[Intel-gfx] [PATCH 2/2] drm/i915: Assume size & 1 means WO map (hack)

Ben Widawsky ben at bwidawsk.net
Fri Aug 12 02:47:26 CEST 2011


Signed-off-by: Ben Widawsky <ben at bwidawsk.net>
---
 drivers/gpu/drm/i915/i915_gem.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index a546a71..8e14fbe 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -1156,6 +1156,11 @@ i915_gem_mmap_ioctl(struct drm_device *dev, void *data,
 		return -E2BIG;
 	}
 
+	if (args->offset & 1) {
+		atomic_set(&(to_intel_bo(obj)->always_cpu_dirty), 1);
+		args->offset -= 1;
+	}
+
 	down_write(&current->mm->mmap_sem);
 	addr = do_mmap(obj->filp, 0, args->size,
 		       PROT_READ | PROT_WRITE, MAP_SHARED,
-- 
1.7.6




More information about the Intel-gfx mailing list