@@ -2763,9 +2763,9 @@ static void intel_program_port_clock_ctl(struct intel_encoder *encoder,
2763
2763
val |= XELPDP_FORWARD_CLOCK_UNGATE ;
2764
2764
2765
2765
if (!is_dp && is_hdmi_frl (port_clock ))
2766
- val |= XELPDP_DDI_CLOCK_SELECT ( XELPDP_DDI_CLOCK_SELECT_DIV18CLK );
2766
+ val |= XELPDP_DDI_CLOCK_SELECT_PREP ( display , XELPDP_DDI_CLOCK_SELECT_DIV18CLK );
2767
2767
else
2768
- val |= XELPDP_DDI_CLOCK_SELECT ( XELPDP_DDI_CLOCK_SELECT_MAXPCLK );
2768
+ val |= XELPDP_DDI_CLOCK_SELECT_PREP ( display , XELPDP_DDI_CLOCK_SELECT_MAXPCLK );
2769
2769
2770
2770
/* TODO: HDMI FRL */
2771
2771
/* DP2.0 10G and 20G rates enable MPLLA*/
@@ -2776,7 +2776,7 @@ static void intel_program_port_clock_ctl(struct intel_encoder *encoder,
2776
2776
2777
2777
intel_de_rmw (display , XELPDP_PORT_CLOCK_CTL (display , encoder -> port ),
2778
2778
XELPDP_LANE1_PHY_CLOCK_SELECT | XELPDP_FORWARD_CLOCK_UNGATE |
2779
- XELPDP_DDI_CLOCK_SELECT_MASK | XELPDP_SSC_ENABLE_PLLA |
2779
+ XELPDP_DDI_CLOCK_SELECT_MASK ( display ) | XELPDP_SSC_ENABLE_PLLA |
2780
2780
XELPDP_SSC_ENABLE_PLLB , val );
2781
2781
}
2782
2782
@@ -3099,10 +3099,7 @@ int intel_mtl_tbt_calc_port_clock(struct intel_encoder *encoder)
3099
3099
3100
3100
val = intel_de_read (display , XELPDP_PORT_CLOCK_CTL (display , encoder -> port ));
3101
3101
3102
- if (DISPLAY_VER (display ) >= 30 )
3103
- clock = REG_FIELD_GET (XE3_DDI_CLOCK_SELECT_MASK , val );
3104
- else
3105
- clock = REG_FIELD_GET (XELPDP_DDI_CLOCK_SELECT_MASK , val );
3102
+ clock = XELPDP_DDI_CLOCK_SELECT_GET (display , val );
3106
3103
3107
3104
drm_WARN_ON (display -> drm , !(val & XELPDP_FORWARD_CLOCK_UNGATE ));
3108
3105
drm_WARN_ON (display -> drm , !(val & XELPDP_TBT_CLOCK_REQUEST ));
@@ -3170,13 +3167,9 @@ static void intel_mtl_tbt_pll_enable(struct intel_encoder *encoder,
3170
3167
* clock muxes, gating and SSC
3171
3168
*/
3172
3169
3173
- if (DISPLAY_VER (display ) >= 30 ) {
3174
- mask = XE3_DDI_CLOCK_SELECT_MASK ;
3175
- val |= XE3_DDI_CLOCK_SELECT (intel_mtl_tbt_clock_select (display , crtc_state -> port_clock ));
3176
- } else {
3177
- mask = XELPDP_DDI_CLOCK_SELECT_MASK ;
3178
- val |= XELPDP_DDI_CLOCK_SELECT (intel_mtl_tbt_clock_select (display , crtc_state -> port_clock ));
3179
- }
3170
+ mask = XELPDP_DDI_CLOCK_SELECT_MASK (display );
3171
+ val |= XELPDP_DDI_CLOCK_SELECT_PREP (display ,
3172
+ intel_mtl_tbt_clock_select (display , crtc_state -> port_clock ));
3180
3173
3181
3174
mask |= XELPDP_FORWARD_CLOCK_UNGATE ;
3182
3175
val |= XELPDP_FORWARD_CLOCK_UNGATE ;
@@ -3289,7 +3282,7 @@ static void intel_cx0pll_disable(struct intel_encoder *encoder)
3289
3282
3290
3283
/* 7. Program PORT_CLOCK_CTL register to disable and gate clocks. */
3291
3284
intel_de_rmw (display , XELPDP_PORT_CLOCK_CTL (display , encoder -> port ),
3292
- XELPDP_DDI_CLOCK_SELECT_MASK , 0 );
3285
+ XELPDP_DDI_CLOCK_SELECT_MASK ( display ) , 0 );
3293
3286
intel_de_rmw (display , XELPDP_PORT_CLOCK_CTL (display , encoder -> port ),
3294
3287
XELPDP_FORWARD_CLOCK_UNGATE , 0 );
3295
3288
@@ -3338,7 +3331,7 @@ static void intel_mtl_tbt_pll_disable(struct intel_encoder *encoder)
3338
3331
* 5. Program PORT CLOCK CTRL register to disable and gate clocks
3339
3332
*/
3340
3333
intel_de_rmw (display , XELPDP_PORT_CLOCK_CTL (display , encoder -> port ),
3341
- XELPDP_DDI_CLOCK_SELECT_MASK |
3334
+ XELPDP_DDI_CLOCK_SELECT_MASK ( display ) |
3342
3335
XELPDP_FORWARD_CLOCK_UNGATE , 0 );
3343
3336
3344
3337
/* 6. Program DDI_CLK_VALFREQ to 0. */
@@ -3367,7 +3360,7 @@ intel_mtl_port_pll_type(struct intel_encoder *encoder,
3367
3360
* handling is done via the standard shared DPLL framework.
3368
3361
*/
3369
3362
val = intel_de_read (display , XELPDP_PORT_CLOCK_CTL (display , encoder -> port ));
3370
- clock = REG_FIELD_GET ( XELPDP_DDI_CLOCK_SELECT_MASK , val );
3363
+ clock = XELPDP_DDI_CLOCK_SELECT_GET ( display , val );
3371
3364
3372
3365
if (clock == XELPDP_DDI_CLOCK_SELECT_MAXPCLK ||
3373
3366
clock == XELPDP_DDI_CLOCK_SELECT_DIV18CLK )
0 commit comments