Skip to contentSkip to conversation

drm/radeon/kms: use active device to pick connector for encoder

PATCH New Dave Airlie 1 participant 2 messages Jan 29, 2010

Subsystems (2)
lore
Share & tools
lore

Dave Airlie

author maintainer
#0 lore raw

PATCH 1/2 drm/radeon/kms: use active device to pick connector for encoder

From: Dave Airlie <[email protected]>

On the W500 we have UNIPHY routed to both DVI and DP, this seems to always pick the DVI connector which means link training fails.

Switch to using active device to pick the connector, this seems like it should be safe from a code review, and it fixes things a bit more here.

---
 drivers/gpu/drm/radeon/radeon_encoders.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/gpu/drm/radeon/radeon_encoders.c +1 -1
index 82eb551..10746c9 100644
@@ -202,7 +202,7 @@ radeon_get_connector_for_encoder(struct drm_encoder *encoder)
 
 	list_for_each_entry(connector, &dev->mode_config.connector_list, head) {
 		radeon_connector = to_radeon_connector(connector);
-		if (radeon_encoder->devices & radeon_connector->devices)
+		if (radeon_encoder->active_device & radeon_connector->devices)
 			return connector;
 	}
 	return NULL;
Signature · 10 lines
1.6.5.2


------------------------------------------------------------------------------
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
--
author maintainer
#1 lore raw

PATCH 2/2 drm/kms/radeon: pick digitial encoders smarter. (v3)

From: Dave Airlie <[email protected]>

booting a Lenovo W500 with LVDS + DP outputs showed up a TODO we had on our list, to pick a correct digital encoder block. The LVTMA encoder requires the second digital encoder, all others can use any encoder at all.

This fixes the digital encoder selection logic to enable LVDS/DP combos to work okay.

V2: fix silly addition of connector dig_block and cleanup the other places in the code that pick the encoder.

V3: rename to dig_encoder and clean up further - also fix the picking algorithm.

tested on Lenovo W500 + desktop 3650 cards.

---
 drivers/gpu/drm/radeon/atombios_dp.c     |   23 ++---
 drivers/gpu/drm/radeon/radeon_encoders.c |  163 ++++++++++++++++-------------
 drivers/gpu/drm/radeon/radeon_mode.h     |    2 +-
 3 files changed, 99 insertions(+), 89 deletions(-)
drivers/gpu/drm/radeon/atombios_dp.c +8 -15
index 9c023d2..7106011 100644
@@ -596,21 +596,14 @@ void dp_link_train(struct drm_encoder *encoder,
 		return;
 	dig_connector = radeon_connector->con_priv;
 
-	if (ASIC_IS_DCE32(rdev)) {
-		if (dig->dig_block)
-			enc_id |= ATOM_DP_CONFIG_DIG2_ENCODER;
-		else
-			enc_id |= ATOM_DP_CONFIG_DIG1_ENCODER;
-		if (dig_connector->linkb)
-			enc_id |= ATOM_DP_CONFIG_LINK_B;
-		else
-			enc_id |= ATOM_DP_CONFIG_LINK_A;
-	} else {
-		if (dig_connector->linkb)
-			enc_id |= ATOM_DP_CONFIG_DIG2_ENCODER | ATOM_DP_CONFIG_LINK_B;
-		else
-			enc_id |= ATOM_DP_CONFIG_DIG1_ENCODER | ATOM_DP_CONFIG_LINK_A;
-	}
+	if (dig->dig_encoder)
+		enc_id |= ATOM_DP_CONFIG_DIG2_ENCODER;
+	else
+		enc_id |= ATOM_DP_CONFIG_DIG1_ENCODER;
+	if (dig_connector->linkb)
+		enc_id |= ATOM_DP_CONFIG_LINK_B;
+	else
+		enc_id |= ATOM_DP_CONFIG_LINK_A;
 
 	memset(link_configuration, 0, DP_LINK_CONFIGURATION_SIZE);
 	if (dig_connector->dp_clock == 270000)
drivers/gpu/drm/radeon/radeon_encoders.c +90 -73

238 lines not on this page · raw message

drivers/gpu/drm/radeon/radeon_mode.h +1 -1
index 96b851f..e81b2ae 100644
@@ -299,7 +299,7 @@ struct radeon_atom_ss {
 struct radeon_encoder_atom_dig {
 	/* atom dig */
 	bool coherent_mode;
-	int dig_block;
+	int dig_encoder; /* -1 disabled, 0 DIGA, 1 DIGB */
 	/* atom lvds */
 	uint32_t lvds_misc;
 	uint16_t panel_pwr_delay;
Signature · 10 lines
1.6.5.2


------------------------------------------------------------------------------
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
--