Re: [PATCH 1/7] drm/i915/execlists: Move RPCS setup to context pin

Joonas Lahtinen
2019-01-08T13:11:58Z

Quoting Tvrtko Ursulin (2019-01-08 13:22:46)
> From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
>
> Configuring RPCS in context image just before pin is sufficient and will
> come extra handy in one of the following patches.
>
> v2:
> * Split image setup a bit differently. (Chris Wilson)
>
> v3:
> * Update context image after reset as well - otherwise the application
> of pinned default state clears the RPCS.
>
> v4:
> * Use local variable throughout the function. (Chris Wilson)
>
> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> Suggested-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Chris Wilson <chris@chris-wilson.co.uk>
> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>

<SNIP>

> +static u32 make_rpcs(struct drm_i915_private *dev_priv);

This will be gotten rid of in upcoming patches, so ok.

> if (rcs) {
> regs[CTX_LRI_HEADER_2] = MI_LOAD_REGISTER_IMM(1);
> - CTX_REG(regs, CTX_R_PWR_CLK_STATE, GEN8_R_PWR_CLK_STATE,
> - make_rpcs(dev_priv));
> + CTX_REG(regs, CTX_R_PWR_CLK_STATE, GEN8_R_PWR_CLK_STATE, 0);

While here, we could poison the value with something nasty as code flow
assumes it to be overwritten in next call.

Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>

Regards, Joonas