[PATCH 6/7] drm/i915/display: Change intel_cdclk_can_crawl()
Anusha Srivatsa
anusha.srivatsa at intel.com
Tue Aug 30 20:05:01 UTC 2022
Signed-off-by: Anusha Srivatsa <anusha.srivatsa at intel.com>
---
drivers/gpu/drm/i915/display/intel_cdclk.c | 19 ++++++++++++++-----
1 file changed, 14 insertions(+), 5 deletions(-)
diff --git a/drivers/gpu/drm/i915/display/intel_cdclk.c b/drivers/gpu/drm/i915/display/intel_cdclk.c
index 19d153bbf52d..33e99cc5403a 100644
--- a/drivers/gpu/drm/i915/display/intel_cdclk.c
+++ b/drivers/gpu/drm/i915/display/intel_cdclk.c
@@ -38,9 +38,9 @@
#include "intel_psr.h"
#include "vlv_sideband.h"
-#define ADLP_CDCLK_CRAWL(i915, vco) (HAS_CDCLK_CRAWL(i915) && \
- i915->cdclk.hw.vco > 0 && \
- ((vco) > 0))
+#define ADLP_CDCLK_CRAWL(i915, vco) (HAS_CDCLK_CRAWL(i915) && \
+ i915->cdclk.hw.vco > 0 && \
+ ((vco) > 0))
/**
* DOC: CDCLK / RAWCLK
@@ -1959,8 +1959,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))
@@ -1973,6 +1975,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 &&
@@ -2778,7 +2786,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