Bug 106890 - 32bit DRI on AMD64 broken (mga driver)
Summary: 32bit DRI on AMD64 broken (mga driver)
Status: RESOLVED FIXED
Alias: None
Product: SUSE LINUX 10.0
Classification: openSUSE
Component: X.Org (show other bugs)
Version: Beta 2
Hardware: Other All
: P2 - High : Normal
Target Milestone: ---
Assignee: Stefan Dirsch
QA Contact: Stefan Dirsch
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-08-23 21:56 UTC by Stefan Dirsch
Modified: 2005-09-11 16:26 UTC (History)
3 users (show)

See Also:
Found By: Other
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments
Make dri structure identical in size on 32 and 64 bit. (1.09 KB, patch)
2005-08-30 10:56 UTC, Egbert Eich
Details | Diff
Required mga DRI driver patch (1.20 KB, patch)
2005-09-01 10:39 UTC, Stefan Dirsch
Details | Diff
New mga DRI driver with above patch applied (1.94 MB, application/octet-stream)
2005-09-01 10:40 UTC, Stefan Dirsch
Details
New mga DRI driver patch to be applied for i386 (2.39 KB, patch)
2005-09-10 17:36 UTC, Stefan Dirsch
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan Dirsch 2005-08-23 21:56:54 UTC
Looks like 32bit DRI on AMD64 is currently broken. I only tested mga driver up 
to now. I'll provide details ASAP and test other drivers (i810, radeon) as 
well.
Comment 1 Stefan Dirsch 2005-08-25 13:57:47 UTC
Works fine with i915 DRI driver (tested on Intel 945G). So it's probably a mga
(DRI) driver problem.
Comment 2 Stefan Dirsch 2005-08-26 17:40:18 UTC
Works also with the radeon driver (tested on Radeon 9000). I don't think it's
worth to investigate the matrox problem (BTW, I tested on a G450) since I don't
think there are or ever has been any machines on the market with G450/G550 inside.
But it might make sense to removed the mga hunks from the X.Org/kernel patch.
Egbert, what do you think?
Comment 3 Egbert Eich 2005-08-30 10:51:06 UTC
You need two fixes for mga (Mesa and X driver).
The first one is for Mesa. It's really simple and it may also work without it
(although it's safer to use it):
--- ../unpatched/Mesa/src/mesa/drivers/dri/mga/mga_xmesa.c      2004-12-16 01:23
:47.000000000 +0100
+++ Mesa/src/mesa/drivers/dri/mga/mga_xmesa.c   2005-04-05 21:26:38.000000000 +0
200
@@ -612,8 +612,7 @@
    _tnl_allow_pixel_fog( ctx, GL_FALSE );
    _tnl_allow_vertex_fog( ctx, GL_TRUE );
 
-   mmesa->primary_offset = mmesa->mgaScreen->primary.handle;
-
+   mmesa->primary_offset = drmAgpBase(sPriv->fd);
    ctx->DriverCtx = (void *) mmesa;
    mmesa->glCtx = ctx;
 
I'm going to attach a copy of the second one.
Comment 4 Egbert Eich 2005-08-30 10:56:06 UTC
Created attachment 48140 [details]
Make dri structure identical in size on 32 and 64 bit.

Please note: This structure is used for data shared between server and Mesa DRI
client.
Therefore it has to be changed in the X driver and the Mesa driver. The header
file can simply be copied from the X driver to Mesa:
(Mesa/src/mesa/drivers/dri/mga/server)
Comment 5 Stefan Dirsch 2005-08-30 15:47:39 UTC
All your hunks are already included in out 32bit client patch
--> ps_x86-64_ioctl32.diff

So this won't help. :-(
Comment 6 Stefan Dirsch 2005-09-01 09:32:35 UTC
We probably need the changes in structure and func calls also in 32bit mga DRI
driver. Building and testing right now.
Comment 7 Stefan Dirsch 2005-09-01 09:59:44 UTC
Build is still running. I only wanted to mention the old error message:

# LIBGL_DEBUG=1 glxinfo
libGL error: 
Couldn't map MMIO registers
libGL warning: 3D driver returned no fbconfigs.
libGL error: InitDriver failed
libGL error: reverting to (slow) indirect rendering
name of display: :0.0
display: :0  screen: 0
direct rendering: No


Comment 8 Stefan Dirsch 2005-09-01 10:04:33 UTC
Unfortunately I get the same error message with the new DRI driver with the
patch applied. :-(
Comment 9 Stefan Dirsch 2005-09-01 10:39:25 UTC
Created attachment 48427 [details]
Required mga DRI driver patch
Comment 10 Stefan Dirsch 2005-09-01 10:40:58 UTC
Created attachment 48428 [details]
New mga DRI driver with above patch applied
Comment 12 Stefan Dirsch 2005-09-10 17:36:08 UTC
Created attachment 49518 [details]
New mga DRI driver patch to be applied for i386

Additionally I replaced "drm_handle_t" with "drmHandle" in both "mga_dri.h" in
ps_x86-64_ioctl32.diff patch, which is still only applied for x86_64.
Comment 13 Stefan Dirsch 2005-09-10 17:39:40 UTC
This still needs to be tested on a 32bit and 64bit system. 
 
Comment 14 Stefan Dirsch 2005-09-11 15:45:19 UTC
Wow, my patches fix 32/64bit apps on x86_64. Tests with 32bit apps on i386 will
follow.
Comment 15 Stefan Dirsch 2005-09-11 16:26:24 UTC
> Tests with 32bit apps on i386 will follow.

Works as well. New xorg-x11 package submitted now.