summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/sis/sis_context.c
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2005-10-19 00:53:05 +0000
committerEric Anholt <[email protected]>2005-10-19 00:53:05 +0000
commitdeadd47aab68d4914d70b19fa08f834623f2e0a7 (patch)
tree5f951bc349cff8655995dcfee24372c489647f68 /src/mesa/drivers/dri/sis/sis_context.c
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.c')
-rw-r--r--src/mesa/drivers/dri/sis/sis_context.c24
1 files changed, 18 insertions, 6 deletions
diff --git a/src/mesa/drivers/dri/sis/sis_context.c b/src/mesa/drivers/dri/sis/sis_context.c
index cfb7700afa2..6f307a25992 100644
--- a/src/mesa/drivers/dri/sis/sis_context.c
+++ b/src/mesa/drivers/dri/sis/sis_context.c
@@ -47,6 +47,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "matrix.h"
#include "extensions.h"
#include "utils.h"
+#include "framebuffer.h"
#include "drivers/common/driverfuncs.h"
@@ -105,6 +106,16 @@ WaitingFor3dIdle(sisContextPtr smesa, int wLen)
}
}
+void sisReAllocateBuffers(GLcontext *ctx, GLframebuffer *drawbuffer,
+ GLuint width, GLuint height)
+{
+ sisContextPtr smesa = SIS_CONTEXT(ctx);
+
+ sisUpdateBufferSize(smesa);
+
+ _mesa_resize_framebuffer(ctx, drawbuffer, width, height);
+}
+
GLboolean
sisCreateContext( const __GLcontextModes *glVisual,
__DRIcontextPrivate *driContextPriv,
@@ -156,11 +167,10 @@ sisCreateContext( const __GLcontextModes *glVisual,
smesa->bytesPerPixel = sisScreen->cpp;
smesa->IOBase = sisScreen->mmio.map;
smesa->Chipset = sisScreen->deviceID;
- smesa->irqEnabled = sisScreen->irqEnabled;
smesa->FbBase = sPriv->pFB;
smesa->displayWidth = sPriv->fbWidth;
- smesa->frontPitch = sPriv->fbStride;
+ smesa->front.pitch = sPriv->fbStride;
smesa->sarea = (SISSAREAPriv *)((char *)sPriv->pSAREA +
sisScreen->sarea_priv_offset);
@@ -187,7 +197,7 @@ sisCreateContext( const __GLcontextModes *glVisual,
smesa->colorFormat = DST_FORMAT_RGB_565;
break;
default:
- sis_fatal_error("Bad bytesPerPixel.\n");
+ sis_fatal_error("Bad bytesPerPixel %d.\n", smesa->bytesPerPixel);
}
/* Parse configuration files */
@@ -303,6 +313,7 @@ sisMakeCurrent( __DRIcontextPrivate *driContextPriv,
GET_CURRENT_CONTEXT(ctx);
sisContextPtr oldSisCtx = ctx ? SIS_CONTEXT(ctx) : NULL;
sisContextPtr newSisCtx = (sisContextPtr) driContextPriv->driverPrivate;
+ struct gl_framebuffer *drawBuffer, *readBuffer;
if ( newSisCtx != oldSisCtx) {
newSisCtx->GlobalFlag = GFLAG_ALL;
@@ -310,9 +321,10 @@ sisMakeCurrent( __DRIcontextPrivate *driContextPriv,
newSisCtx->driDrawable = driDrawPriv;
- _mesa_make_current( newSisCtx->glCtx,
- (GLframebuffer *) driDrawPriv->driverPrivate,
- (GLframebuffer *) driReadPriv->driverPrivate );
+ drawBuffer = (GLframebuffer *)driDrawPriv->driverPrivate;
+ readBuffer = (GLframebuffer *)driReadPriv->driverPrivate;
+
+ _mesa_make_current( newSisCtx->glCtx, drawBuffer, readBuffer );
sisUpdateBufferSize( newSisCtx );
sisUpdateClipping( newSisCtx->glCtx );