return crtc->config->cpu_transcoder;
 }
 
-static bool pipe_dsl_stopped(struct drm_device *dev, enum pipe pipe)
+static bool pipe_dsl_stopped(struct drm_i915_private *dev_priv, enum pipe pipe)
 {
-       struct drm_i915_private *dev_priv = to_i915(dev);
        i915_reg_t reg = PIPEDSL(pipe);
        u32 line1, line2;
        u32 line_mask;
  */
 static void intel_wait_for_pipe_off(struct intel_crtc *crtc)
 {
-       struct drm_device *dev = crtc->base.dev;
-       struct drm_i915_private *dev_priv = to_i915(dev);
+       struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
        enum transcoder cpu_transcoder = crtc->config->cpu_transcoder;
        enum pipe pipe = crtc->pipe;
 
-       if (INTEL_INFO(dev)->gen >= 4) {
+       if (INTEL_GEN(dev_priv) >= 4) {
                i915_reg_t reg = PIPECONF(cpu_transcoder);
 
                /* Wait for the Pipe State to go off */
                        WARN(1, "pipe_off wait timed out\n");
        } else {
                /* Wait for the display line to settle */
-               if (wait_for(pipe_dsl_stopped(dev, pipe), 100))
+               if (wait_for(pipe_dsl_stopped(dev_priv, pipe), 100))
                        WARN(1, "pipe_off wait timed out\n");
        }
 }
 static void assert_planes_disabled(struct drm_i915_private *dev_priv,
                                   enum pipe pipe)
 {
-       struct drm_device *dev = &dev_priv->drm;
        int i;
 
        /* Primary planes are fixed to pipes on gen4+ */
-       if (INTEL_INFO(dev)->gen >= 4) {
+       if (INTEL_GEN(dev_priv) >= 4) {
                u32 val = I915_READ(DSPCNTR(pipe));
                I915_STATE_WARN(val & DISPLAY_PLANE_ENABLE,
                     "plane %c assertion failure, should be disabled but not\n",
 static void assert_sprites_disabled(struct drm_i915_private *dev_priv,
                                    enum pipe pipe)
 {
-       struct drm_device *dev = &dev_priv->drm;
        int sprite;
 
-       if (INTEL_INFO(dev)->gen >= 9) {
+       if (INTEL_GEN(dev_priv) >= 9) {
                for_each_sprite(dev_priv, pipe, sprite) {
                        u32 val = I915_READ(PLANE_CTL(pipe, sprite));
                        I915_STATE_WARN(val & PLANE_CTL_ENABLE,
                             "sprite %c assertion failure, should be off on pipe %c but is still active\n",
                             sprite_name(pipe, sprite), pipe_name(pipe));
                }
-       } else if (INTEL_INFO(dev)->gen >= 7) {
+       } else if (INTEL_GEN(dev_priv) >= 7) {
                u32 val = I915_READ(SPRCTL(pipe));
                I915_STATE_WARN(val & SPRITE_ENABLE,
                     "sprite %c assertion failure, should be off on pipe %c but is still active\n",
                     plane_name(pipe), pipe_name(pipe));
-       } else if (INTEL_INFO(dev)->gen >= 5) {
+       } else if (INTEL_GEN(dev_priv) >= 5) {
                u32 val = I915_READ(DVSCNTR(pipe));
                I915_STATE_WARN(val & DVS_ENABLE,
                     "sprite %c assertion failure, should be off on pipe %c but is still active\n",
        }
 }
 
-static int intel_num_dvo_pipes(struct drm_device *dev)
+static int intel_num_dvo_pipes(struct drm_i915_private *dev_priv)
 {
        struct intel_crtc *crtc;
        int count = 0;
 
-       for_each_intel_crtc(dev, crtc) {
+       for_each_intel_crtc(&dev_priv->drm, crtc) {
                count += crtc->base.state->active &&
                        intel_crtc_has_type(crtc->config, INTEL_OUTPUT_DVO);
        }
 
 static void i9xx_enable_pll(struct intel_crtc *crtc)
 {
-       struct drm_device *dev = crtc->base.dev;
-       struct drm_i915_private *dev_priv = to_i915(dev);
+       struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
        i915_reg_t reg = DPLL(crtc->pipe);
        u32 dpll = crtc->config->dpll_hw_state.dpll;
 
                assert_panel_unlocked(dev_priv, crtc->pipe);
 
        /* Enable DVO 2x clock on both PLLs if necessary */
-       if (IS_I830(dev_priv) && intel_num_dvo_pipes(dev) > 0) {
+       if (IS_I830(dev_priv) && intel_num_dvo_pipes(dev_priv) > 0) {
                /*
                 * It appears to be important that we don't enable this
                 * for the current pipe before otherwise configuring the
        POSTING_READ(reg);
        udelay(150);
 
-       if (INTEL_INFO(dev)->gen >= 4) {
+       if (INTEL_GEN(dev_priv) >= 4) {
                I915_WRITE(DPLL_MD(crtc->pipe),
                           crtc->config->dpll_hw_state.dpll_md);
        } else {
  */
 static void i9xx_disable_pll(struct intel_crtc *crtc)
 {
-       struct drm_device *dev = crtc->base.dev;
-       struct drm_i915_private *dev_priv = to_i915(dev);
+       struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
        enum pipe pipe = crtc->pipe;
 
        /* Disable DVO 2x clock on both PLLs if necessary */
        if (IS_I830(dev_priv) &&
            intel_crtc_has_type(crtc->config, INTEL_OUTPUT_DVO) &&
-           !intel_num_dvo_pipes(dev)) {
+           !intel_num_dvo_pipes(dev_priv)) {
                I915_WRITE(DPLL(PIPE_B),
                           I915_READ(DPLL(PIPE_B)) & ~DPLL_DVO_2X_MODE);
                I915_WRITE(DPLL(PIPE_A),
                                      const struct intel_crtc_state *crtc_state,
                                      const struct intel_plane_state *plane_state)
 {
-       struct drm_device *dev = primary->dev;
-       struct drm_i915_private *dev_priv = to_i915(dev);
+       struct drm_i915_private *dev_priv = to_i915(primary->dev);
        struct intel_crtc *intel_crtc = to_intel_crtc(crtc_state->base.crtc);
        struct drm_framebuffer *fb = plane_state->base.fb;
        int plane = intel_crtc->plane;
 
        dspcntr |= DISPLAY_PLANE_ENABLE;
 
-       if (INTEL_INFO(dev)->gen < 4) {
+       if (INTEL_GEN(dev_priv) < 4) {
                if (intel_crtc->pipe == PIPE_B)
                        dspcntr |= DISPPLANE_SEL_PIPE_B;
 
 
        intel_add_fb_offsets(&x, &y, plane_state, 0);
 
-       if (INTEL_INFO(dev)->gen >= 4)
+       if (INTEL_GEN(dev_priv) >= 4)
                intel_crtc->dspaddr_offset =
                        intel_compute_tile_offset(&x, &y, plane_state, 0);
 
 
        linear_offset = intel_fb_xy_to_linear(x, y, plane_state, 0);
 
-       if (INTEL_INFO(dev)->gen < 4)
+       if (INTEL_GEN(dev_priv) < 4)
                intel_crtc->dspaddr_offset = linear_offset;
 
        intel_crtc->adjusted_x = x;
        I915_WRITE(reg, dspcntr);
 
        I915_WRITE(DSPSTRIDE(plane), fb->pitches[0]);
-       if (INTEL_INFO(dev)->gen >= 4) {
+       if (INTEL_GEN(dev_priv) >= 4) {
                I915_WRITE(DSPSURF(plane),
                           intel_fb_gtt_offset(fb, rotation) +
                           intel_crtc->dspaddr_offset);
 static void intel_update_pipe_config(struct intel_crtc *crtc,
                                     struct intel_crtc_state *old_crtc_state)
 {
-       struct drm_device *dev = crtc->base.dev;
-       struct drm_i915_private *dev_priv = to_i915(dev);
+       struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
        struct intel_crtc_state *pipe_config =
                to_intel_crtc_state(crtc->base.state);
 
                   (pipe_config->pipe_src_h - 1));
 
        /* on skylake this is done by detaching scalers */
-       if (INTEL_INFO(dev)->gen >= 9) {
+       if (INTEL_GEN(dev_priv) >= 9) {
                skl_detach_scalers(crtc);
 
                if (pipe_config->pch_pfit.enabled)
                                struct drm_atomic_state *old_state)
 {
        struct drm_crtc *crtc = pipe_config->base.crtc;
-       struct drm_device *dev = crtc->dev;
-       struct drm_i915_private *dev_priv = to_i915(dev);
+       struct drm_i915_private *dev_priv = to_i915(crtc->dev);
        struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
        int pipe = intel_crtc->pipe, hsw_workaround_pipe;
        enum transcoder cpu_transcoder = intel_crtc->config->cpu_transcoder;
        if (!transcoder_is_dsi(cpu_transcoder))
                intel_ddi_enable_pipe_clock(intel_crtc);
 
-       if (INTEL_INFO(dev)->gen >= 9)
+       if (INTEL_GEN(dev_priv) >= 9)
                skylake_pfit_enable(intel_crtc);
        else
                ironlake_pfit_enable(intel_crtc);
                                 struct drm_atomic_state *old_state)
 {
        struct drm_crtc *crtc = old_crtc_state->base.crtc;
-       struct drm_device *dev = crtc->dev;
-       struct drm_i915_private *dev_priv = to_i915(dev);
+       struct drm_i915_private *dev_priv = to_i915(crtc->dev);
        struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
        enum transcoder cpu_transcoder = intel_crtc->config->cpu_transcoder;
 
        if (!transcoder_is_dsi(cpu_transcoder))
                intel_ddi_disable_transcoder_func(dev_priv, cpu_transcoder);
 
-       if (INTEL_INFO(dev)->gen >= 9)
+       if (INTEL_GEN(dev_priv) >= 9)
                skylake_scaler_disable(intel_crtc);
        else
                ironlake_pfit_disable(intel_crtc, false);
        const struct drm_display_mode *adjusted_mode = &pipe_config->base.adjusted_mode;
        int clock_limit = dev_priv->max_dotclk_freq;
 
-       if (INTEL_INFO(dev)->gen < 4) {
+       if (INTEL_GEN(dev_priv) < 4) {
                clock_limit = dev_priv->max_cdclk_freq * 9 / 10;
 
                /*
                                         struct intel_link_m_n *m_n,
                                         struct intel_link_m_n *m2_n2)
 {
-       struct drm_device *dev = crtc->base.dev;
-       struct drm_i915_private *dev_priv = to_i915(dev);
+       struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
        int pipe = crtc->pipe;
        enum transcoder transcoder = crtc->config->cpu_transcoder;
 
-       if (INTEL_INFO(dev)->gen >= 5) {
+       if (INTEL_GEN(dev_priv) >= 5) {
                I915_WRITE(PIPE_DATA_M1(transcoder), TU_SIZE(m_n->tu) | m_n->gmch_m);
                I915_WRITE(PIPE_DATA_N1(transcoder), m_n->gmch_n);
                I915_WRITE(PIPE_LINK_M1(transcoder), m_n->link_m);
 
 static void intel_set_pipe_timings(struct intel_crtc *intel_crtc)
 {
-       struct drm_device *dev = intel_crtc->base.dev;
-       struct drm_i915_private *dev_priv = to_i915(dev);
+       struct drm_i915_private *dev_priv = to_i915(intel_crtc->base.dev);
        enum pipe pipe = intel_crtc->pipe;
        enum transcoder cpu_transcoder = intel_crtc->config->cpu_transcoder;
        const struct drm_display_mode *adjusted_mode = &intel_crtc->config->base.adjusted_mode;
                        vsyncshift += adjusted_mode->crtc_htotal;
        }
 
-       if (INTEL_INFO(dev)->gen > 3)
+       if (INTEL_GEN(dev_priv) > 3)
                I915_WRITE(VSYNCSHIFT(cpu_transcoder), vsyncshift);
 
        I915_WRITE(HTOTAL(cpu_transcoder),
 
 static void i9xx_set_pipeconf(struct intel_crtc *intel_crtc)
 {
-       struct drm_device *dev = intel_crtc->base.dev;
-       struct drm_i915_private *dev_priv = to_i915(dev);
+       struct drm_i915_private *dev_priv = to_i915(intel_crtc->base.dev);
        uint32_t pipeconf;
 
        pipeconf = 0;
        }
 
        if (intel_crtc->config->base.adjusted_mode.flags & DRM_MODE_FLAG_INTERLACE) {
-               if (INTEL_INFO(dev)->gen < 4 ||
+               if (INTEL_GEN(dev_priv) < 4 ||
                    intel_crtc_has_type(intel_crtc->config, INTEL_OUTPUT_SDVO))
                        pipeconf |= PIPECONF_INTERLACE_W_FIELD_INDICATION;
                else
 static void i9xx_get_pfit_config(struct intel_crtc *crtc,
                                 struct intel_crtc_state *pipe_config)
 {
-       struct drm_device *dev = crtc->base.dev;
-       struct drm_i915_private *dev_priv = to_i915(dev);
+       struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
        uint32_t tmp;
 
        if (INTEL_GEN(dev_priv) <= 3 &&
                return;
 
        /* Check whether the pfit is attached to our pipe. */
-       if (INTEL_INFO(dev)->gen < 4) {
+       if (INTEL_GEN(dev_priv) < 4) {
                if (crtc->pipe != PIPE_B)
                        return;
        } else {
 
        fb = &intel_fb->base;
 
-       if (INTEL_INFO(dev)->gen >= 4) {
+       if (INTEL_GEN(dev_priv) >= 4) {
                if (val & DISPPLANE_TILED) {
                        plane_config->tiling = I915_TILING_X;
                        fb->modifier[0] = I915_FORMAT_MOD_X_TILED;
        fb->pixel_format = fourcc;
        fb->bits_per_pixel = drm_format_plane_cpp(fourcc, 0) * 8;
 
-       if (INTEL_INFO(dev)->gen >= 4) {
+       if (INTEL_GEN(dev_priv) >= 4) {
                if (plane_config->tiling)
                        offset = I915_READ(DSPTILEOFF(plane));
                else
 static bool i9xx_get_pipe_config(struct intel_crtc *crtc,
                                 struct intel_crtc_state *pipe_config)
 {
-       struct drm_device *dev = crtc->base.dev;
-       struct drm_i915_private *dev_priv = to_i915(dev);
+       struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
        enum intel_display_power_domain power_domain;
        uint32_t tmp;
        bool ret;
            (tmp & PIPECONF_COLOR_RANGE_SELECT))
                pipe_config->limited_color_range = true;
 
-       if (INTEL_INFO(dev)->gen < 4)
+       if (INTEL_GEN(dev_priv) < 4)
                pipe_config->double_wide = tmp & PIPECONF_DOUBLE_WIDE;
 
        intel_get_pipe_timings(crtc, pipe_config);
 
        i9xx_get_pfit_config(crtc, pipe_config);
 
-       if (INTEL_INFO(dev)->gen >= 4) {
+       if (INTEL_GEN(dev_priv) >= 4) {
                /* No way to read it out on pipes B and C */
                if (IS_CHERRYVIEW(dev_priv) && crtc->pipe != PIPE_A)
                        tmp = dev_priv->chv_dpll_md[crtc->pipe];
                                         struct intel_link_m_n *m_n,
                                         struct intel_link_m_n *m2_n2)
 {
-       struct drm_device *dev = crtc->base.dev;
-       struct drm_i915_private *dev_priv = to_i915(dev);
+       struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
        enum pipe pipe = crtc->pipe;
 
-       if (INTEL_INFO(dev)->gen >= 5) {
+       if (INTEL_GEN(dev_priv) >= 5) {
                m_n->link_m = I915_READ(PIPE_LINK_M1(transcoder));
                m_n->link_n = I915_READ(PIPE_LINK_N1(transcoder));
                m_n->gmch_m = I915_READ(PIPE_DATA_M1(transcoder))
                 * gen < 8) and if DRRS is supported (to make sure the
                 * registers are not unnecessarily read).
                 */
-               if (m2_n2 && INTEL_INFO(dev)->gen < 8 &&
+               if (m2_n2 && INTEL_GEN(dev_priv) < 8 &&
                        crtc->config->has_drrs) {
                        m2_n2->link_m = I915_READ(PIPE_LINK_M2(transcoder));
                        m2_n2->link_n = I915_READ(PIPE_LINK_N2(transcoder));
 
        fb = &intel_fb->base;
 
-       if (INTEL_INFO(dev)->gen >= 4) {
+       if (INTEL_GEN(dev_priv) >= 4) {
                if (val & DISPPLANE_TILED) {
                        plane_config->tiling = I915_TILING_X;
                        fb->modifier[0] = I915_FORMAT_MOD_X_TILED;
 static void haswell_get_ddi_port_state(struct intel_crtc *crtc,
                                       struct intel_crtc_state *pipe_config)
 {
-       struct drm_device *dev = crtc->base.dev;
-       struct drm_i915_private *dev_priv = to_i915(dev);
+       struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
        struct intel_shared_dpll *pll;
        enum port port;
        uint32_t tmp;
         * DDI E. So just check whether this pipe is wired to DDI E and whether
         * the PCH transcoder is on.
         */
-       if (INTEL_INFO(dev)->gen < 9 &&
+       if (INTEL_GEN(dev_priv) < 9 &&
            (port == PORT_E) && I915_READ(LPT_TRANSCONF) & TRANS_ENABLE) {
                pipe_config->has_pch_encoder = true;
 
 static bool haswell_get_pipe_config(struct intel_crtc *crtc,
                                    struct intel_crtc_state *pipe_config)
 {
-       struct drm_device *dev = crtc->base.dev;
-       struct drm_i915_private *dev_priv = to_i915(dev);
+       struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
        enum intel_display_power_domain power_domain;
        unsigned long power_domain_mask;
        bool active;
        pipe_config->gamma_mode =
                I915_READ(GAMMA_MODE(crtc->pipe)) & GAMMA_MODE_MODE_MASK;
 
-       if (INTEL_INFO(dev)->gen >= 9) {
+       if (INTEL_GEN(dev_priv) >= 9) {
                skl_init_scalers(dev_priv, crtc, pipe_config);
 
                pipe_config->scaler_state.scaler_id = -1;
        power_domain = POWER_DOMAIN_PIPE_PANEL_FITTER(crtc->pipe);
        if (intel_display_power_get_if_enabled(dev_priv, power_domain)) {
                power_domain_mask |= BIT(power_domain);
-               if (INTEL_INFO(dev)->gen >= 9)
+               if (INTEL_GEN(dev_priv) >= 9)
                        skylake_get_pfit_config(crtc, pipe_config);
                else
                        ironlake_get_pfit_config(crtc, pipe_config);
         * TILEOFF/LINOFF registers can't be changed via MI display flips.
         * Note that pitch changes could also affect these register.
         */
-       if (INTEL_INFO(dev)->gen > 3 &&
+       if (INTEL_GEN(dev_priv) > 3 &&
            (fb->offsets[0] != crtc->primary->fb->offsets[0] ||
             fb->pitches[0] != crtc->primary->fb->pitches[0]))
                return -EINVAL;
                        engine = NULL;
        } else if (IS_IVYBRIDGE(dev_priv) || IS_HASWELL(dev_priv)) {
                engine = dev_priv->engine[BCS];
-       } else if (INTEL_INFO(dev)->gen >= 7) {
+       } else if (INTEL_GEN(dev_priv) >= 7) {
                engine = i915_gem_object_last_write_engine(obj);
                if (engine == NULL || engine->id != RCS)
                        engine = dev_priv->engine[BCS];
 
        /* Pre-gen9 platforms need two-step watermark updates */
        if ((pipe_config->update_wm_pre || pipe_config->update_wm_post) &&
-           INTEL_INFO(dev)->gen < 9 && dev_priv->display.optimize_watermarks)
+           INTEL_GEN(dev_priv) < 9 && dev_priv->display.optimize_watermarks)
                to_intel_crtc_state(crtc_state)->wm.need_postvbl_update = true;
 
        if (visible || was_visible)
                 * old state and the new state.  We can program these
                 * immediately.
                 */
-               ret = dev_priv->display.compute_intermediate_wm(crtc->dev,
+               ret = dev_priv->display.compute_intermediate_wm(dev,
                                                                intel_crtc,
                                                                pipe_config);
                if (ret) {
                        pipe_config->wm.ilk.intermediate = pipe_config->wm.ilk.optimal;
        }
 
-       if (INTEL_INFO(dev)->gen >= 9) {
+       if (INTEL_GEN(dev_priv) >= 9) {
                if (mode_changed)
                        ret = skl_update_scaler_crtc(pipe_config);
 
 }
 
 static bool
-intel_pipe_config_compare(struct drm_device *dev,
+intel_pipe_config_compare(struct drm_i915_private *dev_priv,
                          struct intel_crtc_state *current_config,
                          struct intel_crtc_state *pipe_config,
                          bool adjust)
 {
-       struct drm_i915_private *dev_priv = to_i915(dev);
        bool ret = true;
 
 #define INTEL_ERR_OR_DBG_KMS(fmt, ...) \
        PIPE_CONF_CHECK_I(lane_count);
        PIPE_CONF_CHECK_X(lane_lat_optim_mask);
 
-       if (INTEL_INFO(dev)->gen < 8) {
+       if (INTEL_GEN(dev_priv) < 8) {
                PIPE_CONF_CHECK_M_N(dp_m_n);
 
                if (current_config->has_drrs)
 
        PIPE_CONF_CHECK_X(gmch_pfit.control);
        /* pfit ratios are autocomputed by the hw on gen4+ */
-       if (INTEL_INFO(dev)->gen < 4)
+       if (INTEL_GEN(dev_priv) < 4)
                PIPE_CONF_CHECK_X(gmch_pfit.pgm_ratios);
        PIPE_CONF_CHECK_X(gmch_pfit.lvds_border_bits);
 
 static void verify_wm_state(struct drm_crtc *crtc,
                            struct drm_crtc_state *new_state)
 {
-       struct drm_device *dev = crtc->dev;
-       struct drm_i915_private *dev_priv = to_i915(dev);
+       struct drm_i915_private *dev_priv = to_i915(crtc->dev);
        struct skl_ddb_allocation hw_ddb, *sw_ddb;
        struct skl_pipe_wm hw_wm, *sw_wm;
        struct skl_plane_wm *hw_plane_wm, *sw_plane_wm;
        const enum pipe pipe = intel_crtc->pipe;
        int plane, level, max_level = ilk_wm_max_level(dev_priv);
 
-       if (INTEL_INFO(dev)->gen < 9 || !new_state->active)
+       if (INTEL_GEN(dev_priv) < 9 || !new_state->active)
                return;
 
        skl_pipe_wm_get_hw_state(crtc, &hw_wm);
        intel_pipe_config_sanity_check(dev_priv, pipe_config);
 
        sw_config = to_intel_crtc_state(crtc->state);
-       if (!intel_pipe_config_compare(dev, sw_config,
+       if (!intel_pipe_config_compare(dev_priv, sw_config,
                                       pipe_config, false)) {
                I915_STATE_WARN(1, "pipe state doesn't match!\n");
                intel_dump_pipe_config(intel_crtc, pipe_config,
                }
 
                if (i915.fastboot &&
-                   intel_pipe_config_compare(dev,
+                   intel_pipe_config_compare(dev_priv,
                                        to_intel_crtc_state(crtc->state),
                                        pipe_config, true)) {
                        crtc_state->mode_changed = false;
        return true;
 }
 
-static bool intel_crt_present(struct drm_device *dev)
+static bool intel_crt_present(struct drm_i915_private *dev_priv)
 {
-       struct drm_i915_private *dev_priv = to_i915(dev);
-
-       if (INTEL_INFO(dev)->gen >= 9)
+       if (INTEL_GEN(dev_priv) >= 9)
                return false;
 
        if (IS_HSW_ULT(dev_priv) || IS_BDW_ULT(dev_priv))
         */
        intel_lvds_init(dev);
 
-       if (intel_crt_present(dev))
+       if (intel_crt_present(dev_priv))
                intel_crt_init(dev);
 
        if (IS_BROXTON(dev_priv)) {
        switch (mode_cmd->modifier[0]) {
        case I915_FORMAT_MOD_Y_TILED:
        case I915_FORMAT_MOD_Yf_TILED:
-               if (INTEL_INFO(dev)->gen < 9) {
+               if (INTEL_GEN(dev_priv) < 9) {
                        DRM_DEBUG("Unsupported tiling 0x%llx!\n",
                                  mode_cmd->modifier[0]);
                        return -EINVAL;
        case DRM_FORMAT_ARGB8888:
                break;
        case DRM_FORMAT_XRGB1555:
-               if (INTEL_INFO(dev)->gen > 3) {
+               if (INTEL_GEN(dev_priv) > 3) {
                        DRM_DEBUG("unsupported pixel format: %s\n",
                                  drm_get_format_name(mode_cmd->pixel_format, &format_name));
                        return -EINVAL;
                break;
        case DRM_FORMAT_ABGR8888:
                if (!IS_VALLEYVIEW(dev_priv) && !IS_CHERRYVIEW(dev_priv) &&
-                   INTEL_INFO(dev)->gen < 9) {
+                   INTEL_GEN(dev_priv) < 9) {
                        DRM_DEBUG("unsupported pixel format: %s\n",
                                  drm_get_format_name(mode_cmd->pixel_format, &format_name));
                        return -EINVAL;
        case DRM_FORMAT_XBGR8888:
        case DRM_FORMAT_XRGB2101010:
        case DRM_FORMAT_XBGR2101010:
-               if (INTEL_INFO(dev)->gen < 4) {
+               if (INTEL_GEN(dev_priv) < 4) {
                        DRM_DEBUG("unsupported pixel format: %s\n",
                                  drm_get_format_name(mode_cmd->pixel_format, &format_name));
                        return -EINVAL;
        case DRM_FORMAT_UYVY:
        case DRM_FORMAT_YVYU:
        case DRM_FORMAT_VYUY:
-               if (INTEL_INFO(dev)->gen < 5) {
+               if (INTEL_GEN(dev_priv) < 5) {
                        DRM_DEBUG("unsupported pixel format: %s\n",
                                  drm_get_format_name(mode_cmd->pixel_format, &format_name));
                        return -EINVAL;
        /* We need to sanitize the plane -> pipe mapping first because this will
         * disable the crtc (and hence change the state) if it is wrong. Note
         * that gen4+ has a fixed plane -> pipe mapping.  */
-       if (INTEL_INFO(dev)->gen < 4 && !intel_check_plane_mapping(crtc)) {
+       if (INTEL_GEN(dev_priv) < 4 && !intel_check_plane_mapping(crtc)) {
                bool plane;
 
                DRM_DEBUG_KMS("[CRTC:%d:%s] wrong plane connection detected!\n",
 /*
  * set vga decode state - true == enable VGA decode
  */
-int intel_modeset_vga_set_state(struct drm_device *dev, bool state)
+int intel_modeset_vga_set_state(struct drm_i915_private *dev_priv, bool state)
 {
-       struct drm_i915_private *dev_priv = to_i915(dev);
-       unsigned reg = INTEL_INFO(dev)->gen >= 6 ? SNB_GMCH_CTRL : INTEL_GMCH_CTRL;
+       unsigned reg = INTEL_GEN(dev_priv) >= 6 ? SNB_GMCH_CTRL : INTEL_GMCH_CTRL;
        u16 gmch_ctrl;
 
        if (pci_read_config_word(dev_priv->bridge_dev, reg, &gmch_ctrl)) {