summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/savage/savage_xmesa.c
diff options
context:
space:
mode:
authorIan Romanick <idr@us.ibm.com>2006-11-10 18:47:22 +0000
committerIan Romanick <idr@us.ibm.com>2006-11-10 18:47:22 +0000
commit6e2c95253718e9ba294a788ba3bb37b7c9603409 (patch)
treec7cc4f62c9bb3f257249174cb7bd002d831ec479 /src/mesa/drivers/dri/savage/savage_xmesa.c
parent0a3a1c6ae9294634b3b3f496c8bd428b79de8cfa (diff)
Enable GLX_SGI_make_current_read.
Eliminate use of deprecated GetBufferSize interface. Keep framebuffer state associated with the read-drawable and the draw-drawable up to date. Tested with progs/demos/wincopy.
Diffstat (limited to 'src/mesa/drivers/dri/savage/savage_xmesa.c')
-rw-r--r--src/mesa/drivers/dri/savage/savage_xmesa.c32
1 files changed, 25 insertions, 7 deletions
diff --git a/src/mesa/drivers/dri/savage/savage_xmesa.c b/src/mesa/drivers/dri/savage/savage_xmesa.c
index aaba58ed33..f8d68d7874 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();
@@ -756,6 +764,9 @@ 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");
@@ -769,6 +780,11 @@ static void savageXMesaWindowMoved( savageContextPtr imesa )
default:
break;
}
+
+ driUpdateFramebufferSize(imesa->glCtx, drawable);
+ if (drawable != readable) {
+ driUpdateFramebufferSize(imesa->glCtx, readable);
+ }
}
@@ -858,11 +874,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 +899,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 +934,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 );
}
}