xserver: Branch 'master'

Michel Daenzer daenzer at kemper.freedesktop.org
Mon Jun 25 01:53:21 PDT 2007


 hw/xfree86/dri/dri.c |   16 +++++++++-------
 1 files changed, 9 insertions(+), 7 deletions(-)

New commits:
diff-tree edb9ccf3ecb4e35a840aa13815979c5fbd73f32d (from 4c601b904ee6fb01da3343ff9ef00d36f1341fcb)
Author: Michel Dänzer <michel at tungstengraphics.com>
Date:   Mon Jun 25 10:51:38 2007 +0200

    Make sure DRIScreenPrivIndex is -1 when no DRI screen private is allocated.
    
    Fixes https://bugs.freedesktop.org/show_bug.cgi?id=11340 .

diff --git a/hw/xfree86/dri/dri.c b/hw/xfree86/dri/dri.c
index dbc1690..2a53eae 100644
--- a/hw/xfree86/dri/dri.c
+++ b/hw/xfree86/dri/dri.c
@@ -312,12 +312,6 @@ DRIScreenInit(ScreenPtr pScreen, DRIInfo
     DRIEntPrivPtr       pDRIEntPriv;
     ScrnInfoPtr         pScrn = xf86Screens[pScreen->myNum];
 
-    if (DRIGeneration != serverGeneration) {
-	if ((DRIScreenPrivIndex = AllocateScreenPrivateIndex()) < 0)
-	    return FALSE;
-	DRIGeneration = serverGeneration;
-    }
-
     /* If the DRI extension is disabled, do not initialize the DRI */
     if (noXFree86DRIExtension) {
 	DRIDrvMsg(pScreen->myNum, X_WARNING,
@@ -347,9 +341,16 @@ DRIScreenInit(ScreenPtr pScreen, DRIInfo
 
     pDRIEntPriv = DRI_ENT_PRIV(pScrn);
 
+    if (DRIGeneration != serverGeneration) {
+	if ((DRIScreenPrivIndex = AllocateScreenPrivateIndex()) < 0)
+	    return FALSE;
+	DRIGeneration = serverGeneration;
+    }
+
     pDRIPriv = (DRIScreenPrivPtr) xcalloc(1, sizeof(DRIScreenPrivRec));
     if (!pDRIPriv) {
         pScreen->devPrivates[DRIScreenPrivIndex].ptr = NULL;
+        DRIScreenPrivIndex = -1;
         return FALSE;
     }
 
@@ -623,7 +624,7 @@ DRICloseScreen(ScreenPtr pScreen)
     DRIEntPrivPtr    pDRIEntPriv = DRI_ENT_PRIV(pScrn);
     Bool closeMaster;
 
-    if (pDRIPriv && pDRIPriv->directRenderingSupport) {
+    if (pDRIPriv) {
 
         pDRIInfo = pDRIPriv->pDriverInfo;
 
@@ -726,6 +727,7 @@ DRICloseScreen(ScreenPtr pScreen)
 
 	xfree(pDRIPriv);
 	pScreen->devPrivates[DRIScreenPrivIndex].ptr = NULL;
+	DRIScreenPrivIndex = -1;
     }
 }
 


More information about the xorg-commit mailing list