summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/glx/dri2_glx.c68
-rw-r--r--src/glx/dri_glx.c25
-rw-r--r--src/glx/drisw_glx.c36
3 files changed, 59 insertions, 70 deletions
diff --git a/src/glx/dri2_glx.c b/src/glx/dri2_glx.c
index 711989dc192..be48194b143 100644
--- a/src/glx/dri2_glx.c
+++ b/src/glx/dri2_glx.c
@@ -57,11 +57,7 @@
#undef DRI2_MINOR
#define DRI2_MINOR 1
-typedef struct __GLXDRIdisplayPrivateRec __GLXDRIdisplayPrivate;
-typedef struct __GLXDRIcontextPrivateRec __GLXDRIcontextPrivate;
-typedef struct __GLXDRIdrawablePrivateRec __GLXDRIdrawablePrivate;
-
-struct __GLXDRIdisplayPrivateRec
+struct dri2_display
{
__GLXDRIdisplay base;
@@ -79,14 +75,14 @@ struct __GLXDRIdisplayPrivateRec
const __DRIextension *loader_extensions[4];
};
-struct __GLXDRIcontextPrivateRec
+struct dri2_context
{
__GLXDRIcontext base;
__DRIcontext *driContext;
__GLXscreenConfigs *psc;
};
-struct __GLXDRIdrawablePrivateRec
+struct dri2_drawable
{
__GLXDRIdrawable base;
__DRIbuffer buffers[5];
@@ -101,7 +97,7 @@ static void
dri2DestroyContext(__GLXDRIcontext * context,
__GLXscreenConfigs * psc, Display * dpy)
{
- __GLXDRIcontextPrivate *pcp = (__GLXDRIcontextPrivate *) context;
+ struct dri2_context *pcp = (struct dri2_context *) context;
const __DRIcoreExtension *core = pcp->psc->core;
(*core->destroyContext) (pcp->driContext);
@@ -113,7 +109,7 @@ static Bool
dri2BindContext(__GLXDRIcontext * context,
__GLXDRIdrawable * draw, __GLXDRIdrawable * read)
{
- __GLXDRIcontextPrivate *pcp = (__GLXDRIcontextPrivate *) context;
+ struct dri2_context *pcp = (struct dri2_context *) context;
const __DRIcoreExtension *core = pcp->psc->core;
return (*core->bindContext) (pcp->driContext,
@@ -123,7 +119,7 @@ dri2BindContext(__GLXDRIcontext * context,
static void
dri2UnbindContext(__GLXDRIcontext * context)
{
- __GLXDRIcontextPrivate *pcp = (__GLXDRIcontextPrivate *) context;
+ struct dri2_context *pcp = (struct dri2_context *) context;
const __DRIcoreExtension *core = pcp->psc->core;
(*core->unbindContext) (pcp->driContext);
@@ -134,12 +130,12 @@ dri2CreateContext(__GLXscreenConfigs * psc,
const __GLcontextModes * mode,
GLXContext gc, GLXContext shareList, int renderType)
{
- __GLXDRIcontextPrivate *pcp, *pcp_shared;
+ struct dri2_context *pcp, *pcp_shared;
__GLXDRIconfigPrivate *config = (__GLXDRIconfigPrivate *) mode;
__DRIcontext *shared = NULL;
if (shareList) {
- pcp_shared = (__GLXDRIcontextPrivate *) shareList->driContext;
+ pcp_shared = (struct dri2_context *) shareList->driContext;
shared = pcp_shared->driContext;
}
@@ -170,10 +166,10 @@ dri2DestroyDrawable(__GLXDRIdrawable *pdraw)
{
const __DRIcoreExtension *core = pdraw->psc->core;
__GLXdisplayPrivate *dpyPriv;
- __GLXDRIdisplayPrivate *pdp;
+ struct dri2_display *pdp;
dpyPriv = __glXInitialize(pdraw->psc->dpy);
- pdp = (__GLXDRIdisplayPrivate *)dpyPriv->dri2Display;
+ pdp = (struct dri2_display *)dpyPriv->dri2Display;
__glxHashDelete(pdp->dri2Hash, pdraw->xDrawable);
(*core->destroyDrawable) (pdraw->driDrawable);
@@ -186,10 +182,10 @@ dri2CreateDrawable(__GLXscreenConfigs * psc,
XID xDrawable,
GLXDrawable drawable, const __GLcontextModes * modes)
{
- __GLXDRIdrawablePrivate *pdraw;
+ struct dri2_drawable *pdraw;
__GLXDRIconfigPrivate *config = (__GLXDRIconfigPrivate *) modes;
__GLXdisplayPrivate *dpyPriv;
- __GLXDRIdisplayPrivate *pdp;
+ struct dri2_display *pdp;
GLint vblank_mode = DRI_CONF_VBLANK_DEF_INTERVAL_1;
pdraw = Xmalloc(sizeof(*pdraw));
@@ -222,7 +218,7 @@ dri2CreateDrawable(__GLXscreenConfigs * psc,
DRI2CreateDrawable(psc->dpy, xDrawable);
dpyPriv = __glXInitialize(psc->dpy);
- pdp = (__GLXDRIdisplayPrivate *)dpyPriv->dri2Display;;
+ pdp = (struct dri2_display *)dpyPriv->dri2Display;;
/* Create a new drawable */
pdraw->base.driDrawable =
(*psc->dri2->createNewDrawable) (psc->__driScreen,
@@ -289,7 +285,7 @@ dri2WaitForSBC(__GLXDRIdrawable *pdraw, int64_t target_sbc, int64_t *ust,
static void
dri2CopySubBuffer(__GLXDRIdrawable *pdraw, int x, int y, int width, int height)
{
- __GLXDRIdrawablePrivate *priv = (__GLXDRIdrawablePrivate *) pdraw;
+ struct dri2_drawable *priv = (struct dri2_drawable *) pdraw;
XRectangle xrect;
XserverRegion region;
@@ -321,7 +317,7 @@ dri2CopySubBuffer(__GLXDRIdrawable *pdraw, int x, int y, int width, int height)
}
static void
-dri2_copy_drawable(__GLXDRIdrawablePrivate *priv, int dest, int src)
+dri2_copy_drawable(struct dri2_drawable *priv, int dest, int src)
{
XRectangle xrect;
XserverRegion region;
@@ -346,7 +342,7 @@ dri2_copy_drawable(__GLXDRIdrawablePrivate *priv, int dest, int src)
static void
dri2WaitX(__GLXDRIdrawable *pdraw)
{
- __GLXDRIdrawablePrivate *priv = (__GLXDRIdrawablePrivate *) pdraw;
+ struct dri2_drawable *priv = (struct dri2_drawable *) pdraw;
if (!priv->have_fake_front)
return;
@@ -357,7 +353,7 @@ dri2WaitX(__GLXDRIdrawable *pdraw)
static void
dri2WaitGL(__GLXDRIdrawable * pdraw)
{
- __GLXDRIdrawablePrivate *priv = (__GLXDRIdrawablePrivate *) pdraw;
+ struct dri2_drawable *priv = (struct dri2_drawable *) pdraw;
if (!priv->have_fake_front)
return;
@@ -368,9 +364,9 @@ dri2WaitGL(__GLXDRIdrawable * pdraw)
static void
dri2FlushFrontBuffer(__DRIdrawable *driDrawable, void *loaderPrivate)
{
- __GLXDRIdrawablePrivate *pdraw = loaderPrivate;
+ struct dri2_drawable *pdraw = loaderPrivate;
__GLXdisplayPrivate *priv = __glXInitialize(pdraw->base.psc->dpy);
- __GLXDRIdisplayPrivate *pdp = (__GLXDRIdisplayPrivate *)priv->dri2Display;
+ struct dri2_display *pdp = (struct dri2_display *)priv->dri2Display;
/* Old servers don't send invalidate events */
if (!pdp->invalidateAvailable)
@@ -396,7 +392,7 @@ dri2DestroyScreen(__GLXscreenConfigs * psc)
* \c DRI2GetBuffers or \c DRI2GetBuffersWithFormat.
*/
static void
-process_buffers(__GLXDRIdrawablePrivate * pdraw, DRI2Buffer * buffers,
+process_buffers(struct dri2_drawable * pdraw, DRI2Buffer * buffers,
unsigned count)
{
int i;
@@ -425,10 +421,10 @@ static int64_t
dri2SwapBuffers(__GLXDRIdrawable *pdraw, int64_t target_msc, int64_t divisor,
int64_t remainder)
{
- __GLXDRIdrawablePrivate *priv = (__GLXDRIdrawablePrivate *) pdraw;
+ struct dri2_drawable *priv = (struct dri2_drawable *) pdraw;
__GLXdisplayPrivate *dpyPriv = __glXInitialize(priv->base.psc->dpy);
- __GLXDRIdisplayPrivate *pdp =
- (__GLXDRIdisplayPrivate *)dpyPriv->dri2Display;
+ struct dri2_display *pdp =
+ (struct dri2_display *)dpyPriv->dri2Display;
int64_t ret;
#ifdef __DRI2_FLUSH
@@ -460,7 +456,7 @@ dri2GetBuffers(__DRIdrawable * driDrawable,
unsigned int *attachments, int count,
int *out_count, void *loaderPrivate)
{
- __GLXDRIdrawablePrivate *pdraw = loaderPrivate;
+ struct dri2_drawable *pdraw = loaderPrivate;
DRI2Buffer *buffers;
buffers = DRI2GetBuffers(pdraw->base.psc->dpy, pdraw->base.xDrawable,
@@ -483,7 +479,7 @@ dri2GetBuffersWithFormat(__DRIdrawable * driDrawable,
unsigned int *attachments, int count,
int *out_count, void *loaderPrivate)
{
- __GLXDRIdrawablePrivate *pdraw = loaderPrivate;
+ struct dri2_drawable *pdraw = loaderPrivate;
DRI2Buffer *buffers;
buffers = DRI2GetBuffersWithFormat(pdraw->base.psc->dpy,
@@ -508,7 +504,7 @@ static void
dri2SetSwapInterval(__GLXDRIdrawable *pdraw, int interval)
{
__GLXscreenConfigs *psc = pdraw->psc;
- __GLXDRIdrawablePrivate *priv = (__GLXDRIdrawablePrivate *) pdraw;
+ struct dri2_drawable *priv = (struct dri2_drawable *) pdraw;
GLint vblank_mode = DRI_CONF_VBLANK_DEF_INTERVAL_1;
if (psc->config)
@@ -532,7 +528,7 @@ dri2SetSwapInterval(__GLXDRIdrawable *pdraw, int interval)
static unsigned int
dri2GetSwapInterval(__GLXDRIdrawable *pdraw)
{
- __GLXDRIdrawablePrivate *priv = (__GLXDRIdrawablePrivate *) pdraw;
+ struct dri2_drawable *priv = (struct dri2_drawable *) pdraw;
return priv->swap_interval;
}
@@ -579,8 +575,8 @@ dri2_bind_tex_image(Display * dpy,
GLXContext gc = __glXGetCurrentContext();
__GLXDRIdrawable *pdraw = GetGLXDRIDrawable(dpy, drawable, NULL);
__GLXdisplayPrivate *dpyPriv = __glXInitialize(dpy);
- __GLXDRIdisplayPrivate *pdp =
- (__GLXDRIdisplayPrivate *) dpyPriv->dri2Display;
+ struct dri2_display *pdp =
+ (struct dri2_display *) dpyPriv->dri2Display;
if (pdraw != NULL) {
@@ -620,7 +616,7 @@ dri2CreateScreen(__GLXscreenConfigs * psc, int screen,
{
const __DRIconfig **driver_configs;
const __DRIextension **extensions;
- const __GLXDRIdisplayPrivate *const pdp = (__GLXDRIdisplayPrivate *)
+ const struct dri2_display *const pdp = (struct dri2_display *)
priv->dri2Display;
__GLXDRIscreen *psp;
char *driverName, *deviceName;
@@ -763,7 +759,7 @@ _X_HIDDEN __GLXDRIdrawable *
dri2GetGlxDrawableFromXDrawableId(Display *dpy, XID id)
{
__GLXdisplayPrivate *d = __glXInitialize(dpy);
- __GLXDRIdisplayPrivate *pdp = (__GLXDRIdisplayPrivate *) d->dri2Display;
+ struct dri2_display *pdp = (struct dri2_display *) d->dri2Display;
__GLXDRIdrawable *pdraw;
if (__glxHashLookup(pdp->dri2Hash, id, (void *) &pdraw) == 0)
@@ -780,7 +776,7 @@ dri2GetGlxDrawableFromXDrawableId(Display *dpy, XID id)
_X_HIDDEN __GLXDRIdisplay *
dri2CreateDisplay(Display * dpy)
{
- __GLXDRIdisplayPrivate *pdp;
+ struct dri2_display *pdp;
int eventBase, errorBase, i;
if (!DRI2QueryExtension(dpy, &eventBase, &errorBase))
diff --git a/src/glx/dri_glx.c b/src/glx/dri_glx.c
index 12a2cf3af24..b3ae5e6b784 100644
--- a/src/glx/dri_glx.c
+++ b/src/glx/dri_glx.c
@@ -47,10 +47,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "xf86drm.h"
#include "dri_common.h"
-typedef struct __GLXDRIdisplayPrivateRec __GLXDRIdisplayPrivate;
-typedef struct __GLXDRIcontextPrivateRec __GLXDRIcontextPrivate;
-
-struct __GLXDRIdisplayPrivateRec
+struct dri_display
{
__GLXDRIdisplay base;
@@ -62,7 +59,7 @@ struct __GLXDRIdisplayPrivateRec
int driPatch;
};
-struct __GLXDRIcontextPrivateRec
+struct dri_context
{
__GLXDRIcontext base;
__DRIcontext *driContext;
@@ -294,7 +291,7 @@ static const __DRIextension *loader_extensions[] = {
*/
static void *
CallCreateNewScreen(Display * dpy, int scrn, __GLXscreenConfigs * psc,
- __GLXDRIdisplayPrivate * driDpy)
+ struct dri_display * driDpy)
{
void *psp = NULL;
drm_handle_t hSAREA;
@@ -477,7 +474,7 @@ static void
driDestroyContext(__GLXDRIcontext * context,
__GLXscreenConfigs * psc, Display * dpy)
{
- __GLXDRIcontextPrivate *pcp = (__GLXDRIcontextPrivate *) context;
+ struct dri_context *pcp = (struct dri_context *) context;
(*psc->core->destroyContext) (pcp->driContext);
@@ -489,7 +486,7 @@ static Bool
driBindContext(__GLXDRIcontext * context,
__GLXDRIdrawable * draw, __GLXDRIdrawable * read)
{
- __GLXDRIcontextPrivate *pcp = (__GLXDRIcontextPrivate *) context;
+ struct dri_context *pcp = (struct dri_context *) context;
const __DRIcoreExtension *core = pcp->psc->core;
return (*core->bindContext) (pcp->driContext,
@@ -499,7 +496,7 @@ driBindContext(__GLXDRIcontext * context,
static void
driUnbindContext(__GLXDRIcontext * context)
{
- __GLXDRIcontextPrivate *pcp = (__GLXDRIcontextPrivate *) context;
+ struct dri_context *pcp = (struct dri_context *) context;
const __DRIcoreExtension *core = pcp->psc->core;
(*core->unbindContext) (pcp->driContext);
@@ -510,7 +507,7 @@ driCreateContext(__GLXscreenConfigs * psc,
const __GLcontextModes * mode,
GLXContext gc, GLXContext shareList, int renderType)
{
- __GLXDRIcontextPrivate *pcp, *pcp_shared;
+ struct dri_context *pcp, *pcp_shared;
drm_context_t hwContext;
__DRIcontext *shared = NULL;
__GLXDRIconfigPrivate *config = (__GLXDRIconfigPrivate *) mode;
@@ -519,7 +516,7 @@ driCreateContext(__GLXscreenConfigs * psc,
return NULL;
if (shareList) {
- pcp_shared = (__GLXDRIcontextPrivate *) shareList->driContext;
+ pcp_shared = (struct dri_context *) shareList->driContext;
shared = pcp_shared->driContext;
}
@@ -643,7 +640,7 @@ static __GLXDRIscreen *
driCreateScreen(__GLXscreenConfigs * psc, int screen,
__GLXdisplayPrivate * priv)
{
- __GLXDRIdisplayPrivate *pdp;
+ struct dri_display *pdp;
__GLXDRIscreen *psp;
const __DRIextension **extensions;
char *driverName;
@@ -684,7 +681,7 @@ driCreateScreen(__GLXscreenConfigs * psc, int screen,
return NULL;
}
- pdp = (__GLXDRIdisplayPrivate *) priv->driDisplay;
+ pdp = (struct dri_display *) priv->driDisplay;
psc->__driScreen = CallCreateNewScreen(psc->dpy, screen, psc, pdp);
if (psc->__driScreen == NULL) {
dlclose(psc->driver);
@@ -726,7 +723,7 @@ driDestroyDisplay(__GLXDRIdisplay * dpy)
_X_HIDDEN __GLXDRIdisplay *
driCreateDisplay(Display * dpy)
{
- __GLXDRIdisplayPrivate *pdpyp;
+ struct dri_display *pdpyp;
int eventBase, errorBase;
int major, minor, patch;
diff --git a/src/glx/drisw_glx.c b/src/glx/drisw_glx.c
index cdb1d9f4dc3..3b9e8139af5 100644
--- a/src/glx/drisw_glx.c
+++ b/src/glx/drisw_glx.c
@@ -28,23 +28,19 @@
#include <dlfcn.h>
#include "dri_common.h"
-typedef struct __GLXDRIdisplayPrivateRec __GLXDRIdisplayPrivate;
-typedef struct __GLXDRIcontextPrivateRec __GLXDRIcontextPrivate;
-typedef struct __GLXDRIdrawablePrivateRec __GLXDRIdrawablePrivate;
-
-struct __GLXDRIdisplayPrivateRec
+struct drisw_display
{
__GLXDRIdisplay base;
};
-struct __GLXDRIcontextPrivateRec
+struct drisw_context
{
__GLXDRIcontext base;
__DRIcontext *driContext;
__GLXscreenConfigs *psc;
};
-struct __GLXDRIdrawablePrivateRec
+struct drisw_drawable
{
__GLXDRIdrawable base;
@@ -56,7 +52,7 @@ struct __GLXDRIdrawablePrivateRec
};
static Bool
-XCreateDrawable(__GLXDRIdrawablePrivate * pdp,
+XCreateDrawable(struct drisw_drawable * pdp,
Display * dpy, XID drawable, int visualid)
{
XGCValues gcvalues;
@@ -94,7 +90,7 @@ XCreateDrawable(__GLXDRIdrawablePrivate * pdp,
}
static void
-XDestroyDrawable(__GLXDRIdrawablePrivate * pdp, Display * dpy, XID drawable)
+XDestroyDrawable(struct drisw_drawable * pdp, Display * dpy, XID drawable)
{
XDestroyImage(pdp->ximage);
XFree(pdp->visinfo);
@@ -112,7 +108,7 @@ swrastGetDrawableInfo(__DRIdrawable * draw,
int *x, int *y, int *w, int *h,
void *loaderPrivate)
{
- __GLXDRIdrawablePrivate *pdp = loaderPrivate;
+ struct drisw_drawable *pdp = loaderPrivate;
__GLXDRIdrawable *pdraw = &(pdp->base);
Display *dpy = pdraw->psc->dpy;
Drawable drawable;
@@ -156,7 +152,7 @@ swrastPutImage(__DRIdrawable * draw, int op,
int x, int y, int w, int h,
char *data, void *loaderPrivate)
{
- __GLXDRIdrawablePrivate *pdp = loaderPrivate;
+ struct drisw_drawable *pdp = loaderPrivate;
__GLXDRIdrawable *pdraw = &(pdp->base);
Display *dpy = pdraw->psc->dpy;
Drawable drawable;
@@ -192,7 +188,7 @@ swrastGetImage(__DRIdrawable * read,
int x, int y, int w, int h,
char *data, void *loaderPrivate)
{
- __GLXDRIdrawablePrivate *prp = loaderPrivate;
+ struct drisw_drawable *prp = loaderPrivate;
__GLXDRIdrawable *pread = &(prp->base);
Display *dpy = pread->psc->dpy;
Drawable readable;
@@ -232,7 +228,7 @@ static void
driDestroyContext(__GLXDRIcontext * context,
__GLXscreenConfigs * psc, Display * dpy)
{
- __GLXDRIcontextPrivate *pcp = (__GLXDRIcontextPrivate *) context;
+ struct drisw_context *pcp = (struct drisw_context *) context;
const __DRIcoreExtension *core = pcp->psc->core;
(*core->destroyContext) (pcp->driContext);
@@ -244,7 +240,7 @@ static Bool
driBindContext(__GLXDRIcontext * context,
__GLXDRIdrawable * draw, __GLXDRIdrawable * read)
{
- __GLXDRIcontextPrivate *pcp = (__GLXDRIcontextPrivate *) context;
+ struct drisw_context *pcp = (struct drisw_context *) context;
const __DRIcoreExtension *core = pcp->psc->core;
return (*core->bindContext) (pcp->driContext,
@@ -254,7 +250,7 @@ driBindContext(__GLXDRIcontext * context,
static void
driUnbindContext(__GLXDRIcontext * context)
{
- __GLXDRIcontextPrivate *pcp = (__GLXDRIcontextPrivate *) context;
+ struct drisw_context *pcp = (struct drisw_context *) context;
const __DRIcoreExtension *core = pcp->psc->core;
(*core->unbindContext) (pcp->driContext);
@@ -265,7 +261,7 @@ driCreateContext(__GLXscreenConfigs * psc,
const __GLcontextModes * mode,
GLXContext gc, GLXContext shareList, int renderType)
{
- __GLXDRIcontextPrivate *pcp, *pcp_shared;
+ struct drisw_context *pcp, *pcp_shared;
__GLXDRIconfigPrivate *config = (__GLXDRIconfigPrivate *) mode;
const __DRIcoreExtension *core;
__DRIcontext *shared = NULL;
@@ -276,7 +272,7 @@ driCreateContext(__GLXscreenConfigs * psc,
core = psc->core;
if (shareList) {
- pcp_shared = (__GLXDRIcontextPrivate *) shareList->driContext;
+ pcp_shared = (struct drisw_context *) shareList->driContext;
shared = pcp_shared->driContext;
}
@@ -303,7 +299,7 @@ driCreateContext(__GLXscreenConfigs * psc,
static void
driDestroyDrawable(__GLXDRIdrawable * pdraw)
{
- __GLXDRIdrawablePrivate *pdp = (__GLXDRIdrawablePrivate *) pdraw;
+ struct drisw_drawable *pdp = (struct drisw_drawable *) pdraw;
const __DRIcoreExtension *core = pdraw->psc->core;
(*core->destroyDrawable) (pdraw->driDrawable);
@@ -318,7 +314,7 @@ driCreateDrawable(__GLXscreenConfigs * psc,
GLXDrawable drawable, const __GLcontextModes * modes)
{
__GLXDRIdrawable *pdraw;
- __GLXDRIdrawablePrivate *pdp;
+ struct drisw_drawable *pdp;
__GLXDRIconfigPrivate *config = (__GLXDRIconfigPrivate *) modes;
const __DRIswrastExtension *swrast = psc->swrast;
@@ -476,7 +472,7 @@ driDestroyDisplay(__GLXDRIdisplay * dpy)
_X_HIDDEN __GLXDRIdisplay *
driswCreateDisplay(Display * dpy)
{
- __GLXDRIdisplayPrivate *pdpyp;
+ struct drisw_display *pdpyp;
pdpyp = Xmalloc(sizeof *pdpyp);
if (pdpyp == NULL)