[PATCH 5/5] drm/i915/display: Plug squash to cdclk atomic changes

Anusha Srivatsa anusha.srivatsa at intel.com
Fri Aug 26 17:37:48 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 111d1014eb26..406b5612dd66 100644
--- a/drivers/gpu/drm/i915/display/intel_cdclk.c
+++ b/drivers/gpu/drm/i915/display/intel_cdclk.c
@@ -1977,8 +1977,10 @@ static bool intel_cdclk_can_crawl(struct drm_i915_private *dev_priv,
 
 static bool intel_cdclk_can_squash(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;
 	/*
 	 * FIXME should store a bit more state in intel_cdclk_config
 	 * to differentiate squasher vs. cd2x divider properly. For
@@ -1988,6 +1990,12 @@ static bool intel_cdclk_can_squash(struct drm_i915_private *dev_priv,
 	if (!has_cdclk_squasher(dev_priv))
 		return false;
 
+	if (a->cdclk != b->cdclk && a->vco != 0 &&
+	    a->vco == b->vco &&	a->ref == b->ref) {
+		cdclk_transition->action = CDCLK_SQUASH_ONLY;
+		cdclk_transition->cdclk = b->cdclk;
+	}
+
 	return a->cdclk != b->cdclk &&
 		a->vco != 0 &&
 		a->vco == b->vco &&
@@ -2769,7 +2777,8 @@ int intel_modeset_calc_cdclk(struct intel_atomic_state *state)
 
 	if (intel_cdclk_can_squash(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 squasher\n");
 	} else if (intel_cdclk_can_crawl(dev_priv,
-- 
2.25.1



More information about the Intel-gfx-trybot mailing list