drm/i915: Simplify xelpdp_is_only_pipe_per_dbuf_bank()
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Thu, 31 Oct 2024 15:56:46 +0000 (17:56 +0200)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Wed, 6 Nov 2024 14:41:49 +0000 (16:41 +0200)
Implement xelpdp_is_only_pipe_per_dbuf_bank() in a slightly
more straightforward way.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20241031155646.15165-7-ville.syrjala@linux.intel.com
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
drivers/gpu/drm/i915/display/skl_watermark.c

index 98f9e01..d3bbf33 100644 (file)
@@ -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,