[PATCH 3/3] drm/i915/display: CDCLK 0 scenario, corner cases/checks
Anusha Srivatsa
anusha.srivatsa at intel.com
Wed Oct 12 21:54:23 UTC 2022
Common debug patch to narrow down the issue.
In cases where we are still enabling display, when cdclk is 0
do a modeset and not a squash.
Add the check to make sure PLLs are on before looking up
the waveforms.
Add hardware capability
Signed-off-by: Anusha Srivatsa <anusha.srivatsa at intel.com>
---
drivers/gpu/drm/i915/display/intel_cdclk.c | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/i915/display/intel_cdclk.c b/drivers/gpu/drm/i915/display/intel_cdclk.c
index 53f7a4a04d95..99799d18a524 100644
--- a/drivers/gpu/drm/i915/display/intel_cdclk.c
+++ b/drivers/gpu/drm/i915/display/intel_cdclk.c
@@ -1685,7 +1685,7 @@ static u32 cdclk_squash_waveform(struct drm_i915_private *dev_priv,
const struct intel_cdclk_vals *table = dev_priv->display.cdclk.table;
int i;
- if (cdclk == dev_priv->display.cdclk.hw.bypass)
+ if (cdclk == dev_priv->display.cdclk.hw.bypass || cdclk == 0)
return 0;
for (i = 0; table[i].refclk; i++)
@@ -1715,6 +1715,10 @@ static bool cdclk_crawl_and_squash(struct drm_i915_private *i915,
int size = 16;
int div = 2;
+ /* Return if both Squash and Crawl are not present */
+ if (!HAS_CDCLK_CRAWL(i915) || !has_cdclk_squasher(i915))
+ return false;
+
/* Return if Squash only or Crawl only is the desired action */
if (old_cdclk_config->vco <= 0 || new_cdclk_config->vco <= 0 ||
old_cdclk_config->vco == new_cdclk_config->vco ||
@@ -2029,12 +2033,15 @@ static bool intel_cdclk_can_crawl_and_squash(struct drm_i915_private *i915,
{
u16 old_waveform = cdclk_squash_waveform(i915, a->cdclk);
u16 new_waveform = cdclk_squash_waveform(i915, b->cdclk);
+
+ if (a->vco == 0 || b->vco == 0)
+ return false;
if (!HAS_CDCLK_CRAWL(i915) || !has_cdclk_squasher(i915))
return false;
return a->vco != b->vco &&
- old_waveform == new_waveform;
+ old_waveform != new_waveform;
}
static bool intel_cdclk_can_crawl(struct drm_i915_private *dev_priv,
--
2.25.1
More information about the Intel-gfx-trybot
mailing list