Bug 72372

Summary: radeon 9200se atlantis dri hangs X (nforce2)
Product: Base System Reporter: Robin Schoonover <end>
Component: kernAssignee: Eric Anholt <anholt>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 5.3-BETA7   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
agp_nvidia.c-3.diff none

Description Robin Schoonover 2004-10-06 05:20:06 UTC
Just recently got a Sapphire ATI Radeon 9200SE Atlantis (128 MB).  Xorg
ati driver works fine with dri disabled.  With dri enabled it "hangs"
the system. The cursor is shown and the mouse works (hwcursor is
probably why, that doesn't even work with swcursor) but the rest of the
screen is just garbage.  Can't switch to console.

At this point I can ssh onto the system from another computer. Xorg is
taking up 100% cpu. I can try to connect programs to it (env DISPLAY=:0
xterm), but they don't seem to show up, even if they seem to run.  If I
try to kill Xorg, it tried to die, but all it does is eject programs
currently connected (like that xterm I started up). kill -9 does no good
either. Xorg's cpu lowers until it hits 50% cpu usage (+50% system) and
top says it has the state 'rdnrel'.  The mouse will no longer respond at
this point.

The only way to recover local use of the machine is a reboot.

xconf:        http://endif.cjb.net/~end/drimisc/XF86Config.zork
xorg.0.log:   http://endif.cjb.net/~end/drimisc/Xorg.0.log
dmesg:        http://endif.cjb.net/~end/drimisc/dmesg.boot
pciconf:      http://endif.cjb.net/~end/drimisc/pciconf.log
kernconf:    
http://endif.cjb.net/cgi-bin/cvsweb.cgi/conf/kernconf/ZORK?rev=1.2

Not an isolated incident:
http://lists.freebsd.org/pipermail/freebsd-bugs/2004-September/009330.html

Fix: 

Unknown.  (Workaround: disable dri)
How-To-Repeat: 
Sapphire Radeon 9200SE Atlantis (128 MB) + FreeBSD 5.x

Enable dri.  startx.
Comment 1 Ceri Davies freebsd_committer freebsd_triage 2004-10-07 22:10:12 UTC
Adding to audit trail from misfiled PR kern/72412:

Date: Wed, 6 Oct 2004 22:04:18 -0600
From: Robin Schoonover <end@endif.cjb.net>
Message-Id: <20041006220418.315de2a7@zork>

 Hmm.  I tried with a different card (radeon 7200) and it still breaks
 in the same way w/ dri enabled, so this does not seem to be card
 specific. It looks like the problem is actually agp related. (nvidia
 nforce2)
 
 -- 
 Robin Schoonover (aka End)
 #
 # Actual newspaper headline:
 #     Sex Education Delayed, Teachers Request Training
Comment 2 Pierre Beyssac 2004-10-11 13:42:23 UTC
On Wed, Oct 06, 2004 at 04:10:44AM -0000, Robin Schoonover wrote:
> At this point I can ssh onto the system from another computer. Xorg is
> taking up 100% cpu.

From your description I'm having exactly the same problem (5.3,
Xorg or XFree, Radeon 9200SE, nVidia AGP nForce2).

I've tried to analyze it to no avail. Here's more information in
case someone knowledgeable enough would like to look into it.

- it's possible to get more detailed error messages (I think they're
  related, but they might not be) by adding the following to section
  "Device" of the X11 config:

        Option     "CPusecTimeout"      "500000"
        Option     "CPPIOMode"  "true"

Excerpt from log:
(II) RADEON(0): [drm] created "radeon" driver at busid "PCI:3:0:0"
(II) RADEON(0): [drm] added 8192 byte SAREA at 0xc2987000
(II) RADEON(0): [drm] mapped SAREA 0xc2987000 to 0x283bd000
(II) RADEON(0): [drm] framebuffer handle = 0xd0000000
(II) RADEON(0): [drm] added 1 reserved context for kernel
(II) RADEON(0): [agp] Mode 0x1f004209 [AGP 0x0000/0x0000; Card 0x1002/0x5964]
(II) RADEON(0): [agp] 8192 kB allocated with handle 0xc276b900
(II) RADEON(0): [agp] ring handle = 0xe0000000
(II) RADEON(0): [agp] Ring mapped at 0x3041d000
(II) RADEON(0): [agp] ring read ptr handle = 0xe0101000
(II) RADEON(0): [agp] Ring read ptr mapped at 0x282c9000
(II) RADEON(0): [agp] vertex/indirect buffers handle = 0xe0102000
(II) RADEON(0): [agp] Vertex/indirect buffers mapped at 0x3051e000
(II) RADEON(0): [agp] GART texture map handle = 0xe0302000
(II) RADEON(0): [agp] GART Texture map mapped at 0x3071e000
(II) RADEON(0): [drm] register handle = 0xe3000000
(II) RADEON(0): [dri] Visual configs initialized
(II) RADEON(0): CP in PIO mode
(II) RADEON(0): Using 8 MB GART aperture
(II) RADEON(0): Using 1 MB for the ring buffer
(II) RADEON(0): Using 2 MB for vertex/indirect buffers
(II) RADEON(0): Using 5 MB for GART textures
(II) RADEON(0): Memory manager initialized to (0,0) (1280,8191)
(II) RADEON(0): Reserved area from (0,1024) to (1280,1026)
(II) RADEON(0): Largest offscreen area available: 1280 x 7165
(II) RADEON(0): Will use back buffer at offset 0x1400000
(II) RADEON(0): Will use depth buffer at offset 0x1900000
(II) RADEON(0): Will use 100352 kb for textures at offset 0x1e00000
(II) RADEON(0): Using XFree86 Acceleration Architecture (XAA)
        Screen to screen bit blits
        Solid filled rectangles
        8x8 mono pattern filled rectangles
        Indirect CPU to Screen color expansion
        Solid Lines
        Scanline Image Writes
        Offscreen Pixmaps
        Setting up tile and stipple cache:
                32 128x128 slots
                32 256x256 slots
                16 512x512 slots
(II) RADEON(0): Acceleration enabled
(==) RADEON(0): Backing store disabled
(==) RADEON(0): Silken mouse enabled
(II) RADEON(0): Using hardware cursor (scanline 1026)
(II) RADEON(0): Largest offscreen area available: 1280 x 7161
(**) Option "dpms"
(**) RADEON(0): DPMS enabled
(II) RADEON(0): X context handle = 0x00000001
(II) RADEON(0): [drm] installed DRM signal handler
(II) RADEON(0): [DRI] installation complete
(II) RADEON(0): [drm] removed 1 reserved context for kernel
(II) RADEON(0): [drm] unmapping 8192 bytes of SAREA 0xc2987000 at 0x283bd000
(II) RADEON(0): Direct rendering disabled
[...]
(II) XINPUT: Adding extended input device "Mouse0" (type: MOUSE)
(II) Mouse0: SetupAuto: hw.iftype is 4, hw.model is 0
(II) Mouse0: SetupAuto: protocol is SysMouse

Then yelds the following error messages (in a loop):
(EE) RADEON(0): RADEONCPGetBuffer: CP start -1020
(EE) RADEON(0): RADEONCPGetBuffer: CP GetBuffer -1020
(EE) RADEON(0): GetBuffer timed out, resetting engine...

- forcing the bus type to PCI doesn't help.
- since the 9200SE is reported to work, it's probably an AGP problem
  related to the nForce2 chipset.
-- 
Pierre Beyssac	      	    pb@fasterix.frmug.org pb@fasterix.freenix.org
    Free domains: http://www.eu.org/ or mail dns-manager@EU.org
Comment 3 Eric Anholt freebsd_committer freebsd_triage 2005-05-07 01:53:24 UTC
Responsible Changed
From-To: freebsd-bugs->anholt

Snag this one.  Need to go over our nvidia agp again.
Comment 4 Eric Anholt 2005-06-24 02:27:14 UTC
I've attached a new patch, which is also located at:
http://people.freebsd.org/~anholt/agp_nvidia.c-3.diff
which I'm really hoping will fix this issue.

-- 
Eric Anholt                                     eta@lclark.edu
http://people.freebsd.org/~anholt/              anholt@FreeBSD.org
Comment 5 Eric Anholt freebsd_committer freebsd_triage 2005-09-17 00:01:49 UTC
State Changed
From-To: open->patched

I think this is fixed in 6.0 now (agp_nvidia.c-3.diff committed).
Comment 6 Eric Anholt freebsd_committer freebsd_triage 2005-11-18 20:37:02 UTC
State Changed
From-To: patched->closed

Patch has been merged to 6-STABLE.