[igt-dev] [PATCH i-g-t] tests/i915/gem_exec_capture : Add support for local memory
sai.gowtham.ch at intel.com
sai.gowtham.ch at intel.com
Tue Oct 12 05:02:28 UTC 2021
From: Ch Sai Gowtham <sai.gowtham.ch at intel.com>
Add a subtest that performs the exercise on an object allocated in
device memory.
Signed-off-by: Ch Sai Gowtham <sai.gowtham.ch at intel.com>
Cc: Zbigniew Kempczyński <zbigniew.kempczynski at intel.com>
---
tests/i915/gem_exec_capture.c | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/tests/i915/gem_exec_capture.c b/tests/i915/gem_exec_capture.c
index 7e0a8b8a..9664ee07 100644
--- a/tests/i915/gem_exec_capture.c
+++ b/tests/i915/gem_exec_capture.c
@@ -632,6 +632,19 @@ static void userptr(int fd, int dir)
free(ptr);
}
+static void lmem(int fd, int dir, const intel_ctx_t *ctx, unsigned ring)
+{
+ uint32_t handle;
+ uint64_t ahnd;
+
+ handle = gem_create_in_memory_regions(fd, 4096, REGION_LMEM(0));
+ ahnd = get_reloc_ahnd(fd, ctx->id);
+ __capture1(fd, dir, ahnd, ctx, ring, handle, 4096);
+
+ gem_close(fd, handle);
+ put_ahnd(ahnd);
+}
+
static bool has_capture(int fd)
{
drm_i915_getparam_t gp;
@@ -720,6 +733,12 @@ igt_main
test_each_engine("pi", fd, ctx, e)
prioinv(fd, dir, ctx, e->flags, e->name);
+ igt_subtest_f("LMEM") {
+ igt_require(gem_has_lmem(fd));
+ igt_require(gem_can_store_dword(fd, 0));
+ lmem(fd, dir, ctx, e->flags);
+ }
+
igt_fixture {
close(dir);
igt_disallow_hang(fd, hang);
--
2.32.0
More information about the igt-dev
mailing list