]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/i915: Unify the logic in {skl,glk}_plane_has_*()
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Thu, 9 Oct 2025 21:13:12 +0000 (00:13 +0300)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Tue, 28 Oct 2025 21:23:20 +0000 (23:23 +0200)
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ä <ville.syrjala@linux.intel.com>
Link: https://patch.msgid.link/20251009211313.30234-9-ville.syrjala@linux.intel.com
Reviewed-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
drivers/gpu/drm/i915/display/skl_universal_plane.c

index 2cc9ed49a191733cb046ada465ed27fdf4291578..7663d616509314622f2ddee36be25e310309ee14 100644 (file)
@@ -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,