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

Anusha Srivatsa anusha.srivatsa at intel.com
Thu Sep 15 21:35:42 UTC 2022


Populate the new struct steps for squash case.

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

diff --git a/drivers/gpu/drm/i915/display/intel_cdclk.c b/drivers/gpu/drm/i915/display/intel_cdclk.c
index 220d32adbd12..a6e9de21b0c6 100644
--- a/drivers/gpu/drm/i915/display/intel_cdclk.c
+++ b/drivers/gpu/drm/i915/display/intel_cdclk.c
@@ -1705,6 +1705,7 @@ static void bxt_set_cdclk(struct drm_i915_private *dev_priv,
 			  const struct intel_cdclk_config *cdclk_config,
 			  enum pipe pipe)
 {
+	enum cdclk_sequence cdclk_transition = cdclk_config->steps->action;
 	int cdclk = cdclk_config->cdclk;
 	int vco = cdclk_config->vco;
 	u32 val;
@@ -1712,6 +1713,9 @@ static void bxt_set_cdclk(struct drm_i915_private *dev_priv,
 	int clock;
 	int ret;
 
+	if (cdclk_transition == CDCLK_SQUASH_ONLY)
+		drm_err(&dev_priv->drm, "***Atomic has set Squash as the desired cdclk action\n");
+
 	/* Inform power controller of upcoming frequency change. */
 	if (DISPLAY_VER(dev_priv) >= 11)
 		ret = skl_pcode_request(&dev_priv->uncore, SKL_PCODE_CDCLK_CONTROL,
@@ -1973,8 +1977,9 @@ 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)
+				   struct intel_cdclk_config *b)
 {
+	struct cdclk_step *cdclk_transition = b->steps;
 	/*
 	 * FIXME should store a bit more state in intel_cdclk_config
 	 * to differentiate squasher vs. cd2x divider properly. For
@@ -1984,6 +1989,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 &&
-- 
2.25.1



More information about the Intel-gfx-trybot mailing list