From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chris Wilson Subject: [PATCH 02/10] drm/i915/lvds: Introduce intel_lvds_connector Date: Fri, 22 Apr 2011 10:19:10 +0100 Message-ID: <1303463958-17128-3-git-send-email-chris@chris-wilson.co.uk> References: <1303463958-17128-1-git-send-email-chris@chris-wilson.co.uk> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from fireflyinternet.com (server109-228-6-236.live-servers.net [109.228.6.236]) by gabe.freedesktop.org (Postfix) with ESMTP id 4C3839E74B for ; Fri, 22 Apr 2011 02:19:26 -0700 (PDT) In-Reply-To: <1303463958-17128-1-git-send-email-chris@chris-wilson.co.uk> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org To: intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org Introduce a local structure to move LVDS specific information away from the drm_i915_private and onto the LVDS connector. Signed-off-by: Chris Wilson --- drivers/gpu/drm/i915/intel_lvds.c | 31 +++++++++++++++++++++---------- 1 files changed, 21 insertions(+), 10 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_lvds.c b/drivers/gpu/drm/i915/intel_lvds.c index 0882e4c..d82c8da 100644 --- a/drivers/gpu/drm/i915/intel_lvds.c +++ b/drivers/gpu/drm/i915/intel_lvds.c @@ -54,11 +54,20 @@ struct intel_lvds_encoder { struct drm_display_mode *fixed_mode; }; +struct intel_lvds_connector { + struct intel_connector base; +}; + static struct intel_lvds_encoder *to_lvds_encoder(struct drm_encoder *encoder) { 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) { return container_of(intel_attached_encoder(connector), @@ -836,11 +845,11 @@ static bool lvds_is_present_in_vbt(struct drm_device *dev, * Create the connector, register the LVDS DDC bus, and try to figure out what * modes we can display on the LVDS panel (if present). */ -bool intel_lvds_encoder_init(struct drm_device *dev) +bool intel_lvds_init(struct drm_device *dev) { struct drm_i915_private *dev_priv = dev->dev_private; struct intel_lvds_encoder *lvds_encoder; - struct intel_connector *intel_connector; + struct intel_lvds_connector *lvds_connector; struct drm_connector *connector; struct drm_encoder *encoder; struct drm_display_mode *scan; /* *modes, *bios_mode; */ @@ -873,8 +882,8 @@ bool intel_lvds_encoder_init(struct drm_device *dev) return false; } - intel_connector = kzalloc(sizeof(struct intel_connector), GFP_KERNEL); - if (!intel_connector) { + lvds_connector = kzalloc(sizeof(struct intel_lvds_connector), GFP_KERNEL); + if (!lvds_connector) { kfree(lvds_encoder); return false; } @@ -884,17 +893,19 @@ bool intel_lvds_encoder_init(struct drm_device *dev) } encoder = &lvds_encoder->base.base; - connector = &intel_connector->base; + connector = &lvds_connector->base.base; drm_connector_init(dev, - &intel_connector->base, + &lvds_connector->base.base, &intel_lvds_connector_funcs, DRM_MODE_CONNECTOR_LVDS); - drm_encoder_init(dev, &lvds_encoder->base.base, + drm_encoder_init(dev, + &lvds_encoder->base.base, &intel_lvds_encoder_enc_funcs, DRM_MODE_ENCODER_LVDS); - intel_connector_attach_encoder(intel_connector, &lvds_encoder->base); + intel_connector_attach_encoder(&lvds_connector->base, + &lvds_encoder->base); lvds_encoder->base.type = INTEL_OUTPUT_LVDS; lvds_encoder->base.clone_mask = (1 << INTEL_LVDS_CLONE_BIT); @@ -913,7 +924,7 @@ bool intel_lvds_encoder_init(struct drm_device *dev) * the initial panel fitting mode will be FULL_SCREEN. */ - drm_connector_attach_property(&intel_connector->base, + drm_connector_attach_property(&lvds_connector->base.base, dev->mode_config.scaling_mode_property, DRM_MODE_SCALE_ASPECT); lvds_encoder->fitting_mode = DRM_MODE_SCALE_ASPECT; @@ -1065,6 +1076,6 @@ failed: drm_connector_cleanup(connector); drm_encoder_cleanup(encoder); kfree(lvds_encoder); - kfree(intel_connector); + kfree(lvds_connector); return false; } -- 1.7.4.1