dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Alex Deucher <alexdeucher@gmail.com>
To: airlied@gmail.com, dri-devel@lists.freedesktop.org
Subject: [PATCH 05/18] drm/radeon/kms: adjust eDP handling (v2)
Date: Fri, 20 May 2011 04:34:18 -0400	[thread overview]
Message-ID: <1305880471-1472-5-git-send-email-alexdeucher@gmail.com> (raw)
In-Reply-To: <1305880471-1472-1-git-send-email-alexdeucher@gmail.com>

eDP is usually used as an LVDS replacement, so treat
it more like LVDS from the user perspective.

v2: encoder mode is always DP for eDP.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
---
 drivers/gpu/drm/radeon/radeon_connectors.c |   30 +++++++++++++++++++++++----
 drivers/gpu/drm/radeon/radeon_encoders.c   |    3 +-
 2 files changed, 27 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/radeon/radeon_connectors.c b/drivers/gpu/drm/radeon/radeon_connectors.c
index 5f45fa1..a7bdcc7 100644
--- a/drivers/gpu/drm/radeon/radeon_connectors.c
+++ b/drivers/gpu/drm/radeon/radeon_connectors.c
@@ -1314,7 +1314,6 @@ radeon_add_atom_connector(struct drm_device *dev,
 			connector->doublescan_allowed = false;
 		break;
 	case DRM_MODE_CONNECTOR_DisplayPort:
-	case DRM_MODE_CONNECTOR_eDP:
 		radeon_dig_connector = kzalloc(sizeof(struct radeon_connector_atom_dig), GFP_KERNEL);
 		if (!radeon_dig_connector)
 			goto failed;
@@ -1324,10 +1323,7 @@ radeon_add_atom_connector(struct drm_device *dev,
 		drm_connector_helper_add(&radeon_connector->base, &radeon_dp_connector_helper_funcs);
 		if (i2c_bus->valid) {
 			/* add DP i2c bus */
-			if (connector_type == DRM_MODE_CONNECTOR_eDP)
-				radeon_dig_connector->dp_i2c_bus = radeon_i2c_create_dp(dev, i2c_bus, "eDP-auxch");
-			else
-				radeon_dig_connector->dp_i2c_bus = radeon_i2c_create_dp(dev, i2c_bus, "DP-auxch");
+			radeon_dig_connector->dp_i2c_bus = radeon_i2c_create_dp(dev, i2c_bus, "DP-auxch");
 			if (!radeon_dig_connector->dp_i2c_bus)
 				DRM_ERROR("DP: Failed to assign dp ddc bus! Check dmesg for i2c errors.\n");
 			radeon_connector->ddc_bus = radeon_i2c_lookup(rdev, i2c_bus);
@@ -1353,6 +1349,30 @@ radeon_add_atom_connector(struct drm_device *dev,
 		/* in theory with a DP to VGA converter... */
 		connector->doublescan_allowed = false;
 		break;
+	case DRM_MODE_CONNECTOR_eDP:
+		radeon_dig_connector = kzalloc(sizeof(struct radeon_connector_atom_dig), GFP_KERNEL);
+		if (!radeon_dig_connector)
+			goto failed;
+		radeon_dig_connector->igp_lane_info = igp_lane_info;
+		radeon_connector->con_priv = radeon_dig_connector;
+		drm_connector_init(dev, &radeon_connector->base, &radeon_dp_connector_funcs, connector_type);
+		drm_connector_helper_add(&radeon_connector->base, &radeon_dp_connector_helper_funcs);
+		if (i2c_bus->valid) {
+			/* add DP i2c bus */
+			radeon_dig_connector->dp_i2c_bus = radeon_i2c_create_dp(dev, i2c_bus, "eDP-auxch");
+			if (!radeon_dig_connector->dp_i2c_bus)
+				DRM_ERROR("DP: Failed to assign dp ddc bus! Check dmesg for i2c errors.\n");
+			radeon_connector->ddc_bus = radeon_i2c_lookup(rdev, i2c_bus);
+			if (!radeon_connector->ddc_bus)
+				DRM_ERROR("DP: Failed to assign ddc bus! Check dmesg for i2c errors.\n");
+		}
+		drm_connector_attach_property(&radeon_connector->base,
+					      dev->mode_config.scaling_mode_property,
+					      DRM_MODE_SCALE_FULLSCREEN);
+		subpixel_order = SubPixelHorizontalRGB;
+		connector->interlace_allowed = false;
+		connector->doublescan_allowed = false;
+		break;
 	case DRM_MODE_CONNECTOR_SVIDEO:
 	case DRM_MODE_CONNECTOR_Composite:
 	case DRM_MODE_CONNECTOR_9PinDIN:
diff --git a/drivers/gpu/drm/radeon/radeon_encoders.c b/drivers/gpu/drm/radeon/radeon_encoders.c
index 4d66e24..49fcd60 100644
--- a/drivers/gpu/drm/radeon/radeon_encoders.c
+++ b/drivers/gpu/drm/radeon/radeon_encoders.c
@@ -668,7 +668,6 @@ atombios_get_encoder_mode(struct drm_encoder *encoder)
 		return ATOM_ENCODER_MODE_LVDS;
 		break;
 	case DRM_MODE_CONNECTOR_DisplayPort:
-	case DRM_MODE_CONNECTOR_eDP:
 		dig_connector = radeon_connector->con_priv;
 		if ((dig_connector->dp_sink_type == CONNECTOR_OBJECT_ID_DISPLAYPORT) ||
 		    (dig_connector->dp_sink_type == CONNECTOR_OBJECT_ID_eDP))
@@ -682,6 +681,8 @@ atombios_get_encoder_mode(struct drm_encoder *encoder)
 		} else
 			return ATOM_ENCODER_MODE_DVI;
 		break;
+	case DRM_MODE_CONNECTOR_eDP:
+		return ATOM_ENCODER_MODE_DP;
 	case DRM_MODE_CONNECTOR_DVIA:
 	case DRM_MODE_CONNECTOR_VGA:
 		return ATOM_ENCODER_MODE_CRT;
-- 
1.7.1.1

  parent reply	other threads:[~2011-05-20  8:34 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-20  8:34 [PATCH 01/18] drm/radeon/kms: DCE4.1 DIG encoders are fully routeable just like DCE3.2 Alex Deucher
2011-05-20  8:34 ` [PATCH 02/18] drm/radeon/kms: properly handle bpc >8 in atom command tables Alex Deucher
2011-05-20  8:34 ` [PATCH 03/18] drm/radeon/kms: spread spectrum fixes Alex Deucher
2011-05-20  8:34 ` [PATCH 04/18] drm/radeon/kms: fix up DP clock programming on DCE4/5 Alex Deucher
2011-05-20  8:34 ` Alex Deucher [this message]
2011-05-20  8:34 ` [PATCH 06/18] drm/radeon/kms: fix eDP panel power function Alex Deucher
2011-05-20  8:34 ` [PATCH 07/18] drm/radeon/kms: make sure eDP panel is on for modesetting Alex Deucher
2011-05-20  8:34 ` [PATCH 08/18] drm/radeon/kms: add some dp encoder/connector helper funcs Alex Deucher
2011-05-20  8:34 ` [PATCH 09/18] drm/radeon/kms: handle DP bridges Alex Deucher
2011-05-20  8:34 ` [PATCH 10/18] drm/radeon/kms: improve DP detect logic Alex Deucher
2011-05-20  8:34 ` [PATCH 11/18] drm/radeon/kms: improve aux error handling Alex Deucher
2011-05-20  8:34 ` [PATCH 12/18] drm/dp: add some new DP regs for DP 1.2 Alex Deucher
2011-05-20  8:34 ` [PATCH 13/18] drm/radeon/kms: atombios.h updates for DP panel mode Alex Deucher
2011-05-20  8:34 ` [PATCH 14/18] drm/radeon/kms/atom: add support for setting " Alex Deucher
2011-05-20  8:34 ` [PATCH 15/18] drm/radeon/kms: rewrite DP handling Alex Deucher
2011-05-20  8:34 ` [PATCH 16/18] drm/radeon/kms: simplify hotplug handler logic Alex Deucher
2011-05-20  8:34 ` [PATCH 17/18] drm/radeon/kms: bail early for eDP in hotplug callback Alex Deucher
2011-05-20  8:34 ` [PATCH 18/18] drm/radeon/kms: fixup eDP connector handling Alex Deucher

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=1305880471-1472-5-git-send-email-alexdeucher@gmail.com \
    --to=alexdeucher@gmail.com \
    --cc=airlied@gmail.com \
    --cc=dri-devel@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).