Bug 19960

Summary: radeon{,hd} driver can't run a LCD at certain resolutions/timings over DVI
Product: xorg Reporter: Joshua Roys <roysjosh>
Component: Driver/RadeonAssignee: xf86-video-ati maintainers <xorg-driver-ati>
Status: RESOLVED INVALID QA Contact: Xorg Project Team <xorg-team>
Severity: normal    
Priority: medium CC: emme, hyc, leifer
Version: 7.4 (2008.09)   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments:
Description Flags
a Xorg log from yesterday
none
1920x1080 gdm login screen (and 1280x960 in gnome)
none
Xorg.0.log from driver 6.9.0 where external DVI display works
none
Xorg.0.log from driver 6.10.99 git where external DVI display flickers to black
none
diff from Xorg.0.log dated 2009-02-05
none
things I recently updated
none
xorg log under 2.6.29.6-217.2.16.fc11.x86_64
none
xorg log under 2.6.30.5-43.fc11.x86_64
none
dmesg under 2.6.32-rc1 with drm-next, git master mesa/drm/ddx
none
xorg log under 2.6.32-rc1 with drm-next
none
xorg log under 2.6.30.8-64.fc11.x86_64, intel IGP
none
avivotool regs all 1920x1080 in UMS ctl-alt-f2 terminal (good)
none
avivotool regs all 1920x1080 in UMS in X (bad)
none
use frac fb divs
none
possible fix
none
xorg log from latest git, no change
none
trying again. xorg log from latest git, nomodeset, no change
none
photo of desktop display corruption with latest git, nomodeset
none
xorg log with logverbose=9
none
photo of desktop display corruption with latest git, nomodeset, after running xrandr --output DVI-0 --set coherent_mode 0 none

Description Joshua Roys 2009-02-05 04:01:49 UTC
Created attachment 22604 [details] [review]
a Xorg log from yesterday

I'm running F10 x86_64 with:

01:05.0 VGA compatible controller: ATI Technologies Inc Radeon HD 3200 Graphics
xorg-x11-server-Xorg-1.5.3-6.fc10.x86_64
xorg-x11-drv-radeonhd-1.2.4-1.1.20081212git.fc10.x86_64
xorg-x11-drv-ati-6.9.0-63.fc10.x86_64

Motherboard is ASUS M3A78-EM.  In the manual it says:  "Supports DVI with max. resolution up to 2560 x 1600 @60Hz"
Monitor is ASUS VH226H.  In its manual it says:  "1920 x 1080. Horiz: 67.50KHz, Vert: 60.0Hz, Pixel: 148.50MHz"

The drivers seem to see the correct ModeLine...
(II) RADEON(0): Modeline "1920x1080"x60.0  148.50  1920 2008 2052 2200  1080 1084 1089 1125 +hsync +vsync (67.5 kHz)
... but, running at that resolution produces horrible horizontal flickering lines.  The monitor blacks out rather frequently.  I have tried this monitor on a XP computer and it works fine.  I have tried a 17" running at 1440x900 on my computer and it works fine.  I have tried both the radeon and radeonhd driver.

I don't have a xorg.conf (at least, when I want the flickering; right now I force it to a mode that works).

I'll attach a Xorg.0.log using the radeon driver.  In this particular log I am forcing the display to 1024x768@75.  The display is currently running at 1280x960@60.  A few other modes work as well, but the majority have flickering.

Some sites I think are related:
https://bugs.freedesktop.org/show_bug.cgi?id=8790
http://www.hardforum.com/showthread.php?t=1286375
http://www.avforums.com/forums/lcd-televisions/728169-sony-1080p-horizontal-flicker.html

Thanks for your time.
Comment 1 Joshua Roys 2009-02-05 04:13:30 UTC
This could be the same or similar as...
https://bugs.freedesktop.org/show_bug.cgi?id=2859
https://bugs.freedesktop.org/show_bug.cgi?id=15175
https://bugs.freedesktop.org/show_bug.cgi?id=18349

Sorry if this is just more noise.  I'll be glad to do any testing necessary to fix this.  I kind of want to use my monitor at 1920x1080!
Comment 2 Alex Deucher 2009-02-05 06:53:14 UTC
Can you attach your log when running the problematic 1920x1080 mode?
Comment 3 Joshua Roys 2009-02-05 09:33:05 UTC
Created attachment 22618 [details] [review]
1920x1080 gdm login screen (and 1280x960 in gnome)

Moved xorg.conf, logged out.  GDM login screen has horizontal lines running at 1920x1080.  Log back in and gnome settings take over and set monitor to a working mode.
Comment 4 Alex Deucher 2009-02-10 16:36:05 UTC
Can you try some other modelines?

Modeline "1920x1080_60.00"  173.00  1920 2048 2248 2576  1080 1083 1088 1120 -hsync +vsync

Modeline "1920x1080R"  138.50  1920 1968 2000 2080  1080 1083 1088 1111 +hsync -vsync

ModeLine "ATSC-1080-60p" 148.5 1920 1960 2016 2200 1080 1082 1088 1125
Comment 5 Leif Gruenwoldt 2009-02-11 10:00:08 UTC
I have this same issue. For me it is a regression in driver version 6.10 that worked fine in 6.9. Rolling back fixes the issue for me.

Building from latest git still has issue.

Cross referencing my bug filed on redhat:
https://bugzilla.redhat.com/show_bug.cgi?id=484692
Comment 6 Alex Deucher 2009-02-11 10:34:11 UTC
(In reply to comment #5)
> I have this same issue. For me it is a regression in driver version 6.10 that
> worked fine in 6.9. Rolling back fixes the issue for me.
> 
> Building from latest git still has issue.

Can you attach logs from git and 6.9.0?
Comment 7 Leif Gruenwoldt 2009-02-11 11:07:59 UTC
Created attachment 22831 [details]
Xorg.0.log from driver 6.9.0 where external DVI display works
Comment 8 Leif Gruenwoldt 2009-02-11 11:09:06 UTC
Created attachment 22832 [details]
 Xorg.0.log from driver 6.10.99 git where external DVI display flickers to black
Comment 9 Joshua Roys 2009-02-19 21:31:08 UTC
(In reply to comment #4)
> Can you try some other modelines?
> 
> Modeline "1920x1080_60.00"  173.00  1920 2048 2248 2576  1080 1083 1088 1120
> -hsync +vsync
> 
> Modeline "1920x1080R"  138.50  1920 1968 2000 2080  1080 1083 1088 1111 +hsync
> -vsync
> 
> ModeLine "ATSC-1080-60p" 148.5 1920 1960 2016 2200 1080 1082 1088 1125
> 

Those modelines don't seem to change anything.  I checked the log, and it seems to be using them.

Here's a bit from the ATSC-1080-60p ModeLine:

(II) RADEON(0): Modeline "ATSC-1080-60p"x60.0  148.50  1920 1960 2016 2200  1080 1082 1088 1125 (67.5 kHz)
...
(II) RADEON(0): Using user preference for initial modes
(II) RADEON(0): Output DVI-0 using initial mode ATSC-1080-60p
...
Mode 1920x1080 - 2200 1125 0
...
freq: 148500000
best_freq: 148503704
best_feedback_div: 560
best_ref_div: 9
best_post_div: 6
(II) RADEON(0): crtc(0) Clock: mode 148500, PLL 148500
(II) RADEON(0): crtc(0) PLL  : refdiv 9, fbdiv 0x230(560), pdiv 6

Also, downgrading to xorg-x11-drv-ati-6.9.0-63.fc10.x86_64.rpm didn't fix anything for me.
Comment 10 Joshua Roys 2009-03-22 15:22:33 UTC
I just updated to 6.12.1 and it runs at 1920x1080 - and it looks amazing.  Thanks for whatever you fixed : )  It is greatly appreciated.
Comment 11 Joshua Roys 2009-03-22 15:26:24 UTC
Created attachment 24133 [details] [review]
diff from Xorg.0.log dated 2009-02-05

Attached is the diff from the 2009-02-05 attachment to the working Xorg.0.log, in case you're curious.
Comment 12 Joshua Roys 2009-09-14 17:57:05 UTC
I just updated to the latest f11, rebooted, and this problem is back.  The update list is attached below.  I suspect libdrm; I rebooted into a previously working kernel and the issue persisted.  The only two obviously graphics-related updates were libdrm and the kernel.  And Xorg, I suppose.

I'll attach the xorg.log and maybe dmesg too.

Currently on: 2.6.29.6-217.2.16.fc11.x86_64 (used to work)
Also tried: 2.6.30.5-43 (also bad)

Currently installed packages:
kernel-2.6.29.6-217.2.3.fc11.x86_64
kernel-2.6.29.6-217.2.16.fc11.x86_64
kernel-2.6.30.5-43.fc11.x86_64
libdrm-2.4.11-2.fc11.x86_64
mesa-dri-drivers-7.6-0.1.fc11.x86_64
xorg-x11-drv-ati-6.12.2-14.fc11.x86_64 (the one from base f11 unless I'm mistaken?  it's worked perfectly until now)
xorg-x11-server-Xorg-1.6.3-4.fc11.x86_64
Comment 13 Joshua Roys 2009-09-14 17:57:49 UTC
Created attachment 29545 [details]
things I recently updated
Comment 14 Joshua Roys 2009-09-14 17:58:55 UTC
Created attachment 29546 [details]
xorg log under 2.6.29.6-217.2.16.fc11.x86_64
Comment 15 Joshua Roys 2009-09-14 17:59:17 UTC
Created attachment 29547 [details]
xorg log under 2.6.30.5-43.fc11.x86_64
Comment 16 Alex Deucher 2009-09-15 06:51:16 UTC
Does it work again if you disable KMS (boot with nomodeset or radeon.modeset=0 on the kernel command line in grub)?
Comment 17 Joshua Roys 2009-09-15 15:06:13 UTC
Nope, problem persists.

Linux version 2.6.30.5-43.fc11.x86_64 (mockbuild@xenbuilder4.fedora.phx.redhat.com) (gcc version 4.4.1 20090725 (Red Hat 4.4.1-2) (GCC) ) #1 SMP Thu Aug 27 21:39:52 EDT 2009
Command line: ro root=UUID=62cd4638-14b7-4617-b758-5e07df19678d debug nomodeset
Comment 18 Joshua Roys 2009-09-15 18:24:14 UTC
Just out of curiosity, I reverted to previous versions and it still persists.  I'm really stumped.

(I installed f11 with the update repo enabled and got the below version of mesa, the rest I reverted to what was installed originally too, which happened to be dist-f11)

[root@yrael ~]# uname -r ; rpm -qa kernel mesa\* libXext xorg-x11-server\* xorg-x11-drv-ati | sort
2.6.29.6-217.2.3.fc11.x86_64
kernel-2.6.29.6-217.2.16.fc11.x86_64
kernel-2.6.29.6-217.2.3.fc11.x86_64
kernel-2.6.30.5-43.fc11.x86_64
libXext-1.0.99.1-2.fc11.x86_64
mesa-dri-drivers-7.6-0.1.fc11.x86_64
mesa-libGL-7.6-0.1.fc11.x86_64
mesa-libGLU-7.6-0.1.fc11.x86_64
xorg-x11-drv-ati-6.12.2-14.fc11.x86_64
xorg-x11-server-common-1.6.1.901-1.fc11.x86_64
xorg-x11-server-utils-7.4-7.fc11.x86_64
xorg-x11-server-Xorg-1.6.1.901-1.fc11.x86_64

.....

And I just installed git master of libdrm and xf86-video-ati and the problem still persists.  GAH.  As I have time I'll continue to install stuff according to http://www.x.org/wiki/radeonBuildHowTo and see what happens - maybe I'll just jump to full KMS...
Comment 19 Joshua Roys 2009-09-20 08:02:41 UTC
http://roysjosh.googlepages.com/mov00929.avi

a 9MB video of the screen flickering to black.
Comment 20 Alex Deucher 2009-09-20 22:26:09 UTC
Does:
Option "DisplayPriority" "HIGH"
in the device section of your xorg config help when you disable KMS?
Comment 21 Joshua Roys 2009-09-22 18:45:57 UTC
Nope.
Comment 22 Joshua Roys 2009-09-30 14:27:11 UTC
Created attachment 29957 [details]
dmesg under 2.6.32-rc1 with drm-next, git master mesa/drm/ddx

# glxinfo | grep render
do_wait: drmWaitVBlank returned -1, IRQs don't seem to be working correctly.
Try adjusting the vblank_mode configuration parameter.
direct rendering: Yes
OpenGL renderer string: Mesa DRI R600 (RS780 9610) 20090101  TCL DRI2

I'm using 1280x1024 right now and it's working fine - just not 1920x1080, 1600x1200, 1680x1050, 1024x768 (not nearly as many lines/flickering), 800x600 (again, less lines than 1024x768).

works: 1280x1024, 1440x900, 1280x960, 1152x864.

there were a few I didn't try.  I'll attach the Xorg log next.
Comment 23 Joshua Roys 2009-09-30 14:29:53 UTC
Created attachment 29958 [details]
xorg log under 2.6.32-rc1 with drm-next

I'm curious about the line near the end of this section...

(II) RADEON(0): #6: hsize: 1920  vsize 1080  refresh: 60  vid: 49361
(II) RADEON(0): Supported detailed timing:
(II) RADEON(0): clock: 148.5 MHz   Image Size:  477 x 268 mm
(II) RADEON(0): h_active: 1920  h_sync: 2008  h_sync_end 2052 h_blank_end 2200 h_border: 0
(II) RADEON(0): v_active: 1080  v_sync: 1084  v_sync_end 1089 v_blanking: 1125 v_border: 0
(II) RADEON(0): Ranges: V min: 50 V max: 76 Hz, H min: 31 H max: 83 kHz, PixClock max 170 MHz
(II) RADEON(0): Monitor name: VH226
(II) RADEON(0): Serial No: 8BLMQS013087
(II) RADEON(0): EDID (in hex):
(II) RADEON(0):         00ffffffffffff000469f22201010101
(II) RADEON(0):         3012010380301b78eec4f6a3574a9c23
(II) RADEON(0):         114f54bfef00714f818081409500a940
(II) RADEON(0):         b300d1c00101023a801871382d40582c
(II) RADEON(0):         4500dd0c1100001e000000fd00324c1f
(II) RADEON(0):         5311000a202020202020000000fc0056
(II) RADEON(0):         483232360a20202020202020000000ff
(II) RADEON(0):         0038424c4d51533031333038370a0001
(II) RADEON(0): Not using mode "1920x1080" (bad mode clock/interlace/doublescan)
(II) RADEON(0): Printing probed modes for output DVI-0
(II) RADEON(0): Modeline "1920x1080"x60.0  148.50  1920 2008 2052 2200  1080 1084 1089 1125 +hsync +vsync (67.5 kHz)

Not using mode "1920x1080" (...) ????
Comment 24 Martin Emrich 2009-10-01 02:41:04 UTC
Hi!

I just stumbled upon this bug, and it looks similar to my problem (http://bugs.freedesktop.org/show_bug.cgi?id=20222), especially the video (I also have the blackouts, but only occational red lines flashing instead of your big white lines). Could be related...

Ciao

Martin
Comment 25 Joshua Roys 2009-10-01 14:57:25 UTC
I borrowed a HDMI cable and another DVI cable - same result with both: nothing new.  Also, the BIOS splash screen displays fine, and the OSD says it's running at 1920x1080 without flickering.
Comment 26 Joshua Roys 2009-10-06 04:44:49 UTC
Created attachment 30109 [details]
xorg log under 2.6.30.8-64.fc11.x86_64, intel IGP

I brought my monitor in to work to test it on some machines here...

00:02.0 VGA compatible controller [0300]: Intel Corporation 4 Series Chipset Integrated Graphics Controller [8086:2e22] (rev 03) (prog-if 00 [VGA controller])

No flickering over DVI at 1920x1080.
Comment 27 Alex Deucher 2009-10-21 13:39:28 UTC
can you try with ati from git master?  Specifically commit 66b194a78c470cb3978f310828dd96c3f3e96944.
Comment 28 Joshua Roys 2009-10-21 15:15:01 UTC
Both the ddx and kernel commits make the flickering worse.

I tried the kernel one first, since I had everything at master (as of a few days ago).  Then I reverted all my rpms to f11 ones and rebuilt -ati from master and rebooted into a f11 kernel.

Now all modes have flickering :(

Looking at bug 21857, is there anything I could run/do to provide some additional debug info?

Thanks.
Comment 29 Alex Deucher 2009-10-21 15:29:24 UTC
You might try setting different pll flags.  Some monitors don't like certain pll combinations.  In atombios_crtc_set_pll() in atombios_crtc.c try setting pll_flags to each of the following:
RADEON_PLL_PREFER_LOW_REF_DIV
RADEON_PLL_PREFER_HIGH_REF_DIV
RADEON_PLL_PREFER_LOW_FB_DIV
RADEON_PLL_PREFER_HIGH_FB_DIV
RADEON_PLL_PREFER_LOW_POST_DIV
RADEON_PLL_PREFER_HIGH_POST_DIV
RADEON_PLL_USE_FRAC_FB_DIV
RADEON_PLL_PREFER_CLOSEST_LOWER
before calling RADEONComputePLL() and see if any of them help.
Comment 30 Joshua Roys 2009-11-08 07:23:23 UTC
Created attachment 31046 [details]
avivotool regs all 1920x1080 in UMS ctl-alt-f2 terminal (good)

Maybe these will help.  Latest xf86-video-ati (and avivotool) from git.
Comment 31 Joshua Roys 2009-11-08 07:24:11 UTC
Created attachment 31047 [details]
avivotool regs all 1920x1080 in UMS in X (bad)

evil lines.
Comment 32 Howard Chu 2009-11-08 12:15:04 UTC
This sounds pretty similar to the problems I'm having, trying to get 1920x1200@60 working on my laptop with HD3450. The screen looks OK on bootup, and looks perfect in the GRUB menu. When the kernel loads (2.6.32-rc6) I start to see horizontal streaks across the text, and after the text scrolls down to about half of the screen it goes black.

If I then load the radeon module with modeset=1 and load fbcon, the console looks good. But if I fill the console with a lot of colors, the streaking can occur and it will just go black as well. (Try running vlc to play a movie in text mode.)

If I startx, I see the mouse cursor for a few seconds as things initialize, and sometimes I get a glimpse of the desktop before the screen goes black. Using xrandr I can sometimes set the screen to 1920x1200@50 and see the display, but again it's got lots of horizontal streaks across it, and other display content will make it black out again.

Most of the other modes don't work at all, or they're shifted right about 1", and again lots of horizontal streaks.

I'll try playing with the PLL settings.
Comment 33 Joshua Roys 2009-12-01 04:03:18 UTC
This fixes my monitor:

# ./radeontool/avivotool regset 0x00000430 0x00910032 ; ./radeontool/avivotool regset 0x0000043c 0x00000007 ; ./radeontool/avivotool regset 0x00000404 0x00000002
OLD: 0x00000430 (0430)	0x02300030 (36700208)
NEW: 0x00000430 (0430)	0x00910032 (9502770)
OLD: 0x0000043c (043c)	0x00000006 (6)
NEW: 0x0000043c (043c)	0x00000007 (7)
OLD: 0x00000404 (0404)	0x00000009 (9)
NEW: 0x00000404 (0404)	0x00000002 (2)
Comment 34 Alex Deucher 2009-12-01 13:52:36 UTC
Created attachment 31640 [details] [review]
use frac fb divs

Does this patch help (non-kms)?
Comment 35 Joshua Roys 2009-12-01 16:42:18 UTC
nope - here's the output when I changed the regs:

# sh fix.sh 
OLD: 0x00000430 (0430)	0x031e0035 (52297781)
NEW: 0x00000430 (0430)	0x00910032 (9502770)
OLD: 0x0000043c (043c)	0x00000007 (7)
NEW: 0x0000043c (043c)	0x00000007 (7)
OLD: 0x00000404 (0404)	0x0000000b (11)
NEW: 0x00000404 (0404)	0x00000002 (2)
Comment 36 Alex Deucher 2009-12-02 16:16:05 UTC
Created attachment 31694 [details] [review]
possible fix

Does this patch (in combination with the previous one) help?
Comment 37 Joshua Roys 2009-12-03 04:04:47 UTC
nope :(

# sh fix.sh 
OLD: 0x00000430 (0430)	0x031e0035 (52297781)
NEW: 0x00000430 (0430)	0x00910032 (9502770)
OLD: 0x0000043c (043c)	0x00000007 (7)
NEW: 0x0000043c (043c)	0x00000007 (7)
OLD: 0x00000404 (0404)	0x0000000b (11)
NEW: 0x00000404 (0404)	0x00000002 (2)
Comment 38 Alex Deucher 2009-12-09 10:03:46 UTC
Can you try with the latest code from xf86-video-ati git master?  I just committed some new PLL code that might help.
Comment 39 Leif Gruenwoldt 2009-12-09 12:27:49 UTC
Created attachment 31894 [details]
xorg log from latest git, no change
Comment 40 Alex Deucher 2009-12-09 14:07:44 UTC
(In reply to comment #39)
> Created an attachment (id=31894) [details]
> xorg log from latest git, no change
> 

You are using kms.  The patch in question only affects non-KMS.
Comment 41 Leif Gruenwoldt 2009-12-09 14:28:57 UTC
Created attachment 31896 [details]
trying again. xorg log from latest git, nomodeset, no change
Comment 42 Leif Gruenwoldt 2009-12-09 14:30:31 UTC
Created attachment 31897 [details]
photo of desktop display corruption with latest git, nomodeset
Comment 43 Joshua Roys 2009-12-09 15:08:58 UTC
Created attachment 31904 [details]
xorg log with logverbose=9

Cool, that patch fixes my display here.
# ./avivotool regmatch 0x00000430
0x00000430	0x00a50039 (10813497)
# ./avivotool regmatch 0x0000043c
0x0000043c	0x00000008 (8)
# ./avivotool regmatch 0x00000404
0x00000404	0x00000002 (2)

Thanks!!!  (please put in kms too :)

If you need me to test any more patches or provide any other info, let me know.
Comment 44 Alex Deucher 2009-12-10 10:17:26 UTC
Does disabling coherent mode help?
non-KMS:
xrandr --output DVI-0 --set coherent_mode 0
KMS:
xrandr --output DVI-0 --set coherent 0
Note that for KMS, you need the latest bits from drm-radeon-next or drm-radeon-testing for the coherent option to work.
Comment 45 Leif Gruenwoldt 2009-12-10 11:31:34 UTC
Created attachment 31944 [details]
photo of desktop display corruption with latest git, nomodeset, after running xrandr --output DVI-0 --set coherent_mode 0
Comment 46 Adam Jackson 2018-06-12 19:06:34 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.