typedef struct savage_context_t *savageContextPtr;
typedef struct savage_texture_object_t *savageTextureObjectPtr;
-#include <X11/Xlibint.h>
#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 "savage_3d_reg.h"
-#include "mm.h"
+#include "main/mm.h"
#include "tnl/t_vertex.h"
#include "texmem.h"
#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:
*/
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 {
struct savage_context_t {
GLint refcount;
- GLcontext *glCtx;
+ struct gl_context *glCtx;
int lastTexHeap;
driTexHeap *textureHeaps[SAVAGE_NR_TEX_HEAPS];
struct savage_vtxbuf_t *vtxBuf;
/* aperture base */
- GLuint apertureBase[5];
+ GLubyte *apertureBase[5];
GLuint aperturePitch;
/* Manage hardware state */
GLuint dirty;
* completely on the fly:
*/
GLuint LcsCullMode;
+ GLuint texEnvColor;
/* Vertex state
*/
GLfloat hw_viewport[16];
/* DRI stuff */
GLuint bufferSize;
- GLuint vertsPending;
- GLframebuffer *glBuffer;
+ struct gl_framebuffer *glBuffer;
/* Two flags to keep track of fallbacks. */
GLuint Fallback;
/* 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 */
GLuint dirtyAge;
GLuint any_contend; /* throttle me harder */
- GLuint scissor;
- GLboolean scissorChanged;
- drm_clip_rect_t draw_rect;
- drm_clip_rect_t scissor_rect;
+ /* 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;
GLuint driFd;
- __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;
+ __DRIdrawable *driDrawable;
+ __DRIdrawable *driReadable;
- __DRIscreenPrivate *driScreen;
+ __DRIscreen *driScreen;
savageScreenPrivate *savageScreen;
drm_savage_sarea_t *sarea;
GLboolean float_depth;
GLboolean enable_fastpath;
GLboolean enable_vdma;
+ GLboolean sync_frames;
};
#define SAVAGE_CONTEXT(ctx) ((savageContextPtr)(ctx->DriverCtx))
#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