summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZbigniew Kempczyński <zbigniew.kempczynski@intel.com>2020-05-21 10:39:22 +0200
committerChris Wilson <chris@chris-wilson.co.uk>2020-05-21 20:24:46 +0100
commitbc50a54ba71972be175a58be4ae82b45aaa5ca27 (patch)
treecf6bd553d3b0aab0128e1b5d9fdc5e6521d1e0e0
parent918d56bd0181d516e41e3505134f7a81b8fef8fb (diff)
lib/gpu_cmds: Add media pipeline functions based on intel_bb
Add "_v2" versions of media pipeline creation functions. Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--lib/gpu_cmds.c43
-rw-r--r--lib/gpu_cmds.h11
2 files changed, 54 insertions, 0 deletions
diff --git a/lib/gpu_cmds.c b/lib/gpu_cmds.c
index 788f2eb6..2eb09cd4 100644
--- a/lib/gpu_cmds.c
+++ b/lib/gpu_cmds.c
@@ -1331,3 +1331,46 @@ gen8_emit_gpgpu_walk_v2(struct intel_bb *ibb,
/* bottom mask, height 1, always 0xffffffff */
intel_bb_out(ibb, 0xffffffff);
}
+
+void
+gen8_emit_media_state_flush_v2(struct intel_bb *ibb)
+{
+ intel_bb_out(ibb, GEN8_MEDIA_STATE_FLUSH | (2 - 2));
+ intel_bb_out(ibb, 0);
+}
+
+void
+gen_emit_media_object_v2(struct intel_bb *ibb,
+ unsigned int xoffset, unsigned int yoffset)
+{
+ intel_bb_out(ibb, GEN7_MEDIA_OBJECT | (8 - 2));
+
+ /* interface descriptor offset */
+ intel_bb_out(ibb, 0);
+
+ /* without indirect data */
+ intel_bb_out(ibb, 0);
+ intel_bb_out(ibb, 0);
+
+ /* scoreboard */
+ intel_bb_out(ibb, 0);
+ intel_bb_out(ibb, 0);
+
+ /* inline data (xoffset, yoffset) */
+ intel_bb_out(ibb, xoffset);
+ intel_bb_out(ibb, yoffset);
+ if (AT_LEAST_GEN(ibb->devid, 8) && !IS_CHERRYVIEW(ibb->devid))
+ gen8_emit_media_state_flush_v2(ibb);
+}
+
+void
+gen7_emit_media_objects_v2(struct intel_bb *ibb,
+ unsigned int x, unsigned int y,
+ unsigned int width, unsigned int height)
+{
+ int i, j;
+
+ for (i = 0; i < width / 16; i++)
+ for (j = 0; j < height / 16; j++)
+ gen_emit_media_object_v2(ibb, x + i * 16, y + j * 16);
+}
diff --git a/lib/gpu_cmds.h b/lib/gpu_cmds.h
index 61aff153..ab5fe74b 100644
--- a/lib/gpu_cmds.h
+++ b/lib/gpu_cmds.h
@@ -202,4 +202,15 @@ gen8_emit_gpgpu_walk_v2(struct intel_bb *ibb,
unsigned int x, unsigned int y,
unsigned int width, unsigned int height);
+void
+gen8_emit_media_state_flush_v2(struct intel_bb *ibb);
+
+void
+gen_emit_media_object_v2(struct intel_bb *ibb,
+ unsigned int xoffset, unsigned int yoffset);
+
+void
+gen7_emit_media_objects_v2(struct intel_bb *ibb,
+ unsigned int x, unsigned int y,
+ unsigned int width, unsigned int height);
#endif /* GPU_CMDS_H */