All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@intel.com>
To: intel-gfx@lists.freedesktop.org, daniel@ffwll.ch
Cc: jani.nikula@intel.com
Subject: [PATCH 02/10] drm/i915/lvds: Introduce intel_lvds_connector
Date: Fri, 19 Oct 2012 14:51:44 +0300	[thread overview]
Message-ID: <90c212fbd8946ec0857492f2391f9bcdb08e6084.1350644022.git.jani.nikula@intel.com> (raw)
In-Reply-To: <cover.1350644022.git.jani.nikula@intel.com>
In-Reply-To: <cover.1350644022.git.jani.nikula@intel.com>

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: Jani Nikula <jani.nikula@intel.com>
---
 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 <linux/acpi.h>
 
 /* 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;
 }
-- 
1.7.9.5

  parent reply	other threads:[~2012-10-19 11:47 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-19 11:51 [PATCH 00/10] drm/i915: LVDS/eDP panel, EDID and fixed mode refactoring Jani Nikula
2012-10-19 11:51 ` [PATCH 01/10] drm/i915/lvds: Rename intel_lvds to intel_lvds_encoder Jani Nikula
2012-10-19 16:46   ` Jesse Barnes
2012-10-19 11:51 ` Jani Nikula [this message]
2012-10-19 16:47   ` [PATCH 02/10] drm/i915/lvds: Introduce intel_lvds_connector Jesse Barnes
2012-10-19 11:51 ` [PATCH 03/10] drm/i915/lvds: Move the acpi_lid_notifier from drm_i915_private to the connector Jani Nikula
2012-10-19 16:48   ` Jesse Barnes
2012-10-19 11:51 ` [PATCH 04/10] drm/i915: Backlight setup requires connector so pass it as parameter Jani Nikula
2012-10-19 16:54   ` Jesse Barnes
2012-10-19 11:51 ` [PATCH 05/10] drm/i915/lvds: Move some connector specific info across from the encoder Jani Nikula
2012-10-19 16:55   ` Jesse Barnes
2012-10-19 11:51 ` [PATCH 06/10] drm/i915/dp: Initialize eDP fixed mode in intel_dp_init Jani Nikula
2012-10-19 17:00   ` Jesse Barnes
2012-10-19 11:51 ` [PATCH 07/10] drm/i915: Create generic intel_panel for LVDS and eDP Jani Nikula
2012-10-19 17:04   ` Jesse Barnes
2012-10-19 11:51 ` [PATCH 08/10] drm/i915: Move the fixed mode to intel_panel Jani Nikula
2012-10-19 17:09   ` Jesse Barnes
2012-10-19 11:51 ` [PATCH 09/10] drm/i915: Do not free the passed EDID in intel_connector_update_modes() Jani Nikula
2012-10-19 17:10   ` Jesse Barnes
2012-10-19 11:51 ` [PATCH 10/10] drm/i915: Move cached EDID to intel_connector Jani Nikula
2012-10-19 17:13   ` Jesse Barnes
2012-10-19 17:58 ` [PATCH 00/10] drm/i915: LVDS/eDP panel, EDID and fixed mode refactoring Chris Wilson
2012-10-22 17:37   ` Daniel Vetter
  -- strict thread matches above, loose matches on Subject: below --
2011-04-22  9:19 Share common logic between eDP and LVDS in panel Chris Wilson
2011-04-22  9:19 ` [PATCH 02/10] drm/i915/lvds: Introduce intel_lvds_connector Chris Wilson
2011-04-22 16:18   ` Jesse Barnes
2011-04-22 17:50   ` Ben Widawsky
2011-04-22 18:07     ` Chris Wilson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=90c212fbd8946ec0857492f2391f9bcdb08e6084.1350644022.git.jani.nikula@intel.com \
    --to=jani.nikula@intel.com \
    --cc=daniel@ffwll.ch \
    --cc=intel-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.