xf86-video-intel: 2 commits - src/i830_driver.c src/i830_uxa.c

Eric Anholt anholt at kemper.freedesktop.org
Wed Jul 8 09:18:40 PDT 2009


 src/i830_driver.c |    1 +
 src/i830_uxa.c    |   16 ++++++++++++++++
 2 files changed, 17 insertions(+)

New commits:
commit 40e7c9505265823786cf730214db84812a5e494e
Author: Eric Anholt <eric at anholt.net>
Date:   Mon Jul 6 11:54:50 2009 -0700

    Refuse to allocate giant BOs on 32-bit systems.
    
    The overcommit of address space combined with these buffers hitting SW
    fallbacks all the time means that we're probably better off telling the
    application "no" instead of likely silently failing later.
    
    Bug #22601.

diff --git a/src/i830_uxa.c b/src/i830_uxa.c
index eb35014..ef7ac84 100644
--- a/src/i830_uxa.c
+++ b/src/i830_uxa.c
@@ -627,6 +627,22 @@ i830_uxa_create_pixmap (ScreenPtr screen, int w, int h, int depth, unsigned usag
 	     * with drm_intel_bufmgr_check_aperture().
 	     */
 	    size = i830_get_fence_size(i830, stride * h);
+	    assert(size >= stride * h);
+	}
+
+	/* Fail very large allocations on 32-bit systems.  Large BOs will
+	 * tend to hit SW fallbacks frequently, and also will tend to fail
+	 * to successfully map when doing SW fallbacks because we overcommit
+	 * address space for BO access.
+	 *
+	 * Note that size should fit in 32 bits.  We throw out >32767x32767x4,
+	 * and pitch alignment could get us up to 32768x32767x4.
+	 */
+	if (sizeof(unsigned int) == 4 &&
+	    size > (unsigned int)(1024 * 1024 * 1024))
+	{
+	    fbDestroyPixmap (pixmap);
+	    return NullPixmap;
 	}
 
 	bo = drm_intel_bo_alloc_for_render(i830->bufmgr, "pixmap", size, 0);
commit 6337cd23e692cae789d07f429442c425c18e1d4f
Author: Eric Anholt <eric at anholt.net>
Date:   Wed Jul 1 15:54:38 2009 -0700

    Initialize the other argument to drmSetInterfaceVersion.
    
    The kernel ignores it if dd_major is -1, anyway.

diff --git a/src/i830_driver.c b/src/i830_driver.c
index 8986368..257bd6c 100644
--- a/src/i830_driver.c
+++ b/src/i830_driver.c
@@ -1460,6 +1460,7 @@ i830_open_drm_master(ScrnInfoPtr scrn)
     sv.drm_di_major = 1;
     sv.drm_di_minor = 1;
     sv.drm_dd_major = -1;
+    sv.drm_dd_minor = -1;
     err = drmSetInterfaceVersion(i830->drmSubFD, &sv);
     if (err != 0) {
 	xf86DrvMsg(scrn->scrnIndex, X_ERROR,


More information about the xorg-commit mailing list