summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/savage/savagecontext.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/drivers/dri/savage/savagecontext.h')
-rw-r--r--src/mesa/drivers/dri/savage/savagecontext.h61
1 files changed, 44 insertions, 17 deletions
diff --git a/src/mesa/drivers/dri/savage/savagecontext.h b/src/mesa/drivers/dri/savage/savagecontext.h
index f41b73e0de5..8978f9247cf 100644
--- a/src/mesa/drivers/dri/savage/savagecontext.h
+++ b/src/mesa/drivers/dri/savage/savagecontext.h
@@ -42,7 +42,6 @@ typedef struct savage_texture_object_t *savageTextureObjectPtr;
#include "tnl/t_vertex.h"
#include "savagetex.h"
-#include "savagedma.h"
#include "xmlconfig.h"
@@ -69,10 +68,26 @@ typedef struct savage_texture_object_t *savageTextureObjectPtr;
#define SAVAGE_NEW_TEXTURE 0x1
#define SAVAGE_NEW_CULL 0x2
+/* What needs to be changed for the current vertex dma buffer?
+ * This will go away!
+ */
+#define SAVAGE_UPLOAD_LOCAL 0x1 /* DrawLocalCtrl (S4) or
+ DrawCtrl and ZBufCtrl (S3D) */
+#define SAVAGE_UPLOAD_TEX0 0x2 /* texture unit 0 */
+#define SAVAGE_UPLOAD_TEX1 0x4 /* texture unit 1 (S4 only) */
+#define SAVAGE_UPLOAD_FOGTBL 0x8 /* fog table */
+#define SAVAGE_UPLOAD_GLOBAL 0x10 /* most global regs */
+#define SAVAGE_UPLOAD_TEXGLOBAL 0x20 /* TexBlendColor (S4 only) */
+#define SAVAGE_UPLOAD_CLIPRECTS 0x1000 /* FIXME: get rid of this */
/*define the max numer of vertex in vertex buf*/
#define SAVAGE_MAX_VERTEXS 0x10000
+/* Don't make it too big. We don't want to buffer up a whole frame
+ * that would force the application to wait later. */
+#define SAVAGE_CMDBUF_SIZE 1024
+#define SAVAGE_MAX_VERTS_PENDING 1024
+
/* Use the templated vertex formats:
*/
#define TAG(x) savage##x
@@ -113,6 +128,18 @@ typedef void (*savage_point_func)( savageContextPtr, savageVertex * );
imesa->savageScreen->deviceID == CHIP_S3TRISTAR64CDDR )
+struct savage_vtxbuf_t {
+ GLuint total, used, flushed; /* in 32 bit units */
+ GLuint idx; /* for DMA buffers */
+ u_int32_t *buf;
+};
+
+struct savage_cmdbuf_t {
+ GLuint size; /* size in qwords */
+ drm_savage_cmd_header_t *base; /* initial state starts here */
+ drm_savage_cmd_header_t *start; /* drawing/state commands start here */
+ drm_savage_cmd_header_t *write; /* append stuff here */
+};
struct savage_context_t {
@@ -143,11 +170,12 @@ struct savage_context_t {
GLuint new_gl_state;
GLboolean ptexHack;
- GLuint BCIBase;
- GLuint MMIO_BASE;
+ /* Command buffer */
+ struct savage_cmdbuf_t cmdBuf;
- /* DMA command buffer */
- DMABuffer_t DMABuf;
+ /* Vertex buffers */
+ struct savage_vtxbuf_t dmaVtxBuf, clientVtxBuf;
+ struct savage_vtxbuf_t *vtxBuf;
/* aperture base */
GLuint apertureBase[5];
@@ -179,7 +207,8 @@ struct savage_context_t {
GLenum raster_primitive;
GLenum render_primitive;
- GLuint DrawPrimitiveCmd;
+ GLuint skip;
+ GLubyte HwPrim;
GLuint HwVertexSize;
/* Fallback rasterization functions
@@ -194,8 +223,9 @@ struct savage_context_t {
GLuint ClearColor;
GLfloat depth_scale;
GLfloat hw_viewport[16];
- /* DRI stuff */
- drmBufPtr vertex_dma_buffer;
+ /* DRI stuff */
+ GLuint bufferSize;
+ GLuint vertsPending;
GLframebuffer *glBuffer;
@@ -225,8 +255,8 @@ struct savage_context_t {
GLuint backup_streamFIFO;
GLuint NotFirstFrame;
+ GLboolean inSwap;
GLuint lastSwap;
- GLuint secondLastSwap;
GLuint ctxAge;
GLuint dirtyAge;
GLuint any_contend; /* throttle me harder */
@@ -235,7 +265,7 @@ struct savage_context_t {
GLboolean scissorChanged;
drm_clip_rect_t draw_rect;
drm_clip_rect_t scissor_rect;
- drm_clip_rect_t tmp_boxes[2][SAVAGE_NR_SAREA_CLIPRECTS];
+
/*Texture aging and DMA based aging*/
unsigned int texAge[SAVAGE_NR_TEX_HEAPS];
@@ -259,16 +289,11 @@ struct savage_context_t {
GLboolean hw_stencil;
- /*shadow pointer*/
- volatile GLuint *shadowPointer;
- volatile GLuint *eventTag1;
- GLuint shadowCounter;
- GLboolean shadowStatus;
-
/* Configuration cache
*/
driOptionCache optionCache;
- int texture_depth;
+ GLint texture_depth;
+ GLboolean no_rast;
};
#define SAVAGE_CONTEXT(ctx) ((savageContextPtr)(ctx->DriverCtx))
@@ -283,6 +308,8 @@ extern int SAVAGE_DEBUG;
#define DEBUG_FALLBACKS 0x001
#define DEBUG_VERBOSE_API 0x002
#define DEBUG_VERBOSE_LRU 0x004
+#define DEBUG_VERBOSE_MSG 0x008
+#define DEBUG_DMA 0x010
#define TARGET_FRONT 0x0
#define TARGET_BACK 0x1