···17531753 struct drm_connector_state *old_conn_state)17541754{17551755 struct drm_encoder *encoder = &intel_encoder->base;17561756- struct drm_device *dev = encoder->dev;17571757- struct drm_i915_private *dev_priv = to_i915(dev);17561756+ struct drm_i915_private *dev_priv = to_i915(encoder->dev);17581757 enum port port = intel_ddi_get_encoder_port(intel_encoder);17591758 int type = intel_encoder->type;17601759 uint32_t val;···17861787 if (IS_SKYLAKE(dev_priv) || IS_KABYLAKE(dev_priv))17871788 I915_WRITE(DPLL_CTRL2, (I915_READ(DPLL_CTRL2) |17881789 DPLL_CTRL2_DDI_CLK_OFF(port)));17891789- else if (INTEL_INFO(dev)->gen < 9)17901790+ else if (INTEL_GEN(dev_priv) < 9)17901791 I915_WRITE(PORT_CLK_SEL(port), PORT_CLK_SEL_NONE);1791179217921793 if (type == INTEL_OUTPUT_HDMI) {···18361837 struct drm_encoder *encoder = &intel_encoder->base;18371838 struct drm_crtc *crtc = encoder->crtc;18381839 struct intel_crtc *intel_crtc = to_intel_crtc(crtc);18391839- struct drm_device *dev = encoder->dev;18401840- struct drm_i915_private *dev_priv = to_i915(dev);18401840+ struct drm_i915_private *dev_priv = to_i915(encoder->dev);18411841 enum port port = intel_ddi_get_encoder_port(intel_encoder);18421842 int type = intel_encoder->type;18431843···18541856 } else if (type == INTEL_OUTPUT_EDP) {18551857 struct intel_dp *intel_dp = enc_to_intel_dp(encoder);1856185818571857- if (port == PORT_A && INTEL_INFO(dev)->gen < 9)18591859+ if (port == PORT_A && INTEL_GEN(dev_priv) < 9)18581860 intel_dp_stop_link_train(intel_dp);1859186118601862 intel_edp_backlight_on(intel_dp);
+2-3
drivers/gpu/drm/i915/intel_dpll_mgr.c
···188188189189void intel_disable_shared_dpll(struct intel_crtc *crtc)190190{191191- struct drm_device *dev = crtc->base.dev;192192- struct drm_i915_private *dev_priv = to_i915(dev);191191+ struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);193192 struct intel_shared_dpll *pll = crtc->config->shared_dpll;194193 unsigned crtc_mask = 1 << drm_crtc_index(&crtc->base);195194196195 /* PCH only available on ILK+ */197197- if (INTEL_INFO(dev)->gen < 5)196196+ if (INTEL_GEN(dev_priv) < 5)198197 return;199198200199 if (pll == NULL)
+3-4
drivers/gpu/drm/i915/intel_lvds.c
···122122static void intel_lvds_get_config(struct intel_encoder *encoder,123123 struct intel_crtc_state *pipe_config)124124{125125- struct drm_device *dev = encoder->base.dev;126126- struct drm_i915_private *dev_priv = to_i915(dev);125125+ struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);127126 struct intel_lvds_encoder *lvds_encoder = to_lvds_encoder(&encoder->base);128127 u32 tmp, flags = 0;129128···138139139140 pipe_config->base.adjusted_mode.flags |= flags;140141141141- if (INTEL_INFO(dev)->gen < 5)142142+ if (INTEL_GEN(dev_priv) < 5)142143 pipe_config->gmch_pfit.lvds_border_bits =143144 tmp & LVDS_BORDER_ENABLE;144145145146 /* gen2/3 store dither state in pfit control, needs to match */146146- if (INTEL_INFO(dev)->gen < 4) {147147+ if (INTEL_GEN(dev_priv) < 4) {147148 tmp = I915_READ(PFIT_CONTROL);148149149150 pipe_config->gmch_pfit.control |= tmp & PANEL_8TO6_DITHER_ENABLE;
+5-5
drivers/gpu/drm/i915/intel_panel.c
···304304 struct intel_crtc_state *pipe_config,305305 int fitting_mode)306306{307307- struct drm_device *dev = intel_crtc->base.dev;307307+ struct drm_i915_private *dev_priv = to_i915(intel_crtc->base.dev);308308 u32 pfit_control = 0, pfit_pgm_ratios = 0, border = 0;309309 struct drm_display_mode *adjusted_mode = &pipe_config->base.adjusted_mode;310310···325325 break;326326 case DRM_MODE_SCALE_ASPECT:327327 /* Scale but preserve the aspect ratio */328328- if (INTEL_INFO(dev)->gen >= 4)328328+ if (INTEL_GEN(dev_priv) >= 4)329329 i965_scale_aspect(pipe_config, &pfit_control);330330 else331331 i9xx_scale_aspect(pipe_config, &pfit_control,···339339 if (pipe_config->pipe_src_h != adjusted_mode->crtc_vdisplay ||340340 pipe_config->pipe_src_w != adjusted_mode->crtc_hdisplay) {341341 pfit_control |= PFIT_ENABLE;342342- if (INTEL_INFO(dev)->gen >= 4)342342+ if (INTEL_GEN(dev_priv) >= 4)343343 pfit_control |= PFIT_SCALING_AUTO;344344 else345345 pfit_control |= (VERT_AUTO_SCALE |···355355356356 /* 965+ wants fuzzy fitting */357357 /* FIXME: handle multiple panels by failing gracefully */358358- if (INTEL_INFO(dev)->gen >= 4)358358+ if (INTEL_GEN(dev_priv) >= 4)359359 pfit_control |= ((intel_crtc->pipe << PFIT_PIPE_SHIFT) |360360 PFIT_FILTER_FUZZY);361361···366366 }367367368368 /* Make sure pre-965 set dither correctly for 18bpp panels. */369369- if (INTEL_INFO(dev)->gen < 4 && pipe_config->pipe_bpp == 18)369369+ if (INTEL_GEN(dev_priv) < 4 && pipe_config->pipe_bpp == 18)370370 pfit_control |= PANEL_8TO6_DITHER_ENABLE;371371372372 pipe_config->gmch_pfit.control = pfit_control;
+2-2
drivers/gpu/drm/i915/intel_psr.c
···472472 /* Enable PSR on the panel */473473 hsw_psr_enable_sink(intel_dp);474474475475- if (INTEL_INFO(dev)->gen >= 9)475475+ if (INTEL_GEN(dev_priv) >= 9)476476 intel_psr_activate(intel_dp);477477 } else {478478 vlv_psr_setup_vsc(intel_dp);···498498 * - On HSW/BDW we get a recoverable frozen screen until next499499 * exit-activate sequence.500500 */501501- if (INTEL_INFO(dev)->gen < 9)501501+ if (INTEL_GEN(dev_priv) < 9)502502 schedule_delayed_work(&dev_priv->psr.work,503503 msecs_to_jiffies(intel_dp->panel_power_cycle_delay * 5));504504
+5-6
drivers/gpu/drm/i915/intel_sdvo.c
···11951195 struct intel_crtc_state *crtc_state,11961196 struct drm_connector_state *conn_state)11971197{11981198- struct drm_device *dev = intel_encoder->base.dev;11991199- struct drm_i915_private *dev_priv = to_i915(dev);11981198+ struct drm_i915_private *dev_priv = to_i915(intel_encoder->base.dev);12001199 struct intel_crtc *crtc = to_intel_crtc(crtc_state->base.crtc);12011200 const struct drm_display_mode *adjusted_mode = &crtc_state->base.adjusted_mode;12021201 struct drm_display_mode *mode = &crtc_state->base.mode;···12681269 return;1269127012701271 /* Set the SDVO control regs. */12711271- if (INTEL_INFO(dev)->gen >= 4) {12721272+ if (INTEL_GEN(dev_priv) >= 4) {12721273 /* The real mode polarity is set by the SDVO commands, using12731274 * struct intel_sdvo_dtd. */12741275 sdvox = SDVO_VSYNC_ACTIVE_HIGH | SDVO_HSYNC_ACTIVE_HIGH;12751276 if (!HAS_PCH_SPLIT(dev_priv) && crtc_state->limited_color_range)12761277 sdvox |= HDMI_COLOR_RANGE_16_235;12771277- if (INTEL_INFO(dev)->gen < 5)12781278+ if (INTEL_GEN(dev_priv) < 5)12781279 sdvox |= SDVO_BORDER_ENABLE;12791280 } else {12801281 sdvox = I915_READ(intel_sdvo->sdvo_reg);···12931294 if (intel_sdvo->has_hdmi_audio)12941295 sdvox |= SDVO_AUDIO_ENABLE;1295129612961296- if (INTEL_INFO(dev)->gen >= 4) {12971297+ if (INTEL_GEN(dev_priv) >= 4) {12971298 /* done in crtc_mode_set as the dpll_md reg must be written early */12981299 } else if (IS_I945G(dev_priv) || IS_I945GM(dev_priv) ||12991300 IS_G33(dev_priv)) {···13041305 }1305130613061307 if (input_dtd.part2.sdvo_flags & SDVO_NEED_TO_STALL &&13071307- INTEL_INFO(dev)->gen < 5)13081308+ INTEL_GEN(dev_priv) < 5)13081309 sdvox |= SDVO_STALL_SELECT;13091310 intel_sdvo_write_sdvox(intel_sdvo, sdvox);13101311}