[igt-dev] [PATCH i-g-t v2 3/5] lib/intel_batchbuffer: Add new media fillfunc v2

Zbigniew Kempczyński zbigniew.kempczynski at intel.com
Thu May 21 08:39:24 UTC 2020


Media fill function selection for "_v2" version.

Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski at intel.com>
Cc: Chris Wilson <chris at chris-wilson.co.uk>
---
 lib/intel_batchbuffer.c | 26 ++++++++++++++++++++++++++
 lib/intel_batchbuffer.h |  1 +
 2 files changed, 27 insertions(+)

diff --git a/lib/intel_batchbuffer.c b/lib/intel_batchbuffer.c
index b7e86854..02c293be 100644
--- a/lib/intel_batchbuffer.c
+++ b/lib/intel_batchbuffer.c
@@ -1118,6 +1118,32 @@ igt_fillfunc_t igt_get_media_fillfunc(int devid)
 	return fill;
 }
 
+
+/**
+ * igt_get_media_fillfunc_v2:
+ * @devid: pci device id
+ *
+ * Returns:
+ *
+ * The platform-specific media fill function pointer for the device specified
+ * with @devid. Will return NULL when no media fill function is implemented.
+ */
+igt_fillfunc_v2_t igt_get_media_fillfunc_v2(int devid)
+{
+	igt_fillfunc_v2_t fill = NULL;
+
+	if (IS_GEN12(devid))
+		fill = gen12_media_fillfunc_v2;
+	else if (IS_GEN9(devid) || IS_GEN10(devid) || IS_GEN11(devid))
+		fill = gen9_media_fillfunc_v2;
+	else if (IS_GEN8(devid))
+		fill = gen8_media_fillfunc_v2;
+	else if (IS_GEN7(devid))
+		fill = gen7_media_fillfunc_v2;
+
+	return fill;
+}
+
 igt_vme_func_t igt_get_media_vme_func(int devid)
 {
 	igt_vme_func_t fill = NULL;
diff --git a/lib/intel_batchbuffer.h b/lib/intel_batchbuffer.h
index 0d95427c..e7ac58fa 100644
--- a/lib/intel_batchbuffer.h
+++ b/lib/intel_batchbuffer.h
@@ -401,6 +401,7 @@ typedef void (*igt_fillfunc_v2_t)(int i915,
 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);
+igt_fillfunc_v2_t igt_get_media_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