]>
Commit | Line | Data |
---|---|---|
d476d390 GKH |
1 | From a0ae5864d42b41c411368bd689462bf063c029c8 Mon Sep 17 00:00:00 2001 |
2 | From: Alex Deucher <alexdeucher@gmail.com> | |
3 | Date: Tue, 2 Nov 2010 05:26:48 +0000 | |
4 | Subject: drm/radeon/kms: don't disable shared encoders on pre-DCE3 display blocks | |
5 | ||
6 | From: Alex Deucher <alexdeucher@gmail.com> | |
7 | ||
8 | commit a0ae5864d42b41c411368bd689462bf063c029c8 upstream. | |
9 | ||
10 | The A/B links aren't independantly useable on these blocks so when | |
11 | we disable the encoders, make sure to only disable the encoder when | |
12 | there is no connector using it. | |
13 | ||
14 | Should fix: | |
15 | https://bugs.freedesktop.org/show_bug.cgi?id=18564 | |
16 | ||
17 | Signed-off-by: Alex Deucher <alexdeucher@gmail.com> | |
18 | Signed-off-by: Dave Airlie <airlied@redhat.com> | |
19 | Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> | |
20 | ||
21 | --- | |
22 | drivers/gpu/drm/radeon/radeon_encoders.c | 18 ++++++++++++++++++ | |
23 | 1 file changed, 18 insertions(+) | |
24 | ||
25 | --- a/drivers/gpu/drm/radeon/radeon_encoders.c | |
26 | +++ b/drivers/gpu/drm/radeon/radeon_encoders.c | |
27 | @@ -1547,6 +1547,23 @@ static void radeon_atom_encoder_disable( | |
28 | struct radeon_device *rdev = dev->dev_private; | |
29 | struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder); | |
30 | struct radeon_encoder_atom_dig *dig; | |
31 | + | |
32 | + /* check for pre-DCE3 cards with shared encoders; | |
33 | + * can't really use the links individually, so don't disable | |
34 | + * the encoder if it's in use by another connector | |
35 | + */ | |
36 | + if (!ASIC_IS_DCE3(rdev)) { | |
37 | + struct drm_encoder *other_encoder; | |
38 | + struct radeon_encoder *other_radeon_encoder; | |
39 | + | |
40 | + list_for_each_entry(other_encoder, &dev->mode_config.encoder_list, head) { | |
41 | + other_radeon_encoder = to_radeon_encoder(other_encoder); | |
42 | + if ((radeon_encoder->encoder_id == other_radeon_encoder->encoder_id) && | |
43 | + drm_helper_encoder_in_use(other_encoder)) | |
44 | + goto disable_done; | |
45 | + } | |
46 | + } | |
47 | + | |
48 | radeon_atom_encoder_dpms(encoder, DRM_MODE_DPMS_OFF); | |
49 | ||
50 | switch (radeon_encoder->encoder_id) { | |
51 | @@ -1586,6 +1603,7 @@ static void radeon_atom_encoder_disable( | |
52 | break; | |
53 | } | |
54 | ||
55 | +disable_done: | |
56 | if (radeon_encoder_is_digital(encoder)) { | |
57 | if (atombios_get_encoder_mode(encoder) == ATOM_ENCODER_MODE_HDMI) | |
58 | r600_hdmi_disable(encoder); |