rpms/xorg-x11-drv-intel/F-11 intel-2.7-dont-gtt-map-big-objects.patch, NONE, 1.1 xorg-x11-drv-intel.spec, 1.18, 1.19

Kristian Høgsberg krh at fedoraproject.org
Wed May 20 21:16:16 UTC 2009


Author: krh

Update of /cvs/pkgs/rpms/xorg-x11-drv-intel/F-11
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv26385

Modified Files:
	xorg-x11-drv-intel.spec 
Added Files:
	intel-2.7-dont-gtt-map-big-objects.patch 
Log Message:
* Wed May 20 2009  <krh at madara.bos.redhat.com> - 2.7.0-6
- Add intel-2.7-dont-gtt-map-big-objects.patch to avoid mapping big
  gem objects through the GTT (#498131).


intel-2.7-dont-gtt-map-big-objects.patch:

--- NEW FILE intel-2.7-dont-gtt-map-big-objects.patch ---
diff -up xf86-video-intel-2.7.0/src/drmmode_display.c.big-objects xf86-video-intel-2.7.0/src/drmmode_display.c
--- xf86-video-intel-2.7.0/src/drmmode_display.c.big-objects	2009-05-20 11:21:22.000000000 -0400
+++ xf86-video-intel-2.7.0/src/drmmode_display.c	2009-05-20 11:21:22.000000000 -0400
@@ -235,6 +235,8 @@ drmmode_set_mode_major(xf86CrtcPtr crtc,
 		drmmode_output_dpms(output, DPMSModeOn);
 	}
 
+	i830_set_max_gtt_map_size(pScrn);
+
 done:
 	if (!ret) {
 		crtc->x = saved_x;
diff -up xf86-video-intel-2.7.0/src/i830_exa.c.big-objects xf86-video-intel-2.7.0/src/i830_exa.c
--- xf86-video-intel-2.7.0/src/i830_exa.c.big-objects	2009-04-08 19:59:48.000000000 -0400
+++ xf86-video-intel-2.7.0/src/i830_exa.c	2009-05-20 12:27:35.000000000 -0400
@@ -862,10 +862,20 @@ i830_uxa_prepare_access (PixmapPtr pixma
 
 	/* Kernel manages fences at GTT map/fault time */
 	if (i830->kernel_exec_fencing) {
-	    if (drm_intel_gem_bo_map_gtt(bo)) {
-		xf86DrvMsg(scrn->scrnIndex, X_WARNING, "%s: bo map failed\n",
-			   __FUNCTION__);
-		return FALSE;
+	    if (bo->size < i830->max_gtt_map_size) {
+		if (drm_intel_gem_bo_map_gtt(bo)) {
+		    xf86DrvMsg(scrn->scrnIndex, X_WARNING,
+			       "%s: bo map failed\n",
+			       __FUNCTION__);
+		    return FALSE;
+		}
+	    } else {
+		if (dri_bo_map(bo, access == UXA_ACCESS_RW) != 0) {
+		    xf86DrvMsg(scrn->scrnIndex, X_WARNING,
+			       "%s: bo map failed\n",
+			       __FUNCTION__);
+		    return FALSE;
+		}
 	    }
 	    pixmap->devPrivate.ptr = bo->virtual;
 	} else { /* or not... */
@@ -898,7 +908,10 @@ i830_uxa_finish_access (PixmapPtr pixmap
 	}
 
 	if (i830->kernel_exec_fencing)
-	    drm_intel_gem_bo_unmap_gtt(bo);
+	    if (bo->size < i830->max_gtt_map_size)
+		drm_intel_gem_bo_unmap_gtt(bo);
+	    else
+		dri_bo_unmap(bo);
 	else
 	    drm_intel_bo_unpin(bo);
 	pixmap->devPrivate.ptr = NULL;
diff -up xf86-video-intel-2.7.0/src/i830.h.big-objects xf86-video-intel-2.7.0/src/i830.h
--- xf86-video-intel-2.7.0/src/i830.h.big-objects	2009-05-20 11:21:22.000000000 -0400
+++ xf86-video-intel-2.7.0/src/i830.h	2009-05-20 11:21:22.000000000 -0400
@@ -530,6 +530,7 @@ typedef struct _I830Rec {
    int accel_pixmap_offset_alignment;
    int accel_max_x;
    int accel_max_y;
+   int max_gtt_map_size;
 
    I830WriteIndexedByteFunc writeControl;
    I830ReadIndexedByteFunc readControl;
@@ -895,6 +896,7 @@ Bool i830_unbind_all_memory(ScrnInfoPtr 
 unsigned long i830_get_fence_size(I830Ptr pI830, unsigned long size);
 unsigned long i830_get_fence_pitch(I830Ptr pI830, unsigned long pitch, int format);
 unsigned long i830_get_fence_alignment(I830Ptr pI830, unsigned long size);
+void i830_set_max_gtt_map_size(ScrnInfoPtr pScrn);
 
 Bool I830BindAGPMemory(ScrnInfoPtr pScrn);
 Bool I830UnbindAGPMemory(ScrnInfoPtr pScrn);
diff -up xf86-video-intel-2.7.0/src/i830_memory.c.big-objects xf86-video-intel-2.7.0/src/i830_memory.c
--- xf86-video-intel-2.7.0/src/i830_memory.c.big-objects	2009-04-13 16:42:07.000000000 -0400
+++ xf86-video-intel-2.7.0/src/i830_memory.c	2009-05-20 12:35:50.000000000 -0400
@@ -1276,6 +1276,8 @@ i830_allocate_framebuffer(ScrnInfoPtr pS
     if (!pI830->use_drm_mode && pI830->FbBase)
 	memset (pI830->FbBase + front_buffer->offset, 0, size);
 
+    i830_set_max_gtt_map_size(pScrn);
+
     return front_buffer;
 }
 
@@ -1983,6 +1985,7 @@ i830_bind_all_memory(ScrnInfoPtr pScrn)
     }
     if (!pI830->use_drm_mode)
 	i830_update_cursor_offsets(pScrn);
+    i830_set_max_gtt_map_size(pScrn);
 
     return TRUE;
 }
@@ -2067,3 +2070,29 @@ Bool i830_allocate_xvmc_buffer(ScrnInfoP
     return TRUE;
 }
 #endif
+
+void
+i830_set_max_gtt_map_size(ScrnInfoPtr pScrn)
+{
+    I830Ptr pI830 = I830PTR(pScrn);
+    struct drm_i915_gem_get_aperture aperture;
+    int ret;
+
+    /* Default low value in case it gets used during server init. */
+    pI830->max_gtt_map_size = 16 * 1024 * 1024;
+
+    if (!pI830->memory_manager)
+	return;
+
+    ret = ioctl(pI830->drmSubFD, DRM_IOCTL_I915_GEM_GET_APERTURE, &aperture);
+    if (ret == 0) {
+	/* Let objects up get bound up to the size where only 2 would fit in
+	 * the aperture, but then leave slop to account for alignment like
+	 * libdrm does.
+	 */
+	pI830->max_gtt_map_size = aperture.aper_available_size  / 4;
+        xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
+                   "max_gtt_map_size: %dkb.\n", 
+		   pI830->max_gtt_map_size / 1024);
+    }
+}


Index: xorg-x11-drv-intel.spec
===================================================================
RCS file: /cvs/pkgs/rpms/xorg-x11-drv-intel/F-11/xorg-x11-drv-intel.spec,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -p -r1.18 -r1.19
--- xorg-x11-drv-intel.spec	7 May 2009 17:50:27 -0000	1.18
+++ xorg-x11-drv-intel.spec	20 May 2009 21:15:45 -0000	1.19
@@ -7,7 +7,7 @@
 Summary:   Xorg X11 Intel video driver
 Name:      xorg-x11-drv-intel
 Version:   2.7.0
-Release:   5%{?dist}
+Release:   6%{?dist}
 URL:       http://www.x.org
 License:   MIT
 Group:     User Interface/X Hardware Support
@@ -23,11 +23,13 @@ Patch2: copy-fb.patch
 
 # patches from 2.7 branch
 Patch10: intel-2.7-fixes.patch
+Patch11: intel-2.7-dont-gtt-map-big-objects.patch
 
 # needs to be upstreamed
 Patch20: intel-2.6.99.902-kms-get-crtc.patch
 Patch21: intel-2.7.0-lvds-default-modes.patch
 
+
 ExclusiveArch: %{ix86} x86_64 ia64
 
 BuildRequires: autoconf automake libtool
@@ -71,6 +73,9 @@ Debugging tools for Intel graphics chips
 %patch2 -p1 -b .copy-fb
 %patch10 -p1 -b .2.7-fixes
 %patch20 -p1 -b .get-crtc
+
+%patch11 -p1 -b .big-objects
+
 # notyet.  we don't handle switching in and out of tiled front buffer
 # correctly yet, so let's not have people stumble into it more than
 # they have to.
@@ -127,6 +132,10 @@ rm -rf $RPM_BUILD_ROOT
 %{_bindir}/intel_*
 
 %changelog
+* Wed May 20 2009  <krh at madara.bos.redhat.com> - 2.7.0-6
+- Add intel-2.7-dont-gtt-map-big-objects.patch to avoid mapping big
+  gem objects through the GTT (#498131).
+
 * Thu May 07 2009 Adam Jackson <ajax at redhat.com> 2.7.0-5
 - Update intel-gpu-tools
 




More information about the fedora-extras-commits mailing list