[PATCH 7/7] drm/i915/display: Change intel_cdclk_can_crawl()

Anusha Srivatsa anusha.srivatsa at intel.com
Tue Aug 30 17:26:04 UTC 2022


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

diff --git a/drivers/gpu/drm/i915/display/intel_cdclk.c b/drivers/gpu/drm/i915/display/intel_cdclk.c
index 9428fbbea94a..0adaba9fd2a8 100644
--- a/drivers/gpu/drm/i915/display/intel_cdclk.c
+++ b/drivers/gpu/drm/i915/display/intel_cdclk.c
@@ -1958,8 +1958,10 @@ 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)
+				  const struct intel_cdclk_config *b,
+				  struct intel_cdclk_state *new_cdclk)
 {
+	struct cdclk_step *cdclk_transition = new_cdclk->steps;
 	int a_div, b_div;
 
 	if (!HAS_CDCLK_CRAWL(dev_priv))
@@ -1972,6 +1974,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_SQUASH_ONLY;
+		cdclk_transition->cdclk = b->cdclk;
+	}
+
 	return a->vco != 0 && b->vco != 0 &&
 		a->vco != b->vco &&
 		a_div == b_div &&
@@ -2786,7 +2794,8 @@ int intel_modeset_calc_cdclk(struct intel_atomic_state *state)
 			    "Can change cdclk via squasher\n");
 	} else if (intel_cdclk_can_crawl(dev_priv,
 					 &old_cdclk_state->actual,
-					 &new_cdclk_state->actual)) {
+					 &new_cdclk_state->actual,
+					 new_cdclk_state)) {
 		drm_dbg_kms(&dev_priv->drm,
 			    "Can change cdclk via crawl\n");
 	} else if (pipe != INVALID_PIPE) {
-- 
2.25.1



More information about the Intel-gfx-trybot mailing list