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

drm/i915/dsi: convert to struct intel_display

struct intel_display will replace struct drm_i915_private as the main
device pointer for display code. Switch ICL DSI code over to it.

Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/f62a3616ef15e02cf19c5d041656fc6e09b37f6a.1730146000.git.jani.nikula@intel.com

+227 -223
+224 -220
drivers/gpu/drm/i915/display/icl_dsi.c
··· 52 52 #include "skl_scaler.h" 53 53 #include "skl_universal_plane.h" 54 54 55 - static int header_credits_available(struct drm_i915_private *dev_priv, 55 + static int header_credits_available(struct intel_display *display, 56 56 enum transcoder dsi_trans) 57 57 { 58 - return (intel_de_read(dev_priv, DSI_CMD_TXCTL(dsi_trans)) & FREE_HEADER_CREDIT_MASK) 58 + return (intel_de_read(display, DSI_CMD_TXCTL(dsi_trans)) & FREE_HEADER_CREDIT_MASK) 59 59 >> FREE_HEADER_CREDIT_SHIFT; 60 60 } 61 61 62 - static int payload_credits_available(struct drm_i915_private *dev_priv, 62 + static int payload_credits_available(struct intel_display *display, 63 63 enum transcoder dsi_trans) 64 64 { 65 - return (intel_de_read(dev_priv, DSI_CMD_TXCTL(dsi_trans)) & FREE_PLOAD_CREDIT_MASK) 65 + return (intel_de_read(display, DSI_CMD_TXCTL(dsi_trans)) & FREE_PLOAD_CREDIT_MASK) 66 66 >> FREE_PLOAD_CREDIT_SHIFT; 67 67 } 68 68 69 - static bool wait_for_header_credits(struct drm_i915_private *dev_priv, 69 + static bool wait_for_header_credits(struct intel_display *display, 70 70 enum transcoder dsi_trans, int hdr_credit) 71 71 { 72 - if (wait_for_us(header_credits_available(dev_priv, dsi_trans) >= 72 + if (wait_for_us(header_credits_available(display, dsi_trans) >= 73 73 hdr_credit, 100)) { 74 - drm_err(&dev_priv->drm, "DSI header credits not released\n"); 74 + drm_err(display->drm, "DSI header credits not released\n"); 75 75 return false; 76 76 } 77 77 78 78 return true; 79 79 } 80 80 81 - static bool wait_for_payload_credits(struct drm_i915_private *dev_priv, 81 + static bool wait_for_payload_credits(struct intel_display *display, 82 82 enum transcoder dsi_trans, int payld_credit) 83 83 { 84 - if (wait_for_us(payload_credits_available(dev_priv, dsi_trans) >= 84 + if (wait_for_us(payload_credits_available(display, dsi_trans) >= 85 85 payld_credit, 100)) { 86 - drm_err(&dev_priv->drm, "DSI payload credits not released\n"); 86 + drm_err(display->drm, "DSI payload credits not released\n"); 87 87 return false; 88 88 } 89 89 ··· 100 100 101 101 static void wait_for_cmds_dispatched_to_panel(struct intel_encoder *encoder) 102 102 { 103 - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); 103 + struct intel_display *display = to_intel_display(encoder); 104 104 struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); 105 105 struct mipi_dsi_device *dsi; 106 106 enum port port; ··· 110 110 /* wait for header/payload credits to be released */ 111 111 for_each_dsi_port(port, intel_dsi->ports) { 112 112 dsi_trans = dsi_port_to_transcoder(port); 113 - wait_for_header_credits(dev_priv, dsi_trans, MAX_HEADER_CREDIT); 114 - wait_for_payload_credits(dev_priv, dsi_trans, MAX_PLOAD_CREDIT); 113 + wait_for_header_credits(display, dsi_trans, MAX_HEADER_CREDIT); 114 + wait_for_payload_credits(display, dsi_trans, MAX_PLOAD_CREDIT); 115 115 } 116 116 117 117 /* send nop DCS command */ ··· 121 121 dsi->channel = 0; 122 122 ret = mipi_dsi_dcs_nop(dsi); 123 123 if (ret < 0) 124 - drm_err(&dev_priv->drm, 124 + drm_err(display->drm, 125 125 "error sending DCS NOP command\n"); 126 126 } 127 127 128 128 /* wait for header credits to be released */ 129 129 for_each_dsi_port(port, intel_dsi->ports) { 130 130 dsi_trans = dsi_port_to_transcoder(port); 131 - wait_for_header_credits(dev_priv, dsi_trans, MAX_HEADER_CREDIT); 131 + wait_for_header_credits(display, dsi_trans, MAX_HEADER_CREDIT); 132 132 } 133 133 134 134 /* wait for LP TX in progress bit to be cleared */ 135 135 for_each_dsi_port(port, intel_dsi->ports) { 136 136 dsi_trans = dsi_port_to_transcoder(port); 137 - if (wait_for_us(!(intel_de_read(dev_priv, DSI_LP_MSG(dsi_trans)) & 137 + if (wait_for_us(!(intel_de_read(display, DSI_LP_MSG(dsi_trans)) & 138 138 LPTX_IN_PROGRESS), 20)) 139 - drm_err(&dev_priv->drm, "LPTX bit not cleared\n"); 139 + drm_err(display->drm, "LPTX bit not cleared\n"); 140 140 } 141 141 } 142 142 ··· 144 144 const struct mipi_dsi_packet *packet) 145 145 { 146 146 struct intel_dsi *intel_dsi = host->intel_dsi; 147 - struct drm_i915_private *i915 = to_i915(intel_dsi->base.base.dev); 147 + struct intel_display *display = to_intel_display(&intel_dsi->base); 148 148 enum transcoder dsi_trans = dsi_port_to_transcoder(host->port); 149 149 const u8 *data = packet->payload; 150 150 u32 len = packet->payload_length; ··· 152 152 153 153 /* payload queue can accept *256 bytes*, check limit */ 154 154 if (len > MAX_PLOAD_CREDIT * 4) { 155 - drm_err(&i915->drm, "payload size exceeds max queue limit\n"); 155 + drm_err(display->drm, "payload size exceeds max queue limit\n"); 156 156 return -EINVAL; 157 157 } 158 158 159 159 for (i = 0; i < len; i += 4) { 160 160 u32 tmp = 0; 161 161 162 - if (!wait_for_payload_credits(i915, dsi_trans, 1)) 162 + if (!wait_for_payload_credits(display, dsi_trans, 1)) 163 163 return -EBUSY; 164 164 165 165 for (j = 0; j < min_t(u32, len - i, 4); j++) 166 166 tmp |= *data++ << 8 * j; 167 167 168 - intel_de_write(i915, DSI_CMD_TXPYLD(dsi_trans), tmp); 168 + intel_de_write(display, DSI_CMD_TXPYLD(dsi_trans), tmp); 169 169 } 170 170 171 171 return 0; ··· 176 176 bool enable_lpdt) 177 177 { 178 178 struct intel_dsi *intel_dsi = host->intel_dsi; 179 - struct drm_i915_private *dev_priv = to_i915(intel_dsi->base.base.dev); 179 + struct intel_display *display = to_intel_display(&intel_dsi->base); 180 180 enum transcoder dsi_trans = dsi_port_to_transcoder(host->port); 181 181 u32 tmp; 182 182 183 - if (!wait_for_header_credits(dev_priv, dsi_trans, 1)) 183 + if (!wait_for_header_credits(display, dsi_trans, 1)) 184 184 return -EBUSY; 185 185 186 - tmp = intel_de_read(dev_priv, DSI_CMD_TXHDR(dsi_trans)); 186 + tmp = intel_de_read(display, DSI_CMD_TXHDR(dsi_trans)); 187 187 188 188 if (packet->payload) 189 189 tmp |= PAYLOAD_PRESENT; ··· 202 202 tmp |= ((packet->header[0] & DT_MASK) << DT_SHIFT); 203 203 tmp |= (packet->header[1] << PARAM_WC_LOWER_SHIFT); 204 204 tmp |= (packet->header[2] << PARAM_WC_UPPER_SHIFT); 205 - intel_de_write(dev_priv, DSI_CMD_TXHDR(dsi_trans), tmp); 205 + intel_de_write(display, DSI_CMD_TXHDR(dsi_trans), tmp); 206 206 207 207 return 0; 208 208 } 209 209 210 210 void icl_dsi_frame_update(struct intel_crtc_state *crtc_state) 211 211 { 212 - struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); 213 - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); 212 + struct intel_display *display = to_intel_display(crtc_state); 214 213 u32 mode_flags; 215 214 enum port port; 216 215 ··· 227 228 else 228 229 return; 229 230 230 - intel_de_rmw(dev_priv, DSI_CMD_FRMCTL(port), 0, DSI_FRAME_UPDATE_REQUEST); 231 + intel_de_rmw(display, DSI_CMD_FRMCTL(port), 0, 232 + DSI_FRAME_UPDATE_REQUEST); 231 233 } 232 234 233 235 static void dsi_program_swing_and_deemphasis(struct intel_encoder *encoder) 234 236 { 235 - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); 237 + struct intel_display *display = to_intel_display(encoder); 236 238 struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); 237 239 enum phy phy; 238 240 u32 tmp, mask, val; ··· 247 247 mask = SCALING_MODE_SEL_MASK | RTERM_SELECT_MASK; 248 248 val = SCALING_MODE_SEL(0x2) | TAP2_DISABLE | TAP3_DISABLE | 249 249 RTERM_SELECT(0x6); 250 - tmp = intel_de_read(dev_priv, ICL_PORT_TX_DW5_LN(0, phy)); 250 + tmp = intel_de_read(display, ICL_PORT_TX_DW5_LN(0, phy)); 251 251 tmp &= ~mask; 252 252 tmp |= val; 253 - intel_de_write(dev_priv, ICL_PORT_TX_DW5_GRP(phy), tmp); 254 - intel_de_rmw(dev_priv, ICL_PORT_TX_DW5_AUX(phy), mask, val); 253 + intel_de_write(display, ICL_PORT_TX_DW5_GRP(phy), tmp); 254 + intel_de_rmw(display, ICL_PORT_TX_DW5_AUX(phy), mask, val); 255 255 256 256 mask = SWING_SEL_LOWER_MASK | SWING_SEL_UPPER_MASK | 257 257 RCOMP_SCALAR_MASK; 258 258 val = SWING_SEL_UPPER(0x2) | SWING_SEL_LOWER(0x2) | 259 259 RCOMP_SCALAR(0x98); 260 - tmp = intel_de_read(dev_priv, ICL_PORT_TX_DW2_LN(0, phy)); 260 + tmp = intel_de_read(display, ICL_PORT_TX_DW2_LN(0, phy)); 261 261 tmp &= ~mask; 262 262 tmp |= val; 263 - intel_de_write(dev_priv, ICL_PORT_TX_DW2_GRP(phy), tmp); 264 - intel_de_rmw(dev_priv, ICL_PORT_TX_DW2_AUX(phy), mask, val); 263 + intel_de_write(display, ICL_PORT_TX_DW2_GRP(phy), tmp); 264 + intel_de_rmw(display, ICL_PORT_TX_DW2_AUX(phy), mask, val); 265 265 266 266 mask = POST_CURSOR_1_MASK | POST_CURSOR_2_MASK | 267 267 CURSOR_COEFF_MASK; 268 268 val = POST_CURSOR_1(0x0) | POST_CURSOR_2(0x0) | 269 269 CURSOR_COEFF(0x3f); 270 - intel_de_rmw(dev_priv, ICL_PORT_TX_DW4_AUX(phy), mask, val); 270 + intel_de_rmw(display, ICL_PORT_TX_DW4_AUX(phy), mask, val); 271 271 272 272 /* Bspec: must not use GRP register for write */ 273 273 for (lane = 0; lane <= 3; lane++) 274 - intel_de_rmw(dev_priv, ICL_PORT_TX_DW4_LN(lane, phy), 274 + intel_de_rmw(display, ICL_PORT_TX_DW4_LN(lane, phy), 275 275 mask, val); 276 276 } 277 277 } ··· 279 279 static void configure_dual_link_mode(struct intel_encoder *encoder, 280 280 const struct intel_crtc_state *pipe_config) 281 281 { 282 - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); 282 + struct intel_display *display = to_intel_display(encoder); 283 283 struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); 284 284 i915_reg_t dss_ctl1_reg, dss_ctl2_reg; 285 285 u32 dss_ctl1; 286 286 287 287 /* FIXME: Move all DSS handling to intel_vdsc.c */ 288 - if (DISPLAY_VER(dev_priv) >= 12) { 288 + if (DISPLAY_VER(display) >= 12) { 289 289 struct intel_crtc *crtc = to_intel_crtc(pipe_config->uapi.crtc); 290 290 291 291 dss_ctl1_reg = ICL_PIPE_DSS_CTL1(crtc->pipe); ··· 295 295 dss_ctl2_reg = DSS_CTL2; 296 296 } 297 297 298 - dss_ctl1 = intel_de_read(dev_priv, dss_ctl1_reg); 298 + dss_ctl1 = intel_de_read(display, dss_ctl1_reg); 299 299 dss_ctl1 |= SPLITTER_ENABLE; 300 300 dss_ctl1 &= ~OVERLAP_PIXELS_MASK; 301 301 dss_ctl1 |= OVERLAP_PIXELS(intel_dsi->pixel_overlap); ··· 310 310 dl_buffer_depth = hactive / 2 + intel_dsi->pixel_overlap; 311 311 312 312 if (dl_buffer_depth > MAX_DL_BUFFER_TARGET_DEPTH) 313 - drm_err(&dev_priv->drm, 313 + drm_err(display->drm, 314 314 "DL buffer depth exceed max value\n"); 315 315 316 316 dss_ctl1 &= ~LEFT_DL_BUF_TARGET_DEPTH_MASK; 317 317 dss_ctl1 |= LEFT_DL_BUF_TARGET_DEPTH(dl_buffer_depth); 318 - intel_de_rmw(dev_priv, dss_ctl2_reg, RIGHT_DL_BUF_TARGET_DEPTH_MASK, 318 + intel_de_rmw(display, dss_ctl2_reg, RIGHT_DL_BUF_TARGET_DEPTH_MASK, 319 319 RIGHT_DL_BUF_TARGET_DEPTH(dl_buffer_depth)); 320 320 } else { 321 321 /* Interleave */ 322 322 dss_ctl1 |= DUAL_LINK_MODE_INTERLEAVE; 323 323 } 324 324 325 - intel_de_write(dev_priv, dss_ctl1_reg, dss_ctl1); 325 + intel_de_write(display, dss_ctl1_reg, dss_ctl1); 326 326 } 327 327 328 328 /* aka DSI 8X clock */ ··· 343 343 static void gen11_dsi_program_esc_clk_div(struct intel_encoder *encoder, 344 344 const struct intel_crtc_state *crtc_state) 345 345 { 346 + struct intel_display *display = to_intel_display(encoder); 346 347 struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); 347 348 struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); 348 349 enum port port; ··· 363 362 } 364 363 365 364 for_each_dsi_port(port, intel_dsi->ports) { 366 - intel_de_write(dev_priv, ICL_DSI_ESC_CLK_DIV(port), 365 + intel_de_write(display, ICL_DSI_ESC_CLK_DIV(port), 367 366 esc_clk_div_m & ICL_ESC_CLK_DIV_MASK); 368 - intel_de_posting_read(dev_priv, ICL_DSI_ESC_CLK_DIV(port)); 367 + intel_de_posting_read(display, ICL_DSI_ESC_CLK_DIV(port)); 369 368 } 370 369 371 370 for_each_dsi_port(port, intel_dsi->ports) { 372 - intel_de_write(dev_priv, ICL_DPHY_ESC_CLK_DIV(port), 371 + intel_de_write(display, ICL_DPHY_ESC_CLK_DIV(port), 373 372 esc_clk_div_m & ICL_ESC_CLK_DIV_MASK); 374 - intel_de_posting_read(dev_priv, ICL_DPHY_ESC_CLK_DIV(port)); 373 + intel_de_posting_read(display, ICL_DPHY_ESC_CLK_DIV(port)); 375 374 } 376 375 377 376 if (IS_ALDERLAKE_S(dev_priv) || IS_ALDERLAKE_P(dev_priv)) { 378 377 for_each_dsi_port(port, intel_dsi->ports) { 379 - intel_de_write(dev_priv, ADL_MIPIO_DW(port, 8), 378 + intel_de_write(display, ADL_MIPIO_DW(port, 8), 380 379 esc_clk_div_m_phy & TX_ESC_CLK_DIV_PHY); 381 - intel_de_posting_read(dev_priv, ADL_MIPIO_DW(port, 8)); 380 + intel_de_posting_read(display, ADL_MIPIO_DW(port, 8)); 382 381 } 383 382 } 384 383 } 385 384 386 - static void get_dsi_io_power_domains(struct drm_i915_private *dev_priv, 387 - struct intel_dsi *intel_dsi) 385 + static void get_dsi_io_power_domains(struct intel_dsi *intel_dsi) 388 386 { 387 + struct intel_display *display = to_intel_display(&intel_dsi->base); 388 + struct drm_i915_private *dev_priv = to_i915(display->drm); 389 389 enum port port; 390 390 391 391 for_each_dsi_port(port, intel_dsi->ports) { 392 - drm_WARN_ON(&dev_priv->drm, intel_dsi->io_wakeref[port]); 392 + drm_WARN_ON(display->drm, intel_dsi->io_wakeref[port]); 393 393 intel_dsi->io_wakeref[port] = 394 394 intel_display_power_get(dev_priv, 395 395 port == PORT_A ? ··· 401 399 402 400 static void gen11_dsi_enable_io_power(struct intel_encoder *encoder) 403 401 { 404 - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); 402 + struct intel_display *display = to_intel_display(encoder); 405 403 struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); 406 404 enum port port; 407 405 408 406 for_each_dsi_port(port, intel_dsi->ports) 409 - intel_de_rmw(dev_priv, ICL_DSI_IO_MODECTL(port), 407 + intel_de_rmw(display, ICL_DSI_IO_MODECTL(port), 410 408 0, COMBO_PHY_MODE_DSI); 411 409 412 - get_dsi_io_power_domains(dev_priv, intel_dsi); 410 + get_dsi_io_power_domains(intel_dsi); 413 411 } 414 412 415 413 static void gen11_dsi_power_up_lanes(struct intel_encoder *encoder) ··· 425 423 426 424 static void gen11_dsi_config_phy_lanes_sequence(struct intel_encoder *encoder) 427 425 { 426 + struct intel_display *display = to_intel_display(encoder); 428 427 struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); 429 428 struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); 430 429 enum phy phy; ··· 434 431 435 432 /* Step 4b(i) set loadgen select for transmit and aux lanes */ 436 433 for_each_dsi_phy(phy, intel_dsi->phys) { 437 - intel_de_rmw(dev_priv, ICL_PORT_TX_DW4_AUX(phy), LOADGEN_SELECT, 0); 434 + intel_de_rmw(display, ICL_PORT_TX_DW4_AUX(phy), 435 + LOADGEN_SELECT, 0); 438 436 for (lane = 0; lane <= 3; lane++) 439 - intel_de_rmw(dev_priv, ICL_PORT_TX_DW4_LN(lane, phy), 437 + intel_de_rmw(display, ICL_PORT_TX_DW4_LN(lane, phy), 440 438 LOADGEN_SELECT, lane != 2 ? LOADGEN_SELECT : 0); 441 439 } 442 440 443 441 /* Step 4b(ii) set latency optimization for transmit and aux lanes */ 444 442 for_each_dsi_phy(phy, intel_dsi->phys) { 445 - intel_de_rmw(dev_priv, ICL_PORT_TX_DW2_AUX(phy), 443 + intel_de_rmw(display, ICL_PORT_TX_DW2_AUX(phy), 446 444 FRC_LATENCY_OPTIM_MASK, FRC_LATENCY_OPTIM_VAL(0x5)); 447 - tmp = intel_de_read(dev_priv, ICL_PORT_TX_DW2_LN(0, phy)); 445 + tmp = intel_de_read(display, ICL_PORT_TX_DW2_LN(0, phy)); 448 446 tmp &= ~FRC_LATENCY_OPTIM_MASK; 449 447 tmp |= FRC_LATENCY_OPTIM_VAL(0x5); 450 - intel_de_write(dev_priv, ICL_PORT_TX_DW2_GRP(phy), tmp); 448 + intel_de_write(display, ICL_PORT_TX_DW2_GRP(phy), tmp); 451 449 452 450 /* For EHL, TGL, set latency optimization for PCS_DW1 lanes */ 453 451 if (IS_JASPERLAKE(dev_priv) || IS_ELKHARTLAKE(dev_priv) || 454 - (DISPLAY_VER(dev_priv) >= 12)) { 455 - intel_de_rmw(dev_priv, ICL_PORT_PCS_DW1_AUX(phy), 452 + (DISPLAY_VER(display) >= 12)) { 453 + intel_de_rmw(display, ICL_PORT_PCS_DW1_AUX(phy), 456 454 LATENCY_OPTIM_MASK, LATENCY_OPTIM_VAL(0)); 457 455 458 - tmp = intel_de_read(dev_priv, 456 + tmp = intel_de_read(display, 459 457 ICL_PORT_PCS_DW1_LN(0, phy)); 460 458 tmp &= ~LATENCY_OPTIM_MASK; 461 459 tmp |= LATENCY_OPTIM_VAL(0x1); 462 - intel_de_write(dev_priv, ICL_PORT_PCS_DW1_GRP(phy), 460 + intel_de_write(display, ICL_PORT_PCS_DW1_GRP(phy), 463 461 tmp); 464 462 } 465 463 } ··· 469 465 470 466 static void gen11_dsi_voltage_swing_program_seq(struct intel_encoder *encoder) 471 467 { 472 - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); 468 + struct intel_display *display = to_intel_display(encoder); 473 469 struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); 474 470 u32 tmp; 475 471 enum phy phy; 476 472 477 473 /* clear common keeper enable bit */ 478 474 for_each_dsi_phy(phy, intel_dsi->phys) { 479 - tmp = intel_de_read(dev_priv, ICL_PORT_PCS_DW1_LN(0, phy)); 475 + tmp = intel_de_read(display, ICL_PORT_PCS_DW1_LN(0, phy)); 480 476 tmp &= ~COMMON_KEEPER_EN; 481 - intel_de_write(dev_priv, ICL_PORT_PCS_DW1_GRP(phy), tmp); 482 - intel_de_rmw(dev_priv, ICL_PORT_PCS_DW1_AUX(phy), COMMON_KEEPER_EN, 0); 477 + intel_de_write(display, ICL_PORT_PCS_DW1_GRP(phy), tmp); 478 + intel_de_rmw(display, ICL_PORT_PCS_DW1_AUX(phy), COMMON_KEEPER_EN, 0); 483 479 } 484 480 485 481 /* ··· 488 484 * as part of lane phy sequence configuration 489 485 */ 490 486 for_each_dsi_phy(phy, intel_dsi->phys) 491 - intel_de_rmw(dev_priv, ICL_PORT_CL_DW5(phy), 0, SUS_CLOCK_CONFIG); 487 + intel_de_rmw(display, ICL_PORT_CL_DW5(phy), 0, 488 + SUS_CLOCK_CONFIG); 492 489 493 490 /* Clear training enable to change swing values */ 494 491 for_each_dsi_phy(phy, intel_dsi->phys) { 495 - tmp = intel_de_read(dev_priv, ICL_PORT_TX_DW5_LN(0, phy)); 492 + tmp = intel_de_read(display, ICL_PORT_TX_DW5_LN(0, phy)); 496 493 tmp &= ~TX_TRAINING_EN; 497 - intel_de_write(dev_priv, ICL_PORT_TX_DW5_GRP(phy), tmp); 498 - intel_de_rmw(dev_priv, ICL_PORT_TX_DW5_AUX(phy), TX_TRAINING_EN, 0); 494 + intel_de_write(display, ICL_PORT_TX_DW5_GRP(phy), tmp); 495 + intel_de_rmw(display, ICL_PORT_TX_DW5_AUX(phy), TX_TRAINING_EN, 0); 499 496 } 500 497 501 498 /* Program swing and de-emphasis */ ··· 504 499 505 500 /* Set training enable to trigger update */ 506 501 for_each_dsi_phy(phy, intel_dsi->phys) { 507 - tmp = intel_de_read(dev_priv, ICL_PORT_TX_DW5_LN(0, phy)); 502 + tmp = intel_de_read(display, ICL_PORT_TX_DW5_LN(0, phy)); 508 503 tmp |= TX_TRAINING_EN; 509 - intel_de_write(dev_priv, ICL_PORT_TX_DW5_GRP(phy), tmp); 510 - intel_de_rmw(dev_priv, ICL_PORT_TX_DW5_AUX(phy), 0, TX_TRAINING_EN); 504 + intel_de_write(display, ICL_PORT_TX_DW5_GRP(phy), tmp); 505 + intel_de_rmw(display, ICL_PORT_TX_DW5_AUX(phy), 0, TX_TRAINING_EN); 511 506 } 512 507 } 513 508 514 509 static void gen11_dsi_enable_ddi_buffer(struct intel_encoder *encoder) 515 510 { 516 - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); 511 + struct intel_display *display = to_intel_display(encoder); 517 512 struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); 518 513 enum port port; 519 514 520 515 for_each_dsi_port(port, intel_dsi->ports) { 521 - intel_de_rmw(dev_priv, DDI_BUF_CTL(port), 0, DDI_BUF_CTL_ENABLE); 516 + intel_de_rmw(display, DDI_BUF_CTL(port), 0, DDI_BUF_CTL_ENABLE); 522 517 523 - if (wait_for_us(!(intel_de_read(dev_priv, DDI_BUF_CTL(port)) & 518 + if (wait_for_us(!(intel_de_read(display, DDI_BUF_CTL(port)) & 524 519 DDI_BUF_IS_IDLE), 525 520 500)) 526 - drm_err(&dev_priv->drm, "DDI port:%c buffer idle\n", 521 + drm_err(display->drm, "DDI port:%c buffer idle\n", 527 522 port_name(port)); 528 523 } 529 524 } ··· 532 527 gen11_dsi_setup_dphy_timings(struct intel_encoder *encoder, 533 528 const struct intel_crtc_state *crtc_state) 534 529 { 530 + struct intel_display *display = to_intel_display(encoder); 535 531 struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); 536 532 struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); 537 533 enum port port; ··· 540 534 541 535 /* Program DPHY clock lanes timings */ 542 536 for_each_dsi_port(port, intel_dsi->ports) 543 - intel_de_write(dev_priv, DPHY_CLK_TIMING_PARAM(port), 537 + intel_de_write(display, DPHY_CLK_TIMING_PARAM(port), 544 538 intel_dsi->dphy_reg); 545 539 546 540 /* Program DPHY data lanes timings */ 547 541 for_each_dsi_port(port, intel_dsi->ports) 548 - intel_de_write(dev_priv, DPHY_DATA_TIMING_PARAM(port), 542 + intel_de_write(display, DPHY_DATA_TIMING_PARAM(port), 549 543 intel_dsi->dphy_data_lane_reg); 550 544 551 545 /* ··· 554 548 * a value '0' inside TA_PARAM_REGISTERS otherwise 555 549 * leave all fields at HW default values. 556 550 */ 557 - if (DISPLAY_VER(dev_priv) == 11) { 551 + if (DISPLAY_VER(display) == 11) { 558 552 if (afe_clk(encoder, crtc_state) <= 800000) { 559 553 for_each_dsi_port(port, intel_dsi->ports) 560 - intel_de_rmw(dev_priv, DPHY_TA_TIMING_PARAM(port), 554 + intel_de_rmw(display, DPHY_TA_TIMING_PARAM(port), 561 555 TA_SURE_MASK, 562 556 TA_SURE_OVERRIDE | TA_SURE(0)); 563 557 } ··· 565 559 566 560 if (IS_JASPERLAKE(dev_priv) || IS_ELKHARTLAKE(dev_priv)) { 567 561 for_each_dsi_phy(phy, intel_dsi->phys) 568 - intel_de_rmw(dev_priv, ICL_DPHY_CHKN(phy), 562 + intel_de_rmw(display, ICL_DPHY_CHKN(phy), 569 563 0, ICL_DPHY_CHKN_AFE_OVER_PPI_STRAP); 570 564 } 571 565 } ··· 574 568 gen11_dsi_setup_timings(struct intel_encoder *encoder, 575 569 const struct intel_crtc_state *crtc_state) 576 570 { 577 - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); 571 + struct intel_display *display = to_intel_display(encoder); 578 572 struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); 579 573 enum port port; 580 574 581 575 /* Program T-INIT master registers */ 582 576 for_each_dsi_port(port, intel_dsi->ports) 583 - intel_de_rmw(dev_priv, ICL_DSI_T_INIT_MASTER(port), 577 + intel_de_rmw(display, ICL_DSI_T_INIT_MASTER(port), 584 578 DSI_T_INIT_MASTER_MASK, intel_dsi->init_count); 585 579 586 580 /* shadow register inside display core */ 587 581 for_each_dsi_port(port, intel_dsi->ports) 588 - intel_de_write(dev_priv, DSI_CLK_TIMING_PARAM(port), 582 + intel_de_write(display, DSI_CLK_TIMING_PARAM(port), 589 583 intel_dsi->dphy_reg); 590 584 591 585 /* shadow register inside display core */ 592 586 for_each_dsi_port(port, intel_dsi->ports) 593 - intel_de_write(dev_priv, DSI_DATA_TIMING_PARAM(port), 587 + intel_de_write(display, DSI_DATA_TIMING_PARAM(port), 594 588 intel_dsi->dphy_data_lane_reg); 595 589 596 590 /* shadow register inside display core */ 597 - if (DISPLAY_VER(dev_priv) == 11) { 591 + if (DISPLAY_VER(display) == 11) { 598 592 if (afe_clk(encoder, crtc_state) <= 800000) { 599 593 for_each_dsi_port(port, intel_dsi->ports) { 600 - intel_de_rmw(dev_priv, DSI_TA_TIMING_PARAM(port), 594 + intel_de_rmw(display, DSI_TA_TIMING_PARAM(port), 601 595 TA_SURE_MASK, 602 596 TA_SURE_OVERRIDE | TA_SURE(0)); 603 597 } ··· 607 601 608 602 static void gen11_dsi_gate_clocks(struct intel_encoder *encoder) 609 603 { 610 - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); 604 + struct intel_display *display = to_intel_display(encoder); 611 605 struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); 612 606 u32 tmp; 613 607 enum phy phy; 614 608 615 - mutex_lock(&dev_priv->display.dpll.lock); 616 - tmp = intel_de_read(dev_priv, ICL_DPCLKA_CFGCR0); 609 + mutex_lock(&display->dpll.lock); 610 + tmp = intel_de_read(display, ICL_DPCLKA_CFGCR0); 617 611 for_each_dsi_phy(phy, intel_dsi->phys) 618 612 tmp |= ICL_DPCLKA_CFGCR0_DDI_CLK_OFF(phy); 619 613 620 - intel_de_write(dev_priv, ICL_DPCLKA_CFGCR0, tmp); 621 - mutex_unlock(&dev_priv->display.dpll.lock); 614 + intel_de_write(display, ICL_DPCLKA_CFGCR0, tmp); 615 + mutex_unlock(&display->dpll.lock); 622 616 } 623 617 624 618 static void gen11_dsi_ungate_clocks(struct intel_encoder *encoder) 625 619 { 626 - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); 620 + struct intel_display *display = to_intel_display(encoder); 627 621 struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); 628 622 u32 tmp; 629 623 enum phy phy; 630 624 631 - mutex_lock(&dev_priv->display.dpll.lock); 632 - tmp = intel_de_read(dev_priv, ICL_DPCLKA_CFGCR0); 625 + mutex_lock(&display->dpll.lock); 626 + tmp = intel_de_read(display, ICL_DPCLKA_CFGCR0); 633 627 for_each_dsi_phy(phy, intel_dsi->phys) 634 628 tmp &= ~ICL_DPCLKA_CFGCR0_DDI_CLK_OFF(phy); 635 629 636 - intel_de_write(dev_priv, ICL_DPCLKA_CFGCR0, tmp); 637 - mutex_unlock(&dev_priv->display.dpll.lock); 630 + intel_de_write(display, ICL_DPCLKA_CFGCR0, tmp); 631 + mutex_unlock(&display->dpll.lock); 638 632 } 639 633 640 634 static bool gen11_dsi_is_clock_enabled(struct intel_encoder *encoder) 641 635 { 642 - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); 636 + struct intel_display *display = to_intel_display(encoder); 643 637 struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); 644 638 bool clock_enabled = false; 645 639 enum phy phy; 646 640 u32 tmp; 647 641 648 - tmp = intel_de_read(dev_priv, ICL_DPCLKA_CFGCR0); 642 + tmp = intel_de_read(display, ICL_DPCLKA_CFGCR0); 649 643 650 644 for_each_dsi_phy(phy, intel_dsi->phys) { 651 645 if (!(tmp & ICL_DPCLKA_CFGCR0_DDI_CLK_OFF(phy))) ··· 658 652 static void gen11_dsi_map_pll(struct intel_encoder *encoder, 659 653 const struct intel_crtc_state *crtc_state) 660 654 { 661 - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); 655 + struct intel_display *display = to_intel_display(encoder); 662 656 struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); 663 657 struct intel_shared_dpll *pll = crtc_state->shared_dpll; 664 658 enum phy phy; 665 659 u32 val; 666 660 667 - mutex_lock(&dev_priv->display.dpll.lock); 661 + mutex_lock(&display->dpll.lock); 668 662 669 - val = intel_de_read(dev_priv, ICL_DPCLKA_CFGCR0); 663 + val = intel_de_read(display, ICL_DPCLKA_CFGCR0); 670 664 for_each_dsi_phy(phy, intel_dsi->phys) { 671 665 val &= ~ICL_DPCLKA_CFGCR0_DDI_CLK_SEL_MASK(phy); 672 666 val |= ICL_DPCLKA_CFGCR0_DDI_CLK_SEL(pll->info->id, phy); 673 667 } 674 - intel_de_write(dev_priv, ICL_DPCLKA_CFGCR0, val); 668 + intel_de_write(display, ICL_DPCLKA_CFGCR0, val); 675 669 676 670 for_each_dsi_phy(phy, intel_dsi->phys) { 677 671 val &= ~ICL_DPCLKA_CFGCR0_DDI_CLK_OFF(phy); 678 672 } 679 - intel_de_write(dev_priv, ICL_DPCLKA_CFGCR0, val); 673 + intel_de_write(display, ICL_DPCLKA_CFGCR0, val); 680 674 681 - intel_de_posting_read(dev_priv, ICL_DPCLKA_CFGCR0); 675 + intel_de_posting_read(display, ICL_DPCLKA_CFGCR0); 682 676 683 - mutex_unlock(&dev_priv->display.dpll.lock); 677 + mutex_unlock(&display->dpll.lock); 684 678 } 685 679 686 680 static void 687 681 gen11_dsi_configure_transcoder(struct intel_encoder *encoder, 688 682 const struct intel_crtc_state *pipe_config) 689 683 { 690 - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); 684 + struct intel_display *display = to_intel_display(encoder); 691 685 struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); 692 686 struct intel_crtc *crtc = to_intel_crtc(pipe_config->uapi.crtc); 693 687 enum pipe pipe = crtc->pipe; ··· 697 691 698 692 for_each_dsi_port(port, intel_dsi->ports) { 699 693 dsi_trans = dsi_port_to_transcoder(port); 700 - tmp = intel_de_read(dev_priv, DSI_TRANS_FUNC_CONF(dsi_trans)); 694 + tmp = intel_de_read(display, DSI_TRANS_FUNC_CONF(dsi_trans)); 701 695 702 696 if (intel_dsi->eotp_pkt) 703 697 tmp &= ~EOTP_DISABLED; ··· 753 747 } 754 748 } 755 749 756 - if (DISPLAY_VER(dev_priv) >= 12) { 750 + if (DISPLAY_VER(display) >= 12) { 757 751 if (is_vid_mode(intel_dsi)) 758 752 tmp |= BLANKING_PACKET_ENABLE; 759 753 } ··· 786 780 tmp |= TE_SOURCE_GPIO; 787 781 } 788 782 789 - intel_de_write(dev_priv, DSI_TRANS_FUNC_CONF(dsi_trans), tmp); 783 + intel_de_write(display, DSI_TRANS_FUNC_CONF(dsi_trans), tmp); 790 784 } 791 785 792 786 /* enable port sync mode if dual link */ 793 787 if (intel_dsi->dual_link) { 794 788 for_each_dsi_port(port, intel_dsi->ports) { 795 789 dsi_trans = dsi_port_to_transcoder(port); 796 - intel_de_rmw(dev_priv, 797 - TRANS_DDI_FUNC_CTL2(dev_priv, dsi_trans), 790 + intel_de_rmw(display, 791 + TRANS_DDI_FUNC_CTL2(display, dsi_trans), 798 792 0, PORT_SYNC_MODE_ENABLE); 799 793 } 800 794 ··· 806 800 dsi_trans = dsi_port_to_transcoder(port); 807 801 808 802 /* select data lane width */ 809 - tmp = intel_de_read(dev_priv, 810 - TRANS_DDI_FUNC_CTL(dev_priv, dsi_trans)); 803 + tmp = intel_de_read(display, 804 + TRANS_DDI_FUNC_CTL(display, dsi_trans)); 811 805 tmp &= ~DDI_PORT_WIDTH_MASK; 812 806 tmp |= DDI_PORT_WIDTH(intel_dsi->lane_count); 813 807 ··· 833 827 834 828 /* enable DDI buffer */ 835 829 tmp |= TRANS_DDI_FUNC_ENABLE; 836 - intel_de_write(dev_priv, 837 - TRANS_DDI_FUNC_CTL(dev_priv, dsi_trans), tmp); 830 + intel_de_write(display, 831 + TRANS_DDI_FUNC_CTL(display, dsi_trans), tmp); 838 832 } 839 833 840 834 /* wait for link ready */ 841 835 for_each_dsi_port(port, intel_dsi->ports) { 842 836 dsi_trans = dsi_port_to_transcoder(port); 843 - if (wait_for_us((intel_de_read(dev_priv, DSI_TRANS_FUNC_CONF(dsi_trans)) & 837 + if (wait_for_us((intel_de_read(display, DSI_TRANS_FUNC_CONF(dsi_trans)) & 844 838 LINK_READY), 2500)) 845 - drm_err(&dev_priv->drm, "DSI link not ready\n"); 839 + drm_err(display->drm, "DSI link not ready\n"); 846 840 } 847 841 } 848 842 ··· 850 844 gen11_dsi_set_transcoder_timings(struct intel_encoder *encoder, 851 845 const struct intel_crtc_state *crtc_state) 852 846 { 853 - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); 847 + struct intel_display *display = to_intel_display(encoder); 854 848 struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); 855 849 const struct drm_display_mode *adjusted_mode = 856 850 &crtc_state->hw.adjusted_mode; ··· 917 911 918 912 /* minimum hactive as per bspec: 256 pixels */ 919 913 if (adjusted_mode->crtc_hdisplay < 256) 920 - drm_err(&dev_priv->drm, "hactive is less then 256 pixels\n"); 914 + drm_err(display->drm, "hactive is less then 256 pixels\n"); 921 915 922 916 /* if RGB666 format, then hactive must be multiple of 4 pixels */ 923 917 if (intel_dsi->pixel_format == MIPI_DSI_FMT_RGB666 && hactive % 4 != 0) 924 - drm_err(&dev_priv->drm, 918 + drm_err(display->drm, 925 919 "hactive pixels are not multiple of 4\n"); 926 920 927 921 /* program TRANS_HTOTAL register */ 928 922 for_each_dsi_port(port, intel_dsi->ports) { 929 923 dsi_trans = dsi_port_to_transcoder(port); 930 - intel_de_write(dev_priv, TRANS_HTOTAL(dev_priv, dsi_trans), 924 + intel_de_write(display, TRANS_HTOTAL(display, dsi_trans), 931 925 HACTIVE(hactive - 1) | HTOTAL(htotal - 1)); 932 926 } 933 927 ··· 936 930 if (intel_dsi->video_mode == NON_BURST_SYNC_PULSE) { 937 931 /* BSPEC: hsync size should be atleast 16 pixels */ 938 932 if (hsync_size < 16) 939 - drm_err(&dev_priv->drm, 933 + drm_err(display->drm, 940 934 "hsync size < 16 pixels\n"); 941 935 } 942 936 943 937 if (hback_porch < 16) 944 - drm_err(&dev_priv->drm, "hback porch < 16 pixels\n"); 938 + drm_err(display->drm, "hback porch < 16 pixels\n"); 945 939 946 940 if (intel_dsi->dual_link) { 947 941 hsync_start /= 2; ··· 950 944 951 945 for_each_dsi_port(port, intel_dsi->ports) { 952 946 dsi_trans = dsi_port_to_transcoder(port); 953 - intel_de_write(dev_priv, 954 - TRANS_HSYNC(dev_priv, dsi_trans), 947 + intel_de_write(display, 948 + TRANS_HSYNC(display, dsi_trans), 955 949 HSYNC_START(hsync_start - 1) | HSYNC_END(hsync_end - 1)); 956 950 } 957 951 } ··· 965 959 * struct drm_display_mode. 966 960 * For interlace mode: program required pixel minus 2 967 961 */ 968 - intel_de_write(dev_priv, TRANS_VTOTAL(dev_priv, dsi_trans), 962 + intel_de_write(display, TRANS_VTOTAL(display, dsi_trans), 969 963 VACTIVE(vactive - 1) | VTOTAL(vtotal - 1)); 970 964 } 971 965 972 966 if (vsync_end < vsync_start || vsync_end > vtotal) 973 - drm_err(&dev_priv->drm, "Invalid vsync_end value\n"); 967 + drm_err(display->drm, "Invalid vsync_end value\n"); 974 968 975 969 if (vsync_start < vactive) 976 - drm_err(&dev_priv->drm, "vsync_start less than vactive\n"); 970 + drm_err(display->drm, "vsync_start less than vactive\n"); 977 971 978 972 /* program TRANS_VSYNC register for video mode only */ 979 973 if (is_vid_mode(intel_dsi)) { 980 974 for_each_dsi_port(port, intel_dsi->ports) { 981 975 dsi_trans = dsi_port_to_transcoder(port); 982 - intel_de_write(dev_priv, 983 - TRANS_VSYNC(dev_priv, dsi_trans), 976 + intel_de_write(display, 977 + TRANS_VSYNC(display, dsi_trans), 984 978 VSYNC_START(vsync_start - 1) | VSYNC_END(vsync_end - 1)); 985 979 } 986 980 } ··· 994 988 if (is_vid_mode(intel_dsi)) { 995 989 for_each_dsi_port(port, intel_dsi->ports) { 996 990 dsi_trans = dsi_port_to_transcoder(port); 997 - intel_de_write(dev_priv, 998 - TRANS_VSYNCSHIFT(dev_priv, dsi_trans), 991 + intel_de_write(display, 992 + TRANS_VSYNCSHIFT(display, dsi_trans), 999 993 vsync_shift); 1000 994 } 1001 995 } ··· 1006 1000 * FIXME get rid of these local hacks and do it right, 1007 1001 * this will not handle eg. delayed vblank correctly. 1008 1002 */ 1009 - if (DISPLAY_VER(dev_priv) >= 12) { 1003 + if (DISPLAY_VER(display) >= 12) { 1010 1004 for_each_dsi_port(port, intel_dsi->ports) { 1011 1005 dsi_trans = dsi_port_to_transcoder(port); 1012 - intel_de_write(dev_priv, 1013 - TRANS_VBLANK(dev_priv, dsi_trans), 1006 + intel_de_write(display, 1007 + TRANS_VBLANK(display, dsi_trans), 1014 1008 VBLANK_START(vactive - 1) | VBLANK_END(vtotal - 1)); 1015 1009 } 1016 1010 } ··· 1018 1012 1019 1013 static void gen11_dsi_enable_transcoder(struct intel_encoder *encoder) 1020 1014 { 1021 - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); 1015 + struct intel_display *display = to_intel_display(encoder); 1022 1016 struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); 1023 1017 enum port port; 1024 1018 enum transcoder dsi_trans; 1025 1019 1026 1020 for_each_dsi_port(port, intel_dsi->ports) { 1027 1021 dsi_trans = dsi_port_to_transcoder(port); 1028 - intel_de_rmw(dev_priv, TRANSCONF(dev_priv, dsi_trans), 0, 1022 + intel_de_rmw(display, TRANSCONF(display, dsi_trans), 0, 1029 1023 TRANSCONF_ENABLE); 1030 1024 1031 1025 /* wait for transcoder to be enabled */ 1032 - if (intel_de_wait_for_set(dev_priv, TRANSCONF(dev_priv, dsi_trans), 1026 + if (intel_de_wait_for_set(display, TRANSCONF(display, dsi_trans), 1033 1027 TRANSCONF_STATE_ENABLE, 10)) 1034 - drm_err(&dev_priv->drm, 1028 + drm_err(display->drm, 1035 1029 "DSI transcoder not enabled\n"); 1036 1030 } 1037 1031 } ··· 1039 1033 static void gen11_dsi_setup_timeouts(struct intel_encoder *encoder, 1040 1034 const struct intel_crtc_state *crtc_state) 1041 1035 { 1042 - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); 1036 + struct intel_display *display = to_intel_display(encoder); 1043 1037 struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); 1044 1038 enum port port; 1045 1039 enum transcoder dsi_trans; ··· 1063 1057 dsi_trans = dsi_port_to_transcoder(port); 1064 1058 1065 1059 /* program hst_tx_timeout */ 1066 - intel_de_rmw(dev_priv, DSI_HSTX_TO(dsi_trans), 1060 + intel_de_rmw(display, DSI_HSTX_TO(dsi_trans), 1067 1061 HSTX_TIMEOUT_VALUE_MASK, 1068 1062 HSTX_TIMEOUT_VALUE(hs_tx_timeout)); 1069 1063 1070 1064 /* FIXME: DSI_CALIB_TO */ 1071 1065 1072 1066 /* program lp_rx_host timeout */ 1073 - intel_de_rmw(dev_priv, DSI_LPRX_HOST_TO(dsi_trans), 1067 + intel_de_rmw(display, DSI_LPRX_HOST_TO(dsi_trans), 1074 1068 LPRX_TIMEOUT_VALUE_MASK, 1075 1069 LPRX_TIMEOUT_VALUE(lp_rx_timeout)); 1076 1070 1077 1071 /* FIXME: DSI_PWAIT_TO */ 1078 1072 1079 1073 /* program turn around timeout */ 1080 - intel_de_rmw(dev_priv, DSI_TA_TO(dsi_trans), 1074 + intel_de_rmw(display, DSI_TA_TO(dsi_trans), 1081 1075 TA_TIMEOUT_VALUE_MASK, 1082 1076 TA_TIMEOUT_VALUE(ta_timeout)); 1083 1077 } ··· 1086 1080 static void gen11_dsi_config_util_pin(struct intel_encoder *encoder, 1087 1081 bool enable) 1088 1082 { 1089 - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); 1083 + struct intel_display *display = to_intel_display(encoder); 1090 1084 struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); 1091 1085 u32 tmp; 1092 1086 ··· 1098 1092 if (is_vid_mode(intel_dsi) || (intel_dsi->ports & BIT(PORT_B))) 1099 1093 return; 1100 1094 1101 - tmp = intel_de_read(dev_priv, UTIL_PIN_CTL); 1095 + tmp = intel_de_read(display, UTIL_PIN_CTL); 1102 1096 1103 1097 if (enable) { 1104 1098 tmp |= UTIL_PIN_DIRECTION_INPUT; ··· 1106 1100 } else { 1107 1101 tmp &= ~UTIL_PIN_ENABLE; 1108 1102 } 1109 - intel_de_write(dev_priv, UTIL_PIN_CTL, tmp); 1103 + intel_de_write(display, UTIL_PIN_CTL, tmp); 1110 1104 } 1111 1105 1112 1106 static void ··· 1144 1138 1145 1139 static void gen11_dsi_powerup_panel(struct intel_encoder *encoder) 1146 1140 { 1147 - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); 1141 + struct intel_display *display = to_intel_display(encoder); 1148 1142 struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); 1149 1143 struct mipi_dsi_device *dsi; 1150 1144 enum port port; ··· 1160 1154 * FIXME: This uses the number of DW's currently in the payload 1161 1155 * receive queue. This is probably not what we want here. 1162 1156 */ 1163 - tmp = intel_de_read(dev_priv, DSI_CMD_RXCTL(dsi_trans)); 1157 + tmp = intel_de_read(display, DSI_CMD_RXCTL(dsi_trans)); 1164 1158 tmp &= NUMBER_RX_PLOAD_DW_MASK; 1165 1159 /* multiply "Number Rx Payload DW" by 4 to get max value */ 1166 1160 tmp = tmp * 4; 1167 1161 dsi = intel_dsi->dsi_hosts[port]->device; 1168 1162 ret = mipi_dsi_set_maximum_return_packet_size(dsi, tmp); 1169 1163 if (ret < 0) 1170 - drm_err(&dev_priv->drm, 1164 + drm_err(display->drm, 1171 1165 "error setting max return pkt size%d\n", tmp); 1172 1166 } 1173 1167 ··· 1227 1221 static void icl_apply_kvmr_pipe_a_wa(struct intel_encoder *encoder, 1228 1222 enum pipe pipe, bool enable) 1229 1223 { 1230 - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); 1224 + struct intel_display *display = to_intel_display(encoder); 1231 1225 1232 - if (DISPLAY_VER(dev_priv) == 11 && pipe == PIPE_B) 1233 - intel_de_rmw(dev_priv, CHICKEN_PAR1_1, 1226 + if (DISPLAY_VER(display) == 11 && pipe == PIPE_B) 1227 + intel_de_rmw(display, CHICKEN_PAR1_1, 1234 1228 IGNORE_KVMR_PIPE_A, 1235 1229 enable ? IGNORE_KVMR_PIPE_A : 0); 1236 1230 } ··· 1243 1237 */ 1244 1238 static void adlp_set_lp_hs_wakeup_gb(struct intel_encoder *encoder) 1245 1239 { 1246 - struct drm_i915_private *i915 = to_i915(encoder->base.dev); 1240 + struct intel_display *display = to_intel_display(encoder); 1247 1241 struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); 1248 1242 enum port port; 1249 1243 1250 - if (DISPLAY_VER(i915) == 13) { 1244 + if (DISPLAY_VER(display) == 13) { 1251 1245 for_each_dsi_port(port, intel_dsi->ports) 1252 - intel_de_rmw(i915, TGL_DSI_CHKN_REG(port), 1246 + intel_de_rmw(display, TGL_DSI_CHKN_REG(port), 1253 1247 TGL_DSI_CHKN_LSHS_GB_MASK, 1254 1248 TGL_DSI_CHKN_LSHS_GB(4)); 1255 1249 } ··· 1283 1277 1284 1278 static void gen11_dsi_disable_transcoder(struct intel_encoder *encoder) 1285 1279 { 1286 - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); 1280 + struct intel_display *display = to_intel_display(encoder); 1287 1281 struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); 1288 1282 enum port port; 1289 1283 enum transcoder dsi_trans; ··· 1292 1286 dsi_trans = dsi_port_to_transcoder(port); 1293 1287 1294 1288 /* disable transcoder */ 1295 - intel_de_rmw(dev_priv, TRANSCONF(dev_priv, dsi_trans), 1289 + intel_de_rmw(display, TRANSCONF(display, dsi_trans), 1296 1290 TRANSCONF_ENABLE, 0); 1297 1291 1298 1292 /* wait for transcoder to be disabled */ 1299 - if (intel_de_wait_for_clear(dev_priv, TRANSCONF(dev_priv, dsi_trans), 1293 + if (intel_de_wait_for_clear(display, TRANSCONF(display, dsi_trans), 1300 1294 TRANSCONF_STATE_ENABLE, 50)) 1301 - drm_err(&dev_priv->drm, 1295 + drm_err(display->drm, 1302 1296 "DSI trancoder not disabled\n"); 1303 1297 } 1304 1298 } ··· 1315 1309 1316 1310 static void gen11_dsi_deconfigure_trancoder(struct intel_encoder *encoder) 1317 1311 { 1318 - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); 1312 + struct intel_display *display = to_intel_display(encoder); 1319 1313 struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); 1320 1314 enum port port; 1321 1315 enum transcoder dsi_trans; ··· 1324 1318 /* disable periodic update mode */ 1325 1319 if (is_cmd_mode(intel_dsi)) { 1326 1320 for_each_dsi_port(port, intel_dsi->ports) 1327 - intel_de_rmw(dev_priv, DSI_CMD_FRMCTL(port), 1321 + intel_de_rmw(display, DSI_CMD_FRMCTL(port), 1328 1322 DSI_PERIODIC_FRAME_UPDATE_ENABLE, 0); 1329 1323 } 1330 1324 1331 1325 /* put dsi link in ULPS */ 1332 1326 for_each_dsi_port(port, intel_dsi->ports) { 1333 1327 dsi_trans = dsi_port_to_transcoder(port); 1334 - tmp = intel_de_read(dev_priv, DSI_LP_MSG(dsi_trans)); 1328 + tmp = intel_de_read(display, DSI_LP_MSG(dsi_trans)); 1335 1329 tmp |= LINK_ENTER_ULPS; 1336 1330 tmp &= ~LINK_ULPS_TYPE_LP11; 1337 - intel_de_write(dev_priv, DSI_LP_MSG(dsi_trans), tmp); 1331 + intel_de_write(display, DSI_LP_MSG(dsi_trans), tmp); 1338 1332 1339 - if (wait_for_us((intel_de_read(dev_priv, DSI_LP_MSG(dsi_trans)) & 1333 + if (wait_for_us((intel_de_read(display, DSI_LP_MSG(dsi_trans)) & 1340 1334 LINK_IN_ULPS), 1341 1335 10)) 1342 - drm_err(&dev_priv->drm, "DSI link not in ULPS\n"); 1336 + drm_err(display->drm, "DSI link not in ULPS\n"); 1343 1337 } 1344 1338 1345 1339 /* disable ddi function */ 1346 1340 for_each_dsi_port(port, intel_dsi->ports) { 1347 1341 dsi_trans = dsi_port_to_transcoder(port); 1348 - intel_de_rmw(dev_priv, 1349 - TRANS_DDI_FUNC_CTL(dev_priv, dsi_trans), 1342 + intel_de_rmw(display, 1343 + TRANS_DDI_FUNC_CTL(display, dsi_trans), 1350 1344 TRANS_DDI_FUNC_ENABLE, 0); 1351 1345 } 1352 1346 ··· 1354 1348 if (intel_dsi->dual_link) { 1355 1349 for_each_dsi_port(port, intel_dsi->ports) { 1356 1350 dsi_trans = dsi_port_to_transcoder(port); 1357 - intel_de_rmw(dev_priv, 1358 - TRANS_DDI_FUNC_CTL2(dev_priv, dsi_trans), 1351 + intel_de_rmw(display, 1352 + TRANS_DDI_FUNC_CTL2(display, dsi_trans), 1359 1353 PORT_SYNC_MODE_ENABLE, 0); 1360 1354 } 1361 1355 } ··· 1363 1357 1364 1358 static void gen11_dsi_disable_port(struct intel_encoder *encoder) 1365 1359 { 1366 - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); 1360 + struct intel_display *display = to_intel_display(encoder); 1367 1361 struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); 1368 1362 enum port port; 1369 1363 1370 1364 gen11_dsi_ungate_clocks(encoder); 1371 1365 for_each_dsi_port(port, intel_dsi->ports) { 1372 - intel_de_rmw(dev_priv, DDI_BUF_CTL(port), DDI_BUF_CTL_ENABLE, 0); 1366 + intel_de_rmw(display, DDI_BUF_CTL(port), DDI_BUF_CTL_ENABLE, 0); 1373 1367 1374 - if (wait_for_us((intel_de_read(dev_priv, DDI_BUF_CTL(port)) & 1368 + if (wait_for_us((intel_de_read(display, DDI_BUF_CTL(port)) & 1375 1369 DDI_BUF_IS_IDLE), 1376 1370 8)) 1377 - drm_err(&dev_priv->drm, 1371 + drm_err(display->drm, 1378 1372 "DDI port:%c buffer not idle\n", 1379 1373 port_name(port)); 1380 1374 } ··· 1383 1377 1384 1378 static void gen11_dsi_disable_io_power(struct intel_encoder *encoder) 1385 1379 { 1380 + struct intel_display *display = to_intel_display(encoder); 1386 1381 struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); 1387 1382 struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); 1388 1383 enum port port; ··· 1401 1394 1402 1395 /* set mode to DDI */ 1403 1396 for_each_dsi_port(port, intel_dsi->ports) 1404 - intel_de_rmw(dev_priv, ICL_DSI_IO_MODECTL(port), 1397 + intel_de_rmw(display, ICL_DSI_IO_MODECTL(port), 1405 1398 COMBO_PHY_MODE_DSI, 0); 1406 1399 } 1407 1400 ··· 1513 1506 1514 1507 static bool gen11_dsi_is_periodic_cmd_mode(struct intel_dsi *intel_dsi) 1515 1508 { 1516 - struct drm_device *dev = intel_dsi->base.base.dev; 1517 - struct drm_i915_private *dev_priv = to_i915(dev); 1509 + struct intel_display *display = to_intel_display(&intel_dsi->base); 1518 1510 enum transcoder dsi_trans; 1519 1511 u32 val; 1520 1512 ··· 1522 1516 else 1523 1517 dsi_trans = TRANSCODER_DSI_0; 1524 1518 1525 - val = intel_de_read(dev_priv, DSI_TRANS_FUNC_CONF(dsi_trans)); 1519 + val = intel_de_read(display, DSI_TRANS_FUNC_CONF(dsi_trans)); 1526 1520 return (val & DSI_PERIODIC_FRAME_UPDATE_ENABLE); 1527 1521 } 1528 1522 ··· 1565 1559 static void gen11_dsi_sync_state(struct intel_encoder *encoder, 1566 1560 const struct intel_crtc_state *crtc_state) 1567 1561 { 1568 - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); 1562 + struct intel_display *display = to_intel_display(encoder); 1569 1563 struct intel_crtc *intel_crtc; 1570 1564 enum pipe pipe; 1571 1565 ··· 1576 1570 pipe = intel_crtc->pipe; 1577 1571 1578 1572 /* wa verify 1409054076:icl,jsl,ehl */ 1579 - if (DISPLAY_VER(dev_priv) == 11 && pipe == PIPE_B && 1580 - !(intel_de_read(dev_priv, CHICKEN_PAR1_1) & IGNORE_KVMR_PIPE_A)) 1581 - drm_dbg_kms(&dev_priv->drm, 1573 + if (DISPLAY_VER(display) == 11 && pipe == PIPE_B && 1574 + !(intel_de_read(display, CHICKEN_PAR1_1) & IGNORE_KVMR_PIPE_A)) 1575 + drm_dbg_kms(display->drm, 1582 1576 "[ENCODER:%d:%s] BIOS left IGNORE_KVMR_PIPE_A cleared with pipe B enabled\n", 1583 1577 encoder->base.base.id, 1584 1578 encoder->base.name); ··· 1587 1581 static int gen11_dsi_dsc_compute_config(struct intel_encoder *encoder, 1588 1582 struct intel_crtc_state *crtc_state) 1589 1583 { 1590 - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); 1584 + struct intel_display *display = to_intel_display(encoder); 1591 1585 struct drm_dsc_config *vdsc_cfg = &crtc_state->dsc.config; 1592 - int dsc_max_bpc = DISPLAY_VER(dev_priv) >= 12 ? 12 : 10; 1586 + int dsc_max_bpc = DISPLAY_VER(display) >= 12 ? 12 : 10; 1593 1587 bool use_dsc; 1594 1588 int ret; 1595 1589 ··· 1614 1608 return ret; 1615 1609 1616 1610 /* DSI specific sanity checks on the common code */ 1617 - drm_WARN_ON(&dev_priv->drm, vdsc_cfg->vbr_enable); 1618 - drm_WARN_ON(&dev_priv->drm, vdsc_cfg->simple_422); 1619 - drm_WARN_ON(&dev_priv->drm, 1611 + drm_WARN_ON(display->drm, vdsc_cfg->vbr_enable); 1612 + drm_WARN_ON(display->drm, vdsc_cfg->simple_422); 1613 + drm_WARN_ON(display->drm, 1620 1614 vdsc_cfg->pic_width % vdsc_cfg->slice_width); 1621 - drm_WARN_ON(&dev_priv->drm, vdsc_cfg->slice_height < 8); 1622 - drm_WARN_ON(&dev_priv->drm, 1615 + drm_WARN_ON(display->drm, vdsc_cfg->slice_height < 8); 1616 + drm_WARN_ON(display->drm, 1623 1617 vdsc_cfg->pic_height % vdsc_cfg->slice_height); 1624 1618 1625 1619 ret = drm_dsc_compute_rc_parameters(vdsc_cfg); ··· 1635 1629 struct intel_crtc_state *pipe_config, 1636 1630 struct drm_connector_state *conn_state) 1637 1631 { 1638 - struct drm_i915_private *i915 = to_i915(encoder->base.dev); 1632 + struct intel_display *display = to_intel_display(encoder); 1639 1633 struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); 1640 1634 struct intel_connector *intel_connector = intel_dsi->attached_connector; 1641 1635 struct drm_display_mode *adjusted_mode = ··· 1669 1663 pipe_config->clock_set = true; 1670 1664 1671 1665 if (gen11_dsi_dsc_compute_config(encoder, pipe_config)) 1672 - drm_dbg_kms(&i915->drm, "Attempting to use DSC failed\n"); 1666 + drm_dbg_kms(display->drm, "Attempting to use DSC failed\n"); 1673 1667 1674 1668 pipe_config->port_clock = afe_clk(encoder, pipe_config) / 5; 1675 1669 ··· 1687 1681 static void gen11_dsi_get_power_domains(struct intel_encoder *encoder, 1688 1682 struct intel_crtc_state *crtc_state) 1689 1683 { 1690 - struct drm_i915_private *i915 = to_i915(encoder->base.dev); 1691 - 1692 - get_dsi_io_power_domains(i915, 1693 - enc_to_intel_dsi(encoder)); 1684 + get_dsi_io_power_domains(enc_to_intel_dsi(encoder)); 1694 1685 } 1695 1686 1696 1687 static bool gen11_dsi_get_hw_state(struct intel_encoder *encoder, 1697 1688 enum pipe *pipe) 1698 1689 { 1690 + struct intel_display *display = to_intel_display(encoder); 1699 1691 struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); 1700 1692 struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); 1701 1693 enum transcoder dsi_trans; ··· 1709 1705 1710 1706 for_each_dsi_port(port, intel_dsi->ports) { 1711 1707 dsi_trans = dsi_port_to_transcoder(port); 1712 - tmp = intel_de_read(dev_priv, 1713 - TRANS_DDI_FUNC_CTL(dev_priv, dsi_trans)); 1708 + tmp = intel_de_read(display, 1709 + TRANS_DDI_FUNC_CTL(display, dsi_trans)); 1714 1710 switch (tmp & TRANS_DDI_EDP_INPUT_MASK) { 1715 1711 case TRANS_DDI_EDP_INPUT_A_ON: 1716 1712 *pipe = PIPE_A; ··· 1725 1721 *pipe = PIPE_D; 1726 1722 break; 1727 1723 default: 1728 - drm_err(&dev_priv->drm, "Invalid PIPE input\n"); 1724 + drm_err(display->drm, "Invalid PIPE input\n"); 1729 1725 goto out; 1730 1726 } 1731 1727 1732 - tmp = intel_de_read(dev_priv, TRANSCONF(dev_priv, dsi_trans)); 1728 + tmp = intel_de_read(display, TRANSCONF(display, dsi_trans)); 1733 1729 ret = tmp & TRANSCONF_ENABLE; 1734 1730 } 1735 1731 out: ··· 1839 1835 1840 1836 static void icl_dphy_param_init(struct intel_dsi *intel_dsi) 1841 1837 { 1842 - struct drm_device *dev = intel_dsi->base.base.dev; 1843 - struct drm_i915_private *dev_priv = to_i915(dev); 1838 + struct intel_display *display = to_intel_display(&intel_dsi->base); 1844 1839 struct intel_connector *connector = intel_dsi->attached_connector; 1845 1840 struct mipi_config *mipi_config = connector->panel.vbt.dsi.config; 1846 1841 u32 tlpx_ns; ··· 1863 1860 */ 1864 1861 prepare_cnt = DIV_ROUND_UP(ths_prepare_ns * 4, tlpx_ns); 1865 1862 if (prepare_cnt > ICL_PREPARE_CNT_MAX) { 1866 - drm_dbg_kms(&dev_priv->drm, "prepare_cnt out of range (%d)\n", 1863 + drm_dbg_kms(display->drm, "prepare_cnt out of range (%d)\n", 1867 1864 prepare_cnt); 1868 1865 prepare_cnt = ICL_PREPARE_CNT_MAX; 1869 1866 } ··· 1872 1869 clk_zero_cnt = DIV_ROUND_UP(mipi_config->tclk_prepare_clkzero - 1873 1870 ths_prepare_ns, tlpx_ns); 1874 1871 if (clk_zero_cnt > ICL_CLK_ZERO_CNT_MAX) { 1875 - drm_dbg_kms(&dev_priv->drm, 1872 + drm_dbg_kms(display->drm, 1876 1873 "clk_zero_cnt out of range (%d)\n", clk_zero_cnt); 1877 1874 clk_zero_cnt = ICL_CLK_ZERO_CNT_MAX; 1878 1875 } ··· 1880 1877 /* trail cnt in escape clocks*/ 1881 1878 trail_cnt = DIV_ROUND_UP(tclk_trail_ns, tlpx_ns); 1882 1879 if (trail_cnt > ICL_TRAIL_CNT_MAX) { 1883 - drm_dbg_kms(&dev_priv->drm, "trail_cnt out of range (%d)\n", 1880 + drm_dbg_kms(display->drm, "trail_cnt out of range (%d)\n", 1884 1881 trail_cnt); 1885 1882 trail_cnt = ICL_TRAIL_CNT_MAX; 1886 1883 } ··· 1888 1885 /* tclk pre count in escape clocks */ 1889 1886 tclk_pre_cnt = DIV_ROUND_UP(mipi_config->tclk_pre, tlpx_ns); 1890 1887 if (tclk_pre_cnt > ICL_TCLK_PRE_CNT_MAX) { 1891 - drm_dbg_kms(&dev_priv->drm, 1888 + drm_dbg_kms(display->drm, 1892 1889 "tclk_pre_cnt out of range (%d)\n", tclk_pre_cnt); 1893 1890 tclk_pre_cnt = ICL_TCLK_PRE_CNT_MAX; 1894 1891 } ··· 1897 1894 hs_zero_cnt = DIV_ROUND_UP(mipi_config->ths_prepare_hszero - 1898 1895 ths_prepare_ns, tlpx_ns); 1899 1896 if (hs_zero_cnt > ICL_HS_ZERO_CNT_MAX) { 1900 - drm_dbg_kms(&dev_priv->drm, "hs_zero_cnt out of range (%d)\n", 1897 + drm_dbg_kms(display->drm, "hs_zero_cnt out of range (%d)\n", 1901 1898 hs_zero_cnt); 1902 1899 hs_zero_cnt = ICL_HS_ZERO_CNT_MAX; 1903 1900 } ··· 1905 1902 /* hs exit zero cnt in escape clocks */ 1906 1903 exit_zero_cnt = DIV_ROUND_UP(mipi_config->ths_exit, tlpx_ns); 1907 1904 if (exit_zero_cnt > ICL_EXIT_ZERO_CNT_MAX) { 1908 - drm_dbg_kms(&dev_priv->drm, 1905 + drm_dbg_kms(display->drm, 1909 1906 "exit_zero_cnt out of range (%d)\n", 1910 1907 exit_zero_cnt); 1911 1908 exit_zero_cnt = ICL_EXIT_ZERO_CNT_MAX; ··· 1947 1944 fixed_mode->vdisplay); 1948 1945 } 1949 1946 1950 - void icl_dsi_init(struct drm_i915_private *dev_priv, 1947 + void icl_dsi_init(struct intel_display *display, 1951 1948 const struct intel_bios_encoder_data *devdata) 1952 1949 { 1953 - struct intel_display *display = &dev_priv->display; 1954 1950 struct intel_dsi *intel_dsi; 1955 1951 struct intel_encoder *encoder; 1956 1952 struct intel_connector *intel_connector; ··· 1977 1975 encoder->devdata = devdata; 1978 1976 1979 1977 /* register DSI encoder with DRM subsystem */ 1980 - drm_encoder_init(&dev_priv->drm, &encoder->base, &gen11_dsi_encoder_funcs, 1978 + drm_encoder_init(display->drm, &encoder->base, 1979 + &gen11_dsi_encoder_funcs, 1981 1980 DRM_MODE_ENCODER_DSI, "DSI %c", port_name(port)); 1982 1981 1983 1982 encoder->pre_pll_enable = gen11_dsi_pre_pll_enable; ··· 2003 2000 encoder->shutdown = intel_dsi_shutdown; 2004 2001 2005 2002 /* register DSI connector with DRM subsystem */ 2006 - drm_connector_init(&dev_priv->drm, connector, &gen11_dsi_connector_funcs, 2003 + drm_connector_init(display->drm, connector, 2004 + &gen11_dsi_connector_funcs, 2007 2005 DRM_MODE_CONNECTOR_DSI); 2008 2006 drm_connector_helper_add(connector, &gen11_dsi_connector_helper_funcs); 2009 2007 connector->display_info.subpixel_order = SubPixelHorizontalRGB; ··· 2017 2013 2018 2014 intel_bios_init_panel_late(display, &intel_connector->panel, encoder->devdata, NULL); 2019 2015 2020 - mutex_lock(&dev_priv->drm.mode_config.mutex); 2016 + mutex_lock(&display->drm->mode_config.mutex); 2021 2017 intel_panel_add_vbt_lfp_fixed_mode(intel_connector); 2022 - mutex_unlock(&dev_priv->drm.mode_config.mutex); 2018 + mutex_unlock(&display->drm->mode_config.mutex); 2023 2019 2024 2020 if (!intel_panel_preferred_fixed_mode(intel_connector)) { 2025 - drm_err(&dev_priv->drm, "DSI fixed mode info missing\n"); 2021 + drm_err(display->drm, "DSI fixed mode info missing\n"); 2026 2022 goto err; 2027 2023 } 2028 2024 ··· 2035 2031 else 2036 2032 intel_dsi->ports = BIT(port); 2037 2033 2038 - if (drm_WARN_ON(&dev_priv->drm, intel_connector->panel.vbt.dsi.bl_ports & ~intel_dsi->ports)) 2034 + if (drm_WARN_ON(display->drm, intel_connector->panel.vbt.dsi.bl_ports & ~intel_dsi->ports)) 2039 2035 intel_connector->panel.vbt.dsi.bl_ports &= intel_dsi->ports; 2040 2036 2041 - if (drm_WARN_ON(&dev_priv->drm, intel_connector->panel.vbt.dsi.cabc_ports & ~intel_dsi->ports)) 2037 + if (drm_WARN_ON(display->drm, intel_connector->panel.vbt.dsi.cabc_ports & ~intel_dsi->ports)) 2042 2038 intel_connector->panel.vbt.dsi.cabc_ports &= intel_dsi->ports; 2043 2039 2044 2040 for_each_dsi_port(port, intel_dsi->ports) { ··· 2052 2048 } 2053 2049 2054 2050 if (!intel_dsi_vbt_init(intel_dsi, MIPI_DSI_GENERIC_PANEL_ID)) { 2055 - drm_dbg_kms(&dev_priv->drm, "no device found\n"); 2051 + drm_dbg_kms(display->drm, "no device found\n"); 2056 2052 goto err; 2057 2053 } 2058 2054
+2 -2
drivers/gpu/drm/i915/display/icl_dsi.h
··· 6 6 #ifndef __ICL_DSI_H__ 7 7 #define __ICL_DSI_H__ 8 8 9 - struct drm_i915_private; 10 9 struct intel_bios_encoder_data; 11 10 struct intel_crtc_state; 11 + struct intel_display; 12 12 13 - void icl_dsi_init(struct drm_i915_private *dev_priv, 13 + void icl_dsi_init(struct intel_display *display, 14 14 const struct intel_bios_encoder_data *devdata); 15 15 void icl_dsi_frame_update(struct intel_crtc_state *crtc_state); 16 16
+1 -1
drivers/gpu/drm/i915/display/intel_ddi.c
··· 4885 4885 if (!assert_has_icl_dsi(dev_priv)) 4886 4886 return; 4887 4887 4888 - icl_dsi_init(dev_priv, devdata); 4888 + icl_dsi_init(display, devdata); 4889 4889 return; 4890 4890 } 4891 4891