diff options
author | Kevin E Martin <kem@kem.org> | 2004-06-30 20:06:56 +0000 |
---|---|---|
committer | Kevin E Martin <kem@kem.org> | 2004-06-30 20:06:56 +0000 |
commit | 7976ee51afcad41b611e642d2feb31d805dedcf6 (patch) | |
tree | 218e5c900399e880dd01458154896d011a2ff238 /Xext | |
parent | d5db59bd79f5d8788b99056bf9d969b5b3ad99e1 (diff) |
Add Distributed Multihead X (DMX) support
Diffstat (limited to 'Xext')
-rw-r--r-- | Xext/panoramiX.c | 107 | ||||
-rw-r--r-- | Xext/panoramiXsrv.h | 2 |
2 files changed, 72 insertions, 37 deletions
diff --git a/Xext/panoramiX.c b/Xext/panoramiX.c index d9e36d47e..90afc2b3d 100644 --- a/Xext/panoramiX.c +++ b/Xext/panoramiX.c @@ -53,6 +53,12 @@ Equipment Corporation. #include "modinit.h" +#ifdef GLXPROXY +extern VisualPtr glxMatchVisual(ScreenPtr pScreen, + VisualPtr pVisual, + ScreenPtr pMatchScreen); +#endif + #if 0 static unsigned char PanoramiXReqCode = 0; #endif @@ -416,6 +422,56 @@ XineramaRegisterConnectionBlockCallback(void (*func)(void)) return TRUE; } +static void XineramaInitData(ScreenPtr pScreen) +{ + int i, w, h; + + REGION_NULL(pScreen, &PanoramiXScreenRegion) + for (i = 0; i < PanoramiXNumScreens; i++) { + BoxRec TheBox; + + pScreen = screenInfo.screens[i]; + + panoramiXdataPtr[i].x = dixScreenOrigins[i].x; + panoramiXdataPtr[i].y = dixScreenOrigins[i].y; + panoramiXdataPtr[i].width = pScreen->width; + panoramiXdataPtr[i].height = pScreen->height; + + TheBox.x1 = panoramiXdataPtr[i].x; + TheBox.x2 = TheBox.x1 + panoramiXdataPtr[i].width; + TheBox.y1 = panoramiXdataPtr[i].y; + TheBox.y2 = TheBox.y1 + panoramiXdataPtr[i].height; + + REGION_INIT(pScreen, &XineramaScreenRegions[i], &TheBox, 1); + REGION_UNION(pScreen, &PanoramiXScreenRegion, &PanoramiXScreenRegion, + &XineramaScreenRegions[i]); + } + + PanoramiXPixWidth = panoramiXdataPtr[0].x + panoramiXdataPtr[0].width; + PanoramiXPixHeight = panoramiXdataPtr[0].y + panoramiXdataPtr[0].height; + + for (i = 1; i < PanoramiXNumScreens; i++) { + w = panoramiXdataPtr[i].x + panoramiXdataPtr[i].width; + h = panoramiXdataPtr[i].y + panoramiXdataPtr[i].height; + + if (PanoramiXPixWidth < w) + PanoramiXPixWidth = w; + if (PanoramiXPixHeight < h) + PanoramiXPixHeight = h; + } +} + +void XineramaReinitData(ScreenPtr pScreen) +{ + int i; + + REGION_UNINIT(pScreen, &PanoramiXScreenRegion); + for (i = 0; i < PanoramiXNumScreens; i++) + REGION_UNINIT(pScreen, &XineramaScreenRegions[i]); + + XineramaInitData(pScreen); +} + /* * PanoramiXExtensionInit(): * Called from InitExtensions in main(). @@ -430,8 +486,7 @@ void PanoramiXExtensionInit(int argc, char *argv[]) ExtensionEntry *extEntry; ScreenPtr pScreen = screenInfo.screens[0]; PanoramiXScreenPtr pScreenPriv; - int w, h; - + if (noPanoramiXExtension) return; @@ -509,41 +564,7 @@ void PanoramiXExtensionInit(int argc, char *argv[]) return; } - - REGION_NULL(pScreen, &PanoramiXScreenRegion); - for (i = 0; i < PanoramiXNumScreens; i++) { - BoxRec TheBox; - - pScreen = screenInfo.screens[i]; - - panoramiXdataPtr[i].x = dixScreenOrigins[i].x; - panoramiXdataPtr[i].y = dixScreenOrigins[i].y; - panoramiXdataPtr[i].width = pScreen->width; - panoramiXdataPtr[i].height = pScreen->height; - - TheBox.x1 = panoramiXdataPtr[i].x; - TheBox.x2 = TheBox.x1 + panoramiXdataPtr[i].width; - TheBox.y1 = panoramiXdataPtr[i].y; - TheBox.y2 = TheBox.y1 + panoramiXdataPtr[i].height; - - REGION_INIT(pScreen, &XineramaScreenRegions[i], &TheBox, 1); - REGION_UNION(pScreen, &PanoramiXScreenRegion, &PanoramiXScreenRegion, - &XineramaScreenRegions[i]); - } - - - PanoramiXPixWidth = panoramiXdataPtr[0].x + panoramiXdataPtr[0].width; - PanoramiXPixHeight = panoramiXdataPtr[0].y + panoramiXdataPtr[0].height; - - for (i = 1; i < PanoramiXNumScreens; i++) { - w = panoramiXdataPtr[i].x + panoramiXdataPtr[i].width; - h = panoramiXdataPtr[i].y + panoramiXdataPtr[i].height; - - if(PanoramiXPixWidth < w) - PanoramiXPixWidth = w; - if(PanoramiXPixHeight < h) - PanoramiXPixHeight = h; - } + XineramaInitData(pScreen); /* * Put our processes into the ProcVector @@ -789,6 +810,18 @@ void PanoramiXConsolidate(void) /* check if the visual exists on all screens */ for (j = 1; j < PanoramiXNumScreens; j++) { pScreen2 = screenInfo.screens[j]; + +#ifdef GLXPROXY + pVisual2 = glxMatchVisual(pScreen, pVisual, pScreen2); + if (pVisual2) { + PanoramiXVisualTable[(pVisual->vid * MAXSCREENS) + j] = + pVisual2->vid; + continue; + } else if (glxMatchVisual(pScreen, pVisual, pScreen)) { + PanoramiXVisualTable[(pVisual->vid * MAXSCREENS) + j] = 0; + break; + } +#endif pVisual2 = pScreen2->visuals; for (k = 0; k < pScreen2->numVisuals; k++, pVisual2++) { diff --git a/Xext/panoramiXsrv.h b/Xext/panoramiXsrv.h index 1d187bc27..92800062e 100644 --- a/Xext/panoramiXsrv.h +++ b/Xext/panoramiXsrv.h @@ -20,6 +20,8 @@ extern WindowPtr PanoramiXChangeWindow(int, WindowPtr); extern Bool XineramaRegisterConnectionBlockCallback(void (*func)(void)); extern int XineramaDeleteResource(pointer, XID); +extern void XineramaReinitData(ScreenPtr); + extern RegionRec XineramaScreenRegions[MAXSCREENS]; extern unsigned long XRC_DRAWABLE; |