diff options
author | Adam Jackson <[email protected]> | 2004-12-27 20:31:56 +0000 |
---|---|---|
committer | Adam Jackson <[email protected]> | 2004-12-27 20:31:56 +0000 |
commit | c3eaa17b37ef83d43a4de211c1b4f616b3bc0a3d (patch) | |
tree | b1cee126821cce46d6d1b86dbe8a5b9e4c6e27ce /src/mesa/drivers/dri | |
parent | 99edafd4e87fdfb53a46d10d497250a9ba1fa91b (diff) |
Get s3v building with a minimum of warnings.
Diffstat (limited to 'src/mesa/drivers/dri')
-rw-r--r-- | src/mesa/drivers/dri/s3v/Makefile | 46 | ||||
-rw-r--r-- | src/mesa/drivers/dri/s3v/s3v_common.h | 83 | ||||
-rw-r--r-- | src/mesa/drivers/dri/s3v/s3v_context.c | 28 | ||||
-rw-r--r-- | src/mesa/drivers/dri/s3v/s3v_context.h | 113 | ||||
-rw-r--r-- | src/mesa/drivers/dri/s3v/s3v_dri.h | 143 | ||||
-rw-r--r-- | src/mesa/drivers/dri/s3v/s3v_render.c | 57 | ||||
-rw-r--r-- | src/mesa/drivers/dri/s3v/s3v_screen.c | 4 | ||||
-rw-r--r-- | src/mesa/drivers/dri/s3v/s3v_screen.h | 2 | ||||
-rw-r--r-- | src/mesa/drivers/dri/s3v/s3v_span.c | 19 | ||||
-rw-r--r-- | src/mesa/drivers/dri/s3v/s3v_state.c | 9 | ||||
-rw-r--r-- | src/mesa/drivers/dri/s3v/s3v_tex.c | 20 | ||||
-rw-r--r-- | src/mesa/drivers/dri/s3v/s3v_tex.h | 2 | ||||
-rw-r--r-- | src/mesa/drivers/dri/s3v/s3v_texmem.c | 9 | ||||
-rw-r--r-- | src/mesa/drivers/dri/s3v/s3v_texstate.c | 31 | ||||
-rw-r--r-- | src/mesa/drivers/dri/s3v/s3v_tris.c | 16 | ||||
-rw-r--r-- | src/mesa/drivers/dri/s3v/s3v_tritmp.h | 60 | ||||
-rw-r--r-- | src/mesa/drivers/dri/s3v/s3v_vb.c | 18 | ||||
-rw-r--r-- | src/mesa/drivers/dri/s3v/s3v_xmesa.c | 29 |
18 files changed, 483 insertions, 206 deletions
diff --git a/src/mesa/drivers/dri/s3v/Makefile b/src/mesa/drivers/dri/s3v/Makefile new file mode 100644 index 00000000000..2167ac86839 --- /dev/null +++ b/src/mesa/drivers/dri/s3v/Makefile @@ -0,0 +1,46 @@ +# src/mesa/drivers/dri/s3v/Makefile + +TOP = ../../../../.. +include $(TOP)/configs/current + +LIBNAME = s3v_dri.so + +# Doesn't exist yet. +#MINIGLX_SOURCES = server/savage_dri.c + +COMMON_SOURCES = \ + ../../common/driverfuncs.c \ + ../common/mm.c \ + ../common/utils.c \ + ../common/texmem.c \ + ../common/vblank.c \ + ../common/xmlconfig.c \ + ../common/dri_util.c \ + ../common/glcontextmodes.c + +DRIVER_SOURCES = \ + s3v_context.c \ + s3v_dd.c \ + s3v_inithw.c \ + s3v_lock.c \ + s3v_render.c \ + s3v_screen.c \ + s3v_span.c \ + s3v_state.c \ + s3v_tex.c \ + s3v_texmem.c \ + s3v_texstate.c \ + s3v_tris.c \ + s3v_vb.c \ + s3v_xmesa.c + +C_SOURCES = \ + $(COMMON_SOURCES) \ + $(DRIVER_SOURCES) + +ASM_SOURCES = + + +include ../Makefile.template + +symlinks: diff --git a/src/mesa/drivers/dri/s3v/s3v_common.h b/src/mesa/drivers/dri/s3v/s3v_common.h new file mode 100644 index 00000000000..22f6014b2cf --- /dev/null +++ b/src/mesa/drivers/dri/s3v/s3v_common.h @@ -0,0 +1,83 @@ +/* + * Author: Max Lingua <[email protected]> + */ + +/* WARNING: If you change any of these defines, make sure to change + * the kernel include file as well (s3v_drm.h) + */ + +#ifndef _XF86DRI_S3V_H_ +#define _XF86DRI_S3V_H_ + +#ifndef _S3V_DEFINES_ +#define _S3V_DEFINES_ +#define S3V_USE_BATCH 1 + +/* #define S3V_BUF_4K 1 */ + +#ifdef S3V_BUF_4K + #define S3V_DMA_BUF_ORDER 12 + #define S3V_DMA_BUF_NR 256 +#else + #define S3V_DMA_BUF_ORDER 16 /* -much- better */ + #define S3V_DMA_BUF_NR 16 +#endif +/* on s3virge you can only choose between * + * 4k (2^12) and 64k (2^16) dma bufs */ +#define S3V_DMA_BUF_SZ (1<<S3V_DMA_BUF_ORDER) + +#define S3V_NR_SAREA_CLIPRECTS 8 + +/* Each region is a minimum of 16k (64*64@4bpp) + * and there are at most 40 of them. + */ +#define S3V_NR_TEX_REGIONS 64 /* was 40 */ +#define S3V_LOG_TEX_GRANULARITY 16 /* was 4 */ +/* 40 * (2 ^ 4) = 640k, that's all we have for tex on 4mb gfx card */ +/* FIXME: will it work with card with less than 4mb? */ +/* FIXME: we should set this at run time */ + +#endif /* _S3V_DEFINES */ + +/* + * WARNING: If you change any of these defines, make sure to change + * the kernel include file as well (gamma_drm.h) + */ + +/* Driver specific DRM command indices + * NOTE: these are not OS specific, but they are driver specific + */ +#define DRM_S3V_INIT_DMA 0x00 +#define DRM_S3V_CLEANUP_DMA 0x01 + +typedef struct _drmS3VInit { + enum { + S3V_INIT_DMA = 0x01, + S3V_CLEANUP_DMA = 0x02 + } func; + + unsigned int pcimode; /* bool: 1=pci 0=agp */ + + unsigned int mmio_offset; + unsigned int buffers_offset; + unsigned int sarea_priv_offset; + + unsigned int front_offset; + unsigned int front_width; + unsigned int front_height; + unsigned int front_pitch; + + unsigned int back_offset; + unsigned int back_width; + unsigned int back_height; + unsigned int back_pitch; + + unsigned int depth_offset; + unsigned int depth_width; + unsigned int depth_height; + unsigned int depth_pitch; + + unsigned int texture_offset; +} drmS3VInit; + +#endif diff --git a/src/mesa/drivers/dri/s3v/s3v_context.c b/src/mesa/drivers/dri/s3v/s3v_context.c index 4e199a68cd5..0079a7668ef 100644 --- a/src/mesa/drivers/dri/s3v/s3v_context.c +++ b/src/mesa/drivers/dri/s3v/s3v_context.c @@ -13,24 +13,22 @@ #include "context.h" #include "simple_list.h" -#include "mem.h" #include "matrix.h" #include "extensions.h" #if defined(USE_X86_ASM) #include "X86/common_x86_asm.h" #endif #include "simple_list.h" -#include "mem.h" #include "mm.h" - +#include "drivers/common/driverfuncs.h" #include "s3v_vb.h" #include "s3v_tris.h" #if 0 -extern const struct gl_pipeline_stage _s3v_render_stage; +extern const struct tnl_pipeline_stage _s3v_render_stage; -static const struct gl_pipeline_stage *s3v_pipeline[] = { +static const struct tnl_pipeline_stage *s3v_pipeline[] = { &_tnl_vertex_transform_stage, &_tnl_normal_transform_stage, &_tnl_lighting_stage, @@ -46,16 +44,17 @@ static const struct gl_pipeline_stage *s3v_pipeline[] = { }; #endif -GLboolean s3vCreateContext( Display *dpy, const __GLcontextModes *glVisual, - __DRIcontextPrivate *driContextPriv, - void *sharedContextPrivate) +GLboolean s3vCreateContext(const __GLcontextModes *glVisual, + __DRIcontextPrivate *driContextPriv, + void *sharedContextPrivate) { GLcontext *ctx, *shareCtx; __DRIscreenPrivate *sPriv = driContextPriv->driScreenPriv; s3vContextPtr vmesa; s3vScreenPtr s3vScrn; - S3VSAREAPtr saPriv=(S3VSAREAPtr)(((char*)sPriv->pSAREA)+ - sizeof(XF86DRISAREARec)); + S3VSAREAPtr saPriv=(S3VSAREAPtr)(((char*)sPriv->pSAREA) + + sizeof(drm_sarea_t)); + struct dd_function_table functions; DEBUG_WHERE(("*** s3vCreateContext ***\n")); @@ -68,20 +67,21 @@ GLboolean s3vCreateContext( Display *dpy, const __GLcontextModes *glVisual, else shareCtx = NULL; - vmesa->glCtx = _mesa_create_context(glVisual, shareCtx, vmesa, GL_TRUE); + _mesa_init_driver_functions(&functions); + + vmesa->glCtx = _mesa_create_context(glVisual, shareCtx, &functions, + (void *)vmesa); if (!vmesa->glCtx) { FREE(vmesa); return GL_FALSE; } - vmesa->display = dpy; - vmesa->driContext = driContextPriv; vmesa->driScreen = sPriv; vmesa->driDrawable = NULL; /* Set by XMesaMakeCurrent */ vmesa->hHWContext = driContextPriv->hHWContext; - vmesa->driHwLock = &sPriv->pSAREA->lock; + vmesa->driHwLock = (drmLock *)&sPriv->pSAREA->lock; vmesa->driFd = sPriv->fd; vmesa->sarea = saPriv; diff --git a/src/mesa/drivers/dri/s3v/s3v_context.h b/src/mesa/drivers/dri/s3v/s3v_context.h index 79cd6feb5aa..1c0bca3fb8f 100644 --- a/src/mesa/drivers/dri/s3v/s3v_context.h +++ b/src/mesa/drivers/dri/s3v/s3v_context.h @@ -11,6 +11,7 @@ #include "s3v_regs.h" #include "s3v_macros.h" #include "s3v_screen.h" +#include "colormac.h" #include "macros.h" #include "mtypes.h" #include "drm.h" @@ -32,8 +33,7 @@ extern void s3vDDUpdateHWState(GLcontext *ctx); extern s3vScreenPtr s3vCreateScreen(__DRIscreenPrivate *sPriv); extern void s3vDestroyScreen(__DRIscreenPrivate *sPriv); -extern GLboolean s3vCreateContext( Display *dpy, - const __GLcontextModes *glVisual, +extern GLboolean s3vCreateContext(const __GLcontextModes *glVisual, __DRIcontextPrivate *driContextPriv, void *sharedContextPrivate); @@ -129,17 +129,17 @@ struct s3v_texture_object_t { int internalFormat; } image[S3V_TEX_MAXLEVELS]; - CARD32 TextureCMD; + GLuint TextureCMD; - CARD32 TextureColorMode; - CARD32 TextureFilterMode; - CARD32 TextureBorderColor; - CARD32 TextureWrap; - CARD32 TextureMipSize; + GLuint TextureColorMode; + GLuint TextureFilterMode; + GLuint TextureBorderColor; + GLuint TextureWrap; + GLuint TextureMipSize; - CARD32 TextureBaseAddr[S3V_TEX_MAXLEVELS]; - CARD32 TextureFormat; - CARD32 TextureReadMode; + GLuint TextureBaseAddr[S3V_TEX_MAXLEVELS]; + GLuint TextureFormat; + GLuint TextureReadMode; }; #define S3V_NO_PALETTE 0x0 @@ -222,17 +222,16 @@ struct s3v_context { /* Mirrors of some DRI state */ - Display *display; /* X server display */ - drmContext hHWContext; + drm_context_t hHWContext; drmLock *driHwLock; int driFd; GLuint numClipRects; /* Cliprects for the draw buffer */ - XF86DRIClipRectPtr pClipRects; + drm_clip_rect_t *pClipRects; - CARD32* buf; /* FIXME */ - CARD32* _buf[2]; + GLuint* buf; /* FIXME */ + GLuint* _buf[2]; int _bufNum; int bufIndex[2]; int bufSize; @@ -281,40 +280,40 @@ struct s3v_context { unsigned int S3V_REG[S3V_REGS_NUM]; - CARD32 texMode; - CARD32 alphaMode; - CARD32 lightMode; - - CARD32 SrcBase; - CARD32 DestBase; - CARD32 DestBlit; - CARD32 ScissorLR; - CARD32 ScissorTB; - CARD32 ScissorWH; /* SubScissorWH */ /* RectWH */ - CARD32 FrontStride; - CARD32 BackStride; - CARD32 SrcStride; - CARD32 DestStride; - CARD32 SrcXY; - CARD32 DestXY; - - CARD32 ClearColor; - CARD32 Color; - CARD32 DitherMode; - CARD32 ClearDepth; - - CARD32 TextureBorderColor; - CARD32 TexOffset; - CARD32 TexStride; - - CARD32 CMD; - CARD32 prim_cmd; - CARD32 _tri[2]; /* 0 = gouraud; 1 = tex (lit or unlit) */ - CARD32 alpha_cmd; /* actual alpha cmd */ - CARD32 _alpha[2]; - CARD32 _alpha_tex; /* tex alpha type */ + GLuint texMode; + GLuint alphaMode; + GLuint lightMode; + + GLuint SrcBase; + GLuint DestBase; + GLuint DestBlit; + GLuint ScissorLR; + GLuint ScissorTB; + GLuint ScissorWH; /* SubScissorWH */ /* RectWH */ + GLuint FrontStride; + GLuint BackStride; + GLuint SrcStride; + GLuint DestStride; + GLuint SrcXY; + GLuint DestXY; + + GLuint ClearColor; + GLuint Color; + GLuint DitherMode; + GLuint ClearDepth; + + GLuint TextureBorderColor; + GLuint TexOffset; + GLuint TexStride; + + GLuint CMD; + GLuint prim_cmd; + GLuint _tri[2]; /* 0 = gouraud; 1 = tex (lit or unlit) */ + GLuint alpha_cmd; /* actual alpha cmd */ + GLuint _alpha[2]; + GLuint _alpha_tex; /* tex alpha type */ /* (3d_mode) 0 = 3d line/gourad tri; 1 = 3d tex tri */ - CARD32 _3d_mode; + GLuint _3d_mode; GLfloat backface_sign; GLfloat cull_zero; @@ -323,14 +322,14 @@ struct s3v_context { /* *** 2check *** */ - CARD32 FogMode; - CARD32 AreaStippleMode; - CARD32 LBReadFormat; - CARD32 LBWriteFormat; - CARD32 LineMode; - CARD32 PointMode; - CARD32 TriangleMode; - CARD32 AntialiasMode; + GLuint FogMode; + GLuint AreaStippleMode; + GLuint LBReadFormat; + GLuint LBWriteFormat; + GLuint LineMode; + GLuint PointMode; + GLuint TriangleMode; + GLuint AntialiasMode; GLfloat ViewportScaleX; GLfloat ViewportScaleY; GLfloat ViewportScaleZ; diff --git a/src/mesa/drivers/dri/s3v/s3v_dri.h b/src/mesa/drivers/dri/s3v/s3v_dri.h new file mode 100644 index 00000000000..339c579f7f7 --- /dev/null +++ b/src/mesa/drivers/dri/s3v/s3v_dri.h @@ -0,0 +1,143 @@ +/* + * Author: Max Lingua <[email protected]> + */ + +#ifndef _S3V_DRI +#define _S3V_DRI + +#include "s3v_common.h" + +#define S3V_MAX_DRAWABLES (S3V_DMA_BUF_NR/2) /* 32 */ /* 256 */ /* FIXME */ + +typedef struct +{ + int deviceID; + int width; + int height; + int mem; + int cpp; + int bitsPerPixel; + + int fbOffset; + int fbStride; + + int logTextureGranularity; + int textureOffset; + + drm_handle_t regs; + drmSize regsSize; + + unsigned int sarea_priv_offset; +/* + drmAddress regsMap; + + drmSize textureSize; + drm_handle_t textures; +*/ + +#if 0 + drm_handle_t agp_buffers; + drmSize agp_buf_size; +#endif + +/* + drmBufMapPtr drmBufs; + int irq; + unsigned int sarea_priv_offset; +*/ + +/* FIXME: cleanup ! */ + + drmSize registerSize; /* == S3V_MMIO_REGSIZE */ + drm_handle_t registerHandle; + + drmSize pciSize; + drm_handle_t pciMemHandle; + + drmSize frontSize; /* == videoRambytes */ +/* drm_handle_t frontHandle; */ + unsigned long frontOffset; /* == fbOffset */ + int frontPitch; +/* unsigned char *front; */ + + unsigned int bufferSize; /* size of depth/back buffer */ + + drmSize backSize; +/* drm_handle_t backHandle; */ + unsigned long backOffset; + int backPitch; +/* unsigned char *back; */ + + drmSize depthSize; +/* drm_handle_t depthHandle; */ + unsigned long depthOffset; + int depthPitch; +/* unsigned char *depth; */ + + drmSize texSize; +/* drm_handle_t texHandle; */ + unsigned long texOffset; + int texPitch; +/* unsigned char *tex; */ + + drmSize dmaBufSize; /* Size of buffers (in bytes) */ + drm_handle_t dmaBufHandle; /* Handle from drmAddMap */ + unsigned long dmaBufOffset; /* Offset/Start */ + int dmaBufPitch; /* Pitch */ + unsigned char *dmaBuf; /* Map */ + int bufNumBufs; /* Number of buffers */ + drmBufMapPtr buffers; /* Buffer map */ + +} S3VDRIRec, *S3VDRIPtr; + +/* WARNING: Do not change the SAREA structure without changing the kernel + * as well */ + +typedef struct { + unsigned char next, prev; /* indices to form a circular LRU */ + unsigned char in_use; /* owned by a client, or free? */ + int age; /* tracked by clients to update local LRU's */ +} S3VTexRegionRec, *S3VTexRegionPtr; + +typedef struct { + unsigned int nbox; + drm_clip_rect_t boxes[S3V_NR_SAREA_CLIPRECTS]; + + /* Maintain an LRU of contiguous regions of texture space. If + * you think you own a region of texture memory, and it has an + * age different to the one you set, then you are mistaken and + * it has been stolen by another client. If global texAge + * hasn't changed, there is no need to walk the list. + * + * These regions can be used as a proxy for the fine-grained + * texture information of other clients - by maintaining them + * in the same lru which is used to age their own textures, + * clients have an approximate lru for the whole of global + * texture space, and can make informed decisions as to which + * areas to kick out. There is no need to choose whether to + * kick out your own texture or someone else's - simply eject + * them all in LRU order. + */ + S3VTexRegionRec texList[S3V_NR_TEX_REGIONS+1]; /* Last elt is sentinal */ + + int texAge; /* last time texture was uploaded */ + + int last_enqueue; /* last time a buffer was enqueued */ + int last_dispatch; /* age of the most recently dispatched buffer */ + int last_quiescent; /* */ + + int ctxOwner; /* last context to upload state */ +} S3VSAREARec, *S3VSAREAPtr; + +typedef struct { + /* Nothing here yet */ + int dummy; +} S3VConfigPrivRec, *S3VConfigPrivPtr; + +typedef struct { + /* Nothing here yet */ + int dummy; +} S3VDRIContextRec, *S3VDRIContextPtr; + + +#endif diff --git a/src/mesa/drivers/dri/s3v/s3v_render.c b/src/mesa/drivers/dri/s3v/s3v_render.c index 3da9f763a3e..e97a94d25cd 100644 --- a/src/mesa/drivers/dri/s3v/s3v_render.c +++ b/src/mesa/drivers/dri/s3v/s3v_render.c @@ -5,9 +5,7 @@ #include "glheader.h" #include "context.h" #include "macros.h" -#include "mem.h" #include "mtypes.h" -#include "mmath.h" #include "tnl/t_context.h" @@ -29,6 +27,7 @@ #define HAVE_ELTS 0 +#if 0 static void VERT_FALLBACK( GLcontext *ctx, GLuint start, GLuint count, @@ -50,8 +49,9 @@ static void VERT_FALLBACK( GLcontext *ctx, _flags = flags & PRIM_MODE_MASK; tnl->Driver.Render.PrimTabVerts[_flags]( ctx, start, count, flags ); - S3V_CONTEXT(ctx)->SetupNewInputs = VERT_CLIP; + S3V_CONTEXT(ctx)->SetupNewInputs = VERT_BIT_POS; } +#endif static const GLuint hw_prim[GL_POLYGON+1] = { PrimType_Points, @@ -126,12 +126,10 @@ static __inline void s3vEndPrimitive( s3vContextPtr vmesa ) (vmesa->bufSize - vmesa->bufCount) / 2 #define GET_SUBSEQUENT_VB_MAX_VERTS() \ S3V_DMA_BUF_SZ / 2 -#define EMIT_VERTS( ctx, j, nr ) \ -do { \ - printf("Alas, emit...\n"); \ - /* s3v_emit(ctx, j, (j)+(nr)) */ \ - /* we don't need emit on s3v */ \ -} while (0) +/* XXX */ +#define ALLOC_VERTS(nr) NULL +#define EMIT_VERTS(ctx, start, count, buf) NULL +#define FLUSH() s3vEndPrimitive( vmesa ) #define TAG(x) s3v_##x @@ -143,13 +141,13 @@ do { \ static GLboolean s3v_run_render( GLcontext *ctx, - struct gl_pipeline_stage *stage ) + struct tnl_pipeline_stage *stage ) { s3vContextPtr vmesa = S3V_CONTEXT(ctx); TNLcontext *tnl = TNL_CONTEXT(ctx); struct vertex_buffer *VB = &tnl->vb; - GLuint i, length, flags = 0; - render_func *tab; + GLuint i; + tnl_render_func *tab; DEBUG(("s3v_run_render\n")); @@ -170,19 +168,20 @@ static GLboolean s3v_run_render( GLcontext *ctx, tnl->Driver.Render.Start( ctx ); - for (i = 0 ; !(flags & PRIM_LAST) ; i += length) + for (i = 0 ; i < VB->PrimitiveCount ; i++ ) { - flags = VB->Primitive[i]; - length = VB->PrimitiveLength[i]; + GLuint prim = VB->Primitive[i].mode; + GLuint start = VB->Primitive[i].start; + GLuint length = VB->Primitive[i].count; DEBUG(("s3v_run_render (loop=%i) (lenght=%i)\n", i, length)); if (length) { - tnl->Driver.Render.BuildVertices( ctx, i, i+length, - ~0 /*stage->inputs*/); - tnl->Driver.Render.PrimTabVerts[flags & PRIM_MODE_MASK] - ( ctx, i, i + length, flags ); - vmesa->SetupNewInputs = VERT_CLIP; + tnl->Driver.Render.BuildVertices( ctx, start, + start+length, ~0 /*stage->inputs*/); /* XXX */ + tnl->Driver.Render.PrimTabVerts[prim & PRIM_MODE_MASK] + ( ctx, start, start + length, prim ); + vmesa->SetupNewInputs = VERT_BIT_POS; } } @@ -193,10 +192,10 @@ static GLboolean s3v_run_render( GLcontext *ctx, static void s3v_check_render( GLcontext *ctx, - struct gl_pipeline_stage *stage ) + struct tnl_pipeline_stage *stage ) { s3vContextPtr vmesa = S3V_CONTEXT(ctx); - GLuint inputs = VERT_CLIP | VERT_RGBA; + GLuint inputs = VERT_BIT_POS | VERT_BIT_COLOR0; DEBUG(("s3v_check_render\n")); @@ -204,22 +203,22 @@ static void s3v_check_render( GLcontext *ctx, if (ctx->_TriangleCaps & DD_SEPARATE_SPECULAR) { DEBUG(("DD_SEPARATE_SPECULAR\n")); - inputs |= VERT_SPEC_RGB; + inputs |= VERT_BIT_COLOR1; } if (ctx->Texture.Unit[0]._ReallyEnabled) { DEBUG(("ctx->Texture.Unit[0]._ReallyEnabled\n")); - inputs |= VERT_TEX(0); + inputs |= VERT_BIT_TEX(0); } if (ctx->Texture.Unit[1]._ReallyEnabled) { DEBUG(("ctx->Texture.Unit[1]._ReallyEnabled\n")); - inputs |= VERT_TEX(1); + inputs |= VERT_BIT_TEX(1); } if (ctx->Fog.Enabled) { DEBUG(("ctx->Fog.Enabled\n")); - inputs |= VERT_FOG_COORD; + inputs |= VERT_BIT_FOG; } } @@ -228,13 +227,15 @@ static void s3v_check_render( GLcontext *ctx, } -static void dtr( struct gl_pipeline_stage *stage ) +static void dtr( struct tnl_pipeline_stage *stage ) { (void)stage; + /* hack to silence a compiler warning */ + (void) &s3v_validate_render; } -const struct gl_pipeline_stage _s3v_render_stage = +const struct tnl_pipeline_stage _s3v_render_stage = { "s3v render", (_DD_NEW_SEPARATE_SPECULAR | diff --git a/src/mesa/drivers/dri/s3v/s3v_screen.c b/src/mesa/drivers/dri/s3v/s3v_screen.c index e558d5b4f3a..810232fec47 100644 --- a/src/mesa/drivers/dri/s3v/s3v_screen.c +++ b/src/mesa/drivers/dri/s3v/s3v_screen.c @@ -6,8 +6,6 @@ #include "s3v_vb.h" #include "s3v_dri.h" -#include "mem.h" - s3vScreenPtr s3vCreateScreen( __DRIscreenPrivate *sPriv ) { s3vScreenPtr s3vScreen; @@ -25,7 +23,7 @@ s3vScreenPtr s3vCreateScreen( __DRIscreenPrivate *sPriv ) s3vScreen->regionCount = 4; /* Magic number. Can we fix this? */ - s3vScreen->regions = Xmalloc(s3vScreen->regionCount * + s3vScreen->regions = _mesa_malloc(s3vScreen->regionCount * sizeof(s3vRegion)); DEBUG(("sPriv->fd = %i\nvDRIPriv->dmaBufHandle = %x\n", sPriv->fd, vDRIPriv->dmaBufHandle)); diff --git a/src/mesa/drivers/dri/s3v/s3v_screen.h b/src/mesa/drivers/dri/s3v/s3v_screen.h index 6bba29a7faf..bbbffbb8e1a 100644 --- a/src/mesa/drivers/dri/s3v/s3v_screen.h +++ b/src/mesa/drivers/dri/s3v/s3v_screen.h @@ -3,7 +3,7 @@ */ typedef struct _s3vRegion { - drmHandle handle; + drm_handle_t handle; drmSize size; drmAddress map; } s3vRegion, *s3vRegionPtr; diff --git a/src/mesa/drivers/dri/s3v/s3v_span.c b/src/mesa/drivers/dri/s3v/s3v_span.c index d8210f684b6..6266d371052 100644 --- a/src/mesa/drivers/dri/s3v/s3v_span.c +++ b/src/mesa/drivers/dri/s3v/s3v_span.c @@ -226,18 +226,19 @@ do { \ #endif -static void s3vSetReadBuffer( GLcontext *ctx, - GLframebuffer *colorBuffer, - GLenum mode ) +static void s3vSetBuffer( GLcontext *ctx, GLframebuffer *colorBuffer, + GLuint bufferBit ) { s3vContextPtr vmesa = S3V_CONTEXT(ctx); - switch ( mode ) { - case GL_FRONT_LEFT: - vmesa->readOffset = 0; + switch ( bufferBit ) { + case DD_FRONT_LEFT_BIT: + vmesa->drawOffset = vmesa->readOffset = 0; break; - case GL_BACK_LEFT: - vmesa->readOffset = vmesa->driScreen->fbHeight * vmesa->driScreen->fbWidth * vmesa->s3vScreen->cpp; + case DD_BACK_LEFT_BIT: + vmesa->drawOffset = vmesa->readOffset = vmesa->driScreen->fbHeight * + vmesa->driScreen->fbWidth * + vmesa->s3vScreen->cpp; break; } } @@ -248,7 +249,7 @@ void s3vInitSpanFuncs( GLcontext *ctx ) s3vContextPtr vmesa = S3V_CONTEXT(ctx); struct swrast_device_driver *swdd = _swrast_GetDeviceDriverReference(ctx); - swdd->SetReadBuffer = s3vSetReadBuffer; + swdd->SetBuffer = s3vSetBuffer; switch ( vmesa->s3vScreen->cpp ) { case 2: diff --git a/src/mesa/drivers/dri/s3v/s3v_state.c b/src/mesa/drivers/dri/s3v/s3v_state.c index 66f15dbbbda..f92859d4edc 100644 --- a/src/mesa/drivers/dri/s3v/s3v_state.c +++ b/src/mesa/drivers/dri/s3v/s3v_state.c @@ -51,7 +51,7 @@ static void s3vUpdateAlphaMode( GLcontext *ctx ) } -static void s3vDDAlphaFunc( GLcontext *ctx, GLenum func, GLchan ref ) +static void s3vDDAlphaFunc( GLcontext *ctx, GLenum func, GLfloat ref ) { s3vContextPtr vmesa = S3V_CONTEXT(ctx); @@ -492,7 +492,7 @@ static void s3vDDColorMask( GLcontext *ctx, GLboolean r, GLboolean g, * Miscellaneous */ -static void s3vDDClearColor( GLcontext *ctx, const GLchan color[4]) +static void s3vDDClearColor( GLcontext *ctx, const GLfloat color[4]) { s3vContextPtr vmesa = S3V_CONTEXT(ctx); @@ -842,14 +842,17 @@ void s3vInitStateFuncs( GLcontext *ctx ) ctx->Driver.Clear = s3vDDClear; ctx->Driver.ClearIndex = NULL; ctx->Driver.ClearColor = s3vDDClearColor; - ctx->Driver.SetDrawBuffer = s3vDDSetDrawBuffer; + ctx->Driver.DrawBuffer = s3vDDSetDrawBuffer; + ctx->Driver.ReadBuffer = NULL; /* XXX */ ctx->Driver.IndexMask = NULL; ctx->Driver.ColorMask = NULL; /* s3vDDColorMask; */ /* FIXME */ ctx->Driver.AlphaFunc = s3vDDAlphaFunc; /* FIXME */ +#if 0 ctx->Driver.BlendEquation = NULL; /* s3vDDBlendEquation; */ ctx->Driver.BlendFunc = s3vDDBlendFunc; /* FIXME */ +#endif ctx->Driver.BlendFuncSeparate = NULL; /* s3vDDBlendFuncSeparate; */ ctx->Driver.ClearDepth = s3vDDClearDepth; ctx->Driver.CullFace = s3vDDCullFace; diff --git a/src/mesa/drivers/dri/s3v/s3v_tex.c b/src/mesa/drivers/dri/s3v/s3v_tex.c index 80564101ec2..5bee051b092 100644 --- a/src/mesa/drivers/dri/s3v/s3v_tex.c +++ b/src/mesa/drivers/dri/s3v/s3v_tex.c @@ -7,15 +7,14 @@ #include "glheader.h" #include "mtypes.h" -#include "mem.h" #include "simple_list.h" #include "enums.h" #include "texstore.h" #include "texformat.h" +#include "teximage.h" #include "swrast/swrast.h" #include "mm.h" -#include "mmath.h" #include "s3v_context.h" #include "s3v_tex.h" @@ -37,8 +36,8 @@ static void s3vSetTexWrapping(s3vContextPtr vmesa, s3vTextureObjectPtr t, GLenum wraps, GLenum wrapt) { - CARD32 t0 = t->TextureCMD; - CARD32 cmd = vmesa->CMD; + GLuint t0 = t->TextureCMD; + GLuint cmd = vmesa->CMD; #if TEX_DEBUG_ON static unsigned int times=0; DEBUG_TEX(("*** s3vSetTexWrapping: #%i ***\n", ++times)); @@ -64,8 +63,8 @@ static void s3vSetTexFilter(s3vContextPtr vmesa, s3vTextureObjectPtr t, GLenum minf, GLenum magf) { - CARD32 t0 = t->TextureCMD; - CARD32 cmd = vmesa->CMD; + GLuint t0 = t->TextureCMD; + GLuint cmd = vmesa->CMD; #if TEX_DEBUG_ON static unsigned int times=0; DEBUG_TEX(("*** s3vSetTexFilter: #%i ***\n", ++times)); @@ -183,7 +182,7 @@ static void s3vTexParameter( GLcontext *ctx, GLenum target, break; case GL_TEXTURE_BORDER_COLOR: - s3vSetTexBorderColor( vmesa, t, tObj->BorderColor ); + s3vSetTexBorderColor( vmesa, t, tObj->_BorderChan ); break; case GL_TEXTURE_BASE_LEVEL: @@ -402,7 +401,7 @@ static void s3vBindTexture( GLcontext *ctx, GLenum target, { s3vContextPtr vmesa = S3V_CONTEXT( ctx ); s3vTextureObjectPtr t = (s3vTextureObjectPtr) tObj->DriverData; - CARD32 cmd = vmesa->CMD; + GLuint cmd = vmesa->CMD; #if TEX_DEBUG_ON static unsigned int times=0; DEBUG_TEX(("*** s3vBindTexture: #%i ***\n", ++times)); @@ -440,11 +439,6 @@ static void s3vBindTexture( GLcontext *ctx, GLenum target, #endif } - if (!ctx->Texture._ReallyEnabled) { - DEBUG_TEX(("!ctx->Texture._ReallyEnabled\n")); - return; - } - cmd = vmesa->CMD & ~MIP_MASK; vmesa->dirty |= S3V_UPLOAD_TEX0; vmesa->TexOffset = t->TextureBaseAddr[tObj->BaseLevel]; diff --git a/src/mesa/drivers/dri/s3v/s3v_tex.h b/src/mesa/drivers/dri/s3v/s3v_tex.h index 0bbe267d77e..201ab034692 100644 --- a/src/mesa/drivers/dri/s3v/s3v_tex.h +++ b/src/mesa/drivers/dri/s3v/s3v_tex.h @@ -7,6 +7,8 @@ #define TEX_DEBUG_ON 0 +extern void s3vUpdateTexLRU( s3vContextPtr vmesa, s3vTextureObjectPtr t ); + #if TEX_DEBUG_ON #define DEBUG_TEX(str) printf str #else diff --git a/src/mesa/drivers/dri/s3v/s3v_texmem.c b/src/mesa/drivers/dri/s3v/s3v_texmem.c index ab2e67d1826..0ce3ff5fc23 100644 --- a/src/mesa/drivers/dri/s3v/s3v_texmem.c +++ b/src/mesa/drivers/dri/s3v/s3v_texmem.c @@ -12,7 +12,6 @@ #include "enums.h" #include "mm.h" -#include "mem.h" #include "s3v_context.h" #include "s3v_lock.h" #include "s3v_tex.h" @@ -103,7 +102,7 @@ static void s3vUploadTexLevel( s3vContextPtr vmesa, s3vTextureObjectPtr t, int l2d; /* int offset = 0; */ int words; - CARD32* dest; + GLuint* dest; #if TEX_DEBUG_ON static unsigned int times=0; #endif @@ -121,9 +120,9 @@ static void s3vUploadTexLevel( s3vContextPtr vmesa, s3vTextureObjectPtr t, DEBUG_TEX(("t->image[%i].offset = 0x%x\n", level, t->image[level].offset)); - t->TextureBaseAddr[level] = (CARD32)(t->BufAddr + t->image[level].offset - + _TEXALIGN) & (CARD32)(~_TEXALIGN); - dest = (CARD32*)(sPriv->pFB + t->TextureBaseAddr[level]); + t->TextureBaseAddr[level] = (GLuint)(t->BufAddr + t->image[level].offset + + _TEXALIGN) & (GLuint)(~_TEXALIGN); + dest = (GLuint*)(sPriv->pFB + t->TextureBaseAddr[level]); DEBUG_TEX(("sPriv->pFB = 0x%x\n", sPriv->pFB)); DEBUG_TEX(("dest = 0x%x\n", dest)); diff --git a/src/mesa/drivers/dri/s3v/s3v_texstate.c b/src/mesa/drivers/dri/s3v/s3v_texstate.c index 7141e39182e..b136c9d378c 100644 --- a/src/mesa/drivers/dri/s3v/s3v_texstate.c +++ b/src/mesa/drivers/dri/s3v/s3v_texstate.c @@ -21,7 +21,7 @@ static void s3vSetTexImages( s3vContextPtr vmesa, { GLuint height, width, pitch, i, /*textureFormat,*/ log_pitch; s3vTextureObjectPtr t = (s3vTextureObjectPtr) tObj->DriverData; - const struct gl_texture_image *baseImage = tObj->Image[tObj->BaseLevel]; + const struct gl_texture_image *baseImage = tObj->Image[0][tObj->BaseLevel]; GLint firstLevel, lastLevel, numLevels; GLint log2Width, log2Height; #if TEX_DEBUG_ON @@ -55,15 +55,15 @@ static void s3vSetTexImages( s3vContextPtr vmesa, numLevels = lastLevel - firstLevel + 1; - log2Width = tObj->Image[firstLevel]->WidthLog2; - log2Height = tObj->Image[firstLevel]->HeightLog2; + log2Width = tObj->Image[0][firstLevel]->WidthLog2; + log2Height = tObj->Image[0][firstLevel]->HeightLog2; /* Figure out the amount of memory required to hold all the mipmap * levels. Choose the smallest pitch to accomodate the largest * mipmap: */ - width = tObj->Image[firstLevel]->Width * t->texelBytes; + width = tObj->Image[0][firstLevel]->Width * t->texelBytes; for (pitch = 32, log_pitch=2 ; pitch < width ; pitch *= 2 ) log_pitch++; @@ -71,12 +71,12 @@ static void s3vSetTexImages( s3vContextPtr vmesa, * lines required: */ for ( height = i = 0 ; i < numLevels ; i++ ) { - t->image[i].image = tObj->Image[firstLevel + i]; + t->image[i].image = tObj->Image[0][firstLevel + i]; t->image[i].offset = height * pitch; t->image[i].internalFormat = baseImage->Format; height += t->image[i].image->Height; t->TextureBaseAddr[i] = (t->BufAddr + t->image[i].offset + - _TEXALIGN) & (CARD32)(~_TEXALIGN); + _TEXALIGN) & (GLuint)(~_TEXALIGN); } t->Pitch = pitch; @@ -96,13 +96,13 @@ static void s3vUpdateTexEnv( GLcontext *ctx, GLuint unit ) s3vContextPtr vmesa = S3V_CONTEXT(ctx); const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit]; const struct gl_texture_object *tObj = texUnit->_Current; - const GLuint format = tObj->Image[tObj->BaseLevel]->Format; + const GLuint format = tObj->Image[0][tObj->BaseLevel]->Format; /* s3vTextureObjectPtr t = (s3vTextureObjectPtr)tObj->DriverData; GLuint tc; */ GLuint alpha = 0; - CARD32 cmd = vmesa->CMD; + GLuint cmd = vmesa->CMD; #if TEX_DEBUG_ON static unsigned int times=0; DEBUG_TEX(("*** s3vUpdateTexEnv: %i ***\n", ++times)); @@ -205,14 +205,14 @@ static void s3vUpdateTexUnit( GLcontext *ctx, GLuint unit ) { s3vContextPtr vmesa = S3V_CONTEXT(ctx); struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit]; - CARD32 cmd = vmesa->CMD; + GLuint cmd = vmesa->CMD; #if TEX_DEBUG_ON static unsigned int times=0; DEBUG_TEX(("*** s3vUpdateTexUnit: %i ***\n", ++times)); DEBUG_TEX(("and vmesa->CMD was 0x%x\n", vmesa->CMD)); #endif - if (texUnit->_ReallyEnabled == TEXTURE0_2D) + if (texUnit->_ReallyEnabled == TEXTURE_2D_BIT) { struct gl_texture_object *tObj = texUnit->_Current; s3vTextureObjectPtr t = (s3vTextureObjectPtr)tObj->DriverData; @@ -246,8 +246,9 @@ static void s3vUpdateTexUnit( GLcontext *ctx, GLuint unit ) /* Update texture environment if texture object image format or * texture environment state has changed. */ - if (tObj->Image[tObj->BaseLevel]->Format != vmesa->TexEnvImageFmt[unit]) { - vmesa->TexEnvImageFmt[unit] = tObj->Image[tObj->BaseLevel]->Format; + if (tObj->Image[0][tObj->BaseLevel]->Format != + vmesa->TexEnvImageFmt[unit]) { + vmesa->TexEnvImageFmt[unit] = tObj->Image[0][tObj->BaseLevel]->Format; s3vUpdateTexEnv( ctx, unit ); } #if 1 @@ -283,16 +284,12 @@ static void s3vUpdateTexUnit( GLcontext *ctx, GLuint unit ) void s3vUpdateTextureState( GLcontext *ctx ) { s3vContextPtr vmesa = S3V_CONTEXT(ctx); + (void) vmesa; #if TEX_DEBUG_ON static unsigned int times=0; DEBUG_TEX(("*** s3vUpdateTextureState: #%i ***\n", ++times)); #endif - if (!ctx->Texture._ReallyEnabled) { - DEBUG_TEX(("!ctx->Texture._ReallyEnabled\n")); - return; - } - #if _TEXFALLBACK FALLBACK( vmesa, S3V_FALLBACK_TEXTURE, GL_FALSE ); #endif diff --git a/src/mesa/drivers/dri/s3v/s3v_tris.c b/src/mesa/drivers/dri/s3v/s3v_tris.c index 3b52340b4ca..d6cceddd454 100644 --- a/src/mesa/drivers/dri/s3v/s3v_tris.c +++ b/src/mesa/drivers/dri/s3v/s3v_tris.c @@ -33,7 +33,7 @@ #define HAVE_BACK_COLORS 0 #define HAVE_HW_FLATSHADE 1 #define VERTEX s3vVertex -#define TAB rast_tab +#define TAB rast_tab #define VERT_SET_RGBA( v, c ) \ do { \ @@ -55,10 +55,10 @@ do { \ static struct { - points_func points; - line_func line; - triangle_func triangle; - quad_func quad; + tnl_points_func points; + tnl_line_func line; + tnl_triangle_func triangle; + tnl_quad_func quad; } rast_tab[S3V_MAX_TRIFUNC]; #define S3V_RAST_CULL_BIT 0x01 @@ -236,7 +236,7 @@ void s3vChooseRasterState(GLcontext *ctx) if ( flags & DD_FLATSHADE ) ind |= S3V_RAST_FLAT_BIT; - if ( ctx->Texture._ReallyEnabled ) { + if ( ctx->Texture.Unit[0]._ReallyEnabled ) { ind |= S3V_RAST_TEX_BIT; } @@ -608,7 +608,7 @@ static void s3vRasterPrimitive( GLcontext *ctx, GLuint hwprim ) { s3vContextPtr vmesa = S3V_CONTEXT(ctx); /* __DRIdrawablePrivate *dPriv = vmesa->driDrawable; */ - CARD32 cmd = vmesa->CMD; + GLuint cmd = vmesa->CMD; unsigned int _hw_prim = hwprim; @@ -650,7 +650,7 @@ static void s3vRenderPrimitive( GLcontext *ctx, GLenum prim ) { s3vContextPtr vmesa = S3V_CONTEXT(ctx); __DRIdrawablePrivate *dPriv = vmesa->driDrawable; - CARD32 cmd = vmesa->CMD; + GLuint cmd = vmesa->CMD; unsigned int _hw_prim = hw_prim[prim]; diff --git a/src/mesa/drivers/dri/s3v/s3v_tritmp.h b/src/mesa/drivers/dri/s3v/s3v_tritmp.h index 60a5e60dc53..b2136fcb384 100644 --- a/src/mesa/drivers/dri/s3v/s3v_tritmp.h +++ b/src/mesa/drivers/dri/s3v/s3v_tritmp.h @@ -17,18 +17,26 @@ int start02, end01; \ int ystart, y01y12; \ int i, tmp, tmp2, tmp3; \ - GLfloat ydiff, fy[3] + GLfloat ydiff, fy[3]; \ + (void) v; (void) vvv; (void) x; (void) y; (void) z; (void) idx; \ + (void) dx01; (void) dy01; (void) delt02; (void) deltzy; \ + (void) zstart; (void) start02; (void) ystart; (void) y01y12; \ + (void) i; (void) tmp; (void) tmp2; (void) tmp3; (void) ydiff; (void) fy #define LINE_FLAT_VARS \ int arstart, gbstart; \ int deltarx, deltgbx, deltary, deltgby; \ - GLubyte *(col)[3] + GLubyte *(col)[3]; \ + (void) arstart; (void) gbstart; (void) deltarx; (void) deltgbx; \ + (void) deltary; (void) deltgby; (void) col #define LINE_GOURAUD_VARS \ int arstart, gbstart; \ int deltary, deltgby; \ int ctmp, ctmp2, ctmp3, ctmp4; \ - GLubyte *(col)[3] + GLubyte *(col)[3]; \ + (void) arstart; (void) gbstart; (void) deltary; (void) deltgby; \ + (void) ctmp; (void) ctmp2; (void) ctmp3; (void) ctmp4; (void) col #define SORT_LINE_VERT() \ do { \ @@ -199,18 +207,29 @@ do { \ int start02, end01, end12; \ int ystart, y01y12; \ int i, tmp, lr; \ - GLfloat ydiff, fy[3] + GLfloat ydiff, fy[3]; \ + (void) v; (void) x; (void) y; (void) z; (void) idx; (void) dx01; \ + (void) dy01; (void) dx02; (void) dy02; (void) dx12; (void) dy12; \ + (void) delt01; (void) delt02; (void) delt12; (void) deltzx; \ + (void) deltzy; (void) zstart; (void) start02; (void) end01; \ + (void) end12; (void) ystart; (void) y01y12; (void) i; (void) tmp; \ + (void) lr; (void) ydiff; (void) fy #define GOURAUD_VARS \ int arstart, gbstart; \ int deltarx, deltgbx, deltary, deltgby; \ int ctmp, ctmp2, ctmp3, ctmp4; \ - GLubyte *(col)[3] + GLubyte *(col)[3]; \ + (void) arstart; (void) gbstart; (void) deltarx; (void) deltgbx; \ + (void) deltary; (void) deltgby; (void) ctmp; (void) ctmp2; \ + (void) ctmp3; (void) ctmp4; (void) col #define FLAT_VARS \ int arstart, gbstart; \ int deltarx, deltgbx, deltary, deltgby; \ - GLubyte *(col)[3] + GLubyte *(col)[3]; \ + (void) arstart; (void) gbstart; (void) deltarx; (void) deltgbx; \ + (void) deltary; (void) deltgby; (void) col #define TEX_VARS \ int u0, u1, u2; \ @@ -226,7 +245,15 @@ do { \ int rbaseu, rbasev; \ int dstart, ustart, wstart, vstart; \ static int stmp = 0; \ - s3vTextureObjectPtr t + s3vTextureObjectPtr t; \ + (void) u0; (void) u1; (void) u2; (void) ru0; (void) ru1; (void) ru2; \ + (void) v0; (void) v1; (void) v2; (void) rv0; (void) rv1; (void) rv2; \ + (void) w0; (void) w1; (void) w2; (void) rw0; (void) rw1; (void) rw2; \ + (void) baseu; (void) basev; (void) d0; (void) d1; (void) d2; \ + (void) deltdx; (void) deltvx; (void) deltux; (void) deltdy; \ + (void) deltuy; (void) deltwx; (void) deltwy; (void) rbaseu; \ + (void) rbasev; (void) dstart; (void) ustart; (void) wstart; \ + (void) vstart; (void) stmp; (void) t #define SORT_VERT() \ do { \ @@ -376,15 +403,15 @@ do { \ u0 = (v[idx[0]].texcoord[0][0] \ * (GLfloat)(t->image[0].image->Width) * 256.0); \ u1 = (v[idx[1]].texcoord[0][0] \ - * (GLfloat)(t->globj->Image[0]->Width) * 256.0); \ + * (GLfloat)(t->globj->Image[0][0]->Width) * 256.0); \ u2 = (v[idx[2]].texcoord[0][0] \ - * (GLfloat)(t->globj->Image[0]->Width) * 256.0); \ + * (GLfloat)(t->globj->Image[0][0]->Width) * 256.0); \ v0 = (v[idx[0]].texcoord[0][1] \ - * (GLfloat)(t->globj->Image[0]->Height) * 256.0); \ + * (GLfloat)(t->globj->Image[0][0]->Height) * 256.0); \ v1 = (v[idx[1]].texcoord[0][1] \ - * (GLfloat)(t->globj->Image[0]->Height) * 256.0); \ + * (GLfloat)(t->globj->Image[0][0]->Height) * 256.0); \ v2 = (v[idx[2]].texcoord[0][1] \ - * (GLfloat)(t->globj->Image[0]->Height) * 256.0); \ + * (GLfloat)(t->globj->Image[0][0]->Height) * 256.0); \ \ w0 = (v[idx[0]].win[3]); \ w1 = (v[idx[1]].win[3]); \ @@ -492,8 +519,8 @@ do { \ rv1 = (((v1 - basev) * rw1)); \ rv2 = (((v2 - basev) * rw2)); \ \ - while (baseu < 0) { baseu += (t->globj->Image[0]->Width << 8); } \ - while (basev < 0) { basev += (t->globj->Image[0]->Height << 8); } \ + while (baseu < 0) { baseu += (t->globj->Image[0][0]->Width << 8); } \ + while (basev < 0) { basev += (t->globj->Image[0][0]->Height << 8); } \ \ if (!(baseu & 0xFF)) \ { baseu = (baseu >> 8); } \ @@ -505,8 +532,8 @@ do { \ else \ { basev = (basev >> 8) - 1; } \ \ - rbaseu = (baseu) << (16 - t->globj->Image[0]->WidthLog2); \ - rbasev = (basev) << (16 - t->globj->Image[0]->WidthLog2); \ + rbaseu = (baseu) << (16 - t->globj->Image[0][0]->WidthLog2); \ + rbasev = (basev) << (16 - t->globj->Image[0][0]->WidthLog2); \ deltuy = (((ru2 - ru0) / dy02)); \ deltvy = (((rv2 - rv0) / dy02)); \ rw0 *= (1024.0 * 512.0); \ @@ -591,6 +618,7 @@ static void TAG(s3v_line)( s3vContextPtr vmesa, #endif #if (IND & S3V_RAST_CULL_BIT) GLfloat cull; + (void) cull; #endif DEBUG(("*** s3v_line: ")); diff --git a/src/mesa/drivers/dri/s3v/s3v_vb.c b/src/mesa/drivers/dri/s3v/s3v_vb.c index f8ca6d15ee3..dadf2b48911 100644 --- a/src/mesa/drivers/dri/s3v/s3v_vb.c +++ b/src/mesa/drivers/dri/s3v/s3v_vb.c @@ -4,10 +4,8 @@ #include "glheader.h" #include "mtypes.h" -#include "mem.h" #include "macros.h" #include "colormac.h" -#include "mmath.h" #include "swrast_setup/swrast_setup.h" #include "tnl/t_context.h" @@ -26,8 +24,8 @@ static struct { void (*emit)( GLcontext *, GLuint, GLuint, void *, GLuint ); - interp_func interp; - copy_pv_func copy_pv; + tnl_interp_func interp; + tnl_copy_pv_func copy_pv; GLboolean (*check_tex_sizes)( GLcontext *ctx ); GLuint vertex_size; GLuint vertex_stride_shift; @@ -61,6 +59,7 @@ static struct { #define GET_VIEWPORT_MAT() 0 /* vmesa->hw_viewport */ #define GET_TEXSOURCE(n) n #define GET_VERTEX_FORMAT() 0 +#define GET_VERTEX_SIZE() S3V_CONTEXT(ctx)->vertex_size * sizeof(GLuint) #define GET_VERTEX_STORE() S3V_CONTEXT(ctx)->verts #define GET_VERTEX_STRIDE_SHIFT() S3V_CONTEXT(ctx)->vertex_stride_shift #define INVALIDATE_STORED_VERTICES() @@ -71,8 +70,8 @@ static struct { #define HAVE_HW_DIVIDE 1 #define HAVE_RGBA_COLOR 0 /* we're BGRA */ #define HAVE_TINY_VERTICES 1 -#define HAVE_NOTEX_VERTICES 1 -#define HAVE_TEX0_VERTICES 1 +#define HAVE_NOTEX_VERTICES 0 +#define HAVE_TEX0_VERTICES 0 #define HAVE_TEX1_VERTICES 0 #define HAVE_TEX2_VERTICES 0 #define HAVE_TEX3_VERTICES 0 @@ -216,7 +215,6 @@ void s3vBuildVertices( GLcontext *ctx, GLubyte *v = ((GLubyte *)vmesa->verts + (start<<vmesa->vertex_stride_shift)); GLuint stride = 1<<vmesa->vertex_stride_shift; - GLuint ind = 0; DEBUG(("*** s3vBuildVertices ***\n")); DEBUG(("vmesa->SetupNewInputs = 0x%x\n", vmesa->SetupNewInputs)); @@ -284,7 +282,7 @@ void s3vChooseVertexState( GLcontext *ctx ) */ - if (ctx->Texture._ReallyEnabled) { + if (ctx->Texture.Unit[0]._ReallyEnabled) { _tnl_need_projected_coords( ctx, GL_FALSE ); ind |= S3V_TEX0_BIT; } else { @@ -330,12 +328,12 @@ void s3vFreeVB( GLcontext *ctx ) } if (vmesa->UbyteSecondaryColor.Ptr) { - ALIGN_FREE(vmesa->UbyteSecondaryColor.Ptr); + ALIGN_FREE((void *)vmesa->UbyteSecondaryColor.Ptr); vmesa->UbyteSecondaryColor.Ptr = 0; } if (vmesa->UbyteColor.Ptr) { - ALIGN_FREE(vmesa->UbyteColor.Ptr); + ALIGN_FREE((void *)vmesa->UbyteColor.Ptr); vmesa->UbyteColor.Ptr = 0; } } diff --git a/src/mesa/drivers/dri/s3v/s3v_xmesa.c b/src/mesa/drivers/dri/s3v/s3v_xmesa.c index b012c1b9cc3..ee59eaff095 100644 --- a/src/mesa/drivers/dri/s3v/s3v_xmesa.c +++ b/src/mesa/drivers/dri/s3v/s3v_xmesa.c @@ -5,7 +5,6 @@ #include "s3v_context.h" #include "s3v_vb.h" #include "context.h" -#include "mmath.h" #include "matrix.h" #include "s3v_dri.h" @@ -46,15 +45,14 @@ s3vDestroyContext(__DRIcontextPrivate *driContextPriv) vmesa->glCtx->DriverCtx = NULL; _mesa_destroy_context(vmesa->glCtx); - Xfree(vmesa); + _mesa_free(vmesa); driContextPriv->driverPrivate = NULL; } } static GLboolean -s3vCreateBuffer( Display *dpy, - __DRIscreenPrivate *driScrnPriv, +s3vCreateBuffer( __DRIscreenPrivate *driScrnPriv, __DRIdrawablePrivate *driDrawPriv, const __GLcontextModes *mesaVis, GLboolean isPixmap ) @@ -82,7 +80,7 @@ s3vDestroyBuffer(__DRIdrawablePrivate *driDrawPriv) } static void -s3vSwapBuffers(Display *dpy, void *drawablePrivate) +s3vSwapBuffers(__DRIdrawablePrivate *drawablePrivate) { __DRIdrawablePrivate *dPriv = (__DRIdrawablePrivate *) drawablePrivate; __DRIscreenPrivate *sPriv; @@ -99,14 +97,14 @@ s3vSwapBuffers(Display *dpy, void *drawablePrivate) /* DMAFLUSH(); */ - _mesa_swapbuffers( ctx ); + _mesa_notifySwapBuffers( ctx ); vmesa = (s3vContextPtr) dPriv->driContextPriv->driverPrivate; /* driScrnPriv = vmesa->driScreen; */ /* if (vmesa->EnabledFlags & S3V_BACK_BUFFER) */ -/* _mesa_swapbuffers( ctx ); */ +/* _mesa_notifySwapBuffers( ctx ); */ #if 1 { int x0, y0, x1, y1; @@ -275,18 +273,6 @@ s3vUnbindContext( __DRIcontextPrivate *driContextPriv ) return GL_TRUE; } -static GLboolean -s3vOpenFullScreen(__DRIcontextPrivate *driContextPriv) -{ - return GL_TRUE; -} - -static GLboolean -s3vCloseFullScreen(__DRIcontextPrivate *driContextPriv) -{ - return GL_TRUE; -} - static struct __DriverAPIRec s3vAPI = { s3vInitDriver, @@ -298,12 +284,10 @@ static struct __DriverAPIRec s3vAPI = { s3vSwapBuffers, s3vMakeCurrent, s3vUnbindContext, - s3vOpenFullScreen, - s3vCloseFullScreen }; - +#if 0 /* * This is the bootstrap function for the driver. * The __driCreateScreen name is the symbol that libGL.so fetches. @@ -319,6 +303,7 @@ void *__driCreateScreen(Display *dpy, int scrn, __DRIscreen *psc, DEBUG(("__driCreateScreen: psp = %p\n", psp)); return (void *) psp; } +#endif void __driRegisterExtensions(void) { |