summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorBen Widawsky <benjamin.widawsky@intel.com>2013-12-24 13:12:31 -0800
committerBen Widawsky <benjamin.widawsky@intel.com>2013-12-24 13:12:31 -0800
commit72fe2b641488fcc01d48187fe1642337ce61cef0 (patch)
tree79fcf6d9a10a46b6055cc55aebfdb99230ed41c4 /tests
parent94b2b861f5e2cd3dd5e32459174c9fdc3c3b0d8b (diff)
gem_exec_blit: gen8 updates for blit
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
Diffstat (limited to 'tests')
-rw-r--r--tests/gem_exec_blt.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/tests/gem_exec_blt.c b/tests/gem_exec_blt.c
index 4fe1d476..ea8c46c3 100644
--- a/tests/gem_exec_blt.c
+++ b/tests/gem_exec_blt.c
@@ -65,6 +65,8 @@ static int gem_linear_blt(int fd,
if (height) {
int i = 0;
b[i++] = COPY_BLT_CMD | BLT_WRITE_ALPHA | BLT_WRITE_RGB;
+ if (intel_gen(intel_get_drm_devid(fd)) >= 8)
+ b[i-1]+=2;
b[i++] = 0xcc << 16 | 1 << 25 | 1 << 24 | (16*1024);
b[i++] = 0;
b[i++] = height << 16 | (4*1024);
@@ -83,6 +85,8 @@ static int gem_linear_blt(int fd,
b[i++] = 16*1024;
b[i++] = 0;
reloc->offset = (b-batch+7) * sizeof(uint32_t);
+ if (intel_gen(intel_get_drm_devid(fd)) >= 8)
+ reloc->offset += sizeof(uint32_t);
reloc->delta = 0;
reloc->target_handle = src;
reloc->read_domains = I915_GEM_DOMAIN_RENDER;
@@ -99,6 +103,8 @@ static int gem_linear_blt(int fd,
if (length) {
int i = 0;
b[i++] = COPY_BLT_CMD | BLT_WRITE_ALPHA | BLT_WRITE_RGB;
+ if (intel_gen(intel_get_drm_devid(fd)) >= 8)
+ b[i-1]+=2;
b[i++] = 0xcc << 16 | 1 << 25 | 1 << 24 | (16*1024);
b[i++] = height << 16;
b[i++] = (1+height) << 16 | (length / 4);
@@ -117,6 +123,8 @@ static int gem_linear_blt(int fd,
b[i++] = 16*1024;
b[i++] = 0;
reloc->offset = (b-batch+7) * sizeof(uint32_t);
+ if (intel_gen(intel_get_drm_devid(fd)) >= 8)
+ reloc->offset += sizeof(uint32_t);
reloc->delta = 0;
reloc->target_handle = src;
reloc->read_domains = I915_GEM_DOMAIN_RENDER;
@@ -199,7 +207,10 @@ static void run(int object_size)
exec[1].rsvd2 = 0;
exec[2].handle = handle;
- exec[2].relocation_count = len > 40 ? 4 : 2;
+ if (intel_gen(intel_get_drm_devid(fd)) >= 8)
+ exec[2].relocation_count = len > 56 ? 4 : 2;
+ else
+ exec[2].relocation_count = len > 40 ? 4 : 2;
exec[2].relocs_ptr = (uintptr_t)reloc;
exec[2].alignment = 0;
exec[2].offset = 0;