diff options
author | Paulo Zanoni <paulo.r.zanoni@intel.com> | 2015-06-25 14:19:24 -0300 |
---|---|---|
committer | Paulo Zanoni <paulo.r.zanoni@intel.com> | 2015-06-26 17:36:47 -0300 |
commit | e86557ca9fa24bb3c73a8168b0866169f7606d0c (patch) | |
tree | 12b601dc64d85380fb66b4cd3f1573871c74c871 /lib/igt_draw.c | |
parent | 6cc553adf298e6244fbdb5fe03841c00ddda29ad (diff) |
lib/igt_draw: move to the GTT domain before using GTT mmaps
With this, we don't need to worry about what happened to the buffer
before.
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Diffstat (limited to 'lib/igt_draw.c')
-rw-r--r-- | lib/igt_draw.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/igt_draw.c b/lib/igt_draw.c index 51dce4b6..fb9294d8 100644 --- a/lib/igt_draw.c +++ b/lib/igt_draw.c @@ -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. */ |