Bug 16200

Summary: Xorg server busy-loops at start when DRI is true
Product: xorg Reporter: Coleman Kane <ckane>
Component: Driver/RadeonAssignee: xf86-video-ati maintainers <xorg-driver-ati>
Status: RESOLVED FIXED QA Contact: Xorg Project Team <xorg-team>
Severity: major    
Priority: medium CC: akirchhoff135014
Version: git   
Hardware: x86-64 (AMD64)   
OS: FreeBSD   
Whiteboard:
i915 platform: i915 features:
Attachments:
Description Flags
Dmesg output
none
Log of radeonhd EXA+DRI startup none

Description Coleman Kane 2008-06-02 07:11:11 UTC
I am using the latest xorg-server from git, built against the following packages:
  * dri2proto from git
  * drm from git
  * glproto from git
  * inputproto from git
  * kbproto from git
  * libX11 from git
  * libxcb from git
  * mesa from git

I've pulled down the latest DRM from git and build/installed the kernel modules against the latest FreeBSD 8.0-CURRENT (June 1st, 2008).

I cannot start the Xserver using the latest radeon driver (commit 8504c6b0e40477ee544ad7f5366d569bdc53d6f0) from xf86-video-ati, when I have DRI enabled.

The symptom is that the Xserver starts up and clears the screen (sets up the video mode I guess), but stops in a loop (100% CPU, nearly all of it system time) before it begins rendering to the screen. I used dcons to connect to another box and get a message dump, and the result is that the drm driver is running a loop printing the following to the screen (endlessly, but pausing between each print):

[drm:pid1385:radeon_cp_idle]
[drm:pid1385:radeon_do_cp_idle]
[drm:pid1385:drm_ioctl]     returning 16
[drm:pid1385:drm_ioctl] pid=1385, cmd=0x20006444, nr=0x44, dev 0xffffff000129d600, auth=1
[drm:pid1385:radeon_cp_idle]
[drm:pid1385:radeon_do_cp_idle]
[drm:pid1385:drm_ioctl]     returning 16
[drm:pid1385:drm_ioctl] pid=1385, cmd=0x20006444, nr=0x44, dev 0xffffff000129d600, auth=1
[drm:pid1385:radeon_cp_idle]
[drm:pid1385:radeon_do_cp_idle]
[drm:pid1385:drm_ioctl]     returning 16
[drm:pid1385:drm_ioctl] pid=1385, cmd=0x20006444, nr=0x44, dev 0xffffff000129d600, auth=1

I can access the box via SSH, and it looks like Xorg just hoses my display until I reboot the thing.

This is an RS690T on an HP Compaq 6715b notebook with a 1680x1050 flat panel. The following is the drm probe output:
 drm0: <ATI Radeon RS690 X1270 IGP> on vgapci0
info: [drm] Initialized radeon 1.29.0 20080528

Output of "lspci -nn -s 01:05 -v":

01:05.0 VGA compatible controller [0300]: ATI Technologies Inc RS690M [Radeon X1200 Series] [1002:791f] (prog-if 00 [VGA controller])
        Subsystem: Hewlett-Packard Company Unknown device [103c:30c2]
        Flags: bus master, fast devsel, latency 64, IRQ 19
        Memory at c0000000 (64-bit, prefetchable)
        Memory at d0400000 (64-bit, non-prefetchable)
        I/O ports at 4000
        Memory at d0500000 (32-bit, non-prefetchable)
        Capabilities: [50] Power Management version 2
        Capabilities: [80] Message Signalled Interrupts: Mask- 64bit+ Queue=0/0 Enable-

Perhaps interesting to note is that this is an IGP chip, the drm kmod probes it as a PCI device (specifically neither PCIY_EXPRESS or PCIY_AGP). I am not sure if this is helpful.

Using the radeonhd driver, I can get the Xserver to come up with DRI enabled, but I get a blank (black space) where rendering should be for glxgears, etc... The output of glxinfo using the radeonhd driver seems to be okay.
Comment 1 Alex Deucher 2008-06-03 14:08:57 UTC
(In reply to comment #0)
> Using the radeonhd driver, I can get the Xserver to come up with DRI enabled,
> but I get a blank (black space) where rendering should be for glxgears, etc...
> The output of glxinfo using the radeonhd driver seems to be okay.
> 

It's the same problem, but there's no 2D acceleration in radeonhd when the dri is enabled so the server will come up, but when you try and use the CP, you get the error.  radeon hangs since it's trying to initialize and use 2D accel when the server starts.
Comment 2 Coleman Kane 2008-06-03 14:40:34 UTC
(In reply to comment #1)
> (In reply to comment #0)
> > Using the radeonhd driver, I can get the Xserver to come up with DRI enabled,
> > but I get a blank (black space) where rendering should be for glxgears, etc...
> > The output of glxinfo using the radeonhd driver seems to be okay.
> > 
> 
> It's the same problem, but there's no 2D acceleration in radeonhd when the dri
> is enabled so the server will come up, but when you try and use the CP, you get
> the error.  radeon hangs since it's trying to initialize and use 2D accel when
> the server starts.
> 

Well, can you give me some pointers as to where to start looking and maybe I can wriggle out some more debugging on my own... I am not throughly familiar with what trickery (if any) is employed in the PCI GART stuff, but I have picked over a lot of the drm kmod code, so I'm not going into it totally blind.
Comment 3 Alex Deucher 2008-06-03 14:48:18 UTC
(In reply to comment #2)
> 
> Well, can you give me some pointers as to where to start looking and maybe I
> can wriggle out some more debugging on my own... I am not throughly familiar
> with what trickery (if any) is employed in the PCI GART stuff, but I have
> picked over a lot of the drm kmod code, so I'm not going into it totally blind.
> 

I'm not sure what shape the ati pci/pcie/igp gart stuff is in for bsd unfortunately.  rnoland and adamk were working on it on IRC (#dri-devel).  The relevant code is in ati_pcigart.c and radeon_cp.c in the drm.
Comment 4 Adam K Kirchhoff 2008-06-03 15:03:01 UTC
Just to add my 2 cents worth...  This is what I'm getting with a PCIe x850 and x1650:


[drm:pid1193:drm_ioctl]     returning 16
[drm:pid1193:drm_ioctl] pid=1193, cmd=0x20006444, nr=0x44, dev 0xc529ad80, auth=1
[drm:pid1193:radeon_cp_idle]
[drm:pid1193:radeon_do_cp_idle]
[drm:pid1193:drm_ioctl]     returning 16
[drm:pid1193:drm_ioctl] pid=1193, cmd=0x20006444, nr=0x44, dev 0xc529ad80, auth=1
[drm:pid1193:radeon_cp_idle]
[drm:pid1193:radeon_do_cp_idle]
[drm:pid1193:drm_ioctl]     returning 16
[drm:pid1193:drm_ioctl] pid=1193, cmd=0x20006444, nr=0x44, dev 0xc529ad80, auth=1

The exact same as Coleman.  I've given rnoland the full dmesg output with debugging enabled.  The x850 works fine with mesa/xserver/ati from ports and drm from -CURRENT.  I've even gotten the x1650 to enable direct rendering (with a usable X server) using some combination of those four, from ports and git, though I haven't had time to try and reproduce that combination yet.  In that state, though, AIGLX would not work, I believe, do to a mismatch of xserver and mesa.
Comment 5 Coleman Kane 2008-06-27 06:28:56 UTC
Created attachment 17425 [details]
Dmesg output

I have some new data... for a small period this was working for me with limited success. Recently, however, with the latest updates to DRM, or xf86-video-ati, or something else, I have been reverted to the busy-loop at server startup.

I've also started testing with the latest code from the quick-and-dirty-2d branch from xf86-video-radeonhd. Using EXA+DRI I also get a similar lock-up, however the display does get populated with what looks like a bunch of frame-buffer garbage, and the X cursor (which can't be moved).

Additionally, I get the following messages spewed to the kernel console:
info: [drm] wait for fifo failed status : 0x9001C100 0x00080000

I am attaching them to the issue. It seems to be caught in a loop constantly calling the radeon_do_wait_for_fifo function from shared-core/radeon_cp.c and never recovers.

I will also attach an Xorg log for that session as well.
Comment 6 Coleman Kane 2008-06-27 06:30:45 UTC
Created attachment 17426 [details]
Log of radeonhd EXA+DRI startup

Ignore the lines at the bottom about synaptics/mouse failures. They happen when the mouse device is working too, and are just an artifact of the weirdness that is the synaptics driver.
Comment 7 Coleman Kane 2008-06-27 06:48:12 UTC
Output of lspci -s 01:05 -vv -xxxx -i /usr/local/share/pciids/pci.ids -nn:
01:05.0 VGA compatible controller [0300]: ATI Technologies Inc RS690M [Radeon X1200 Series] [1002:791f] (prog-if 00 [VGA controller])
        Subsystem: Hewlett-Packard Company Unknown device [103c:30c2]
        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: 64, Cache Line Size: 64 bytes
        Interrupt: pin B routed to IRQ 19
        Region 0: Memory at c0000000 (64-bit, prefetchable)
        Region 2: Memory at d0400000 (64-bit, non-prefetchable)
        Region 4: I/O ports at 4000
        Region 5: Memory at d0500000 (32-bit, non-prefetchable)
        Capabilities: [50] Power Management version 2
                Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot-,D3cold-)
                Status: D0 PME-Enable- DSel=0 DScale=0 PME-
        Capabilities: [80] Message Signalled Interrupts: Mask- 64bit+ Queue=0/0 Enable-
                Address: 0000000000000000  Data: 0000
00: 02 10 1f 79 07 00 10 00 00 00 00 03 10 40 00 00
10: 0c 00 00 c0 00 00 00 00 04 00 40 d0 00 00 00 00
20: 01 40 00 00 00 00 50 d0 00 00 00 00 3c 10 c2 30
30: 00 00 00 00 50 00 00 00 00 00 00 00 13 02 00 00
40: 00 00 00 00 00 00 00 00 00 00 00 00 3c 10 c2 30
50: 01 80 02 06 00 00 00 00 00 00 00 00 00 00 00 00
60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
80: 05 00 80 00 00 00 00 00 00 00 00 00 00 00 00 00
90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Comment 8 Coleman Kane 2008-12-23 11:56:00 UTC
This has been fixed already

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.