Bug 40576 - HD4290 (Asus M4A89GTD/Pro onboard): no DRI (/dev/dri/card0) with CONFIG_DRM_RADEON_KMS enabled
Summary: HD4290 (Asus M4A89GTD/Pro onboard): no DRI (/dev/dri/card0) with CONFIG_DRM_R...
Status: RESOLVED NOTABUG
Alias: None
Product: DRI
Classification: Unclassified
Component: DRM/Radeon (show other bugs)
Version: unspecified
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Default DRI bug account
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-02 05:03 UTC by RandomCore
Modified: 2011-09-02 09:05 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description RandomCore 2011-09-02 05:03:28 UTC
I have a Debian (somewhere between unstable and testing) and a homebrewn kernel (v3.0.1 with vserver 2.3.1-pre9) on my M4A89GTD/Pro. The M4A89GTD/Pro has HD4290 on-board graphics (RS880). There's no other graphic card installed. For bootup I have a vesa console framebuffer configured but no radeon (couldn't get it to work). If I set in my kernel .config file

 CONFIG_DRM_RADEON=y
 CONFIG_DRM_RADEON_KMS=y

a dmesg shows:

 [drm] Initialized drm 1.1.0 20060810
 [drm] radeon defaulting to kernel modesetting.
 [drm] radeon kernel modesetting enabled.
 checking generic (d0000000 280000) vs hw (d0000000 10000000)
 fb: conflicting fb hw usage radeondrmfb vs VESA VGA - removing generic driver
 radeon 0000:01:05.0: PCI INT A -> GSI 18 (level, low) -> IRQ 18
 radeon 0000:01:05.0: setting latency timer to 64
 [drm] initializing kernel modesetting (RS880 0x1002:0x9714).
 [drm] register mmio base: 0xFE6F0000
 [drm] register mmio size: 65536
 radeon 0000:01:05.0: BAR 6: can't assign [??? 0x00000000 flags 0x0] (bogus alignment)
 [drm:radeon_get_bios] *ERROR* Unable to locate a BIOS ROM
 radeon 0000:01:05.0: Fatal error during GPU init
 [drm] radeon: finishing device.

Unnecessary to tell, that there are no /dev/dri/* around then. If I unset CONFIG_DRM_RADEON_KMS I get:

 [drm] Initialized drm 1.1.0 20060810
 [drm] radeon defaulting to userspace modesetting.
 pci 0000:01:05.0: PCI INT A -> GSI 18 (level, low) -> IRQ 18
 pci 0000:01:05.0: setting latency timer to 64
 [drm] Supports vblank timestamp caching Rev 1 (10.10.2010).
 [drm] No driver support for vblank timestamp query.
 [drm] Initialized radeon 1.33.0 20080528 for 0000:01:05.0 on minor 0
 ... (much later, at the end) ...
 [drm] Setting GART location based on new memory map
 [drm] Loading RS780 CP Microcode
 [drm] Resetting GPU
 [drm] writeback test succeeded in 1 usecs
 [drm] Resetting GPU

and /dev/dri/card0 is present. The Problem however is that the libGL (Debian libgl1-mesa-glx v7.11-5, xorg v1:7.5+8) has Problems with that:

 $ LIBGL_DEBUG=verbose /usr/bin/glxinfo -b

 libGL: XF86DRIGetClientDriverName: 4.3.0 r600 (screen 0)
 libGL: OpenDriver: trying /usr/lib/i386-linux-gnu/dri/tls/r600_dri.so
 libGL: OpenDriver: trying /usr/lib/i386-linux-gnu/dri/r600_dri.so
 drmOpenDevice: node name is /dev/dri/card0
 drmOpenDevice: open result is 4, (OK)
 drmOpenByBusid: Searching for BusID pci:0000:01:05.0
 drmOpenDevice: node name is /dev/dri/card0
 drmOpenDevice: open result is 4, (OK)
 drmOpenByBusid: drmOpenMinor returns 4
 drmOpenByBusid: Interface 1.4 failed, trying 1.1
 drmOpenByBusid: drmGetBusid reports pci:0000:01:05.0
 libGL error: Calling driver entry point failed
 libGL error: reverting to software direct rendering
 ...

The performance of X (measured with glxgears) without KMS (~630 FPS) is better than with KMS and no DRI (~85 FPS), but there should be more.

Do you have any idea, what I can change?
Or, can I do more to help analyzing this?

cu, RandomCore
Comment 1 Michel Dänzer 2011-09-02 06:06:47 UTC
(In reply to comment #1)
>  CONFIG_DRM_RADEON=y

In that case KMS requires the microcode from /lib/firmware/radeon to be built into the kernel as well. Are you doing that?
Comment 2 Alex Deucher 2011-09-02 06:58:24 UTC
Make sure you enable PCI quirks in your kernel.  They are needed to access the vbios rom on a lot of cards.  Without access to the vbios, the drm can't set up your card.
Comment 3 RandomCore 2011-09-02 07:50:12 UTC
ok, one by one.

1) /lib/firmware/radeon

I installed firmware-linux-nonfree (Debian v0.33), added the necessary lines to the kernel .config to have them all included.

Booting with this (radeon.modeset=0 or =1) was not different or better then without.

2) PCI Quirks

I added CONFIG_PCI_QUIRKS=y to my .config

This got me some difference:

a) a 30s lag where the firmware should install:

 $ grep "drm\|radeon" dmesg_bootlog_20110902_1624-kms-fw-pciquirks 
 [drm] Initialized drm 1.1.0 20060810
 [drm] radeon defaulting to kernel modesetting.
 [drm] radeon kernel modesetting enabled.
 fb: conflicting fb hw usage radeondrmfb vs VESA VGA - removing generic driver
 radeon 0000:01:05.0: PCI INT A -> GSI 18 (level, low) -> IRQ 18
 radeon 0000:01:05.0: setting latency timer to 64
 [drm] initializing kernel modesetting (RS880 0x1002:0x9714).
 [drm] register mmio base: 0xFE6F0000
 [drm] register mmio size: 65536
 radeon 0000:01:05.0: VRAM: 368M 0x00000000C0000000 - 0x00000000D6FFFFFF (368M used)
 radeon 0000:01:05.0: GTT: 512M 0x00000000A0000000 - 0x00000000BFFFFFFF
 [drm] Detected VRAM RAM=368M, BAR=256M
 [drm] RAM width 32bits DDR
 [drm] radeon: 368M of VRAM memory ready
 [drm] radeon: 512M of GTT memory ready.
 [drm] Supports vblank timestamp caching Rev 1 (10.10.2010).
 [drm] Driver supports precise vblank timestamp query.
 [drm] radeon: irq initialized.
 [drm] GART: num cpu pages 131072, num gpu pages 131072
 [drm] Loading RS780 Microcode

--->> 30s waiting <<---

 r600_cp: Failed to load firmware "radeon/R600_rlc.bin"
 [drm:r600_startup] *ERROR* Failed to load firmware!
 radeon 0000:01:05.0: disabling GPU acceleration
 radeon 0000:01:05.0: ffff88021f00f800 unpin not necessary
 radeon 0000:01:05.0: ffff88021f00f800 unpin not necessary
 [drm] Radeon Display Connectors
 [drm] Connector 0:
 [drm]   VGA
 [drm]   DDC: 0x7e40 0x7e40 0x7e44 0x7e44 0x7e48 0x7e48 0x7e4c 0x7e4c
 [drm]   Encoders:
 [drm]     CRT1: INTERNAL_KLDSCP_DAC1
 [drm] Connector 1:
 [drm]   DVI-D
 [drm]   HPD3
 [drm]   DDC: 0x7e50 0x7e50 0x7e54 0x7e54 0x7e58 0x7e58 0x7e5c 0x7e5c
 [drm]   Encoders:
 [drm]     DFP1: INTERNAL_KLDSCP_LVTMA
 [drm] radeon: power management initialized
 [drm] fb mappable at 0xD0040000
 [drm] vram apper at 0xD0000000
 [drm] size 9216000
 [drm] fb depth is 24
 [drm]    pitch is 7680
 fb: conflicting fb hw usage radeondrmfb vs VESA VGA - removing generic driver
 fbcon: radeondrmfb (fb1) is primary device
 fb1: radeondrmfb frame buffer device
 drm: registered panic notifier
 [drm] Initialized radeon 2.10.0 20080528 for 0000:01:05.0 on minor 0

b) Xorg seems to be faster (glxgears shows around 730 FPS now == 15% increase). Here's the (relevant part of the) log:

 $ grep "DRI" /var/log/Xorg.0.log
 [   139.748] (II) RADEON(0): Front buffer size: 9600K
 [   139.748] (II) RADEON(0): VRAM usage limit set to 218959K
 [   139.803] (==) RADEON(0): Backing store disabled
 [   139.803] (WW) RADEON(0): Direct rendering disabled
 [   139.803] (II) RADEON(0): Acceleration disabled
 [   139.803] (==) RADEON(0): DPMS enabled
 [   139.803] (==) RADEON(0): Silken mouse enabled
 [   139.805] (II) RADEON(0): RandR 1.2 enabled, ignore the following RandR disabled message.
 [   139.805] (--) RandR disabled
 [   139.805] (II) Initializing built-in extension Generic Event Extension
 [   139.805] (II) Initializing built-in extension SHAPE
 [   139.805] (II) Initializing built-in extension MIT-SHM
 [   139.805] (II) Initializing built-in extension XInputExtension
 [   139.805] (II) Initializing built-in extension XTEST
 [   139.805] (II) Initializing built-in extension BIG-REQUESTS
 [   139.805] (II) Initializing built-in extension SYNC
 [   139.805] (II) Initializing built-in extension XKEYBOARD
 [   139.805] (II) Initializing built-in extension XC-MISC
 [   139.805] (II) Initializing built-in extension SECURITY
 [   139.805] (II) Initializing built-in extension XINERAMA
 [   139.805] (II) Initializing built-in extension XFIXES
 [   139.805] (II) Initializing built-in extension RENDER
 [   139.805] (II) Initializing built-in extension RANDR
 [   139.805] (II) Initializing built-in extension COMPOSITE
 [   139.805] (II) Initializing built-in extension DAMAGE
 [   139.807] (II) SELinux: Disabled on system
 [   139.227] (II) Loading extension XFree86-DRI
 [   139.239] (II) Loading extension DRI2
 [   139.816] (II) AIGLX: Screen 0 is not DRI2 capable
 [   139.816] (II) AIGLX: Screen 0 is not DRI capable
 [   139.962] (II) GLX: Initialized DRISWRAST GL provider for screen 0

Otherwise no (EE) in there and no more (WW) lines.

So, many thanks for this improvement alone (factor 12 against software renderer only).

How can I address this firmware problem ("Failed to load firmware")? Why is it the R600_rlc.bin and not the R700_rlc.bin? Is there a newer/better one around?

Anything more I can do or test?

cu, RandomCore
Comment 4 Michel Dänzer 2011-09-02 07:59:40 UTC
(In reply to comment #3)
> I installed firmware-linux-nonfree (Debian v0.33), added the necessary lines to
> the kernel .config to have them all included.

[...]

>  r600_cp: Failed to load firmware "radeon/R600_rlc.bin"

Well, at least this one is missing.
Comment 5 RandomCore 2011-09-02 08:42:15 UTC
You were right; partly. It was tehre, but I guess the pathes in the kernel build got mixed up. Since I didn't know which firmware to include I included all, whihc made the string constant too long and the make fell back to configuration. So I changed the _DIR to "/lib/firmware/radeon" and added the firmwares without "radeon/" as prefix. Well, seems to have messed up the build process.

Anyway, I did a mrproper and just included the R*.bin files. Here's the outcome:

 $ dmesg|grep drm
 [drm] Initialized drm 1.1.0 20060810
 [drm] radeon defaulting to kernel modesetting.
 [drm] radeon kernel modesetting enabled.
 fb: conflicting fb hw usage radeondrmfb vs VESA VGA - removing generic driver
 [drm] initializing kernel modesetting (RS880 0x1002:0x9714).
 [drm] register mmio base: 0xFE6F0000
 [drm] register mmio size: 65536
 [drm] Detected VRAM RAM=368M, BAR=256M
 [drm] RAM width 32bits DDR
 [drm] radeon: 368M of VRAM memory ready
 [drm] radeon: 512M of GTT memory ready.
 [drm] Supports vblank timestamp caching Rev 1 (10.10.2010).
 [drm] Driver supports precise vblank timestamp query.
 [drm] radeon: irq initialized.
 [drm] GART: num cpu pages 131072, num gpu pages 131072
 [drm] Loading RS780 Microcode
 [drm:r600_ring_test] *ERROR* radeon: ring test failed (scratch(0x8504)=0xCAFEDEAD)
 [drm] Radeon Display Connectors
 [drm] Connector 0:
 [drm]   VGA
 [drm]   DDC: 0x7e40 0x7e40 0x7e44 0x7e44 0x7e48 0x7e48 0x7e4c 0x7e4c
 [drm]   Encoders:
 [drm]     CRT1: INTERNAL_KLDSCP_DAC1
 [drm] Connector 1:
 [drm]   DVI-D
 [drm]   HPD3
 [drm]   DDC: 0x7e50 0x7e50 0x7e54 0x7e54 0x7e58 0x7e58 0x7e5c 0x7e5c
 [drm]   Encoders:
 [drm]     DFP1: INTERNAL_KLDSCP_LVTMA
 [drm] radeon: power management initialized
 [drm] fb mappable at 0xD0141000
 [drm] vram apper at 0xD0000000
 [drm] size 9216000
 [drm] fb depth is 24
 [drm]    pitch is 7680
 fb: conflicting fb hw usage radeondrmfb vs VESA VGA - removing generic driver
 fbcon: radeondrmfb (fb1) is primary device
 fb1: radeondrmfb frame buffer device
 drm: registered panic notifier
 [drm] Initialized radeon 2.10.0 20080528 for 0000:01:05.0 on minor 0

I guess a failing ring-test is not that good. Performance (glxgears) is still around 730 FPS.

Which firmwares shall I include for my HD4290 / RS880?

Shall I disable the VESA console fb device?

Oh, and there was no 30s pause anymore.

cu, RandomCore
Comment 6 RandomCore 2011-09-02 08:58:08 UTC
ok, Got it now.

I disabled the VESA fb framebuffer and added the radeonfb instead (want my penguins during boot). This did it.

 [    51.021] (II) AIGLX: enabled GLX_MESA_copy_sub_buffer
 [    51.021] (II) AIGLX: enabled GLX_INTEL_swap_event
 [    51.021] (II) AIGLX: enabled GLX_SGI_swap_control and GLX_MESA_swap_control
 [    51.021] (II) AIGLX: enabled GLX_SGI_make_current_read
 [    51.021] (II) AIGLX: GLX_EXT_texture_from_pixmap backed by buffer objects
 [    51.022] (II) AIGLX: Loaded and initialized /usr/lib/i386-linux-gnu/dri/r600_dri.so
 [    51.022] (II) GLX: Initialized DRI2 GL provider for screen 0

Confirmation through
 $ glxinfo|grep render
 direct rendering: Yes
 OpenGL renderer string: Gallium 0.4 on AMD RS880

glxgears tells me it sync with the monitor now (and does indeed 60 FPS, but even on fullscreen).

For those google'ing for answers, here's the dmesg bootlog from this one:

 $ grep drm dmesg_bootlog_20110902_1746 
 [drm] Initialized drm 1.1.0 20060810
 [drm] radeon defaulting to kernel modesetting.
 [drm] radeon kernel modesetting enabled.
 [drm] initializing kernel modesetting (RS880 0x1002:0x9714).
 [drm] register mmio base: 0xFE6F0000
 [drm] register mmio size: 65536
 [drm] Detected VRAM RAM=368M, BAR=256M
 [drm] RAM width 32bits DDR
 [drm] radeon: 368M of VRAM memory ready
 [drm] radeon: 512M of GTT memory ready.
 [drm] Supports vblank timestamp caching Rev 1 (10.10.2010).
 [drm] Driver supports precise vblank timestamp query.
 [drm] radeon: irq initialized.
 [drm] GART: num cpu pages 131072, num gpu pages 131072
 [drm] Loading RS780 Microcode
 [drm] ring test succeeded in 0 usecs
 [drm] radeon: ib pool ready.
 [drm] ib test succeeded in 0 usecs
 [drm] Radeon Display Connectors
 [drm] Connector 0:
 [drm]   VGA
 [drm]   DDC: 0x7e40 0x7e40 0x7e44 0x7e44 0x7e48 0x7e48 0x7e4c 0x7e4c
 [drm]   Encoders:
 [drm]     CRT1: INTERNAL_KLDSCP_DAC1
 [drm] Connector 1:
 [drm]   DVI-D
 [drm]   HPD3
 [drm]   DDC: 0x7e50 0x7e50 0x7e54 0x7e54 0x7e58 0x7e58 0x7e5c 0x7e5c
 [drm]   Encoders:
 [drm]     DFP1: INTERNAL_KLDSCP_LVTMA
 [drm] radeon: power management initialized
 [drm] fb mappable at 0xD0141000
 [drm] vram apper at 0xD0000000
 [drm] size 9216000
 [drm] fb depth is 24
 [drm]    pitch is 7680
 fbcon: radeondrmfb (fb0) is primary device
 fb0: radeondrmfb frame buffer device
 drm: registered panic notifier
 [drm] Initialized radeon 2.10.0 20080528 for 0000:01:05.0 on minor 0

Thank you Alex, thank you Michel and all those who (silently) contributed. Cool software indeed. All in all it was my inability to get it configured.

cu, RandomCore
Comment 7 Alex Deucher 2011-09-02 09:05:51 UTC
(In reply to comment #6)
> ok, Got it now.
> 
> I disabled the VESA fb framebuffer and added the radeonfb instead (want my
> penguins during boot). This did it.

You don't need radeonfb; it doesn't even support your chip.  The radeon KMS drm provides a fb interface itself.  radeonfb is an old fbdev driver from the pre-KMS days and will conflict with the kms drm on chips supported by both.


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.