[igt-dev] [PATCH i-g-t v7 6/8] lib/intel_batchbuffer: Introduce temporary igt_fillfunc_v2_t
Zbigniew Kempczyński
zbigniew.kempczynski at intel.com
Wed May 20 11:26:40 UTC 2020
gem_gpgpu_fill test is spread over different generations (gen >= 7)
so some transitional state is required until all gens will be
rewritten to new intel_bb code without libdrm dependency.
So, let's define new igt_fillfunc_v2_t to be new fill function.
Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski at intel.com>
Cc: Chris Wilson <chris at chris-wilson.co.uk>
---
lib/intel_batchbuffer.c | 27 +++++++++++++++++++++++++++
lib/intel_batchbuffer.h | 8 ++++++++
2 files changed, 35 insertions(+)
diff --git a/lib/intel_batchbuffer.c b/lib/intel_batchbuffer.c
index effcff4f..b7e86854 100644
--- a/lib/intel_batchbuffer.c
+++ b/lib/intel_batchbuffer.c
@@ -1154,6 +1154,33 @@ igt_fillfunc_t igt_get_gpgpu_fillfunc(int devid)
return fill;
}
+/**
+ * igt_get_gpgpu_fillfunc_v2:
+ * @devid: pci device id
+ *
+ * Returns:
+ *
+ * The platform-specific gpgpu fill function pointer for the device specified
+ * with @devid. Will return NULL when no gpgpu fill function is implemented.
+ */
+igt_fillfunc_v2_t igt_get_gpgpu_fillfunc_v2(int devid)
+{
+ igt_fillfunc_v2_t fill = NULL;
+
+ if (IS_GEN7(devid))
+ fill = gen7_gpgpu_fillfunc_v2;
+ else if (IS_GEN8(devid))
+ fill = gen8_gpgpu_fillfunc_v2;
+ else if (IS_GEN9(devid) || IS_GEN10(devid))
+ fill = gen9_gpgpu_fillfunc_v2;
+ else if (IS_GEN11(devid))
+ fill = gen11_gpgpu_fillfunc_v2;
+ else if (IS_GEN12(devid))
+ fill = gen12_gpgpu_fillfunc_v2;
+
+ return fill;
+}
+
/**
* igt_get_media_spinfunc:
* @devid: pci device id
diff --git a/lib/intel_batchbuffer.h b/lib/intel_batchbuffer.h
index 5f162546..0d95427c 100644
--- a/lib/intel_batchbuffer.h
+++ b/lib/intel_batchbuffer.h
@@ -391,8 +391,16 @@ typedef void (*igt_fillfunc_t)(struct intel_batchbuffer *batch,
unsigned width, unsigned height,
uint8_t color);
+struct intel_buf;
+typedef void (*igt_fillfunc_v2_t)(int i915,
+ struct intel_buf *buf,
+ unsigned x, unsigned y,
+ unsigned width, unsigned height,
+ uint8_t color);
+
igt_fillfunc_t igt_get_media_fillfunc(int devid);
igt_fillfunc_t igt_get_gpgpu_fillfunc(int devid);
+igt_fillfunc_v2_t igt_get_gpgpu_fillfunc_v2(int devid);
typedef void (*igt_vme_func_t)(struct intel_batchbuffer *batch,
const struct igt_buf *src,
--
2.26.0
More information about the igt-dev
mailing list