summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/savage
diff options
context:
space:
mode:
authorKeith Whitwell <keith@tungstengraphics.com>2007-01-16 11:22:57 +0000
committerKeith Whitwell <keith@tungstengraphics.com>2007-01-16 11:22:57 +0000
commit6a3fdc3a1ea6c306d9543791bf172dd1052d7382 (patch)
treec372c6daff13e435e79914c2e40dfe9d370c337b /src/mesa/drivers/dri/savage
parent0b412f8f156b46b0e7220a2b61e0f41781769f66 (diff)
parenta03fc8277180e2171519165a724849e2254ef0b7 (diff)
Merge branch 'master' of git+ssh://keithw@git.freedesktop.org/git/mesa/mesa into vbo-0.2
Conflicts: src/mesa/array_cache/sources src/mesa/drivers/dri/i965/brw_context.c src/mesa/drivers/dri/i965/brw_draw.c src/mesa/drivers/dri/i965/brw_fallback.c src/mesa/drivers/dri/i965/brw_vs_emit.c src/mesa/drivers/dri/i965/brw_vs_tnl.c src/mesa/drivers/dri/mach64/mach64_context.c src/mesa/main/extensions.c src/mesa/main/getstring.c src/mesa/tnl/sources src/mesa/tnl/t_save_api.c src/mesa/tnl/t_save_playback.c src/mesa/tnl/t_vtx_api.c src/mesa/tnl/t_vtx_exec.c src/mesa/vbo/vbo_attrib.h src/mesa/vbo/vbo_exec_api.c src/mesa/vbo/vbo_save_api.c src/mesa/vbo/vbo_save_draw.c
Diffstat (limited to 'src/mesa/drivers/dri/savage')
-rw-r--r--src/mesa/drivers/dri/savage/savage_init.h13
-rw-r--r--src/mesa/drivers/dri/savage/savage_xmesa.c63
-rw-r--r--src/mesa/drivers/dri/savage/savagedd.c19
-rw-r--r--src/mesa/drivers/dri/savage/savagespan.c6
-rw-r--r--src/mesa/drivers/dri/savage/savagestate.c11
5 files changed, 36 insertions, 76 deletions
diff --git a/src/mesa/drivers/dri/savage/savage_init.h b/src/mesa/drivers/dri/savage/savage_init.h
index 0dec397b7b..43fb969c69 100644
--- a/src/mesa/drivers/dri/savage/savage_init.h
+++ b/src/mesa/drivers/dri/savage/savage_init.h
@@ -80,21 +80,10 @@ typedef struct {
} savageScreenPrivate;
-/**
- * savageRenderbuffer, derived from Mesa's gl_renderbuffer
- */
-typedef struct {
- struct gl_renderbuffer Base;
- /* XXX per-window info should go here */
- int foo, bar;
-} savageRenderbuffer;
-
-
#include "savagecontext.h"
extern void savageGetLock( savageContextPtr imesa, GLuint flags );
-extern void savageXMesaSetBackClipRects( savageContextPtr imesa );
-extern void savageXMesaSetFrontClipRects( savageContextPtr imesa );
+extern void savageXMesaSetClipRects(savageContextPtr imesa);
#define GET_DISPATCH_AGE( imesa ) imesa->sarea->last_dispatch
diff --git a/src/mesa/drivers/dri/savage/savage_xmesa.c b/src/mesa/drivers/dri/savage/savage_xmesa.c
index 3557ce0118..ad79b9235c 100644
--- a/src/mesa/drivers/dri/savage/savage_xmesa.c
+++ b/src/mesa/drivers/dri/savage/savage_xmesa.c
@@ -173,6 +173,9 @@ savageInitDriver(__DRIscreenPrivate *sPriv)
{
savageScreenPrivate *savageScreen;
SAVAGEDRIPtr gDRIPriv = (SAVAGEDRIPtr)sPriv->pDevPriv;
+ PFNGLXSCRENABLEEXTENSIONPROC glx_enable_extension =
+ (PFNGLXSCRENABLEEXTENSIONPROC) (*dri_interface->getProcAddress("glxEnableExtension"));
+
if (sPriv->devPrivSize != sizeof(SAVAGEDRIRec)) {
fprintf(stderr,"\nERROR! sizeof(SAVAGEDRIRec) does not match passed size from device driver\n");
@@ -260,6 +263,11 @@ savageInitDriver(__DRIscreenPrivate *sPriv)
driParseOptionInfo (&savageScreen->optionCache,
__driConfigOptions, __driNConfigOptions);
+ if (glx_enable_extension != NULL) {
+ (*glx_enable_extension)(sPriv->psc->screenConfigs,
+ "GLX_SGI_make_current_read");
+ }
+
#if 0
savageDDFastPathInit();
savageDDTrifuncInit();
@@ -716,34 +724,18 @@ void XMesaSwapBuffers(__DRIdrawablePrivate *driDrawPriv)
}
#endif
-void savageXMesaSetFrontClipRects( savageContextPtr imesa )
-{
- __DRIdrawablePrivate *dPriv = imesa->driDrawable;
-
- imesa->numClipRects = dPriv->numClipRects;
- imesa->pClipRects = dPriv->pClipRects;
- imesa->drawX = dPriv->x;
- imesa->drawY = dPriv->y;
- savageCalcViewport( imesa->glCtx );
-}
-
-
-void savageXMesaSetBackClipRects( savageContextPtr imesa )
+void savageXMesaSetClipRects(savageContextPtr imesa)
{
__DRIdrawablePrivate *dPriv = imesa->driDrawable;
- if (dPriv->numBackClipRects == 0)
- {
-
-
+ if ((dPriv->numBackClipRects == 0)
+ || (imesa->glCtx->DrawBuffer->_ColorDrawBufferMask[0] == BUFFER_BIT_FRONT_LEFT)) {
imesa->numClipRects = dPriv->numClipRects;
imesa->pClipRects = dPriv->pClipRects;
imesa->drawX = dPriv->x;
imesa->drawY = dPriv->y;
} else {
-
-
imesa->numClipRects = dPriv->numBackClipRects;
imesa->pClipRects = dPriv->pBackClipRects;
imesa->drawX = dPriv->backX;
@@ -756,18 +748,17 @@ void savageXMesaSetBackClipRects( savageContextPtr imesa )
static void savageXMesaWindowMoved( savageContextPtr imesa )
{
+ __DRIdrawablePrivate *const drawable = imesa->driDrawable;
+ __DRIdrawablePrivate *const readable = imesa->driReadable;
+
if (0)
fprintf(stderr, "savageXMesaWindowMoved\n\n");
- switch (imesa->glCtx->DrawBuffer->_ColorDrawBufferMask[0]) {
- case BUFFER_BIT_FRONT_LEFT:
- savageXMesaSetFrontClipRects( imesa );
- break;
- case BUFFER_BIT_BACK_LEFT:
- savageXMesaSetBackClipRects( imesa );
- break;
- default:
- break;
+ savageXMesaSetClipRects(imesa);
+
+ driUpdateFramebufferSize(imesa->glCtx, drawable);
+ if (drawable != readable) {
+ driUpdateFramebufferSize(imesa->glCtx, readable);
}
}
@@ -858,11 +849,12 @@ savageMakeCurrent(__DRIcontextPrivate *driContextPriv,
void savageGetLock( savageContextPtr imesa, GLuint flags )
{
- __DRIdrawablePrivate *dPriv = imesa->driDrawable;
+ __DRIdrawablePrivate *const drawable = imesa->driDrawable;
+ __DRIdrawablePrivate *const readable = imesa->driReadable;
__DRIscreenPrivate *sPriv = imesa->driScreen;
drm_savage_sarea_t *sarea = imesa->sarea;
int me = imesa->hHWContext;
- int stamp = dPriv->lastStamp;
+ int stamp = drawable->lastStamp;
int heap;
unsigned int timestamp = 0;
@@ -882,10 +874,11 @@ void savageGetLock( savageContextPtr imesa, GLuint flags )
* NOTE: This releases and regains the hw lock, so all state
* checking must be done *after* this call:
*/
- DRI_VALIDATE_DRAWABLE_INFO(sPriv, dPriv);
-
+ DRI_VALIDATE_DRAWABLE_INFO(sPriv, drawable);
+ if (drawable != readable) {
+ DRI_VALIDATE_DRAWABLE_INFO(sPriv, readable);
+ }
-
/* If we lost context, need to dump all registers to hardware.
* Note that we don't care about 2d contexts, even if they perform
@@ -916,8 +909,8 @@ void savageGetLock( savageContextPtr imesa, GLuint flags )
DRI_AGE_TEXTURES( imesa->textureHeaps[heap] );
}
- if (dPriv->lastStamp != stamp) {
- driUpdateFramebufferSize(imesa->glCtx, dPriv);
+ if (drawable->lastStamp != stamp) {
+ driUpdateFramebufferSize(imesa->glCtx, drawable);
savageXMesaWindowMoved( imesa );
}
}
diff --git a/src/mesa/drivers/dri/savage/savagedd.c b/src/mesa/drivers/dri/savage/savagedd.c
index ae19481f03..a5c5310e28 100644
--- a/src/mesa/drivers/dri/savage/savagedd.c
+++ b/src/mesa/drivers/dri/savage/savagedd.c
@@ -42,7 +42,7 @@
#include "utils.h"
-#define DRIVER_DATE "20050829"
+#define DRIVER_DATE "20061110"
/***************************************
* Mesa's Driver Functions
@@ -95,24 +95,7 @@ static GLint savageGetParameteri(const GLcontext *ctx, GLint param)
#endif
-static void savageBufferSize(GLframebuffer *buffer, GLuint *width, GLuint *height)
-{
- GET_CURRENT_CONTEXT(ctx);
- savageContextPtr imesa = SAVAGE_CONTEXT(ctx);
-
- /* Need to lock to make sure the driDrawable is uptodate. This
- * information is used to resize Mesa's software buffers, so it has
- * to be correct.
- */
- LOCK_HARDWARE(imesa);
- *width = imesa->driDrawable->w;
- *height = imesa->driDrawable->h;
- UNLOCK_HARDWARE(imesa);
-}
-
-
void savageDDInitDriverFuncs( GLcontext *ctx )
{
- ctx->Driver.GetBufferSize = savageBufferSize;
ctx->Driver.GetString = savageDDGetString;
}
diff --git a/src/mesa/drivers/dri/savage/savagespan.c b/src/mesa/drivers/dri/savage/savagespan.c
index 5d6246797f..61ab9e6d64 100644
--- a/src/mesa/drivers/dri/savage/savagespan.c
+++ b/src/mesa/drivers/dri/savage/savagespan.c
@@ -33,9 +33,8 @@
#define DBG 0
#define LOCAL_VARS \
- savageContextPtr imesa = SAVAGE_CONTEXT(ctx); \
- __DRIdrawablePrivate *dPriv = imesa->driDrawable; \
driRenderbuffer *drb = (driRenderbuffer *) rb; \
+ __DRIdrawablePrivate *const dPriv = drb->dPriv; \
GLuint cpp = drb->cpp; \
GLuint pitch = drb->pitch; \
GLuint height = dPriv->h; \
@@ -44,9 +43,8 @@
(void) p
#define LOCAL_DEPTH_VARS \
- savageContextPtr imesa = SAVAGE_CONTEXT(ctx); \
- __DRIdrawablePrivate *dPriv = imesa->driDrawable; \
driRenderbuffer *drb = (driRenderbuffer *) rb; \
+ __DRIdrawablePrivate *const dPriv = drb->dPriv; \
GLuint zpp = drb->cpp; \
GLuint pitch = drb->pitch; \
GLuint height = dPriv->h; \
diff --git a/src/mesa/drivers/dri/savage/savagestate.c b/src/mesa/drivers/dri/savage/savagestate.c
index 5c2b397bde..741a9dda4f 100644
--- a/src/mesa/drivers/dri/savage/savagestate.c
+++ b/src/mesa/drivers/dri/savage/savagestate.c
@@ -647,23 +647,20 @@ static void savageDDDrawBuffer(GLcontext *ctx, GLenum mode )
case BUFFER_BIT_FRONT_LEFT:
imesa->IsDouble = GL_FALSE;
imesa->regs.s4.destCtrl.ni.offset = imesa->savageScreen->frontOffset>>11;
-
- imesa->NotFirstFrame = GL_FALSE;
- savageXMesaSetFrontClipRects( imesa );
- FALLBACK( ctx, SAVAGE_FALLBACK_DRAW_BUFFER, GL_FALSE );
break;
case BUFFER_BIT_BACK_LEFT:
imesa->IsDouble = GL_TRUE;
imesa->regs.s4.destCtrl.ni.offset = imesa->savageScreen->backOffset>>11;
- imesa->NotFirstFrame = GL_FALSE;
- savageXMesaSetBackClipRects( imesa );
- FALLBACK( ctx, SAVAGE_FALLBACK_DRAW_BUFFER, GL_FALSE );
break;
default:
FALLBACK( ctx, SAVAGE_FALLBACK_DRAW_BUFFER, GL_TRUE );
return;
}
+ imesa->NotFirstFrame = GL_FALSE;
+ savageXMesaSetClipRects(imesa);
+ FALLBACK(ctx, SAVAGE_FALLBACK_DRAW_BUFFER, GL_FALSE);
+
if (destCtrl != imesa->regs.s4.destCtrl.ui)
imesa->dirty |= SAVAGE_UPLOAD_GLOBAL;
}