From: Ville Syrjälä <[email protected]>

Just like we have icl_hdr_plane_mask() let's introduce
icl_sdr_y_plane_mask(). This should make future changes to
the set of supported planes easier.

Signed-off-by: Ville Syrjälä <[email protected]>
---
 drivers/gpu/drm/i915/display/intel_sprite.h | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_sprite.h 
b/drivers/gpu/drm/i915/display/intel_sprite.h
index 965abc8a57cc..f38cc46ab282 100644
--- a/drivers/gpu/drm/i915/display/intel_sprite.h
+++ b/drivers/gpu/drm/i915/display/intel_sprite.h
@@ -32,13 +32,14 @@ struct intel_plane *
 skl_universal_plane_create(struct drm_i915_private *dev_priv,
                           enum pipe pipe, enum plane_id plane_id);
 
+static inline u8 icl_sdr_y_plane_mask(void)
+{
+       return BIT(PLANE_SPRITE4) | BIT(PLANE_SPRITE5);
+}
+
 static inline bool icl_is_sdr_y_plane(enum plane_id id)
 {
-       /* Don't need to do a gen check, these planes are only available on 
gen11 */
-       if (id == PLANE_SPRITE4 || id == PLANE_SPRITE5)
-               return true;
-
-       return false;
+       return icl_sdr_y_plane_mask() & BIT(id);
 }
 
 static inline u8 icl_hdr_plane_mask(void)
-- 
2.23.0

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

Reply via email to