Bug 19439

Summary: randr dualhead not working with radeon 4850 (RV770)
Product: xorg Reporter: Florian Scandella <flo.scandella>
Component: Driver/RadeonAssignee: Luc Verhaegen <lverhaegen>
Status: RESOLVED FIXED QA Contact: Xorg Project Team <xorg-team>
Severity: normal    
Priority: medium    
Version: 7.4 (2008.09)   
Hardware: x86-64 (AMD64)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Attachments:
Description Flags
xorg.conf
none
Xorg.0.log
none
Xorg.0.log with xf86-video-ati
none
config with xf86-video-ati
none
verbose X log
none
xf86-video-ati registers
none
fglrx-registers
none
fglrx-registers after xf86-video-ati
none
startx -- -verbose 7 2>x.verbose.log
none
xorg.conf (exa,dri disabled) none

Description Florian Scandella 2009-01-07 05:38:26 UTC
hi,

i have tried to setup dualhead on my linux machine. the static xorg.conf configuration is not working (i've followed varius online examples). instead of putting the crt left of the tft monitor, the crt is configured to clone the tft.

i have also played with the xrandr utility. i was able to extend the screen to the second monitor (mode was set, could move windows, etc) but the output is always black. it's always the second monitor that is black, if i define the crt to be the primary monitor, the tft goes black.
Comment 1 Florian Scandella 2009-01-07 05:38:59 UTC
Created attachment 21745 [details]
xorg.conf
Comment 2 Florian Scandella 2009-01-07 05:39:31 UTC
Created attachment 21746 [details]
Xorg.0.log
Comment 3 Matthias Hopf 2009-01-07 11:18:31 UTC
Try to remove the
	Monitor "tft"
line from the Screen section. It seems that newer Xservers behave strangely if you add a Monitor reference there.
Comment 4 Florian Scandella 2009-01-08 06:06:50 UTC
thanks, but that did not help.
after testing this, i switched back to the fglrx driver and the second monitor stayed black (mode was set correctly,desktop was expandet) until reboot.

another thing i noticed, in spite of all the documentations on the web, i had to use 'Option "RightOf" "DVI-I_1/analog"' instead of 'Option "RightOf" "crt"' in the tft monitor section (main monitor) to disable cloning and enable desktop expansion. 'Option "LeftOf" "DVI-I_2/digital"' in the crt section did not help.
Comment 5 Matthias Hopf 2009-01-09 03:18:00 UTC
In that case your Xserver is probably too old. There was a bug related LeftOf/RightOf handling, but that had been solved a while ago (don't ask me about the exact version number, though).
Comment 6 Florian Scandella 2009-01-09 18:28:53 UTC
hmm ... i just tried the git master version of the x server (+libraries via gentoo overlay). no difference at all except that the colors are completely messed up (looks like blue/green is switched).
the second monitor won't come up and the problems with RightOf/LeftOf persists. if i remove the Monitor line in the Display section i always end up with a single monitor configuration.
for me, it looks like everything is set up correctly, but nothing is written to the scanout buffer of the second monitor (or ends up somewhere else). the problem with RightOf/LeftOf might be an xserver bug, but thats not important (in the worst case i have to write a script with xrandr commands) 

ps: i'm staying with the radeonhd driver for the time being (it's a much better user experience than fglrx, even without accel,xv an the second monitor).
Comment 7 Florian Scandella 2009-01-13 12:07:14 UTC
just a small update. after rebooting from windows xp to linux it worked once, but i couldn't reproduce it since.
Comment 8 Florian Scandella 2009-01-18 08:19:23 UTC
Created attachment 22084 [details]
Xorg.0.log with xf86-video-ati

same result with xf86-video-ati
Comment 9 Florian Scandella 2009-01-18 08:20:52 UTC
Created attachment 22085 [details]
config with xf86-video-ati

config used
Comment 10 Florian Scandella 2009-01-18 08:40:53 UTC
on X exit i get the error

mtrr: no MTRR for e0000000,10000000 found

maybe this is related?

cat /proc/mtrr while x is running:
reg00: base=0x000000000 (    0MB), size= 2048MB, count=1: write-back
reg01: base=0x080000000 ( 2048MB), size= 1024MB, count=1: write-back
reg02: base=0x0c0000000 ( 3072MB), size=  512MB, count=1: write-back
reg03: base=0x0dff00000 ( 3583MB), size=    1MB, count=1: uncachable
reg04: base=0x100000000 ( 4096MB), size=  512MB, count=1: write-back

Comment 11 Matthias Hopf 2009-01-19 10:10:21 UTC
Ok, so this is not driver dependent.

(In reply to comment #10)
> on X exit i get the error
> 
> mtrr: no MTRR for e0000000,10000000 found
> 
> maybe this is related?

Not really. A missing MTRR (when it should be there) would possibly reduce the driver's speed, but nothing like what you encountered.


Regarding the messed up colors - I'm unsure whether this is a general Xserver issue, or a problem with the gentoo build.
Comment 12 Florian Scandella 2009-01-20 10:45:37 UTC
it could be something both radeon and radeonhd are using ... like the atombios parser (although the mode gets set correctly) or shadowfb. fglrx did work, but it doesnt use randr. what confuses me are the messages:
(WW) RADEON(0): Option "DVI-1" is not used
(WW) RADEON(0): Option "DVI-0" is not used
and
(II) RADEON(0): Output DVI-0 has no monitor section
if you look at the config file, everything is there.

one more thing, whenn i switch back to console, or quit the x server, the second monitor gets an invalid mode (0hsync,0vsync) while before the console was cloned.

as a sidenote, i tried the r6xx-r7xx branch of radeonhd. no multihead, but xv was kind of working although everything was extremely slow (100% cpu when moving windows). i cant wait to try the fully accelerated driver :)

it could just as well be that my card is somehow different from the other radeons (MSI R4850-T2D512 v151).

lspci -vvxx

03:00.0 VGA compatible controller: ATI Technologies Inc RV770 [Radeon HD 4850] (prog-if 00 [VGA controller])
	Subsystem: Micro-Star International Co., Ltd. Device 1510
	Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
	Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
	Latency: 0, Cache Line Size: 32 bytes
	Interrupt: pin A routed to IRQ 16
	Region 0: Memory at e0000000 (64-bit, prefetchable) [size=256M]
	Region 2: Memory at fdce0000 (64-bit, non-prefetchable) [size=64K]
	Region 4: I/O ports at 8c00 [size=256]
	Expansion ROM at fdcc0000 [disabled] [size=128K]
	Capabilities: [50] Power Management version 3
		Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot-,D3cold-)
		Status: D0 PME-Enable- DSel=0 DScale=0 PME-
	Capabilities: [58] Express (v2) Legacy Endpoint, MSI 00
		DevCap:	MaxPayload 128 bytes, PhantFunc 0, Latency L0s <4us, L1 unlimited
			ExtTag+ AttnBtn- AttnInd- PwrInd- RBE+ FLReset-
		DevCtl:	Report errors: Correctable- Non-Fatal- Fatal- Unsupported-
			RlxdOrd+ ExtTag- PhantFunc- AuxPwr- NoSnoop+
			MaxPayload 128 bytes, MaxReadReq 128 bytes
		DevSta:	CorrErr- UncorrErr- FatalErr- UnsuppReq- AuxPwr- TransPend-
		LnkCap:	Port #0, Speed 2.5GT/s, Width x16, ASPM L0s L1, Latency L0 <64ns, L1 <1us
			ClockPM- Suprise- LLActRep- BwNot-
		LnkCtl:	ASPM Disabled; RCB 64 bytes Disabled- Retrain- CommClk+
			ExtSynch- ClockPM- AutWidDis- BWInt- AutBWInt-
		LnkSta:	Speed 2.5GT/s, Width x16, TrErr- Train- SlotClk+ DLActive- BWMgmt- ABWMgmt-
		DevCap2: Completion Timeout: Not Supported, TimeoutDis-
		DevCtl2: Completion Timeout: 50us to 50ms, TimeoutDis-
		LnkCtl2: Target Link Speed: 2.5GT/s, EnterCompliance- SpeedDis-, Selectable De-emphasis: -6dB
			 Transmit Margin: Normal Operating Range, EnterModifiedCompliance- ComplianceSOS-
			 Compliance De-emphasis: -6dB
		LnkSta2: Current De-emphasis Level: -6dB
	Capabilities: [a0] Message Signalled Interrupts: Mask- 64bit+ Count=1/1 Enable-
		Address: 0000000000000000  Data: 0000
	Capabilities: [100] Vendor Specific Information <?>
00: 02 10 42 94 07 00 10 00 00 00 00 03 08 00 80 00
10: 0c 00 00 e0 00 00 00 00 04 00 ce fd 00 00 00 00
20: 01 8c 00 00 00 00 00 00 00 00 00 00 62 14 10 15
30: 00 00 cc fd 50 00 00 00 00 00 00 00 07 01 00 00


thanks very much for looking into this. just tell me what i can do, to help resolving this issue.
Comment 13 Florian Scandella 2009-01-28 08:15:00 UTC
Created attachment 22309 [details]
verbose X log

driver: radeonhd r6xx-r7xx branch, dri disabled, exa disabled

startx -- -verbose 8 2>x.verbose.log
Comment 14 Florian Scandella 2009-01-30 05:46:41 UTC
i resolved the issue with my monitor configurations being ignored. i didn't realize i had to put the "Monitor-" in front of the output name.
now everything is working as expected, except the main problem ... the second output displays a black screen.

to summarize:

*) affects xf86-video-radeonhd, xf86-video-at  .. stable and git versions
*) affects server 1.5.3, git master
*) primary monitor always works, secondary is black (eg. change output order)
*) modesetting works (both monitors have the right display mode and frequencies)
*) xrandr displays the right configuration, desktop is expanded
*) if i take a screenshot, i get the contents of the whole expanded desktop.
 

by the way, if i put a Option "Ignore" "true" in an monitor section the server crashes (i only tried this with radeonhd, assert() in the driver).
Comment 15 Florian Scandella 2009-02-10 07:22:00 UTC
quick update .. if i use fglrx after using xf86-driver-radeon it doesn't work either. i have to reboot.

adding register dumps of radeon driver and fglrx driver (radeontool regmatch '*')
Comment 16 Florian Scandella 2009-02-10 07:23:39 UTC
Created attachment 22752 [details]
xf86-video-ati registers

xf86-video-ati r6xx-r7xx-support branch, dri enabled, exa enabled registers
Comment 17 Florian Scandella 2009-02-10 07:24:36 UTC
Created attachment 22753 [details]
fglrx-registers

fglrx driver, same monitor setup (working)
Comment 18 Florian Scandella 2009-02-10 07:33:58 UTC
Created attachment 22754 [details]
fglrx-registers after xf86-video-ati

fglrx after running xf86-video-ati once (not working)
Comment 19 Florian Scandella 2009-02-13 07:00:11 UTC
Created attachment 22899 [details]
startx -- -verbose 7 2>x.verbose.log

xf86-video-ati (master + r7xx-r6xx-support)
Comment 20 Florian Scandella 2009-02-13 07:01:36 UTC
Created attachment 22900 [details]
xorg.conf (exa,dri disabled)
Comment 21 Florian Scandella 2009-02-18 09:51:23 UTC
one of these commits fixed my problem too ... so it was a driver bug after all. anyway, thanks for fixing this :)



commit 1a237a40958c006c56b80850bd77b2ac6c17e030
Author: Alex Deucher <alexdeucher@gmail.com>
Date:   Wed Feb 18 11:46:20 2009 -0500

    ATOM: reset crtc initialized flag on CloseScreen()
    
    additional fix needed for bug 16781


commit 9a108f0a0b7203458673ce6221e747a166d39617
Author: Alex Deucher <alexdeucher@gmail.com>
Date:   Tue Feb 17 19:52:27 2009 -0500

    ATOM: don't unblank uninitialized crtcs
    
    If the crtc timing isn't setup, you might get stuck in a loop
    in the BlankCRTC command table
    
    fixes bug 16781

commit 31bd6d28dd35021e0e706d4f094989deb856c26a
Author: Alex Deucher <alexdeucher@gmail.com>
Date:   Tue Feb 17 11:24:02 2009 -0500

    Fix crtc routing on pre-DCE3.2 systems
    
    This should fix peterz and bug 20074

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.