summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/mach64
diff options
context:
space:
mode:
authorDave Airlie <airliedfreedesktop.org>2004-02-06 00:16:26 +0000
committerDave Airlie <airliedfreedesktop.org>2004-02-06 00:16:26 +0000
commit6c7bb5ebbde6dfe19ecf0e9c6790c28b8b2e8d1e (patch)
treea3fd56662e57965b870cd20889c6d7bf89f5bcc2 /src/mesa/drivers/dri/mach64
parent0fbeff2fa2e831e45e4dc6014c8f1e6abaa44aa1 (diff)
Remove warnings from mach64 build, fix up some _SOLO stuff,
update to newer Mesa interfaces...
Diffstat (limited to 'src/mesa/drivers/dri/mach64')
-rw-r--r--src/mesa/drivers/dri/mach64/Makefile.solo1
-rw-r--r--src/mesa/drivers/dri/mach64/mach64_context.c8
-rw-r--r--src/mesa/drivers/dri/mach64/mach64_context.h2
-rw-r--r--src/mesa/drivers/dri/mach64/mach64_dd.c16
-rw-r--r--src/mesa/drivers/dri/mach64/mach64_dd.h2
-rw-r--r--src/mesa/drivers/dri/mach64/mach64_ioctl.c4
-rw-r--r--src/mesa/drivers/dri/mach64/mach64_ioctl.h4
-rw-r--r--src/mesa/drivers/dri/mach64/mach64_native_vb.c23
-rw-r--r--src/mesa/drivers/dri/mach64/mach64_native_vbtmp.h14
-rw-r--r--src/mesa/drivers/dri/mach64/mach64_screen.c82
-rw-r--r--src/mesa/drivers/dri/mach64/mach64_tex.c42
-rw-r--r--src/mesa/drivers/dri/mach64/mach64_tex.h3
-rw-r--r--src/mesa/drivers/dri/mach64/mach64_texmem.c4
-rw-r--r--src/mesa/drivers/dri/mach64/mach64_vb.c2
-rw-r--r--src/mesa/drivers/dri/mach64/server/mach64_common.h8
15 files changed, 122 insertions, 93 deletions
diff --git a/src/mesa/drivers/dri/mach64/Makefile.solo b/src/mesa/drivers/dri/mach64/Makefile.solo
index e3700f267a..9d6769917a 100644
--- a/src/mesa/drivers/dri/mach64/Makefile.solo
+++ b/src/mesa/drivers/dri/mach64/Makefile.solo
@@ -36,7 +36,6 @@ DRIVER_SOURCES = \
mach64_vb.c \
mach64_dd.c \
mach64_lock.c \
- mach64_native_vb.c \
../../common/driverfuncs.c \
../common/mm.c \
../common/utils.c \
diff --git a/src/mesa/drivers/dri/mach64/mach64_context.c b/src/mesa/drivers/dri/mach64/mach64_context.c
index 4ebca8774a..205003a851 100644
--- a/src/mesa/drivers/dri/mach64/mach64_context.c
+++ b/src/mesa/drivers/dri/mach64/mach64_context.c
@@ -139,6 +139,10 @@ GLboolean mach64CreateContext( const __GLcontextModes *glVisual,
mach64Screen = mmesa->mach64Screen = (mach64ScreenPtr)driScreen->private;
+ /* Parse configuration files */
+ driParseConfigFiles (&mmesa->optionCache, &mach64Screen->optionCache,
+ mach64Screen->driScreen->myNum, "mach64");
+
mmesa->sarea = (ATISAREAPrivPtr)((char *)driScreen->pSAREA +
sizeof(XF86DRISAREARec));
@@ -210,13 +214,11 @@ GLboolean mach64CreateContext( const __GLcontextModes *glVisual,
_swrast_allow_vertex_fog( ctx, GL_TRUE );
driInitExtensions( ctx, card_extensions, GL_TRUE );
+
mach64InitVB( ctx );
mach64InitTriFuncs( ctx );
- mach64DDInitDriverFuncs( ctx );
- mach64DDInitIoctlFuncs( ctx );
mach64DDInitStateFuncs( ctx );
mach64DDInitSpanFuncs( ctx );
- mach64DDInitTextureFuncs( ctx );
mach64DDInitState( mmesa );
mmesa->do_irqs = (mmesa->mach64Screen->irq && !getenv("MACH64_NO_IRQS"));
diff --git a/src/mesa/drivers/dri/mach64/mach64_context.h b/src/mesa/drivers/dri/mach64/mach64_context.h
index 508b4875ce..95c69270c5 100644
--- a/src/mesa/drivers/dri/mach64/mach64_context.h
+++ b/src/mesa/drivers/dri/mach64/mach64_context.h
@@ -238,7 +238,7 @@ struct mach64_context {
GLuint vertex_stride_shift;
GLuint vertex_format;
GLuint num_verts;
- char *verts;
+ GLubyte *verts;
CARD32 Color; /* Current draw color */
CARD32 ClearColor; /* Color used to clear color buffer */
diff --git a/src/mesa/drivers/dri/mach64/mach64_dd.c b/src/mesa/drivers/dri/mach64/mach64_dd.c
index 82f4c740aa..f1248bd8b7 100644
--- a/src/mesa/drivers/dri/mach64/mach64_dd.c
+++ b/src/mesa/drivers/dri/mach64/mach64_dd.c
@@ -59,7 +59,7 @@ static void mach64DDGetBufferSize( GLframebuffer *buffer,
static const GLubyte *mach64DDGetString( GLcontext *ctx, GLenum name )
{
mach64ContextPtr mmesa = MACH64_CONTEXT(ctx);
- static GLubyte buffer[128];
+ static char buffer[128];
unsigned offset;
const char * card_name = "Mach64 [Rage Pro]";
GLuint agp_mode = mmesa->mach64Screen->IsPCI ? 0 :
@@ -123,12 +123,12 @@ static void mach64DDFinish( GLcontext *ctx )
/* Initialize the driver's misc functions.
*/
-void mach64DDInitDriverFuncs( GLcontext *ctx )
+void mach64InitDriverFuncs( struct dd_function_table *functions )
{
- ctx->Driver.GetBufferSize = mach64DDGetBufferSize;
- ctx->Driver.ResizeBuffers = _swrast_alloc_buffers;
- ctx->Driver.GetString = mach64DDGetString;
- ctx->Driver.Finish = mach64DDFinish;
- ctx->Driver.Flush = mach64DDFlush;
- ctx->Driver.Error = NULL;
+ functions->GetBufferSize = mach64DDGetBufferSize;
+ functions->ResizeBuffers = _swrast_alloc_buffers;
+ functions->GetString = mach64DDGetString;
+ functions->Finish = mach64DDFinish;
+ functions->Flush = mach64DDFlush;
+
}
diff --git a/src/mesa/drivers/dri/mach64/mach64_dd.h b/src/mesa/drivers/dri/mach64/mach64_dd.h
index de5649919f..92b10c6078 100644
--- a/src/mesa/drivers/dri/mach64/mach64_dd.h
+++ b/src/mesa/drivers/dri/mach64/mach64_dd.h
@@ -33,7 +33,7 @@
#ifdef GLX_DIRECT_RENDERING
-extern void mach64DDInitDriverFuncs( GLcontext *ctx );
+extern void mach64InitDriverFuncs( struct dd_function_table *functions );
#endif
#endif
diff --git a/src/mesa/drivers/dri/mach64/mach64_ioctl.c b/src/mesa/drivers/dri/mach64/mach64_ioctl.c
index 06bb9c8f1a..0bd0939166 100644
--- a/src/mesa/drivers/dri/mach64/mach64_ioctl.c
+++ b/src/mesa/drivers/dri/mach64/mach64_ioctl.c
@@ -905,7 +905,7 @@ void mach64UploadHwStateLocked( mach64ContextPtr mmesa )
DMAADVANCE();
}
-void mach64DDInitIoctlFuncs( GLcontext *ctx )
+void mach64InitIoctlFuncs( struct dd_function_table *functions )
{
- ctx->Driver.Clear = mach64DDClear;
+ functions->Clear = mach64DDClear;
}
diff --git a/src/mesa/drivers/dri/mach64/mach64_ioctl.h b/src/mesa/drivers/dri/mach64/mach64_ioctl.h
index 519ee985eb..ee0b5296bb 100644
--- a/src/mesa/drivers/dri/mach64/mach64_ioctl.h
+++ b/src/mesa/drivers/dri/mach64/mach64_ioctl.h
@@ -90,9 +90,7 @@ extern void mach64PerformanceBoxesLocked( mach64ContextPtr mmesa );
#endif
extern void mach64WaitForIdleLocked( mach64ContextPtr mmesa );
-
-extern void mach64DDInitIoctlFuncs( GLcontext *ctx );
-
+extern void mach64InitIoctlFuncs( struct dd_function_table *functions );
/* ================================================================
* Helper macros:
diff --git a/src/mesa/drivers/dri/mach64/mach64_native_vb.c b/src/mesa/drivers/dri/mach64/mach64_native_vb.c
index a348954721..e4d97ad5c5 100644
--- a/src/mesa/drivers/dri/mach64/mach64_native_vb.c
+++ b/src/mesa/drivers/dri/mach64/mach64_native_vb.c
@@ -213,28 +213,6 @@ static void do_import( struct vertex_buffer *VB,
count);
}
-#ifndef IMPORT_QUALIFIER
-#define IMPORT_QUALIFIER static
-#endif
-
-IMPORT_QUALIFIER void TAG(import_float_colors)( GLcontext *ctx )
-{
- LOCALVARS
- struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
- struct gl_client_array *to = GET_UBYTE_COLOR_STORE();
- do_import( VB, to, VB->ColorPtr[0] );
- VB->ColorPtr[0] = to;
-}
-
-IMPORT_QUALIFIER void TAG(import_float_spec_colors)( GLcontext *ctx )
-{
- LOCALVARS
- struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
- struct gl_client_array *to = GET_UBYTE_SPEC_COLOR_STORE();
- do_import( VB, to, VB->SecondaryColorPtr[0] );
- VB->SecondaryColorPtr[0] = to;
-}
-
/* Interpolate the elements of the VB not included in typical hardware
* vertices.
*
@@ -298,7 +276,6 @@ INTERP_QUALIFIER void TAG(copy_pv_extras)( GLcontext *ctx,
#undef INTERP_QUALIFIER
-#undef IMPORT_QUALIFIER
#undef GET_COLOR
#undef IND
diff --git a/src/mesa/drivers/dri/mach64/mach64_native_vbtmp.h b/src/mesa/drivers/dri/mach64/mach64_native_vbtmp.h
index b07cbcfd48..8a36405489 100644
--- a/src/mesa/drivers/dri/mach64/mach64_native_vbtmp.h
+++ b/src/mesa/drivers/dri/mach64/mach64_native_vbtmp.h
@@ -74,7 +74,7 @@ static void TAG(emit)( GLcontext *ctx,
#endif
#endif
#if DO_SPEC
- GLubyte (*spec)[4];
+ GLfloat (*spec)[4];
GLuint spec_stride;
#endif
#if DO_FOG
@@ -82,7 +82,7 @@ static void TAG(emit)( GLcontext *ctx,
GLuint fog_stride;
#endif
#if DO_RGBA
- GLubyte (*col)[4];
+ GLfloat (*col)[4];
GLuint col_stride;
#endif
GLfloat (*coord)[4];
@@ -123,7 +123,7 @@ static void TAG(emit)( GLcontext *ctx,
#endif
#if DO_SPEC
- spec = (GLubyte (*)[4])VB->SecondaryColorPtr[0]->data;
+ spec = VB->SecondaryColorPtr[0]->data;
spec_stride = VB->SecondaryColorPtr[0]->stride;
#endif
@@ -154,14 +154,14 @@ static void TAG(emit)( GLcontext *ctx,
tc0 = (GLfloat (*)[4])((GLubyte *)tc0 + start * tc0_stride);
#endif
#if DO_SPEC
- STRIDE_4UB(spec, start * spec_stride);
+ STRIDE_4F(spec, start * spec_stride);
#endif
#if DO_FOG
/* STRIDE_F(fog, start * fog_stride); */
fog = (GLfloat (*)[4])((GLubyte *)fog + start * fog_stride);
#endif
#if DO_RGBA
- STRIDE_4UB(col, start * col_stride);
+ STRIDE_4F(col, start * col_stride);
#endif
coord = (GLfloat (*)[4])((GLubyte *)coord + start * coord_stride);
}
@@ -248,7 +248,7 @@ static void TAG(emit)( GLcontext *ctx,
((GLubyte *)p)[0] = spec[0][2]; /* VERTEX_?_SPEC_B */
((GLubyte *)p)[1] = spec[0][1]; /* VERTEX_?_SPEC_G */
((GLubyte *)p)[2] = spec[0][0]; /* VERTEX_?_SPEC_R */
- STRIDE_4UB(spec, spec_stride);
+ STRIDE_4F(spec, spec_stride);
#endif
#if DO_FOG
((GLubyte *)p)[3] = fog[0][0] * 255.0; /* VERTEX_?_SPEC_A */
@@ -273,7 +273,7 @@ static void TAG(emit)( GLcontext *ctx,
*((GLubyte *)p)++ = col[0][1]; /* VERTEX_?_G */
*((GLubyte *)p)++ = col[0][0]; /* VERTEX_?_R */
*((GLubyte *)p)++ = col[0][3]; /* VERTEX_?_A */
- STRIDE_4UB(col, col_stride);
+ STRIDE_4F(col, col_stride);
#else
p++;
#endif
diff --git a/src/mesa/drivers/dri/mach64/mach64_screen.c b/src/mesa/drivers/dri/mach64/mach64_screen.c
index 69bd228285..916b80b4ca 100644
--- a/src/mesa/drivers/dri/mach64/mach64_screen.c
+++ b/src/mesa/drivers/dri/mach64/mach64_screen.c
@@ -40,26 +40,54 @@
#include "utils.h"
#include "vblank.h"
+#ifndef _SOLO
#include "glxextensions.h"
+#endif
+
+/* Mach64 configuration
+ */
+#include "xmlpool.h"
+
+const char __driConfigOptions[] =
+DRI_CONF_BEGIN
+ DRI_CONF_SECTION_PERFORMANCE
+ DRI_CONF_VBLANK_MODE(DRI_CONF_VBLANK_DEF_INTERVAL_0)
+ DRI_CONF_SECTION_END
+#if ENABLE_PERF_BOXES
+ DRI_CONF_SECTION_DEBUG
+ DRI_CONF_PERFORMANCE_BOXES(false)
+ DRI_CONF_SECTION_END
+#endif
+DRI_CONF_END;
+#if ENABLE_PERF_BOXES
+static const GLuint __driNConfigOptions = 2;
+#else
+static const GLuint __driNConfigOptions = 1;
+#endif
+
/* Create the device specific screen private data struct.
*/
static mach64ScreenRec *
-mach64CreateScreen( __DRIscreenPrivate *driScreen )
+mach64CreateScreen( __DRIscreenPrivate *sPriv )
{
- mach64ScreenRec *mach64Screen;
- ATIDRIPtr serverInfo = (ATIDRIPtr)driScreen->pDevPriv;
+ mach64ScreenPtr mach64Screen;
+ ATIDRIPtr serverInfo = (ATIDRIPtr)sPriv->pDevPriv;
if ( MACH64_DEBUG & DEBUG_VERBOSE_DRI )
fprintf( stderr, "%s\n", __FUNCTION__ );
- if ( ! driCheckDriDdxDrmVersions( driScreen, "Mach64", 4, 0, 6, 4, 1, 0 ) )
+ if ( ! driCheckDriDdxDrmVersions( sPriv, "Mach64", 4, 0, 6, 4, 1, 0 ) )
return NULL;
/* Allocate the private area */
- mach64Screen = (mach64ScreenRec *) CALLOC( sizeof(*mach64Screen) );
+ mach64Screen = (mach64ScreenPtr) CALLOC( sizeof(*mach64Screen) );
if ( !mach64Screen ) return NULL;
-
+
+ /* parse information in __driConfigOptions */
+ driParseOptionInfo (&mach64Screen->optionCache,
+ __driConfigOptions, __driNConfigOptions);
+
mach64Screen->IsPCI = serverInfo->IsPCI;
{
@@ -69,7 +97,7 @@ mach64CreateScreen( __DRIscreenPrivate *driScreen )
gp.param = MACH64_PARAM_IRQ_NR;
gp.value = &mach64Screen->irq;
- ret = drmCommandWriteRead( driScreen->fd, DRM_MACH64_GETPARAM,
+ ret = drmCommandWriteRead( sPriv->fd, DRM_MACH64_GETPARAM,
&gp, sizeof(gp));
if (ret) {
fprintf(stderr, "DRM_MACH64_GETPARAM (MACH64_PARAM_IRQ_NR): %d\n", ret);
@@ -80,7 +108,7 @@ mach64CreateScreen( __DRIscreenPrivate *driScreen )
mach64Screen->mmio.handle = serverInfo->regs;
mach64Screen->mmio.size = serverInfo->regsSize;
- if ( drmMap( driScreen->fd,
+ if ( drmMap( sPriv->fd,
mach64Screen->mmio.handle,
mach64Screen->mmio.size,
(drmAddressPtr)&mach64Screen->mmio.map ) != 0 ) {
@@ -88,7 +116,7 @@ mach64CreateScreen( __DRIscreenPrivate *driScreen )
return NULL;
}
- mach64Screen->buffers = drmMapBufs( driScreen->fd );
+ mach64Screen->buffers = drmMapBufs( sPriv->fd );
if ( !mach64Screen->buffers ) {
drmUnmap( (drmAddress)mach64Screen->mmio.map,
mach64Screen->mmio.size );
@@ -99,7 +127,7 @@ mach64CreateScreen( __DRIscreenPrivate *driScreen )
if ( !mach64Screen->IsPCI ) {
mach64Screen->agpTextures.handle = serverInfo->agp;
mach64Screen->agpTextures.size = serverInfo->agpSize;
- if ( drmMap( driScreen->fd,
+ if ( drmMap( sPriv->fd,
mach64Screen->agpTextures.handle,
mach64Screen->agpTextures.size,
(drmAddressPtr)&mach64Screen->agpTextures.map ) ) {
@@ -149,8 +177,24 @@ mach64CreateScreen( __DRIscreenPrivate *driScreen )
mach64Screen->logTexGranularity[MACH64_AGP_HEAP] = serverInfo->logAgpTextureGranularity;
}
- mach64Screen->driScreen = driScreen;
+ mach64Screen->driScreen = sPriv;
+#ifndef _SOLO
+ if ( driCompareGLXAPIVersion( 20030813 ) >= 0 ) {
+ PFNGLXSCRENABLEEXTENSIONPROC glx_enable_extension =
+ (PFNGLXSCRENABLEEXTENSIONPROC) glXGetProcAddress( (const GLubyte *) "__glXScrEnableExtension" );
+ void * const psc = sPriv->psc->screenConfigs;
+
+ if ( glx_enable_extension != NULL ) {
+ if ( mach64Screen->irq != 0 ) {
+ (*glx_enable_extension)( psc, "GLX_SGI_swap_control" );
+ (*glx_enable_extension)( psc, "GLX_SGI_video_sync" );
+ (*glx_enable_extension)( psc, "GLX_MESA_swap_control" );
+ }
+ (*glx_enable_extension)( psc, "GLX_MESA_swap_frame_usage" );
+ }
+ }
+#endif
return mach64Screen;
}
@@ -263,7 +307,7 @@ mach64InitDriver( __DRIscreenPrivate *driScreen )
return GL_TRUE;
}
-
+#ifndef _SOLO
/* This function is called by libGL.so as soon as libGL.so is loaded.
* This is where we register new extension functions with the dispatcher.
*/
@@ -273,7 +317,7 @@ void __driRegisterExtensions( void )
if ( driCompareGLXAPIVersion( 20030317 ) >= 0 ) {
glx_enable_extension = (PFNGLXENABLEEXTENSIONPROC)
- glXGetProcAddress( "__glXEnableExtension" );
+ glXGetProcAddress( (const GLubyte *) "__glXEnableExtension" );
if ( glx_enable_extension != NULL ) {
glx_enable_extension( "GLX_SGI_swap_control", GL_FALSE );
@@ -282,7 +326,7 @@ void __driRegisterExtensions( void )
}
}
}
-
+#endif
static struct __DriverAPIRec mach64API = {
.InitDriver = mach64InitDriver,
@@ -309,6 +353,7 @@ static struct __DriverAPIRec mach64API = {
* The __driCreateScreen name is the symbol that libGL.so fetches.
* Return: pointer to a __DRIscreenPrivate.
*/
+#ifndef _SOLO
void *__driCreateScreen(Display *dpy, int scrn, __DRIscreen *psc,
int numConfigs, __GLXvisualConfig *config)
{
@@ -316,3 +361,12 @@ void *__driCreateScreen(Display *dpy, int scrn, __DRIscreen *psc,
psp = __driUtilCreateScreen(dpy, scrn, psc, numConfigs, config, &mach64API);
return (void *) psp;
}
+#else
+void *__driCreateScreen(struct DRIDriverRec *driver,
+ struct DRIDriverContextRec *driverContext)
+{
+ __DRIscreenPrivate *psp;
+ psp = __driUtilCreateScreen(driver, driverContext, &mach64API);
+ return (void *) psp;
+}
+#endif
diff --git a/src/mesa/drivers/dri/mach64/mach64_tex.c b/src/mesa/drivers/dri/mach64/mach64_tex.c
index 02d76067ae..1ac42e330d 100644
--- a/src/mesa/drivers/dri/mach64/mach64_tex.c
+++ b/src/mesa/drivers/dri/mach64/mach64_tex.c
@@ -580,26 +580,26 @@ static GLboolean mach64DDIsTextureResident( GLcontext *ctx,
}
-void mach64DDInitTextureFuncs( GLcontext *ctx )
+void mach64InitTextureFuncs( struct dd_function_table *functions )
{
- ctx->Driver.TexEnv = mach64DDTexEnv;
- ctx->Driver.ChooseTextureFormat = mach64ChooseTextureFormat;
- ctx->Driver.TexImage1D = mach64TexImage1D;
- ctx->Driver.TexSubImage1D = mach64TexSubImage1D;
- ctx->Driver.TexImage2D = mach64TexImage2D;
- ctx->Driver.TexSubImage2D = mach64TexSubImage2D;
- ctx->Driver.TexImage3D = _mesa_store_teximage3d;
- ctx->Driver.TexSubImage3D = _mesa_store_texsubimage3d;
- ctx->Driver.CopyTexImage1D = _swrast_copy_teximage1d;
- ctx->Driver.CopyTexImage2D = _swrast_copy_teximage2d;
- ctx->Driver.CopyTexSubImage1D = _swrast_copy_texsubimage1d;
- ctx->Driver.CopyTexSubImage2D = _swrast_copy_texsubimage2d;
- ctx->Driver.CopyTexSubImage3D = _swrast_copy_texsubimage3d;
- ctx->Driver.TexParameter = mach64DDTexParameter;
- ctx->Driver.BindTexture = mach64DDBindTexture;
- ctx->Driver.DeleteTexture = mach64DDDeleteTexture;
- ctx->Driver.UpdateTexturePalette = NULL;
- ctx->Driver.ActiveTexture = NULL;
- ctx->Driver.IsTextureResident = mach64DDIsTextureResident;
- ctx->Driver.PrioritizeTexture = NULL;
+ functions->TexEnv = mach64DDTexEnv;
+ functions->ChooseTextureFormat = mach64ChooseTextureFormat;
+ functions->TexImage1D = mach64TexImage1D;
+ functions->TexSubImage1D = mach64TexSubImage1D;
+ functions->TexImage2D = mach64TexImage2D;
+ functions->TexSubImage2D = mach64TexSubImage2D;
+ functions->TexImage3D = _mesa_store_teximage3d;
+ functions->TexSubImage3D = _mesa_store_texsubimage3d;
+ functions->CopyTexImage1D = _swrast_copy_teximage1d;
+ functions->CopyTexImage2D = _swrast_copy_teximage2d;
+ functions->CopyTexSubImage1D = _swrast_copy_texsubimage1d;
+ functions->CopyTexSubImage2D = _swrast_copy_texsubimage2d;
+ functions->CopyTexSubImage3D = _swrast_copy_texsubimage3d;
+ functions->TexParameter = mach64DDTexParameter;
+ functions->BindTexture = mach64DDBindTexture;
+ functions->DeleteTexture = mach64DDDeleteTexture;
+ functions->UpdateTexturePalette = NULL;
+ functions->ActiveTexture = NULL;
+ functions->IsTextureResident = mach64DDIsTextureResident;
+ functions->PrioritizeTexture = NULL;
}
diff --git a/src/mesa/drivers/dri/mach64/mach64_tex.h b/src/mesa/drivers/dri/mach64/mach64_tex.h
index ecd36db325..acae887d30 100644
--- a/src/mesa/drivers/dri/mach64/mach64_tex.h
+++ b/src/mesa/drivers/dri/mach64/mach64_tex.h
@@ -59,8 +59,7 @@ extern void mach64EmitTexStateLocked( mach64ContextPtr mmesa,
mach64TexObjPtr t0,
mach64TexObjPtr t1 );
-extern void mach64DDInitTextureFuncs( GLcontext *ctx );
-
+extern void mach64InitTextureFuncs( struct dd_function_table *functions );
/* ================================================================
* Color conversion macros:
diff --git a/src/mesa/drivers/dri/mach64/mach64_texmem.c b/src/mesa/drivers/dri/mach64/mach64_texmem.c
index 44dd888a96..e78264ed87 100644
--- a/src/mesa/drivers/dri/mach64/mach64_texmem.c
+++ b/src/mesa/drivers/dri/mach64/mach64_texmem.c
@@ -395,7 +395,7 @@ static void mach64UploadAGPSubImage( mach64ContextPtr mmesa,
if ( ( level < 0 ) || ( level > mmesa->glCtx->Const.MaxTextureLevels ) )
return;
- image = t->tObj->Image[level];
+ image = t->tObj->Image[0][level];
if ( !image )
return;
@@ -460,7 +460,7 @@ static void mach64UploadLocalSubImage( mach64ContextPtr mmesa,
if ( ( level < 0 ) || ( level > mmesa->glCtx->Const.MaxTextureLevels ) )
return;
- image = t->tObj->Image[level];
+ image = t->tObj->Image[0][level];
if ( !image )
return;
diff --git a/src/mesa/drivers/dri/mach64/mach64_vb.c b/src/mesa/drivers/dri/mach64/mach64_vb.c
index 8a132b4f7b..254dd27e06 100644
--- a/src/mesa/drivers/dri/mach64/mach64_vb.c
+++ b/src/mesa/drivers/dri/mach64/mach64_vb.c
@@ -622,7 +622,7 @@ void mach64InitVB( GLcontext *ctx )
mach64ContextPtr mmesa = MACH64_CONTEXT(ctx);
GLuint size = TNL_CONTEXT(ctx)->vb.Size;
- mmesa->verts = (char *)ALIGN_MALLOC(size * 4 * 16, 32);
+ mmesa->verts = (GLubyte *)ALIGN_MALLOC(size * 4 * 16, 32);
{
static int firsttime = 1;
diff --git a/src/mesa/drivers/dri/mach64/server/mach64_common.h b/src/mesa/drivers/dri/mach64/server/mach64_common.h
index 65ec25afb6..00609e31a4 100644
--- a/src/mesa/drivers/dri/mach64/server/mach64_common.h
+++ b/src/mesa/drivers/dri/mach64/server/mach64_common.h
@@ -121,11 +121,11 @@ typedef struct {
} drmMach64Blit;
typedef struct {
- enum {
- MACH64_PARAM_FRAMES_QUEUED = 0x01,
- MACH64_PARAM_IRQ_NR = 0x02
- } param;
+ int param;
int *value;
} drmMach64GetParam;
+#define MACH64_PARAM_FRAMES_QUEUED 1
+#define MACH64_PARAM_IRQ_NR 2
+
#endif /* __MACH64_COMMON_H__ */