From 9527e660fabf01eb76753a3c0a5f4e6c48a14e02 Mon Sep 17 00:00:00 2001 From: David Reveman Date: Tue, 18 Apr 2006 22:12:19 +0000 Subject: [PATCH] Fix for running multiple Xgl servers --- ChangeLog | 8 ++++++++ hw/xgl/glx/xglx.c | 5 ++++- hw/xgl/glx/xglx.h | 2 +- hw/xgl/glx/xglxorg.c | 15 ++++++++++++--- 4 files changed, 25 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index beb7f777e..d427176e0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2006-04-19 David Reveman + + * hw/xgl/glx/xglx.c: Pass display offset to xglxInitXorg. + + * hw/xgl/glx/xglx.h: + * hw/xgl/glx/xglxorg.c: Use offset for xorg display so that more than + one server can be started. + 2006-04-18 David Reveman * fb/fbmmx.c (fbCompositeSrc_yv12x8888mmx): Translate U, V start diff --git a/hw/xgl/glx/xglx.c b/hw/xgl/glx/xglx.c index f2f42239f..1eab9fe2a 100644 --- a/hw/xgl/glx/xglx.c +++ b/hw/xgl/glx/xglx.c @@ -136,6 +136,7 @@ static ScreenPtr currentScreen = 0; static Bool softCursor = FALSE; static Bool fullscreen = TRUE; static Bool xDpms = FALSE; +static int displayOffset = 0; static Bool randrExtension = FALSE; static int randrEvent, randrError; @@ -1388,6 +1389,8 @@ xglxProcessArgument (int argc, if (xDisplayName) fullscreen = FALSE; + displayOffset = atoi (display + 1); + checkDisplayName = TRUE; } @@ -1447,7 +1450,7 @@ xglxOsVendorInit (void) char *name = xDisplayName; if (!name) - name = xglxInitXorg (); + name = xglxInitXorg (displayOffset); xdisplay = XOpenDisplay (name); if (!xdisplay) diff --git a/hw/xgl/glx/xglx.h b/hw/xgl/glx/xglx.h index 79fa09d62..06210545a 100644 --- a/hw/xgl/glx/xglx.h +++ b/hw/xgl/glx/xglx.h @@ -140,7 +140,7 @@ void xglxAbortXorg (void); char * -xglxInitXorg (void); +xglxInitXorg (int displayOffset); #endif diff --git a/hw/xgl/glx/xglxorg.c b/hw/xgl/glx/xglxorg.c index fff9d16a1..60d104d1d 100644 --- a/hw/xgl/glx/xglxorg.c +++ b/hw/xgl/glx/xglxorg.c @@ -55,8 +55,11 @@ static char *xorgAuth = NULL; static char *xorgProgs[] = { "/usr/bin/Xorg", "/usr/X11R6/bin/Xorg" }; static char *xorgProg = NULL; -static char *xorgDisplay = ":93"; -static char *xorgTerminate = "-terminate"; +static char xorgDisplayBuf[256]; +static char *xorgDisplay = NULL; +static int xorgDisplayOffset = 93; + +static char *xorgTerminate = "-terminate"; static pid_t xorgPid = 0; static int receivedUsr1 = 0; @@ -538,7 +541,7 @@ xglxSetupAuth (char *name, int authFd) } char * -xglxInitXorg (void) +xglxInitXorg (int displayOffset) { sighandler_t oldSigUsr1; pid_t pid; @@ -591,6 +594,12 @@ xglxInitXorg (void) if (!xglxAddXorgArguments (auth, sizeof (auth) / sizeof (char *))) return 0; + if (!xorgDisplay) + { + xorgDisplay = xorgDisplayBuf; + sprintf (xorgDisplay, ":%d", xorgDisplayOffset + displayOffset); + } + if (!xglxAddXorgArguments (&xorgDisplay, 1)) return 0;