Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Ville Syrjala <ville.syrjala@linux.intel.com>
To: intel-gfx@lists.freedesktop.org
Subject: [PATCH v2 9/9] drm/i915: Carve up skl_get_plane_caps()
Date: Thu, 10 Oct 2024 19:46:17 +0300	[thread overview]
Message-ID: <20241010164617.10280-1-ville.syrjala@linux.intel.com> (raw)
In-Reply-To: <20241009182207.22900-10-ville.syrjala@linux.intel.com>

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

Split skl_get_plane_caps() into four variants:
skl_plane_caps(), glk_plane_caps(), icl_plane_caps(),
tgl_plane_caps().

Makes it easier to figure out what is actually going on there.

v2: skl_plane_caps() should return u8 not bool

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 .../drm/i915/display/skl_universal_plane.c    | 81 +++++++++++++------
 1 file changed, 57 insertions(+), 24 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/skl_universal_plane.c b/drivers/gpu/drm/i915/display/skl_universal_plane.c
index bcb48d8932d2..4924fc3619c5 100644
--- a/drivers/gpu/drm/i915/display/skl_universal_plane.c
+++ b/drivers/gpu/drm/i915/display/skl_universal_plane.c
@@ -2562,47 +2562,73 @@ skl_plane_disable_flip_done(struct intel_plane *plane)
 static bool skl_plane_has_rc_ccs(struct drm_i915_private *i915,
 				 enum pipe pipe, enum plane_id plane_id)
 {
-	if (DISPLAY_VER(i915) >= 11)
-		return true;
-
-	if (IS_GEMINILAKE(i915))
-		return pipe != PIPE_C;
-
 	return pipe != PIPE_C &&
 		(plane_id == PLANE_1 || plane_id == PLANE_2);
 }
 
+static u8 skl_plane_caps(struct drm_i915_private *i915,
+			 enum pipe pipe, enum plane_id plane_id)
+{
+	u8 caps = INTEL_PLANE_CAP_TILING_X |
+		INTEL_PLANE_CAP_TILING_Y |
+		INTEL_PLANE_CAP_TILING_Yf;
+
+	if (skl_plane_has_rc_ccs(i915, pipe, plane_id))
+		caps |= INTEL_PLANE_CAP_CCS_RC;
+
+	return caps;
+}
+
+static bool glk_plane_has_rc_ccs(struct drm_i915_private *i915,
+				 enum pipe pipe)
+{
+	return pipe != PIPE_C;
+}
+
+static u8 glk_plane_caps(struct drm_i915_private *i915,
+			 enum pipe pipe, enum plane_id plane_id)
+{
+	u8 caps = INTEL_PLANE_CAP_TILING_X |
+		INTEL_PLANE_CAP_TILING_Y |
+		INTEL_PLANE_CAP_TILING_Yf;
+
+	if (glk_plane_has_rc_ccs(i915, pipe))
+		caps |= INTEL_PLANE_CAP_CCS_RC;
+
+	return caps;
+}
+
+static u8 icl_plane_caps(struct drm_i915_private *i915,
+			 enum pipe pipe, enum plane_id plane_id)
+{
+	return INTEL_PLANE_CAP_TILING_X |
+		INTEL_PLANE_CAP_TILING_Y |
+		INTEL_PLANE_CAP_TILING_Yf |
+		INTEL_PLANE_CAP_CCS_RC;
+}
+
 static bool tgl_plane_has_mc_ccs(struct drm_i915_private *i915,
 				 enum plane_id plane_id)
 {
-	if (DISPLAY_VER(i915) < 12)
-		return false;
-
 	/* Wa_14010477008 */
 	if (IS_DG1(i915) || IS_ROCKETLAKE(i915) ||
-		(IS_TIGERLAKE(i915) && IS_DISPLAY_STEP(i915, STEP_A0, STEP_D0)))
+	    (IS_TIGERLAKE(i915) && IS_DISPLAY_STEP(i915, STEP_A0, STEP_D0)))
 		return false;
 
 	return plane_id < PLANE_6;
 }
 
-static u8 skl_get_plane_caps(struct drm_i915_private *i915,
-			     enum pipe pipe, enum plane_id plane_id)
+static u8 tgl_plane_caps(struct drm_i915_private *i915,
+			 enum pipe pipe, enum plane_id plane_id)
 {
-	u8 caps = INTEL_PLANE_CAP_TILING_X;
+	u8 caps = INTEL_PLANE_CAP_TILING_X |
+		INTEL_PLANE_CAP_CCS_RC |
+		INTEL_PLANE_CAP_CCS_RC_CC;
 
-	if (DISPLAY_VER(i915) < 13 || IS_ALDERLAKE_P(i915))
-		caps |= INTEL_PLANE_CAP_TILING_Y;
-	if (DISPLAY_VER(i915) < 12)
-		caps |= INTEL_PLANE_CAP_TILING_Yf;
 	if (HAS_4TILE(i915))
 		caps |= INTEL_PLANE_CAP_TILING_4;
-
-	if (skl_plane_has_rc_ccs(i915, pipe, plane_id)) {
-		caps |= INTEL_PLANE_CAP_CCS_RC;
-		if (DISPLAY_VER(i915) >= 12)
-			caps |= INTEL_PLANE_CAP_CCS_RC_CC;
-	}
+	else
+		caps |= INTEL_PLANE_CAP_TILING_Y;
 
 	if (tgl_plane_has_mc_ccs(i915, plane_id))
 		caps |= INTEL_PLANE_CAP_CCS_MC;
@@ -2714,7 +2740,14 @@ skl_universal_plane_create(struct drm_i915_private *dev_priv,
 	else
 		plane_type = DRM_PLANE_TYPE_OVERLAY;
 
-	caps = skl_get_plane_caps(dev_priv, pipe, plane_id);
+	if (DISPLAY_VER(dev_priv) >= 12)
+		caps = tgl_plane_caps(dev_priv, pipe, plane_id);
+	else if (DISPLAY_VER(dev_priv) == 11)
+		caps = icl_plane_caps(dev_priv, pipe, plane_id);
+	else if (DISPLAY_VER(dev_priv) == 10)
+		caps = glk_plane_caps(dev_priv, pipe, plane_id);
+	else
+		caps = skl_plane_caps(dev_priv, pipe, plane_id);
 
 	/* FIXME: xe has problems with AUX */
 	if (!IS_ENABLED(I915) && !HAS_FLAT_CCS(dev_priv))
-- 
2.45.2


  reply	other threads:[~2024-10-10 16:46 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-09 18:21 [PATCH 0/9] drm/i915: Async flip + compression, and some plane cleanups Ville Syrjala
2024-10-09 18:21 ` [PATCH 1/9] drm/i915: Allow async flips with render compression on TGL+ Ville Syrjala
2024-10-24 10:41   ` Hogander, Jouni
2024-10-28 15:12     ` Ville Syrjälä
2024-11-18  7:47       ` Hogander, Jouni
2024-10-09 18:22 ` [PATCH 2/9] drm/i915: Allow async flips with compression on ICL Ville Syrjala
2024-10-24 10:42   ` Hogander, Jouni
2024-10-09 18:22 ` [PATCH 3/9] drm/i915: Introduce plane->can_async_flip() Ville Syrjala
2024-10-24 10:43   ` Hogander, Jouni
2025-01-08  7:54   ` Borah, Chaitanya Kumar
2024-10-09 18:22 ` [PATCH 4/9] drm/i915: Use plane->can_async_flip() for alignment exceptions Ville Syrjala
2024-10-24 10:46   ` Hogander, Jouni
2024-10-28 15:02     ` Ville Syrjälä
2024-10-09 18:22 ` [PATCH 5/9] drm/i915: Reuse vlv_primary_min_alignment() for sprites as well Ville Syrjala
2024-10-24 10:47   ` Hogander, Jouni
2024-10-09 18:22 ` [PATCH 6/9] drm/i915: Disable scanout VT-d workaround for TGL+ Ville Syrjala
2024-10-24 10:50   ` Hogander, Jouni
2024-10-28 15:01     ` Ville Syrjälä
2024-11-18  7:48       ` Hogander, Jouni
2024-10-09 18:22 ` [PATCH 7/9] drm/i915: Nuke ADL pre-production Wa_22011186057 Ville Syrjala
2024-10-24 10:52   ` Hogander, Jouni
2024-10-28 15:04     ` Ville Syrjälä
2024-11-18  7:50       ` Hogander, Jouni
2024-10-09 18:22 ` [PATCH 8/9] drm/i915: Relocate xe AUX hack Ville Syrjala
2024-10-24 10:52   ` Hogander, Jouni
2024-10-09 18:22 ` [PATCH 9/9] drm/i915: Carve up skl_get_plane_caps() Ville Syrjala
2024-10-10 16:46   ` Ville Syrjala [this message]
2024-10-24 10:53     ` [PATCH v2 " Hogander, Jouni
2024-10-09 20:36 ` ✗ Fi.CI.CHECKPATCH: warning for drm/i915: Async flip + compression, and some plane cleanups Patchwork
2024-10-09 20:36 ` ✗ Fi.CI.SPARSE: " Patchwork
2024-10-09 20:46 ` ✗ Fi.CI.BAT: failure " Patchwork
2024-10-11  8:56 ` ✗ Fi.CI.CHECKPATCH: warning for drm/i915: Async flip + compression, and some plane cleanups (rev2) Patchwork
2024-10-11  8:56 ` ✗ Fi.CI.SPARSE: " Patchwork
2024-10-11  9:00 ` ✗ Fi.CI.BAT: failure " Patchwork
2024-10-11 16:50 ` ✗ Fi.CI.CHECKPATCH: warning for drm/i915: Async flip + compression, and some plane cleanups (rev3) Patchwork
2024-10-11 16:50 ` ✗ Fi.CI.SPARSE: " Patchwork
2024-10-11 17:30 ` ✓ Fi.CI.BAT: success " Patchwork
2024-10-12 11:56 ` ✗ Fi.CI.IGT: failure " Patchwork
  -- strict thread matches above, loose matches on Subject: below --
2024-12-02 14:14 [PATCH v2 0/9] drm/i915: Async flip + compression, and some plane cleanups Ville Syrjala
2024-12-02 14:14 ` [PATCH v2 9/9] drm/i915: Carve up skl_get_plane_caps() Ville Syrjala

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241010164617.10280-1-ville.syrjala@linux.intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox