[PATCH 6/6] drm/i915: Simplify xelpdp_is_only_pipe_per_dbuf_bank()

Jani Nikula jani.nikula at linux.intel.com
Fri Nov 1 10:32:11 UTC 2024


On Thu, 31 Oct 2024, Ville Syrjala <ville.syrjala at linux.intel.com> wrote:
> From: Ville Syrjälä <ville.syrjala at linux.intel.com>
>
> Implement xelpdp_is_only_pipe_per_dbuf_bank() in a slightly
> more straightforward way.
>
> Signed-off-by: Ville Syrjälä <ville.syrjala at linux.intel.com>

Matter of taste, but at least this is less repetitive.

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

> ---
>  drivers/gpu/drm/i915/display/skl_watermark.c | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/skl_watermark.c b/drivers/gpu/drm/i915/display/skl_watermark.c
> index 98f9e01b2a1c..d3bbf335c749 100644
> --- a/drivers/gpu/drm/i915/display/skl_watermark.c
> +++ b/drivers/gpu/drm/i915/display/skl_watermark.c
> @@ -3256,19 +3256,19 @@ static bool xelpdp_is_only_pipe_per_dbuf_bank(enum pipe pipe, u8 active_pipes)
>  {
>  	switch (pipe) {
>  	case PIPE_A:
> -		return !(active_pipes & BIT(PIPE_D));
>  	case PIPE_D:
> -		return !(active_pipes & BIT(PIPE_A));
> +		active_pipes &= BIT(PIPE_A) | BIT(PIPE_D);
> +		break;
>  	case PIPE_B:
> -		return !(active_pipes & BIT(PIPE_C));
>  	case PIPE_C:
> -		return !(active_pipes & BIT(PIPE_B));
> +		active_pipes &= BIT(PIPE_B) | BIT(PIPE_C);
> +		break;
>  	default: /* to suppress compiler warning */
>  		MISSING_CASE(pipe);
> -		break;
> +		return false;
>  	}
>  
> -	return false;
> +	return is_power_of_2(active_pipes);
>  }
>  
>  static u32 pipe_mbus_dbox_ctl(const struct intel_crtc *crtc,

-- 
Jani Nikula, Intel


More information about the Intel-gfx mailing list