xf86-video-intel: Branch 'intel-batchbuffer' - 2 commits - src/i830_driver.c src/i830_exa.c

Kristian Høgsberg krh at kemper.freedesktop.org
Mon Apr 14 12:24:18 PDT 2008


 src/i830_driver.c |    5 ++---
 src/i830_exa.c    |   10 +++++++---
 2 files changed, 9 insertions(+), 6 deletions(-)

New commits:
commit ebf6797d306b4eda044ad45fa0d4d4970386174f
Author: Michel Dänzer <michel at tungstengraphics.com>
Date:   Thu Apr 10 19:44:17 2008 +0200

    Take the DRI2 lock before mapping a pixmap for a software fallback.
    
    Fixes a race condition which could cause compiz with direct rendering to fail
    the superioctl when the BO was already mapped.

diff --git a/src/i830_exa.c b/src/i830_exa.c
index e3b9db5..2d916b4 100644
--- a/src/i830_exa.c
+++ b/src/i830_exa.c
@@ -489,6 +489,8 @@ static Bool I830EXAPrepareAccess(PixmapPtr pPix, int index)
     if (!driver_priv)
 	return FALSE;
 
+    dri2Lock(pPix);
+
     if (driver_priv->bo) {
 	mmDebug("mapping %p %d %dx%d\n", pPix, driver_priv->flags, pPix->drawable.width, pPix->drawable.height);
 
@@ -497,15 +499,17 @@ static Bool I830EXAPrepareAccess(PixmapPtr pPix, int index)
 	ret = dri_bo_map(driver_priv->bo, TRUE);
 	if (ret) {
 	    FatalError("Failed to map pixmap: %s\n", strerror(-ret));
-	    return FALSE;
+	    goto error;
 	}
 
 	pPix->devPrivate.ptr = driver_priv->bo->virtual;
     }
 
-    dri2Lock(pPix);
-
     return TRUE;
+
+error:
+    dri2Unlock(pPix);
+    return FALSE;
 }
 
 static void I830EXAFinishAccess(PixmapPtr pPix, int index)
commit 6772ccac5851bba030339b77ffa97dfeb1c94fba
Author: Kristian Høgsberg <krh at redhat.com>
Date:   Fri Apr 11 12:54:11 2008 -0400

    Use xf86DRI2Enabled() instead of a driver option.
    
    This allows us to enable and disable DRI2 in the serverflags or serverlayout
    sections of the config file, and lets us disable the server side
    module and driver support in one place.

diff --git a/src/i830_driver.c b/src/i830_driver.c
index c4bcee0..18c6a6a 100644
--- a/src/i830_driver.c
+++ b/src/i830_driver.c
@@ -1748,8 +1748,7 @@ I830PreInit(ScrnInfoPtr pScrn, int flags)
 
 #if defined(DRI2)
    /* Load the dri2 module if requested. */
-   if (xf86ReturnOptValBool(pI830->Options, OPTION_DRI2, FALSE) &&
-       !pI830->directRenderingDisabled) {
+   if (xf86DRI2Enabled() && !pI830->directRenderingDisabled) {
        xf86LoadSubModule(pScrn, "dri2");
    }
 #endif
@@ -2476,7 +2475,7 @@ I830ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
 
    pI830->directRendering = DRI_TYPE_NONE;
 #ifdef DRI2
-   if (xf86ReturnOptValBool(pI830->Options, OPTION_DRI2, FALSE))
+   if (xf86DRI2Enabled())
        I830DRI2Prepare(pScreen);
 #endif
 


More information about the xorg-commit mailing list