xf86-video-intel: 2 commits - src/i830_dri.c src/i830_memory.c

Keith Packard keithp at kemper.freedesktop.org
Sun Oct 19 14:12:47 PDT 2008


 src/i830_dri.c    |    1 -
 src/i830_memory.c |   29 +++++++++++++++++++++--------
 2 files changed, 21 insertions(+), 9 deletions(-)

New commits:
commit c25437a69490b09acff335a81a38aa540f0822f5
Author: Keith Packard <keithp at keithp.com>
Date:   Sun Oct 19 13:39:04 2008 -0700

    Remove accidental 'return;' left at the top of I830DRIInitBuffers
    
    I was testing the behaviour of the XAA-based DRI buffer drawing code for
    tiled buffers and accidentally left I830DRIInitBuffers disabled.
    
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/src/i830_dri.c b/src/i830_dri.c
index 16f3735..286b357 100644
--- a/src/i830_dri.c
+++ b/src/i830_dri.c
@@ -1197,7 +1197,6 @@ I830DRIInitBuffers(WindowPtr pWin, RegionPtr prgn, CARD32 index)
    int nbox;
    int buffer, first_buffer, last_buffer;
 
-   return;
    if (I810_DEBUG & DEBUG_VERBOSE_DRI)
       ErrorF("I830DRIInitBuffers\n");
 
commit ae224be27bb4432f25dae851debea6966bf31261
Author: Keith Packard <keithp at keithp.com>
Date:   Tue Oct 14 14:35:36 2008 -0700

    Check for DRI module before initializing GEM mm
    
    GEM requires the DRI extension module currently, so make sure that is loaded
    (by checking for the DRIQueryVersion symbol) before trying to call it. This
    allows the server to start with the DRI extension disabled.
    
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/src/i830_memory.c b/src/i830_memory.c
index 505564f..b778f39 100644
--- a/src/i830_memory.c
+++ b/src/i830_memory.c
@@ -393,6 +393,7 @@ i830_allocator_init(ScrnInfoPtr pScrn, unsigned long offset, unsigned long size)
     int dri_major, dri_minor, dri_patch;
     struct drm_i915_getparam gp;
     int has_gem;
+    int has_dri;
 #endif
 
     start = xcalloc(1, sizeof(*start));
@@ -431,21 +432,33 @@ i830_allocator_init(ScrnInfoPtr pScrn, unsigned long offset, unsigned long size)
     pI830->memory_list = start;
 
 #ifdef XF86DRI
-    DRIQueryVersion(&dri_major, &dri_minor, &dri_patch);
-
-    has_gem = 0;
-    gp.param = I915_PARAM_HAS_GEM;
-    gp.value = &has_gem;
+    has_gem = FALSE;
+    has_dri = FALSE;
+    
+    if (pI830->directRenderingEnabled &&
+	xf86LoaderCheckSymbol ("DRIQueryVersion"))
+    {
+	DRIQueryVersion(&dri_major, &dri_minor, &dri_patch);
+	has_dri = TRUE;
+    }
 
-    (void)drmCommandWriteRead(pI830->drmSubFD, DRM_I915_GETPARAM,
-			      &gp, sizeof(gp));
+    if (pI830->directRenderingEnabled &&
+	xf86LoaderCheckSymbol ("drmCommandWriteRead"))
+    {
+	has_gem = FALSE;
+	gp.param = I915_PARAM_HAS_GEM;
+	gp.value = &has_gem;
+    
+	(void)drmCommandWriteRead(pI830->drmSubFD, DRM_I915_GETPARAM,
+				  &gp, sizeof(gp));
+    }
 
     /* Now that we have our manager set up, initialize the kernel MM if
      * possible, covering almost all of the aperture.  We need libdri interface
      * 5.4 or newer so we can rely on the lock being held after DRIScreenInit,
      * rather than after DRIFinishScreenInit.
      */
-    if (pI830->directRenderingEnabled && has_gem &&
+    if (pI830->directRenderingEnabled && has_gem && has_dri &&
 	(dri_major > 5 || (dri_major == 5 && dri_minor >= 4)))
     {
 	int mmsize;


More information about the xorg-commit mailing list