summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/common/dri_util.c
diff options
context:
space:
mode:
authorKristian Høgsberg <krh@hinata.boston.redhat.com>2007-05-10 18:38:49 -0400
committerKristian Høgsberg <krh@redhat.com>2007-10-10 17:09:16 -0400
commit8ed5c7ca0572a09375bdfd411c3804456dac78d6 (patch)
tree79a5fc7225b5d1be313bc99599ea7a51a4e8f7c3 /src/mesa/drivers/dri/common/dri_util.c
parent4ff95e78e19e5902352ea3759d32d9f013255f42 (diff)
Drop createContext and destroyContext from DRIinterfaceMethods.
As for createDrawable and destroyDrawable, these functions immediately upon entry to driCreateNewContext and immediately before exit from driDestroyContext. Instead of passing function pointers back and forth just obtain the drm_context_t prior to calling DRIscreen::createNewContext and pass it as a parameter. This change also lets us keep the DRI context XID in the libGL loader only.
Diffstat (limited to 'src/mesa/drivers/dri/common/dri_util.c')
-rw-r--r--src/mesa/drivers/dri/common/dri_util.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/src/mesa/drivers/dri/common/dri_util.c b/src/mesa/drivers/dri/common/dri_util.c
index dd7068ad10..31438b8271 100644
--- a/src/mesa/drivers/dri/common/dri_util.c
+++ b/src/mesa/drivers/dri/common/dri_util.c
@@ -552,8 +552,6 @@ driDestroyContext(void *contextPrivate)
if (pcp) {
(*pcp->driScreenPriv->DriverAPI.DestroyContext)(pcp);
- (void) (*dri_interface->destroyContext)(pcp->driScreenPriv->psc,
- pcp->contextID);
_mesa_free(pcp);
}
}
@@ -582,7 +580,8 @@ driDestroyContext(void *contextPrivate)
*/
static void *
driCreateNewContext(__DRIscreen *screen, const __GLcontextModes *modes,
- int render_type, void *sharedPrivate, __DRIcontext *pctx)
+ int render_type, void *sharedPrivate,
+ drm_context_t hwContext, __DRIcontext *pctx)
{
__DRIcontextPrivate *pcp;
__DRIcontextPrivate *pshare = (__DRIcontextPrivate *) sharedPrivate;
@@ -596,12 +595,7 @@ driCreateNewContext(__DRIscreen *screen, const __GLcontextModes *modes,
return NULL;
}
- if (! (*dri_interface->createContext)(screen, modes->fbconfigID,
- &pcp->contextID, &pcp->hHWContext)) {
- _mesa_free(pcp);
- return NULL;
- }
-
+ pcp->hHWContext = hwContext;
pcp->driScreenPriv = psp;
pcp->driDrawablePriv = NULL;
@@ -610,7 +604,6 @@ driCreateNewContext(__DRIscreen *screen, const __GLcontextModes *modes,
*/
if (!psp->dummyContextPriv.driScreenPriv) {
- psp->dummyContextPriv.contextID = 0;
psp->dummyContextPriv.hHWContext = psp->pSAREA->dummy_context;
psp->dummyContextPriv.driScreenPriv = psp;
psp->dummyContextPriv.driDrawablePriv = NULL;
@@ -623,7 +616,6 @@ driCreateNewContext(__DRIscreen *screen, const __GLcontextModes *modes,
pctx->unbindContext = driUnbindContext;
if ( !(*psp->DriverAPI.CreateContext)(modes, pcp, shareCtx) ) {
- (void) (*dri_interface->destroyContext)(screen, pcp->contextID);
_mesa_free(pcp);
return NULL;
}