You are not logged in.

#1 2010-09-12 02:05:08

kagerato
Member
Registered: 2007-09-10
Posts: 45
Website

[SOLVED] Radeon X700 Kernel Mode Setting

UPDATE: See my most recent post at bottom for the solution to this issue.

Reinstalled Arch recently, and my first mission has been to see whether I can get kernel mode setting working on this old desktop GPU.  It doesn't work out of box, which is sad because the X.org Radeon Feature Matrix claims it is supported.  (Indeed, it says essentially all Radeon chips support KMS now.)

The GPU itself is a Radeon X550/X700 Series according to both X and Windows 7.  I seem to recall having purchased an X800, but it was years ago now and my memory may be faulty.  It is definitely a PCI-Express card, since the motherboard does not have AGP.

During boot, the kernel presents these messages:

[drm] Initialized drm 1.1.0 20060810
[drm] radeon defaulting to kernel modesetting.
[drm] radeon kernel modesetting enabled.
radeon 0000:02:00.0: PCI INT A -> Link[APC6] -> GSI 16 (level, low) -> IRQ 16
radeon 0000:02:00.0: setting latency timer to 64
[drm] initializing kernel modesetting (RV380 0x1002:0x5657).
[drm] register mmio base: 0xFDDF0000
[drm] register mmio size: 65536
radeon 0000:02:00.0: Expecting combios for RS400/RS480 GPU
radeon 0000:02:00.0: Fatal error during GPU init
[drm] radeon: finishing device.
[TTM] Memory type 2 has not been initialized.
[drm] radeon: cp finalized
radeon 0000:02:00.0: PCI INT A disabled
radeon: probe of 0000:02:00.0 failed with error -22

Now, this is simply bizarre for several reasons.  First, the kernel reports two different identifiers: RV380 and RS400/RS480.  It can't be both, correct?  Second, X disagrees with this -- it thinks the card is an RV410.  Third, what is a 'combios'?  Firmware?  Haven't heard of this term anywhere, and apparently neither has Google.  Indeed, if you search for the full phrase "combios for RS400/RS480", the leading results are right to C source code that generates the message.  Splendid.

X doesn't offer much more help, except to inform me that my 3D is also broken.  Might that be the round-about cause of KMS failing?

[    37.254] (WW) The directory "/usr/share/fonts/OTF/" does not exist.
[    37.254] (WW) The directory "/usr/share/fonts/Type1/" does not exist.
[    37.293] (WW) Open ACPI failed (/var/run/acpid.socket) (No such file or directory)
[    37.421] (WW) Falling back to old probe method for vesa
[    37.421] (WW) Falling back to old probe method for fbdev
[    38.001] (WW) RADEON(0): Direct rendering disabled
[    37.577] (EE) RADEON(0): [dri] RADEONDRIGetVersion failed to open the DRM
[dri] Disabling DRI.

Hoping to make some progress, I tried booting from an alternate custom kernel I originally built in ubuntu.  This kernel is version 2.6.35.4, which is just slightly newer than the Arch stock kernel.  The main differences between the two are: {1} minimal drivers and config, {2} video drivers and support code built-in, {3} radeon firmware built-in, {4} no initrd.

Unfortunately, the errors are exactly the same.  In case you'd like to look for yourself, I've posted the full dmesg of both to paste bin as well as my X.org log.

Arch Stock Kernel dmesg
Custom Kernel dmesg
X.org Log

Here are the versions of some relevant installed packages:

Linux 2.6.35
ati-dri 7.8.2-1
libgl 7.8.2-1
libdrm 2.4.21-2
mesa 7.8.2-1
xf86-video-ati 6.13.1-1
xorg-server 1.8.1.902-1

As to the X configuration, there is no xorg.conf and the only files in xorg.conf.d are for input.  Nothing special is being passed on the kernel command line, either -- though I've tried removing all vga= , video= , and similar options without useful result.  KMS doesn't work in ubuntu either, which suggests to me that this is an upstream issue.

Any help is appreciated, even if it's merely an explanation of what is actually going on here.

Last edited by kagerato (2010-09-27 04:37:47)

Offline

#2 2010-09-12 10:00:06

thn81
Member
Registered: 2009-08-27
Posts: 88

Re: [SOLVED] Radeon X700 Kernel Mode Setting

I might be wrong but as far as I understand it, there are two types of BIOS'es on Radeon cards: the older COMbios type which is found at least on cards up to Radeon 9800 (R300 type), and the newer AtomBios. The message you get in your log file

Expecting combios for RS400/RS480 GPU

is actually an error message which means that the driver expects the older COMbios for your card but detected the AtomBios (if I understand the driver source code correctly). There is a module parameter for the radeon DRM module, "r4xx_atom" which (if set to 1) tells the driver to use the AtomBios for modesetting. You can try that but I don't know if it will help.

thn81

Offline

#3 2010-09-13 02:42:31

kagerato
Member
Registered: 2007-09-10
Posts: 45
Website

Re: [SOLVED] Radeon X700 Kernel Mode Setting

Tried adding "radeon.r4xx_atom=1" to both the stock and custom kernel command lines.  No apparent change, even in the messages.  (Double-checked the option was passed correctly in the dmesg output.)

This option does exist, as I can see in the kernel source code.  It mainly seems to change how some structures are initialized.

Since changing this did not work, I'm all the more inclined now to think this a fundamental problem of misreading the card model outright.  The X.org man page for Radeon Video Driver clearly shows that RS400/RS480 corresponds to "Radeon XPRESS 200(M)/1100 IGP", which is certainly incorrect.  RV380, which the kernel echoes on the modesetting initialization line, corresponds to Radeon X600.  Ninety-nine percent sure that's not right either.  X thinks it's RV410 Radeon X700.  Probably that or R420 is correct.

One other odd thing...does anyone find that drm version string odd?  1.1.0, 2006 08 10?  Somehow I rather doubt the code has not changed at all in four years.  Although it is also implausible that the maintainer forgot to update the version for that long.

I've heard of a distinction between DRI 1 and DRI 2.  Might this have some connection to that?

Offline

#4 2010-09-27 04:36:48

kagerato
Member
Registered: 2007-09-10
Posts: 45
Website

Re: [SOLVED] Radeon X700 Kernel Mode Setting

The problem was upstream, as I suspected.  This particular card is misidentified in a header related to the Direct Rendering Manager (DRM).  If anyone else has this card and is facing this issue, please check out:

Kernel Bugzilla, Bug 19012: Kernel Mode Setting Fails on Radeon X700 .

The fix is pretty trivial, basically a one line change:

diff --git a/include/drm/drm_pciids.h b/include/drm/drm_pciids.h
index 3a9940e..7ad4dba 100644
--- a/include/drm/drm_pciids.h
+++ b/include/drm/drm_pciids.h
@@ -85,7 +85,7 @@
     {0x1002, 0x5460, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV380|RADEON_IS_MOBILITY}, \
     {0x1002, 0x5462, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV380|RADEON_IS_MOBILITY}, \
     {0x1002, 0x5464, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV380|RADEON_IS_MOBILITY}, \
-    {0x1002, 0x5657, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV380|RADEON_NEW_MEMMAP}, \
+    {0x1002, 0x5657, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV410|RADEON_NEW_MEMMAP}, \
     {0x1002, 0x5548, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R423|RADEON_NEW_MEMMAP}, \
     {0x1002, 0x5549, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R423|RADEON_NEW_MEMMAP}, \
     {0x1002, 0x554A, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R423|RADEON_NEW_MEMMAP}, \

In case you're not familiar with diff or patch formats, basically all this does is change RV380 to RV410 on one line in ${kernel_source_tree}/include/drm/drm_pciids.h .  This RV410 is an AtomBIOS chip, not a ComBIOS (so thn81 had the right idea).  It's also pretty rare.

In order to use the patch, save it into a text file like "radeon_drm_fix.patch".  Then copy the file to the base of the extracted kernel source tree (I used version 2.6.35.5) and issue this command:

patch -p1 < radeon_drm_fix.patch

Naturally you must have the patch program installed for this to work.  Once the patch is successfully applied, do:

make clean
make
make modules_install
make install

This will build and install the new kernel.  Reconfigure grub to be able to load it, and kernel mode setting should be working fine.  In my case, it also mostly fixed 3D in X.  Some games crash, but I'm not sure whether it's the games or the driver -- some other games do not crash at all, even if run for a long time.

Kernel mode setting is really sweet; virtual terminals and X transition almost instantaneously.  Nothing like the old two second delays.  I've been waiting for this feature for ages, so it was great to see such a fast and effective response from the kernel developers.

Offline

Board footer

Powered by FluxBB