Skip to content

Commit 32a120f

Browse files
committed
drm/i915/mtl: Skip PLL state verification in TBT mode
In TBT-alt mode the driver doesn't program the PHY's PLL, which is handled instead by Thunderbolt driver/FW components, hence the PLL's HW vs. SW state verification should be skipped. During HW readout set a flag in the PLL state if the port was at the moment in TBT-alt mode and skip the verification of PLL parameters in this case. Fixes: 45fe957 ("drm/i915/display: Add compare config for MTL+ platforms") Closes: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/11258 Cc: Mika Kahola <[email protected]> Reviewed-by: Mika Kahola <[email protected]> Signed-off-by: Imre Deak <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent a9422ec commit 32a120f

File tree

3 files changed

+12
-8
lines changed

3 files changed

+12
-8
lines changed

drivers/gpu/drm/i915/display/intel_cx0_phy.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3279,6 +3279,10 @@ void intel_cx0pll_readout_hw_state(struct intel_encoder *encoder,
32793279
{
32803280
pll_state->use_c10 = false;
32813281

3282+
pll_state->tbt_mode = intel_tc_port_in_tbt_alt_mode(enc_to_dig_port(encoder));
3283+
if (pll_state->tbt_mode)
3284+
return;
3285+
32823286
if (intel_encoder_is_c10phy(encoder)) {
32833287
intel_c10pll_readout_hw_state(encoder, &pll_state->c10);
32843288
pll_state->use_c10 = true;
@@ -3325,6 +3329,8 @@ static bool mtl_compare_hw_state_c20(const struct intel_c20pll_state *a,
33253329
bool intel_cx0pll_compare_hw_state(const struct intel_cx0pll_state *a,
33263330
const struct intel_cx0pll_state *b)
33273331
{
3332+
if (a->tbt_mode || b->tbt_mode)
3333+
return true;
33283334

33293335
if (a->use_c10 != b->use_c10)
33303336
return false;
@@ -3420,12 +3426,11 @@ void intel_cx0pll_state_verify(struct intel_atomic_state *state,
34203426
return;
34213427

34223428
encoder = intel_get_crtc_new_encoder(state, new_crtc_state);
3429+
intel_cx0pll_readout_hw_state(encoder, &mpll_hw_state);
34233430

3424-
if (intel_tc_port_in_tbt_alt_mode(enc_to_dig_port(encoder)))
3431+
if (mpll_hw_state.tbt_mode)
34253432
return;
34263433

3427-
intel_cx0pll_readout_hw_state(encoder, &mpll_hw_state);
3428-
34293434
if (intel_encoder_is_c10phy(encoder))
34303435
intel_c10pll_state_verify(new_crtc_state, crtc, encoder, &mpll_hw_state.c10);
34313436
else

drivers/gpu/drm/i915/display/intel_ddi.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4027,14 +4027,12 @@ void intel_ddi_get_clock(struct intel_encoder *encoder,
40274027
static void mtl_ddi_get_config(struct intel_encoder *encoder,
40284028
struct intel_crtc_state *crtc_state)
40294029
{
4030-
struct intel_digital_port *dig_port = enc_to_dig_port(encoder);
4030+
intel_cx0pll_readout_hw_state(encoder, &crtc_state->dpll_hw_state.cx0pll);
40314031

4032-
if (intel_tc_port_in_tbt_alt_mode(dig_port)) {
4032+
if (crtc_state->dpll_hw_state.cx0pll.tbt_mode)
40334033
crtc_state->port_clock = intel_mtl_tbt_calc_port_clock(encoder);
4034-
} else {
4035-
intel_cx0pll_readout_hw_state(encoder, &crtc_state->dpll_hw_state.cx0pll);
4034+
else
40364035
crtc_state->port_clock = intel_cx0pll_calc_port_clock(encoder, &crtc_state->dpll_hw_state.cx0pll);
4037-
}
40384036

40394037
intel_ddi_get_config(encoder, crtc_state);
40404038
}

drivers/gpu/drm/i915/display/intel_dpll_mgr.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,7 @@ struct intel_cx0pll_state {
265265
};
266266
bool ssc_enabled;
267267
bool use_c10;
268+
bool tbt_mode;
268269
};
269270

270271
struct intel_dpll_hw_state {

0 commit comments

Comments
 (0)