Skip to contentSkip to conversation

Re-enable FBC on TGL

PATCH Superseded Uma Shankar 2 participants 5 messages Dec 1, 2020

Subsystems (3)

v5 of 6 Superseded Latest is v6 →

lore
Share & tools
lore
#0 lore raw

v5 cover Re-enable FBC on TGL

FBC was disabled on TGL due to random underruns. It has been determined that FBC will not work reliably with PSR2. This series re-enables fbc along with taking care of the PSR2 limitations for TGL.

Bspec: 50422 HSD: 14010260002

v2: Addressed review comments and added bspec links

v3: Addressed Ville's review comments

v4: Change the WA as per Jose's recommendation.

v5: Addressed Jose's review comments.

Uma Shankar (2):
drm/i915/display/tgl: Disable FBC with PSR2
Revert "drm/i915/display/fbc: Disable fbc by default on TGL"

 drivers/gpu/drm/i915/display/intel_fbc.c | 19 ++++++++++++-------
 drivers/gpu/drm/i915/i915_drv.h          |  1 +
 2 files changed, 13 insertions(+), 7 deletions(-)
Signature · 6 lines
2.26.2

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

PATCH v5 1/2 drm/i915/display/tgl: Disable FBC with PSR2

There are some corner cases wrt underrun when we enable FBC with PSR2 on TGL. Recommendation from hardware is to keep this combination disabled.

Bspec: 50422 HSD: 14010260002

v2: Added psr2 enabled check from crtc_state (Anshuman) Added Bspec link and HSD referneces (Jose)

v3: Moved the logic to disable fbc to intel_fbc_update_state_cache and removed the crtc->config usages, as per Ville's recommendation.

v4: Introduced a variable in fbc state_cache instead of the earlier plane.visible WA, as suggested by Jose.

v5: Dropped an extra check for fbc in intel_fbc_enable and addressed review comments by Jose.

---
 drivers/gpu/drm/i915/display/intel_fbc.c | 12 ++++++++++++
 drivers/gpu/drm/i915/i915_drv.h          |  1 +
 2 files changed, 13 insertions(+)
drivers/gpu/drm/i915/display/intel_fbc.c +12 -0
index a5b072816a7b..611cadc5c70a 100644
@@ -742,6 +742,8 @@ static void intel_fbc_update_state_cache(struct intel_crtc *crtc,
 		cache->fence_id = plane_state->vma->fence->id;
 	else
 		cache->fence_id = -1;
+
+	cache->psr2_active = crtc_state->has_psr2;
 }
 
 static bool intel_fbc_cfb_size_changed(struct drm_i915_private *dev_priv)
@@ -799,6 +801,16 @@ static bool intel_fbc_can_activate(struct intel_crtc *crtc)
 	struct intel_fbc *fbc = &dev_priv->fbc;
 	struct intel_fbc_state_cache *cache = &fbc->state_cache;
 
+	/*
+	 * Tigerlake is not supporting FBC with PSR2.
+	 * Recommendation is to keep this combination disabled
+	 * Bspec: 50422 HSD: 14010260002
+	 */
+	if (fbc->state_cache.psr2_active && IS_TIGERLAKE(dev_priv)) {
+		fbc->no_fbc_reason = "not supported with PSR2";
+		return false;
+	}
+
 	if (!intel_fbc_can_enable(dev_priv))
 		return false;
 
drivers/gpu/drm/i915/i915_drv.h +1 -0
index 15be8debae54..f4e08c1a5867 100644
@@ -416,6 +416,7 @@ struct intel_fbc {
 		u16 gen9_wa_cfb_stride;
 		u16 interval;
 		s8 fence_id;
+		bool psr2_active;
 	} state_cache;
 
 	/*
Signature · 6 lines
2.26.2

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Reviewed-by on v5 1/2
#2 lore raw

Re: [Intel-gfx] [v5 1/2] drm/i915/display/tgl: Disable FBC with PSR2

Quoted 47 lines · Uma Shankar

There are some corner cases wrt underrun when we enable FBC with PSR2 on TGL. Recommendation from hardware is to keep this combination disabled.

Bspec: 50422 HSD: 14010260002

v2: Added psr2 enabled check from crtc_state (Anshuman) Added Bspec link and HSD referneces (Jose)

v3: Moved the logic to disable fbc to intel_fbc_update_state_cache and removed the crtc->config usages, as per Ville's recommendation.

v4: Introduced a variable in fbc state_cache instead of the earlier plane.visible WA, as suggested by Jose.

v5: Dropped an extra check for fbc in intel_fbc_enable and addressed review comments by Jose.

---
 drivers/gpu/drm/i915/display/intel_fbc.c | 12 ++++++++++++
 drivers/gpu/drm/i915/i915_drv.h | 1 +

 2 files changed, 13 insertions(+)
drivers/gpu/drm/i915/display/intel_fbc.c +0 -0
index a5b072816a7b..611cadc5c70a 100644
@@ -742,6 +742,8 @@ static void intel_fbc_update_state_cache(struct intel_crtc *crtc,
  		cache->fence_id = plane_state->vma->fence->id;

  else
  cache->fence_id = -1;

drivers/gpu/drm/i915/display/intel_fbc.c +2 -0
+
+	cache->psr2_active = crtc_state->has_psr2;

 }

 static bool intel_fbc_cfb_size_changed(struct drm_i915_private *dev_priv)

drivers/gpu/drm/i915/display/intel_fbc.c +0 -0
@@ -799,6 +801,16 @@ static bool intel_fbc_can_activate(struct intel_crtc *crtc)
  	struct intel_fbc *fbc = &dev_priv->fbc;
  	struct intel_fbc_state_cache *cache = &fbc->state_cache;

drivers/gpu/drm/i915/display/intel_fbc.c static bool intel_fbc_can_activate(struct intel_crtc *crtc) · line 812

Quoted 9 lines
drivers/gpu/drm/i915/display/intel_fbc.c +9 -0
+	/*
+	 * Tigerlake is not supporting FBC with PSR2.
+	 * Recommendation is to keep this combination disabled
+	 * Bspec: 50422 HSD: 14010260002
+	 */
+	if (fbc->state_cache.psr2_active && IS_TIGERLAKE(dev_priv)) {
+		fbc->no_fbc_reason = "not supported with PSR2";
+		return false;
+	}

Nitpick: all new restrictions are added at the bottom lets follow it. With this change you can add my rvb in both patches.

Quoted 21 lines

+
  if (!intel_fbc_can_enable(dev_priv))
  return false;

drivers/gpu/drm/i915/i915_drv.h +1 -0
index 15be8debae54..f4e08c1a5867 100644
@@ -416,6 +416,7 @@ struct intel_fbc {
  		u16 gen9_wa_cfb_stride;
  		u16 interval;
  		s8 fence_id;
+		bool psr2_active;
  	} state_cache;

Quoted 1 line

  /*

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

#3 lore raw

Re: [Intel-gfx] [v5 1/2] drm/i915/display/tgl: Disable FBC with PSR2

Quoted 60 lines

-----Original Message-----
From: Souza, Jose <[email protected]>
Sent: Tuesday, December 1, 2020 10:13 PM
To: Shankar, Uma <[email protected]>; [email protected]
Cc: [email protected]
Subject: Re: [v5 1/2] drm/i915/display/tgl: Disable FBC with PSR2

drivers/gpu/drm/i915/display/intel_fbc.c static void intel_fbc_update_state_cache(struct

Quoted 30 lines · Uma Shankar

There are some corner cases wrt underrun when we enable FBC with PSR2 on TGL. Recommendation from hardware is to keep this combination disabled.

Bspec: 50422 HSD: 14010260002

v2: Added psr2 enabled check from crtc_state (Anshuman) Added Bspec link and HSD referneces (Jose)

v3: Moved the logic to disable fbc to intel_fbc_update_state_cache and removed the crtc->config usages, as per Ville's recommendation.

v4: Introduced a variable in fbc state_cache instead of the earlier plane.visible WA, as suggested by Jose.

v5: Dropped an extra check for fbc in intel_fbc_enable and addressed review comments by Jose.

---
 drivers/gpu/drm/i915/display/intel_fbc.c | 12 ++++++++++++
 drivers/gpu/drm/i915/i915_drv.h | 1 +

 2 files changed, 13 insertions(+)
drivers/gpu/drm/i915/display/intel_fbc.c +0 -0
index a5b072816a7b..611cadc5c70a 100644
@@ -742,6 +742,8 @@ static void intel_fbc_update_state_cache(struct

intel_crtc *crtc,

Quoted 10 lines
drivers/gpu/drm/i915/display/intel_fbc.c +0 -0
  		cache->fence_id = plane_state->vma->fence->id;

  else
  cache->fence_id = -1;

drivers/gpu/drm/i915/display/intel_fbc.c +2 -0
+
+	cache->psr2_active = crtc_state->has_psr2;

 }

Quoted 2 lines

 static bool intel_fbc_cfb_size_changed(struct drm_i915_private *dev_priv) @@ -799,6 +801,16 @@ static bool intel_fbc_can_activate(struct

intel_crtc *crtc)

Quoted 6 lines

  struct intel_fbc *fbc = &dev_priv->fbc;
  struct intel_fbc_state_cache *cache = &fbc->state_cache;

Quoted 11 lines

drivers/gpu/drm/i915/display/intel_fbc.c static bool intel_fbc_can_activate(struct intel_crtc *crtc) · line 812

Quoted 9 lines
drivers/gpu/drm/i915/display/intel_fbc.c +9 -0
+	/*
+	 * Tigerlake is not supporting FBC with PSR2.
+	 * Recommendation is to keep this combination disabled
+	 * Bspec: 50422 HSD: 14010260002
+	 */
+	if (fbc->state_cache.psr2_active && IS_TIGERLAKE(dev_priv)) {
+		fbc->no_fbc_reason = "not supported with PSR2";
+		return false;
+	}

Nitpick: all new restrictions are added at the bottom lets follow it.

Sure, will update that.

Quoted 2 lines

With this change you can add my rvb in both patches.

Thanks Jose for the review.

Regards,
Uma Shankar

Quoted 24 lines
Quoted 24 lines

+
  if (!intel_fbc_can_enable(dev_priv))
  return false;

(quoted diff) +0 -0

b/drivers/gpu/drm/i915/i915_drv.h index 15be8debae54..f4e08c1a5867 100644

drivers/gpu/drm/i915/i915_drv.h +1 -0
@@ -416,6 +416,7 @@ struct intel_fbc {
  		u16 gen9_wa_cfb_stride;
  		u16 interval;
  		s8 fence_id;
+		bool psr2_active;
  	} state_cache;
 
 
Quoted 1 line
Quoted 1 line

  /*

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

#4 lore raw

PATCH v5 2/2 Revert "drm/i915/display/fbc: Disable fbc by default on TGL"

In reply to Uma Shankar

FBC can be re-enabled on TGL with WA of keeping it disabled while PSR2 is enabled.

This reverts commit 2982ded2ff5ce0cf1a49bc39a526da182782b664.

---
 drivers/gpu/drm/i915/display/intel_fbc.c | 7 -------
 1 file changed, 7 deletions(-)
drivers/gpu/drm/i915/display/intel_fbc.c +0 -7
index 611cadc5c70a..415c9d949d36 100644
@@ -1445,13 +1445,6 @@ static int intel_sanitize_fbc_option(struct drm_i915_private *dev_priv)
 	if (!HAS_FBC(dev_priv))
 		return 0;
 
-	/*
-	 * Fbc is causing random underruns in CI execution on TGL platforms.
-	 * Disabling the same while the problem is being debugged and analyzed.
-	 */
-	if (IS_TIGERLAKE(dev_priv))
-		return 0;
-
 	if (IS_BROADWELL(dev_priv) || INTEL_GEN(dev_priv) >= 9)
 		return 1;
 
Signature · 6 lines
2.26.2

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