[Intel-gfx] [PATCH 1/6] drm/i915: Stop hand rolling drm_crtc_mask()

Rodrigo Vivi rodrigo.vivi at intel.com
Wed Jun 9 11:25:21 UTC 2021


On Wed, Jun 09, 2021 at 11:56:27AM +0300, Ville Syrjala wrote:
> From: Ville Syrjälä <ville.syrjala at linux.intel.com>
> 
> Use drm_crtc_mask() instead of hand rolling it.
> 
> Signed-off-by: Ville Syrjälä <ville.syrjala at linux.intel.com>

Reviewed-by: Rodrigo Vivi <rodrigo.vivi at intel.com>

> ---
>  drivers/gpu/drm/i915/display/intel_display.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
> index 362bff9beb5c..62ad4cfae073 100644
> --- a/drivers/gpu/drm/i915/display/intel_display.c
> +++ b/drivers/gpu/drm/i915/display/intel_display.c
> @@ -6485,7 +6485,7 @@ int intel_get_load_detect_pipe(struct drm_connector *connector,
>  	struct drm_atomic_state *state = NULL, *restore_state = NULL;
>  	struct drm_connector_state *connector_state;
>  	struct intel_crtc_state *crtc_state;
> -	int ret, i = -1;
> +	int ret;
>  
>  	drm_dbg_kms(&dev_priv->drm, "[CONNECTOR:%d:%s], [ENCODER:%d:%s]\n",
>  		    connector->base.id, connector->name,
> @@ -6519,8 +6519,7 @@ int intel_get_load_detect_pipe(struct drm_connector *connector,
>  
>  	/* Find an unused one (if possible) */
>  	for_each_crtc(dev, possible_crtc) {
> -		i++;
> -		if (!(encoder->possible_crtcs & (1 << i)))
> +		if (!(encoder->possible_crtcs & drm_crtc_mask(possible_crtc)))
>  			continue;
>  
>  		ret = drm_modeset_lock(&possible_crtc->mutex, ctx);
> -- 
> 2.31.1
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx


More information about the Intel-gfx mailing list