diff options
Diffstat (limited to 'tests/gem_exec_faulting_reloc.c')
-rw-r--r-- | tests/gem_exec_faulting_reloc.c | 34 |
1 files changed, 18 insertions, 16 deletions
diff --git a/tests/gem_exec_faulting_reloc.c b/tests/gem_exec_faulting_reloc.c index d25bd5ef..ef801ed4 100644 --- a/tests/gem_exec_faulting_reloc.c +++ b/tests/gem_exec_faulting_reloc.c @@ -67,11 +67,12 @@ static int gem_linear_blt(uint32_t *batch, igt_assert(height <= 1<<16); if (height) { - b[0] = COPY_BLT_CMD | BLT_WRITE_ALPHA | BLT_WRITE_RGB; - b[1] = 0xcc << 16 | 1 << 25 | 1 << 24 | (16*1024); - b[2] = 0; - b[3] = height << 16 | (4*1024); - b[4] = 0; + int i = 0; + b[i++] = COPY_BLT_CMD | BLT_WRITE_ALPHA | BLT_WRITE_RGB; + b[i++] = 0xcc << 16 | 1 << 25 | 1 << 24 | (16*1024); + b[i++] = 0; + b[i++] = height << 16 | (4*1024); + b[i++] = 0; reloc->offset = (b-batch+4) * sizeof(uint32_t); reloc->delta = 0; reloc->target_handle = dst; @@ -80,9 +81,9 @@ static int gem_linear_blt(uint32_t *batch, reloc->presumed_offset = 0; reloc++; - b[5] = 0; - b[6] = 16*1024; - b[7] = 0; + b[i++] = 0; + b[i++] = 16*1024; + b[i++] = 0; reloc->offset = (b-batch+7) * sizeof(uint32_t); reloc->delta = 0; reloc->target_handle = src; @@ -96,11 +97,12 @@ static int gem_linear_blt(uint32_t *batch, } if (length) { - b[0] = COPY_BLT_CMD | BLT_WRITE_ALPHA | BLT_WRITE_RGB; - b[1] = 0xcc << 16 | 1 << 25 | 1 << 24 | (16*1024); - b[2] = height << 16; - b[3] = (1+height) << 16 | (length / 4); - b[4] = 0; + int i = 0; + b[i++] = COPY_BLT_CMD | BLT_WRITE_ALPHA | BLT_WRITE_RGB; + b[i++] = 0xcc << 16 | 1 << 25 | 1 << 24 | (16*1024); + b[i++] = height << 16; + b[i++] = (1+height) << 16 | (length / 4); + b[i++] = 0; reloc->offset = (b-batch+4) * sizeof(uint32_t); reloc->delta = 0; reloc->target_handle = dst; @@ -109,9 +111,9 @@ static int gem_linear_blt(uint32_t *batch, reloc->presumed_offset = 0; reloc++; - b[5] = height << 16; - b[6] = 16*1024; - b[7] = 0; + b[i++] = height << 16; + b[i++] = 16*1024; + b[i++] = 0; reloc->offset = (b-batch+7) * sizeof(uint32_t); reloc->delta = 0; reloc->target_handle = src; |