Bug 11700

Summary: intel driver fails to init DRM memory manager
Product: DRI Reporter: Tobias Jakobi <liquid.acid>
Component: libdrmAssignee: Default DRI bug account <dri-devel>
Status: RESOLVED FIXED QA Contact:
Severity: major    
Priority: medium    
Version: DRI git   
Hardware: x86 (IA32)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Attachments:
Description Flags
xorg log when the new 3D driver is activated
none
xorg configuration file
none
xorg log when using legacy 3D - direct rendering works
none
xorg log when having XXA enabled instead
none
glxgears output with LIBGL_DEBUG=verbose
none
glxinfo with LIBGL_DEBUG=verbose
none
xorg log when linked with correct libdrm.so
none
kernel log when executing glxinfo and glxgears none

Description Tobias Jakobi 2007-07-23 08:44:50 UTC
Hi there!

I just updated everything gfx-related (Xorg intel driver, mesa, libdrm and drm kernel module) to GIT to check if my (previously reported) problem was fixed. Now I can compile everything, but I still won't get 3D acceleration.

The intel driver reports that it can't init the DRM memory manager, so I suspect this has something to do with libdrm. I'm using the "new" 3D support, not the legacy one.

The legacy one works smooth but it is a bit too slow for serious gaming :)

I'm attaching a copy of the Xorg log, the xorg.conf and another log when legacy support is enabled.
Anything else I can test?

Thanks,
Tobias

uname -a:
Linux leena 2.6.21-gentoo-r4 #1 PREEMPT Fri Jul 13 17:10:07 CEST 2007 i686 Intel(R) Celeron(R) M processor 1.50GHz GenuineIntel GNU/Linux
Comment 1 Tobias Jakobi 2007-07-23 08:45:53 UTC
Created attachment 10843 [details]
xorg log when the new 3D driver is activated

this the log when it fails (DRM init error resulting in no direct rendering)
Comment 2 Tobias Jakobi 2007-07-23 08:47:09 UTC
Created attachment 10844 [details]
xorg configuration file

contains the general config (new 3D enabled, and EXA enabled)
I'll check if switching from EXA to XXA does something for me...
Comment 3 Tobias Jakobi 2007-07-23 08:52:04 UTC
Created attachment 10845 [details]
xorg log when using legacy 3D - direct rendering works
Comment 4 Tobias Jakobi 2007-07-23 08:52:44 UTC
Created attachment 10846 [details]
xorg log when having XXA enabled instead

still cannot init DRM when new memory manager is used
Comment 5 Michel Dänzer 2007-07-23 08:59:00 UTC
Is the X server using libdrm.so.2 built from GIT?
Comment 6 Tobias Jakobi 2007-07-23 09:46:27 UTC
No, xorg-server was build from the normal gentoo ebuild (version 1.3.0.0). Actually I don't have a good GIT-ebuild to do the job (and I really don't want to update the whole system to bleading edge versions).
Comment 7 Michel Dänzer 2007-07-23 09:49:31 UTC
(In reply to comment #6)
> No, xorg-server was build from the normal gentoo ebuild (version 1.3.0.0).

Shouldn't matter, just make sure it (specifically the libdri.so module) picks up the libdrm.so.2 built from GIT at runtime.
Comment 8 Tobias Jakobi 2007-07-23 09:52:03 UTC
Ah yes, could the problem be related to this commit?
http://gitweb.freedesktop.org/?p=xorg/driver/xf86-video-intel.git;a=commit;h=1e169be25b2e4ab34afd4b8ae8ae0041f6069125

What I have done is renaming the libdrm.so.2.3.0 to libdrm.so.2.3.1 (correcting the various symlinks) and then rebuilding xf86-video-i810 (ebuild name for the intel xorg driver). AFAIK the make process checks for the libdrm version number, correct?
Maybe renaming the lib doesn't do the trick...
Comment 9 Tobias Jakobi 2007-07-23 09:55:57 UTC
(In reply to comment #7)
> (In reply to comment #6)
> > No, xorg-server was build from the normal gentoo ebuild (version 1.3.0.0).
> 
> Shouldn't matter, just make sure it (specifically the libdri.so module) picks
> up the libdrm.so.2 built from GIT at runtime.
> 

What I have done:
1) Shutting down the gdm login manager (-> Xorg shutdown)
2) Removing i195 and drm kernel module
3) Building from GIT
4) Renaming lib and correcting symlinks
5) running ldconfig
6) Building intel driver from GIT
7) Updating kernel module dependencies (because of the drm kernel module)
8) Starting login manager (-> Xorg startup -> loading i915 and drm kernel module)

How do I make really sure that libdri links to the correct file?
Comment 10 Michel Dänzer 2007-07-23 10:05:12 UTC
(In reply to comment #9)
> 
> How do I make really sure that libdri links to the correct file?

What does

ldd /path/to/libdri.so | grep drm

say? Assuming it points at the right symlink, does that point to the correct file (still)?
Comment 11 Tobias Jakobi 2007-07-23 10:38:28 UTC
ldd /usr/lib/xorg/modules/extensions/libdri.so | grep drm:
libdrm.so.2 => /lib/libdrm.so.2 (0xb7f98000)

And this is strange, there are libdrm libraries in both /lib and /usr/lib

ls -l /lib/libdrm*:
-rwxr-xr-x 1 root root    768 2007-06-02 15:18 /lib/libdrm.la
lrwxrwxrwx 1 root root     15 2007-06-02 15:18 /lib/libdrm.so -> libdrm.so.2.3.0
lrwxrwxrwx 1 root root     15 2007-06-02 15:18 /lib/libdrm.so.2 -> libdrm.so.2.3.0
-rwxr-xr-x 1 root root 114308 2007-06-02 15:18 /lib/libdrm.so.2.3.0

ls -l /usr/lib/libdrm*:
-rw-r--r-- 1 root root   772 2007-07-23 16:55 /usr/lib/libdrm.la
lrwxrwxrwx 1 root root    15 2007-07-23 17:29 /usr/lib/libdrm.so -> libdrm.so.2.3.1
lrwxrwxrwx 1 root root    15 2007-07-23 17:29 /usr/lib/libdrm.so.2 -> libdrm.so.2.3.1
-rwxr-xr-x 1 root root 34812 2007-07-23 16:55 /usr/lib/libdrm.so.2.3.1

Hmm... going to check this...
Comment 12 Tobias Jakobi 2007-07-23 11:44:36 UTC
OK, here we go:

I removed the libdrm files from /lib and also from /usr/lib and recompiled everything:
libdrm
drm kernel module
mesa
xorg-server
xf86-video-i810 (after renaming libdrm.so.2.3.0)

Now libdri.so links to /usr/lib/libdrm.so.2 and the X-server starts normally with the new 3D driver activated. glxinfo reports that direct rendering is on.

BUT glxgears won't work (log attached) and starting quake3 locks up the system to bad I can only use magic sysrq to restart it (vt switch won't work).

Any ideas?
Comment 13 Tobias Jakobi 2007-07-23 11:45:22 UTC
Created attachment 10853 [details]
glxgears output with LIBGL_DEBUG=verbose
Comment 14 Tobias Jakobi 2007-07-23 11:45:47 UTC
Created attachment 10854 [details]
glxinfo with LIBGL_DEBUG=verbose
Comment 15 Tobias Jakobi 2007-07-23 11:47:46 UTC
Created attachment 10856 [details]
xorg log when linked with correct libdrm.so

and it still crashes...
Comment 16 Tobias Jakobi 2007-07-23 14:41:12 UTC
Created attachment 10860 [details]
kernel log when executing glxinfo and glxgears

I enabled debug in the drm module and started a failsafe session in gdm:
1) run glxinfo
2) run glxgears
3) switch to VT
4) get kernel log and shutdown X
Comment 17 Tobias Jakobi 2007-07-30 06:45:58 UTC
The bug seems to be fixed by my latest GIT upgrade from yesterday.
Updated:
xf86-video-intel
libdrm
drm kernel module
mesa

I think it's unnecessary to do a bisect to find the commit that solves this for me. ;-)

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.