Skip to contentSkip to conversation

drm/i915: Bump up CDCLK to eliminate underruns on TGL

PATCH Superseded Stanislav Lisovskiy 4 participants 4 messages Jan 9, 2020

Subsystems (3)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 drm/i915: Bump up CDCLK to eliminate underruns on TGL

There seems to be some undocumented bandwidth bottleneck/dependency which scales with CDCLK, causing FIFO underruns when CDCLK is too low, even when it's correct from BSpec point of view.

Currently for TGL platforms we calculate min_cdclk initially based on pixel_rate divided by 2, accounting for also plane requirements, however in some cases the lowest possible CDCLK doesn't work and causing the underruns.

Explicitly stating here that this seems to be currently rather a Hack, than final solution.

v2: Use clamp operation instead of min(Matt Roper)

Bugzilla: https://gitlab.freedesktop.org/drm/intel/issues/402

---
 drivers/gpu/drm/i915/display/intel_cdclk.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
drivers/gpu/drm/i915/display/intel_cdclk.c +14 -0
index 7d1ab1e5b7c3..23ef30175090 100644
@@ -2004,6 +2004,20 @@ int intel_crtc_compute_min_cdclk(const struct intel_crtc_state *crtc_state)
 	/* Account for additional needs from the planes */
 	min_cdclk = max(intel_planes_min_cdclk(crtc_state), min_cdclk);
 
+	/*
+	 * HACK. Currently for TGL platforms we calculate
+	 * min_cdclk initially based on pixel_rate divided
+	 * by 2, accounting for also plane requirements,
+	 * however in some cases the lowest possible CDCLK
+	 * doesn't work and causing the underruns.
+	 * Explicitly stating here that this seems to be currently
+	 * rather a Hack, than final solution.
+	 */
+	if (IS_TIGERLAKE(dev_priv))
+		min_cdclk = clamp(min_cdclk,
+				  (int)crtc_state->pixel_rate,
+				  (int)dev_priv->max_cdclk_freq);
+
 	if (min_cdclk > dev_priv->max_cdclk_freq) {
 		DRM_DEBUG_KMS("required cdclk (%d kHz) exceeds max (%d kHz)\n",
 			      min_cdclk, dev_priv->max_cdclk_freq);
Signature · 6 lines
2.24.1.485.gad05a3d8e5

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Reviewed-by on v2 1/1
#1 lore raw
Quoted 10 lines · Stanislav Lisovskiy

There seems to be some undocumented bandwidth bottleneck/dependency which scales with CDCLK, causing FIFO underruns when CDCLK is too low, even when it's correct from BSpec point of view.

Currently for TGL platforms we calculate min_cdclk initially based on pixel_rate divided by 2, accounting for also plane requirements, however in some cases the lowest possible CDCLK doesn't work and causing the underruns.

We probably want one more sentence here explaining the (somewhat blunt) workaround we're actually applying with this patch. E.g., "We've found experimentally that raising cdclk to at least pixel_rate (rather than pixel_rate/2) eliminates these underruns, so let's use this as a temporary workaround until the hardware team can suggest a more precise remedy."

Quoted 8 lines

Explicitly stating here that this seems to be currently rather a Hack, than final solution.

v2: Use clamp operation instead of min(Matt Roper)

Bugzilla: https://gitlab.freedesktop.org/drm/intel/issues/402

I believe we're trying to start using "Closes:" rather than "Bugzilla:" as the tag here now that the bug database isn't actually bugzilla anymore.

Anyway, the patch does what it aims to do and eliminates the underruns that are crippling us at the moment (at the expense of some higher power usage), so with an updated commit message, this is

Quoted 32 lines
---
 drivers/gpu/drm/i915/display/intel_cdclk.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
drivers/gpu/drm/i915/display/intel_cdclk.c +14 -0
index 7d1ab1e5b7c3..23ef30175090 100644
@@ -2004,6 +2004,20 @@ int intel_crtc_compute_min_cdclk(const struct intel_crtc_state *crtc_state)
 	/* Account for additional needs from the planes */
 	min_cdclk = max(intel_planes_min_cdclk(crtc_state), min_cdclk);
 
+	/*
+	 * HACK. Currently for TGL platforms we calculate
+	 * min_cdclk initially based on pixel_rate divided
+	 * by 2, accounting for also plane requirements,
+	 * however in some cases the lowest possible CDCLK
+	 * doesn't work and causing the underruns.
+	 * Explicitly stating here that this seems to be currently
+	 * rather a Hack, than final solution.
+	 */
+	if (IS_TIGERLAKE(dev_priv))
+		min_cdclk = clamp(min_cdclk,
+				  (int)crtc_state->pixel_rate,
+				  (int)dev_priv->max_cdclk_freq);
+
 	if (min_cdclk > dev_priv->max_cdclk_freq) {
 		DRM_DEBUG_KMS("required cdclk (%d kHz) exceeds max (%d kHz)\n",
 			      min_cdclk, dev_priv->max_cdclk_freq);
Signature · 1 line
2.24.1.485.gad05a3d8e5
Signature · 9 lines
Matt Roper
Graphics Software Engineer
VTT-OSGC Platform Enablement
Intel Corporation
(916) 356-2795
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
maintainer
#2 lore raw
In reply to Stanislav Lisovskiy
Quoted 33 lines · Stanislav Lisovskiy

There seems to be some undocumented bandwidth bottleneck/dependency which scales with CDCLK, causing FIFO underruns when CDCLK is too low, even when it's correct from BSpec point of view.

Currently for TGL platforms we calculate min_cdclk initially based on pixel_rate divided by 2, accounting for also plane requirements, however in some cases the lowest possible CDCLK doesn't work and causing the underruns.

Explicitly stating here that this seems to be currently rather a Hack, than final solution.

v2: Use clamp operation instead of min(Matt Roper)

Bugzilla: https://gitlab.freedesktop.org/drm/intel/issues/402

---
 drivers/gpu/drm/i915/display/intel_cdclk.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
drivers/gpu/drm/i915/display/intel_cdclk.c +3 -0
index 7d1ab1e5b7c3..23ef30175090 100644
@@ -2004,6 +2004,20 @@ int intel_crtc_compute_min_cdclk(const struct intel_crtc_state *crtc_state)
 	/* Account for additional needs from the planes */
 	min_cdclk = max(intel_planes_min_cdclk(crtc_state), min_cdclk);
 
+	/*
+	 * HACK. Currently for TGL platforms we calculate
+	 * min_cdclk initially based on pixel_rate divided

drivers/gpu/drm/i915/display/intel_cdclk.c int intel_crtc_compute_min_cdclk(const struct intel_crtc_state *crtc_state) · line 2019

Quoted 10 lines
drivers/gpu/drm/i915/display/intel_cdclk.c +10 -0
+	 * by 2, accounting for also plane requirements,
+	 * however in some cases the lowest possible CDCLK
+	 * doesn't work and causing the underruns.
+	 * Explicitly stating here that this seems to be currently
+	 * rather a Hack, than final solution.
+	 */
+	if (IS_TIGERLAKE(dev_priv))
+		min_cdclk = clamp(min_cdclk,
+				  (int)crtc_state->pixel_rate,
+				  (int)dev_priv->max_cdclk_freq);

I don't think you can do that even as a hack. By clamping the required minimum to the max cdclk, you lose the check below. Can't do that.

BR,
Jani.

Quoted 4 lines
drivers/gpu/drm/i915/display/intel_cdclk.c +1 -0
+
 	if (min_cdclk > dev_priv->max_cdclk_freq) {
 		DRM_DEBUG_KMS("required cdclk (%d kHz) exceeds max (%d kHz)\n",
 			      min_cdclk, dev_priv->max_cdclk_freq);
Signature · 5 lines
Jani Nikula, Intel Open Source Graphics Center
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#3 lore raw
In reply to Stanislav Lisovskiy
Quoted 33 lines · Stanislav Lisovskiy

There seems to be some undocumented bandwidth bottleneck/dependency which scales with CDCLK, causing FIFO underruns when CDCLK is too low, even when it's correct from BSpec point of view.

Currently for TGL platforms we calculate min_cdclk initially based on pixel_rate divided by 2, accounting for also plane requirements, however in some cases the lowest possible CDCLK doesn't work and causing the underruns.

Explicitly stating here that this seems to be currently rather a Hack, than final solution.

v2: Use clamp operation instead of min(Matt Roper)

Bugzilla: https://gitlab.freedesktop.org/drm/intel/issues/402

---
 drivers/gpu/drm/i915/display/intel_cdclk.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
drivers/gpu/drm/i915/display/intel_cdclk.c +3 -0
index 7d1ab1e5b7c3..23ef30175090 100644
@@ -2004,6 +2004,20 @@ int intel_crtc_compute_min_cdclk(const struct intel_crtc_state *crtc_state)
 	/* Account for additional needs from the planes */
 	min_cdclk = max(intel_planes_min_cdclk(crtc_state), min_cdclk);
 
+	/*
+	 * HACK. Currently for TGL platforms we calculate
+	 * min_cdclk initially based on pixel_rate divided

drivers/gpu/drm/i915/display/intel_cdclk.c int intel_crtc_compute_min_cdclk(const struct intel_crtc_state *crtc_state) · line 2019

Quoted 10 lines
drivers/gpu/drm/i915/display/intel_cdclk.c +10 -0
+	 * by 2, accounting for also plane requirements,
+	 * however in some cases the lowest possible CDCLK
+	 * doesn't work and causing the underruns.
+	 * Explicitly stating here that this seems to be currently
+	 * rather a Hack, than final solution.
+	 */
+	if (IS_TIGERLAKE(dev_priv))
+		min_cdclk = clamp(min_cdclk,
+				  (int)crtc_state->pixel_rate,
+				  (int)dev_priv->max_cdclk_freq);

clamp_t() is neater.

Quoted 6 lines
drivers/gpu/drm/i915/display/intel_cdclk.c +1 -0
+
 	if (min_cdclk > dev_priv->max_cdclk_freq) {
 		DRM_DEBUG_KMS("required cdclk (%d kHz) exceeds max (%d kHz)\n",
 			      min_cdclk, dev_priv->max_cdclk_freq);
Signature · 1 line
2.24.1.485.gad05a3d8e5
Signature · 6 lines
Ville Syrjälä
Intel
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx