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

Configure Feed

Select the types of activity you want to include in your feed.

drm/i915: move CPT clock gating init into intel_pch

Move the CPT PCH clock gating programming into
intel_pch_init_clock_gating() and switch the corresponding IVB callers
to the display-specific code.

Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patch.msgid.link/20260324080441.154609-3-luciano.coelho@intel.com
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>

+42 -37
+40
drivers/gpu/drm/i915/display/intel_pch.c
··· 6 6 #include <drm/drm_print.h> 7 7 8 8 #include "intel_de.h" 9 + #include "intel_display.h" 9 10 #include "intel_display_regs.h" 10 11 #include "intel_display_core.h" 11 12 #include "intel_display_utils.h" ··· 228 227 PCH_DPLSUNIT_CLOCK_GATE_DISABLE); 229 228 } 230 229 230 + static void intel_pch_cpt_init_clock_gating(struct intel_display *display) 231 + { 232 + enum pipe pipe; 233 + u32 val; 234 + 235 + /* 236 + * On Ibex Peak and Cougar Point, we need to disable clock 237 + * gating for the panel power sequencer or it will fail to 238 + * start up when no ports are active. 239 + */ 240 + intel_de_write(display, SOUTH_DSPCLK_GATE_D, 241 + PCH_DPLSUNIT_CLOCK_GATE_DISABLE | 242 + PCH_DPLUNIT_CLOCK_GATE_DISABLE | 243 + PCH_CPUNIT_CLOCK_GATE_DISABLE); 244 + intel_de_rmw(display, SOUTH_CHICKEN2, 0, DPLS_EDP_PPS_FIX_DIS); 245 + 246 + /* The below fixes the weird display corruption, a few pixels shifted 247 + * downward, on (only) LVDS of some HP laptops with IVY. 248 + */ 249 + for_each_pipe(display, pipe) { 250 + val = intel_de_read(display, TRANS_CHICKEN2(pipe)); 251 + val |= TRANS_CHICKEN2_TIMING_OVERRIDE; 252 + val &= ~TRANS_CHICKEN2_FDI_POLARITY_REVERSED; 253 + if (display->vbt.fdi_rx_polarity_inverted) 254 + val |= TRANS_CHICKEN2_FDI_POLARITY_REVERSED; 255 + val &= ~TRANS_CHICKEN2_DISABLE_DEEP_COLOR_COUNTER; 256 + val &= ~TRANS_CHICKEN2_DISABLE_DEEP_COLOR_MODESWITCH; 257 + intel_de_write(display, TRANS_CHICKEN2(pipe), val); 258 + } 259 + 260 + /* WADP0ClockGatingDisable */ 261 + for_each_pipe(display, pipe) 262 + intel_de_write(display, TRANS_CHICKEN1(pipe), 263 + TRANS_CHICKEN1_DP0UNIT_GC_DISABLE); 264 + } 265 + 231 266 void intel_pch_init_clock_gating(struct intel_display *display) 232 267 { 233 268 switch (INTEL_PCH_TYPE(display)) { 234 269 case PCH_IBX: 235 270 intel_pch_ibx_init_clock_gating(display); 271 + break; 272 + case PCH_CPT: 273 + intel_pch_cpt_init_clock_gating(display); 236 274 break; 237 275 default: 238 276 break;
+2 -37
drivers/gpu/drm/i915/intel_clock_gating.c
··· 196 196 intel_pch_init_clock_gating(i915->display); 197 197 } 198 198 199 - static void cpt_init_clock_gating(struct drm_i915_private *i915) 200 - { 201 - struct intel_display *display = i915->display; 202 - enum pipe pipe; 203 - u32 val; 204 - 205 - /* 206 - * On Ibex Peak and Cougar Point, we need to disable clock 207 - * gating for the panel power sequencer or it will fail to 208 - * start up when no ports are active. 209 - */ 210 - intel_uncore_write(&i915->uncore, SOUTH_DSPCLK_GATE_D, PCH_DPLSUNIT_CLOCK_GATE_DISABLE | 211 - PCH_DPLUNIT_CLOCK_GATE_DISABLE | 212 - PCH_CPUNIT_CLOCK_GATE_DISABLE); 213 - intel_uncore_rmw(&i915->uncore, SOUTH_CHICKEN2, 0, DPLS_EDP_PPS_FIX_DIS); 214 - /* The below fixes the weird display corruption, a few pixels shifted 215 - * downward, on (only) LVDS of some HP laptops with IVY. 216 - */ 217 - for_each_pipe(display, pipe) { 218 - val = intel_uncore_read(&i915->uncore, TRANS_CHICKEN2(pipe)); 219 - val |= TRANS_CHICKEN2_TIMING_OVERRIDE; 220 - val &= ~TRANS_CHICKEN2_FDI_POLARITY_REVERSED; 221 - if (display->vbt.fdi_rx_polarity_inverted) 222 - val |= TRANS_CHICKEN2_FDI_POLARITY_REVERSED; 223 - val &= ~TRANS_CHICKEN2_DISABLE_DEEP_COLOR_COUNTER; 224 - val &= ~TRANS_CHICKEN2_DISABLE_DEEP_COLOR_MODESWITCH; 225 - intel_uncore_write(&i915->uncore, TRANS_CHICKEN2(pipe), val); 226 - } 227 - /* WADP0ClockGatingDisable */ 228 - for_each_pipe(display, pipe) { 229 - intel_uncore_write(&i915->uncore, TRANS_CHICKEN1(pipe), 230 - TRANS_CHICKEN1_DP0UNIT_GC_DISABLE); 231 - } 232 - } 233 - 234 199 static void gen6_check_mch_setup(struct drm_i915_private *i915) 235 200 { 236 201 u32 tmp; ··· 261 296 262 297 g4x_disable_trickle_feed(i915); 263 298 264 - cpt_init_clock_gating(i915); 299 + intel_pch_init_clock_gating(i915->display); 265 300 266 301 gen6_check_mch_setup(i915); 267 302 } ··· 501 536 GEN6_MBC_SNPCR_MED); 502 537 503 538 if (!HAS_PCH_NOP(display)) 504 - cpt_init_clock_gating(i915); 539 + intel_pch_init_clock_gating(display); 505 540 506 541 gen6_check_mch_setup(i915); 507 542 }