[2/4] drm/i915: Introduce icl_sdr_y_plane_mask()
diff mbox series

Message ID 20191031105929.11594-2-ville.syrjala@linux.intel.com
State New
Headers show
Series
  • [1/4] drm/i915: s/icl_is_nv12_y_plane/icl_is_sdr_y_plane/
Related show

Commit Message

Ville Syrjälä Oct. 31, 2019, 10:59 a.m. UTC
From: Ville Syrjälä <ville.syrjala@linux.intel.com>

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ä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/i915/display/intel_sprite.h | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

Patch
diff mbox series

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)