Re: [igt-dev] [PATCH i-g-t] tests/i915/gem_exec_capture : Add support for local memory
From: Zbigniew Kempczyński <hidden>
Date: 2021-10-14 09:35:21
On Tue, Oct 12, 2021 at 10:32:28AM +0530, sai.gowtham.ch@intel.com wrote:
quoted hunk ↗ jump to hunk
From: Ch Sai Gowtham <redacted> Add a subtest that performs the exercise on an object allocated in device memory. Signed-off-by: Ch Sai Gowtham <redacted> Cc: Zbigniew Kempczyński <redacted> --- 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); +} +
Instead of creating separate lmem test just reuse 'capture', but involve walk over regioning. -- Zbigniew
quoted hunk ↗ jump to hunk
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