X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;ds=sidebyside;f=src%2Fmesa%2Fdrivers%2Fdri%2Fsavage%2Fsavagecontext.h;h=fd6399d6a6f59f2d6a8610e42c73f5a05212722c;hb=0c31661e73dd2979df22a275452efc71c7064f81;hp=5a66bdfa4ef24d2f002834d3ef9e43cdc0e9d3a5;hpb=675b92515ab016038ab47f37d83631fb3713384e;p=mesa.git diff --git a/src/mesa/drivers/dri/savage/savagecontext.h b/src/mesa/drivers/dri/savage/savagecontext.h index 5a66bdfa4ef..fd6399d6a6f 100644 --- a/src/mesa/drivers/dri/savage/savagecontext.h +++ b/src/mesa/drivers/dri/savage/savagecontext.h @@ -33,15 +33,16 @@ typedef struct savage_texture_object_t *savageTextureObjectPtr; #include #include "dri_util.h" -#include "mtypes.h" +#include "main/mtypes.h" #include "xf86drm.h" #include "drm.h" #include "savage_drm.h" #include "savage_init.h" -#include "mm.h" +#include "savage_3d_reg.h" +#include "main/mm.h" #include "tnl/t_vertex.h" -#include "savagetex.h" +#include "texmem.h" #include "xmlconfig.h" @@ -78,7 +79,6 @@ typedef struct savage_texture_object_t *savageTextureObjectPtr; #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 @@ -86,7 +86,6 @@ typedef struct savage_texture_object_t *savageTextureObjectPtr; /* 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: */ @@ -131,7 +130,7 @@ typedef void (*savage_point_func)( savageContextPtr, savageVertex * ); struct savage_vtxbuf_t { GLuint total, used, flushed; /* in 32 bit units */ GLuint idx; /* for DMA buffers */ - u_int32_t *buf; + uint32_t *buf; }; struct savage_cmdbuf_t { @@ -141,6 +140,11 @@ struct savage_cmdbuf_t { drm_savage_cmd_header_t *write; /* append stuff here */ }; +struct savage_elt_t { + GLuint n; /* number of elts currently allocated */ + drm_savage_cmd_header_t *cmd; /* the indexed drawing command */ +}; + struct savage_context_t { GLint refcount; @@ -148,18 +152,11 @@ struct savage_context_t { GLcontext *glCtx; int lastTexHeap; - savageTextureObjectPtr CurrentTexObj[2]; - - struct savage_texture_object_t TexObjList[SAVAGE_NR_TEX_HEAPS]; - struct savage_texture_object_t SwappedOut; - - GLuint c_texupload; - GLuint c_texusage; - GLuint tex_thrash; - - GLuint TextureMode; - - + driTexHeap *textureHeaps[SAVAGE_NR_TEX_HEAPS]; + driTextureObject swapped; + + driTextureObject *CurrentTexObj[2]; + /* Hardware state */ @@ -173,22 +170,26 @@ struct savage_context_t { /* Command buffer */ struct savage_cmdbuf_t cmdBuf; + /* Elt book-keeping */ + struct savage_elt_t elts; + GLint firstElt; + /* Vertex buffers */ struct savage_vtxbuf_t dmaVtxBuf, clientVtxBuf; struct savage_vtxbuf_t *vtxBuf; /* aperture base */ - GLuint apertureBase[5]; + GLubyte *apertureBase[5]; GLuint aperturePitch; /* Manage hardware state */ GLuint dirty; GLboolean lostContext; - memHeap_t *texHeap[SAVAGE_NR_TEX_HEAPS]; GLuint bTexEn1; /* One of the few bits of hardware state that can't be calculated * completely on the fly: */ GLuint LcsCullMode; + GLuint texEnvColor; /* Vertex state */ @@ -225,7 +226,6 @@ struct savage_context_t { GLfloat hw_viewport[16]; /* DRI stuff */ GLuint bufferSize; - GLuint vertsPending; GLframebuffer *glBuffer; @@ -236,8 +236,6 @@ struct savage_context_t { /* These refer to the current draw (front vs. back) buffer: */ - char *drawMap; /* draw buffer address in virtual mem */ - char *readMap; int drawX; /* origin of drawable in draw buffer */ int drawY; GLuint numClipRects; /* cliprects for that buffer */ @@ -261,13 +259,14 @@ struct savage_context_t { GLuint dirtyAge; GLuint any_contend; /* throttle me harder */ - GLuint scissor; - GLboolean scissorChanged; - drm_clip_rect_t draw_rect; - drm_clip_rect_t scissor_rect; - - /*Texture aging and DMA based aging*/ - unsigned int texAge[SAVAGE_NR_TEX_HEAPS]; + /* Scissor state needs to be mirrored so buffered commands can be + * emitted with the old scissor state when scissor state changes. + */ + struct { + GLboolean enabled; + GLint x, y; + GLsizei w, h; + } scissor; drm_context_t hHWContext; drm_hw_lock_t *driHwLock; @@ -276,25 +275,25 @@ struct savage_context_t { __DRIdrawablePrivate *driDrawable; __DRIdrawablePrivate *driReadable; - /** - * Drawable used by Mesa for software fallbacks for reading and - * writing. It is set by Mesa's \c SetBuffer callback, and will always be - * either \c mga_context_t::driDrawable or \c mga_context_t::driReadable. - */ - __DRIdrawablePrivate *mesa_drawable; - __DRIscreenPrivate *driScreen; savageScreenPrivate *savageScreen; drm_savage_sarea_t *sarea; GLboolean hw_stencil; + /* Performance counters + */ + GLuint c_textureSwaps; + /* Configuration cache */ driOptionCache optionCache; GLint texture_depth; GLboolean no_rast; GLboolean float_depth; + GLboolean enable_fastpath; + GLboolean enable_vdma; + GLboolean sync_frames; }; #define SAVAGE_CONTEXT(ctx) ((savageContextPtr)(ctx->DriverCtx)) @@ -308,7 +307,7 @@ extern int SAVAGE_DEBUG; #define DEBUG_FALLBACKS 0x001 #define DEBUG_VERBOSE_API 0x002 -#define DEBUG_VERBOSE_LRU 0x004 +#define DEBUG_VERBOSE_TEX 0x004 #define DEBUG_VERBOSE_MSG 0x008 #define DEBUG_DMA 0x010 #define DEBUG_STATE 0x020