[Intel-gfx] [PATCH 06/16] drm/i915: Introduce with_intel_display_power_if_enabled()

Jani Nikula jani.nikula at linux.intel.com
Wed Sep 15 13:22:15 UTC 2021


On Mon, 13 Sep 2021, Ville Syrjala <ville.syrjala at linux.intel.com> wrote:
> From: Ville Syrjälä <ville.syrjala at linux.intel.com>
>
> Add the _if_enabled() counterpart to with_intel_display_power().
>
> Signed-off-by: Ville Syrjälä <ville.syrjala at linux.intel.com>

Reviewed-by: Jani Nikula <jani.nikula at intel.com>

Looks like there's plenty of code that could use this.

> ---
>  drivers/gpu/drm/i915/display/intel_display_power.h | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_display_power.h b/drivers/gpu/drm/i915/display/intel_display_power.h
> index 978531841fa3..0612e4b6e3c8 100644
> --- a/drivers/gpu/drm/i915/display/intel_display_power.h
> +++ b/drivers/gpu/drm/i915/display/intel_display_power.h
> @@ -410,6 +410,10 @@ void gen9_dbuf_slices_update(struct drm_i915_private *dev_priv,
>  	for ((wf) = intel_display_power_get((i915), (domain)); (wf); \
>  	     intel_display_power_put_async((i915), (domain), (wf)), (wf) = 0)
>  
> +#define with_intel_display_power_if_enabled(i915, domain, wf) \
> +	for ((wf) = intel_display_power_get_if_enabled((i915), (domain)); (wf); \
> +	     intel_display_power_put_async((i915), (domain), (wf)), (wf) = 0)
> +
>  void chv_phy_powergate_lanes(struct intel_encoder *encoder,
>  			     bool override, unsigned int mask);
>  bool chv_phy_powergate_ch(struct drm_i915_private *dev_priv, enum dpio_phy phy,

-- 
Jani Nikula, Intel Open Source Graphics Center


More information about the Intel-gfx mailing list