[Intel-gfx] [PATCH 38/46] drm/i915: Only track object dependencies on first request

Matthew Brost
2021-08-03T22:13:15Z

Only track object dependencies on the first request generated from the
execbuf, this help with the upcoming multi-bb execbuf extension.

Signed-off-by: Matthew Brost <matthew.brost@intel.com>
---
drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
index 2835ef8734e5..b224b28530d1 100644
--- a/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
+++ b/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
@@ -2239,7 +2239,7 @@ static int eb_relocate_parse(struct i915_execbuffer *eb)
return err;
}

-static int eb_move_to_gpu(struct i915_execbuffer *eb)
+static int eb_move_to_gpu(struct i915_execbuffer *eb, bool first)
{
const unsigned int count = eb->buffer_count;
unsigned int i = count;
@@ -2281,7 +2281,7 @@ static int eb_move_to_gpu(struct i915_execbuffer *eb)
flags &= ~EXEC_OBJECT_ASYNC;
}

- if (err == 0 && !(flags & EXEC_OBJECT_ASYNC)) {
+ if (err == 0 && first && !(flags & EXEC_OBJECT_ASYNC)) {
err = i915_request_await_object
(eb->request, obj, flags & EXEC_OBJECT_WRITE);
}
@@ -2525,14 +2525,15 @@ static int eb_parse(struct i915_execbuffer *eb)
return err;
}

-static int eb_submit(struct i915_execbuffer *eb, struct i915_vma *batch)
+static int eb_submit(struct i915_execbuffer *eb, struct i915_vma *batch,
+ bool first)
{
int err;

if (intel_context_nopreempt(eb->context))
__set_bit(I915_FENCE_FLAG_NOPREEMPT, &eb->request->fence.flags);

- err = eb_move_to_gpu(eb);
+ err = eb_move_to_gpu(eb, first);
if (err)
return err;

@@ -3304,7 +3305,7 @@ i915_gem_do_execbuffer(struct drm_device *dev,
intel_gt_buffer_pool_mark_active(eb.batch_pool, eb.request);

trace_i915_request_queue(eb.request, eb.batch_flags);
- err = eb_submit(&eb, batch);
+ err = eb_submit(&eb, batch, true);

err_request:
i915_request_get(eb.request);
--
2.28.0