From: Dave Gordon <david.s.gor...@intel.com>

With the scheduler, request allocation can happen long before
the ring is filled in, and in a different order. So for that case,
we update the request head at the start of _final (the initialisation
on allocation is stull useful for the direct-submission mode).

v2: Updated to use locally cached request pointer.

For: VIZ-2021
Signed-off-by: Dave Gordon <david.s.gor...@intel.com>
---
 drivers/gpu/drm/i915/i915_gem_execbuffer.c | 3 +++
 drivers/gpu/drm/i915/intel_lrc.c           | 3 +++
 2 files changed, 6 insertions(+)

diff --git a/drivers/gpu/drm/i915/i915_gem_execbuffer.c 
b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
index 0b2c4d1..f02300a 100644
--- a/drivers/gpu/drm/i915/i915_gem_execbuffer.c
+++ b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
@@ -1293,6 +1293,9 @@ int i915_gem_ringbuffer_submission_final(struct 
i915_execbuffer_params *params)
        if (ret)
                goto error;
 
+       /* record where we start filling the ring */
+       req->head = intel_ring_get_tail(req->ringbuf);
+
        /*
         * Unconditionally invalidate gpu caches and ensure that we do flush
         * any residual writes from the previous batch.
diff --git a/drivers/gpu/drm/i915/intel_lrc.c b/drivers/gpu/drm/i915/intel_lrc.c
index 1062e85..ceba055 100644
--- a/drivers/gpu/drm/i915/intel_lrc.c
+++ b/drivers/gpu/drm/i915/intel_lrc.c
@@ -1012,6 +1012,9 @@ int intel_execlists_submission_final(struct 
i915_execbuffer_params *params)
        if (ret)
                goto err;
 
+       /* record where we start filling the ring */
+       req->head = intel_ring_get_tail(ringbuf);
+
        /*
         * Unconditionally invalidate gpu caches and ensure that we do flush
         * any residual writes from the previous batch.
-- 
1.9.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

Reply via email to