rpms/kernel/F-11 drm-intel-set-domain-on-fault.patch, NONE, 1.1 kernel.spec, 1.1627, 1.1628

Kristian Høgsberg krh at fedoraproject.org
Wed May 27 20:56:09 UTC 2009


Author: krh

Update of /cvs/pkgs/rpms/kernel/F-11
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv27903

Modified Files:
	kernel.spec 
Added Files:
	drm-intel-set-domain-on-fault.patch 
Log Message:
* Wed May 27 2009  <krh at redhat.com> - 2.6.29.4-166
- Add drm-intel-set-domain-on-fault.patch to fix random gem object
  corruption when swapping (495323 and probably others).
- Enable kms on 845 and 855 as well, Erics tiling patch should fix
  those too.


drm-intel-set-domain-on-fault.patch:

--- NEW FILE drm-intel-set-domain-on-fault.patch ---
>From a0243958bc6457ee4c5d4599487930b2b5fe9912 Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Kristian=20H=C3=B8gsberg?= <krh at redhat.com>
Date: Wed, 27 May 2009 14:23:50 -0400
Subject: [PATCH] i915: Set object to gtt domain when faulting it back in
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit

When a GEM object is evicted from the GTT we set it to the CPU domain,
as it might get swapped in and out or ever mmapped regularly.  If the
object is mmapped through the GTT it can still get evicted in this way
by other objects requiring GTT space.  When the GTT mapping is touched
again we fault it back into the GTT, but fail to set it back to the
GTT domain.  This means we fail to flush any cached CPU writes to the
pages backing the object which will then happen "eventually", typically
after we write to the page through the uncached GTT mapping.

Signed-off-by: Kristian Høgsberg <krh at redhat.com>
---
 drivers/gpu/drm/i915/i915_gem.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index 4a24c90..2500510 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -1145,6 +1145,13 @@ int i915_gem_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
 			mutex_unlock(&dev->struct_mutex);
 			return VM_FAULT_SIGBUS;
 		}
+
+		ret = i915_gem_object_set_to_gtt_domain(obj, write);
+		if (ret) {
+			mutex_unlock(&dev->struct_mutex);
+			return VM_FAULT_SIGBUS;
+		}
+
 		list_add(&obj_priv->list, &dev_priv->mm.inactive_list);
 	}
 
-- 
1.6.2.2



Index: kernel.spec
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/F-11/kernel.spec,v
retrieving revision 1.1627
retrieving revision 1.1628
diff -u -p -r1.1627 -r1.1628
--- kernel.spec	27 May 2009 20:12:00 -0000	1.1627
+++ kernel.spec	27 May 2009 20:55:37 -0000	1.1628
@@ -712,6 +712,7 @@ Patch1835: drm-copyback-ioctl-data-to-us
 Patch1836: drm-intel-disable-kms-i8xx.patch
 Patch1837: drm-i915-apply-a-big-hammer-to-865-gem-object.patch
 Patch1838: drm-i915-fix-tiling-pitch.patch
+Patch1839: drm-intel-set-domain-on-fault.patch
 
 # kludge to make ich9 e1000 work
 Patch2000: linux-2.6-e1000-ich9.patch
@@ -1390,6 +1391,7 @@ ApplyPatch drm-copyback-ioctl-data-to-us
 ApplyPatch drm-intel-disable-kms-i8xx.patch
 ApplyPatch drm-i915-apply-a-big-hammer-to-865-gem-object.patch
 ApplyPatch drm-i915-fix-tiling-pitch.patch
+ApplyPatch drm-intel-set-domain-on-fault.patch
 
 # linux1394 git patches
 ApplyPatch linux-2.6-firewire-git-update.patch
@@ -2016,6 +2018,12 @@ fi
 # and build.
 
 %changelog
+* Wed May 27 2009  <krh at redhat.com> - 2.6.29.4-166
+- Add drm-intel-set-domain-on-fault.patch to fix random gem object
+  corruption when swapping (495323 and probably others).
+- Enable kms on 845 and 855 as well, Erics tiling patch should fix
+  those too.
+
 * Wed May 27 2009 Kyle McMartin <kyle at redhat.com> 2.6.29.4-165
 - Enable KMS/gem on I865.
 - drm-no-gem-on-i8xx.patch: Remove I865 so GEM will be enabled.




More information about the scm-commits mailing list