Commit c7362c4d authored by Jani Nikula's avatar Jani Nikula Committed by Daniel Vetter

drm/i915/lvds: Introduce intel_lvds_connector

Introduce a local structure to move LVDS specific information away from the
drm_i915_private and onto the LVDS connector.

Based on earlier work by Chris Wilson <chris@chris-wilson.co.uk>

CC: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
Reviewed-by: default avatarJesse Barnes <jbarnes@virtuousgeek.org>
Reviewed-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent 29b99b48
...@@ -40,6 +40,10 @@ ...@@ -40,6 +40,10 @@
#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_encoder { struct intel_lvds_encoder {
struct intel_encoder base; struct intel_encoder base;
...@@ -58,6 +62,11 @@ static struct intel_lvds_encoder *to_lvds_encoder(struct drm_encoder *encoder) ...@@ -58,6 +62,11 @@ 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);
}
static struct intel_lvds_encoder *intel_attached_lvds(struct drm_connector *connector) static struct intel_lvds_encoder *intel_attached_lvds(struct drm_connector *connector)
{ {
return container_of(intel_attached_encoder(connector), return container_of(intel_attached_encoder(connector),
...@@ -906,6 +915,7 @@ bool intel_lvds_init(struct drm_device *dev) ...@@ -906,6 +915,7 @@ bool intel_lvds_init(struct drm_device *dev)
struct drm_i915_private *dev_priv = dev->dev_private; struct drm_i915_private *dev_priv = dev->dev_private;
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;
...@@ -941,8 +951,8 @@ bool intel_lvds_init(struct drm_device *dev) ...@@ -941,8 +951,8 @@ bool intel_lvds_init(struct drm_device *dev)
if (!lvds_encoder) if (!lvds_encoder)
return false; return false;
intel_connector = kzalloc(sizeof(struct intel_connector), GFP_KERNEL); lvds_connector = kzalloc(sizeof(struct intel_lvds_connector), GFP_KERNEL);
if (!intel_connector) { if (!lvds_connector) {
kfree(lvds_encoder); kfree(lvds_encoder);
return false; return false;
} }
...@@ -953,6 +963,7 @@ bool intel_lvds_init(struct drm_device *dev) ...@@ -953,6 +963,7 @@ bool intel_lvds_init(struct drm_device *dev)
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);
...@@ -1103,6 +1114,6 @@ bool intel_lvds_init(struct drm_device *dev) ...@@ -1103,6 +1114,6 @@ bool intel_lvds_init(struct drm_device *dev)
drm_connector_cleanup(connector); drm_connector_cleanup(connector);
drm_encoder_cleanup(encoder); drm_encoder_cleanup(encoder);
kfree(lvds_encoder); kfree(lvds_encoder);
kfree(intel_connector); kfree(lvds_connector);
return false; return false;
} }
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