On Fri, 2002-07-12 at 14:56, Keith Whitwell wrote: > > > Looks good, but I think I've got an even better patch: > > > > http://www.penguinppc.org/~daenzer/DRI/radeon-nommio.diff > > > > I've moved the initialization and put the scratch registers right behind > > the ring read pointer, this should work with PCI GART and all kinds of > > AGP GART. I'll commit this now. > > This looks ok. The one thing I'd say is that we've added functionality to the > kernel module, so we should bump the minor version number (ie 1.4.0) -- this > means that you can test rmesa->drm.minor (or whatever) instead of firing off > the ioctl & checking for EINVAL.
Bumping the minor strikes me as overkill for this. It's not a new ioctl or something. What about the attached patch? -- Earthling Michel Dänzer (MrCooper)/ Debian GNU/Linux (powerpc) developer XFree86 and DRI project member / CS student, Free Software enthusiast
Index: lib/GL/mesa/src/drv/radeon/radeon_ioctl.c =================================================================== RCS file: /cvsroot/dri/xc/xc/lib/GL/mesa/src/drv/radeon/radeon_ioctl.c,v retrieving revision 1.19 diff -p -u -r1.19 radeon_ioctl.c --- lib/GL/mesa/src/drv/radeon/radeon_ioctl.c 11 Jul 2002 20:31:10 -0000 1.19 +++ lib/GL/mesa/src/drv/radeon/radeon_ioctl.c 13 Jul 2002 16:30:17 -0000 @@ -614,13 +614,20 @@ static int radeonWaitForFrameCompletion( int i; while ( 1 ) { - drmRadeonGetParam gp; int ret; + int minor = rmesa->dri.screen->drmMinor; + int patchlevel = rmesa->dri.screen->drmPatch; + + if (minor > 3 || (minor == 3 && patchlevel >= 2) ) { + drmRadeonGetParam gp; + + gp.param = RADEON_PARAM_LAST_FRAME; + gp.value = (int *)&frame; + ret = drmCommandWriteRead( rmesa->dri.fd, + DRM_RADEON_GETPARAM, &gp, sizeof(gp) ); + } else + ret = -EINVAL; - gp.param = RADEON_PARAM_LAST_FRAME; - gp.value = (int *)&frame; - ret = drmCommandWriteRead( rmesa->dri.fd, - DRM_RADEON_GETPARAM, &gp, sizeof(gp) ); if ( ret == -EINVAL ) { frame = INREG( RADEON_LAST_FRAME_REG ); } else if ( ret ) { @@ -824,13 +842,20 @@ static void radeonClear( GLcontext *ctx, /* Throttle the number of clear ioctls we do. */ while ( 1 ) { - drmRadeonGetParam gp; int ret; + int minor = rmesa->dri.screen->drmMinor; + int patchlevel = rmesa->dri.screen->drmPatch; + + if (minor > 3 || (minor == 3 && patchlevel >= 2) ) { + drmRadeonGetParam gp; + + gp.param = RADEON_PARAM_LAST_CLEAR; + gp.value = (int *)&clear; + ret = drmCommandWriteRead( rmesa->dri.fd, + DRM_RADEON_GETPARAM, &gp, sizeof(gp) ); + } else + ret = -EINVAL; - gp.param = RADEON_PARAM_LAST_CLEAR; - gp.value = (int *)&clear; - ret = drmCommandWriteRead( rmesa->dri.fd, - DRM_RADEON_GETPARAM, &gp, sizeof(gp) ); if ( ret == -EINVAL ) { clear = INREG( RADEON_LAST_CLEAR_REG ); } else if ( ret ) { Index: programs/Xserver/hw/xfree86/os-support/shared/drm/kernel/radeon.h =================================================================== RCS file: /cvsroot/dri/xc/xc/programs/Xserver/hw/xfree86/os-support/shared/drm/kernel/radeon.h,v retrieving revision 1.2 diff -p -u -r1.2 radeon.h --- programs/Xserver/hw/xfree86/os-support/shared/drm/kernel/radeon.h 5 Jul 2002 08:31:11 -0000 1.2 +++ programs/Xserver/hw/xfree86/os-support/shared/drm/kernel/radeon.h 13 Jul 2002 16:30:17 -0000 @@ -47,11 +47,11 @@ #define DRIVER_NAME "radeon" #define DRIVER_DESC "ATI Radeon" -#define DRIVER_DATE "20020611" +#define DRIVER_DATE "20020713" #define DRIVER_MAJOR 1 #define DRIVER_MINOR 3 -#define DRIVER_PATCHLEVEL 1 +#define DRIVER_PATCHLEVEL 2 /* Interface history: *