summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/common
diff options
context:
space:
mode:
authorGeorge Sapountzis <[email protected]>2011-11-03 13:04:57 +0200
committerGeorge Sapountzis <[email protected]>2011-11-04 23:33:04 +0200
commit875a757ddd103722cfe9a2b21035024aa5a23d32 (patch)
tree98d0473304b03638e5827746494d178e3b9ee677 /src/mesa/drivers/dri/common
parent7192c37294964b3f6e1551469f161593ec8f851d (diff)
dri: unify __DRIscreenRec
Also drop DriverAPI field, this is a static symbol and I don't see why it should be accessed through __DRIscreenRec
Diffstat (limited to 'src/mesa/drivers/dri/common')
-rw-r--r--src/mesa/drivers/dri/common/dri_util.c31
-rw-r--r--src/mesa/drivers/dri/common/dri_util.h33
-rw-r--r--src/mesa/drivers/dri/common/drisw_util.h2
3 files changed, 27 insertions, 39 deletions
diff --git a/src/mesa/drivers/dri/common/dri_util.c b/src/mesa/drivers/dri/common/dri_util.c
index 1775a43fc3e..13ba061c1dc 100644
--- a/src/mesa/drivers/dri/common/dri_util.c
+++ b/src/mesa/drivers/dri/common/dri_util.c
@@ -67,7 +67,6 @@ static void dri_put_drawable(__DRIdrawable *pdp);
*/
static int driUnbindContext(__DRIcontext *pcp)
{
- __DRIscreen *psp;
__DRIdrawable *pdp;
__DRIdrawable *prp;
@@ -79,7 +78,6 @@ static int driUnbindContext(__DRIcontext *pcp)
if (pcp == NULL)
return GL_FALSE;
- psp = pcp->driScreenPriv;
pdp = pcp->driDrawablePriv;
prp = pcp->driReadablePriv;
@@ -87,7 +85,7 @@ static int driUnbindContext(__DRIcontext *pcp)
if (!pdp && !prp)
return GL_TRUE;
/* Let driver unbind drawable from context */
- (*psp->DriverAPI.UnbindContext)(pcp);
+ driDriverAPI.UnbindContext(pcp);
assert(pdp);
if (pdp->refcount == 0) {
@@ -125,8 +123,6 @@ static int driBindContext(__DRIcontext *pcp,
__DRIdrawable *pdp,
__DRIdrawable *prp)
{
- __DRIscreen *psp = NULL;
-
/*
** Assume error checking is done properly in glXMakeCurrent before
** calling driUnbindContext.
@@ -136,7 +132,6 @@ static int driBindContext(__DRIcontext *pcp,
return GL_FALSE;
/* Bind the drawable to the context */
- psp = pcp->driScreenPriv;
pcp->driDrawablePriv = pdp;
pcp->driReadablePriv = prp;
if (pdp) {
@@ -148,7 +143,7 @@ static int driBindContext(__DRIcontext *pcp,
}
/* Call device-specific MakeCurrent */
- return (*psp->DriverAPI.MakeCurrent)(pcp, pdp, prp);
+ return driDriverAPI.MakeCurrent(pcp, pdp, prp);
}
static __DRIdrawable *
@@ -170,7 +165,7 @@ dri2CreateNewDrawable(__DRIscreen *screen,
pdraw->h = 0;
pdraw->driScreenPriv = screen;
- if (!(*screen->DriverAPI.CreateBuffer)(screen, pdraw, &config->modes, 0)) {
+ if (!driDriverAPI.CreateBuffer(screen, pdraw, &config->modes, 0)) {
free(pdraw);
return NULL;
}
@@ -185,14 +180,14 @@ dri2AllocateBuffer(__DRIscreen *screen,
unsigned int attachment, unsigned int format,
int width, int height)
{
- return (*screen->DriverAPI.AllocateBuffer)(screen, attachment, format,
- width, height);
+ return driDriverAPI.AllocateBuffer(screen, attachment, format,
+ width, height);
}
static void
dri2ReleaseBuffer(__DRIscreen *screen, __DRIbuffer *buffer)
{
- (*screen->DriverAPI.ReleaseBuffer)(screen, buffer);
+ driDriverAPI.ReleaseBuffer(screen, buffer);
}
@@ -246,7 +241,7 @@ static void dri_put_drawable(__DRIdrawable *pdp)
return;
psp = pdp->driScreenPriv;
- (*psp->DriverAPI.DestroyBuffer)(pdp);
+ driDriverAPI.DestroyBuffer(pdp);
free(pdp);
}
}
@@ -276,7 +271,7 @@ static void
driDestroyContext(__DRIcontext *pcp)
{
if (pcp) {
- (*pcp->driScreenPriv->DriverAPI.DestroyContext)(pcp);
+ driDriverAPI.DestroyContext(pcp);
free(pcp);
}
}
@@ -322,8 +317,8 @@ dri2CreateNewContextForAPI(__DRIscreen *screen, int api,
context->driDrawablePriv = NULL;
context->loaderPrivate = data;
- if (!(*screen->DriverAPI.CreateContext)(mesa_api, modes,
- context, shareCtx) ) {
+ if (!driDriverAPI.CreateContext(mesa_api, modes,
+ context, shareCtx) ) {
free(context);
return NULL;
}
@@ -374,8 +369,8 @@ static void driDestroyScreen(__DRIscreen *psp)
_mesa_destroy_shader_compiler();
- if (psp->DriverAPI.DestroyScreen)
- (*psp->DriverAPI.DestroyScreen)(psp);
+ if (driDriverAPI.DestroyScreen)
+ driDriverAPI.DestroyScreen(psp);
driDestroyOptionCache(&psp->optionCache);
driDestroyOptionInfo(&psp->optionInfo);
@@ -430,7 +425,6 @@ dri2CreateNewScreen(int scrn, int fd,
psp->fd = fd;
psp->myNum = scrn;
- psp->DriverAPI = driDriverAPI;
psp->api_mask = (1 << __DRI_API_OPENGL);
*driver_configs = driDriverAPI.InitScreen(psp);
if (*driver_configs == NULL) {
@@ -438,7 +432,6 @@ dri2CreateNewScreen(int scrn, int fd,
return NULL;
}
- psp->DriverAPI = driDriverAPI;
psp->loaderPrivate = data;
driParseOptionInfo(&psp->optionInfo, __dri2ConfigOptions,
diff --git a/src/mesa/drivers/dri/common/dri_util.h b/src/mesa/drivers/dri/common/dri_util.h
index b4f17d139df..af012f15010 100644
--- a/src/mesa/drivers/dri/common/dri_util.h
+++ b/src/mesa/drivers/dri/common/dri_util.h
@@ -209,18 +209,6 @@ struct __DRIscreenRec {
int myNum;
/**
- * Callback functions into the hardware-specific DRI driver code.
- */
- struct __DriverAPIRec DriverAPI;
-
- const __DRIextension **extensions;
-
- /**
- * DRM (kernel module) version information.
- */
- __DRIversion drm_version;
-
- /**
* File descriptor returned when the kernel device driver is opened.
*
* Used to:
@@ -231,15 +219,22 @@ struct __DRIscreenRec {
int fd;
/**
+ * DRM (kernel module) version information.
+ */
+ __DRIversion drm_version;
+
+ /**
* Device-dependent private information (not stored in the SAREA).
*
* This pointer is never touched by the DRI layer.
*/
-#ifdef __cplusplus
- void *priv;
-#else
- void *private;
-#endif
+ void *driverPrivate;
+
+ void *loaderPrivate;
+
+ const __DRIextension **extensions;
+
+ const __DRIswrastLoaderExtension *swrast_loader;
struct {
/* Flag to indicate that this is a DRI2 screen. Many of the above
@@ -251,8 +246,8 @@ struct __DRIscreenRec {
driOptionCache optionInfo;
driOptionCache optionCache;
- unsigned int api_mask;
- void *loaderPrivate;
+
+ unsigned int api_mask;
};
extern void
diff --git a/src/mesa/drivers/dri/common/drisw_util.h b/src/mesa/drivers/dri/common/drisw_util.h
index 1d3b14c6f52..6b3f46b545f 100644
--- a/src/mesa/drivers/dri/common/drisw_util.h
+++ b/src/mesa/drivers/dri/common/drisw_util.h
@@ -97,7 +97,7 @@ struct __DRIscreenRec {
int fd;
- void *private;
+ void *driverPrivate;
const __DRIextension **extensions;