radeon/r200/r300: fix warnings
authorDave Airlie <airlied@linux.ie>
Tue, 24 Mar 2009 08:32:46 +0000 (18:32 +1000)
committerDave Airlie <airlied@linux.ie>
Tue, 24 Mar 2009 08:32:46 +0000 (18:32 +1000)
12 files changed:
src/mesa/drivers/dri/r200/r200_cmdbuf.c
src/mesa/drivers/dri/r200/r200_context.c
src/mesa/drivers/dri/r200/r200_ioctl.c
src/mesa/drivers/dri/r300/r300_state.c
src/mesa/drivers/dri/radeon/radeon_common_context.c
src/mesa/drivers/dri/radeon/radeon_fbo.c
src/mesa/drivers/dri/radeon/radeon_lock.c
src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c
src/mesa/drivers/dri/radeon/radeon_mipmap_tree.h
src/mesa/drivers/dri/radeon/radeon_span.c
src/mesa/drivers/dri/radeon/radeon_swtcl.c
src/mesa/drivers/dri/radeon/radeon_texstate.c

index ae31bcb8311aa5c8acbe72d55d78a3d1b46d922f..83375c88a7013ce643c8f9b4d1265ddbf5c93d56 100644 (file)
@@ -112,7 +112,6 @@ void r200EmitVbufPrim( r200ContextPtr rmesa,
                        GLuint primitive,
                        GLuint vertex_nr )
 {
-   drm_radeon_cmd_header_t *cmd;
    BATCH_LOCALS(&rmesa->radeon);
 
    assert(!(primitive & R200_VF_PRIM_WALK_IND));
@@ -164,8 +163,7 @@ static void r200FireEB(r200ContextPtr rmesa, int vertex_count, int type)
 
 void r200FlushElts(GLcontext *ctx)
 {
-  r200ContextPtr rmesa = R200_CONTEXT(ctx);
-   int dwords;
+   r200ContextPtr rmesa = R200_CONTEXT(ctx);
    int nr, elt_used = rmesa->tcl.elt_used;
 
    if (R200_DEBUG & (DEBUG_IOCTL|DEBUG_PRIMS))
@@ -345,14 +343,3 @@ void r200EmitAOS(r200ContextPtr rmesa, GLuint nr, GLuint offset)
    }
    END_BATCH();
 }
-
-void r200FireAOS(r200ContextPtr rmesa, int vertex_count, int type)
-{
-       BATCH_LOCALS(&rmesa->radeon);
-
-       BEGIN_BATCH(3);
-       OUT_BATCH_PACKET3(R200_CP_CMD_3D_DRAW_VBUF_2, 0);
-       OUT_BATCH(R200_VF_PRIM_WALK_LIST | (vertex_count << 16) | type);
-       END_BATCH();
-}
-
index d3898d0900d111a1b4d55adce0048b93a8939651..564e168290c052cef1644879d81a50664b0e5854 100644 (file)
@@ -243,7 +243,6 @@ static void r200_get_lock(radeonContextPtr radeon)
 {
    r200ContextPtr rmesa = (r200ContextPtr)radeon;
    drm_radeon_sarea_t *sarea = radeon->sarea;
-   int i;
 
    R200_STATECHANGE( rmesa, ctx );
    if (rmesa->radeon.sarea->tiling_enabled) {
index ccb56202f6d9758811640f5b2605ffae2fedb43f..b8e40da475c614185d5feadfc72c52cb6ef21631 100644 (file)
@@ -193,7 +193,6 @@ static void r200Clear( GLcontext *ctx, GLbitfield mask )
    __DRIdrawablePrivate *dPriv = rmesa->radeon.dri.drawable;
    GLuint flags = 0;
    GLuint color_mask = 0;
-   GLint ret;
    GLuint orig_mask = mask;
 
    if ( R200_DEBUG & DEBUG_IOCTL ) {
index f49b43c2070ce3d7fe7c171a3df30b313fc83cec..6796d36d4cdb776444e0ac70149d5a3e1897d814 100644 (file)
@@ -42,6 +42,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #include "main/macros.h"
 #include "main/context.h"
 #include "main/dd.h"
+#include "main/framebuffer.h"
 #include "main/simple_list.h"
 #include "main/api_arrayelt.h"
 #include "main/texformat.h"
@@ -2029,7 +2030,6 @@ static void r300Enable(GLcontext * ctx, GLenum cap, GLboolean state)
 static void r300ResetHwState(r300ContextPtr r300)
 {
        GLcontext *ctx = r300->radeon.glCtx;
-       struct radeon_renderbuffer *rrb;
        int has_tcl = 1;
 
        if (!(r300->radeon.radeonScreen->chip_flags & RADEON_CHIPSET_TCL))
@@ -2039,7 +2039,6 @@ static void r300ResetHwState(r300ContextPtr r300)
                fprintf(stderr, "%s\n", __FUNCTION__);
 
        radeon_firevertices(&r300->radeon);
-       //r300UpdateWindow(ctx);
 
        r300ColorMask(ctx,
                      ctx->Color.ColorMask[RCOMP],
@@ -2524,9 +2523,6 @@ static void r300InvalidateState(GLcontext * ctx, GLuint new_state)
  */
 void r300InitState(r300ContextPtr r300)
 {
-       GLcontext *ctx = r300->radeon.glCtx;
-       GLuint depth_fmt;
-
        memset(&(r300->state.texture), 0, sizeof(r300->state.texture));
 
        r300ResetHwState(r300);
index 5b23473ab375e845db9f420f74f6652acc5e45be..9964de7c7ccdac9154670ad9da5726d85a842537 100644 (file)
@@ -36,6 +36,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #include "xmlpool.h"           /* for symbolic values of enum-type options */
 #include "utils.h"
 #include "vblank.h"
+#include "drirenderbuffer.h"
 #include "main/state.h"
 
 #define DRIVER_DATE "20090101"
@@ -398,7 +399,7 @@ radeon_update_renderbuffers(__DRIcontext *context, __DRIdrawable *drawable)
        struct radeon_framebuffer *draw;
        radeonContextPtr radeon;
        char *regname;
-       struct radeon_bo *depth_bo, *bo;
+       struct radeon_bo *depth_bo = NULL, *bo;
 
        if (RADEON_DEBUG & DEBUG_DRI)
            fprintf(stderr, "enter %s, drawable %p\n", __func__, drawable);
index 40945855d968828cc29db7a14dc8079cfb7b9490..96ba5d3c60ef4a8f47fccc22ce85f5d1142f4003 100644 (file)
@@ -510,8 +510,9 @@ radeon_render_texture(GLcontext * ctx,
                                             att->TextureLevel);
 
    if (att->Texture->Target == GL_TEXTURE_3D) {
-      const GLuint *offsets = radeon_miptree_depth_offsets(radeon_image->mt,
-                                                          att->TextureLevel);
+      GLuint offsets[6];
+      radeon_miptree_depth_offsets(radeon_image->mt, att->TextureLevel,
+                                  offsets);
       imageOffset += offsets[att->Zoffset];
    }
 
index e1bb2cd6e21629b29f22c36702b950f1a6440d90..fe19218d7ae316215994274a52c6427d51ed040d 100644 (file)
@@ -61,7 +61,6 @@ void radeonGetLock(radeonContextPtr rmesa, GLuint flags)
        __DRIdrawablePrivate *const drawable = rmesa->dri.drawable;
        __DRIdrawablePrivate *const readable = rmesa->dri.readable;
        __DRIscreenPrivate *sPriv = rmesa->dri.screen;
-       drm_radeon_sarea_t *sarea = rmesa->sarea;
 
        assert(drawable != NULL);
 
@@ -92,7 +91,6 @@ void radeonGetLock(radeonContextPtr rmesa, GLuint flags)
 
 void radeon_lock_hardware(radeonContextPtr radeon)
 {
-       __DRIdrawable *dPriv = radeon->dri.drawable;
        char ret = 0;
        struct radeon_framebuffer *rfb = NULL;
        struct radeon_renderbuffer *rrb = NULL;
index 228629e3c45405b7ae19e4caa9c2dc0c37f0b9cc..34d6261706807e919214508321343fcaf432c952 100644 (file)
@@ -94,8 +94,6 @@ static void compute_tex_image_offset(radeon_mipmap_tree *mt,
        /* Find image size in bytes */
        if (mt->compressed) {
                /* TODO: Is this correct? Need test cases for compressed textures! */
-               GLuint align;
-
                lvl->rowstride = (lvl->width * mt->bpp + 63) & ~63;
                lvl->size = radeon_compressed_texture_size(mt->radeon->glCtx,
                                                           lvl->width, lvl->height, lvl->depth, mt->compressed);
@@ -365,14 +363,16 @@ void radeon_try_alloc_miptree(radeonContextPtr rmesa, radeonTexObj *t,
  *
  * These functions present that view to mesa:
  */
-const GLuint *
-radeon_miptree_depth_offsets(radeon_mipmap_tree *mt, GLuint level)
+void
+radeon_miptree_depth_offsets(radeon_mipmap_tree *mt, GLuint level, GLuint *offsets)
 {
-     static const GLuint zero = 0;
      if (mt->target != GL_TEXTURE_3D || mt->faces == 1)
-       return &zero;
-     else
-       return mt->levels[level].faces[0].offset;
+        offsets[0] = 0;
+     else {
+       int i;
+       for (i = 0; i < 6; i++)
+               offsets[i] = mt->levels[level].faces[i].offset;
+     }
 }
 
 GLuint
index d9ad5ad39a3e1d39e043fb86c3e2ea0be28ece1e..697010bc02206fb6d0926402c7175bad2653795b 100644 (file)
@@ -94,6 +94,5 @@ void radeon_try_alloc_miptree(radeonContextPtr rmesa, radeonTexObj *t,
                              struct gl_texture_image *texImage, GLuint face, GLuint level);
 GLuint radeon_miptree_image_offset(radeon_mipmap_tree *mt,
                                   GLuint face, GLuint level);
-const GLuint *
-radeon_miptree_depth_offsets(radeon_mipmap_tree *mt, GLuint level);
+void radeon_miptree_depth_offsets(radeon_mipmap_tree *mt, GLuint level, GLuint *offsets);
 #endif /* __RADEON_MIPMAP_TREE_H_ */
index 3d2c5da4c0655ad34f632d2764e3821634fd13b8..0b4eaae02bffefefa9344ea37b9781f859d5084a 100644 (file)
@@ -377,7 +377,7 @@ do {                                                                        \
 #include "stenciltmp.h"
 
 
-void map_unmap_rb(struct gl_renderbuffer *rb, int flag)
+static void map_unmap_rb(struct gl_renderbuffer *rb, int flag)
 {
        struct radeon_renderbuffer *rrb = radeon_renderbuffer(rb);
        int r;
@@ -403,7 +403,6 @@ void map_unmap_rb(struct gl_renderbuffer *rb, int flag)
 static void
 radeon_map_unmap_buffers(GLcontext *ctx, GLboolean map)
 {
-       radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
        GLuint i, j;
 
        /* color draw buffers */
index af933a35f2b50dabac2f327b82773d58478da943..2484006f1c4e9e6ff87c8411fea43ff24e6309b0 100644 (file)
@@ -825,6 +825,4 @@ void radeonInitSwtcl( GLcontext *ctx )
 
 void radeonDestroySwtcl( GLcontext *ctx )
 {
-   r100ContextPtr rmesa = R100_CONTEXT(ctx);
-
 }
index 78e2a08559ba19ae3ab78b7017aa37f8f5e59773..9931f01b63629c4ccd2dff4c8e611ada67d32443 100644 (file)
@@ -775,11 +775,6 @@ void radeonSetTexBuffer(__DRIcontext *pDRICtx, GLint target, __DRIdrawable *dPri
 static void disable_tex_obj_state( r100ContextPtr rmesa, 
                                   int unit )
 {
-   /* do not use RADEON_DB_STATE to avoid stale texture caches */
-   uint32_t *cmd = &rmesa->hw.tex[unit].cmd[TEX_CMD_0];
-   GLuint se_coord_fmt = rmesa->hw.set.cmd[SET_SE_COORDFMT];
-   GLuint *txr_cmd = RADEON_DB_STATE( txr[unit] );
-
    RADEON_STATECHANGE( rmesa, tex[unit] );
 
    RADEON_STATECHANGE( rmesa, tcl );
@@ -1142,8 +1137,6 @@ static GLboolean radeon_validate_texture(GLcontext *ctx, struct gl_texture_objec
 static GLboolean radeonUpdateTextureUnit( GLcontext *ctx, int unit )
 {
    r100ContextPtr rmesa = R100_CONTEXT(ctx);
-   struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit];
-
 
    if (ctx->Texture.Unit[unit]._ReallyEnabled & TEXTURE_3D_BIT) {
      return GL_FALSE;