summaryrefslogtreecommitdiff
path: root/tests/i915/gem_huc_copy.c
diff options
context:
space:
mode:
authorZbigniew Kempczyński <zbigniew.kempczynski@intel.com>2021-07-20 12:01:11 +0200
committerZbigniew Kempczyński <zbigniew.kempczynski@intel.com>2021-08-10 21:02:50 +0200
commitad3ad1ebab84ff5d02b23abdd8ca2025ec5a5e9a (patch)
tree0da326924577308d9986a32d7d644496aab2772a /tests/i915/gem_huc_copy.c
parentcbdf3b1d3acc14da497259e6e8f6e0fd0632d8fd (diff)
lib/huc_copy: Extend huc copy prototype to pass allocator handle
For testing gem_huc_copy on no-reloc platforms we need to pass allocator handle and object sizes to properly acquire offsets from allocator. Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com> Cc: Petri Latvala <petri.latvala@intel.com> Cc: Ashutosh Dixit <ashutosh.dixit@intel.com> Reviewed-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
Diffstat (limited to 'tests/i915/gem_huc_copy.c')
-rw-r--r--tests/i915/gem_huc_copy.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/tests/i915/gem_huc_copy.c b/tests/i915/gem_huc_copy.c
index 9a32893e..ea32b705 100644
--- a/tests/i915/gem_huc_copy.c
+++ b/tests/i915/gem_huc_copy.c
@@ -89,6 +89,7 @@ igt_main
int drm_fd = -1;
uint32_t devid;
igt_huc_copyfunc_t huc_copy;
+ uint64_t ahnd;
igt_fixture {
drm_fd = drm_open_driver(DRIVER_INTEL);
@@ -97,6 +98,8 @@ igt_main
huc_copy = igt_get_huc_copyfunc(devid);
igt_require_f(huc_copy, "no huc_copy function\n");
+
+ ahnd = get_reloc_ahnd(drm_fd, 0);
}
igt_describe("Make sure that Huc firmware works"
@@ -106,6 +109,9 @@ igt_main
igt_subtest("huc-copy") {
char inputs[HUC_COPY_DATA_BUF_SIZE];
struct drm_i915_gem_exec_object2 obj[3];
+ uint64_t objsize[3] = { HUC_COPY_DATA_BUF_SIZE,
+ HUC_COPY_DATA_BUF_SIZE,
+ 4096 };
test_huc_load(drm_fd);
/* Initialize src buffer randomly */
@@ -123,7 +129,7 @@ igt_main
gem_write(drm_fd, obj[0].handle, 0, inputs, HUC_COPY_DATA_BUF_SIZE);
- huc_copy(drm_fd, obj);
+ huc_copy(drm_fd, ahnd, obj, objsize);
compare_huc_copy_result(drm_fd, obj[0].handle, obj[1].handle);
gem_close(drm_fd, obj[0].handle);
@@ -131,6 +137,8 @@ igt_main
gem_close(drm_fd, obj[2].handle);
}
- igt_fixture
+ igt_fixture {
+ put_ahnd(ahnd);
close(drm_fd);
+ }
}