[Intel-gfx] [PATCH 34/53] drm/i915: Update workarounds_emit() to take request structures
Tomas Elf
tomas.elf at intel.com
Mon Mar 9 13:17:57 PDT 2015
On 19/02/2015 17:17, John.C.Harrison at Intel.com wrote:
> From: John Harrison <John.C.Harrison at Intel.com>
>
> Updated the *_ring_workarounds_emit() functions to take requests instead of
> ring/context pairs.
>
> For: VIZ-5115
> Signed-off-by: John Harrison <John.C.Harrison at Intel.com>
> ---
> drivers/gpu/drm/i915/intel_lrc.c | 14 +++++++-------
> drivers/gpu/drm/i915/intel_ringbuffer.c | 6 +++---
> 2 files changed, 10 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_lrc.c b/drivers/gpu/drm/i915/intel_lrc.c
> index fab9269..08ed800 100644
> --- a/drivers/gpu/drm/i915/intel_lrc.c
> +++ b/drivers/gpu/drm/i915/intel_lrc.c
> @@ -1076,11 +1076,11 @@ int intel_logical_ring_begin(struct intel_ringbuffer *ringbuf,
> return 0;
> }
>
> -static int intel_logical_ring_workarounds_emit(struct intel_engine_cs *ring,
> - struct intel_context *ctx)
> +static int intel_logical_ring_workarounds_emit(struct drm_i915_gem_request *req)
> {
> int ret, i;
> - struct intel_ringbuffer *ringbuf = ctx->engine[ring->id].ringbuf;
> + struct intel_engine_cs *ring = req->ring;
> + struct intel_ringbuffer *ringbuf = req->ringbuf;
> struct drm_device *dev = ring->dev;
> struct drm_i915_private *dev_priv = dev->dev_private;
> struct i915_workarounds *w = &dev_priv->workarounds;
> @@ -1089,11 +1089,11 @@ static int intel_logical_ring_workarounds_emit(struct intel_engine_cs *ring,
> return 0;
>
> ring->gpu_caches_dirty = true;
> - ret = logical_ring_flush_all_caches(ringbuf, ctx);
> + ret = logical_ring_flush_all_caches(ringbuf, req->ctx);
> if (ret)
> return ret;
>
> - ret = intel_logical_ring_begin(ringbuf, ctx, w->count * 2 + 2);
> + ret = intel_logical_ring_begin(ringbuf, req->ctx, w->count * 2 + 2);
> if (ret)
> return ret;
>
> @@ -1107,7 +1107,7 @@ static int intel_logical_ring_workarounds_emit(struct intel_engine_cs *ring,
> intel_logical_ring_advance(ringbuf);
>
> ring->gpu_caches_dirty = true;
> - ret = logical_ring_flush_all_caches(ringbuf, ctx);
> + ret = logical_ring_flush_all_caches(ringbuf, req->ctx);
> if (ret)
> return ret;
>
> @@ -1377,7 +1377,7 @@ static int gen8_init_rcs_context(struct drm_i915_gem_request *req)
> {
> int ret;
>
> - ret = intel_logical_ring_workarounds_emit(req->ring, req->ctx);
> + ret = intel_logical_ring_workarounds_emit(req);
> if (ret)
> return ret;
>
> diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.c b/drivers/gpu/drm/i915/intel_ringbuffer.c
> index efa44db..d147ffa 100644
> --- a/drivers/gpu/drm/i915/intel_ringbuffer.c
> +++ b/drivers/gpu/drm/i915/intel_ringbuffer.c
> @@ -736,10 +736,10 @@ err:
> return ret;
> }
>
> -static int intel_ring_workarounds_emit(struct intel_engine_cs *ring,
> - struct intel_context *ctx)
> +static int intel_ring_workarounds_emit(struct drm_i915_gem_request *req)
> {
> int ret, i;
> + struct intel_engine_cs *ring = req->ring;
> struct drm_device *dev = ring->dev;
> struct drm_i915_private *dev_priv = dev->dev_private;
> struct i915_workarounds *w = &dev_priv->workarounds;
> @@ -779,7 +779,7 @@ static int intel_rcs_ctx_init(struct drm_i915_gem_request *req)
> {
> int ret;
>
> - ret = intel_ring_workarounds_emit(req->ring, req->ctx);
> + ret = intel_ring_workarounds_emit(req);
> if (ret != 0)
> return ret;
>
>
Reviewed-by: Tomas Elf <tomas.elf at intel.com>
Thanks,
Tomas
More information about the Intel-gfx
mailing list