Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 136315 - media-libs/mesa-6.5-r3 needs to be updated
Summary: media-libs/mesa-6.5-r3 needs to be updated
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo X packagers
URL: https://bugs.freedesktop.org/show_bug...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-06-10 12:21 UTC by Priit Laes (IRC: plaes)
Modified: 2006-07-31 11:24 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Priit Laes (IRC: plaes) 2006-06-10 12:21:37 UTC
After installing latest x11-drm snapshot, I did get following messages in kernel log and glx-using apps didn't work at all:
[drm:r300_emit_3d_load_vbpntr] *ERROR* Offset failed range check (k=0 i=2) while processing 3D_LOAD_VBPNTR packet.
[drm:r300_emit_packet3] *ERROR* r300_emit_raw_packet3 failed
[drm:r300_do_cp_cmdbuf] *ERROR* r300_emit_packet3 failed
[drm:r300_emit_3d_load_vbpntr] *ERROR* Offset failed range check (k=0 i=2) while processing 3D_LOAD_VBPNTR packet.
[drm:r300_emit_packet3] *ERROR* r300_emit_raw_packet3 failed
[drm:r300_do_cp_cmdbuf] *ERROR* r300_emit_packet3 failed
[drm:r300_emit_3d_load_vbpntr] *ERROR* Offset failed range check (k=0 i=2) while processing 3D_LOAD_VBPNTR packet.
[drm:r300_emit_packet3] *ERROR* r300_emit_raw_packet3 failed
[drm:r300_do_cp_cmdbuf] *ERROR* r300_emit_packet3 failed
[drm:r300_emit_3d_load_vbpntr] *ERROR* Offset failed range check (k=0 i=2) while processing 3D_LOAD_VBPNTR packet.
[drm:r300_emit_packet3] *ERROR* r300_emit_raw_packet3 failed
[drm:r300_do_cp_cmdbuf] *ERROR* r300_emit_packet3 failed

Then I tried upgrading to both x11-drm and Mesa CVS to get things working again.

Also, x11-drm installs drivers to  /lib/modules/${kernelversion}/x11-drm directory. This means when the in-kernel drm modules are also compiled, the new modules won't get picked up.
Comment 1 Jochen Trumpf 2006-06-17 00:51:32 UTC
I can confirm this. There is even an upstream bug report:
https://bugs.freedesktop.org/show_bug.cgi?id=6241

I don't see how the kernel module path is related to this, though. Maybe the x11-drm ebuild could check if the current kernel has drm compiled in/as module and bail out if it does? ieee80211 does a similar thing.
Comment 2 Priit Laes (IRC: plaes) 2006-07-18 22:47:34 UTC
Also happens with sys-kernel/gentoo-sources-2.6.17-r3
Comment 3 Joshua Baergen (RETIRED) gentoo-dev 2006-07-19 18:28:48 UTC
I'd appreciate it if someone could track down the patch that went into CVS to fix this issue.
Comment 4 Jochen Trumpf 2006-07-21 04:07:49 UTC
I think it is this one:

--- radeon_screen.c.1.59        2006-07-21 21:00:59.000000000 +1000
+++ radeon_screen.c.1.60        2006-07-21 21:00:45.000000000 +1000
@@ -351,8 +351,6 @@
         return NULL;
       }

-      if (sPriv->drmMinor >= 6) {
-
         ret = radeonGetParam( sPriv->fd, RADEON_PARAM_GART_BASE,
                            &screen->gart_base);
         if (ret) {
@@ -375,7 +373,6 @@
         screen->drmSupportsPointSprites = (sPriv->drmMinor >= 13);
         screen->drmSupportsCubeMapsR100 = (sPriv->drmMinor >= 15);
       }
-   }

    screen->mmio.handle = dri_priv->registerHandle;
    screen->mmio.size   = dri_priv->registerSize;
@@ -428,9 +425,7 @@
         return NULL;
       }

-      screen->gart_texture_offset = dri_priv->gartTexOffset + (( screen->card_type == RADEON_CARD_PCI)
-               ? INREG( RADEON_AIC_LO_ADDR )
-               : ( ( INREG( RADEON_MC_AGP_LOCATION ) & 0x0ffffU ) << 16 ) );
+      screen->gart_texture_offset = dri_priv->gartTexOffset + screen->gart_base;
    }

    screen->chip_flags = 0;
@@ -979,12 +974,12 @@
    static const char *driver_name = "Radeon";
    static const __DRIutilversion2 ddx_expected = { 4, 5, 0, 0 };
    static const __DRIversion dri_expected = { 4, 0, 0 };
-   static const __DRIversion drm_expected = { 1, 3, 0 };
+   static const __DRIversion drm_expected = { 1, 6, 0 };
 #elif RADEON_COMMON && defined(RADEON_COMMON_FOR_R200)
    static const char *driver_name = "R200";
    static const __DRIutilversion2 ddx_expected = { 4, 5, 0, 0 };
    static const __DRIversion dri_expected = { 4, 0, 0 };
-   static const __DRIversion drm_expected = { 1, 5, 0 };
+   static const __DRIversion drm_expected = { 1, 6, 0 };
 #elif RADEON_COMMON && defined(RADEON_COMMON_FOR_R300)
    static const char *driver_name = "R300";
    static const __DRIutilversion2 ddx_expected = { 4, 5, 0, 0 };

The file is /Mesa/src/mesa/drivers/dri/radeon/radeon_screen.c

And the comment in cvs is
"use gart base from drm not try to work it out ourselves.. bump radeon client
to need 1.6 drm where this first appeared.. this fixes r300 on PCIE"

It is the only commit of Dave Airlie on that day that mentions PCIE.

Hope that helps.
Comment 5 Joshua Baergen (RETIRED) gentoo-dev 2006-07-21 17:35:28 UTC
Could someone try that patch and see if it helps?
Comment 6 Jochen Trumpf 2006-07-28 03:19:22 UTC
I had to tweak the patch a bit so that it applies cleanly:

--- src/mesa/drivers/dri/radeon/radeon_screen.c
+++ src/mesa/drivers/dri/radeon/radeon_screen.c
@@ -343,7 +343,6 @@
         return NULL;
       }

-      if (sPriv->drmMinor >= 6) {
         gp.param = RADEON_PARAM_GART_BASE;
         gp.value = &screen->gart_base;

@@ -371,7 +370,6 @@
         screen->drmSupportsFragShader = (sPriv->drmMinor >= 18);
         screen->drmSupportsPointSprites = (sPriv->drmMinor >= 13);
         screen->drmSupportsCubeMapsR100 = (sPriv->drmMinor >= 15);
-      }
    }

    screen->mmio.handle = dri_priv->registerHandle;
@@ -425,9 +423,7 @@
         return NULL;
       }

-      screen->gart_texture_offset = dri_priv->gartTexOffset + ( screen->IsPCI
-               ? INREG( RADEON_AIC_LO_ADDR )
-               : ( ( INREG( RADEON_MC_AGP_LOCATION ) & 0x0ffffU ) << 16 ) );
+      screen->gart_texture_offset = dri_priv->gartTexOffset + screen->gart_base;
    }

    screen->chip_flags = 0;
@@ -976,12 +972,12 @@
    static const char *driver_name = "Radeon";
    static const __DRIutilversion2 ddx_expected = { 4, 5, 0, 0 };
    static const __DRIversion dri_expected = { 4, 0, 0 };
-   static const __DRIversion drm_expected = { 1, 3, 0 };
+   static const __DRIversion drm_expected = { 1, 6, 0 };
 #elif RADEON_COMMON && defined(RADEON_COMMON_FOR_R200)
    static const char *driver_name = "R200";
    static const __DRIutilversion2 ddx_expected = { 4, 5, 0, 0 };
    static const __DRIversion dri_expected = { 4, 0, 0 };
-   static const __DRIversion drm_expected = { 1, 5, 0 };
+   static const __DRIversion drm_expected = { 1, 6, 0 };
 #elif RADEON_COMMON && defined(RADEON_COMMON_FOR_R300)
    static const char *driver_name = "R300";
    static const __DRIutilversion2 ddx_expected = { 4, 5, 0, 0 };

The functionality should be identical. The code now cleanly compiles and the bug described above is gone, i.e. glxgears starts fine. I am no expert in mesa, though, so I wouldn't know if it is a proper fix.
Comment 7 Joshua Baergen (RETIRED) gentoo-dev 2006-07-29 11:29:33 UTC
Alright, thanks Jochen.  This has been added in r4.

Priit, let me know if mesa-6.5-r4 fixes this problem for you too.
Comment 8 Priit Laes (IRC: plaes) 2006-07-31 11:24:13 UTC
Looks good!

Thanks Jochen and Joshua :)