drm/i915: Pass dev_priv to intel_setup_outputs()

Pass dev_priv to intel_setup_outputs() and functions called by it, since
those are all intel i915 specific functions. Also, in the majority of
the functions dev_priv is used more often than dev. In the rare cases
where there are a few calls back into drm core, a local dev variable was
added.

v2: Don't convert dev to &dev_priv->drm in intel_dsi_init. (Ville)
Signed-off-by: default avatarAnder Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
Reviewed-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1479910904-11005-1-git-send-email-ander.conselvan.de.oliveira@intel.com
parent fc158405
...@@ -1579,7 +1579,7 @@ static int i915_drm_resume(struct drm_device *dev) ...@@ -1579,7 +1579,7 @@ static int i915_drm_resume(struct drm_device *dev)
intel_pps_unlock_regs_wa(dev_priv); intel_pps_unlock_regs_wa(dev_priv);
intel_opregion_setup(dev_priv); intel_opregion_setup(dev_priv);
intel_init_pch_refclk(dev); intel_init_pch_refclk(dev_priv);
drm_mode_config_reset(dev); drm_mode_config_reset(dev);
/* /*
...@@ -2418,7 +2418,7 @@ static int intel_runtime_resume(struct device *kdev) ...@@ -2418,7 +2418,7 @@ static int intel_runtime_resume(struct device *kdev)
intel_guc_resume(dev); intel_guc_resume(dev);
if (IS_GEN6(dev_priv)) if (IS_GEN6(dev_priv))
intel_init_pch_refclk(dev); intel_init_pch_refclk(dev_priv);
if (IS_BROXTON(dev_priv)) { if (IS_BROXTON(dev_priv)) {
bxt_disable_dc9(dev_priv); bxt_disable_dc9(dev_priv);
......
...@@ -3570,7 +3570,7 @@ extern void intel_display_resume(struct drm_device *dev); ...@@ -3570,7 +3570,7 @@ extern void intel_display_resume(struct drm_device *dev);
extern void i915_redisable_vga(struct drm_i915_private *dev_priv); extern void i915_redisable_vga(struct drm_i915_private *dev_priv);
extern void i915_redisable_vga_power_on(struct drm_i915_private *dev_priv); extern void i915_redisable_vga_power_on(struct drm_i915_private *dev_priv);
extern bool ironlake_set_drps(struct drm_i915_private *dev_priv, u8 val); extern bool ironlake_set_drps(struct drm_i915_private *dev_priv, u8 val);
extern void intel_init_pch_refclk(struct drm_device *dev); extern void intel_init_pch_refclk(struct drm_i915_private *dev_priv);
extern void intel_set_rps(struct drm_i915_private *dev_priv, u8 val); extern void intel_set_rps(struct drm_i915_private *dev_priv, u8 val);
extern void intel_set_memory_cxsr(struct drm_i915_private *dev_priv, extern void intel_set_memory_cxsr(struct drm_i915_private *dev_priv,
bool enable); bool enable);
......
...@@ -836,12 +836,11 @@ static const struct drm_encoder_funcs intel_crt_enc_funcs = { ...@@ -836,12 +836,11 @@ static const struct drm_encoder_funcs intel_crt_enc_funcs = {
.destroy = intel_encoder_destroy, .destroy = intel_encoder_destroy,
}; };
void intel_crt_init(struct drm_device *dev) void intel_crt_init(struct drm_i915_private *dev_priv)
{ {
struct drm_connector *connector; struct drm_connector *connector;
struct intel_crt *crt; struct intel_crt *crt;
struct intel_connector *intel_connector; struct intel_connector *intel_connector;
struct drm_i915_private *dev_priv = to_i915(dev);
i915_reg_t adpa_reg; i915_reg_t adpa_reg;
u32 adpa; u32 adpa;
...@@ -881,10 +880,10 @@ void intel_crt_init(struct drm_device *dev) ...@@ -881,10 +880,10 @@ void intel_crt_init(struct drm_device *dev)
connector = &intel_connector->base; connector = &intel_connector->base;
crt->connector = intel_connector; crt->connector = intel_connector;
drm_connector_init(dev, &intel_connector->base, drm_connector_init(&dev_priv->drm, &intel_connector->base,
&intel_crt_connector_funcs, DRM_MODE_CONNECTOR_VGA); &intel_crt_connector_funcs, DRM_MODE_CONNECTOR_VGA);
drm_encoder_init(dev, &crt->base.base, &intel_crt_enc_funcs, drm_encoder_init(&dev_priv->drm, &crt->base.base, &intel_crt_enc_funcs,
DRM_MODE_ENCODER_DAC, "CRT"); DRM_MODE_ENCODER_DAC, "CRT");
intel_connector_attach_encoder(intel_connector, &crt->base); intel_connector_attach_encoder(intel_connector, &crt->base);
......
...@@ -2155,9 +2155,8 @@ intel_ddi_get_link_dpll(struct intel_dp *intel_dp, int clock) ...@@ -2155,9 +2155,8 @@ intel_ddi_get_link_dpll(struct intel_dp *intel_dp, int clock)
return pll; return pll;
} }
void intel_ddi_init(struct drm_device *dev, enum port port) void intel_ddi_init(struct drm_i915_private *dev_priv, enum port port)
{ {
struct drm_i915_private *dev_priv = to_i915(dev);
struct intel_digital_port *intel_dig_port; struct intel_digital_port *intel_dig_port;
struct intel_encoder *intel_encoder; struct intel_encoder *intel_encoder;
struct drm_encoder *encoder; struct drm_encoder *encoder;
...@@ -2219,7 +2218,7 @@ void intel_ddi_init(struct drm_device *dev, enum port port) ...@@ -2219,7 +2218,7 @@ void intel_ddi_init(struct drm_device *dev, enum port port)
intel_encoder = &intel_dig_port->base; intel_encoder = &intel_dig_port->base;
encoder = &intel_encoder->base; encoder = &intel_encoder->base;
drm_encoder_init(dev, encoder, &intel_ddi_funcs, drm_encoder_init(&dev_priv->drm, encoder, &intel_ddi_funcs,
DRM_MODE_ENCODER_TMDS, "DDI %c", port_name(port)); DRM_MODE_ENCODER_TMDS, "DDI %c", port_name(port));
intel_encoder->compute_config = intel_ddi_compute_config; intel_encoder->compute_config = intel_ddi_compute_config;
......
...@@ -8897,9 +8897,8 @@ static bool i9xx_get_pipe_config(struct intel_crtc *crtc, ...@@ -8897,9 +8897,8 @@ static bool i9xx_get_pipe_config(struct intel_crtc *crtc,
return ret; return ret;
} }
static void ironlake_init_pch_refclk(struct drm_device *dev) static void ironlake_init_pch_refclk(struct drm_i915_private *dev_priv)
{ {
struct drm_i915_private *dev_priv = to_i915(dev);
struct intel_encoder *encoder; struct intel_encoder *encoder;
int i; int i;
u32 val, final; u32 val, final;
...@@ -8911,7 +8910,7 @@ static void ironlake_init_pch_refclk(struct drm_device *dev) ...@@ -8911,7 +8910,7 @@ static void ironlake_init_pch_refclk(struct drm_device *dev)
bool using_ssc_source = false; bool using_ssc_source = false;
/* We need to take the global config into account */ /* We need to take the global config into account */
for_each_intel_encoder(dev, encoder) { for_each_intel_encoder(&dev_priv->drm, encoder) {
switch (encoder->type) { switch (encoder->type) {
case INTEL_OUTPUT_LVDS: case INTEL_OUTPUT_LVDS:
has_panel = true; has_panel = true;
...@@ -9167,10 +9166,9 @@ static void lpt_program_fdi_mphy(struct drm_i915_private *dev_priv) ...@@ -9167,10 +9166,9 @@ static void lpt_program_fdi_mphy(struct drm_i915_private *dev_priv)
* - Sequence to enable CLKOUT_DP without spread * - Sequence to enable CLKOUT_DP without spread
* - Sequence to enable CLKOUT_DP for FDI usage and configure PCH FDI I/O * - Sequence to enable CLKOUT_DP for FDI usage and configure PCH FDI I/O
*/ */
static void lpt_enable_clkout_dp(struct drm_device *dev, bool with_spread, static void lpt_enable_clkout_dp(struct drm_i915_private *dev_priv,
bool with_fdi) bool with_spread, bool with_fdi)
{ {
struct drm_i915_private *dev_priv = to_i915(dev);
uint32_t reg, tmp; uint32_t reg, tmp;
if (WARN(with_fdi && !with_spread, "FDI requires downspread\n")) if (WARN(with_fdi && !with_spread, "FDI requires downspread\n"))
...@@ -9208,9 +9206,8 @@ static void lpt_enable_clkout_dp(struct drm_device *dev, bool with_spread, ...@@ -9208,9 +9206,8 @@ static void lpt_enable_clkout_dp(struct drm_device *dev, bool with_spread,
} }
/* Sequence to disable CLKOUT_DP */ /* Sequence to disable CLKOUT_DP */
static void lpt_disable_clkout_dp(struct drm_device *dev) static void lpt_disable_clkout_dp(struct drm_i915_private *dev_priv)
{ {
struct drm_i915_private *dev_priv = to_i915(dev);
uint32_t reg, tmp; uint32_t reg, tmp;
mutex_lock(&dev_priv->sb_lock); mutex_lock(&dev_priv->sb_lock);
...@@ -9295,12 +9292,12 @@ static void lpt_bend_clkout_dp(struct drm_i915_private *dev_priv, int steps) ...@@ -9295,12 +9292,12 @@ static void lpt_bend_clkout_dp(struct drm_i915_private *dev_priv, int steps)
#undef BEND_IDX #undef BEND_IDX
static void lpt_init_pch_refclk(struct drm_device *dev) static void lpt_init_pch_refclk(struct drm_i915_private *dev_priv)
{ {
struct intel_encoder *encoder; struct intel_encoder *encoder;
bool has_vga = false; bool has_vga = false;
for_each_intel_encoder(dev, encoder) { for_each_intel_encoder(&dev_priv->drm, encoder) {
switch (encoder->type) { switch (encoder->type) {
case INTEL_OUTPUT_ANALOG: case INTEL_OUTPUT_ANALOG:
has_vga = true; has_vga = true;
...@@ -9311,24 +9308,22 @@ static void lpt_init_pch_refclk(struct drm_device *dev) ...@@ -9311,24 +9308,22 @@ static void lpt_init_pch_refclk(struct drm_device *dev)
} }
if (has_vga) { if (has_vga) {
lpt_bend_clkout_dp(to_i915(dev), 0); lpt_bend_clkout_dp(dev_priv, 0);
lpt_enable_clkout_dp(dev, true, true); lpt_enable_clkout_dp(dev_priv, true, true);
} else { } else {
lpt_disable_clkout_dp(dev); lpt_disable_clkout_dp(dev_priv);
} }
} }
/* /*
* Initialize reference clocks when the driver loads * Initialize reference clocks when the driver loads
*/ */
void intel_init_pch_refclk(struct drm_device *dev) void intel_init_pch_refclk(struct drm_i915_private *dev_priv)
{ {
struct drm_i915_private *dev_priv = to_i915(dev);
if (HAS_PCH_IBX(dev_priv) || HAS_PCH_CPT(dev_priv)) if (HAS_PCH_IBX(dev_priv) || HAS_PCH_CPT(dev_priv))
ironlake_init_pch_refclk(dev); ironlake_init_pch_refclk(dev_priv);
else if (HAS_PCH_LPT(dev_priv)) else if (HAS_PCH_LPT(dev_priv))
lpt_init_pch_refclk(dev); lpt_init_pch_refclk(dev_priv);
} }
static void ironlake_set_pipeconf(struct drm_crtc *crtc) static void ironlake_set_pipeconf(struct drm_crtc *crtc)
...@@ -10175,7 +10170,6 @@ static void hsw_restore_lcpll(struct drm_i915_private *dev_priv) ...@@ -10175,7 +10170,6 @@ static void hsw_restore_lcpll(struct drm_i915_private *dev_priv)
*/ */
void hsw_enable_pc8(struct drm_i915_private *dev_priv) void hsw_enable_pc8(struct drm_i915_private *dev_priv)
{ {
struct drm_device *dev = &dev_priv->drm;
uint32_t val; uint32_t val;
DRM_DEBUG_KMS("Enabling package C8+\n"); DRM_DEBUG_KMS("Enabling package C8+\n");
...@@ -10186,19 +10180,18 @@ void hsw_enable_pc8(struct drm_i915_private *dev_priv) ...@@ -10186,19 +10180,18 @@ void hsw_enable_pc8(struct drm_i915_private *dev_priv)
I915_WRITE(SOUTH_DSPCLK_GATE_D, val); I915_WRITE(SOUTH_DSPCLK_GATE_D, val);
} }
lpt_disable_clkout_dp(dev); lpt_disable_clkout_dp(dev_priv);
hsw_disable_lcpll(dev_priv, true, true); hsw_disable_lcpll(dev_priv, true, true);
} }
void hsw_disable_pc8(struct drm_i915_private *dev_priv) void hsw_disable_pc8(struct drm_i915_private *dev_priv)
{ {
struct drm_device *dev = &dev_priv->drm;
uint32_t val; uint32_t val;
DRM_DEBUG_KMS("Disabling package C8+\n"); DRM_DEBUG_KMS("Disabling package C8+\n");
hsw_restore_lcpll(dev_priv); hsw_restore_lcpll(dev_priv);
lpt_init_pch_refclk(dev); lpt_init_pch_refclk(dev_priv);
if (HAS_PCH_LPT_LP(dev_priv)) { if (HAS_PCH_LPT_LP(dev_priv)) {
val = I915_READ(SOUTH_DSPCLK_GATE_D); val = I915_READ(SOUTH_DSPCLK_GATE_D);
...@@ -15494,9 +15487,8 @@ static void intel_pps_init(struct drm_i915_private *dev_priv) ...@@ -15494,9 +15487,8 @@ static void intel_pps_init(struct drm_i915_private *dev_priv)
intel_pps_unlock_regs_wa(dev_priv); intel_pps_unlock_regs_wa(dev_priv);
} }
static void intel_setup_outputs(struct drm_device *dev) static void intel_setup_outputs(struct drm_i915_private *dev_priv)
{ {
struct drm_i915_private *dev_priv = to_i915(dev);
struct intel_encoder *encoder; struct intel_encoder *encoder;
bool dpd_is_edp = false; bool dpd_is_edp = false;
...@@ -15507,10 +15499,10 @@ static void intel_setup_outputs(struct drm_device *dev) ...@@ -15507,10 +15499,10 @@ static void intel_setup_outputs(struct drm_device *dev)
* prevent the registeration of both eDP and LVDS and the incorrect * prevent the registeration of both eDP and LVDS and the incorrect
* sharing of the PPS. * sharing of the PPS.
*/ */
intel_lvds_init(dev); intel_lvds_init(dev_priv);
if (intel_crt_present(dev_priv)) if (intel_crt_present(dev_priv))
intel_crt_init(dev); intel_crt_init(dev_priv);
if (IS_BROXTON(dev_priv)) { if (IS_BROXTON(dev_priv)) {
/* /*
...@@ -15518,11 +15510,11 @@ static void intel_setup_outputs(struct drm_device *dev) ...@@ -15518,11 +15510,11 @@ static void intel_setup_outputs(struct drm_device *dev)
* DDI_BUF_CTL_A or SFUSE_STRAP registers, find another way to * DDI_BUF_CTL_A or SFUSE_STRAP registers, find another way to
* detect the ports. * detect the ports.
*/ */
intel_ddi_init(dev, PORT_A); intel_ddi_init(dev_priv, PORT_A);
intel_ddi_init(dev, PORT_B); intel_ddi_init(dev_priv, PORT_B);
intel_ddi_init(dev, PORT_C); intel_ddi_init(dev_priv, PORT_C);
intel_dsi_init(dev); intel_dsi_init(dev_priv);
} else if (HAS_DDI(dev_priv)) { } else if (HAS_DDI(dev_priv)) {
int found; int found;
...@@ -15534,18 +15526,18 @@ static void intel_setup_outputs(struct drm_device *dev) ...@@ -15534,18 +15526,18 @@ static void intel_setup_outputs(struct drm_device *dev)
found = I915_READ(DDI_BUF_CTL(PORT_A)) & DDI_INIT_DISPLAY_DETECTED; found = I915_READ(DDI_BUF_CTL(PORT_A)) & DDI_INIT_DISPLAY_DETECTED;
/* WaIgnoreDDIAStrap: skl */ /* WaIgnoreDDIAStrap: skl */
if (found || IS_SKYLAKE(dev_priv) || IS_KABYLAKE(dev_priv)) if (found || IS_SKYLAKE(dev_priv) || IS_KABYLAKE(dev_priv))
intel_ddi_init(dev, PORT_A); intel_ddi_init(dev_priv, PORT_A);
/* DDI B, C and D detection is indicated by the SFUSE_STRAP /* DDI B, C and D detection is indicated by the SFUSE_STRAP
* register */ * register */
found = I915_READ(SFUSE_STRAP); found = I915_READ(SFUSE_STRAP);
if (found & SFUSE_STRAP_DDIB_DETECTED) if (found & SFUSE_STRAP_DDIB_DETECTED)
intel_ddi_init(dev, PORT_B); intel_ddi_init(dev_priv, PORT_B);
if (found & SFUSE_STRAP_DDIC_DETECTED) if (found & SFUSE_STRAP_DDIC_DETECTED)
intel_ddi_init(dev, PORT_C); intel_ddi_init(dev_priv, PORT_C);
if (found & SFUSE_STRAP_DDID_DETECTED) if (found & SFUSE_STRAP_DDID_DETECTED)
intel_ddi_init(dev, PORT_D); intel_ddi_init(dev_priv, PORT_D);
/* /*
* On SKL we don't have a way to detect DDI-E so we rely on VBT. * On SKL we don't have a way to detect DDI-E so we rely on VBT.
*/ */
...@@ -15553,35 +15545,35 @@ static void intel_setup_outputs(struct drm_device *dev) ...@@ -15553,35 +15545,35 @@ static void intel_setup_outputs(struct drm_device *dev)
(dev_priv->vbt.ddi_port_info[PORT_E].supports_dp || (dev_priv->vbt.ddi_port_info[PORT_E].supports_dp ||
dev_priv->vbt.ddi_port_info[PORT_E].supports_dvi || dev_priv->vbt.ddi_port_info[PORT_E].supports_dvi ||
dev_priv->vbt.ddi_port_info[PORT_E].supports_hdmi)) dev_priv->vbt.ddi_port_info[PORT_E].supports_hdmi))
intel_ddi_init(dev, PORT_E); intel_ddi_init(dev_priv, PORT_E);
} else if (HAS_PCH_SPLIT(dev_priv)) { } else if (HAS_PCH_SPLIT(dev_priv)) {
int found; int found;
dpd_is_edp = intel_dp_is_edp(dev_priv, PORT_D); dpd_is_edp = intel_dp_is_edp(dev_priv, PORT_D);
if (has_edp_a(dev_priv)) if (has_edp_a(dev_priv))
intel_dp_init(dev, DP_A, PORT_A); intel_dp_init(dev_priv, DP_A, PORT_A);
if (I915_READ(PCH_HDMIB) & SDVO_DETECTED) { if (I915_READ(PCH_HDMIB) & SDVO_DETECTED) {
/* PCH SDVOB multiplex with HDMIB */ /* PCH SDVOB multiplex with HDMIB */
found = intel_sdvo_init(dev, PCH_SDVOB, PORT_B); found = intel_sdvo_init(dev_priv, PCH_SDVOB, PORT_B);
if (!found) if (!found)
intel_hdmi_init(dev, PCH_HDMIB, PORT_B); intel_hdmi_init(dev_priv, PCH_HDMIB, PORT_B);
if (!found && (I915_READ(PCH_DP_B) & DP_DETECTED)) if (!found && (I915_READ(PCH_DP_B) & DP_DETECTED))
intel_dp_init(dev, PCH_DP_B, PORT_B); intel_dp_init(dev_priv, PCH_DP_B, PORT_B);
} }
if (I915_READ(PCH_HDMIC) & SDVO_DETECTED) if (I915_READ(PCH_HDMIC) & SDVO_DETECTED)
intel_hdmi_init(dev, PCH_HDMIC, PORT_C); intel_hdmi_init(dev_priv, PCH_HDMIC, PORT_C);
if (!dpd_is_edp && I915_READ(PCH_HDMID) & SDVO_DETECTED) if (!dpd_is_edp && I915_READ(PCH_HDMID) & SDVO_DETECTED)
intel_hdmi_init(dev, PCH_HDMID, PORT_D); intel_hdmi_init(dev_priv, PCH_HDMID, PORT_D);
if (I915_READ(PCH_DP_C) & DP_DETECTED) if (I915_READ(PCH_DP_C) & DP_DETECTED)
intel_dp_init(dev, PCH_DP_C, PORT_C); intel_dp_init(dev_priv, PCH_DP_C, PORT_C);
if (I915_READ(PCH_DP_D) & DP_DETECTED) if (I915_READ(PCH_DP_D) & DP_DETECTED)
intel_dp_init(dev, PCH_DP_D, PORT_D); intel_dp_init(dev_priv, PCH_DP_D, PORT_D);
} else if (IS_VALLEYVIEW(dev_priv) || IS_CHERRYVIEW(dev_priv)) { } else if (IS_VALLEYVIEW(dev_priv) || IS_CHERRYVIEW(dev_priv)) {
bool has_edp, has_port; bool has_edp, has_port;
...@@ -15603,16 +15595,16 @@ static void intel_setup_outputs(struct drm_device *dev) ...@@ -15603,16 +15595,16 @@ static void intel_setup_outputs(struct drm_device *dev)
has_edp = intel_dp_is_edp(dev_priv, PORT_B); has_edp = intel_dp_is_edp(dev_priv, PORT_B);
has_port = intel_bios_is_port_present(dev_priv, PORT_B); has_port = intel_bios_is_port_present(dev_priv, PORT_B);
if (I915_READ(VLV_DP_B) & DP_DETECTED || has_port) if (I915_READ(VLV_DP_B) & DP_DETECTED || has_port)
has_edp &= intel_dp_init(dev, VLV_DP_B, PORT_B); has_edp &= intel_dp_init(dev_priv, VLV_DP_B, PORT_B);
if ((I915_READ(VLV_HDMIB) & SDVO_DETECTED || has_port) && !has_edp) if ((I915_READ(VLV_HDMIB) & SDVO_DETECTED || has_port) && !has_edp)
intel_hdmi_init(dev, VLV_HDMIB, PORT_B); intel_hdmi_init(dev_priv, VLV_HDMIB, PORT_B);
has_edp = intel_dp_is_edp(dev_priv, PORT_C); has_edp = intel_dp_is_edp(dev_priv, PORT_C);
has_port = intel_bios_is_port_present(dev_priv, PORT_C); has_port = intel_bios_is_port_present(dev_priv, PORT_C);
if (I915_READ(VLV_DP_C) & DP_DETECTED || has_port) if (I915_READ(VLV_DP_C) & DP_DETECTED || has_port)
has_edp &= intel_dp_init(dev, VLV_DP_C, PORT_C); has_edp &= intel_dp_init(dev_priv, VLV_DP_C, PORT_C);
if ((I915_READ(VLV_HDMIC) & SDVO_DETECTED || has_port) && !has_edp) if ((I915_READ(VLV_HDMIC) & SDVO_DETECTED || has_port) && !has_edp)
intel_hdmi_init(dev, VLV_HDMIC, PORT_C); intel_hdmi_init(dev_priv, VLV_HDMIC, PORT_C);
if (IS_CHERRYVIEW(dev_priv)) { if (IS_CHERRYVIEW(dev_priv)) {
/* /*
...@@ -15621,63 +15613,63 @@ static void intel_setup_outputs(struct drm_device *dev) ...@@ -15621,63 +15613,63 @@ static void intel_setup_outputs(struct drm_device *dev)
*/ */
has_port = intel_bios_is_port_present(dev_priv, PORT_D); has_port = intel_bios_is_port_present(dev_priv, PORT_D);
if (I915_READ(CHV_DP_D) & DP_DETECTED || has_port) if (I915_READ(CHV_DP_D) & DP_DETECTED || has_port)
intel_dp_init(dev, CHV_DP_D, PORT_D); intel_dp_init(dev_priv, CHV_DP_D, PORT_D);
if (I915_READ(CHV_HDMID) & SDVO_DETECTED || has_port) if (I915_READ(CHV_HDMID) & SDVO_DETECTED || has_port)
intel_hdmi_init(dev, CHV_HDMID, PORT_D); intel_hdmi_init(dev_priv, CHV_HDMID, PORT_D);
} }
intel_dsi_init(dev); intel_dsi_init(dev_priv);
} else if (!IS_GEN2(dev_priv) && !IS_PINEVIEW(dev_priv)) { } else if (!IS_GEN2(dev_priv) && !IS_PINEVIEW(dev_priv)) {
bool found = false; bool found = false;
if (I915_READ(GEN3_SDVOB) & SDVO_DETECTED) { if (I915_READ(GEN3_SDVOB) & SDVO_DETECTED) {
DRM_DEBUG_KMS("probing SDVOB\n"); DRM_DEBUG_KMS("probing SDVOB\n");
found = intel_sdvo_init(dev, GEN3_SDVOB, PORT_B); found = intel_sdvo_init(dev_priv, GEN3_SDVOB, PORT_B);
if (!found && IS_G4X(dev_priv)) { if (!found && IS_G4X(dev_priv)) {
DRM_DEBUG_KMS("probing HDMI on SDVOB\n"); DRM_DEBUG_KMS("probing HDMI on SDVOB\n");
intel_hdmi_init(dev, GEN4_HDMIB, PORT_B); intel_hdmi_init(dev_priv, GEN4_HDMIB, PORT_B);
} }
if (!found && IS_G4X(dev_priv)) if (!found && IS_G4X(dev_priv))
intel_dp_init(dev, DP_B, PORT_B); intel_dp_init(dev_priv, DP_B, PORT_B);
} }
/* Before G4X SDVOC doesn't have its own detect register */ /* Before G4X SDVOC doesn't have its own detect register */
if (I915_READ(GEN3_SDVOB) & SDVO_DETECTED) { if (I915_READ(GEN3_SDVOB) & SDVO_DETECTED) {
DRM_DEBUG_KMS("probing SDVOC\n"); DRM_DEBUG_KMS("probing SDVOC\n");
found = intel_sdvo_init(dev, GEN3_SDVOC, PORT_C); found = intel_sdvo_init(dev_priv, GEN3_SDVOC, PORT_C);
} }
if (!found && (I915_READ(GEN3_SDVOC) & SDVO_DETECTED)) { if (!found && (I915_READ(GEN3_SDVOC) & SDVO_DETECTED)) {
if (IS_G4X(dev_priv)) { if (IS_G4X(dev_priv)) {
DRM_DEBUG_KMS("probing HDMI on SDVOC\n"); DRM_DEBUG_KMS("probing HDMI on SDVOC\n");
intel_hdmi_init(dev, GEN4_HDMIC, PORT_C); intel_hdmi_init(dev_priv, GEN4_HDMIC, PORT_C);
} }
if (IS_G4X(dev_priv)) if (IS_G4X(dev_priv))
intel_dp_init(dev, DP_C, PORT_C); intel_dp_init(dev_priv, DP_C, PORT_C);
} }
if (IS_G4X(dev_priv) && (I915_READ(DP_D) & DP_DETECTED)) if (IS_G4X(dev_priv) && (I915_READ(DP_D) & DP_DETECTED))
intel_dp_init(dev, DP_D, PORT_D); intel_dp_init(dev_priv, DP_D, PORT_D);
} else if (IS_GEN2(dev_priv)) } else if (IS_GEN2(dev_priv))
intel_dvo_init(dev); intel_dvo_init(dev_priv);
if (SUPPORTS_TV(dev_priv)) if (SUPPORTS_TV(dev_priv))
intel_tv_init(dev); intel_tv_init(dev_priv);
intel_psr_init(dev); intel_psr_init(dev_priv);
for_each_intel_encoder(dev, encoder) { for_each_intel_encoder(&dev_priv->drm, encoder) {
encoder->base.possible_crtcs = encoder->crtc_mask; encoder->base.possible_crtcs = encoder->crtc_mask;
encoder->base.possible_clones = encoder->base.possible_clones =
intel_encoder_clones(encoder); intel_encoder_clones(encoder);
} }
intel_init_pch_refclk(dev); intel_init_pch_refclk(dev_priv);
drm_helper_move_panel_connectors_to_head(dev); drm_helper_move_panel_connectors_to_head(&dev_priv->drm);
} }
static void intel_user_framebuffer_destroy(struct drm_framebuffer *fb) static void intel_user_framebuffer_destroy(struct drm_framebuffer *fb)
...@@ -16532,7 +16524,7 @@ int intel_modeset_init(struct drm_device *dev) ...@@ -16532,7 +16524,7 @@ int intel_modeset_init(struct drm_device *dev)
/* Just disable it once at startup */ /* Just disable it once at startup */
i915_disable_vga(dev_priv); i915_disable_vga(dev_priv);
intel_setup_outputs(dev); intel_setup_outputs(dev_priv);
drm_modeset_lock_all(dev); drm_modeset_lock_all(dev);
intel_modeset_setup_hw_state(dev); intel_modeset_setup_hw_state(dev);
......
...@@ -5770,11 +5770,10 @@ intel_dp_init_connector(struct intel_digital_port *intel_dig_port, ...@@ -5770,11 +5770,10 @@ intel_dp_init_connector(struct intel_digital_port *intel_dig_port,
return false; return false;
} }
bool intel_dp_init(struct drm_device *dev, bool intel_dp_init(struct drm_i915_private *dev_priv,
i915_reg_t output_reg, i915_reg_t output_reg,
enum port port) enum port port)
{ {
struct drm_i915_private *dev_priv = to_i915(dev);
struct intel_digital_port *intel_dig_port; struct intel_digital_port *intel_dig_port;
struct intel_encoder *intel_encoder; struct intel_encoder *intel_encoder;
struct drm_encoder *encoder; struct drm_encoder *encoder;
...@@ -5791,8 +5790,9 @@ bool intel_dp_init(struct drm_device *dev, ...@@ -5791,8 +5790,9 @@ bool intel_dp_init(struct drm_device *dev,
intel_encoder = &intel_dig_port->base; intel_encoder = &intel_dig_port->base;
encoder = &intel_encoder->base; encoder = &intel_encoder->base;
if (drm_encoder_init(dev, &intel_encoder->base, &intel_dp_enc_funcs, if (drm_encoder_init(&dev_priv->drm, &intel_encoder->base,
DRM_MODE_ENCODER_TMDS, "DP %c", port_name(port))) &intel_dp_enc_funcs, DRM_MODE_ENCODER_TMDS,
"DP %c", port_name(port)))
goto err_encoder_init; goto err_encoder_init;
intel_encoder->compute_config = intel_dp_compute_config; intel_encoder->compute_config = intel_dp_compute_config;
......
...@@ -1151,7 +1151,7 @@ void gen9_enable_guc_interrupts(struct drm_i915_private *dev_priv); ...@@ -1151,7 +1151,7 @@ void gen9_enable_guc_interrupts(struct drm_i915_private *dev_priv);
void gen9_disable_guc_interrupts(struct drm_i915_private *dev_priv); void gen9_disable_guc_interrupts(struct drm_i915_private *dev_priv);
/* intel_crt.c */ /* intel_crt.c */
void intel_crt_init(struct drm_device *dev); void intel_crt_init(struct drm_i915_private *dev_priv);
void intel_crt_reset(struct drm_encoder *encoder); void intel_crt_reset(struct drm_encoder *encoder);
/* intel_ddi.c */ /* intel_ddi.c */
...@@ -1162,7 +1162,7 @@ void intel_ddi_fdi_post_disable(struct intel_encoder *intel_encoder, ...@@ -1162,7 +1162,7 @@ void intel_ddi_fdi_post_disable(struct intel_encoder *intel_encoder,
struct drm_connector_state *old_conn_state); struct drm_connector_state *old_conn_state);
void intel_prepare_dp_ddi_buffers(struct intel_encoder *encoder); void intel_prepare_dp_ddi_buffers(struct intel_encoder *encoder);
void hsw_fdi_link_train(struct drm_crtc *crtc); void hsw_fdi_link_train(struct drm_crtc *crtc);
void intel_ddi_init(struct drm_device *dev, enum port port); void intel_ddi_init(struct drm_i915_private *dev_priv, enum port port);
enum port intel_ddi_get_encoder_port(struct intel_encoder *intel_encoder); enum port intel_ddi_get_encoder_port(struct intel_encoder *intel_encoder);
bool intel_ddi_get_hw_state(struct intel_encoder *encoder, enum pipe *pipe); bool intel_ddi_get_hw_state(struct intel_encoder *encoder, enum pipe *pipe);
void intel_ddi_enable_transcoder_func(struct drm_crtc *crtc); void intel_ddi_enable_transcoder_func(struct drm_crtc *crtc);
...@@ -1387,7 +1387,8 @@ void intel_csr_ucode_suspend(struct drm_i915_private *); ...@@ -1387,7 +1387,8 @@ void intel_csr_ucode_suspend(struct drm_i915_private *);
void intel_csr_ucode_resume(struct drm_i915_private *); void intel_csr_ucode_resume(struct drm_i915_private *);
/* intel_dp.c */ /* intel_dp.c */
bool intel_dp_init(struct drm_device *dev, i915_reg_t output_reg, enum port port); bool intel_dp_init(struct drm_i915_private *dev_priv, i915_reg_t output_reg,
enum port port);
bool intel_dp_init_connector(struct intel_digital_port *intel_dig_port, bool intel_dp_init_connector(struct intel_digital_port *intel_dig_port,
struct intel_connector *intel_connector); struct intel_connector *intel_connector);
void intel_dp_set_link_params(struct intel_dp *intel_dp, void intel_dp_set_link_params(struct intel_dp *intel_dp,
...@@ -1462,13 +1463,13 @@ int intel_dp_aux_init_backlight_funcs(struct intel_connector *intel_connector); ...@@ -1462,13 +1463,13 @@ int intel_dp_aux_init_backlight_funcs(struct intel_connector *intel_connector);
int intel_dp_mst_encoder_init(struct intel_digital_port *intel_dig_port, int conn_id); int intel_dp_mst_encoder_init(struct intel_digital_port *intel_dig_port, int conn_id);
void intel_dp_mst_encoder_cleanup(struct intel_digital_port *intel_dig_port); void intel_dp_mst_encoder_cleanup(struct intel_digital_port *intel_dig_port);
/* intel_dsi.c */ /* intel_dsi.c */
void intel_dsi_init(struct drm_device *dev); void intel_dsi_init(struct drm_i915_private *dev_priv);
/* intel_dsi_dcs_backlight.c */ /* intel_dsi_dcs_backlight.c */
int intel_dsi_dcs_init_backlight_funcs(struct intel_connector *intel_connector); int intel_dsi_dcs_init_backlight_funcs(struct intel_connector *intel_connector);
/* intel_dvo.c */ /* intel_dvo.c */
void intel_dvo_init(struct drm_device *dev); void intel_dvo_init(struct drm_i915_private *dev_priv);
/* intel_hotplug.c */ /* intel_hotplug.c */
void intel_hpd_poll_init(struct drm_i915_private *dev_priv); void intel_hpd_poll_init(struct drm_i915_private *dev_priv);
...@@ -1532,7 +1533,8 @@ void intel_fbc_cleanup_cfb(struct drm_i915_private *dev_priv); ...@@ -1532,7 +1533,8 @@ void intel_fbc_cleanup_cfb(struct drm_i915_private *dev_priv);
void intel_fbc_handle_fifo_underrun_irq(struct drm_i915_private *dev_priv); void intel_fbc_handle_fifo_underrun_irq(struct drm_i915_private *dev_priv);
/* intel_hdmi.c */ /* intel_hdmi.c */
void intel_hdmi_init(struct drm_device *dev, i915_reg_t hdmi_reg, enum port port); void intel_hdmi_init(struct drm_i915_private *dev_priv, i915_reg_t hdmi_reg,
enum port port);
void intel_hdmi_init_connector(struct intel_digital_port *intel_dig_port, void intel_hdmi_init_connector(struct intel_digital_port *intel_dig_port,
struct intel_connector *intel_connector); struct intel_connector *intel_connector);
struct intel_hdmi *enc_to_intel_hdmi(struct drm_encoder *encoder); struct intel_hdmi *enc_to_intel_hdmi(struct drm_encoder *encoder);
...@@ -1543,7 +1545,7 @@ void intel_dp_dual_mode_set_tmds_output(struct intel_hdmi *hdmi, bool enable); ...@@ -1543,7 +1545,7 @@ void intel_dp_dual_mode_set_tmds_output(struct intel_hdmi *hdmi, bool enable);
/* intel_lvds.c */ /* intel_lvds.c */
void intel_lvds_init(struct drm_device *dev); void intel_lvds_init(struct drm_i915_private *dev_priv);
struct intel_encoder *intel_get_lvds_encoder(struct drm_device *dev); struct intel_encoder *intel_get_lvds_encoder(struct drm_device *dev);
bool intel_is_dual_link_lvds(struct drm_device *dev); bool intel_is_dual_link_lvds(struct drm_device *dev);
...@@ -1616,7 +1618,7 @@ void intel_psr_invalidate(struct drm_i915_private *dev_priv, ...@@ -1616,7 +1618,7 @@ void intel_psr_invalidate(struct drm_i915_private *dev_priv,
void intel_psr_flush(struct drm_i915_private *dev_priv, void intel_psr_flush(struct drm_i915_private *dev_priv,
unsigned frontbuffer_bits, unsigned frontbuffer_bits,
enum fb_op_origin origin); enum fb_op_origin origin);
void intel_psr_init(struct drm_device *dev); void intel_psr_init(struct drm_i915_private *dev_priv);
void intel_psr_single_frame_update(struct drm_i915_private *dev_priv, void intel_psr_single_frame_update(struct drm_i915_private *dev_priv,
unsigned frontbuffer_bits); unsigned frontbuffer_bits);
...@@ -1761,7 +1763,7 @@ static inline int intel_enable_rc6(void) ...@@ -1761,7 +1763,7 @@ static inline int intel_enable_rc6(void)
} }
/* intel_sdvo.c */ /* intel_sdvo.c */
bool intel_sdvo_init(struct drm_device *dev, bool intel_sdvo_init(struct drm_i915_private *dev_priv,
i915_reg_t reg, enum port port); i915_reg_t reg, enum port port);
...@@ -1776,7 +1778,7 @@ void intel_pipe_update_start(struct intel_crtc *crtc); ...@@ -1776,7 +1778,7 @@ void intel_pipe_update_start(struct intel_crtc *crtc);
void intel_pipe_update_end(struct intel_crtc *crtc, struct intel_flip_work *work); void intel_pipe_update_end(struct intel_crtc *crtc, struct intel_flip_work *work);
/* intel_tv.c */ /* intel_tv.c */
void intel_tv_init(struct drm_device *dev); void intel_tv_init(struct drm_i915_private *dev_priv);
/* intel_atomic.c */ /* intel_atomic.c */
int intel_connector_atomic_get_property(struct drm_connector *connector, int intel_connector_atomic_get_property(struct drm_connector *connector,
......
...@@ -1434,15 +1434,15 @@ static void intel_dsi_add_properties(struct intel_connector *connector) ...@@ -1434,15 +1434,15 @@ static void intel_dsi_add_properties(struct intel_connector *connector)
} }
} }
void intel_dsi_init(struct drm_device *dev) void intel_dsi_init(struct drm_i915_private *dev_priv)
{ {
struct drm_device *dev = &dev_priv->drm;
struct intel_dsi *intel_dsi; struct intel_dsi *intel_dsi;
struct intel_encoder *intel_encoder; struct intel_encoder *intel_encoder;
struct drm_encoder *encoder; struct drm_encoder *encoder;
struct intel_connector *intel_connector; struct intel_connector *intel_connector;
struct drm_connector *connector; struct drm_connector *connector;
struct drm_display_mode *scan, *fixed_mode = NULL; struct drm_display_mode *scan, *fixed_mode = NULL;
struct drm_i915_private *dev_priv = to_i915(dev);
enum port port; enum port port;
unsigned int i; unsigned int i;
......
...@@ -422,9 +422,8 @@ static enum port intel_dvo_port(i915_reg_t dvo_reg) ...@@ -422,9 +422,8 @@ static enum port intel_dvo_port(i915_reg_t dvo_reg)
return PORT_C; return PORT_C;
} }
void intel_dvo_init(struct drm_device *dev) void intel_dvo_init(struct drm_i915_private *dev_priv)
{ {
struct drm_i915_private *dev_priv = to_i915(dev);
struct intel_encoder *intel_encoder; struct intel_encoder *intel_encoder;
struct intel_dvo *intel_dvo; struct intel_dvo *intel_dvo;
struct intel_connector *intel_connector; struct intel_connector *intel_connector;
...@@ -511,7 +510,7 @@ void intel_dvo_init(struct drm_device *dev) ...@@ -511,7 +510,7 @@ void intel_dvo_init(struct drm_device *dev)
continue; continue;
port = intel_dvo_port(dvo->dvo_reg); port = intel_dvo_port(dvo->dvo_reg);
drm_encoder_init(dev, &intel_encoder->base, drm_encoder_init(&dev_priv->drm, &intel_encoder->base,
&intel_dvo_enc_funcs, encoder_type, &intel_dvo_enc_funcs, encoder_type,
"DVO %c", port_name(port)); "DVO %c", port_name(port));
...@@ -523,14 +522,14 @@ void intel_dvo_init(struct drm_device *dev) ...@@ -523,14 +522,14 @@ void intel_dvo_init(struct drm_device *dev)
case INTEL_DVO_CHIP_TMDS: case INTEL_DVO_CHIP_TMDS:
intel_encoder->cloneable = (1 << INTEL_OUTPUT_ANALOG) | intel_encoder->cloneable = (1 << INTEL_OUTPUT_ANALOG) |
(1 << INTEL_OUTPUT_DVO); (1 << INTEL_OUTPUT_DVO);
drm_connector_init(dev, connector, drm_connector_init(&dev_priv->drm, connector,
&intel_dvo_connector_funcs, &intel_dvo_connector_funcs,
DRM_MODE_CONNECTOR_DVII); DRM_MODE_CONNECTOR_DVII);
encoder_type = DRM_MODE_ENCODER_TMDS; encoder_type = DRM_MODE_ENCODER_TMDS;
break; break;
case INTEL_DVO_CHIP_LVDS: case INTEL_DVO_CHIP_LVDS:
intel_encoder->cloneable = 0; intel_encoder->cloneable = 0;
drm_connector_init(dev, connector, drm_connector_init(&dev_priv->drm, connector,
&intel_dvo_connector_funcs, &intel_dvo_connector_funcs,
DRM_MODE_CONNECTOR_LVDS); DRM_MODE_CONNECTOR_LVDS);
encoder_type = DRM_MODE_ENCODER_LVDS; encoder_type = DRM_MODE_ENCODER_LVDS;
......
...@@ -1933,10 +1933,9 @@ void intel_hdmi_init_connector(struct intel_digital_port *intel_dig_port, ...@@ -1933,10 +1933,9 @@ void intel_hdmi_init_connector(struct intel_digital_port *intel_dig_port,
} }
} }
void intel_hdmi_init(struct drm_device *dev, void intel_hdmi_init(struct drm_i915_private *dev_priv,
i915_reg_t hdmi_reg, enum port port) i915_reg_t hdmi_reg, enum port port)
{ {
struct drm_i915_private *dev_priv = to_i915(dev);
struct intel_digital_port *intel_dig_port; struct intel_digital_port *intel_dig_port;
struct intel_encoder *intel_encoder; struct intel_encoder *intel_encoder;
struct intel_connector *intel_connector; struct intel_connector *intel_connector;
...@@ -1953,8 +1952,9 @@ void intel_hdmi_init(struct drm_device *dev, ...@@ -1953,8 +1952,9 @@ void intel_hdmi_init(struct drm_device *dev,
intel_encoder = &intel_dig_port->base; intel_encoder = &intel_dig_port->base;
drm_encoder_init(dev, &intel_encoder->base, &intel_hdmi_enc_funcs, drm_encoder_init(&dev_priv->drm, &intel_encoder->base,
DRM_MODE_ENCODER_TMDS, "HDMI %c", port_name(port)); &intel_hdmi_enc_funcs, DRM_MODE_ENCODER_TMDS,
"HDMI %c", port_name(port));
intel_encoder->compute_config = intel_hdmi_compute_config; intel_encoder->compute_config = intel_hdmi_compute_config;
if (HAS_PCH_SPLIT(dev_priv)) { if (HAS_PCH_SPLIT(dev_priv)) {
......
...@@ -971,9 +971,9 @@ static bool intel_lvds_supported(struct drm_i915_private *dev_priv) ...@@ -971,9 +971,9 @@ static bool intel_lvds_supported(struct drm_i915_private *dev_priv)
* Create the connector, register the LVDS DDC bus, and try to figure out what * Create the connector, register the LVDS DDC bus, and try to figure out what
* modes we can display on the LVDS panel (if present). * modes we can display on the LVDS panel (if present).
*/ */
void intel_lvds_init(struct drm_device *dev) void intel_lvds_init(struct drm_i915_private *dev_priv)
{ {
struct drm_i915_private *dev_priv = to_i915(dev); struct drm_device *dev = &dev_priv->drm;
struct intel_lvds_encoder *lvds_encoder; struct intel_lvds_encoder *lvds_encoder;
struct intel_encoder *intel_encoder; struct intel_encoder *intel_encoder;
struct intel_lvds_connector *lvds_connector; struct intel_lvds_connector *lvds_connector;
......
...@@ -818,10 +818,8 @@ void intel_psr_flush(struct drm_i915_private *dev_priv, ...@@ -818,10 +818,8 @@ void intel_psr_flush(struct drm_i915_private *dev_priv,
* This function is called only once at driver load to initialize basic * This function is called only once at driver load to initialize basic
* PSR stuff. * PSR stuff.
*/ */
void intel_psr_init(struct drm_device *dev) void intel_psr_init(struct drm_i915_private *dev_priv)
{ {
struct drm_i915_private *dev_priv = to_i915(dev);
dev_priv->psr_mmio_base = IS_HASWELL(dev_priv) ? dev_priv->psr_mmio_base = IS_HASWELL(dev_priv) ?
HSW_EDP_PSR_BASE : BDW_EDP_PSR_BASE; HSW_EDP_PSR_BASE : BDW_EDP_PSR_BASE;
......
...@@ -2342,9 +2342,9 @@ intel_sdvo_is_hdmi_connector(struct intel_sdvo *intel_sdvo, int device) ...@@ -2342,9 +2342,9 @@ intel_sdvo_is_hdmi_connector(struct intel_sdvo *intel_sdvo, int device)
} }
static u8 static u8
intel_sdvo_get_slave_addr(struct drm_device *dev, struct intel_sdvo *sdvo) intel_sdvo_get_slave_addr(struct drm_i915_private *dev_priv,
struct intel_sdvo *sdvo)
{ {
struct drm_i915_private *dev_priv = to_i915(dev);
struct sdvo_device_mapping *my_mapping, *other_mapping; struct sdvo_device_mapping *my_mapping, *other_mapping;
if (sdvo->port == PORT_B) { if (sdvo->port == PORT_B) {
...@@ -2934,9 +2934,9 @@ static const struct i2c_algorithm intel_sdvo_ddc_proxy = { ...@@ -2934,9 +2934,9 @@ static const struct i2c_algorithm intel_sdvo_ddc_proxy = {
static bool static bool
intel_sdvo_init_ddc_proxy(struct intel_sdvo *sdvo, intel_sdvo_init_ddc_proxy(struct intel_sdvo *sdvo,
struct drm_device *dev) struct drm_i915_private *dev_priv)
{ {
struct pci_dev *pdev = dev->pdev; struct pci_dev *pdev = dev_priv->drm.pdev;
sdvo->ddc.owner = THIS_MODULE; sdvo->ddc.owner = THIS_MODULE;
sdvo->ddc.class = I2C_CLASS_DDC; sdvo->ddc.class = I2C_CLASS_DDC;
...@@ -2957,10 +2957,9 @@ static void assert_sdvo_port_valid(const struct drm_i915_private *dev_priv, ...@@ -2957,10 +2957,9 @@ static void assert_sdvo_port_valid(const struct drm_i915_private *dev_priv,
WARN_ON(port != PORT_B && port != PORT_C); WARN_ON(port != PORT_B && port != PORT_C);
} }
bool intel_sdvo_init(struct drm_device *dev, bool intel_sdvo_init(struct drm_i915_private *dev_priv,
i915_reg_t sdvo_reg, enum port port) i915_reg_t sdvo_reg, enum port port)
{ {
struct drm_i915_private *dev_priv = to_i915(dev);
struct intel_encoder *intel_encoder; struct intel_encoder *intel_encoder;
struct intel_sdvo *intel_sdvo; struct intel_sdvo *intel_sdvo;
int i; int i;
...@@ -2973,16 +2972,18 @@ bool intel_sdvo_init(struct drm_device *dev, ...@@ -2973,16 +2972,18 @@ bool intel_sdvo_init(struct drm_device *dev,
intel_sdvo->sdvo_reg = sdvo_reg; intel_sdvo->sdvo_reg = sdvo_reg;
intel_sdvo->port = port; intel_sdvo->port = port;
intel_sdvo->slave_addr = intel_sdvo_get_slave_addr(dev, intel_sdvo) >> 1; intel_sdvo->slave_addr =
intel_sdvo_get_slave_addr(dev_priv, intel_sdvo) >> 1;
intel_sdvo_select_i2c_bus(dev_priv, intel_sdvo); intel_sdvo_select_i2c_bus(dev_priv, intel_sdvo);
if (!intel_sdvo_init_ddc_proxy(intel_sdvo, dev)) if (!intel_sdvo_init_ddc_proxy(intel_sdvo, dev_priv))
goto err_i2c_bus; goto err_i2c_bus;
/* encoder type will be decided later */ /* encoder type will be decided later */
intel_encoder = &intel_sdvo->base; intel_encoder = &intel_sdvo->base;
intel_encoder->type = INTEL_OUTPUT_SDVO; intel_encoder->type = INTEL_OUTPUT_SDVO;
intel_encoder->port = port; intel_encoder->port = port;
drm_encoder_init(dev, &intel_encoder->base, &intel_sdvo_enc_funcs, 0, drm_encoder_init(&dev_priv->drm, &intel_encoder->base,
&intel_sdvo_enc_funcs, 0,
"SDVO %c", port_name(port)); "SDVO %c", port_name(port));
/* Read the regs to test if we can talk to the device */ /* Read the regs to test if we can talk to the device */
......
...@@ -1537,9 +1537,9 @@ static const struct drm_encoder_funcs intel_tv_enc_funcs = { ...@@ -1537,9 +1537,9 @@ static const struct drm_encoder_funcs intel_tv_enc_funcs = {
}; };
void void
intel_tv_init(struct drm_device *dev) intel_tv_init(struct drm_i915_private *dev_priv)
{ {
struct drm_i915_private *dev_priv = to_i915(dev); struct drm_device *dev = &dev_priv->drm;
struct drm_connector *connector; struct drm_connector *connector;
struct intel_tv *intel_tv; struct intel_tv *intel_tv;
struct intel_encoder *intel_encoder; struct intel_encoder *intel_encoder;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment