[igt-dev] [PATCH i-g-t v2 1/2] tests/gem_*: Fix release offsets

Zbigniew Kempczyński zbigniew.kempczynski at intel.com
Mon Dec 19 11:58:33 UTC 2022


After changing reloc allocator to track offsets allocations all
shortcommings started to be visible. Release offsets requires
handles, not offsets so fix this in the tests.

Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski at intel.com>
Cc: Kamil Konieczny <kamil.konieczny at linux.intel.com>
---
 tests/i915/gem_blits.c         | 12 ++++++------
 tests/i915/gem_ctx_isolation.c |  6 +++---
 2 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/tests/i915/gem_blits.c b/tests/i915/gem_blits.c
index 24e83b9f51..d9296cf2d1 100644
--- a/tests/i915/gem_blits.c
+++ b/tests/i915/gem_blits.c
@@ -264,11 +264,11 @@ static void buffer_set_tiling(const struct device *device,
 	gem_execbuf(device->fd, &execbuf);
 
 	gem_close(device->fd, obj[2].handle);
-	put_offset(device->ahnd, obj[2].offset);
+	put_offset(device->ahnd, obj[2].handle);
 
 	gem_close(device->fd, obj[1].handle);
+	put_offset(device->ahnd, obj[1].handle);
 
-	put_offset(device->ahnd, buffer->gtt_offset);
 	buffer->gtt_offset = obj[0].offset;
 	buffer->handle = obj[0].handle;
 
@@ -403,11 +403,11 @@ static bool blit_to_linear(const struct device *device,
 
 	gem_execbuf(device->fd, &execbuf);
 	gem_close(device->fd, obj[2].handle);
-	put_offset(device->ahnd, obj[2].offset);
+	put_offset(device->ahnd, obj[2].handle);
 
 	gem_sync(device->fd, obj[0].handle);
 	gem_close(device->fd, obj[0].handle);
-	put_offset(device->ahnd, obj[0].offset);
+	put_offset(device->ahnd, obj[0].handle);
 
 	return true;
 }
@@ -531,7 +531,7 @@ static void buffer_free(const struct device *device, struct buffer *buffer)
 {
 	igt_assert(buffer_check(device, buffer, GTT));
 	gem_close(device->fd, buffer->handle);
-	put_offset(device->ahnd, buffer->gtt_offset);
+	put_offset(device->ahnd, buffer->handle);
 	free(buffer);
 }
 
@@ -744,7 +744,7 @@ blit(const struct device *device,
 
 	gem_execbuf(device->fd, &execbuf);
 	gem_close(device->fd, obj[2].handle);
-	put_offset(device->ahnd, obj[2].offset);
+	put_offset(device->ahnd, obj[2].handle);
 
 	dst->gtt_offset = obj[0].offset;
 	src->gtt_offset = obj[1].offset;
diff --git a/tests/i915/gem_ctx_isolation.c b/tests/i915/gem_ctx_isolation.c
index ec69357140..2def529ac3 100644
--- a/tests/i915/gem_ctx_isolation.c
+++ b/tests/i915/gem_ctx_isolation.c
@@ -437,7 +437,7 @@ static void write_regs(int fd, uint64_t ahnd,
 	}
 	gem_execbuf(fd, &execbuf);
 	gem_close(fd, obj.handle);
-	put_offset(ahnd, obj.offset);
+	put_offset(ahnd, obj.handle);
 }
 
 static void restore_regs(int fd,
@@ -524,8 +524,8 @@ static void restore_regs(int fd,
 	execbuf.rsvd1 = ctx->id;
 	gem_execbuf(fd, &execbuf);
 	gem_close(fd, obj[1].handle);
-	put_offset(ahnd, obj[0].offset);
-	put_offset(ahnd, obj[1].offset);
+	put_offset(ahnd, obj[0].handle);
+	put_offset(ahnd, obj[1].handle);
 }
 
 __attribute__((unused))
-- 
2.34.1



More information about the igt-dev mailing list