summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrzej Hajda <andrzej.hajda@intel.com>2024-06-27 09:25:00 +0200
committerKamil Konieczny <kamil.konieczny@linux.intel.com>2024-07-02 17:32:33 +0200
commitc0b7746395e0790156a75139a33f9dd544716f98 (patch)
treecaa2a3632becd123d9102761362a29455b8df35b
parentc7650224f5d2af27c3500732a98ead3c3fab61f3 (diff)
lib/gpu_cmds: add Xe_LP version of emit_vfe_state
In Xe_LP version there is added argument to control EU thread dispatching mode. For shaders lagacy mode is used. v2: added commit description v6: added public function descriptions v8: removed spare return from void function Signed-off-by: Andrzej Hajda <andrzej.hajda@intel.com> Reviewed-by: Dominik Grzegorzek <dominik.grzegorzek@intel.com>
-rw-r--r--lib/gpu_cmds.c52
-rw-r--r--lib/gpu_cmds.h6
2 files changed, 52 insertions, 6 deletions
diff --git a/lib/gpu_cmds.c b/lib/gpu_cmds.c
index 2e29cc6c4..c44b24c79 100644
--- a/lib/gpu_cmds.c
+++ b/lib/gpu_cmds.c
@@ -651,10 +651,10 @@ gen7_emit_vfe_state(struct intel_bb *ibb, uint32_t threads,
intel_bb_out(ibb, 0);
}
-void
-gen8_emit_vfe_state(struct intel_bb *ibb, uint32_t threads,
- uint32_t urb_entries, uint32_t urb_size,
- uint32_t curbe_size)
+static void
+__gen8_emit_vfe_state(struct intel_bb *ibb, uint32_t threads,
+ uint32_t urb_entries, uint32_t urb_size,
+ uint32_t curbe_size, bool legacy_mode)
{
intel_bb_out(ibb, GEN7_MEDIA_VFE_STATE | (9 - 2));
@@ -662,8 +662,8 @@ gen8_emit_vfe_state(struct intel_bb *ibb, uint32_t threads,
intel_bb_out(ibb, 0);
intel_bb_out(ibb, 0);
- /* number of threads & urb entries */
- intel_bb_out(ibb, threads << 16 | urb_entries << 8);
+ /* number of threads & urb entries & eu fusion */
+ intel_bb_out(ibb, threads << 16 | urb_entries << 8 | legacy_mode << 6);
intel_bb_out(ibb, 0);
@@ -676,6 +676,25 @@ gen8_emit_vfe_state(struct intel_bb *ibb, uint32_t threads,
intel_bb_out(ibb, 0);
}
+/**
+ * gen8_emit_vfe_state:
+ * @ibb: batchbuffer
+ * @threads: maximum number of threads
+ * @urb_entries: number of URB entries
+ * @urb_size: URB entry allocation size
+ * @curbe_size: CURBE allocation size
+ *
+ * Emits instruction MEDIA_VFE_STATE for Gen8+ which sets Video Front End (VFE)
+ * state.
+ */
+void gen8_emit_vfe_state(struct intel_bb *ibb, uint32_t threads,
+ uint32_t urb_entries, uint32_t urb_size,
+ uint32_t curbe_size)
+{
+ __gen8_emit_vfe_state(ibb, threads, urb_entries, urb_size, curbe_size,
+ false);
+}
+
void
gen7_emit_curbe_load(struct intel_bb *ibb, uint32_t curbe_buffer)
{
@@ -864,6 +883,27 @@ gen7_emit_media_objects(struct intel_bb *ibb,
gen_emit_media_object(ibb, x + i * 16, y + j * 16);
}
+/**
+ * xelp_emit_vfe_state:
+ * @ibb: pointer to intel_bb
+ * @threads: maximum number of threads
+ * @urb_entries: number of URB entries
+ * @urb_size: URB entry allocation size
+ * @curbe_size: CURBE allocation size
+ * @legacy_mode: if set, threads are dispatched individually (legacy mode),
+ * otherwise they are dispatched in sets(fused EU mode)
+ *
+ * Emits instruction MEDIA_VFE_STATE for XeLP which sets Video Front End (VFE)
+ * state.
+ */
+void xelp_emit_vfe_state(struct intel_bb *ibb, uint32_t threads,
+ uint32_t urb_entries, uint32_t urb_size,
+ uint32_t curbe_size, bool legacy_mode)
+{
+ __gen8_emit_vfe_state(ibb, threads, urb_entries, urb_size,
+ curbe_size, legacy_mode);
+}
+
/*
* XEHP
*/
diff --git a/lib/gpu_cmds.h b/lib/gpu_cmds.h
index 348c6c945..1b9156a80 100644
--- a/lib/gpu_cmds.h
+++ b/lib/gpu_cmds.h
@@ -81,6 +81,12 @@ void
gen8_emit_vfe_state(struct intel_bb *ibb, uint32_t threads,
uint32_t urb_entries, uint32_t urb_size,
uint32_t curbe_size);
+
+void
+xelp_emit_vfe_state(struct intel_bb *ibb, uint32_t threads,
+ uint32_t urb_entries, uint32_t urb_size,
+ uint32_t curbe_size, bool legacy_mode);
+
void
gen7_emit_curbe_load(struct intel_bb *ibb, uint32_t curbe_buffer);