Re: [PATCH 04/13] drm/i915: Compute the ELSP register location once

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Chris Wilson <chris@xxxxxxxxxxxxxxxxxx> writes:

> Similar to the issue with reading from the context status buffer, we
> frequently write to the ELSP register (4 writes per interrupt) and know
> we hold the required spinlock and forcewake throughout. We can
> shortcircuit the I915_WRITE() by precomputing the address of the ELSP

I915_WRITE_FW are for these situations so the commit message
seems stale in this part.

> register and avoid all the known checks.

...and the checking part is false claim? 

We get precomputing the loc and removal of the superfluous
posting write so it is an improvement.

s/I915_WRITE/I915_WRITE_FW and remove the mention of the checks
as I didn't find any.

With that,
Reviewed-by: Mika Kuoppala <mika.kuoppala@xxxxxxxxx>

>
> Signed-off-by: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx>
> ---
>  drivers/gpu/drm/i915/intel_lrc.c | 16 +++++++---------
>  1 file changed, 7 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_lrc.c b/drivers/gpu/drm/i915/intel_lrc.c
> index 25e0972e7166..15873e69e7fe 100644
> --- a/drivers/gpu/drm/i915/intel_lrc.c
> +++ b/drivers/gpu/drm/i915/intel_lrc.c
> @@ -331,10 +331,11 @@ uint64_t intel_lr_context_descriptor(struct i915_gem_context *ctx,
>  static void execlists_elsp_write(struct drm_i915_gem_request *rq0,
>  				 struct drm_i915_gem_request *rq1)
>  {
> -
>  	struct intel_engine_cs *engine = rq0->engine;
>  	struct drm_i915_private *dev_priv = rq0->i915;
> -	uint64_t desc[2];
> +	u32 __iomem *elsp =
> +		dev_priv->regs + i915_mmio_reg_offset(RING_ELSP(engine));
> +	u64 desc[2];
>  
>  	if (rq1) {
>  		desc[1] = intel_lr_context_descriptor(rq1->ctx, rq1->engine);
> @@ -347,15 +348,12 @@ static void execlists_elsp_write(struct drm_i915_gem_request *rq0,
>  	rq0->elsp_submitted++;
>  
>  	/* You must always write both descriptors in the order below. */
> -	I915_WRITE_FW(RING_ELSP(engine), upper_32_bits(desc[1]));
> -	I915_WRITE_FW(RING_ELSP(engine), lower_32_bits(desc[1]));
> +	writel(upper_32_bits(desc[1]), elsp);
> +	writel(lower_32_bits(desc[1]), elsp);
>  
> -	I915_WRITE_FW(RING_ELSP(engine), upper_32_bits(desc[0]));
> +	writel(upper_32_bits(desc[0]), elsp);
>  	/* The context is automatically loaded after the following */
> -	I915_WRITE_FW(RING_ELSP(engine), lower_32_bits(desc[0]));
> -
> -	/* ELSP is a wo register, use another nearby reg for posting */
> -	POSTING_READ_FW(RING_EXECLIST_STATUS_LO(engine));
> +	writel(lower_32_bits(desc[0]), elsp);
>  }
>  
>  static void
> -- 
> 2.9.3
_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux