Skip to contentSkip to conversation

lib/igt_draw: move to the GTT domain before using GTT mmaps

PATCH In review Paulo Zanoni 2 participants 2 messages Jun 25, 2015 Library code

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 lib/igt_draw: move to the GTT domain before using GTT mmaps

From: Paulo Zanoni <[email protected]>

With this, we don't need to worry about what happened to the buffer before.

---
 lib/igt_draw.c | 5 +++++
 1 file changed, 5 insertions(+)
lib/igt_draw.c +5 -0
index 51dce4b..fb9294d 100644
@@ -262,6 +262,9 @@ static void draw_rect_mmap_gtt(int fd, struct buf_data *buf, struct rect *rect,
 {
 	uint32_t *ptr;
 
+	gem_set_domain(fd, buf->handle, I915_GEM_DOMAIN_GTT,
+		       I915_GEM_DOMAIN_GTT);
+
 	ptr = gem_mmap__gtt(fd, buf->handle, buf->size, PROT_READ | PROT_WRITE);
 	igt_assert(ptr);
 
@@ -276,6 +279,8 @@ static void draw_rect_mmap_wc(int fd, struct buf_data *buf, struct rect *rect,
 	uint32_t *ptr;
 	uint32_t tiling, swizzle;
 
+	gem_set_domain(fd, buf->handle, I915_GEM_DOMAIN_GTT,
+		       I915_GEM_DOMAIN_GTT);
 	gem_get_tiling(fd, buf->handle, &tiling, &swizzle);
 
 	/* We didn't implement suport for the older tiling methods yet. */
Signature · 6 lines
2.1.4

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · Paulo Zanoni

From: Paulo Zanoni <[email protected]>

With this, we don't need to worry about what happened to the buffer before.

-Chris

Signature · 5 lines
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx