[Intel-gfx] [PATCH] drm/i915: Use wait_for_register in hsw_disable_lcpll()

Chris Wilson chris at chris-wilson.co.uk
Mon Apr 10 12:54:58 UTC 2017


On Mon, Apr 10, 2017 at 12:30:43PM +0000, Michal Wajdeczko wrote:
> There is no need to use macro as we can use generic function.
> And as side effect we can lower driver footprint.
> 
> Signed-off-by: Michal Wajdeczko <michal.wajdeczko at intel.com>
> Cc: Chris Wilson <chris at chris-wilson.co.uk>
> Cc: Paulo Zanoni <paulo.r.zanoni at intel.com>
> ---
>  drivers/gpu/drm/i915/intel_display.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index eeb828c..2fce1a7 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -8693,11 +8693,11 @@ static void hsw_disable_lcpll(struct drm_i915_private *dev_priv,
>  		val |= LCPLL_CD_SOURCE_FCLK;
>  		I915_WRITE(LCPLL_CTL, val);
>  
> -		if (wait_for_us(I915_READ(LCPLL_CTL) &
> -				LCPLL_CD_SOURCE_FCLK_DONE, 1))
> +		if (__intel_wait_for_register_fw(dev_priv, LCPLL_CTL,
> +						 LCPLL_CD_SOURCE_FCLK_DONE,
> +						 LCPLL_CD_SOURCE_FCLK_DONE,
> +						 1, 0, &val))

This changes it from a I915_READ() to I915_READ_FW. It should be safe to
drop the forcewakes, but the jury is out over the spinlock. Can anyone
else concurrently access the same cacheline?
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre


More information about the Intel-gfx mailing list