[PATCH i-g-t v2 1/2] tests/gem_mmap_gtt: Clarify BO domain setting functions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Add suffix and complementary function for CPU domain.

Signed-off-by: Joonas Lahtinen <joonas.lahtinen@xxxxxxxxxxxxxxx>
---
 tests/gem_mmap_gtt.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/tests/gem_mmap_gtt.c b/tests/gem_mmap_gtt.c
index 55c66a2..d2803d7 100644
--- a/tests/gem_mmap_gtt.c
+++ b/tests/gem_mmap_gtt.c
@@ -43,11 +43,16 @@
 
 static int OBJECT_SIZE = 16*1024*1024;
 
-static void set_domain(int fd, uint32_t handle)
+static void set_domain_gtt(int fd, uint32_t handle)
 {
 	gem_set_domain(fd, handle, I915_GEM_DOMAIN_GTT, I915_GEM_DOMAIN_GTT);
 }
 
+static void set_domain_cpu(int fd, uint32_t handle)
+{
+	gem_set_domain(fd, handle, I915_GEM_DOMAIN_CPU, I915_GEM_DOMAIN_CPU);
+}
+
 static void *
 mmap_bo(int fd, uint32_t handle)
 {
@@ -245,7 +250,7 @@ test_write_gtt(int fd)
 
 	/* prefault object into gtt */
 	dst_gtt = mmap_bo(fd, dst);
-	set_domain(fd, dst);
+	set_domain_gtt(fd, dst);
 	memset(dst_gtt, 0, OBJECT_SIZE);
 	munmap(dst_gtt, OBJECT_SIZE);
 
-- 
1.9.3



_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/intel-gfx





[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux