[i-g-t 23/27] lib/i915: Execbuf3 support for render & vebox copy functions

Bhanuprakash Modem bhanuprakash.modem at intel.com
Mon Jan 23 09:43:31 UTC 2023


Add Execbuf3 support for render & vebox copy functions.

Signed-off-by: Bhanuprakash Modem <bhanuprakash.modem at intel.com>
---
 lib/rendercopy_gen9.c | 11 +++++++++--
 lib/veboxcopy_gen12.c | 10 ++++++++--
 2 files changed, 17 insertions(+), 4 deletions(-)

diff --git a/lib/rendercopy_gen9.c b/lib/rendercopy_gen9.c
index d74f1c99..c19410d8 100644
--- a/lib/rendercopy_gen9.c
+++ b/lib/rendercopy_gen9.c
@@ -1181,8 +1181,15 @@ void _gen9_render_op(struct intel_bb *ibb,
 		gen12_emit_pxp_state(ibb, false, pxp_scratch_offset);
 
 	intel_bb_emit_bbe(ibb);
-	intel_bb_exec(ibb, intel_bb_offset(ibb),
-		      I915_EXEC_RENDER | I915_EXEC_NO_RELOC, false);
+	if (ibb->vm_id) {
+		uint32_t engine_idx = intel_bb_find_engine(ibb->cfg, I915_ENGINE_CLASS_RENDER);
+
+		intel_bb_exec3(ibb, engine_idx, false);
+	} else {
+		intel_bb_exec(ibb, intel_bb_offset(ibb),
+			      I915_EXEC_RENDER | I915_EXEC_NO_RELOC, false);
+	}
+
 	dump_batch(ibb);
 	intel_bb_reset(ibb, false);
 }
diff --git a/lib/veboxcopy_gen12.c b/lib/veboxcopy_gen12.c
index aa90939b..8be4c14d 100644
--- a/lib/veboxcopy_gen12.c
+++ b/lib/veboxcopy_gen12.c
@@ -358,8 +358,14 @@ void gen12_vebox_copyfunc(struct intel_bb *ibb,
 	intel_bb_out(ibb, MI_BATCH_BUFFER_END);
 	intel_bb_ptr_align(ibb, 8);
 
-	intel_bb_exec(ibb, intel_bb_offset(ibb),
-		      I915_EXEC_VEBOX | I915_EXEC_NO_RELOC, false);
+	if (ibb->vm_id) {
+		uint32_t engine_idx = intel_bb_find_engine(ibb->cfg, I915_ENGINE_CLASS_RENDER);
+
+		intel_bb_exec3(ibb, engine_idx, false);
+	} else {
+		intel_bb_exec(ibb, intel_bb_offset(ibb),
+			      I915_EXEC_VEBOX | I915_EXEC_NO_RELOC, false);
+	}
 
 	intel_bb_reset(ibb, false);
 
-- 
2.39.0



More information about the Intel-gfx-trybot mailing list