summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/common/drisw_util.c
diff options
context:
space:
mode:
authorGeorge Sapountzis <gsapountzis@gmail.com>2011-11-04 16:35:49 +0200
committerGeorge Sapountzis <gsapountzis@gmail.com>2011-11-04 23:33:06 +0200
commitcd86a5d2f862f183f85ef8c7d51f69e028d04447 (patch)
tree548ba824ad298407a41f2a15f5d85b569d11bcfc /src/mesa/drivers/dri/common/drisw_util.c
parent2fbba6bb906a4389de64cc6e961b531d8cd5c495 (diff)
dri: cosmetic
To smooth minor diff between dri_util & drisw_util
Diffstat (limited to 'src/mesa/drivers/dri/common/drisw_util.c')
-rw-r--r--src/mesa/drivers/dri/common/drisw_util.c47
1 files changed, 13 insertions, 34 deletions
diff --git a/src/mesa/drivers/dri/common/drisw_util.c b/src/mesa/drivers/dri/common/drisw_util.c
index b720750eac..614339eeb4 100644
--- a/src/mesa/drivers/dri/common/drisw_util.c
+++ b/src/mesa/drivers/dri/common/drisw_util.c
@@ -54,20 +54,19 @@ driCreateNewScreen(int scrn, const __DRIextension **extensions,
static const __DRIextension *emptyExtensionList[] = { NULL };
__DRIscreen *psp;
- (void) data;
-
psp = CALLOC_STRUCT(__DRIscreenRec);
if (!psp)
return NULL;
setupLoaderExtensions(psp, extensions);
+ psp->loaderPrivate = data;
+
psp->extensions = emptyExtensionList;
psp->fd = -1;
psp->myNum = scrn;
*driver_configs = driDriverAPI.InitScreen(psp);
-
if (*driver_configs == NULL) {
FREE(psp);
return NULL;
@@ -80,7 +79,6 @@ static void driDestroyScreen(__DRIscreen *psp)
{
if (psp) {
driDriverAPI.DestroyScreen(psp);
-
FREE(psp);
}
}
@@ -96,37 +94,12 @@ static const __DRIextension **driGetExtensions(__DRIscreen *psp)
*/
static __DRIcontext *
-driCreateNewContext(__DRIscreen *psp, const __DRIconfig *config,
- __DRIcontext *shared, void *data)
-{
- __DRIcontext *pcp;
- void * const shareCtx = (shared != NULL) ? shared->driverPrivate : NULL;
-
- pcp = CALLOC_STRUCT(__DRIcontextRec);
- if (!pcp)
- return NULL;
-
- pcp->loaderPrivate = data;
-
- pcp->driScreenPriv = psp;
- pcp->driDrawablePriv = NULL;
- pcp->driReadablePriv = NULL;
-
- if (!driDriverAPI.CreateContext(API_OPENGL,
- &config->modes, pcp, shareCtx)) {
- FREE(pcp);
- return NULL;
- }
-
- return pcp;
-}
-
-static __DRIcontext *
driCreateNewContextForAPI(__DRIscreen *psp, int api,
const __DRIconfig *config,
__DRIcontext *shared, void *data)
{
__DRIcontext *pcp;
+ const struct gl_config *modes = (config != NULL) ? &config->modes : NULL;
void * const shareCtx = (shared != NULL) ? shared->driverPrivate : NULL;
gl_api mesa_api;
@@ -154,8 +127,7 @@ driCreateNewContextForAPI(__DRIscreen *psp, int api,
pcp->driDrawablePriv = NULL;
pcp->driReadablePriv = NULL;
- if (!driDriverAPI.CreateContext(mesa_api,
- &config->modes, pcp, shareCtx)) {
+ if (!driDriverAPI.CreateContext(mesa_api, modes, pcp, shareCtx)) {
FREE(pcp);
return NULL;
}
@@ -163,6 +135,14 @@ driCreateNewContextForAPI(__DRIscreen *psp, int api,
return pcp;
}
+static __DRIcontext *
+driCreateNewContext(__DRIscreen *psp, const __DRIconfig *config,
+ __DRIcontext *shared, void *data)
+{
+ return driCreateNewContextForAPI(psp, __DRI_API_OPENGL,
+ config, shared, data);
+}
+
static void
driDestroyContext(__DRIcontext *pcp)
{
@@ -193,7 +173,7 @@ static int driBindContext(__DRIcontext *pcp,
pdp->driContextPriv = pcp;
dri_get_drawable(pdp);
}
- if ( prp && pdp != prp ) {
+ if (prp && pdp != prp) {
dri_get_drawable(prp);
}
}
@@ -248,7 +228,6 @@ static void dri_put_drawable(__DRIdrawable *pdp)
return;
driDriverAPI.DestroyBuffer(pdp);
-
FREE(pdp);
}
}