From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jesse Barnes Subject: Re: [PATCH 02/10] drm/i915/lvds: Introduce intel_lvds_connector Date: Fri, 19 Oct 2012 09:47:06 -0700 Message-ID: <20121019094706.08716642@jbarnes-desktop> References: <90c212fbd8946ec0857492f2391f9bcdb08e6084.1350644022.git.jani.nikula@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from oproxy7-pub.bluehost.com (oproxy7-pub.bluehost.com [67.222.55.9]) by gabe.freedesktop.org (Postfix) with SMTP id E6DEC9EB75 for ; Fri, 19 Oct 2012 09:46:11 -0700 (PDT) In-Reply-To: <90c212fbd8946ec0857492f2391f9bcdb08e6084.1350644022.git.jani.nikula@intel.com> 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: Jani Nikula Cc: intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org On Fri, 19 Oct 2012 14:51:44 +0300 Jani Nikula wrote: > 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 > > CC: Chris Wilson > Signed-off-by: Jani Nikula > --- > drivers/gpu/drm/i915/intel_lvds.c | 17 ++++++++++++++--- > 1 file changed, 14 insertions(+), 3 deletions(-) > > diff --git a/drivers/gpu/drm/i915/intel_lvds.c b/drivers/gpu/drm/i915/intel_lvds.c > index 61bdf4c..4a2f6fa 100644 > --- a/drivers/gpu/drm/i915/intel_lvds.c > +++ b/drivers/gpu/drm/i915/intel_lvds.c > @@ -41,6 +41,10 @@ > #include > > /* Private structure for the integrated LVDS support */ > +struct intel_lvds_connector { > + struct intel_connector base; > +}; > + > struct intel_lvds_encoder { > struct intel_encoder base; > > @@ -59,6 +63,11 @@ 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), > @@ -907,6 +916,7 @@ 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_encoder *intel_encoder; > + struct intel_lvds_connector *lvds_connector; > struct intel_connector *intel_connector; > struct drm_connector *connector; > struct drm_encoder *encoder; > @@ -942,8 +952,8 @@ bool intel_lvds_init(struct drm_device *dev) > if (!lvds_encoder) > 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; > } > @@ -954,6 +964,7 @@ bool intel_lvds_init(struct drm_device *dev) > > intel_encoder = &lvds_encoder->base; > encoder = &intel_encoder->base; > + intel_connector = &lvds_connector->base; > connector = &intel_connector->base; > drm_connector_init(dev, &intel_connector->base, &intel_lvds_connector_funcs, > DRM_MODE_CONNECTOR_LVDS); > @@ -1104,6 +1115,6 @@ failed: > drm_connector_cleanup(connector); > drm_encoder_cleanup(encoder); > kfree(lvds_encoder); > - kfree(intel_connector); > + kfree(lvds_connector); > return false; > } Reviewed-by: Jesse Barnes -- Jesse Barnes, Intel Open Source Technology Center