/**
* Method to destroy the private DRI screen data.
*/
- void (*destroyScreen)(void *screenPrivate);
+ void (*destroyScreen)(__DRIscreen *screen);
/**
* Method to create the private DRI drawable data and initialize the
*
* \since Internal API version 20030317.
*/
- int (*getMSC)( void *screenPrivate, int64_t *msc );
+ int (*getMSC)(__DRIscreen *screen, int64_t *msc);
/**
* Functions associated with MESA_allocate_memory.
/**
* Method to destroy the private DRI context data.
*/
- void (*destroyContext)(void *contextPrivate);
+ void (*destroyContext)(__DRIcontext *context);
/**
* Opaque pointer to private per context direct rendering data.
*
* \since Internal API version 20050727.
*/
- GLboolean (*bindContext)(__DRIdrawable *pdraw,
- __DRIdrawable *pread,
- __DRIcontext *ctx);
+ GLboolean (*bindContext)(__DRIcontext *ctx,
+ __DRIdrawable *pdraw,
+ __DRIdrawable *pread);
/**
* Method to unbind a DRI drawable from a DRI graphics context.
/**
* Method to destroy the private DRI drawable data.
*/
- void (*destroyDrawable)(void *drawablePrivate);
+ void (*destroyDrawable)(__DRIdrawable *drawable);
/**
* Method to swap the front and back buffers.
*/
- void (*swapBuffers)(void *drawablePrivate);
+ void (*swapBuffers)(__DRIdrawable *drawable);
/**
* Opaque pointer to private per drawable direct rendering data.
*
* \since Internal API version 20030317.
*/
- int (*getSBC)(void *drawablePrivate, int64_t *sbc );
+ int (*getSBC)(__DRIdrawable *drawable, int64_t *sbc);
/**
* Wait for the SBC to be greater than or equal target_sbc.
*
* \since Internal API version 20030317.
*/
- int (*waitForSBC)( void *drawablePriv,
- int64_t target_sbc,
- int64_t * msc, int64_t * sbc );
+ int (*waitForSBC)(__DRIdrawable *drawable,
+ int64_t target_sbc,
+ int64_t * msc, int64_t * sbc);
/**
* Wait for the MSC to equal target_msc, or, if that has already passed,
*
* \since Internal API version 20030317.
*/
- int (*waitForMSC)( void *drawablePriv,
- int64_t target_msc, int64_t divisor, int64_t remainder,
- int64_t * msc, int64_t * sbc );
+ int (*waitForMSC)(__DRIdrawable *drawable,
+ int64_t target_msc, int64_t divisor, int64_t remainder,
+ int64_t * msc, int64_t * sbc);
/**
* Like \c swapBuffers, but does NOT have an implicit \c glFlush. Once
*
* \since Internal API version 20030317.
*/
- int64_t (*swapBuffersMSC)(void *drawablePrivate,
+ int64_t (*swapBuffersMSC)(__DRIdrawable *drawable,
int64_t target_msc,
int64_t divisor, int64_t remainder);
*
* \since Internal API version 20030317.
*/
- int (*frameTracking)(void *drawablePrivate, GLboolean enable);
+ int (*frameTracking)(__DRIdrawable *drawable, GLboolean enable);
/**
* Retrieve frame usage information.
*
* \since Internal API version 20030317.
*/
- int (*queryFrameTracking)(void *drawablePrivate,
+ int (*queryFrameTracking)(__DRIdrawable *drawable,
int64_t * sbc, int64_t * missedFrames,
- float * lastMissedUsage, float * usage );
+ float * lastMissedUsage, float * usage);
/**
* Used by drivers that implement the GLX_SGI_swap_control or
*
* \since Internal API version 20060314.
*/
- void (*copySubBuffer)(void *drawablePrivate,
+ void (*copySubBuffer)(__DRIdrawable *drawable,
int x, int y, int w, int h);
};
if (!windowExistsFlag) {
/* Destroy the local drawable data, if the drawable no
longer exists in the Xserver */
- (*pdraw->driDrawable.destroyDrawable)(pdraw->driDrawable.private);
+ (*pdraw->driDrawable.destroyDrawable)(&pdraw->driDrawable);
XF86DRIDestroyDrawable(dpy, sc->scr, draw);
Xfree(pdraw);
}
/* Destroy the direct rendering context */
if (gc->isDirect) {
if (gc->driContext.private) {
- (*gc->driContext.destroyContext)(gc->driContext.private);
+ (*gc->driContext.destroyContext)(&gc->driContext);
XF86DRIDestroyContext(dpy, gc->psc->scr, gc->hwContextID);
gc->driContext.private = NULL;
}
__DRIdrawable *pdraw = GetDRIDrawable( dpy, drawable, NULL );
if ( pdraw != NULL ) {
- (*pdraw->swapBuffers)(pdraw->private);
+ (*pdraw->swapBuffers)(pdraw);
return;
}
#endif
if ( (pdraw != NULL) && (pdraw->frameTracking != NULL)
&& __glXExtensionBitIsEnabled( psc, MESA_swap_frame_usage_bit ) ) {
- status = pdraw->frameTracking( pdraw->private, GL_TRUE );
+ status = pdraw->frameTracking(pdraw, GL_TRUE);
}
#else
(void) dpy;
if ( (pdraw != NULL) && (pdraw->frameTracking != NULL)
&& __glXExtensionBitIsEnabled( psc, MESA_swap_frame_usage_bit ) ) {
- status = pdraw->frameTracking( pdraw->private, GL_FALSE );
+ status = pdraw->frameTracking(pdraw, GL_FALSE);
}
#else
(void) dpy;
int64_t sbc, missedFrames;
float lastMissedUsage;
- status = pdraw->queryFrameTracking( pdraw->private, &sbc,
- &missedFrames, &lastMissedUsage,
- usage );
+ status = pdraw->queryFrameTracking(pdraw, &sbc, &missedFrames,
+ &lastMissedUsage, usage);
}
#else
(void) dpy;
&& __glXExtensionBitIsEnabled( psc, MESA_swap_frame_usage_bit ) ) {
float usage;
- status = pdraw->queryFrameTracking( pdraw->private, sbc,
- missedFrames, lastMissedUsage,
- & usage );
+ status = pdraw->queryFrameTracking(pdraw, sbc, missedFrames,
+ lastMissedUsage, &usage);
}
#else
(void) dpy;
int ret;
int64_t temp;
- ret = psc->driScreen.getMSC( psc->driScreen.private, & temp );
+ ret = psc->driScreen.getMSC(&psc->driScreen, &temp);
*count = (unsigned) temp;
return (ret == 0) ? 0 : GLX_BAD_CONTEXT;
}
int64_t msc;
int64_t sbc;
- ret = (*pdraw->waitForMSC)( pdraw->private,
- 0, divisor, remainder,
- & msc, & sbc );
+ ret = (*pdraw->waitForMSC)(pdraw, 0,
+ divisor, remainder, &msc, &sbc);
*count = (unsigned) msc;
return (ret == 0) ? 0 : GLX_BAD_CONTEXT;
}
assert( (pdraw == NULL) || (i != -1) );
return ( (pdraw && pdraw->getSBC && psc->driScreen.getMSC)
&& __glXExtensionBitIsEnabled( psc, OML_sync_control_bit )
- && ((*psc->driScreen.getMSC)( psc->driScreen.private, msc ) == 0)
- && ((*pdraw->getSBC)( psc->driScreen.private, sbc ) == 0)
+ && ((*psc->driScreen.getMSC)(&psc->driScreen, msc) == 0)
+ && ((*pdraw->getSBC)(pdraw, sbc ) == 0)
&& (__glXGetUST( ust ) == 0) );
}
#else
if ( (pdraw != NULL) && (pdraw->swapBuffersMSC != NULL)
&& __glXExtensionBitIsEnabled( psc, OML_sync_control_bit ) ) {
- return (*pdraw->swapBuffersMSC)(pdraw->private, target_msc,
- divisor, remainder);
+ return (*pdraw->swapBuffersMSC)(pdraw, target_msc, divisor, remainder);
}
#else
(void) dpy;
if ( (pdraw != NULL) && (pdraw->waitForMSC != NULL)
&& __glXExtensionBitIsEnabled( psc, OML_sync_control_bit ) ) {
- ret = (*pdraw->waitForMSC)( pdraw->private, target_msc,
- divisor, remainder, msc, sbc );
+ ret = (*pdraw->waitForMSC)(pdraw, target_msc,
+ divisor, remainder, msc, sbc);
/* __glXGetUST returns zero on success and non-zero on failure.
* This function returns True on success and False on failure.
if ( (pdraw != NULL) && (pdraw->waitForSBC != NULL)
&& __glXExtensionBitIsEnabled( psc, OML_sync_control_bit )) {
- ret = (*pdraw->waitForSBC)( pdraw->private, target_sbc, msc, sbc );
+ ret = (*pdraw->waitForSBC)(pdraw, target_sbc, msc, sbc);
/* __glXGetUST returns zero on success and non-zero on failure.
* This function returns True on success and False on failure.
if ( pdraw != NULL ) {
__GLXscreenConfigs * const psc = GetGLXScreenConfigs( dpy, screen );
if ( __glXExtensionBitIsEnabled( psc, MESA_copy_sub_buffer_bit ) ) {
- (*pdraw->copySubBuffer)(pdraw->private, x, y, width, height);
+ (*pdraw->copySubBuffer)(pdraw, x, y, width, height);
}
return;
#ifdef GLX_DIRECT_RENDERING
/* Free the direct rendering per screen data */
if (psc->driScreen.private)
- (*psc->driScreen.destroyScreen)(psc->driScreen.private);
+ (*psc->driScreen.destroyScreen)(&psc->driScreen);
psc->driScreen.private = NULL;
__glxHashDestroy(psc->drawHash);
#endif
}
if (__glxHashInsert(sc->drawHash, drawable, pdraw)) {
- (*pdraw->driDrawable.destroyDrawable)(pdraw->driDrawable.private);
+ (*pdraw->driDrawable.destroyDrawable)(&pdraw->driDrawable);
XF86DRIDestroyDrawable(dpy, sc->scr, drawable);
Xfree(pdraw);
return NULL;
__DRIdrawable *pdraw = FetchDRIDrawable(dpy, draw, gc);
__DRIdrawable *pread = FetchDRIDrawable(dpy, read, gc);
- return (*gc->driContext.bindContext)(pdraw, pread, &gc->driContext);
+ return (*gc->driContext.bindContext)(&gc->driContext, pdraw, pread);
}
if (oldGC->isDirect) {
if (oldGC->driContext.private) {
(*oldGC->driContext.destroyContext)
- (oldGC->driContext.private);
+ (&oldGC->driContext);
XF86DRIDestroyContext(oldGC->createDpy,
oldGC->psc->scr,
gc->hwContextID);
static int api_ver = 0;
/* forward declarations */
-static int driQueryFrameTracking( void *priv,
+static int driQueryFrameTracking( __DRIdrawable *drawable,
int64_t *sbc, int64_t *missedFrames,
float *lastMissedUsage, float *usage );
drm_drawable_t hwDrawable,
int renderType, const int *attrs);
-static void driDestroyDrawable(void *drawablePrivate);
+static void driDestroyDrawable(__DRIdrawable *drawable);
/**
* for \c glXMakeCurrentReadSGI or GLX 1.3's \c glXMakeContextCurrent
* function.
*/
-static GLboolean DoBindContext(__DRIdrawable *pdraw,
- __DRIdrawable *pread,
- __DRIcontext *ctx)
+static GLboolean DoBindContext(__DRIcontext *ctx,
+ __DRIdrawable *pdraw,
+ __DRIdrawable *pread)
{
__DRIdrawablePrivate *pdp;
__DRIdrawablePrivate *prp;
* for \c glXMakeCurrentReadSGI or GLX 1.3's \c glXMakeContextCurrent
* function.
*/
-static GLboolean driBindContext(__DRIdrawable *pdraw,
- __DRIdrawable *pread,
- __DRIcontext * ctx)
+static GLboolean driBindContext(__DRIcontext * ctx,
+ __DRIdrawable *pdraw,
+ __DRIdrawable *pread)
{
/*
** Assume error checking is done properly in glXMakeCurrent before
if (ctx == NULL || pdraw == None || pread == None)
return GL_FALSE;
- return DoBindContext( pdraw, pread, ctx );
+ return DoBindContext( ctx, pdraw, pread );
}
/*@}*/
*
* Is called directly from glXSwapBuffers().
*/
-static void driSwapBuffers(void *drawablePrivate)
+static void driSwapBuffers(__DRIdrawable *drawable)
{
- __DRIdrawablePrivate *dPriv = (__DRIdrawablePrivate *) drawablePrivate;
+ __DRIdrawablePrivate *dPriv = drawable->private;
drm_clip_rect_t rect;
dPriv->swapBuffers(dPriv);
/**
* Called directly from a number of higher-level GLX functions.
*/
-static int driGetMSC( void *screenPrivate, int64_t *msc )
+static int driGetMSC( __DRIscreen *screen, int64_t *msc )
{
- __DRIscreenPrivate *sPriv = (__DRIscreenPrivate *) screenPrivate;
+ __DRIscreenPrivate *sPriv = screen->private;
return sPriv->DriverAPI.GetMSC( sPriv, msc );
}
/**
* Called directly from a number of higher-level GLX functions.
*/
-static int driGetSBC( void *drawablePrivate, int64_t *sbc )
+static int driGetSBC(__DRIdrawable *drawable, int64_t *sbc)
{
- __DRIdrawablePrivate *dPriv = (__DRIdrawablePrivate *) drawablePrivate;
+ __DRIdrawablePrivate *dPriv = drawable->private;
__DRIswapInfo sInfo;
int status;
return status;
}
-static int driWaitForSBC( void *drawablePriv, int64_t target_sbc,
- int64_t * msc, int64_t * sbc )
+static int driWaitForSBC(__DRIdrawable *drawable, int64_t target_sbc,
+ int64_t * msc, int64_t * sbc)
{
- __DRIdrawablePrivate *dPriv = (__DRIdrawablePrivate *) drawablePriv;
+ __DRIdrawablePrivate *dPriv = drawable->private;
return dPriv->driScreenPriv->DriverAPI.WaitForSBC( dPriv, target_sbc,
msc, sbc );
}
-static int driWaitForMSC( void *drawablePriv, int64_t target_msc,
- int64_t divisor, int64_t remainder,
- int64_t * msc, int64_t * sbc )
+static int driWaitForMSC(__DRIdrawable *drawable, int64_t target_msc,
+ int64_t divisor, int64_t remainder,
+ int64_t * msc, int64_t * sbc)
{
- __DRIdrawablePrivate *dPriv = (__DRIdrawablePrivate *) drawablePriv;
+ __DRIdrawablePrivate *dPriv = drawable->private;
__DRIswapInfo sInfo;
int status;
return status;
}
-static int64_t driSwapBuffersMSC( void *drawablePriv, int64_t target_msc,
- int64_t divisor, int64_t remainder )
+static int64_t driSwapBuffersMSC(__DRIdrawable *drawable, int64_t target_msc,
+ int64_t divisor, int64_t remainder)
{
- __DRIdrawablePrivate *dPriv = (__DRIdrawablePrivate *) drawablePriv;
+ __DRIdrawablePrivate *dPriv = drawable->private;
return dPriv->driScreenPriv->DriverAPI.SwapBuffersMSC( dPriv, target_msc,
divisor,
remainder );
}
-static void driCopySubBuffer( void *drawablePrivate,
+static void driCopySubBuffer(__DRIdrawable *drawable,
int x, int y, int w, int h)
{
- __DRIdrawablePrivate *dPriv = (__DRIdrawablePrivate *) drawablePrivate;
+ __DRIdrawablePrivate *dPriv = drawable->private;
dPriv->driScreenPriv->DriverAPI.CopySubBuffer(dPriv, x, y, w, h);
}
}
static void
-driDestroyDrawable(void *drawablePrivate)
+driDestroyDrawable(__DRIdrawable *drawable)
{
- __DRIdrawablePrivate *pdp = (__DRIdrawablePrivate *) drawablePrivate;
+ __DRIdrawablePrivate *pdp = drawable->private;
__DRIscreenPrivate *psp;
if (pdp) {
* drmDestroyContext(), and finally frees \p contextPrivate.
*/
static void
-driDestroyContext(void *contextPrivate)
+driDestroyContext(__DRIcontext *context)
{
- __DRIcontextPrivate *pcp = (__DRIcontextPrivate *) contextPrivate;
+ __DRIcontextPrivate *pcp = context->private;
if (pcp) {
(*pcp->driScreenPriv->DriverAPI.DestroyContext)(pcp);
* This function calls __DriverAPIRec::DestroyScreen on \p screenPrivate, calls
* drmClose(), and finally frees \p screenPrivate.
*/
-static void driDestroyScreen(void *screenPrivate)
+static void driDestroyScreen(__DRIscreen *screen)
{
- __DRIscreenPrivate *psp = (__DRIscreenPrivate *) screenPrivate;
+ __DRIscreenPrivate *psp = screen->private;
if (psp) {
/* No interaction with the X-server is possible at this point. This
static int
-driQueryFrameTracking( void * priv,
- int64_t * sbc, int64_t * missedFrames,
- float * lastMissedUsage, float * usage )
+driQueryFrameTracking(__DRIdrawable *drawable,
+ int64_t * sbc, int64_t * missedFrames,
+ float * lastMissedUsage, float * usage)
{
__DRIswapInfo sInfo;
int status;
int64_t ust;
- __DRIdrawablePrivate * dpriv = (__DRIdrawablePrivate *) priv;
+ __DRIdrawablePrivate * dpriv = drawable->private;
status = dpriv->driScreenPriv->DriverAPI.GetSwapInfo( dpriv, & sInfo );