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

drm/i915/combo-phy: convert intel_combo_phy.[ch] to struct intel_display

Going forward, struct intel_display is the main display device data
pointer. Convert as much as possible of intel_combo_phy.[ch] to struct
intel_display, along with intel_phy_is_combo() in intel_display.c.

Drive-by convert some drm_dbg() to drm_dbg_kms() while at it.

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

+109 -113
+3 -3
drivers/gpu/drm/i915/display/icl_dsi.c
··· 31 31 #include <drm/drm_mipi_dsi.h> 32 32 #include <drm/drm_probe_helper.h> 33 33 34 - #include "i915_drv.h" 35 34 #include "i915_reg.h" 35 + #include "i915_utils.h" 36 36 #include "icl_dsi.h" 37 37 #include "icl_dsi_regs.h" 38 38 #include "intel_atomic.h" ··· 413 413 414 414 static void gen11_dsi_power_up_lanes(struct intel_encoder *encoder) 415 415 { 416 - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); 416 + struct intel_display *display = to_intel_display(encoder); 417 417 struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); 418 418 enum phy phy; 419 419 420 420 for_each_dsi_phy(phy, intel_dsi->phys) 421 - intel_combo_phy_power_up_lanes(dev_priv, phy, true, 421 + intel_combo_phy_power_up_lanes(display, phy, true, 422 422 intel_dsi->lane_count, false); 423 423 } 424 424
+89 -91
drivers/gpu/drm/i915/display/intel_combo_phy.c
··· 3 3 * Copyright © 2018 Intel Corporation 4 4 */ 5 5 6 - #include "i915_drv.h" 7 6 #include "i915_reg.h" 7 + #include "i915_utils.h" 8 8 #include "intel_combo_phy.h" 9 9 #include "intel_combo_phy_regs.h" 10 10 #include "intel_de.h" 11 11 #include "intel_display_types.h" 12 12 13 - #define for_each_combo_phy(__dev_priv, __phy) \ 13 + #define for_each_combo_phy(__display, __phy) \ 14 14 for ((__phy) = PHY_A; (__phy) < I915_MAX_PHYS; (__phy)++) \ 15 - for_each_if(intel_phy_is_combo(__dev_priv, __phy)) 15 + for_each_if(intel_phy_is_combo(__display, __phy)) 16 16 17 - #define for_each_combo_phy_reverse(__dev_priv, __phy) \ 17 + #define for_each_combo_phy_reverse(__display, __phy) \ 18 18 for ((__phy) = I915_MAX_PHYS; (__phy)-- > PHY_A;) \ 19 - for_each_if(intel_phy_is_combo(__dev_priv, __phy)) 19 + for_each_if(intel_phy_is_combo(__display, __phy)) 20 20 21 21 enum { 22 22 PROCMON_0_85V_DOT_0, ··· 53 53 }; 54 54 55 55 static const struct icl_procmon * 56 - icl_get_procmon_ref_values(struct drm_i915_private *dev_priv, enum phy phy) 56 + icl_get_procmon_ref_values(struct intel_display *display, enum phy phy) 57 57 { 58 58 u32 val; 59 59 60 - val = intel_de_read(dev_priv, ICL_PORT_COMP_DW3(phy)); 60 + val = intel_de_read(display, ICL_PORT_COMP_DW3(phy)); 61 61 switch (val & (PROCESS_INFO_MASK | VOLTAGE_INFO_MASK)) { 62 62 default: 63 63 MISSING_CASE(val); ··· 75 75 } 76 76 } 77 77 78 - static void icl_set_procmon_ref_values(struct drm_i915_private *dev_priv, 78 + static void icl_set_procmon_ref_values(struct intel_display *display, 79 79 enum phy phy) 80 80 { 81 81 const struct icl_procmon *procmon; 82 82 83 - procmon = icl_get_procmon_ref_values(dev_priv, phy); 83 + procmon = icl_get_procmon_ref_values(display, phy); 84 84 85 - intel_de_rmw(dev_priv, ICL_PORT_COMP_DW1(phy), 85 + intel_de_rmw(display, ICL_PORT_COMP_DW1(phy), 86 86 (0xff << 16) | 0xff, procmon->dw1); 87 87 88 - intel_de_write(dev_priv, ICL_PORT_COMP_DW9(phy), procmon->dw9); 89 - intel_de_write(dev_priv, ICL_PORT_COMP_DW10(phy), procmon->dw10); 88 + intel_de_write(display, ICL_PORT_COMP_DW9(phy), procmon->dw9); 89 + intel_de_write(display, ICL_PORT_COMP_DW10(phy), procmon->dw10); 90 90 } 91 91 92 - static bool check_phy_reg(struct drm_i915_private *dev_priv, 92 + static bool check_phy_reg(struct intel_display *display, 93 93 enum phy phy, i915_reg_t reg, u32 mask, 94 94 u32 expected_val) 95 95 { 96 - u32 val = intel_de_read(dev_priv, reg); 96 + u32 val = intel_de_read(display, reg); 97 97 98 98 if ((val & mask) != expected_val) { 99 - drm_dbg(&dev_priv->drm, 100 - "Combo PHY %c reg %08x state mismatch: " 101 - "current %08x mask %08x expected %08x\n", 102 - phy_name(phy), 103 - reg.reg, val, mask, expected_val); 99 + drm_dbg_kms(display->drm, 100 + "Combo PHY %c reg %08x state mismatch: " 101 + "current %08x mask %08x expected %08x\n", 102 + phy_name(phy), 103 + reg.reg, val, mask, expected_val); 104 104 return false; 105 105 } 106 106 107 107 return true; 108 108 } 109 109 110 - static bool icl_verify_procmon_ref_values(struct drm_i915_private *dev_priv, 110 + static bool icl_verify_procmon_ref_values(struct intel_display *display, 111 111 enum phy phy) 112 112 { 113 113 const struct icl_procmon *procmon; 114 114 bool ret; 115 115 116 - procmon = icl_get_procmon_ref_values(dev_priv, phy); 116 + procmon = icl_get_procmon_ref_values(display, phy); 117 117 118 - ret = check_phy_reg(dev_priv, phy, ICL_PORT_COMP_DW1(phy), 118 + ret = check_phy_reg(display, phy, ICL_PORT_COMP_DW1(phy), 119 119 (0xff << 16) | 0xff, procmon->dw1); 120 - ret &= check_phy_reg(dev_priv, phy, ICL_PORT_COMP_DW9(phy), 120 + ret &= check_phy_reg(display, phy, ICL_PORT_COMP_DW9(phy), 121 121 -1U, procmon->dw9); 122 - ret &= check_phy_reg(dev_priv, phy, ICL_PORT_COMP_DW10(phy), 122 + ret &= check_phy_reg(display, phy, ICL_PORT_COMP_DW10(phy), 123 123 -1U, procmon->dw10); 124 124 125 125 return ret; 126 126 } 127 127 128 - static bool has_phy_misc(struct drm_i915_private *i915, enum phy phy) 128 + static bool has_phy_misc(struct intel_display *display, enum phy phy) 129 129 { 130 130 /* 131 131 * Some platforms only expect PHY_MISC to be programmed for PHY-A and ··· 136 136 * that we program it for PHY A. 137 137 */ 138 138 139 - if (IS_ALDERLAKE_S(i915)) 139 + if (display->platform.alderlake_s) 140 140 return phy == PHY_A; 141 - else if ((IS_JASPERLAKE(i915) || IS_ELKHARTLAKE(i915)) || 142 - IS_ROCKETLAKE(i915) || 143 - IS_DG1(i915)) 141 + else if ((display->platform.jasperlake || display->platform.elkhartlake) || 142 + display->platform.rocketlake || 143 + display->platform.dg1) 144 144 return phy < PHY_C; 145 145 146 146 return true; 147 147 } 148 148 149 - static bool icl_combo_phy_enabled(struct drm_i915_private *dev_priv, 149 + static bool icl_combo_phy_enabled(struct intel_display *display, 150 150 enum phy phy) 151 151 { 152 152 /* The PHY C added by EHL has no PHY_MISC register */ 153 - if (!has_phy_misc(dev_priv, phy)) 154 - return intel_de_read(dev_priv, ICL_PORT_COMP_DW0(phy)) & COMP_INIT; 153 + if (!has_phy_misc(display, phy)) 154 + return intel_de_read(display, ICL_PORT_COMP_DW0(phy)) & COMP_INIT; 155 155 else 156 - return !(intel_de_read(dev_priv, ICL_PHY_MISC(phy)) & 156 + return !(intel_de_read(display, ICL_PHY_MISC(phy)) & 157 157 ICL_PHY_MISC_DE_IO_COMP_PWR_DOWN) && 158 - (intel_de_read(dev_priv, ICL_PORT_COMP_DW0(phy)) & COMP_INIT); 158 + (intel_de_read(display, ICL_PORT_COMP_DW0(phy)) & COMP_INIT); 159 159 } 160 160 161 - static bool ehl_vbt_ddi_d_present(struct drm_i915_private *i915) 161 + static bool ehl_vbt_ddi_d_present(struct intel_display *display) 162 162 { 163 - struct intel_display *display = &i915->display; 164 - 165 163 bool ddi_a_present = intel_bios_is_port_present(display, PORT_A); 166 164 bool ddi_d_present = intel_bios_is_port_present(display, PORT_D); 167 165 bool dsi_present = intel_bios_is_dsi_present(display, NULL); ··· 179 181 * in the log and let the internal display win. 180 182 */ 181 183 if (ddi_d_present) 182 - drm_err(&i915->drm, 184 + drm_err(display->drm, 183 185 "VBT claims to have both internal and external displays on PHY A. Configuring for internal.\n"); 184 186 185 187 return false; 186 188 } 187 189 188 - static bool phy_is_master(struct drm_i915_private *dev_priv, enum phy phy) 190 + static bool phy_is_master(struct intel_display *display, enum phy phy) 189 191 { 190 192 /* 191 193 * Certain PHYs are connected to compensation resistors and act ··· 205 207 */ 206 208 if (phy == PHY_A) 207 209 return true; 208 - else if (IS_ALDERLAKE_S(dev_priv)) 210 + else if (display->platform.alderlake_s) 209 211 return phy == PHY_D; 210 - else if (IS_DG1(dev_priv) || IS_ROCKETLAKE(dev_priv)) 212 + else if (display->platform.dg1 || display->platform.rocketlake) 211 213 return phy == PHY_C; 212 214 213 215 return false; 214 216 } 215 217 216 - static bool icl_combo_phy_verify_state(struct drm_i915_private *dev_priv, 218 + static bool icl_combo_phy_verify_state(struct intel_display *display, 217 219 enum phy phy) 218 220 { 219 221 bool ret = true; 220 222 u32 expected_val = 0; 221 223 222 - if (!icl_combo_phy_enabled(dev_priv, phy)) 224 + if (!icl_combo_phy_enabled(display, phy)) 223 225 return false; 224 226 225 - if (DISPLAY_VER(dev_priv) >= 12) { 226 - ret &= check_phy_reg(dev_priv, phy, ICL_PORT_TX_DW8_LN(0, phy), 227 + if (DISPLAY_VER(display) >= 12) { 228 + ret &= check_phy_reg(display, phy, ICL_PORT_TX_DW8_LN(0, phy), 227 229 ICL_PORT_TX_DW8_ODCC_CLK_SEL | 228 230 ICL_PORT_TX_DW8_ODCC_CLK_DIV_SEL_MASK, 229 231 ICL_PORT_TX_DW8_ODCC_CLK_SEL | 230 232 ICL_PORT_TX_DW8_ODCC_CLK_DIV_SEL_DIV2); 231 233 232 - ret &= check_phy_reg(dev_priv, phy, ICL_PORT_PCS_DW1_LN(0, phy), 234 + ret &= check_phy_reg(display, phy, ICL_PORT_PCS_DW1_LN(0, phy), 233 235 DCC_MODE_SELECT_MASK, RUN_DCC_ONCE); 234 236 } 235 237 236 - ret &= icl_verify_procmon_ref_values(dev_priv, phy); 238 + ret &= icl_verify_procmon_ref_values(display, phy); 237 239 238 - if (phy_is_master(dev_priv, phy)) { 239 - ret &= check_phy_reg(dev_priv, phy, ICL_PORT_COMP_DW8(phy), 240 + if (phy_is_master(display, phy)) { 241 + ret &= check_phy_reg(display, phy, ICL_PORT_COMP_DW8(phy), 240 242 IREFGEN, IREFGEN); 241 243 242 - if (IS_JASPERLAKE(dev_priv) || IS_ELKHARTLAKE(dev_priv)) { 243 - if (ehl_vbt_ddi_d_present(dev_priv)) 244 + if (display->platform.jasperlake || display->platform.elkhartlake) { 245 + if (ehl_vbt_ddi_d_present(display)) 244 246 expected_val = ICL_PHY_MISC_MUX_DDID; 245 247 246 - ret &= check_phy_reg(dev_priv, phy, ICL_PHY_MISC(phy), 248 + ret &= check_phy_reg(display, phy, ICL_PHY_MISC(phy), 247 249 ICL_PHY_MISC_MUX_DDID, 248 250 expected_val); 249 251 } 250 252 } 251 253 252 - ret &= check_phy_reg(dev_priv, phy, ICL_PORT_CL_DW5(phy), 254 + ret &= check_phy_reg(display, phy, ICL_PORT_CL_DW5(phy), 253 255 CL_POWER_DOWN_ENABLE, CL_POWER_DOWN_ENABLE); 254 256 255 257 return ret; 256 258 } 257 259 258 - void intel_combo_phy_power_up_lanes(struct drm_i915_private *dev_priv, 260 + void intel_combo_phy_power_up_lanes(struct intel_display *display, 259 261 enum phy phy, bool is_dsi, 260 262 int lane_count, bool lane_reversal) 261 263 { 262 264 u8 lane_mask; 263 265 264 266 if (is_dsi) { 265 - drm_WARN_ON(&dev_priv->drm, lane_reversal); 267 + drm_WARN_ON(display->drm, lane_reversal); 266 268 267 269 switch (lane_count) { 268 270 case 1: ··· 300 302 } 301 303 } 302 304 303 - intel_de_rmw(dev_priv, ICL_PORT_CL_DW10(phy), 305 + intel_de_rmw(display, ICL_PORT_CL_DW10(phy), 304 306 PWR_DOWN_LN_MASK, lane_mask); 305 307 } 306 308 307 - static void icl_combo_phys_init(struct drm_i915_private *dev_priv) 309 + static void icl_combo_phys_init(struct intel_display *display) 308 310 { 309 311 enum phy phy; 310 312 311 - for_each_combo_phy(dev_priv, phy) { 313 + for_each_combo_phy(display, phy) { 312 314 const struct icl_procmon *procmon; 313 315 u32 val; 314 316 315 - if (icl_combo_phy_verify_state(dev_priv, phy)) 317 + if (icl_combo_phy_verify_state(display, phy)) 316 318 continue; 317 319 318 - procmon = icl_get_procmon_ref_values(dev_priv, phy); 320 + procmon = icl_get_procmon_ref_values(display, phy); 319 321 320 - drm_dbg(&dev_priv->drm, 321 - "Initializing combo PHY %c (Voltage/Process Info : %s)\n", 322 - phy_name(phy), procmon->name); 322 + drm_dbg_kms(display->drm, 323 + "Initializing combo PHY %c (Voltage/Process Info : %s)\n", 324 + phy_name(phy), procmon->name); 323 325 324 - if (!has_phy_misc(dev_priv, phy)) 326 + if (!has_phy_misc(display, phy)) 325 327 goto skip_phy_misc; 326 328 327 329 /* ··· 332 334 * based on whether our VBT indicates the presence of any 333 335 * "internal" child devices. 334 336 */ 335 - val = intel_de_read(dev_priv, ICL_PHY_MISC(phy)); 336 - if ((IS_JASPERLAKE(dev_priv) || IS_ELKHARTLAKE(dev_priv)) && 337 + val = intel_de_read(display, ICL_PHY_MISC(phy)); 338 + if ((display->platform.jasperlake || display->platform.elkhartlake) && 337 339 phy == PHY_A) { 338 340 val &= ~ICL_PHY_MISC_MUX_DDID; 339 341 340 - if (ehl_vbt_ddi_d_present(dev_priv)) 342 + if (ehl_vbt_ddi_d_present(display)) 341 343 val |= ICL_PHY_MISC_MUX_DDID; 342 344 } 343 345 344 346 val &= ~ICL_PHY_MISC_DE_IO_COMP_PWR_DOWN; 345 - intel_de_write(dev_priv, ICL_PHY_MISC(phy), val); 347 + intel_de_write(display, ICL_PHY_MISC(phy), val); 346 348 347 349 skip_phy_misc: 348 - if (DISPLAY_VER(dev_priv) >= 12) { 349 - val = intel_de_read(dev_priv, ICL_PORT_TX_DW8_LN(0, phy)); 350 + if (DISPLAY_VER(display) >= 12) { 351 + val = intel_de_read(display, ICL_PORT_TX_DW8_LN(0, phy)); 350 352 val &= ~ICL_PORT_TX_DW8_ODCC_CLK_DIV_SEL_MASK; 351 353 val |= ICL_PORT_TX_DW8_ODCC_CLK_SEL; 352 354 val |= ICL_PORT_TX_DW8_ODCC_CLK_DIV_SEL_DIV2; 353 - intel_de_write(dev_priv, ICL_PORT_TX_DW8_GRP(phy), val); 355 + intel_de_write(display, ICL_PORT_TX_DW8_GRP(phy), val); 354 356 355 - val = intel_de_read(dev_priv, ICL_PORT_PCS_DW1_LN(0, phy)); 357 + val = intel_de_read(display, ICL_PORT_PCS_DW1_LN(0, phy)); 356 358 val &= ~DCC_MODE_SELECT_MASK; 357 359 val |= RUN_DCC_ONCE; 358 - intel_de_write(dev_priv, ICL_PORT_PCS_DW1_GRP(phy), val); 360 + intel_de_write(display, ICL_PORT_PCS_DW1_GRP(phy), val); 359 361 } 360 362 361 - icl_set_procmon_ref_values(dev_priv, phy); 363 + icl_set_procmon_ref_values(display, phy); 362 364 363 - if (phy_is_master(dev_priv, phy)) 364 - intel_de_rmw(dev_priv, ICL_PORT_COMP_DW8(phy), 365 + if (phy_is_master(display, phy)) 366 + intel_de_rmw(display, ICL_PORT_COMP_DW8(phy), 365 367 0, IREFGEN); 366 368 367 - intel_de_rmw(dev_priv, ICL_PORT_COMP_DW0(phy), 0, COMP_INIT); 368 - intel_de_rmw(dev_priv, ICL_PORT_CL_DW5(phy), 369 + intel_de_rmw(display, ICL_PORT_COMP_DW0(phy), 0, COMP_INIT); 370 + intel_de_rmw(display, ICL_PORT_CL_DW5(phy), 369 371 0, CL_POWER_DOWN_ENABLE); 370 372 } 371 373 } 372 374 373 - static void icl_combo_phys_uninit(struct drm_i915_private *dev_priv) 375 + static void icl_combo_phys_uninit(struct intel_display *display) 374 376 { 375 377 enum phy phy; 376 378 377 - for_each_combo_phy_reverse(dev_priv, phy) { 379 + for_each_combo_phy_reverse(display, phy) { 378 380 if (phy == PHY_A && 379 - !icl_combo_phy_verify_state(dev_priv, phy)) { 380 - if (IS_TIGERLAKE(dev_priv) || IS_DG1(dev_priv)) { 381 + !icl_combo_phy_verify_state(display, phy)) { 382 + if (display->platform.tigerlake || display->platform.dg1) { 381 383 /* 382 384 * A known problem with old ifwi: 383 385 * https://gitlab.freedesktop.org/drm/intel/-/issues/2411 384 386 * Suppress the warning for CI. Remove ASAP! 385 387 */ 386 - drm_dbg_kms(&dev_priv->drm, 388 + drm_dbg_kms(display->drm, 387 389 "Combo PHY %c HW state changed unexpectedly\n", 388 390 phy_name(phy)); 389 391 } else { 390 - drm_warn(&dev_priv->drm, 392 + drm_warn(display->drm, 391 393 "Combo PHY %c HW state changed unexpectedly\n", 392 394 phy_name(phy)); 393 395 } 394 396 } 395 397 396 - if (!has_phy_misc(dev_priv, phy)) 398 + if (!has_phy_misc(display, phy)) 397 399 goto skip_phy_misc; 398 400 399 - intel_de_rmw(dev_priv, ICL_PHY_MISC(phy), 0, 401 + intel_de_rmw(display, ICL_PHY_MISC(phy), 0, 400 402 ICL_PHY_MISC_DE_IO_COMP_PWR_DOWN); 401 403 402 404 skip_phy_misc: 403 - intel_de_rmw(dev_priv, ICL_PORT_COMP_DW0(phy), COMP_INIT, 0); 405 + intel_de_rmw(display, ICL_PORT_COMP_DW0(phy), COMP_INIT, 0); 404 406 } 405 407 } 406 408 407 - void intel_combo_phy_init(struct drm_i915_private *i915) 409 + void intel_combo_phy_init(struct intel_display *display) 408 410 { 409 - icl_combo_phys_init(i915); 411 + icl_combo_phys_init(display); 410 412 } 411 413 412 - void intel_combo_phy_uninit(struct drm_i915_private *i915) 414 + void intel_combo_phy_uninit(struct intel_display *display) 413 415 { 414 - icl_combo_phys_uninit(i915); 416 + icl_combo_phys_uninit(display); 415 417 }
+4 -4
drivers/gpu/drm/i915/display/intel_combo_phy.h
··· 8 8 9 9 #include <linux/types.h> 10 10 11 - struct drm_i915_private; 12 11 enum phy; 12 + struct intel_display; 13 13 14 - void intel_combo_phy_init(struct drm_i915_private *dev_priv); 15 - void intel_combo_phy_uninit(struct drm_i915_private *dev_priv); 16 - void intel_combo_phy_power_up_lanes(struct drm_i915_private *dev_priv, 14 + void intel_combo_phy_init(struct intel_display *display); 15 + void intel_combo_phy_uninit(struct intel_display *display); 16 + void intel_combo_phy_power_up_lanes(struct intel_display *display, 17 17 enum phy phy, bool is_dsi, 18 18 int lane_count, bool lane_reversal); 19 19
+2 -2
drivers/gpu/drm/i915/display/intel_ddi.c
··· 2437 2437 static void intel_ddi_power_up_lanes(struct intel_encoder *encoder, 2438 2438 const struct intel_crtc_state *crtc_state) 2439 2439 { 2440 - struct drm_i915_private *i915 = to_i915(encoder->base.dev); 2440 + struct intel_display *display = to_intel_display(encoder); 2441 2441 struct intel_digital_port *dig_port = enc_to_dig_port(encoder); 2442 2442 2443 2443 if (intel_encoder_is_combo(encoder)) { 2444 2444 enum phy phy = intel_encoder_to_phy(encoder); 2445 2445 2446 - intel_combo_phy_power_up_lanes(i915, phy, false, 2446 + intel_combo_phy_power_up_lanes(display, phy, false, 2447 2447 crtc_state->lane_count, 2448 2448 dig_port->lane_reversal); 2449 2449 }
+7 -7
drivers/gpu/drm/i915/display/intel_display.c
··· 1995 1995 } 1996 1996 1997 1997 /* Prefer intel_encoder_is_combo() */ 1998 - bool intel_phy_is_combo(struct drm_i915_private *dev_priv, enum phy phy) 1998 + bool intel_phy_is_combo(struct intel_display *display, enum phy phy) 1999 1999 { 2000 2000 if (phy == PHY_NONE) 2001 2001 return false; 2002 - else if (IS_ALDERLAKE_S(dev_priv)) 2002 + else if (display->platform.alderlake_s) 2003 2003 return phy <= PHY_E; 2004 - else if (IS_DG1(dev_priv) || IS_ROCKETLAKE(dev_priv)) 2004 + else if (display->platform.dg1 || display->platform.rocketlake) 2005 2005 return phy <= PHY_D; 2006 - else if (IS_JASPERLAKE(dev_priv) || IS_ELKHARTLAKE(dev_priv)) 2006 + else if (display->platform.jasperlake || display->platform.elkhartlake) 2007 2007 return phy <= PHY_C; 2008 - else if (IS_ALDERLAKE_P(dev_priv) || IS_DISPLAY_VER(dev_priv, 11, 12)) 2008 + else if (display->platform.alderlake_p || IS_DISPLAY_VER(display, 11, 12)) 2009 2009 return phy <= PHY_B; 2010 2010 else 2011 2011 /* ··· 2085 2085 2086 2086 bool intel_encoder_is_combo(struct intel_encoder *encoder) 2087 2087 { 2088 - struct drm_i915_private *i915 = to_i915(encoder->base.dev); 2088 + struct intel_display *display = to_intel_display(encoder); 2089 2089 2090 - return intel_phy_is_combo(i915, intel_encoder_to_phy(encoder)); 2090 + return intel_phy_is_combo(display, intel_encoder_to_phy(encoder)); 2091 2091 } 2092 2092 2093 2093 bool intel_encoder_is_snps(struct intel_encoder *encoder)
+1 -1
drivers/gpu/drm/i915/display/intel_display.h
··· 476 476 intel_encoder_current_mode(struct intel_encoder *encoder); 477 477 void intel_encoder_get_config(struct intel_encoder *encoder, 478 478 struct intel_crtc_state *crtc_state); 479 - bool intel_phy_is_combo(struct drm_i915_private *dev_priv, enum phy phy); 479 + bool intel_phy_is_combo(struct intel_display *display, enum phy phy); 480 480 bool intel_phy_is_tc(struct drm_i915_private *dev_priv, enum phy phy); 481 481 bool intel_phy_is_snps(struct drm_i915_private *dev_priv, enum phy phy); 482 482 enum tc_port intel_port_to_tc(struct drm_i915_private *dev_priv,
+2 -3
drivers/gpu/drm/i915/display/intel_display_power.c
··· 1651 1651 return; 1652 1652 1653 1653 /* 2. Initialize all combo phys */ 1654 - intel_combo_phy_init(dev_priv); 1654 + intel_combo_phy_init(display); 1655 1655 1656 1656 /* 1657 1657 * 3. Enable Power Well 1 (PG1). ··· 1714 1714 1715 1715 static void icl_display_core_uninit(struct intel_display *display) 1716 1716 { 1717 - struct drm_i915_private *dev_priv = to_i915(display->drm); 1718 1717 struct i915_power_domains *power_domains = &display->power.domains; 1719 1718 struct i915_power_well *well; 1720 1719 ··· 1746 1747 mutex_unlock(&power_domains->lock); 1747 1748 1748 1749 /* 5. */ 1749 - intel_combo_phy_uninit(dev_priv); 1750 + intel_combo_phy_uninit(display); 1750 1751 } 1751 1752 1752 1753 static void chv_phy_control_init(struct intel_display *display)
+1 -2
drivers/gpu/drm/i915/display/intel_display_power_well.c
··· 973 973 974 974 void gen9_disable_dc_states(struct intel_display *display) 975 975 { 976 - struct drm_i915_private *dev_priv = to_i915(display->drm); 977 976 struct i915_power_domains *power_domains = &display->power.domains; 978 977 struct intel_cdclk_config cdclk_config = {}; 979 978 u32 old_state = power_domains->dc_state; ··· 1012 1013 * PHY's HW context for port B is lost after DC transitions, 1013 1014 * so we need to restore it manually. 1014 1015 */ 1015 - intel_combo_phy_init(dev_priv); 1016 + intel_combo_phy_init(display); 1016 1017 } 1017 1018 1018 1019 static void gen9_dc_off_power_well_enable(struct intel_display *display,