summaryrefslogtreecommitdiff
path: root/tests/gem_exec_alignment.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2016-02-05 15:55:40 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2016-02-05 16:13:23 +0000
commit6f7372f6644bed5b615d24bedc06fa84488e3c39 (patch)
tree31c2048848a832a4c929d1b9799b8bc108c3d78a /tests/gem_exec_alignment.c
parentb081257d749b536de857952037ad3d9bbe40ddad (diff)
igt/gem_exec_alignment: Fix off-by-one in buffer objects
When reducing the buffer count to fit into the aperture whilst aligned, remember to adjust the pointer so that the batch is the last object! Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'tests/gem_exec_alignment.c')
-rw-r--r--tests/gem_exec_alignment.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/gem_exec_alignment.c b/tests/gem_exec_alignment.c
index 95494f74..4385297b 100644
--- a/tests/gem_exec_alignment.c
+++ b/tests/gem_exec_alignment.c
@@ -119,7 +119,7 @@ static void many(int fd)
uint64_t factor = alignment / max_alignment;
execbuf.buffer_count = 2*count / factor;
execbuf.buffers_ptr =
- (uintptr_t)(execobj + count - execbuf.buffer_count);
+ (uintptr_t)(execobj + count - execbuf.buffer_count + 1);
}
igt_debug("testing %lld x alignment=%#llx [%db]\n",
@@ -127,7 +127,7 @@ static void many(int fd)
(long long)alignment,
find_last_bit(alignment)-1);
gem_execbuf(fd, &execbuf);
- for(i = count - execbuf.buffer_count; i < count; i++) {
+ for(i = count - execbuf.buffer_count + 1; i < count; i++) {
igt_assert_eq_u64(execobj[i].alignment, alignment);
igt_assert_eq_u64(execobj[i].offset % alignment, 0);
}
@@ -197,7 +197,7 @@ static void single(int fd)
igt_main
{
- int fd;
+ int fd = -1;
igt_fixture
fd = drm_open_driver(DRIVER_INTEL);