#ifndef DRI_INTERFACE_H
#define DRI_INTERFACE_H
+#ifndef DRI_NEW_INTERFACE_ONLY
/* FIXME: With a small amount of work, these two includes can be removed. */
#include <X11/Xlib.h>
#include <GL/glx.h>
+#endif
#ifndef DRI_NEW_INTERFACE_ONLY
#include <GL/glxint.h>
typedef struct __DRIframebufferRec __DRIframebuffer;
typedef struct __DRIversionRec __DRIversion;
typedef unsigned long __DRIid;
+typedef void __DRInativeDisplay;
/*@}*/
* \name Functions provided by the driver loader.
*/
/*@{*/
-extern __DRIscreen *__glXFindDRIScreen(Display *dpy, int scrn);
+extern __DRIscreen *__glXFindDRIScreen(__DRInativeDisplay *dpy, int scrn);
/**
*
* \sa __glXWindowExists, glXGetProcAddress
*/
-typedef Bool (* PFNGLXWINDOWEXISTSPROC) (Display *dpy, __DRIid draw);
+typedef Bool (* PFNGLXWINDOWEXISTSPROC) (__DRInativeDisplay *dpy, __DRIid draw);
/**
* Type of a pointer to \c __glXGetUST, as returned by \c glXGetProcAddress.
*
* \sa glXGetScreenDriver, glXGetProcAddress, glXGetDriverConfig
*/
-typedef const char * (* PFNGLXGETSCREENDRIVERPROC) (Display *dpy, int scrNum);
+typedef const char * (* PFNGLXGETSCREENDRIVERPROC) (__DRInativeDisplay *dpy, int scrNum);
/**
* Type of a pointer to \c glXGetDriverConfig, as returned by
*
* \sa __glXGetDrawableInfo, glXGetProcAddress
*/
-typedef Bool (* PFNGLXGETDRAWABLEINFOPROC) ( Display *dpy, int scrn,
+typedef Bool (* PFNGLXGETDRAWABLEINFOPROC) ( __DRInativeDisplay *dpy, int scrn,
__DRIid draw, unsigned int * index, unsigned int * stamp,
int * x, int * y, int * width, int * height,
int * numClipRects, drm_clip_rect_t ** pClipRects,
*/
/*@{*/
-extern void * __driCreateNewScreen( Display *dpy, int scrn, __DRIscreen *psc,
+extern void * __driCreateNewScreen( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc,
const __GLcontextModes * modes, const __DRIversion * ddx_version,
const __DRIversion * dri_version, const __DRIversion * drm_version,
const __DRIframebuffer * frame_buffer, drmAddress pSAREA, int fd,
/**
* Method to destroy the private DRI screen data.
*/
- void (*destroyScreen)(Display *dpy, int scrn, void *screenPrivate);
+ void (*destroyScreen)(__DRInativeDisplay *dpy, int scrn, void *screenPrivate);
/**
* Method to create the private DRI context data and initialize the
* Method to create the private DRI drawable data and initialize the
* drawable dependent methods.
*/
- void *(*createNewDrawable)(Display *dpy, const __GLcontextModes *modes,
+ void *(*createNewDrawable)(__DRInativeDisplay *dpy, const __GLcontextModes *modes,
__DRIid draw, __DRIdrawable *pdraw,
int renderType, const int *attrs);
/**
* Method to return a pointer to the DRI drawable data.
*/
- __DRIdrawable *(*getDrawable)(Display *dpy, __DRIid draw,
+ __DRIdrawable *(*getDrawable)(__DRInativeDisplay *dpy, __DRIid draw,
void *drawablePrivate);
/**
* \since Internal API version 20030815.
*/
/*@{*/
- void *(*allocateMemory)(Display *dpy, int scrn, GLsizei size,
+ void *(*allocateMemory)(__DRInativeDisplay *dpy, int scrn, GLsizei size,
GLfloat readfreq, GLfloat writefreq,
GLfloat priority);
- void (*freeMemory)(Display *dpy, int scrn, GLvoid *pointer);
+ void (*freeMemory)(__DRInativeDisplay *dpy, int scrn, GLvoid *pointer);
- GLuint (*memoryOffset)(Display *dpy, int scrn, const GLvoid *pointer);
+ GLuint (*memoryOffset)(__DRInativeDisplay *dpy, int scrn, const GLvoid *pointer);
/*@}*/
/**
*
* \since Internal API version 20031201.
*/
- void * (*createNewContext)(Display *dpy, const __GLcontextModes *modes,
+ void * (*createNewContext)(__DRInativeDisplay *dpy, const __GLcontextModes *modes,
int render_type,
void *sharedPrivate, __DRIcontext *pctx);
};
/**
* Method to destroy the private DRI context data.
*/
- void (*destroyContext)(Display *dpy, int scrn, void *contextPrivate);
+ void (*destroyContext)(__DRInativeDisplay *dpy, int scrn, void *contextPrivate);
/**
* Method to bind a DRI drawable to a DRI graphics context.
*
* \since Internal API version 20040415.
*/
- Bool (*bindContext3)(Display *dpy, int scrn, __DRIid draw,
+ Bool (*bindContext3)(__DRInativeDisplay *dpy, int scrn, __DRIid draw,
__DRIid read, __DRIcontext *ctx);
/**
*
* \since Internal API version 20040415.
*/
- Bool (*unbindContext3)(Display *dpy, int scrn, __DRIid draw,
+ Bool (*unbindContext3)(__DRInativeDisplay *dpy, int scrn, __DRIid draw,
__DRIid read, __DRIcontext *ctx);
};
/**
* Method to destroy the private DRI drawable data.
*/
- void (*destroyDrawable)(Display *dpy, void *drawablePrivate);
+ void (*destroyDrawable)(__DRInativeDisplay *dpy, void *drawablePrivate);
/**
* Method to swap the front and back buffers.
*/
- void (*swapBuffers)(Display *dpy, void *drawablePrivate);
+ void (*swapBuffers)(__DRInativeDisplay *dpy, void *drawablePrivate);
/**
* Opaque pointer to private per drawable direct rendering data.
*
* \since Internal API version 20030317.
*/
- int (*getSBC)(Display *dpy, void *drawablePrivate, int64_t *sbc );
+ int (*getSBC)(__DRInativeDisplay *dpy, void *drawablePrivate, int64_t *sbc );
/**
* Wait for the SBC to be greater than or equal target_sbc.
*
* \since Internal API version 20030317.
*/
- int (*waitForSBC)( Display * dpy, void *drawablePriv,
+ int (*waitForSBC)( __DRInativeDisplay * dpy, void *drawablePriv,
int64_t target_sbc,
int64_t * msc, int64_t * sbc );
*
* \since Internal API version 20030317.
*/
- int (*waitForMSC)( Display * dpy, void *drawablePriv,
+ int (*waitForMSC)( __DRInativeDisplay * dpy, void *drawablePriv,
int64_t target_msc, int64_t divisor, int64_t remainder,
int64_t * msc, int64_t * sbc );
*
* \since Internal API version 20030317.
*/
- int64_t (*swapBuffersMSC)(Display *dpy, void *drawablePrivate,
+ int64_t (*swapBuffersMSC)(__DRInativeDisplay *dpy, void *drawablePrivate,
int64_t target_msc,
int64_t divisor, int64_t remainder);
*
* \since Internal API version 20030317.
*/
- int (*frameTracking)(Display *dpy, void *drawablePrivate, Bool enable);
+ int (*frameTracking)(__DRInativeDisplay *dpy, void *drawablePrivate, Bool enable);
/**
* Retrieve frame usage information.
*
* \since Internal API version 20030317.
*/
- int (*queryFrameTracking)(Display *dpy, void *drawablePrivate,
+ int (*queryFrameTracking)(__DRInativeDisplay *dpy, void *drawablePrivate,
int64_t * sbc, int64_t * missedFrames,
float * lastMissedUsage, float * usage );
/*#define DRI_NEW_INTERFACE_ONLY*/
#ifndef GLX_OML_sync_control
-typedef Bool ( * PFNGLXGETMSCRATEOMLPROC) (Display *dpy, __DRIid drawable, int32_t *numerator, int32_t *denominator);
+typedef Bool ( * PFNGLXGETMSCRATEOMLPROC) (__DRInativeDisplay *dpy, __DRIid drawable, int32_t *numerator, int32_t *denominator);
#endif
/**
*/
static PFNGLXWINDOWEXISTSPROC window_exists;
-typedef Bool (*PFNGLXCREATECONTEXTWITHCONFIGPROC)( Display*, int, int, void *,
+typedef Bool (*PFNGLXCREATECONTEXTWITHCONFIGPROC)( __DRInativeDisplay*, int, int, void *,
drmContextPtr );
static PFNGLXCREATECONTEXTWITHCONFIGPROC create_context_with_config;
static int api_ver = 0;
/* forward declarations */
-static int driQueryFrameTracking( Display * dpy, void * priv,
+static int driQueryFrameTracking( __DRInativeDisplay * dpy, void * priv,
int64_t * sbc, int64_t * missedFrames, float * lastMissedUsage,
float * usage );
-static void *driCreateNewDrawable(Display *dpy, const __GLcontextModes *modes,
+static void *driCreateNewDrawable(__DRInativeDisplay *dpy, const __GLcontextModes *modes,
__DRIid draw, __DRIdrawable *pdraw, int renderType, const int *attrs);
-static void driDestroyDrawable(Display *dpy, void *drawablePrivate);
+static void driDestroyDrawable(__DRInativeDisplay *dpy, void *drawablePrivate);
* if found, or \c NULL if no match is found.
*/
static const __GLcontextModes *
-findConfigMode(Display *dpy, int scrn, VisualID vid,
+findConfigMode(__DRInativeDisplay *dpy, int scrn, VisualID vid,
const __DRIscreen * pDRIScreen)
{
if ( (pDRIScreen != NULL) && (pDRIScreen->private != NULL) ) {
* about X structures like a \c Visual.
*/
static Bool
-fake_XF86DRICreateContextWithConfig( Display* dpy, int screen, int configID,
+fake_XF86DRICreateContextWithConfig( __DRInativeDisplay* dpy, int screen, int configID,
XID* context, drmContextPtr hHWContext )
{
Visual vis;
{
__DRIid draw;
__DRIdrawable *pdraw;
- Display *dpy;
+ __DRInativeDisplay *dpy;
if (drmHashFirst(drawHash, &draw, (void **)&pdraw)) {
do {
* While casting the opaque private pointers associated with the parameters
* into their respective real types it also assures they are not \c NULL.
*/
-static Bool driUnbindContext3(Display *dpy, int scrn,
+static Bool driUnbindContext3(__DRInativeDisplay *dpy, int scrn,
__DRIid draw, __DRIid read,
__DRIcontext *ctx)
{
* be needed in those places when support for pbuffers and / or pixmaps
* is added. Is it safe to assume that the drawable is a window?
*/
-static Bool DoBindContext(Display *dpy,
+static Bool DoBindContext(__DRInativeDisplay *dpy,
__DRIid draw, __DRIid read,
__DRIcontext *ctx, const __GLcontextModes * modes,
__DRIscreenPrivate *psp)
* for \c glXMakeCurrentReadSGI or GLX 1.3's \c glXMakeContextCurrent
* function.
*/
-static Bool driBindContext3(Display *dpy, int scrn,
+static Bool driBindContext3(__DRInativeDisplay *dpy, int scrn,
__DRIid draw, __DRIid read,
__DRIcontext * ctx)
{
*
* Is called directly from glXSwapBuffers().
*/
-static void driSwapBuffers( Display *dpy, void *drawablePrivate )
+static void driSwapBuffers( __DRInativeDisplay *dpy, void *drawablePrivate )
{
__DRIdrawablePrivate *dPriv = (__DRIdrawablePrivate *) drawablePrivate;
dPriv->swapBuffers(dPriv);
/**
* Called directly from a number of higher-level GLX functions.
*/
-static int driGetSBC( Display *dpy, void *drawablePrivate, int64_t *sbc )
+static int driGetSBC( __DRInativeDisplay *dpy, void *drawablePrivate, int64_t *sbc )
{
__DRIdrawablePrivate *dPriv = (__DRIdrawablePrivate *) drawablePrivate;
__DRIswapInfo sInfo;
return status;
}
-static int driWaitForSBC( Display * dpy, void *drawablePriv,
+static int driWaitForSBC( __DRInativeDisplay * dpy, void *drawablePriv,
int64_t target_sbc,
int64_t * msc, int64_t * sbc )
{
msc, sbc );
}
-static int driWaitForMSC( Display * dpy, void *drawablePriv,
+static int driWaitForMSC( __DRInativeDisplay * dpy, void *drawablePriv,
int64_t target_msc,
int64_t divisor, int64_t remainder,
int64_t * msc, int64_t * sbc )
return status;
}
-static int64_t driSwapBuffersMSC( Display * dpy, void *drawablePriv,
+static int64_t driSwapBuffersMSC( __DRInativeDisplay * dpy, void *drawablePriv,
int64_t target_msc,
int64_t divisor, int64_t remainder )
{
/**
* This is called via __DRIscreenRec's createNewDrawable pointer.
*/
-static void *driCreateNewDrawable(Display *dpy,
+static void *driCreateNewDrawable(__DRInativeDisplay *dpy,
const __GLcontextModes *modes,
__DRIid draw,
__DRIdrawable *pdraw,
pdp->driScreenPriv = psp;
pdp->driContextPriv = &psp->dummyContextPriv;
- pdp->getInfo = (GetDrawableInfo *)
+ pdp->getInfo = (PFNGLXGETDRAWABLEINFOPROC)
glXGetProcAddress( (const GLubyte *) "__glXGetDrawableInfo" );
if ( pdp->getInfo == NULL ) {
#ifdef DRI_NEW_INTERFACE_ONLY
return (void *) pdp;
}
-static __DRIdrawable *driGetDrawable(Display *dpy, __DRIid draw,
+static __DRIdrawable *driGetDrawable(__DRInativeDisplay *dpy, __DRIid draw,
void *screenPrivate)
{
__DRIscreenPrivate *psp = (__DRIscreenPrivate *) screenPrivate;
return __driFindDrawable(psp->drawHash, draw);
}
-static void driDestroyDrawable(Display *dpy, void *drawablePrivate)
+static void driDestroyDrawable(__DRInativeDisplay *dpy, void *drawablePrivate)
{
__DRIdrawablePrivate *pdp = (__DRIdrawablePrivate *) drawablePrivate;
__DRIscreenPrivate *psp = pdp->driScreenPriv;
* This function calls __DriverAPIRec::DestroyContext on \p contextPrivate, calls
* drmDestroyContext(), and finally frees \p contextPrivate.
*/
-static void driDestroyContext(Display *dpy, int scrn, void *contextPrivate)
+static void driDestroyContext(__DRInativeDisplay *dpy, int scrn, void *contextPrivate)
{
__DRIcontextPrivate *pcp = (__DRIcontextPrivate *) contextPrivate;
*
*/
static void *
-driCreateNewContext(Display *dpy, const __GLcontextModes *modes,
+driCreateNewContext(__DRInativeDisplay *dpy, const __GLcontextModes *modes,
int render_type, void *sharedPrivate, __DRIcontext *pctx)
{
__DRIscreen *pDRIScreen;
* This function calls __DriverAPIRec::DestroyScreen on \p screenPrivate, calls
* drmClose(), and finally frees \p screenPrivate.
*/
-static void driDestroyScreen(Display *dpy, int scrn, void *screenPrivate)
+static void driDestroyScreen(__DRInativeDisplay *dpy, int scrn, void *screenPrivate)
{
__DRIscreenPrivate *psp = (__DRIscreenPrivate *) screenPrivate;
* \param driverAPI Driver API functions used by other routines in dri_util.c.
*/
__DRIscreenPrivate *
-__driUtilCreateNewScreen(Display *dpy, int scrn, __DRIscreen *psc,
+__driUtilCreateNewScreen(__DRInativeDisplay *dpy, int scrn, __DRIscreen *psc,
__GLcontextModes * modes,
const __DRIversion * ddx_version,
const __DRIversion * dri_version,
static int
-driQueryFrameTracking( Display * dpy, void * priv,
+driQueryFrameTracking( __DRInativeDisplay * dpy, void * priv,
int64_t * sbc, int64_t * missedFrames,
float * lastMissedUsage, float * usage )
{
};
-typedef Bool (GetDrawableInfo)( Display *dpy, int scrn, __DRIid draw,
- unsigned int * index, unsigned int * stamp,
- int * x, int * y, int * width, int * height,
- int * numClipRects, drm_clip_rect_t ** pClipRects,
- int * backX, int * backY,
- int * numBackClipRects, drm_clip_rect_t ** pBackClipRects );
-
-
/**
* Per-drawable private DRI driver information.
*/
* __driUtilUpdateDrawableInfo() which calls XF86DRIGetDrawableInfo().
*/
/*@{*/
- Display *display;
+ __DRInativeDisplay *display;
int screen;
/*@}*/
* Get information about the location, size, and clip rects of the
* drawable within the display.
*/
- GetDrawableInfo * getInfo;
+ PFNGLXGETDRAWABLEINFOPROC getInfo;
};
/**
/**
* This context's display pointer.
*/
- Display *display;
+ __DRInativeDisplay *display;
/**
* Pointer to drawable currently bound to this context.
/**
* Display for this screen
*/
- Display *display;
+ __DRInativeDisplay *display;
/**
* Current screen's number
__driUtilUpdateDrawableInfo(__DRIdrawablePrivate *pdp);
-extern __DRIscreenPrivate * __driUtilCreateNewScreen( Display *dpy,
+extern __DRIscreenPrivate * __driUtilCreateNewScreen( __DRInativeDisplay *dpy,
int scrn, __DRIscreen *psc, __GLcontextModes * modes,
const __DRIversion * ddx_version, const __DRIversion * dri_version,
const __DRIversion * drm_version, const __DRIframebuffer * frame_buffer,
drmAddress pSAREA, int fd, int internal_api_version,
const struct __DriverAPIRec *driverAPI );
+#ifndef DRI_NEW_INTERFACE_ONLY
extern __DRIscreenPrivate *
__driUtilCreateScreen(Display *dpy, int scrn, __DRIscreen *psc,
int numConfigs, __GLXvisualConfig *config,
const struct __DriverAPIRec *driverAPI);
+#endif /* DRI_NEW_INTERFACE_ONLY */
/* Test the version of the internal GLX API. Returns a value like strcmp. */
extern int
psp = __driUtilCreateScreen(dpy, scrn, psc, numConfigs, config, &i810API);
return (void *) psp;
}
-#else
+#elif !defined(DRI_NEW_INTERFACE_ONLY)
void *__driCreateScreen(struct DRIDriverRec *driver,
struct DRIDriverContextRec *driverContext)
{
* failure.
*/
#ifdef USE_NEW_INTERFACE
-void * __driCreateNewScreen( Display *dpy, int scrn, __DRIscreen *psc,
+void * __driCreateNewScreen( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc,
const __GLcontextModes * modes,
const __DRIversion * ddx_version,
const __DRIversion * dri_version,
psp = __driUtilCreateScreen(dpy, scrn, psc, numConfigs, config, &i830API);
return (void *) psp;
}
-#else
+#elif !defined(DRI_NEW_INTERFACE_ONLY)
void *__driCreateScreen(struct DRIDriverRec *driver,
struct DRIDriverContextRec *driverContext)
{
* failure.
*/
#ifdef USE_NEW_INTERFACE
-void * __driCreateNewScreen( Display *dpy, int scrn, __DRIscreen *psc,
+void * __driCreateNewScreen( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc,
const __GLcontextModes * modes,
const __DRIversion * ddx_version,
const __DRIversion * dri_version,
psp = __driUtilCreateScreen(dpy, scrn, psc, numConfigs, config, &mach64API);
return (void *) psp;
}
-#else
+#elif !defined(DRI_NEW_INTERFACE_ONLY)
void *__driCreateScreen(struct DRIDriverRec *driver,
struct DRIDriverContextRec *driverContext)
{
* failure.
*/
#ifdef USE_NEW_INTERFACE
-void * __driCreateNewScreen( Display *dpy, int scrn, __DRIscreen *psc,
+void * __driCreateNewScreen( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc,
const __GLcontextModes * modes,
const __DRIversion * ddx_version,
const __DRIversion * dri_version,
psp = __driUtilCreateScreen(dpy, scrn, psc, numConfigs, config, &mgaAPI);
return (void *) psp;
}
-#else
+#elif !defined(DRI_NEW_INTERFACE_ONLY)
void *__driCreateScreen(struct DRIDriverRec *driver,
struct DRIDriverContextRec *driverContext)
{
* failure.
*/
#ifdef USE_NEW_INTERFACE
-void * __driCreateNewScreen( Display *dpy, int scrn, __DRIscreen *psc,
+void * __driCreateNewScreen( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc,
const __GLcontextModes * modes,
const __DRIversion * ddx_version,
const __DRIversion * dri_version,
psp = __driUtilCreateScreen(dpy, scrn, psc, numConfigs, config, &r200API);
return (void *) psp;
}
-#else
+#elif !defined(DRI_NEW_INTERFACE_ONLY)
void *__driCreateScreen(struct DRIDriverRec *driver,
struct DRIDriverContextRec *driverContext)
{
* failure.
*/
#ifdef USE_NEW_INTERFACE
-void * __driCreateNewScreen( Display *dpy, int scrn, __DRIscreen *psc,
+void * __driCreateNewScreen( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc,
const __GLcontextModes * modes,
const __DRIversion * ddx_version,
const __DRIversion * dri_version,
psp = __driUtilCreateScreen(dpy, scrn, psc, numConfigs, config, &radeonAPI);
return (void *) psp;
}
-#else
+#elif !defined(DRI_NEW_INTERFACE_ONLY)
void *__driCreateScreen(struct DRIDriverRec *driver,
struct DRIDriverContextRec *driverContext)
{
* failure.
*/
#ifdef USE_NEW_INTERFACE
-void * __driCreateNewScreen( Display *dpy, int scrn, __DRIscreen *psc,
+void * __driCreateNewScreen( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc,
const __GLcontextModes * modes,
const __DRIversion * ddx_version,
const __DRIversion * dri_version,
* \return A pointer to a \c __DRIscreenPrivate on success, or \c NULL on
* failure.
*/
-void * __driCreateNewScreen( Display *dpy, int scrn, __DRIscreen *psc,
+void * __driCreateNewScreen( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc,
const __GLcontextModes * modes,
const __DRIversion * ddx_version,
const __DRIversion * dri_version,
psp = __driUtilCreateScreen(dpy, scrn, psc, numConfigs, config, &tdfxAPI);
return (void *) psp;
}
-#else
+#elif !defined(DRI_NEW_INTERFACE_ONLY)
void *__driCreateScreen(struct DRIDriverRec *driver,
struct DRIDriverContextRec *driverContext)
{