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

drm/i915/lvds: convert intel_lvds.[ch] to struct intel_display

Going forward, struct intel_display is the main display device data
pointer. Convert as much as possible of intel_lvds.[ch] to struct
intel_display.

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://lore.kernel.org/r/2b5205db60f956dba788cc894531cc74d0dd853d.1742554320.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>

+97 -95
+5 -6
drivers/gpu/drm/i915/display/intel_display.c
··· 2342 2342 { 2343 2343 struct intel_display *display = to_intel_display(crtc_state); 2344 2344 struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); 2345 - struct drm_i915_private *i915 = to_i915(crtc->base.dev); 2346 2345 2347 2346 intel_joiner_compute_pipe_src(crtc_state); 2348 2347 ··· 2360 2361 } 2361 2362 2362 2363 if (intel_crtc_has_type(crtc_state, INTEL_OUTPUT_LVDS) && 2363 - intel_is_dual_link_lvds(i915)) { 2364 + intel_is_dual_link_lvds(display)) { 2364 2365 drm_dbg_kms(display->drm, 2365 2366 "[CRTC:%d:%s] Odd pipe source width not supported with dual link LVDS\n", 2366 2367 crtc->base.base.id, crtc->base.name); ··· 7677 7678 * to prevent the registration of both eDP and LVDS and the 7678 7679 * incorrect sharing of the PPS. 7679 7680 */ 7680 - intel_lvds_init(dev_priv); 7681 + intel_lvds_init(display); 7681 7682 intel_crt_init(display); 7682 7683 7683 7684 dpd_is_edp = intel_dp_is_port_edp(display, PORT_D); ··· 7754 7755 7755 7756 vlv_dsi_init(display); 7756 7757 } else if (display->platform.pineview) { 7757 - intel_lvds_init(dev_priv); 7758 + intel_lvds_init(display); 7758 7759 intel_crt_init(display); 7759 7760 } else if (IS_DISPLAY_VER(display, 3, 4)) { 7760 7761 bool found = false; 7761 7762 7762 7763 if (display->platform.mobile) 7763 - intel_lvds_init(dev_priv); 7764 + intel_lvds_init(display); 7764 7765 7765 7766 intel_crt_init(display); 7766 7767 ··· 7802 7803 intel_tv_init(display); 7803 7804 } else if (DISPLAY_VER(display) == 2) { 7804 7805 if (display->platform.i85x) 7805 - intel_lvds_init(dev_priv); 7806 + intel_lvds_init(display); 7806 7807 7807 7808 intel_crt_init(display); 7808 7809 intel_dvo_init(display);
+1 -1
drivers/gpu/drm/i915/display/intel_dp.c
··· 6325 6325 * eDP and LVDS bail out early in this case to prevent interfering 6326 6326 * with an already powered-on LVDS power sequencer. 6327 6327 */ 6328 - if (intel_get_lvds_encoder(dev_priv)) { 6328 + if (intel_get_lvds_encoder(display)) { 6329 6329 drm_WARN_ON(display->drm, 6330 6330 !(HAS_PCH_IBX(dev_priv) || HAS_PCH_CPT(dev_priv))); 6331 6331 drm_info(display->drm,
+7 -6
drivers/gpu/drm/i915/display/intel_dpll.c
··· 421 421 /* Returns the clock of the currently programmed mode of the given pipe. */ 422 422 void i9xx_crtc_clock_get(struct intel_crtc_state *crtc_state) 423 423 { 424 + struct intel_display *display = to_intel_display(crtc_state); 424 425 struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); 425 426 struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); 426 427 const struct i9xx_dpll_hw_state *hw_state = &crtc_state->dpll_hw_state.i9xx; ··· 477 476 enum pipe lvds_pipe; 478 477 479 478 if (IS_I85X(dev_priv) && 480 - intel_lvds_port_enabled(dev_priv, LVDS, &lvds_pipe) && 479 + intel_lvds_port_enabled(display, LVDS, &lvds_pipe) && 481 480 lvds_pipe == crtc->pipe) { 482 481 u32 lvds = intel_de_read(dev_priv, LVDS); 483 482 ··· 621 620 const struct intel_crtc_state *crtc_state, 622 621 int target) 623 622 { 624 - struct drm_i915_private *dev_priv = to_i915(crtc_state->uapi.crtc->dev); 623 + struct intel_display *display = to_intel_display(crtc_state); 625 624 626 625 if (intel_crtc_has_type(crtc_state, INTEL_OUTPUT_LVDS)) { 627 626 /* ··· 629 628 * We haven't figured out how to reliably set up different 630 629 * single/dual channel state, if we even can. 631 630 */ 632 - if (intel_is_dual_link_lvds(dev_priv)) 631 + if (intel_is_dual_link_lvds(display)) 633 632 return limit->p2.p2_fast; 634 633 else 635 634 return limit->p2.p2_slow; ··· 1247 1246 1248 1247 if (intel_crtc_has_type(crtc_state, INTEL_OUTPUT_LVDS) && 1249 1248 ((intel_panel_use_ssc(display) && i915->display.vbt.lvds_ssc_freq == 100000) || 1250 - (HAS_PCH_IBX(i915) && intel_is_dual_link_lvds(i915)))) 1249 + (HAS_PCH_IBX(i915) && intel_is_dual_link_lvds(display)))) 1251 1250 return 25; 1252 1251 1253 1252 if (crtc_state->sdvo_tv_clock) ··· 1382 1381 refclk = dev_priv->display.vbt.lvds_ssc_freq; 1383 1382 } 1384 1383 1385 - if (intel_is_dual_link_lvds(dev_priv)) { 1384 + if (intel_is_dual_link_lvds(display)) { 1386 1385 if (refclk == 100000) 1387 1386 limit = &ilk_limits_dual_lvds_100m; 1388 1387 else ··· 1554 1553 refclk); 1555 1554 } 1556 1555 1557 - if (intel_is_dual_link_lvds(dev_priv)) 1556 + if (intel_is_dual_link_lvds(display)) 1558 1557 limit = &intel_limits_g4x_dual_channel_lvds; 1559 1558 else 1560 1559 limit = &intel_limits_g4x_single_channel_lvds;
+72 -70
drivers/gpu/drm/i915/display/intel_lvds.c
··· 84 84 return container_of(encoder, struct intel_lvds_encoder, base); 85 85 } 86 86 87 - bool intel_lvds_port_enabled(struct drm_i915_private *i915, 87 + bool intel_lvds_port_enabled(struct intel_display *display, 88 88 i915_reg_t lvds_reg, enum pipe *pipe) 89 89 { 90 + struct drm_i915_private *i915 = to_i915(display->drm); 90 91 u32 val; 91 92 92 - val = intel_de_read(i915, lvds_reg); 93 + val = intel_de_read(display, lvds_reg); 93 94 94 95 /* asserts want to know the pipe even if the port is disabled */ 95 96 if (HAS_PCH_CPT(i915)) ··· 105 104 enum pipe *pipe) 106 105 { 107 106 struct intel_display *display = to_intel_display(encoder); 108 - struct drm_i915_private *i915 = to_i915(encoder->base.dev); 109 107 struct intel_lvds_encoder *lvds_encoder = to_lvds_encoder(encoder); 110 108 intel_wakeref_t wakeref; 111 109 bool ret; ··· 113 113 if (!wakeref) 114 114 return false; 115 115 116 - ret = intel_lvds_port_enabled(i915, lvds_encoder->reg, pipe); 116 + ret = intel_lvds_port_enabled(display, lvds_encoder->reg, pipe); 117 117 118 118 intel_display_power_put(display, encoder->power_domain, wakeref); 119 119 ··· 123 123 static void intel_lvds_get_config(struct intel_encoder *encoder, 124 124 struct intel_crtc_state *crtc_state) 125 125 { 126 - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); 126 + struct intel_display *display = to_intel_display(encoder); 127 127 struct intel_lvds_encoder *lvds_encoder = to_lvds_encoder(encoder); 128 128 u32 tmp, flags = 0; 129 129 130 130 crtc_state->output_types |= BIT(INTEL_OUTPUT_LVDS); 131 131 132 - tmp = intel_de_read(dev_priv, lvds_encoder->reg); 132 + tmp = intel_de_read(display, lvds_encoder->reg); 133 133 if (tmp & LVDS_HSYNC_POLARITY) 134 134 flags |= DRM_MODE_FLAG_NHSYNC; 135 135 else ··· 141 141 142 142 crtc_state->hw.adjusted_mode.flags |= flags; 143 143 144 - if (DISPLAY_VER(dev_priv) < 5) 144 + if (DISPLAY_VER(display) < 5) 145 145 crtc_state->gmch_pfit.lvds_border_bits = 146 146 tmp & LVDS_BORDER_ENABLE; 147 147 148 148 /* gen2/3 store dither state in pfit control, needs to match */ 149 - if (DISPLAY_VER(dev_priv) < 4) { 150 - tmp = intel_de_read(dev_priv, PFIT_CONTROL(dev_priv)); 149 + if (DISPLAY_VER(display) < 4) { 150 + tmp = intel_de_read(display, PFIT_CONTROL(display)); 151 151 152 152 crtc_state->gmch_pfit.control |= tmp & PFIT_PANEL_8TO6_DITHER_ENABLE; 153 153 } ··· 155 155 crtc_state->hw.adjusted_mode.crtc_clock = crtc_state->port_clock; 156 156 } 157 157 158 - static void intel_lvds_pps_get_hw_state(struct drm_i915_private *dev_priv, 158 + static void intel_lvds_pps_get_hw_state(struct intel_display *display, 159 159 struct intel_lvds_pps *pps) 160 160 { 161 161 u32 val; 162 162 163 - pps->powerdown_on_reset = intel_de_read(dev_priv, 164 - PP_CONTROL(dev_priv, 0)) & PANEL_POWER_RESET; 163 + pps->powerdown_on_reset = intel_de_read(display, 164 + PP_CONTROL(display, 0)) & PANEL_POWER_RESET; 165 165 166 - val = intel_de_read(dev_priv, PP_ON_DELAYS(dev_priv, 0)); 166 + val = intel_de_read(display, PP_ON_DELAYS(display, 0)); 167 167 pps->port = REG_FIELD_GET(PANEL_PORT_SELECT_MASK, val); 168 168 pps->delays.power_up = REG_FIELD_GET(PANEL_POWER_UP_DELAY_MASK, val); 169 169 pps->delays.backlight_on = REG_FIELD_GET(PANEL_LIGHT_ON_DELAY_MASK, val); 170 170 171 - val = intel_de_read(dev_priv, PP_OFF_DELAYS(dev_priv, 0)); 171 + val = intel_de_read(display, PP_OFF_DELAYS(display, 0)); 172 172 pps->delays.power_down = REG_FIELD_GET(PANEL_POWER_DOWN_DELAY_MASK, val); 173 173 pps->delays.backlight_off = REG_FIELD_GET(PANEL_LIGHT_OFF_DELAY_MASK, val); 174 174 175 - val = intel_de_read(dev_priv, PP_DIVISOR(dev_priv, 0)); 175 + val = intel_de_read(display, PP_DIVISOR(display, 0)); 176 176 pps->divider = REG_FIELD_GET(PP_REFERENCE_DIVIDER_MASK, val); 177 177 val = REG_FIELD_GET(PANEL_POWER_CYCLE_DELAY_MASK, val); 178 178 /* ··· 185 185 /* Convert from 100ms to 100us units */ 186 186 pps->delays.power_cycle = val * 1000; 187 187 188 - if (DISPLAY_VER(dev_priv) < 5 && 188 + if (DISPLAY_VER(display) < 5 && 189 189 pps->delays.power_up == 0 && 190 190 pps->delays.backlight_on == 0 && 191 191 pps->delays.power_down == 0 && 192 192 pps->delays.backlight_off == 0) { 193 - drm_dbg_kms(&dev_priv->drm, 193 + drm_dbg_kms(display->drm, 194 194 "Panel power timings uninitialized, " 195 195 "setting defaults\n"); 196 196 /* Set T2 to 40ms and T5 to 200ms in 100 usec units */ ··· 201 201 pps->delays.backlight_off = 200 * 10; 202 202 } 203 203 204 - drm_dbg(&dev_priv->drm, "LVDS PPS:power_up %d power_down %d power_cycle %d backlight_on %d backlight_off %d " 204 + drm_dbg(display->drm, "LVDS PPS:power_up %d power_down %d power_cycle %d backlight_on %d backlight_off %d " 205 205 "divider %d port %d powerdown_on_reset %d\n", 206 206 pps->delays.power_up, pps->delays.power_down, 207 207 pps->delays.power_cycle, pps->delays.backlight_on, ··· 209 209 pps->port, pps->powerdown_on_reset); 210 210 } 211 211 212 - static void intel_lvds_pps_init_hw(struct drm_i915_private *dev_priv, 212 + static void intel_lvds_pps_init_hw(struct intel_display *display, 213 213 struct intel_lvds_pps *pps) 214 214 { 215 215 u32 val; 216 216 217 - val = intel_de_read(dev_priv, PP_CONTROL(dev_priv, 0)); 218 - drm_WARN_ON(&dev_priv->drm, 217 + val = intel_de_read(display, PP_CONTROL(display, 0)); 218 + drm_WARN_ON(display->drm, 219 219 (val & PANEL_UNLOCK_MASK) != PANEL_UNLOCK_REGS); 220 220 if (pps->powerdown_on_reset) 221 221 val |= PANEL_POWER_RESET; 222 - intel_de_write(dev_priv, PP_CONTROL(dev_priv, 0), val); 222 + intel_de_write(display, PP_CONTROL(display, 0), val); 223 223 224 - intel_de_write(dev_priv, PP_ON_DELAYS(dev_priv, 0), 224 + intel_de_write(display, PP_ON_DELAYS(display, 0), 225 225 REG_FIELD_PREP(PANEL_PORT_SELECT_MASK, pps->port) | 226 226 REG_FIELD_PREP(PANEL_POWER_UP_DELAY_MASK, pps->delays.power_up) | 227 227 REG_FIELD_PREP(PANEL_LIGHT_ON_DELAY_MASK, pps->delays.backlight_on)); 228 228 229 - intel_de_write(dev_priv, PP_OFF_DELAYS(dev_priv, 0), 229 + intel_de_write(display, PP_OFF_DELAYS(display, 0), 230 230 REG_FIELD_PREP(PANEL_POWER_DOWN_DELAY_MASK, pps->delays.power_down) | 231 231 REG_FIELD_PREP(PANEL_LIGHT_OFF_DELAY_MASK, pps->delays.backlight_off)); 232 232 233 - intel_de_write(dev_priv, PP_DIVISOR(dev_priv, 0), 233 + intel_de_write(display, PP_DIVISOR(display, 0), 234 234 REG_FIELD_PREP(PP_REFERENCE_DIVIDER_MASK, pps->divider) | 235 235 REG_FIELD_PREP(PANEL_POWER_CYCLE_DELAY_MASK, 236 236 DIV_ROUND_UP(pps->delays.power_cycle, 1000) + 1)); ··· 256 256 assert_pll_disabled(display, pipe); 257 257 } 258 258 259 - intel_lvds_pps_init_hw(i915, &lvds_encoder->init_pps); 259 + intel_lvds_pps_init_hw(display, &lvds_encoder->init_pps); 260 260 261 261 temp = lvds_encoder->init_lvds_val; 262 262 temp |= LVDS_PORT_EN | LVDS_A0A2_CLKA_POWER_UP; ··· 296 296 * special lvds dither control bit on pch-split platforms, dithering is 297 297 * only controlled through the TRANSCONF reg. 298 298 */ 299 - if (DISPLAY_VER(i915) == 4) { 299 + if (DISPLAY_VER(display) == 4) { 300 300 /* 301 301 * Bspec wording suggests that LVDS port dithering only exists 302 302 * for 18bpp panels. ··· 312 312 if (adjusted_mode->flags & DRM_MODE_FLAG_NVSYNC) 313 313 temp |= LVDS_VSYNC_POLARITY; 314 314 315 - intel_de_write(i915, lvds_encoder->reg, temp); 315 + intel_de_write(display, lvds_encoder->reg, temp); 316 316 } 317 317 318 318 /* ··· 323 323 const struct intel_crtc_state *crtc_state, 324 324 const struct drm_connector_state *conn_state) 325 325 { 326 + struct intel_display *display = to_intel_display(encoder); 326 327 struct intel_lvds_encoder *lvds_encoder = to_lvds_encoder(encoder); 327 - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); 328 328 329 - intel_de_rmw(dev_priv, lvds_encoder->reg, 0, LVDS_PORT_EN); 329 + intel_de_rmw(display, lvds_encoder->reg, 0, LVDS_PORT_EN); 330 330 331 - intel_de_rmw(dev_priv, PP_CONTROL(dev_priv, 0), 0, PANEL_POWER_ON); 332 - intel_de_posting_read(dev_priv, lvds_encoder->reg); 331 + intel_de_rmw(display, PP_CONTROL(display, 0), 0, PANEL_POWER_ON); 332 + intel_de_posting_read(display, lvds_encoder->reg); 333 333 334 - if (intel_de_wait_for_set(dev_priv, PP_STATUS(dev_priv, 0), PP_ON, 5000)) 335 - drm_err(&dev_priv->drm, 334 + if (intel_de_wait_for_set(display, PP_STATUS(display, 0), PP_ON, 5000)) 335 + drm_err(display->drm, 336 336 "timed out waiting for panel to power on\n"); 337 337 338 338 intel_backlight_enable(crtc_state, conn_state); ··· 343 343 const struct intel_crtc_state *old_crtc_state, 344 344 const struct drm_connector_state *old_conn_state) 345 345 { 346 + struct intel_display *display = to_intel_display(encoder); 346 347 struct intel_lvds_encoder *lvds_encoder = to_lvds_encoder(encoder); 347 - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); 348 348 349 - intel_de_rmw(dev_priv, PP_CONTROL(dev_priv, 0), PANEL_POWER_ON, 0); 350 - if (intel_de_wait_for_clear(dev_priv, PP_STATUS(dev_priv, 0), PP_ON, 1000)) 351 - drm_err(&dev_priv->drm, 349 + intel_de_rmw(display, PP_CONTROL(display, 0), PANEL_POWER_ON, 0); 350 + if (intel_de_wait_for_clear(display, PP_STATUS(display, 0), PP_ON, 1000)) 351 + drm_err(display->drm, 352 352 "timed out waiting for panel to power off\n"); 353 353 354 - intel_de_rmw(dev_priv, lvds_encoder->reg, LVDS_PORT_EN, 0); 355 - intel_de_posting_read(dev_priv, lvds_encoder->reg); 354 + intel_de_rmw(display, lvds_encoder->reg, LVDS_PORT_EN, 0); 355 + intel_de_posting_read(display, lvds_encoder->reg); 356 356 } 357 357 358 358 static void gmch_disable_lvds(struct intel_atomic_state *state, ··· 384 384 385 385 static void intel_lvds_shutdown(struct intel_encoder *encoder) 386 386 { 387 - struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); 387 + struct intel_display *display = to_intel_display(encoder); 388 388 389 - if (intel_de_wait_for_clear(dev_priv, PP_STATUS(dev_priv, 0), PP_CYCLE_DELAY_ACTIVE, 5000)) 390 - drm_err(&dev_priv->drm, 389 + if (intel_de_wait_for_clear(display, PP_STATUS(display, 0), PP_CYCLE_DELAY_ACTIVE, 5000)) 390 + drm_err(display->drm, 391 391 "timed out waiting for panel power cycle delay\n"); 392 392 } 393 393 ··· 420 420 struct intel_crtc_state *crtc_state, 421 421 struct drm_connector_state *conn_state) 422 422 { 423 + struct intel_display *display = to_intel_display(encoder); 423 424 struct drm_i915_private *i915 = to_i915(encoder->base.dev); 424 425 struct intel_lvds_encoder *lvds_encoder = to_lvds_encoder(encoder); 425 426 struct intel_connector *connector = lvds_encoder->attached_connector; ··· 430 429 int ret; 431 430 432 431 /* Should never happen!! */ 433 - if (DISPLAY_VER(i915) < 4 && crtc->pipe == 0) { 434 - drm_err(&i915->drm, "Can't support LVDS on pipe A\n"); 432 + if (DISPLAY_VER(display) < 4 && crtc->pipe == 0) { 433 + drm_err(display->drm, "Can't support LVDS on pipe A\n"); 435 434 return -EINVAL; 436 435 } 437 436 ··· 448 447 449 448 /* TODO: Check crtc_state->max_link_bpp_x16 instead of bw_constrained */ 450 449 if (lvds_bpp != crtc_state->pipe_bpp && !crtc_state->bw_constrained) { 451 - drm_dbg_kms(&i915->drm, 450 + drm_dbg_kms(display->drm, 452 451 "forcing display bpp (was %d) to LVDS (%d)\n", 453 452 crtc_state->pipe_bpp, lvds_bpp); 454 453 crtc_state->pipe_bpp = lvds_bpp; ··· 776 775 { } /* terminating entry */ 777 776 }; 778 777 779 - struct intel_encoder *intel_get_lvds_encoder(struct drm_i915_private *i915) 778 + struct intel_encoder *intel_get_lvds_encoder(struct intel_display *display) 780 779 { 781 780 struct intel_encoder *encoder; 782 781 783 - for_each_intel_encoder(&i915->drm, encoder) { 782 + for_each_intel_encoder(display->drm, encoder) { 784 783 if (encoder->type == INTEL_OUTPUT_LVDS) 785 784 return encoder; 786 785 } ··· 788 787 return NULL; 789 788 } 790 789 791 - bool intel_is_dual_link_lvds(struct drm_i915_private *i915) 790 + bool intel_is_dual_link_lvds(struct intel_display *display) 792 791 { 793 - struct intel_encoder *encoder = intel_get_lvds_encoder(i915); 792 + struct intel_encoder *encoder = intel_get_lvds_encoder(display); 794 793 795 794 return encoder && to_lvds_encoder(encoder)->is_dual_link; 796 795 } 797 796 798 797 static bool compute_is_dual_link_lvds(struct intel_lvds_encoder *lvds_encoder) 799 798 { 799 + struct intel_display *display = to_intel_display(&lvds_encoder->base); 800 800 struct drm_i915_private *i915 = to_i915(lvds_encoder->base.base.dev); 801 801 struct intel_connector *connector = lvds_encoder->attached_connector; 802 802 const struct drm_display_mode *fixed_mode = ··· 805 803 unsigned int val; 806 804 807 805 /* use the module option value if specified */ 808 - if (i915->display.params.lvds_channel_mode > 0) 809 - return i915->display.params.lvds_channel_mode == 2; 806 + if (display->params.lvds_channel_mode > 0) 807 + return display->params.lvds_channel_mode == 2; 810 808 811 809 /* single channel LVDS is limited to 112 MHz */ 812 810 if (fixed_mode->clock > 112999) ··· 821 819 * we need to check "the value to be set" in VBT when LVDS 822 820 * register is uninitialized. 823 821 */ 824 - val = intel_de_read(i915, lvds_encoder->reg); 822 + val = intel_de_read(display, lvds_encoder->reg); 825 823 if (HAS_PCH_CPT(i915)) 826 824 val &= ~(LVDS_DETECTED | LVDS_PIPE_SEL_MASK_CPT); 827 825 else ··· 839 837 840 838 /** 841 839 * intel_lvds_init - setup LVDS connectors on this device 842 - * @i915: i915 device 840 + * @display: display device 843 841 * 844 842 * Create the connector, register the LVDS DDC bus, and try to figure out what 845 843 * modes we can display on the LVDS panel (if present). 846 844 */ 847 - void intel_lvds_init(struct drm_i915_private *i915) 845 + void intel_lvds_init(struct intel_display *display) 848 846 { 849 - struct intel_display *display = &i915->display; 847 + struct drm_i915_private *i915 = to_i915(display->drm); 850 848 struct intel_lvds_encoder *lvds_encoder; 851 849 struct intel_connector *connector; 852 850 const struct drm_edid *drm_edid; ··· 857 855 858 856 /* Skip init on machines we know falsely report LVDS */ 859 857 if (dmi_check_system(intel_no_lvds)) { 860 - drm_WARN(&i915->drm, !i915->display.vbt.int_lvds_support, 858 + drm_WARN(display->drm, !display->vbt.int_lvds_support, 861 859 "Useless DMI match. Internal LVDS support disabled by VBT\n"); 862 860 return; 863 861 } 864 862 865 - if (!i915->display.vbt.int_lvds_support) { 866 - drm_dbg_kms(&i915->drm, 863 + if (!display->vbt.int_lvds_support) { 864 + drm_dbg_kms(display->drm, 867 865 "Internal LVDS support disabled by VBT\n"); 868 866 return; 869 867 } ··· 873 871 else 874 872 lvds_reg = LVDS; 875 873 876 - lvds = intel_de_read(i915, lvds_reg); 874 + lvds = intel_de_read(display, lvds_reg); 877 875 878 876 if (HAS_PCH_SPLIT(i915)) { 879 877 if ((lvds & LVDS_DETECTED) == 0) ··· 883 881 ddc_pin = GMBUS_PIN_PANEL; 884 882 if (!intel_bios_is_lvds_present(display, &ddc_pin)) { 885 883 if ((lvds & LVDS_PORT_EN) == 0) { 886 - drm_dbg_kms(&i915->drm, 884 + drm_dbg_kms(display->drm, 887 885 "LVDS is not present in VBT\n"); 888 886 return; 889 887 } 890 - drm_dbg_kms(&i915->drm, 888 + drm_dbg_kms(display->drm, 891 889 "LVDS is not present in VBT, but enabled anyway\n"); 892 890 } 893 891 ··· 904 902 lvds_encoder->attached_connector = connector; 905 903 encoder = &lvds_encoder->base; 906 904 907 - drm_connector_init_with_ddc(&i915->drm, &connector->base, 905 + drm_connector_init_with_ddc(display->drm, &connector->base, 908 906 &intel_lvds_connector_funcs, 909 907 DRM_MODE_CONNECTOR_LVDS, 910 908 intel_gmbus_get_adapter(display, ddc_pin)); 911 909 912 - drm_encoder_init(&i915->drm, &encoder->base, &intel_lvds_enc_funcs, 910 + drm_encoder_init(display->drm, &encoder->base, &intel_lvds_enc_funcs, 913 911 DRM_MODE_ENCODER_LVDS, "LVDS"); 914 912 915 913 encoder->enable = intel_enable_lvds; ··· 933 931 encoder->power_domain = POWER_DOMAIN_PORT_OTHER; 934 932 encoder->port = PORT_NONE; 935 933 encoder->cloneable = 0; 936 - if (DISPLAY_VER(i915) < 4) 934 + if (DISPLAY_VER(display) < 4) 937 935 encoder->pipe_mask = BIT(PIPE_B); 938 936 else 939 937 encoder->pipe_mask = ~0; ··· 945 943 946 944 intel_lvds_add_properties(&connector->base); 947 945 948 - intel_lvds_pps_get_hw_state(i915, &lvds_encoder->init_pps); 946 + intel_lvds_pps_get_hw_state(display, &lvds_encoder->init_pps); 949 947 lvds_encoder->init_lvds_val = lvds; 950 948 951 949 /* ··· 960 958 * Attempt to get the fixed panel mode from DDC. Assume that the 961 959 * preferred mode is the right one. 962 960 */ 963 - mutex_lock(&i915->drm.mode_config.mutex); 961 + mutex_lock(&display->drm->mode_config.mutex); 964 962 if (vga_switcheroo_handler_flags() & VGA_SWITCHEROO_CAN_SWITCH_DDC) 965 963 drm_edid = drm_edid_read_switcheroo(&connector->base, connector->base.ddc); 966 964 else ··· 993 991 if (!intel_panel_preferred_fixed_mode(connector)) 994 992 intel_panel_add_encoder_fixed_mode(connector, encoder); 995 993 996 - mutex_unlock(&i915->drm.mode_config.mutex); 994 + mutex_unlock(&display->drm->mode_config.mutex); 997 995 998 996 /* If we still don't have a mode after all that, give up. */ 999 997 if (!intel_panel_preferred_fixed_mode(connector)) ··· 1004 1002 intel_backlight_setup(connector, INVALID_PIPE); 1005 1003 1006 1004 lvds_encoder->is_dual_link = compute_is_dual_link_lvds(lvds_encoder); 1007 - drm_dbg_kms(&i915->drm, "detected %s-link lvds configuration\n", 1005 + drm_dbg_kms(display->drm, "detected %s-link lvds configuration\n", 1008 1006 lvds_encoder->is_dual_link ? "dual" : "single"); 1009 1007 1010 1008 lvds_encoder->a3_power = lvds & LVDS_A3_POWER_MASK; ··· 1012 1010 return; 1013 1011 1014 1012 failed: 1015 - drm_dbg_kms(&i915->drm, "No LVDS modes found, disabling.\n"); 1013 + drm_dbg_kms(display->drm, "No LVDS modes found, disabling.\n"); 1016 1014 drm_connector_cleanup(&connector->base); 1017 1015 drm_encoder_cleanup(&encoder->base); 1018 1016 kfree(lvds_encoder);
+9 -9
drivers/gpu/drm/i915/display/intel_lvds.h
··· 11 11 #include "i915_reg_defs.h" 12 12 13 13 enum pipe; 14 - struct drm_i915_private; 14 + struct intel_display; 15 15 16 16 #ifdef I915 17 - bool intel_lvds_port_enabled(struct drm_i915_private *dev_priv, 17 + bool intel_lvds_port_enabled(struct intel_display *display, 18 18 i915_reg_t lvds_reg, enum pipe *pipe); 19 - void intel_lvds_init(struct drm_i915_private *dev_priv); 20 - struct intel_encoder *intel_get_lvds_encoder(struct drm_i915_private *dev_priv); 21 - bool intel_is_dual_link_lvds(struct drm_i915_private *dev_priv); 19 + void intel_lvds_init(struct intel_display *display); 20 + struct intel_encoder *intel_get_lvds_encoder(struct intel_display *display); 21 + bool intel_is_dual_link_lvds(struct intel_display *display); 22 22 #else 23 - static inline bool intel_lvds_port_enabled(struct drm_i915_private *dev_priv, 23 + static inline bool intel_lvds_port_enabled(struct intel_display *display, 24 24 i915_reg_t lvds_reg, enum pipe *pipe) 25 25 { 26 26 return false; 27 27 } 28 - static inline void intel_lvds_init(struct drm_i915_private *dev_priv) 28 + static inline void intel_lvds_init(struct intel_display *display) 29 29 { 30 30 } 31 - static inline struct intel_encoder *intel_get_lvds_encoder(struct drm_i915_private *dev_priv) 31 + static inline struct intel_encoder *intel_get_lvds_encoder(struct intel_display *display) 32 32 { 33 33 return NULL; 34 34 } 35 - static inline bool intel_is_dual_link_lvds(struct drm_i915_private *dev_priv) 35 + static inline bool intel_is_dual_link_lvds(struct intel_display *display) 36 36 { 37 37 return false; 38 38 }
+1 -1
drivers/gpu/drm/i915/display/intel_pch_display.c
··· 93 93 pipe_name(pipe)); 94 94 95 95 INTEL_DISPLAY_STATE_WARN(display, 96 - intel_lvds_port_enabled(dev_priv, PCH_LVDS, &port_pipe) && port_pipe == pipe, 96 + intel_lvds_port_enabled(display, PCH_LVDS, &port_pipe) && port_pipe == pipe, 97 97 "PCH LVDS enabled on transcoder %c, should be disabled\n", 98 98 pipe_name(pipe)); 99 99
+2 -2
drivers/gpu/drm/i915/display/intel_pps.c
··· 1855 1855 1856 1856 switch (port_sel) { 1857 1857 case PANEL_PORT_SELECT_LVDS: 1858 - intel_lvds_port_enabled(dev_priv, PCH_LVDS, &panel_pipe); 1858 + intel_lvds_port_enabled(display, PCH_LVDS, &panel_pipe); 1859 1859 break; 1860 1860 case PANEL_PORT_SELECT_DPA: 1861 1861 g4x_dp_port_enabled(display, DP_A, PORT_A, &panel_pipe); ··· 1883 1883 1884 1884 drm_WARN_ON(display->drm, 1885 1885 port_sel != PANEL_PORT_SELECT_LVDS); 1886 - intel_lvds_port_enabled(dev_priv, LVDS, &panel_pipe); 1886 + intel_lvds_port_enabled(display, LVDS, &panel_pipe); 1887 1887 } 1888 1888 1889 1889 val = intel_de_read(display, pp_reg);