[PATCH 4/7] drm/i915/display: Embed the new struct steps for crawling

Anusha Srivatsa anusha.srivatsa at intel.com
Mon Sep 19 23:41:15 UTC 2022


Populate the new struct steps for crawl case.

Signed-off-by: Anusha Srivatsa <anusha.srivatsa at intel.com>
---
 drivers/gpu/drm/i915/display/intel_cdclk.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/display/intel_cdclk.c b/drivers/gpu/drm/i915/display/intel_cdclk.c
index d2e81134b6f2..bb5bbb1ad982 100644
--- a/drivers/gpu/drm/i915/display/intel_cdclk.c
+++ b/drivers/gpu/drm/i915/display/intel_cdclk.c
@@ -1951,8 +1951,9 @@ void intel_cdclk_uninit_hw(struct drm_i915_private *i915)
 
 static bool intel_cdclk_can_crawl(struct drm_i915_private *dev_priv,
 				  const struct intel_cdclk_config *a,
-				  const struct intel_cdclk_config *b)
+				  struct intel_cdclk_config *b)
 {
+	struct cdclk_step *cdclk_transition = b->steps;
 	int a_div, b_div;
 
 	if (!HAS_CDCLK_CRAWL(dev_priv))
@@ -1965,6 +1966,12 @@ static bool intel_cdclk_can_crawl(struct drm_i915_private *dev_priv,
 	a_div = DIV_ROUND_CLOSEST(a->vco, a->cdclk);
 	b_div = DIV_ROUND_CLOSEST(b->vco, b->cdclk);
 
+	if (a->vco != 0 && b->vco != 0 && a->vco != b->vco &&
+	    a_div == b_div && a->ref == b->ref) {
+		cdclk_transition->action = CDCLK_CRAWL_ONLY;
+		cdclk_transition->cdclk = b->cdclk;
+	}
+
 	return a->vco != 0 && b->vco != 0 &&
 		a->vco != b->vco &&
 		a_div == b_div &&
-- 
2.25.1



More information about the Intel-gfx-trybot mailing list