Commit 9aec6f76 authored by Jani Nikula's avatar Jani Nikula

drm/i915/bios: convert to struct intel_display

Going forward, struct intel_display shall replace struct
drm_i915_private as the main display device data pointer type. Convert
intel_bios.[ch] to struct intel_display.

Do one drive-by conversion of unnecessary hex usage to decimal.
Reviewed-by: default avatarImre Deak <imre.deak@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/0d0261a53aff5f141b16b482222a5ffce78e176e.1723213547.git.jani.nikula@intel.comSigned-off-by: default avatarJani Nikula <jani.nikula@intel.com>
parent 769b081c
...@@ -1279,6 +1279,7 @@ static const struct drm_encoder_funcs intel_dp_enc_funcs = { ...@@ -1279,6 +1279,7 @@ static const struct drm_encoder_funcs intel_dp_enc_funcs = {
bool g4x_dp_init(struct drm_i915_private *dev_priv, bool g4x_dp_init(struct drm_i915_private *dev_priv,
i915_reg_t output_reg, enum port port) i915_reg_t output_reg, enum port port)
{ {
struct intel_display *display = &dev_priv->display;
const struct intel_bios_encoder_data *devdata; const struct intel_bios_encoder_data *devdata;
struct intel_digital_port *dig_port; struct intel_digital_port *dig_port;
struct intel_encoder *intel_encoder; struct intel_encoder *intel_encoder;
...@@ -1288,7 +1289,7 @@ bool g4x_dp_init(struct drm_i915_private *dev_priv, ...@@ -1288,7 +1289,7 @@ bool g4x_dp_init(struct drm_i915_private *dev_priv,
if (!assert_port_valid(dev_priv, port)) if (!assert_port_valid(dev_priv, port))
return false; return false;
devdata = intel_bios_encoder_data_lookup(dev_priv, port); devdata = intel_bios_encoder_data_lookup(display, port);
/* FIXME bail? */ /* FIXME bail? */
if (!devdata) if (!devdata)
......
...@@ -686,6 +686,7 @@ static bool assert_hdmi_port_valid(struct drm_i915_private *i915, enum port port ...@@ -686,6 +686,7 @@ static bool assert_hdmi_port_valid(struct drm_i915_private *i915, enum port port
void g4x_hdmi_init(struct drm_i915_private *dev_priv, void g4x_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 intel_display *display = &dev_priv->display;
const struct intel_bios_encoder_data *devdata; const struct intel_bios_encoder_data *devdata;
struct intel_digital_port *dig_port; struct intel_digital_port *dig_port;
struct intel_encoder *intel_encoder; struct intel_encoder *intel_encoder;
...@@ -697,7 +698,7 @@ void g4x_hdmi_init(struct drm_i915_private *dev_priv, ...@@ -697,7 +698,7 @@ void g4x_hdmi_init(struct drm_i915_private *dev_priv,
if (!assert_hdmi_port_valid(dev_priv, port)) if (!assert_hdmi_port_valid(dev_priv, port))
return; return;
devdata = intel_bios_encoder_data_lookup(dev_priv, port); devdata = intel_bios_encoder_data_lookup(display, port);
/* FIXME bail? */ /* FIXME bail? */
if (!devdata) if (!devdata)
......
...@@ -1945,6 +1945,7 @@ static void icl_dsi_add_properties(struct intel_connector *connector) ...@@ -1945,6 +1945,7 @@ static void icl_dsi_add_properties(struct intel_connector *connector)
void icl_dsi_init(struct drm_i915_private *dev_priv, void icl_dsi_init(struct drm_i915_private *dev_priv,
const struct intel_bios_encoder_data *devdata) const struct intel_bios_encoder_data *devdata)
{ {
struct intel_display *display = &dev_priv->display;
struct intel_dsi *intel_dsi; struct intel_dsi *intel_dsi;
struct intel_encoder *encoder; struct intel_encoder *encoder;
struct intel_connector *intel_connector; struct intel_connector *intel_connector;
...@@ -2008,7 +2009,7 @@ void icl_dsi_init(struct drm_i915_private *dev_priv, ...@@ -2008,7 +2009,7 @@ void icl_dsi_init(struct drm_i915_private *dev_priv,
intel_dsi->panel_power_off_time = ktime_get_boottime(); intel_dsi->panel_power_off_time = ktime_get_boottime();
intel_bios_init_panel_late(dev_priv, &intel_connector->panel, encoder->devdata, NULL); intel_bios_init_panel_late(display, &intel_connector->panel, encoder->devdata, NULL);
mutex_lock(&dev_priv->drm.mode_config.mutex); mutex_lock(&dev_priv->drm.mode_config.mutex);
intel_panel_add_vbt_lfp_fixed_mode(intel_connector); intel_panel_add_vbt_lfp_fixed_mode(intel_connector);
......
This diff is collapsed.
...@@ -33,9 +33,9 @@ ...@@ -33,9 +33,9 @@
#include <linux/types.h> #include <linux/types.h>
struct drm_edid; struct drm_edid;
struct drm_i915_private;
struct intel_bios_encoder_data; struct intel_bios_encoder_data;
struct intel_crtc_state; struct intel_crtc_state;
struct intel_display;
struct intel_encoder; struct intel_encoder;
struct intel_panel; struct intel_panel;
enum aux_ch; enum aux_ch;
...@@ -232,28 +232,28 @@ struct mipi_pps_data { ...@@ -232,28 +232,28 @@ struct mipi_pps_data {
u16 panel_power_cycle_delay; u16 panel_power_cycle_delay;
} __packed; } __packed;
void intel_bios_init(struct drm_i915_private *dev_priv); void intel_bios_init(struct intel_display *display);
void intel_bios_init_panel_early(struct drm_i915_private *dev_priv, void intel_bios_init_panel_early(struct intel_display *display,
struct intel_panel *panel, struct intel_panel *panel,
const struct intel_bios_encoder_data *devdata); const struct intel_bios_encoder_data *devdata);
void intel_bios_init_panel_late(struct drm_i915_private *dev_priv, void intel_bios_init_panel_late(struct intel_display *display,
struct intel_panel *panel, struct intel_panel *panel,
const struct intel_bios_encoder_data *devdata, const struct intel_bios_encoder_data *devdata,
const struct drm_edid *drm_edid); const struct drm_edid *drm_edid);
void intel_bios_fini_panel(struct intel_panel *panel); void intel_bios_fini_panel(struct intel_panel *panel);
void intel_bios_driver_remove(struct drm_i915_private *dev_priv); void intel_bios_driver_remove(struct intel_display *display);
bool intel_bios_is_valid_vbt(struct drm_i915_private *i915, bool intel_bios_is_valid_vbt(struct intel_display *display,
const void *buf, size_t size); const void *buf, size_t size);
bool intel_bios_is_tv_present(struct drm_i915_private *dev_priv); bool intel_bios_is_tv_present(struct intel_display *display);
bool intel_bios_is_lvds_present(struct drm_i915_private *dev_priv, u8 *i2c_pin); bool intel_bios_is_lvds_present(struct intel_display *display, u8 *i2c_pin);
bool intel_bios_is_port_present(struct drm_i915_private *dev_priv, enum port port); bool intel_bios_is_port_present(struct intel_display *display, enum port port);
bool intel_bios_is_dsi_present(struct drm_i915_private *dev_priv, enum port *port); bool intel_bios_is_dsi_present(struct intel_display *display, enum port *port);
bool intel_bios_get_dsc_params(struct intel_encoder *encoder, bool intel_bios_get_dsc_params(struct intel_encoder *encoder,
struct intel_crtc_state *crtc_state, struct intel_crtc_state *crtc_state,
int dsc_max_bpc); int dsc_max_bpc);
const struct intel_bios_encoder_data * const struct intel_bios_encoder_data *
intel_bios_encoder_data_lookup(struct drm_i915_private *i915, enum port port); intel_bios_encoder_data_lookup(struct intel_display *display, enum port port);
bool intel_bios_encoder_supports_dvi(const struct intel_bios_encoder_data *devdata); bool intel_bios_encoder_supports_dvi(const struct intel_bios_encoder_data *devdata);
bool intel_bios_encoder_supports_hdmi(const struct intel_bios_encoder_data *devdata); bool intel_bios_encoder_supports_hdmi(const struct intel_bios_encoder_data *devdata);
...@@ -277,10 +277,10 @@ int intel_bios_hdmi_ddc_pin(const struct intel_bios_encoder_data *devdata); ...@@ -277,10 +277,10 @@ int intel_bios_hdmi_ddc_pin(const struct intel_bios_encoder_data *devdata);
int intel_bios_hdmi_level_shift(const struct intel_bios_encoder_data *devdata); int intel_bios_hdmi_level_shift(const struct intel_bios_encoder_data *devdata);
int intel_bios_hdmi_max_tmds_clock(const struct intel_bios_encoder_data *devdata); int intel_bios_hdmi_max_tmds_clock(const struct intel_bios_encoder_data *devdata);
void intel_bios_for_each_encoder(struct drm_i915_private *i915, void intel_bios_for_each_encoder(struct intel_display *display,
void (*func)(struct drm_i915_private *i915, void (*func)(struct intel_display *display,
const struct intel_bios_encoder_data *devdata)); const struct intel_bios_encoder_data *devdata));
void intel_bios_debugfs_register(struct drm_i915_private *i915); void intel_bios_debugfs_register(struct intel_display *display);
#endif /* _INTEL_BIOS_H_ */ #endif /* _INTEL_BIOS_H_ */
...@@ -159,9 +159,11 @@ static bool icl_combo_phy_enabled(struct drm_i915_private *dev_priv, ...@@ -159,9 +159,11 @@ static bool icl_combo_phy_enabled(struct drm_i915_private *dev_priv,
static bool ehl_vbt_ddi_d_present(struct drm_i915_private *i915) static bool ehl_vbt_ddi_d_present(struct drm_i915_private *i915)
{ {
bool ddi_a_present = intel_bios_is_port_present(i915, PORT_A); struct intel_display *display = &i915->display;
bool ddi_d_present = intel_bios_is_port_present(i915, PORT_D);
bool dsi_present = intel_bios_is_dsi_present(i915, NULL); bool ddi_a_present = intel_bios_is_port_present(display, PORT_A);
bool ddi_d_present = intel_bios_is_port_present(display, PORT_D);
bool dsi_present = intel_bios_is_dsi_present(display, NULL);
/* /*
* VBT's 'dvo port' field for child devices references the DDI, not * VBT's 'dvo port' field for child devices references the DDI, not
......
...@@ -4854,9 +4854,10 @@ static bool port_in_use(struct drm_i915_private *i915, enum port port) ...@@ -4854,9 +4854,10 @@ static bool port_in_use(struct drm_i915_private *i915, enum port port)
return false; return false;
} }
void intel_ddi_init(struct drm_i915_private *dev_priv, void intel_ddi_init(struct intel_display *display,
const struct intel_bios_encoder_data *devdata) const struct intel_bios_encoder_data *devdata)
{ {
struct drm_i915_private *dev_priv = to_i915(display->drm);
struct intel_digital_port *dig_port; struct intel_digital_port *dig_port;
struct intel_encoder *encoder; struct intel_encoder *encoder;
bool init_hdmi, init_dp; bool init_hdmi, init_dp;
......
...@@ -15,6 +15,7 @@ struct intel_bios_encoder_data; ...@@ -15,6 +15,7 @@ struct intel_bios_encoder_data;
struct intel_connector; struct intel_connector;
struct intel_crtc; struct intel_crtc;
struct intel_crtc_state; struct intel_crtc_state;
struct intel_display;
struct intel_dp; struct intel_dp;
struct intel_dpll_hw_state; struct intel_dpll_hw_state;
struct intel_encoder; struct intel_encoder;
...@@ -53,7 +54,7 @@ void hsw_prepare_dp_ddi_buffers(struct intel_encoder *encoder, ...@@ -53,7 +54,7 @@ void hsw_prepare_dp_ddi_buffers(struct intel_encoder *encoder,
const struct intel_crtc_state *crtc_state); const struct intel_crtc_state *crtc_state);
void intel_wait_ddi_buf_idle(struct drm_i915_private *dev_priv, void intel_wait_ddi_buf_idle(struct drm_i915_private *dev_priv,
enum port port); enum port port);
void intel_ddi_init(struct drm_i915_private *dev_priv, void intel_ddi_init(struct intel_display *display,
const struct intel_bios_encoder_data *devdata); const struct intel_bios_encoder_data *devdata);
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 intel_encoder *encoder, void intel_ddi_enable_transcoder_func(struct intel_encoder *encoder,
......
...@@ -7786,6 +7786,7 @@ bool assert_port_valid(struct drm_i915_private *i915, enum port port) ...@@ -7786,6 +7786,7 @@ bool assert_port_valid(struct drm_i915_private *i915, enum port port)
void intel_setup_outputs(struct drm_i915_private *dev_priv) void intel_setup_outputs(struct drm_i915_private *dev_priv)
{ {
struct intel_display *display = &dev_priv->display;
struct intel_encoder *encoder; struct intel_encoder *encoder;
bool dpd_is_edp = false; bool dpd_is_edp = false;
...@@ -7798,7 +7799,7 @@ void intel_setup_outputs(struct drm_i915_private *dev_priv) ...@@ -7798,7 +7799,7 @@ void intel_setup_outputs(struct drm_i915_private *dev_priv)
if (intel_ddi_crt_present(dev_priv)) if (intel_ddi_crt_present(dev_priv))
intel_crt_init(dev_priv); intel_crt_init(dev_priv);
intel_bios_for_each_encoder(dev_priv, intel_ddi_init); intel_bios_for_each_encoder(display, intel_ddi_init);
if (IS_GEMINILAKE(dev_priv) || IS_BROXTON(dev_priv)) if (IS_GEMINILAKE(dev_priv) || IS_BROXTON(dev_priv))
vlv_dsi_init(dev_priv); vlv_dsi_init(dev_priv);
...@@ -7860,14 +7861,14 @@ void intel_setup_outputs(struct drm_i915_private *dev_priv) ...@@ -7860,14 +7861,14 @@ void intel_setup_outputs(struct drm_i915_private *dev_priv)
* HDMI ports that the VBT claim are DP or eDP. * HDMI ports that the VBT claim are DP or eDP.
*/ */
has_edp = intel_dp_is_port_edp(dev_priv, PORT_B); has_edp = intel_dp_is_port_edp(dev_priv, PORT_B);
has_port = intel_bios_is_port_present(dev_priv, PORT_B); has_port = intel_bios_is_port_present(display, PORT_B);
if (intel_de_read(dev_priv, VLV_DP_B) & DP_DETECTED || has_port) if (intel_de_read(dev_priv, VLV_DP_B) & DP_DETECTED || has_port)
has_edp &= g4x_dp_init(dev_priv, VLV_DP_B, PORT_B); has_edp &= g4x_dp_init(dev_priv, VLV_DP_B, PORT_B);
if ((intel_de_read(dev_priv, VLV_HDMIB) & SDVO_DETECTED || has_port) && !has_edp) if ((intel_de_read(dev_priv, VLV_HDMIB) & SDVO_DETECTED || has_port) && !has_edp)
g4x_hdmi_init(dev_priv, VLV_HDMIB, PORT_B); g4x_hdmi_init(dev_priv, VLV_HDMIB, PORT_B);
has_edp = intel_dp_is_port_edp(dev_priv, PORT_C); has_edp = intel_dp_is_port_edp(dev_priv, PORT_C);
has_port = intel_bios_is_port_present(dev_priv, PORT_C); has_port = intel_bios_is_port_present(display, PORT_C);
if (intel_de_read(dev_priv, VLV_DP_C) & DP_DETECTED || has_port) if (intel_de_read(dev_priv, VLV_DP_C) & DP_DETECTED || has_port)
has_edp &= g4x_dp_init(dev_priv, VLV_DP_C, PORT_C); has_edp &= g4x_dp_init(dev_priv, VLV_DP_C, PORT_C);
if ((intel_de_read(dev_priv, VLV_HDMIC) & SDVO_DETECTED || has_port) && !has_edp) if ((intel_de_read(dev_priv, VLV_HDMIC) & SDVO_DETECTED || has_port) && !has_edp)
...@@ -7878,7 +7879,7 @@ void intel_setup_outputs(struct drm_i915_private *dev_priv) ...@@ -7878,7 +7879,7 @@ void intel_setup_outputs(struct drm_i915_private *dev_priv)
* eDP not supported on port D, * eDP not supported on port D,
* so no need to worry about it * so no need to worry about it
*/ */
has_port = intel_bios_is_port_present(dev_priv, PORT_D); has_port = intel_bios_is_port_present(display, PORT_D);
if (intel_de_read(dev_priv, CHV_DP_D) & DP_DETECTED || has_port) if (intel_de_read(dev_priv, CHV_DP_D) & DP_DETECTED || has_port)
g4x_dp_init(dev_priv, CHV_DP_D, PORT_D); g4x_dp_init(dev_priv, CHV_DP_D, PORT_D);
if (intel_de_read(dev_priv, CHV_HDMID) & SDVO_DETECTED || has_port) if (intel_de_read(dev_priv, CHV_HDMID) & SDVO_DETECTED || has_port)
......
...@@ -1065,7 +1065,7 @@ void intel_display_debugfs_register(struct drm_i915_private *i915) ...@@ -1065,7 +1065,7 @@ void intel_display_debugfs_register(struct drm_i915_private *i915)
ARRAY_SIZE(intel_display_debugfs_list), ARRAY_SIZE(intel_display_debugfs_list),
minor->debugfs_root, minor); minor->debugfs_root, minor);
intel_bios_debugfs_register(i915); intel_bios_debugfs_register(display);
intel_cdclk_debugfs_register(i915); intel_cdclk_debugfs_register(i915);
intel_dmc_debugfs_register(i915); intel_dmc_debugfs_register(i915);
intel_fbc_debugfs_register(display); intel_fbc_debugfs_register(display);
......
...@@ -217,7 +217,7 @@ int intel_display_driver_probe_noirq(struct drm_i915_private *i915) ...@@ -217,7 +217,7 @@ int intel_display_driver_probe_noirq(struct drm_i915_private *i915)
return ret; return ret;
} }
intel_bios_init(i915); intel_bios_init(display);
ret = intel_vga_register(i915); ret = intel_vga_register(i915);
if (ret) if (ret)
...@@ -275,7 +275,7 @@ int intel_display_driver_probe_noirq(struct drm_i915_private *i915) ...@@ -275,7 +275,7 @@ int intel_display_driver_probe_noirq(struct drm_i915_private *i915)
cleanup_vga: cleanup_vga:
intel_vga_unregister(i915); intel_vga_unregister(i915);
cleanup_bios: cleanup_bios:
intel_bios_driver_remove(i915); intel_bios_driver_remove(display);
return ret; return ret;
} }
...@@ -615,13 +615,15 @@ void intel_display_driver_remove_noirq(struct drm_i915_private *i915) ...@@ -615,13 +615,15 @@ void intel_display_driver_remove_noirq(struct drm_i915_private *i915)
/* part #3: call after gem init */ /* part #3: call after gem init */
void intel_display_driver_remove_nogem(struct drm_i915_private *i915) void intel_display_driver_remove_nogem(struct drm_i915_private *i915)
{ {
struct intel_display *display = &i915->display;
intel_dmc_fini(i915); intel_dmc_fini(i915);
intel_power_domains_driver_remove(i915); intel_power_domains_driver_remove(i915);
intel_vga_unregister(i915); intel_vga_unregister(i915);
intel_bios_driver_remove(i915); intel_bios_driver_remove(display);
} }
void intel_display_driver_unregister(struct drm_i915_private *i915) void intel_display_driver_unregister(struct drm_i915_private *i915)
......
...@@ -1697,6 +1697,7 @@ static void icp_irq_postinstall(struct drm_i915_private *i915); ...@@ -1697,6 +1697,7 @@ static void icp_irq_postinstall(struct drm_i915_private *i915);
void gen8_de_irq_postinstall(struct drm_i915_private *dev_priv) void gen8_de_irq_postinstall(struct drm_i915_private *dev_priv)
{ {
struct intel_display *display = &dev_priv->display;
struct intel_uncore *uncore = &dev_priv->uncore; struct intel_uncore *uncore = &dev_priv->uncore;
u32 de_pipe_masked = gen8_de_pipe_fault_mask(dev_priv) | u32 de_pipe_masked = gen8_de_pipe_fault_mask(dev_priv) |
...@@ -1731,7 +1732,7 @@ void gen8_de_irq_postinstall(struct drm_i915_private *dev_priv) ...@@ -1731,7 +1732,7 @@ void gen8_de_irq_postinstall(struct drm_i915_private *dev_priv)
} else if (DISPLAY_VER(dev_priv) >= 11) { } else if (DISPLAY_VER(dev_priv) >= 11) {
enum port port; enum port port;
if (intel_bios_is_dsi_present(dev_priv, &port)) if (intel_bios_is_dsi_present(display, &port))
de_port_masked |= DSI0_TE | DSI1_TE; de_port_masked |= DSI0_TE | DSI1_TE;
} }
......
...@@ -6503,8 +6503,9 @@ static bool _intel_dp_is_port_edp(struct drm_i915_private *dev_priv, ...@@ -6503,8 +6503,9 @@ static bool _intel_dp_is_port_edp(struct drm_i915_private *dev_priv,
bool intel_dp_is_port_edp(struct drm_i915_private *i915, enum port port) bool intel_dp_is_port_edp(struct drm_i915_private *i915, enum port port)
{ {
struct intel_display *display = &i915->display;
const struct intel_bios_encoder_data *devdata = const struct intel_bios_encoder_data *devdata =
intel_bios_encoder_data_lookup(i915, port); intel_bios_encoder_data_lookup(display, port);
return _intel_dp_is_port_edp(i915, devdata, port); return _intel_dp_is_port_edp(i915, devdata, port);
} }
...@@ -6607,6 +6608,7 @@ static void intel_edp_backlight_setup(struct intel_dp *intel_dp, ...@@ -6607,6 +6608,7 @@ static void intel_edp_backlight_setup(struct intel_dp *intel_dp,
static bool intel_edp_init_connector(struct intel_dp *intel_dp, static bool intel_edp_init_connector(struct intel_dp *intel_dp,
struct intel_connector *intel_connector) struct intel_connector *intel_connector)
{ {
struct intel_display *display = to_intel_display(intel_dp);
struct drm_i915_private *dev_priv = dp_to_i915(intel_dp); struct drm_i915_private *dev_priv = dp_to_i915(intel_dp);
struct drm_connector *connector = &intel_connector->base; struct drm_connector *connector = &intel_connector->base;
struct drm_display_mode *fixed_mode; struct drm_display_mode *fixed_mode;
...@@ -6632,7 +6634,7 @@ static bool intel_edp_init_connector(struct intel_dp *intel_dp, ...@@ -6632,7 +6634,7 @@ static bool intel_edp_init_connector(struct intel_dp *intel_dp,
return false; return false;
} }
intel_bios_init_panel_early(dev_priv, &intel_connector->panel, intel_bios_init_panel_early(display, &intel_connector->panel,
encoder->devdata); encoder->devdata);
if (!intel_pps_init(intel_dp)) { if (!intel_pps_init(intel_dp)) {
...@@ -6729,7 +6731,7 @@ static bool intel_edp_init_connector(struct intel_dp *intel_dp, ...@@ -6729,7 +6731,7 @@ static bool intel_edp_init_connector(struct intel_dp *intel_dp,
drm_edid = ERR_PTR(-ENOENT); drm_edid = ERR_PTR(-ENOENT);
} }
intel_bios_init_panel_late(dev_priv, &intel_connector->panel, encoder->devdata, intel_bios_init_panel_late(display, &intel_connector->panel, encoder->devdata,
IS_ERR(drm_edid) ? NULL : drm_edid); IS_ERR(drm_edid) ? NULL : drm_edid);
intel_panel_add_edid_fixed_modes(intel_connector, true); intel_panel_add_edid_fixed_modes(intel_connector, true);
......
...@@ -838,6 +838,7 @@ static void intel_lvds_add_properties(struct drm_connector *connector) ...@@ -838,6 +838,7 @@ static void intel_lvds_add_properties(struct drm_connector *connector)
*/ */
void intel_lvds_init(struct drm_i915_private *i915) void intel_lvds_init(struct drm_i915_private *i915)
{ {
struct intel_display *display = &i915->display;
struct intel_lvds_encoder *lvds_encoder; struct intel_lvds_encoder *lvds_encoder;
struct intel_connector *connector; struct intel_connector *connector;
const struct drm_edid *drm_edid; const struct drm_edid *drm_edid;
...@@ -872,7 +873,7 @@ void intel_lvds_init(struct drm_i915_private *i915) ...@@ -872,7 +873,7 @@ void intel_lvds_init(struct drm_i915_private *i915)
} }
ddc_pin = GMBUS_PIN_PANEL; ddc_pin = GMBUS_PIN_PANEL;
if (!intel_bios_is_lvds_present(i915, &ddc_pin)) { if (!intel_bios_is_lvds_present(display, &ddc_pin)) {
if ((lvds & LVDS_PORT_EN) == 0) { if ((lvds & LVDS_PORT_EN) == 0) {
drm_dbg_kms(&i915->drm, drm_dbg_kms(&i915->drm,
"LVDS is not present in VBT\n"); "LVDS is not present in VBT\n");
...@@ -966,7 +967,7 @@ void intel_lvds_init(struct drm_i915_private *i915) ...@@ -966,7 +967,7 @@ void intel_lvds_init(struct drm_i915_private *i915)
} else { } else {
drm_edid = ERR_PTR(-ENOENT); drm_edid = ERR_PTR(-ENOENT);
} }
intel_bios_init_panel_late(i915, &connector->panel, NULL, intel_bios_init_panel_late(display, &connector->panel, NULL,
IS_ERR(drm_edid) ? NULL : drm_edid); IS_ERR(drm_edid) ? NULL : drm_edid);
/* Try EDID first */ /* Try EDID first */
......
...@@ -870,7 +870,6 @@ static const struct dmi_system_id intel_no_opregion_vbt[] = { ...@@ -870,7 +870,6 @@ static const struct dmi_system_id intel_no_opregion_vbt[] = {
int intel_opregion_setup(struct intel_display *display) int intel_opregion_setup(struct intel_display *display)
{ {
struct drm_i915_private *i915 = to_i915(display->drm);
struct intel_opregion *opregion; struct intel_opregion *opregion;
struct pci_dev *pdev = to_pci_dev(display->drm->dev); struct pci_dev *pdev = to_pci_dev(display->drm->dev);
u32 asls, mboxes; u32 asls, mboxes;
...@@ -991,7 +990,7 @@ int intel_opregion_setup(struct intel_display *display) ...@@ -991,7 +990,7 @@ int intel_opregion_setup(struct intel_display *display)
vbt = opregion->rvda; vbt = opregion->rvda;
vbt_size = opregion->asle->rvds; vbt_size = opregion->asle->rvds;
if (intel_bios_is_valid_vbt(i915, vbt, vbt_size)) { if (intel_bios_is_valid_vbt(display, vbt, vbt_size)) {
drm_dbg_kms(display->drm, drm_dbg_kms(display->drm,
"Found valid VBT in ACPI OpRegion (RVDA)\n"); "Found valid VBT in ACPI OpRegion (RVDA)\n");
opregion->vbt = vbt; opregion->vbt = vbt;
...@@ -1016,7 +1015,7 @@ int intel_opregion_setup(struct intel_display *display) ...@@ -1016,7 +1015,7 @@ int intel_opregion_setup(struct intel_display *display)
vbt_size = (mboxes & MBOX_ASLE_EXT) ? vbt_size = (mboxes & MBOX_ASLE_EXT) ?
OPREGION_ASLE_EXT_OFFSET : OPREGION_SIZE; OPREGION_ASLE_EXT_OFFSET : OPREGION_SIZE;
vbt_size -= OPREGION_VBT_OFFSET; vbt_size -= OPREGION_VBT_OFFSET;
if (intel_bios_is_valid_vbt(i915, vbt, vbt_size)) { if (intel_bios_is_valid_vbt(display, vbt, vbt_size)) {
drm_dbg_kms(display->drm, drm_dbg_kms(display->drm,
"Found valid VBT in ACPI OpRegion (Mailbox #4)\n"); "Found valid VBT in ACPI OpRegion (Mailbox #4)\n");
opregion->vbt = vbt; opregion->vbt = vbt;
......
...@@ -2919,6 +2919,7 @@ intel_sdvo_analog_init(struct intel_sdvo *intel_sdvo, u16 type) ...@@ -2919,6 +2919,7 @@ intel_sdvo_analog_init(struct intel_sdvo *intel_sdvo, u16 type)
static bool static bool
intel_sdvo_lvds_init(struct intel_sdvo *intel_sdvo, u16 type) intel_sdvo_lvds_init(struct intel_sdvo *intel_sdvo, u16 type)
{ {
struct intel_display *display = to_intel_display(&intel_sdvo->base);
struct drm_encoder *encoder = &intel_sdvo->base.base; struct drm_encoder *encoder = &intel_sdvo->base.base;
struct drm_i915_private *i915 = to_i915(encoder->dev); struct drm_i915_private *i915 = to_i915(encoder->dev);
struct drm_connector *connector; struct drm_connector *connector;
...@@ -2946,7 +2947,7 @@ intel_sdvo_lvds_init(struct intel_sdvo *intel_sdvo, u16 type) ...@@ -2946,7 +2947,7 @@ intel_sdvo_lvds_init(struct intel_sdvo *intel_sdvo, u16 type)
if (!intel_sdvo_create_enhance_property(intel_sdvo, intel_sdvo_connector)) if (!intel_sdvo_create_enhance_property(intel_sdvo, intel_sdvo_connector))
goto err; goto err;
intel_bios_init_panel_late(i915, &intel_connector->panel, NULL, NULL); intel_bios_init_panel_late(display, &intel_connector->panel, NULL, NULL);
/* /*
* Fetch modes from VBT. For SDVO prefer the VBT mode since some * Fetch modes from VBT. For SDVO prefer the VBT mode since some
......
...@@ -1930,6 +1930,7 @@ static void intel_tv_add_properties(struct drm_connector *connector) ...@@ -1930,6 +1930,7 @@ static void intel_tv_add_properties(struct drm_connector *connector)
void void
intel_tv_init(struct drm_i915_private *dev_priv) intel_tv_init(struct drm_i915_private *dev_priv)
{ {
struct intel_display *display = &dev_priv->display;
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;
...@@ -1939,7 +1940,7 @@ intel_tv_init(struct drm_i915_private *dev_priv) ...@@ -1939,7 +1940,7 @@ intel_tv_init(struct drm_i915_private *dev_priv)
if ((intel_de_read(dev_priv, TV_CTL) & TV_FUSE_STATE_MASK) == TV_FUSE_STATE_DISABLED) if ((intel_de_read(dev_priv, TV_CTL) & TV_FUSE_STATE_MASK) == TV_FUSE_STATE_DISABLED)
return; return;
if (!intel_bios_is_tv_present(dev_priv)) { if (!intel_bios_is_tv_present(display)) {
drm_dbg_kms(&dev_priv->drm, "Integrated TV is not present.\n"); drm_dbg_kms(&dev_priv->drm, "Integrated TV is not present.\n");
return; return;
} }
......
...@@ -1880,6 +1880,7 @@ static const struct dmi_system_id vlv_dsi_dmi_quirk_table[] = { ...@@ -1880,6 +1880,7 @@ static const struct dmi_system_id vlv_dsi_dmi_quirk_table[] = {
void vlv_dsi_init(struct drm_i915_private *dev_priv) void vlv_dsi_init(struct drm_i915_private *dev_priv)
{ {
struct intel_display *display = &dev_priv->display;
struct intel_dsi *intel_dsi; struct intel_dsi *intel_dsi;
struct intel_encoder *encoder; struct intel_encoder *encoder;
struct intel_connector *connector; struct intel_connector *connector;
...@@ -1891,7 +1892,7 @@ void vlv_dsi_init(struct drm_i915_private *dev_priv) ...@@ -1891,7 +1892,7 @@ void vlv_dsi_init(struct drm_i915_private *dev_priv)
drm_dbg_kms(&dev_priv->drm, "\n"); drm_dbg_kms(&dev_priv->drm, "\n");
/* There is no detection method for MIPI so rely on VBT */ /* There is no detection method for MIPI so rely on VBT */
if (!intel_bios_is_dsi_present(dev_priv, &port)) if (!intel_bios_is_dsi_present(display, &port))
return; return;
if (IS_GEMINILAKE(dev_priv) || IS_BROXTON(dev_priv)) if (IS_GEMINILAKE(dev_priv) || IS_BROXTON(dev_priv))
...@@ -1946,7 +1947,7 @@ void vlv_dsi_init(struct drm_i915_private *dev_priv) ...@@ -1946,7 +1947,7 @@ void vlv_dsi_init(struct drm_i915_private *dev_priv)
intel_dsi->panel_power_off_time = ktime_get_boottime(); intel_dsi->panel_power_off_time = ktime_get_boottime();
intel_bios_init_panel_late(dev_priv, &connector->panel, NULL, NULL); intel_bios_init_panel_late(display, &connector->panel, NULL, NULL);
if (connector->panel.vbt.dsi.config->dual_link) if (connector->panel.vbt.dsi.config->dual_link)
intel_dsi->ports = BIT(PORT_A) | BIT(PORT_C); intel_dsi->ports = BIT(PORT_A) | BIT(PORT_C);
......
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