From 938c6c9be35e438c9c6b77c08f2d5f20c212cf6e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Ville=20Syrj=C3=A4l=C3=A4?= Date: Fri, 10 Oct 2025 00:13:12 +0300 Subject: [PATCH] drm/i915: Unify the logic in {skl,glk}_plane_has_*() MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Use the similar logic in skl_plane_has_planar(), glk_plane_has_planar() and skl_plane_has_rc_ccs() to avoid having to think too much when comparing the three. Signed-off-by: Ville Syrjälä Link: https://patch.msgid.link/20251009211313.30234-9-ville.syrjala@linux.intel.com Reviewed-by: Juha-Pekka Heikkila --- .../gpu/drm/i915/display/skl_universal_plane.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/drivers/gpu/drm/i915/display/skl_universal_plane.c b/drivers/gpu/drm/i915/display/skl_universal_plane.c index 2cc9ed49a1917..7663d61650931 100644 --- a/drivers/gpu/drm/i915/display/skl_universal_plane.c +++ b/drivers/gpu/drm/i915/display/skl_universal_plane.c @@ -2428,10 +2428,7 @@ static bool skl_plane_has_planar(struct intel_display *display, if (pipe == PIPE_C) return false; - if (plane_id != PLANE_1 && plane_id != PLANE_2) - return false; - - return true; + return plane_id == PLANE_1 || plane_id == PLANE_2; } static const u32 *skl_get_plane_formats(struct intel_display *display, @@ -2450,10 +2447,7 @@ static const u32 *skl_get_plane_formats(struct intel_display *display, static bool glk_plane_has_planar(struct intel_display *display, enum pipe pipe, enum plane_id plane_id) { - if (plane_id != PLANE_1 && plane_id != PLANE_2) - return false; - - return true; + return plane_id == PLANE_1 || plane_id == PLANE_2; } static const u32 *glk_get_plane_formats(struct intel_display *display, @@ -2700,8 +2694,10 @@ skl_plane_disable_flip_done(struct intel_plane *plane) static bool skl_plane_has_rc_ccs(struct intel_display *display, enum pipe pipe, enum plane_id plane_id) { - return pipe != PIPE_C && - (plane_id == PLANE_1 || plane_id == PLANE_2); + if (pipe == PIPE_C) + return false; + + return plane_id == PLANE_1 || plane_id == PLANE_2; } static u8 skl_plane_caps(struct intel_display *display, -- 2.47.3