Commit aee7d9be authored by Jani Nikula's avatar Jani Nikula

drm/i915: nuke the intel_lvds_connector

For a while we carried lvds connector specific data in the lvds
connector, but since commit 05c72e77 ("drm/i915: Nuke the LVDS lid
notifier") we haven't needed it. Revert back to plain intel_connector.

Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20181009210916.19578-1-jani.nikula@intel.com
parent 65404c89
...@@ -42,10 +42,6 @@ ...@@ -42,10 +42,6 @@
#include <linux/acpi.h> #include <linux/acpi.h>
/* Private structure for the integrated LVDS support */ /* Private structure for the integrated LVDS support */
struct intel_lvds_connector {
struct intel_connector base;
};
struct intel_lvds_pps { struct intel_lvds_pps {
/* 100us units */ /* 100us units */
int t1_t2; int t1_t2;
...@@ -70,7 +66,7 @@ struct intel_lvds_encoder { ...@@ -70,7 +66,7 @@ struct intel_lvds_encoder {
struct intel_lvds_pps init_pps; struct intel_lvds_pps init_pps;
u32 init_lvds_val; u32 init_lvds_val;
struct intel_lvds_connector *attached_connector; struct intel_connector *attached_connector;
}; };
static struct intel_lvds_encoder *to_lvds_encoder(struct drm_encoder *encoder) static struct intel_lvds_encoder *to_lvds_encoder(struct drm_encoder *encoder)
...@@ -78,11 +74,6 @@ static struct intel_lvds_encoder *to_lvds_encoder(struct drm_encoder *encoder) ...@@ -78,11 +74,6 @@ static struct intel_lvds_encoder *to_lvds_encoder(struct drm_encoder *encoder)
return container_of(encoder, struct intel_lvds_encoder, base.base); return container_of(encoder, struct intel_lvds_encoder, base.base);
} }
static struct intel_lvds_connector *to_lvds_connector(struct drm_connector *connector)
{
return container_of(connector, struct intel_lvds_connector, base.base);
}
bool intel_lvds_port_enabled(struct drm_i915_private *dev_priv, bool intel_lvds_port_enabled(struct drm_i915_private *dev_priv,
i915_reg_t lvds_reg, enum pipe *pipe) i915_reg_t lvds_reg, enum pipe *pipe)
{ {
...@@ -396,7 +387,7 @@ static bool intel_lvds_compute_config(struct intel_encoder *intel_encoder, ...@@ -396,7 +387,7 @@ static bool intel_lvds_compute_config(struct intel_encoder *intel_encoder,
struct intel_lvds_encoder *lvds_encoder = struct intel_lvds_encoder *lvds_encoder =
to_lvds_encoder(&intel_encoder->base); to_lvds_encoder(&intel_encoder->base);
struct intel_connector *intel_connector = struct intel_connector *intel_connector =
&lvds_encoder->attached_connector->base; lvds_encoder->attached_connector;
struct drm_display_mode *adjusted_mode = &pipe_config->base.adjusted_mode; struct drm_display_mode *adjusted_mode = &pipe_config->base.adjusted_mode;
struct intel_crtc *intel_crtc = to_intel_crtc(pipe_config->base.crtc); struct intel_crtc *intel_crtc = to_intel_crtc(pipe_config->base.crtc);
unsigned int lvds_bpp; unsigned int lvds_bpp;
...@@ -461,15 +452,15 @@ intel_lvds_detect(struct drm_connector *connector, bool force) ...@@ -461,15 +452,15 @@ intel_lvds_detect(struct drm_connector *connector, bool force)
*/ */
static int intel_lvds_get_modes(struct drm_connector *connector) static int intel_lvds_get_modes(struct drm_connector *connector)
{ {
struct intel_lvds_connector *lvds_connector = to_lvds_connector(connector); struct intel_connector *intel_connector = to_intel_connector(connector);
struct drm_device *dev = connector->dev; struct drm_device *dev = connector->dev;
struct drm_display_mode *mode; struct drm_display_mode *mode;
/* use cached edid if we have one */ /* use cached edid if we have one */
if (!IS_ERR_OR_NULL(lvds_connector->base.edid)) if (!IS_ERR_OR_NULL(intel_connector->edid))
return drm_add_edid_modes(connector, lvds_connector->base.edid); return drm_add_edid_modes(connector, intel_connector->edid);
mode = drm_mode_duplicate(dev, lvds_connector->base.panel.fixed_mode); mode = drm_mode_duplicate(dev, intel_connector->panel.fixed_mode);
if (mode == NULL) if (mode == NULL)
return 0; return 0;
...@@ -781,8 +772,7 @@ static bool compute_is_dual_link_lvds(struct intel_lvds_encoder *lvds_encoder) ...@@ -781,8 +772,7 @@ static bool compute_is_dual_link_lvds(struct intel_lvds_encoder *lvds_encoder)
return i915_modparams.lvds_channel_mode == 2; return i915_modparams.lvds_channel_mode == 2;
/* single channel LVDS is limited to 112 MHz */ /* single channel LVDS is limited to 112 MHz */
if (lvds_encoder->attached_connector->base.panel.fixed_mode->clock if (lvds_encoder->attached_connector->panel.fixed_mode->clock > 112999)
> 112999)
return true; return true;
if (dmi_check_system(intel_dual_link_lvds)) if (dmi_check_system(intel_dual_link_lvds))
...@@ -837,7 +827,6 @@ void intel_lvds_init(struct drm_i915_private *dev_priv) ...@@ -837,7 +827,6 @@ void intel_lvds_init(struct drm_i915_private *dev_priv)
struct drm_device *dev = &dev_priv->drm; 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_connector *intel_connector; struct intel_connector *intel_connector;
struct drm_connector *connector; struct drm_connector *connector;
struct drm_encoder *encoder; struct drm_encoder *encoder;
...@@ -890,23 +879,16 @@ void intel_lvds_init(struct drm_i915_private *dev_priv) ...@@ -890,23 +879,16 @@ void intel_lvds_init(struct drm_i915_private *dev_priv)
if (!lvds_encoder) if (!lvds_encoder)
return; return;
lvds_connector = kzalloc(sizeof(*lvds_connector), GFP_KERNEL); intel_connector = intel_connector_alloc();
if (!lvds_connector) { if (!intel_connector) {
kfree(lvds_encoder);
return;
}
if (intel_connector_init(&lvds_connector->base) < 0) {
kfree(lvds_connector);
kfree(lvds_encoder); kfree(lvds_encoder);
return; return;
} }
lvds_encoder->attached_connector = lvds_connector; lvds_encoder->attached_connector = intel_connector;
intel_encoder = &lvds_encoder->base; intel_encoder = &lvds_encoder->base;
encoder = &intel_encoder->base; encoder = &intel_encoder->base;
intel_connector = &lvds_connector->base;
connector = &intel_connector->base; connector = &intel_connector->base;
drm_connector_init(dev, &intel_connector->base, &intel_lvds_connector_funcs, drm_connector_init(dev, &intel_connector->base, &intel_lvds_connector_funcs,
DRM_MODE_CONNECTOR_LVDS); DRM_MODE_CONNECTOR_LVDS);
...@@ -987,7 +969,7 @@ void intel_lvds_init(struct drm_i915_private *dev_priv) ...@@ -987,7 +969,7 @@ void intel_lvds_init(struct drm_i915_private *dev_priv)
} else { } else {
edid = ERR_PTR(-ENOENT); edid = ERR_PTR(-ENOENT);
} }
lvds_connector->base.edid = edid; intel_connector->edid = edid;
list_for_each_entry(scan, &connector->probed_modes, head) { list_for_each_entry(scan, &connector->probed_modes, head) {
if (scan->type & DRM_MODE_TYPE_PREFERRED) { if (scan->type & DRM_MODE_TYPE_PREFERRED) {
...@@ -1051,6 +1033,6 @@ void intel_lvds_init(struct drm_i915_private *dev_priv) ...@@ -1051,6 +1033,6 @@ void intel_lvds_init(struct drm_i915_private *dev_priv)
drm_connector_cleanup(connector); drm_connector_cleanup(connector);
drm_encoder_cleanup(encoder); drm_encoder_cleanup(encoder);
kfree(lvds_encoder); kfree(lvds_encoder);
kfree(lvds_connector); intel_connector_free(intel_connector);
return; return;
} }
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