[PATCH 1/2] eb-parse

Chris Wilson chris at chris-wilson.co.uk
Fri Mar 5 15:27:52 UTC 2021


---
 drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
index fe170186dd42..928a4b9a3aa5 100644
--- a/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
+++ b/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
@@ -249,6 +249,7 @@ struct i915_execbuffer {
 	struct i915_request *request; /** our request to build */
 	struct eb_vma *batch; /** identity of the batch obj/vma */
 	struct i915_vma *trampoline; /** trampoline used for chaining */
+	struct dma_fence *parse;
 
 	/** actual size of execobj[] as we may extend it for the cmdparser */
 	unsigned int buffer_count;
@@ -2388,6 +2389,7 @@ static int eb_parse_pipeline(struct i915_execbuffer *eb,
 	/* Force execution to wait for completion of the parser */
 	dma_resv_add_excl_fence(shadow->resv, &pw->base.dma);
 
+	eb->parse = dma_fence_get(&pw->base.dma);
 	dma_fence_work_commit_imm(&pw->base);
 	return 0;
 
@@ -3190,6 +3192,7 @@ i915_gem_do_execbuffer(struct drm_device *dev,
 	eb.batch_start_offset = args->batch_start_offset;
 	eb.batch_len = args->batch_len;
 	eb.trampoline = NULL;
+	eb.parse = NULL;
 
 	eb.fences = NULL;
 	eb.num_fences = 0;
@@ -3289,6 +3292,12 @@ i915_gem_do_execbuffer(struct drm_device *dev,
 		goto err_vma;
 	}
 
+	if (eb.parse) {
+		err = i915_request_await_dma_fence(eb.request, eb.parse);
+		if (err < 0)
+			goto err_request;
+	}
+
 	if (in_fence) {
 		if (args->flags & I915_EXEC_FENCE_SUBMIT)
 			err = i915_request_await_execution(eb.request,
@@ -3354,6 +3363,7 @@ i915_gem_do_execbuffer(struct drm_device *dev,
 	WARN_ON(err == -EDEADLK);
 	i915_gem_ww_ctx_fini(&eb.ww);
 
+	dma_fence_put(eb.parse);
 	if (eb.batch_pool)
 		intel_gt_buffer_pool_put(eb.batch_pool);
 	if (eb.reloc_pool)
-- 
2.20.1



More information about the Intel-gfx-trybot mailing list