drm/i915/cdclk: Remove the hardcoded divider from cdclk_compute_crawl_and_squash_midp...
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Wed, 7 Feb 2024 01:33:33 +0000 (03:33 +0200)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Fri, 16 Feb 2024 15:11:20 +0000 (17:11 +0200)
commitc0151c695fbefcef816432e00d2f8d427ebf3125
tree20e455b04e6ac89315c9eba39db3b1e5614db58a
parent76184fa3d32ed9b43da7c451cbbb45e567d20196
drm/i915/cdclk: Remove the hardcoded divider from cdclk_compute_crawl_and_squash_midpoint()

cdclk_compute_crawl_and_squash_midpoint() was still assuming
that cd2x divider == 1 (ie. full divider == 2). Remove that
assumption by computing the dividers properly.

We'll also toss in a WARN in case the divider somehow ends
up different between the old and new cdclk configs. That should
never happen given we have div==2 in all the cdclk table entries
for the affected platforms.

If in the future we need a config where the divider also needs
to be changed then we likely need to add an extra step into the
cdclk programming sequence to make sure things stay within
legal limits throughout the process.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240207013334.29606-4-ville.syrjala@linux.intel.com
Reviewed-by: Gustavo Sousa <gustavo.sousa@intel.com>
drivers/gpu/drm/i915/display/intel_cdclk.c