Commit 3b670558 authored by kem's avatar kem
Browse files

Add unbind callback to driver [fixes bug #100615 and test prog from

                               hovers@dera.gov.uk]
Fix multiple windows crash [bug #100621]
Include Egbert Eich's fix for the PCI detection bug in tdfx-1-1 branch
parent a95896f0
/* $Id: xmesa.h,v 1.1 1999/12/14 02:39:38 daryll Exp $ */
/* $Id: xmesa.h,v 1.1.4.1 2000/01/22 05:45:57 kem Exp $ */
/*
* Mesa 3-D graphics library
......@@ -27,6 +27,12 @@
/*
* $Log: xmesa.h,v $
* Revision 1.1.4.1 2000/01/22 05:45:57 kem
* Add unbind callback to driver [fixes bug #100615 and test prog from
* hovers@dera.gov.uk]
* Fix multiple windows crash [bug #100621]
* Include Egbert Eich's fix for the PCI detection bug in tdfx-1-1 branch
*
* Revision 1.1 1999/12/14 02:39:38 daryll
*
* Upgrade to the latest Mesa 3.2 code.
......@@ -263,6 +269,12 @@ extern GLboolean XMesaMakeCurrent( XMesaContext c,
XMesaBuffer b );
/*
* Unbind the current context from its buffer.
*/
extern GLboolean XMesaUnbindContext( XMesaContext c );
/*
* Return a handle to the current context.
*/
......
......@@ -722,7 +722,7 @@ fxTMRestoreTextures_NoLock(fxMesaContext ctx) {
if (ctx->glCtx->Texture.Unit[i].Current==tObj) {
/* Force the texture onto the board, as it could be in use */
where=ti->whichTMU;
ti->whichTMU=FX_TMU_NONE;
fxTMMoveOutTM_NoLock(ctx, tObj);
fxTMMoveInTM_NoLock(ctx, tObj, where);
break;
}
......
/* $Id: xmesa1.c,v 1.1 1999/12/05 23:10:27 daryll Exp $ */
/* $Id: xmesa1.c,v 1.1.4.1 2000/01/22 05:45:57 kem Exp $ */
/*
* Mesa 3-D graphics library
......@@ -2004,6 +2004,15 @@ GLboolean XMesaMakeCurrent( XMesaContext c, XMesaBuffer b )
}
/*
* Unbind the context c from its buffer.
*/
GLboolean XMesaUnbindContext( XMesaContext c )
{
return GL_TRUE;
}
XMesaContext XMesaGetCurrentContext( void )
{
return XMesa;
......
......@@ -148,7 +148,17 @@ static Bool driMesaUnbindContext(Display *dpy, int scrn,
return GL_FALSE;
}
pcp = (__DRIcontextPrivate *)gc->driContext.private;
pdp = (__DRIdrawablePrivate *)pdraw->private;
psp = pdp->driScreenPriv;
if (!psp) {
/* ERROR!!! */
return GL_FALSE;
}
/* Unbind Mesa's drawable from Mesa's context */
(*psp->XMesaAPI.UnbindContext)(pcp->xm_ctx);
if (pdp->refcount == 0) {
/* ERROR!!! */
return GL_FALSE;
......@@ -174,14 +184,7 @@ static Bool driMesaUnbindContext(Display *dpy, int scrn,
#endif
}
psp = pdp->driScreenPriv;
if (!psp) {
/* ERROR!!! */
return GL_FALSE;
}
/* Unbind the drawable */
pcp = (__DRIcontextPrivate *)gc->driContext.private;
pcp->driDrawablePriv = NULL;
pdp->driContextPriv = &psp->dummyContextPriv;
......
......@@ -100,6 +100,7 @@ void *driMesaInitAPI(char *name, __XMESAapi *XMesaAPI, __GLapi *glAPI)
XMesaAPI->DestroyBuffer = resolveSymbol(handle, "XMesaDestroyBuffer");
XMesaAPI->SwapBuffers = resolveSymbol(handle, "XMesaSwapBuffers");
XMesaAPI->MakeCurrent = resolveSymbol(handle, "XMesaMakeCurrent");
XMesaAPI->UnbindContext = resolveSymbol(handle, "XMesaUnbindContext");
glAPI->Accum = resolveSymbol(handle, "glAccum");
glAPI->AlphaFunc = resolveSymbol(handle, "glAlphaFunc");
......@@ -453,6 +454,7 @@ void *driMesaInitAPI(char *name, __XMESAapi *XMesaAPI, __GLapi *glAPI)
XMesaAPI->DestroyBuffer = XMesaDestroyBuffer;
XMesaAPI->SwapBuffers = XMesaSwapBuffers;
XMesaAPI->MakeCurrent = XMesaMakeCurrent;
XMesaAPI->UnbindContext = XMesaUnbindContext;
glAPI->Accum = __glAccum;
glAPI->AlphaFunc = __glAlphaFunc;
......
......@@ -70,6 +70,7 @@ struct __XMESAapiRec {
void (*DestroyBuffer)(XMesaBuffer b);
void (*SwapBuffers)(XMesaBuffer b);
GLboolean (*MakeCurrent)(XMesaContext c, XMesaBuffer b);
GLboolean (*UnbindContext)(XMesaContext c);
};
#endif
......
......@@ -265,13 +265,18 @@ void XMesaSwapBuffers(XMesaBuffer b)
}
}
GLboolean XMesaUnbindContext(XMesaContext c)
{
if (c && c==gCC && gCCPriv) FX_grGlideGetState((GrState*)gCCPriv->state);
return GL_TRUE;
}
GLboolean XMesaMakeCurrent(XMesaContext c, XMesaBuffer b)
{
__DRIdrawablePrivate *driDrawPriv;
if (c) {
if (c==gCC) return GL_TRUE;
if (gCCPriv) FX_grGlideGetState((GrState*)gCCPriv->state);
gCC = c;
gCCPriv = (tdfxContextPrivate *)c->private;
......
......@@ -1346,6 +1346,13 @@ xf86GetPciBridgeInfo(const pciConfigPtr *pciInfo)
if (pcrp->pci_base_class == PCI_CLASS_BRIDGE)
switch (pcrp->pci_sub_class) {
case PCI_SUBCLASS_BRIDGE_PCI:
/* something fishy about the header? If so: just ignore! */
if ((pcrp->pci_header_type & 0x7f) != 0x01) {
xf86MsgVerb(X_WARNING,3,"PCI-PCI bridge at %x:%x:%x has "
"funny header: 0x%x",pcrp->busnum,pcrp->devnum,
pcrp->funcnum,pcrp->pci_header_type);
break;
}
*pnPciBus = PciBus = xnfcalloc(1, sizeof(PciBusRec));
pnPciBus = &PciBus->next;
PciBus->secondary = pcrp->pci_secondary_bus_number;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment