[PATCH] [6/223] drm/radeon/kms: don't disable shared encoders on pre-DCE3 display blocks

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Andi Kleen
Date: Sunday, December 12, 2010 - 4:45 pm

2.6.35-longterm review patch.  If anyone has any objections, please let me know.

------------------
From: Alex Deucher <alexdeucher@gmail.com>

commit a0ae5864d42b41c411368bd689462bf063c029c8 upstream.

The A/B links aren't independantly useable on these blocks so when
we disable the encoders, make sure to only disable the encoder when
there is no connector using it.

Should fix:
https://bugs.freedesktop.org/show_bug.cgi?id=18564

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Andi Kleen <ak@linux.intel.com>

---
 drivers/gpu/drm/radeon/radeon_encoders.c |   18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

Index: linux/drivers/gpu/drm/radeon/radeon_encoders.c
===================================================================
--- linux.orig/drivers/gpu/drm/radeon/radeon_encoders.c
+++ linux/drivers/gpu/drm/radeon/radeon_encoders.c
@@ -1545,6 +1545,23 @@ static void radeon_atom_encoder_disable(
 	struct radeon_device *rdev = dev->dev_private;
 	struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder);
 	struct radeon_encoder_atom_dig *dig;
+
+	/* check for pre-DCE3 cards with shared encoders;
+	 * can't really use the links individually, so don't disable
+	 * the encoder if it's in use by another connector
+	 */
+	if (!ASIC_IS_DCE3(rdev)) {
+		struct drm_encoder *other_encoder;
+		struct radeon_encoder *other_radeon_encoder;
+
+		list_for_each_entry(other_encoder, &dev->mode_config.encoder_list, head) {
+			other_radeon_encoder = to_radeon_encoder(other_encoder);
+			if ((radeon_encoder->encoder_id == other_radeon_encoder->encoder_id) &&
+			    drm_helper_encoder_in_use(other_encoder))
+				goto disable_done;
+		}
+	}
+
 	radeon_atom_encoder_dpms(encoder, DRM_MODE_DPMS_OFF);
 
 	switch (radeon_encoder->encoder_id) {
@@ -1584,6 +1601,7 @@ static void radeon_atom_encoder_disable(
 		break;
 	}
 
+disable_done:
 	if (radeon_encoder_is_digital(encoder)) {
 		if (atombios_get_encoder_mode(encoder) == ATOM_ENCODER_MODE_HDMI)
 			r600_hdmi_disable(encoder);
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] [0/223] 2.6.35.10 longterm review, Andi Kleen, (Sun Dec 12, 4:44 pm)
[PATCH] [6/223] drm/radeon/kms: don't disable shared encod ..., Andi Kleen, (Sun Dec 12, 4:45 pm)
[PATCH] [10/223] cfg80211: fix BSS double-unlinking, Andi Kleen, (Sun Dec 12, 4:45 pm)
[PATCH] [11/223] cfg80211: fix locking, Andi Kleen, (Sun Dec 12, 4:45 pm)
[PATCH] [42/223] NFSv4: Fix open recovery, Andi Kleen, (Sun Dec 12, 4:45 pm)
Re: [PATCH] [0/223] 2.6.35.10 longterm review, Randy Dunlap, (Thu Dec 16, 10:42 am)