Bug 25520

Summary: Enabling and disabling TV output kills VGA output with KMS and non-KMS
Product: xorg Reporter: Bob Ham <rah>
Component: Driver/RadeonAssignee: xf86-video-ati maintainers <xorg-driver-ati>
Status: RESOLVED INVALID QA Contact: Xorg Project Team <xorg-team>
Severity: major    
Priority: high    
Version: git   
Hardware: x86-64 (AMD64)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Attachments:
Description Flags
Xorg log for git master
none
Xorg configuration file for git master
none
dmesg output for git master
none
Xorg configuration file for 6.12.3
none
dmesg output for 6.12.3
none
Xorg log for drm-radeon-testing KMS
none
Xorg configuration file for drm-radeon-testing KMS
none
dmesg output for drm-radeon-testing KMS
none
Register dump of working state
none
Register dump of broken state
none
Log of which registers are modified in order to fix VGA output
none
properly disable the tv encoder when VGA is used.
none
ddx patch for ums
none
fix UMS
none
fix KMS
none
Xorg log for UMS with git DDX
none
Register dump of UMS working state
none
Register dump of UMS broken state none

Description Bob Ham 2009-12-08 08:20:59 UTC
Created attachment 31836 [details]
Xorg log for git master

I have two flat panels and a TV connected to my rv770.  Ordinarily, I use the two flat panels for X.  In order to display things on the TV, I have to disable one of the flat panel outputs with xrandr and enable to the TV output.  However, if I do this and then disable the TV output again, the flat panel will not work again.

The non-working panel says it is receiving an input signal but it is out of range and recommends that I set the resolution to the panel's optimum.  This panel is connected by a VGA connector.

This is evidently touching something deep as restarting X does not bring the panel output back from the dead; it comes alive but still reports a bad input signal.  Even stranger: when switching to the console in this state, the workingness of the monitors is reversed; the panel that is dead in X displays the console and the panel that is working in X is dead.

This happens with version 6.12.3 of the radeon DDX driver, and with git master (both kernel 2.6.32 without KMS.)
Comment 1 Bob Ham 2009-12-08 08:21:28 UTC
Created attachment 31837 [details]
Xorg configuration file for git master
Comment 2 Bob Ham 2009-12-08 08:21:57 UTC
Created attachment 31838 [details]
dmesg output for git master
Comment 3 Bob Ham 2009-12-08 08:25:10 UTC
The (1.2MB!) Xorg log for 6.12.3 is here: http://pkl.net/~node/misc/6.12.3-Xorg.0.log
Comment 4 Bob Ham 2009-12-08 08:25:48 UTC
Created attachment 31839 [details]
Xorg configuration file for 6.12.3
Comment 5 Bob Ham 2009-12-08 08:26:17 UTC
Created attachment 31840 [details]
dmesg output for 6.12.3
Comment 6 Bob Ham 2009-12-09 09:17:23 UTC
This also occurs with KMS enabled (kernel from drm-radeon-testing, commit d63ca9dcdfd39d8a0cbdf3a5861e81a558852e5f).  However, the workingness of the monitors is not switched when changing to the console.

Also worth noting that the TV output ("DIN") is listed as being disconnected and has no modes associated with it.
Comment 7 Bob Ham 2009-12-09 09:18:18 UTC
Created attachment 31886 [details]
Xorg log for drm-radeon-testing KMS
Comment 8 Bob Ham 2009-12-09 09:18:51 UTC
Created attachment 31887 [details]
Xorg configuration file for drm-radeon-testing KMS
Comment 9 Bob Ham 2009-12-09 09:19:22 UTC
Created attachment 31888 [details]
dmesg output for drm-radeon-testing KMS
Comment 10 Bob Ham 2009-12-09 14:22:43 UTC
From #radeon:

[17:38] <rah> Dec  9 16:59:22 myrtle kernel: [drm] 2: conflicting encoders switching off 9-pin DIN-1
[17:38] <rah> Dec  9 16:59:22 myrtle kernel: [drm] in favor of DVI-I-1
[17:41] <agd5f> rah: that dac drives both the analog portion of the DVI port and the TV connector
Comment 11 Bob Ham 2010-02-01 07:37:54 UTC
With latest drm-radeon-testing (commit b7ca68719ff3912915bf16547548d162c0d0c526) I get lots of errors like below while trying to switch the TV on.  Note that the TV will come on in NTSC mode, ignoring the "tv standard" property.  When changing the "tv standard" property while the display is on, the signal disappears and does not return.


Jan 31 12:29:14 myrtle kernel: [drm] 2: conflicting encoders switching off 9-pin DIN-1
Jan 31 12:29:14 myrtle kernel: [drm] in favor of DVI-I-1
Jan 31 12:29:14 myrtle kernel: [drm] 2: conflicting encoders switching off 9-pin DIN-1
Jan 31 12:29:14 myrtle kernel: [drm] in favor of DVI-I-1
Jan 31 12:29:14 myrtle kernel: [drm] 2: conflicting encoders switching off 9-pin DIN-1
Jan 31 12:29:14 myrtle kernel: [drm] in favor of DVI-I-1
Jan 31 12:29:14 myrtle kernel: [drm] 2: conflicting encoders switching off 9-pin DIN-1
Jan 31 12:29:14 myrtle kernel: [drm] in favor of DVI-I-1
Jan 31 12:29:14 myrtle kernel: executing set crtc timing
Jan 31 12:29:14 myrtle kernel: [drm] TV-11: set mode 1280x1024 2d
Jan 31 12:29:14 myrtle kernel: executing set crtc timing
Jan 31 12:29:14 myrtle kernel: [drm] TMDS-15: set mode 1920x1200 2e
Jan 31 12:29:14 myrtle kernel: [drm] 2: conflicting encoders switching off 9-pin DIN-1
Jan 31 12:29:14 myrtle kernel: [drm] in favor of DVI-I-1
Jan 31 12:29:14 myrtle kernel: [drm] 2: conflicting encoders switching off 9-pin DIN-1
Jan 31 12:29:14 myrtle kernel: [drm] in favor of DVI-I-1
Jan 31 12:29:14 myrtle kernel: [drm] 2: conflicting encoders switching off 9-pin DIN-1
Jan 31 12:29:14 myrtle kernel: [drm] in favor of DVI-I-1
Jan 31 12:29:14 myrtle kernel: [drm] 2: conflicting encoders switching off 9-pin DIN-1
Jan 31 12:29:14 myrtle kernel: [drm] in favor of DVI-I-1
Jan 31 12:29:14 myrtle kernel: [drm] 2: conflicting encoders switching off 9-pin DIN-1
Jan 31 12:29:14 myrtle kernel: [drm] in favor of DVI-I-1
Jan 31 12:29:14 myrtle kernel: [drm] 2: conflicting encoders switching off 9-pin DIN-1
Jan 31 12:29:14 myrtle kernel: [drm] in favor of DVI-I-1
Comment 12 Bob Ham 2010-04-12 08:36:50 UTC
Created attachment 34913 [details]
Register dump of working state
Comment 13 Bob Ham 2010-04-12 08:37:52 UTC
Created attachment 34914 [details]
Register dump of broken state
Comment 14 Bob Ham 2010-04-12 08:40:01 UTC
Created attachment 34915 [details]
Log of which registers are modified in order to fix VGA output
Comment 15 Bob Ham 2010-04-12 08:47:25 UTC
Using avivotool to find registers that differ between the working and broken states, I've managed to reliably get the VGA output to work again after turning off the TV output.

While setting all of the differing registers to their value from the working state, the VGA output starts working properly when register 0x4f4 is set (to value 0x0 from value 0x80000062.)  Setting this register alone does not fix the VGA output.  Also, the ordering in which the registers are set is significant; I have set the registers in reverse order and the VGA output is not fixed.

Attached are dumps of registers in the working and broken states and a log of the output of avivotool while fixing the VGA output.  The log shows which registers are set to which value and the order in which they are set.
Comment 16 Alex Deucher 2010-04-12 13:19:39 UTC
Created attachment 34925 [details] [review]
properly disable the tv encoder when VGA is used.

This patch should fix things.
Comment 17 Alex Deucher 2010-04-12 13:24:38 UTC
Created attachment 34926 [details] [review]
ddx patch for ums

This patch should fix UMS.
Comment 18 Alex Deucher 2010-04-12 13:32:35 UTC
Created attachment 34927 [details] [review]
fix UMS

updated ums patch.
Comment 19 Alex Deucher 2010-04-12 13:33:26 UTC
Created attachment 34928 [details] [review]
fix KMS

Updated KMS patch.
Comment 20 Bob Ham 2010-04-13 00:00:19 UTC
(In reply to comment #19)
> Created an attachment (id=34928) [details]
> fix KMS
> 
> Updated KMS patch.

Yes, this fixes the VGA output.

However, I would note that the VGA monitor displays a message that says the input signal is out of range, rather the monitor going to sleep (which is what happens when xrandr --off is run.)  Evidently there is a similar problem with the VGA output not being disabled properly when the TV output is enabled.
Comment 21 Bob Ham 2010-04-13 00:15:37 UTC
Created attachment 34958 [details]
Xorg log for UMS with git DDX
Comment 22 Bob Ham 2010-04-13 00:20:47 UTC
(In reply to comment #18)
> Created an attachment (id=34927) [details]
> fix UMS
> 
> updated ums patch.

This patch does not work; the VGA output is not enabled.

Also, with DDX from git (commit 878814aeab7031ff6169fcaf2be869b7595c8699,) using a vanilla 2.6.33 kernel, the xrandr property "tv_standard" no longer works, similarly to bug 26582.  This is a regression from 6.12.6 which works fine.

I've attached the X log.
Comment 23 Alex Deucher 2010-04-13 08:22:27 UTC
(In reply to comment #20)
> Yes, this fixes the VGA output.
> 

Good.  I'll push that upstream.

> However, I would note that the VGA monitor displays a message that says the
> input signal is out of range, rather the monitor going to sleep (which is what
> happens when xrandr --off is run.)  Evidently there is a similar problem with
> the VGA output not being disabled properly when the TV output is enabled.

There's only one DAC connected to both the DVI and TV connectors, so there's no way to turn off one connector without turning off the other.

(In reply to comment #22)
> 
> This patch does not work; the VGA output is not enabled.
> 

Should be fixed in 22a46dddd375b2b9399e12fdf168fa5292ff17a4
Comment 24 Bob Ham 2010-04-13 11:04:29 UTC
(In reply to comment #23)
> (In reply to comment #22)
> > 
> > This patch does not work; the VGA output is not enabled.
> > 
> 
> Should be fixed in 22a46dddd375b2b9399e12fdf168fa5292ff17a4

With DDX up to that commit, the PAL output is fixed but unfortunately, the VGA output isn't; it's still not enabled.
Comment 25 Alex Deucher 2010-04-13 11:06:49 UTC
(In reply to comment #24)
> With DDX up to that commit, the PAL output is fixed but unfortunately, the VGA
> output isn't; it's still not enabled.

You mean it's still screwed up after having used tv-out or something else?
Comment 26 Bob Ham 2010-04-13 12:48:54 UTC
Created attachment 34975 [details]
Register dump of UMS working state
Comment 27 Bob Ham 2010-04-13 12:49:30 UTC
Created attachment 34976 [details]
Register dump of UMS broken state
Comment 28 Bob Ham 2010-04-13 12:53:07 UTC
(In reply to comment #25)
> (In reply to comment #24)
> > With DDX up to that commit, the PAL output is fixed but unfortunately, the VGA
> > output isn't; it's still not enabled.
> 
> You mean it's still screwed up after having used tv-out or something else?

After having used tv-out.  To reiterate, this is what I'm doing: X starts with the DVI and VGA outputs enabled.  I disable the VGA output and enable the TV output.  I then disable the TV output and enable the VGA output.  X believes that the VGA display is enabled (the desktop adjusts itself to having more space) but the monitor just says "the input signal is out of range."

I've attached register dumps in the working state (after startup, before disabling the VGA output) and broken state (after disabling the TV output and trying to enable the VGA output.)
Comment 29 Adam Jackson 2018-06-12 19:09:23 UTC
Mass closure: This bug has been untouched for more than six years, and is not
obviously still valid. Please reopen this bug or file a new report if you continue to experience issues with current releases.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.