Skip to content

Commit

Permalink
drm/i915: Allow cdclk squasher to be reconfigured live
Browse files Browse the repository at this point in the history
Supposedly we should be able to change the cdclk squasher waveform
even when many pipes are active. Make it so.

Signed-off-by: Ville Syrjälä <[email protected]>
Reviewed-by: Mika Kahola <[email protected]>
Signed-off-by: Stanislav Lisovskiy <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
  • Loading branch information
vsyrjala authored and StanFox1984 committed Dec 7, 2021
1 parent 77ab3a1 commit d4a2393
Showing 1 changed file with 37 additions and 3 deletions.
40 changes: 37 additions & 3 deletions drivers/gpu/drm/i915/display/intel_cdclk.c
Original file line number Diff line number Diff line change
Expand Up @@ -1951,6 +1951,25 @@ static bool intel_cdclk_can_crawl(struct drm_i915_private *dev_priv,
a->ref == b->ref;
}

static bool intel_cdclk_can_squash(struct drm_i915_private *dev_priv,
const struct intel_cdclk_config *a,
const struct intel_cdclk_config *b)
{
/*
* FIXME should store a bit more state in intel_cdclk_config
* to differentiate squasher vs. cd2x divider properly. For
* the moment all platforms with squasher use a fixed cd2x
* divider.
*/
if (!has_cdclk_squasher(dev_priv))
return false;

return a->cdclk != b->cdclk &&
a->vco != 0 &&
a->vco == b->vco &&
a->ref == b->ref;
}

/**
* intel_cdclk_needs_modeset - Determine if changong between the CDCLK
* configurations requires a modeset on all pipes
Expand Down Expand Up @@ -1988,7 +2007,17 @@ static bool intel_cdclk_can_cd2x_update(struct drm_i915_private *dev_priv,
if (DISPLAY_VER(dev_priv) < 10 && !IS_BROXTON(dev_priv))
return false;

/*
* FIXME should store a bit more state in intel_cdclk_config
* to differentiate squasher vs. cd2x divider properly. For
* the moment all platforms with squasher use a fixed cd2x
* divider.
*/
if (has_cdclk_squasher(dev_priv))
return false;

return a->cdclk != b->cdclk &&
a->vco != 0 &&
a->vco == b->vco &&
a->ref == b->ref;
}
Expand Down Expand Up @@ -2672,9 +2701,14 @@ int intel_modeset_calc_cdclk(struct intel_atomic_state *state)
pipe = INVALID_PIPE;
}

if (intel_cdclk_can_crawl(dev_priv,
&old_cdclk_state->actual,
&new_cdclk_state->actual)) {
if (intel_cdclk_can_squash(dev_priv,
&old_cdclk_state->actual,
&new_cdclk_state->actual)) {
drm_dbg_kms(&dev_priv->drm,
"Can change cdclk via squasher\n");
} else if (intel_cdclk_can_crawl(dev_priv,
&old_cdclk_state->actual,
&new_cdclk_state->actual)) {
drm_dbg_kms(&dev_priv->drm,
"Can change cdclk via crawl\n");
} else if (pipe != INVALID_PIPE) {
Expand Down

0 comments on commit d4a2393

Please sign in to comment.