summaryrefslogtreecommitdiff
path: root/lib/igt_store.h
diff options
context:
space:
mode:
authorJohn Harrison <John.C.Harrison@Intel.com>2022-01-14 10:17:05 -0800
committerAshutosh Dixit <ashutosh.dixit@intel.com>2022-01-18 12:43:38 -0800
commit64aacf9ad3a1987fb4353c5fae96519ffc70d9b1 (patch)
tree45b3be9c3c61e05c7d958d7ecc2c40aad455db30 /lib/igt_store.h
parent0af1bfc9cd9c8e61ceed2e9529c4fc4f3bcf4544 (diff)
lib/store: Refactor common store code into helper function
A lot of tests use almost identical code for creating a batch buffer which does a single write to memory and another is about to be added. Instead, move the most generic version into a common helper function. Unfortunately, the other instances are all subtly different enough to make it not so trivial to try to use the helper. It could be done but it is unclear if it is worth the effort at this point. This patch proves the concept, if people like it enough then it can be extended. v2: Fix up object address vs store offset confusion (with help from Zbigniew K). v3: Cope with >32bit store_offset (review feedback from Matthew Brost). Signed-off-by: John Harrison <John.C.Harrison@Intel.com> Reviewed-by: Matthew Brost <matthew.brost@intel.com>
Diffstat (limited to 'lib/igt_store.h')
-rw-r--r--lib/igt_store.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/igt_store.h b/lib/igt_store.h
new file mode 100644
index 00000000..5c6c8263
--- /dev/null
+++ b/lib/igt_store.h
@@ -0,0 +1,12 @@
+/* SPDX-License-Identifier: MIT */
+/*
+ * Copyright © 2021 Intel Corporation
+ */
+
+#include "igt_gt.h"
+
+void igt_store_word(int fd, uint64_t ahnd, const intel_ctx_t *ctx,
+ const struct intel_execution_engine2 *e,
+ int fence, uint32_t target_handle,
+ uint64_t target_gpu_addr,
+ uint64_t store_offset, uint32_t store_value);