[Intel-gfx] [PATCH] gem_pin: Be explicit about GGTT needs

Ben Widawsky benjamin.widawsky at intel.com
Thu Nov 7 05:05:02 CET 2013


This test assumes that using gem_pin will pin in the same address space
used by execbuf. Since pin is for the global GTT only, use the existing
flag to notify i915.ko that the exec object is special.

Cc: Chris Wilson <chris at chris-wilson.co.uk>
Signed-off-by: Ben Widawsky <ben at bwidawsk.net>
---
 tests/gem_pin.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/tests/gem_pin.c b/tests/gem_pin.c
index 273315f..ca48a04 100644
--- a/tests/gem_pin.c
+++ b/tests/gem_pin.c
@@ -45,6 +45,8 @@
 #define BLT_WRITE_ALPHA         (1<<21)
 #define BLT_WRITE_RGB           (1<<20)
 
+#define LOCAL__EXEC_OBJ_NEEDS_GTT (1<<1)
+
 static void exec(int fd, uint32_t handle, uint32_t offset)
 {
 	struct drm_i915_gem_execbuffer2 execbuf;
@@ -63,7 +65,7 @@ static void exec(int fd, uint32_t handle, uint32_t offset)
 	gem_exec[0].relocs_ptr = (uintptr_t) gem_reloc;
 	gem_exec[0].alignment = 0;
 	gem_exec[0].offset = 0;
-	gem_exec[0].flags = 0;
+	gem_exec[0].flags = LOCAL__EXEC_OBJ_NEEDS_GTT;
 	gem_exec[0].rsvd1 = 0;
 	gem_exec[0].rsvd2 = 0;
 
-- 
1.8.4.2




More information about the Intel-gfx mailing list