[Intel-gfx] [PATCH 6/6] drm/i915: Wrappers for display register waits

Chris Wilson chris at chris-wilson.co.uk
Fri Aug 16 07:17:58 UTC 2019


Quoting Daniele Ceraolo Spurio (2019-08-16 02:23:43)
> To reduce the number of explicit dev_priv->uncore calls in the display
> code ahead of the introduction of dev_priv->de_uncore, this patch
> introduces a wrapper for one of the main usages of it, the register
> waits. When we transition to the new uncore, we can just update the
> wrapper to point to the appropriate structure.
> 
> Since the vast majority of waits are on a set or clear of a bit or mask,
> add set & clear flavours of the wrapper to simplify the code.
> 
> Signed-off-by: Daniele Ceraolo Spurio <daniele.ceraolospurio at intel.com>
> Cc: Jani Nikula <jani.nikula at intel.com>
> Cc: Ville Syrjälä <ville.syrjala at linux.intel.com>
> ---
>  drivers/gpu/drm/i915/display/icl_dsi.c        | 11 +--
>  drivers/gpu/drm/i915/display/intel_cdclk.c    | 18 +----
>  drivers/gpu/drm/i915/display/intel_crt.c      | 17 ++--
>  drivers/gpu/drm/i915/display/intel_ddi.c      |  6 +-
>  drivers/gpu/drm/i915/display/intel_display.c  | 45 +++--------
>  .../drm/i915/display/intel_display_power.c    | 32 +++-----
>  drivers/gpu/drm/i915/display/intel_dp.c       | 10 +--
>  drivers/gpu/drm/i915/display/intel_dp_mst.c   |  7 +-
>  drivers/gpu/drm/i915/display/intel_dpio_phy.c |  5 +-
>  drivers/gpu/drm/i915/display/intel_dpll_mgr.c | 44 +++-------
>  drivers/gpu/drm/i915/display/intel_fbc.c      |  4 +-
>  drivers/gpu/drm/i915/display/intel_hdcp.c     | 32 +++-----
>  drivers/gpu/drm/i915/display/intel_lvds.c     |  6 +-
>  drivers/gpu/drm/i915/display/intel_psr.c      |  5 +-
>  drivers/gpu/drm/i915/display/vlv_dsi.c        | 80 ++++++-------------
>  drivers/gpu/drm/i915/display/vlv_dsi_pll.c    | 14 +---
>  drivers/gpu/drm/i915/i915_drv.h               | 11 +++
>  17 files changed, 112 insertions(+), 235 deletions(-)

> diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> index 35db81d66785..9578f1c1f099 100644
> --- a/drivers/gpu/drm/i915/i915_drv.h
> +++ b/drivers/gpu/drm/i915/i915_drv.h
> @@ -2446,6 +2446,17 @@ int i915_reg_read_ioctl(struct drm_device *dev, void *data,
>  #define I915_READ_FW(reg__) __I915_REG_OP(read_fw, dev_priv, (reg__))
>  #define I915_WRITE_FW(reg__, val__) __I915_REG_OP(write_fw, dev_priv, (reg__), (val__))
>  
> +/* register wait wrappers for display regs */
> +#define intel_de_wait_for_register(dev_priv_, reg_, mask_, value_, timeout_) \
> +       intel_wait_for_register(&(dev_priv_)->uncore, \
> +                               (reg_), (mask_), (value_), (timeout_))
> +
> +#define intel_de_wait_for_set(dev_priv_, reg_, mask_, timeout_) \
> +       intel_de_wait_for_register(dev_priv_, reg_, mask_, mask_, timeout_)
> +
> +#define intel_de_wait_for_clear(dev_priv_, reg_, mask_, timeout_) \
> +       intel_de_wait_for_register(dev_priv_, reg_, mask_, 0, timeout_)

wait_for_set & wait_for_clear was a nice improvement in clarity.

I didn't see any incorrect conversions,
Reviewed-by: Chris Wilson <chris at chris-wilson.co.uk>
-Chris


More information about the Intel-gfx mailing list