Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/i915/dsi: Don't set/read the DSI C clock divider on GLK

GLK doesn't use the DSI C clock at all, no need to program
the divider for it. Bspec even says: "Do not program this field".

However looks like some firmware versions program this and
some do not. In order to avoid bogus fastset mismatches
we should also filter it out during readout.

v2: Clear all the DSI C clock bits during readout (Jani)
Adjust platform checks for new style, and add
has_dsic_clock() while at it.

Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250718112928.27669-1-ville.syrjala@linux.intel.com

+11 -2
+11 -2
drivers/gpu/drm/i915/display/vlv_dsi_pll.c
··· 262 262 vlv_cck_put(display->drm); 263 263 } 264 264 265 + static bool has_dsic_clock(struct intel_display *display) 266 + { 267 + return display->platform.broxton; 268 + } 269 + 265 270 bool bxt_dsi_pll_is_enabled(struct intel_display *display) 266 271 { 267 272 bool enabled; ··· 289 284 * causes a system hang. 290 285 */ 291 286 val = intel_de_read(display, BXT_DSI_PLL_CTL); 292 - if (display->platform.geminilake) { 287 + if (!has_dsic_clock(display)) { 293 288 if (!(val & BXT_DSIA_16X_MASK)) { 294 289 drm_dbg_kms(display->drm, 295 290 "Invalid PLL divider (%08x)\n", val); ··· 363 358 u32 pclk; 364 359 365 360 config->dsi_pll.ctrl = intel_de_read(display, BXT_DSI_PLL_CTL); 361 + if (!has_dsic_clock(display)) 362 + config->dsi_pll.ctrl &= ~BXT_DSIC_16X_MASK; 366 363 367 364 pclk = bxt_dsi_pclk(encoder, config); 368 365 ··· 521 514 * Spec says both have to be programmed, even if one is not getting 522 515 * used. Configure MIPI_CLOCK_CTL dividers in modeset 523 516 */ 524 - config->dsi_pll.ctrl = dsi_ratio | BXT_DSIA_16X_BY2 | BXT_DSIC_16X_BY2; 517 + config->dsi_pll.ctrl = dsi_ratio | BXT_DSIA_16X_BY2; 518 + if (has_dsic_clock(display)) 519 + config->dsi_pll.ctrl |= BXT_DSIC_16X_BY2; 525 520 526 521 /* As per recommendation from hardware team, 527 522 * Prog PVD ratio =1 if dsi ratio <= 50