summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/sis/sis_context.h
diff options
context:
space:
mode:
authorEric Anholt <anholt@FreeBSD.org>2005-10-19 00:53:05 +0000
committerEric Anholt <anholt@FreeBSD.org>2005-10-19 00:53:05 +0000
commitdeadd47aab68d4914d70b19fa08f834623f2e0a7 (patch)
tree5f951bc349cff8655995dcfee24372c489647f68 /src/mesa/drivers/dri/sis/sis_context.h
parentbf3f0bcf802af20b2d95890ad4dcc56c98289b10 (diff)
Bug #4615: Fix the SiS driver for the renderbuffer changes. Previously, all
drirenderbuffers pointed at screen offset 0 and NULL. Instead, set up the front buffer at startup but leave the others for later, since sis allocates them on demand rather than using the static method of the other non-sis-descendent drivers. Some basic apps work, but fallbacks may be broken still.
Diffstat (limited to 'src/mesa/drivers/dri/sis/sis_context.h')
-rw-r--r--src/mesa/drivers/dri/sis/sis_context.h39
1 files changed, 24 insertions, 15 deletions
diff --git a/src/mesa/drivers/dri/sis/sis_context.h b/src/mesa/drivers/dri/sis/sis_context.h
index fee8f6ead1..5ef1895362 100644
--- a/src/mesa/drivers/dri/sis/sis_context.h
+++ b/src/mesa/drivers/dri/sis/sis_context.h
@@ -231,6 +231,19 @@ typedef void (*sis_line_func)( sisContextPtr,
typedef void (*sis_point_func)( sisContextPtr,
sisVertex * );
+/**
+ * Derived from gl_renderbuffer.
+ */
+struct sis_renderbuffer {
+ struct gl_renderbuffer Base; /* must be first! */
+ drmSize size;
+ GLuint offset;
+ void *handle;
+ GLuint pitch;
+ GLuint bpp;
+ char *map;
+};
+
/* Device dependent context state */
struct sis_context
@@ -264,8 +277,6 @@ struct sis_context
unsigned char *IOBase;
unsigned char *FbBase;
unsigned int displayWidth;
- unsigned int frontOffset;
- unsigned int frontPitch;
/* HW RGBA layout */
unsigned int redMask, greenMask, blueMask, alphaMask;
@@ -333,18 +344,12 @@ struct sis_context
/* Front/back/depth buffer info */
GLuint width, height; /* size of buffers */
GLint bottom; /* used for FLIP macro */
- GLvoid *backbuffer;
- unsigned int backOffset;
- unsigned int backPitch;
- GLvoid *depthbuffer;
- unsigned int depthOffset;
- unsigned int depthPitch;
- void *zbFree, *bbFree; /* Cookies for freeing buffers */
ENGPACKET zClearPacket, cbClearPacket;
-
- /* Drawable, cliprect and scissor information
- */
- GLint drawOffset, drawPitch;
+ /* XXX These don't belong here. They should be per-drawable state. */
+ struct sis_renderbuffer front;
+ struct sis_renderbuffer back;
+ struct sis_renderbuffer depth;
+ struct sis_renderbuffer stencil; /* mirrors depth */
/* Mirrors of some DRI state
*/
@@ -394,9 +399,10 @@ struct sis_context
*(volatile GLuint *)(smesa->IOBase + 0x8b60) = 0xffffffff; \
}
-#define sis_fatal_error(msg) \
+#define sis_fatal_error(...) \
do { \
- fprintf(stderr, "[%s:%d]: %s", __FILE__, __LINE__, msg); \
+ fprintf(stderr, "[%s:%d]:", __FILE__, __LINE__); \
+ fprintf(stderr, __VA_ARGS__); \
exit(-1); \
} while (0)
@@ -422,6 +428,9 @@ extern GLboolean sisCreateContext( const __GLcontextModes *glVisual,
void *sharedContextPrivate );
extern void sisDestroyContext( __DRIcontextPrivate * );
+void sisReAllocateBuffers(GLcontext *ctx, GLframebuffer *drawbuffer,
+ GLuint width, GLuint height);
+
extern GLboolean sisMakeCurrent( __DRIcontextPrivate *driContextPriv,
__DRIdrawablePrivate *driDrawPriv,
__DRIdrawablePrivate *driReadPriv );