drm/i915/display: Do both crawl and squash when changing cdclk
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Thu, 17 Nov 2022 23:00:01 +0000 (15:00 -0800)
committerAnusha Srivatsa <anusha.srivatsa@intel.com>
Mon, 21 Nov 2022 23:19:28 +0000 (15:19 -0800)
commit25e0e5ae561003817797c23ae3b85cf510be11c5
tree74286d7de5c18cac7de6f028b43868a8a232551d
parent9a0a4ec530a7514ccd6061ecdeaf719a03cb34cd
drm/i915/display: Do both crawl and squash when changing cdclk

For MTL, changing cdclk from between certain frequencies has
both squash and crawl. Use the current cdclk config and
the new(desired) cdclk config to construct a mid cdclk config.
Set the cdclk twice:
- Current cdclk -> mid cdclk
- mid cdclk -> desired cdclk

Driver should not take some Pcode mailbox communication
in the cdclk path for platforms that are Display version 14 and later.

v2: Add check in intel_modeset_calc_cdclk() to avoid cdclk
change via modeset for platforms that support squash_crawl sequences(Ville)

v3: Add checks for:
- scenario where only slow clock is used and
cdclk is actually 0 (bringing up display).
- PLLs are on before looking up the waveform.
- Squash and crawl capability checks.(Ville)

v4: Rebase
- Move checks to be more consistent (Ville)
- Add comments (Bala)
v5:
- Further small changes. Move checks around.
- Make if-else better looking (Ville)

v6: MTl should not follow PUnit mailbox communication as the rest of
gen11+ platforms.(Anusha)

Cc: Clint Taylor <Clinton.A.Taylor@intel.com>
Cc: Balasubramani Vivekanandan <balasubramani.vivekanandan@intel.com>
Signed-off-by: Anusha Srivatsa <anusha.srivatsa@intel.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Matt Roper <matthew.d.roper@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20221117230002.792096-2-anusha.srivatsa@intel.com
drivers/gpu/drm/i915/display/intel_cdclk.c