Bug 94414

Summary: Radeon RV370 w/ acceleration enabled exhibits problem with resolutions above 1440x900
Product: Mesa Reporter: Jean-Philippe Gariépy <gawix>
Component: Drivers/Gallium/r300Assignee: Default DRI bug account <dri-devel>
Status: RESOLVED MOVED QA Contact: Default DRI bug account <dri-devel>
Severity: normal    
Priority: medium CC: mrmazda
Version: unspecified   
Hardware: x86 (IA32)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Attachments: dmesg
journalctl (filtered with gdm-x-session and gnome-shell.desktop)
screenshot of garbled display
rv370 X300 Radeon Xorg.0.log on Fedora 23 (2 connected displays)(hwinfo prepended)

Description Jean-Philippe Gariépy 2016-03-06 15:46:35 UTC
Observed under Using Fedora 23 package xorg-x11-drv-ati-7.6.1-3.20160215gitd41fccc.fc23.i686 but problem is present in many other Linux distribs.

xorg.conf

Section "Device"
  Identifier "device"
  Driver "radeon"
  Option "Accel"  "true" 
EndSection

lspci -v

...
01:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] RV370 [Radeon X300] (prog-if 00 [VGA controller])
	Subsystem: Advanced Micro Devices, Inc. [AMD/ATI] Device 0602
	Flags: bus master, fast devsel, latency 0, IRQ 30
	Memory at ec000000 (64-bit, prefetchable) [size=32M]
	Memory at efde0000 (64-bit, non-prefetchable) [size=64K]
	I/O ports at dc00 [size=256]
	Expansion ROM at efe00000 [disabled] [size=128K]
	Capabilities: <access denied>
	Kernel driver in use: radeon
	Kernel modules: radeon
...

Was working ok with old fedora XOrg version (under Fedora 12, it was OK).

I'd like to provide more useful info as whether the bug is in the DRI layer or XOrg driver but I don't know where to start.

I've tried modifying every EXA options without success. The only stable configuration is with Accel = false.
Comment 1 Felix Miata 2016-03-06 19:07:20 UTC
Exactly what is the "problem"?

Which DE are you using?

Could it be that your X300 is RAM limited and in Fedora 12 X was using 16 bits instead of 24?

1680x1050 on rv370 FireGL on  64 bit Plasma 5 seems to work normally here:

xorg-x11-drv-ati-7.6.1-3.20160215gitd41fccc.fc23.x86_64

Section "Device"
	Identifier "DefaultDevice"
	Driver		"radeon"
	Option		"Accel"	"true"
EndSection

Section "Monitor"
	Identifier	"DefaultMonitor"
	Option		"PreferredMode"	"1680x1050"
	DisplaySize	394 247 # 108 DPI @ 1680x1050
EndSection

Section "Screen"
	Identifier "DefaultScreen"
	Device "DefaultDevice"
	Monitor "DefaultMonitor"
EndSection

01:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] RV370 GL [FireGL V3100] (rev 80) (prog-if 00 [VGA controller])
	Subsystem: Advanced Micro Devices, Inc. [AMD/ATI] Device 0102
	Flags: bus master, fast devsel, latency 0, IRQ 29
	Memory at e0000000 (32-bit, prefetchable) [size=128M]
	I/O ports at e000 [size=256]
	Memory at efee0000 (32-bit, non-prefetchable) [size=64K]
	Expansion ROM at efec0000 [disabled] [size=128K]
	Capabilities: [50] Power Management version 2
	Capabilities: [58] Express Endpoint, MSI 00
	Capabilities: [80] MSI: Enable+ Count=1/1 Maskable- 64bit+
	Capabilities: [100] Advanced Error Reporting
	Kernel driver in use: radeon
	Kernel modules: radeon

01:00.1 Display controller: Advanced Micro Devices, Inc. [AMD/ATI] RV370 GL [FireGL V3100] (Secondary) (rev 80)
	Subsystem: Advanced Micro Devices, Inc. [AMD/ATI] Device 0103
	Flags: bus master, fast devsel, latency 0
	Memory at efef0000 (32-bit, non-prefetchable) [size=64K]
	Capabilities: [50] Power Management version 2
	Capabilities: [58] Express Endpoint, MSI 00
Comment 2 Michel Dänzer 2016-03-07 02:23:27 UTC
In addition to providing an actual description of the problem, please attach the Xorg log and the output of dmesg.
Comment 3 Jean-Philippe Gariépy 2016-03-10 02:42:14 UTC
Created attachment 122189 [details]
dmesg
Comment 4 Michel Dänzer 2016-03-10 02:47:12 UTC
No description of the problem => no valid bug report. Feel free to reopen with a description of the problem and the Xorg log file.
Comment 5 Jean-Philippe Gariépy 2016-03-10 02:57:11 UTC
Created attachment 122192 [details]
journalctl (filtered with gdm-x-session and gnome-shell.desktop)
Comment 6 Jean-Philippe Gariépy 2016-03-10 02:58:54 UTC
Created attachment 122194 [details]
screenshot of garbled display
Comment 7 Jean-Philippe Gariépy 2016-03-10 03:12:28 UTC
Sorry for the delay. I was trying to gather all the files for diagnostic.

I'm using Gnome 3.18 (classic).

# uname -a 
Linux localhost.localdomain 4.4.3-300.fc23.i686+PAE #1 SMP Fri Feb 26 19:01:29 UTC 2016 i686 i686 i386 GNU/Linux

/etc/X11/xorg.conf.d/00-gawi.conf:

Section "Device"
  Identifier "device"
  Driver "radeon"
  Option "Accel"  "true"
  #Option "EXAVSync" "true"
  #Option "EXAPixmaps" "false"
  #Option "SwapBuffersWait" "true"
  #Option "AccelMethod"  "exa"
  #Option "ColorTiling" "false"
  #Option "ColorTiling2D        " "false"
  #Option "DRI" "3"
  #Option "TearFree" "false"
EndSection

I'm not using wayland for GDM.

I've tried lowering the depth to 16bpp but I have the same problems.
Comment 8 Jean-Philippe Gariépy 2016-03-10 03:15:28 UTC
Note that I'm seeing this "r300: CS space validation failed." message. 

This seems to come from Mesa:
mesa/src/gallium/drivers/r300/r300_render.c

Not sure what is the exact cause for this message.  What else can I try?
Comment 9 Felix Miata 2016-03-10 09:05:33 UTC
Created attachment 122200 [details]
rv370 X300 Radeon Xorg.0.log on Fedora 23 (2 connected displays)(hwinfo prepended)

I managed to reproduce the screen corruption accidentally, by forgetting to disconnect 1680x1050 LCD on VGA before booting with 1920x1200 LCD on DVI. Rebooting with only 1920x1200 on DVI, no corruption was evident in KDE.

The corruption looks the same as appeared long ago on a couple of rv370-380 era Radeon X### cards I then decided must have developed bad RAM.
Comment 10 Alex Deucher 2016-03-10 14:02:41 UTC
(In reply to Felix Miata from comment #9)
> Created attachment 122200 [details]
> rv370 X300 Radeon Xorg.0.log on Fedora 23 (2 connected displays)(hwinfo
> prepended)
> 
> I managed to reproduce the screen corruption accidentally, by forgetting to
> disconnect 1680x1050 LCD on VGA before booting with 1920x1200 LCD on DVI.
> Rebooting with only 1920x1200 on DVI, no corruption was evident in KDE.
> 
> The corruption looks the same as appeared long ago on a couple of rv370-380
> era Radeon X### cards I then decided must have developed bad RAM.

The problem is that the max texture and render target coordinate limits on R3xx hardware is 2048 pixels.  If your desktop is larger than 2048 pixels in either dimension, you will see corruption if you compositor attempts to accelerate it.  The desktop compositor should check the GL limits of the underlying driver before blindly specifying surfaces larger than them.
Comment 11 Jean-Philippe Gariépy 2016-03-10 14:47:11 UTC
(In reply to Alex Deucher from comment #10)

> The problem is that the max texture and render target coordinate limits on
> R3xx hardware is 2048 pixels.  If your desktop is larger than 2048 pixels in
> either dimension, you will see corruption if you compositor attempts to
> accelerate it.  The desktop compositor should check the GL limits of the
> underlying driver before blindly specifying surfaces larger than them.

Hi Alex, you've responded to Felix comment but this is not the original problem. 

As far as I know, my desktop size is 1920x1200 and doesn't exceed 2048 in either dimension.  My card only has a 2 physical outputs DVI and S-video.  Only DVI-0 is connected, so there is no "other monitor" left open that would change the desktop size.

(II) RADEON(0): Output VGA-0 disconnected
(II) RADEON(0): Output DVI-0 connected
(II) RADEON(0): Output S-video disconnected

Nevertheless...

The only hint that I have so far is the "r300: CS space validation failed." message. If it's a problem with the desktop compositor violating the contract, which Gnome component is reponsible? Just trying to log the bug at the right level.

I'll try using another desktop environment tonight.

Thanks
Comment 12 Felix Miata 2016-03-10 18:09:42 UTC
(In reply to Jean-Philippe Gariépy from comment #11)
> I'll try using another desktop environment tonight.
 
Not just another DE, but another OS, like a Knoppix DVD or other live media, to help determine whether a software problem, or failing X300 RAM. If it's RAM, maybe trying a lower resolution mode or display would tell that your real limit has dropped to less than 2048. Was your X300 manufactured by MSI, or shipped originally in a Dell PC?
Comment 13 Michel Dänzer 2016-03-11 03:01:50 UTC
(In reply to Jean-Philippe Gariépy from comment #11)
> The only hint that I have so far is the "r300: CS space validation failed."
> message. If it's a problem with the desktop compositor violating the
> contract, which Gnome component is reponsible? Just trying to log the bug at
> the right level.

It's probably assigned correctly now. The message indicates that the r300 driver isn't coping with the amount of VRAM available to it.
Comment 14 Jean-Philippe Gariépy 2016-03-11 03:15:48 UTC
(In reply to Felix Miata from comment #12)
> > I'll try using another desktop environment tonight.
>  
> Not just another DE, but another OS, like a Knoppix DVD or other live media,
> to help determine whether a software problem, or failing X300 RAM. If it's
> RAM, maybe trying a lower resolution mode or display would tell that your
> real limit has dropped to less than 2048. Was your X300 manufactured by MSI,
> or shipped originally in a Dell PC?

My X300 came in a Dell PC.

Didn't have the time to try another distribution but I remember having similar display problems while trying Ubuntu from a Live image. Same problem under KDE.

At 1280x1024, I get the "CS space validation" error message.
At 1280x960, I don't get it.
Comment 15 Felix Miata 2016-03-11 03:46:44 UTC
I think what's happening is RAM deterioration. IIRC, my oldest and most used (24/7 > 5 years) X600 started displaying the same kind of corruption. I replaced it with another X600 off eBay for $6. Another I bought off eBay worked OK at boot and on vttys, but corrupted like yours on starting X at modes higher than 1280x1024 or so. With yours having only DVI and S-Video outputs it sounds like yours came in a SFF Dell. I see a 5-lot of low profile X600 cards in a current eBay ad for $19.95 delivered in the USA, and many other ads for X300 and X600 at low prices in US and abroad.
Comment 16 Michel Dänzer 2016-03-11 08:48:04 UTC
(In reply to Felix Miata from comment #15)
> I think what's happening is RAM deterioration.

That couldn't explain the error messages Jean-Philippe is getting. They indicate a software bug.
Comment 17 Felix Miata 2016-03-11 09:05:47 UTC
(In reply to Michel Dänzer from comment #16)
> (In reply to Felix Miata from comment #15)
> > I think what's happening is RAM deterioration.

> That couldn't explain the error messages Jean-Philippe is getting. They
> indicate a software bug.

You wrote "the r300 driver isn't coping with the amount of VRAM available to it". I would expect unreliable RAM to be difficult to cope with. Bad coping may be a software problem, but if his coped with available RAM is less than it used to be, I'd expect he wouldn't be able to recover uncorrupted 1920x1200 without hardware replacement.

I think I may still have my corrupting rv380 X600 upstairs that I could reinstall in something if you think it might help development of better coping.
Comment 18 Michel Dänzer 2016-03-11 09:37:23 UTC
Felix, the symptoms described in this bug report aren't consistent with hardware failure. Some of the symptoms you were getting due to hardware failure might have been similar, but it's most certainly not the same problem. Please stop mixing up the two issues.
Comment 19 GitLab Migration User 2019-09-18 18:53:24 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/mesa/mesa/issues/371.

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.