Xephyr: port XV/GL stuff of the new multiscreen architecture

We can now launch GL or XV apps in any of the
        Xephyr screens we want.

	* hw/kdrive/ephyr/hostx.c,h:
	 (hostx_get_window):
	 (hostx_create_window): make these functions be screen
	 number aware.
	* hw/kdrive/ephyr/XF86dri.c : fix some compiler warnings.
	* hw/kdrive/ephyr/ephyrdri.c:
	 (ephyrDRIQueryDirectRenderingCapable),
	 (ephyrDRIOpenConnection),
	 (ephyrDRIAuthConnection),
	 (ephyrDRICloseConnection),
	 (ephyrDRIGetClientDriverName),
	 (ephyrDRICreateContext),
	 (ephyrDRIDestroyContext),
	 (ephyrDRICreateDrawable),
	 (ephyrDRIGetDrawableInfo),
	 (ephyrDRIGetDeviceInfo): in all those functions, don't forward
	 the screen number we receive - from the client - to the host X.
	 We (Xephyr) are always targetting the same X display screen, which is
	 the one Xephyr got launched against. So we enforce that in the code.
	* hw/kdrive/ephyr/ephyrdriext.c:
	 (EphyrMirrorHostVisuals): make this duplicate the visuals of the host X
	  default screen into a given Xephyr screen. This way we have a chance
	  to update the visuals of all Xephyr screen to make them mirror those
	  of the host X.
	 (many other places): specify screen number where required by the api
	 change in hostx.h.
	* hw/kdrive/ephyr/ephyrglxext.c: specify screen number where required
	 by the api change in hostx.h
	* hw/kdrive/ephyr/ephyrhostglx.c: don't forward the screen number we
	  receive - from the client - to the host X.
	  We (Xephyr) are always targetting the same
	  X display screen, which is
	 the one Xephyr got launched against. So we enforce that in the code.
	* hw/kdrive/ephyr/ephyrhostvideo.c,h: take in account the screen number received
	  from the client app. This is useful to know on which Xephyr screen we
	  need to display video stuff.
	* hw/kdrive/ephyr/ephyrvideo.c: update this to reflect the API change
	  in hw/kdrive/ephyr/ephyrhostvideo.h.
	  (ephyrSetPortAttribute): when parameters are not valid
	   - they exceed their validity range - send them to the host anyway
	   and do not return an error to clients.
	  Some host expose buggy validity range, so rejecting client for that
	  is too harsh.
This commit is contained in:
Dodji Seketeli 2007-10-03 13:03:34 +02:00
commit 4ba76a7e2b
10 changed files with 123 additions and 63 deletions

View file

@ -978,9 +978,13 @@ hostx_get_display(void)
}
int
hostx_get_window(void)
hostx_get_window (int a_screen_number)
{
return HostX.win ;
if (a_screen_number < 0 || a_screen_number >= HostX.n_screens) {
EPHYR_LOG_ERROR ("bad screen number:%d\n", a_screen_number) ;
return 0;
}
return HostX.screens[a_screen_number].win ;
}
int
@ -1085,7 +1089,8 @@ static ResourcePair resource_peers[RESOURCE_PEERS_SIZE] ;
int
hostx_create_window (EphyrBox *a_geometry,
hostx_create_window (int a_screen_number,
EphyrBox *a_geometry,
int a_visual_id,
int *a_host_peer /*out parameter*/)
{
@ -1120,7 +1125,7 @@ hostx_create_window (EphyrBox *a_geometry,
AllocNone) ;
winmask = CWColormap;
win = XCreateWindow (dpy, hostx_get_window (),
win = XCreateWindow (dpy, hostx_get_window (a_screen_number),
a_geometry->x, a_geometry->y,
a_geometry->width, a_geometry->height, 0,
visual_info->depth, InputOutput,