Bug 23745

Summary: x11-drivers/xf86-video-ati: No DRI and wrong colors for OpenGL (Pegasos II + Radeon 9000)
Product: DRI Reporter: Johannes Geiss <johannes.geiss>
Component: DRM/otherAssignee: Default DRI bug account <dri-devel>
Status: RESOLVED FIXED QA Contact:
Severity: major    
Priority: high CC: remi
Version: XOrg 6.7.0   
Hardware: PowerPC   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:

Description Johannes Geiss 2009-09-06 08:27:21 UTC
Since the upgrade from xorg-server 1.3 to 1.5 (Gentoo distribution) the hardware acceleration for a Radeon 9000 graphics card is not working. It seems the PCI Id is wrong. It should be "pci:0001:01:08.0" but X11 tries to use "pci:0000:01:08.0".

Reproducible: Always

Steps to Reproduce:
1. Start X11, eg. startx
2. Start glxgears (wrong colors and bad performance)

Actual Results:  
The Performance of the Gfx card is very bad and all colors are wrong if you use
OpenGL (Mesa). Eg. glxgears, blender.

Expected Results:  
Performance of Gfx card as good as in xorg-sever 1.3 and correct colors.

I'm using Gentoo Linux (CPU: PowerPC G4) and updated my xorg-server to
the version 1.5.3-r6 and now my X11 performance for OpenGL
(Mesa 7.3-r1) is bad and has wrong colors (eg. glxgears).

I did a little investigation of this problem and saw this:

xorg-server-1.5.3-r6 has a library called libglx.so. This library uses 

        drmOpenOnce(NULL, "pci:0001:01:08.0", ...)

to get the graphics card.

lspci reports

        0001:01:08.0 VGA compatible controller:
        ATI Technologies Inc Radeon RV250 If [Radeon 9000] (rev 01)

So the PCI Bus ID seems to be correct.

libdrm-2.4.5 has the function drmOpenOnce(). This function goes down to
drmOpen(NULL, "pci:0001:01:08.0") and
drmOpenByBusid("pci:0001:01:08.0").

Now drmGetBusid(fd) is called and returns "pci:0000:01:08.0". Which is
wrong, because it differs from the original PCI Bus ID. So my graphics
card will not be used with hardware accelerated OpenGL.

drmGetBusid() calls the kernel module drm via IOCTL
DRM_IOCTL_GET_UNIQUE. (see file drm_ioc32.c). So is it a bug in the
kernel or libdrm?

PS: Since I have only the version numbers from the Gentoo distribution I do not know the actual XOrg version. I guess it's 6.7.0 but this could be wrong.
Comment 1 Michel Dänzer 2009-09-08 05:58:09 UTC
> all colors are wrong if you use OpenGL (Mesa).

That's bug 22767.

> drmGetBusid() calls the kernel module drm via IOCTL
> DRM_IOCTL_GET_UNIQUE. (see file drm_ioc32.c). So is it a bug in the
> kernel or libdrm?

Yes, the problem is that while the X server has been fixed to properly handle PCI domains > 0, drm_get_pci_domain() in the kernel is still hardcoded to 0. Unfortunately that can't be fixed easily, or it will break older X servers. So the fix will probably require some DRM userspace interface versioning magic.
Comment 2 Michel Dänzer 2011-02-09 02:29:18 UTC
This should be fixed with current versions of the relevant components, at least with KMS enabled.

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.