summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri
diff options
context:
space:
mode:
authorIan Romanick <[email protected]>2004-06-01 20:24:59 +0000
committerIan Romanick <[email protected]>2004-06-01 20:24:59 +0000
commit60b0e12830310e7c05b4043857ed277b28b1c781 (patch)
tree58346be231b980792a370ca15156134a4725b698 /src/mesa/drivers/dri
parentec032cb17b2ffb7b9401604258234998612b445f (diff)
Convert 'Display *' to '__DRInativeDisplay *'. Only portions of the
interface that are not *strictly* part of the old interface were changed. Replace GetDrawableInfo type (dri_util.h) with PFNGLXGETDRAWABLEINFOPROC (dri_interface.h). Wrap __driCreateScreen (in drivers that use the new interface) with '#ifndef DRI_NEW_INTERFACE_ONLY'.
Diffstat (limited to 'src/mesa/drivers/dri')
-rw-r--r--src/mesa/drivers/dri/common/dri_util.c50
-rw-r--r--src/mesa/drivers/dri/common/dri_util.h20
-rw-r--r--src/mesa/drivers/dri/i810/i810screen.c4
-rw-r--r--src/mesa/drivers/dri/i830/i830_screen.c4
-rw-r--r--src/mesa/drivers/dri/mach64/mach64_screen.c4
-rw-r--r--src/mesa/drivers/dri/mga/mga_xmesa.c4
-rw-r--r--src/mesa/drivers/dri/r200/r200_screen.c4
-rw-r--r--src/mesa/drivers/dri/radeon/radeon_screen.c4
-rw-r--r--src/mesa/drivers/dri/tdfx/tdfx_screen.c4
9 files changed, 46 insertions, 52 deletions
diff --git a/src/mesa/drivers/dri/common/dri_util.c b/src/mesa/drivers/dri/common/dri_util.c
index 13101755b3e..4dbd57ae86c 100644
--- a/src/mesa/drivers/dri/common/dri_util.c
+++ b/src/mesa/drivers/dri/common/dri_util.c
@@ -44,7 +44,7 @@
/*#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
/**
@@ -61,7 +61,7 @@ static const int empty_attribute_list[1] = { None };
*/
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;
@@ -73,14 +73,14 @@ 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);
@@ -144,7 +144,7 @@ __driUtilMessage(const char *f, ...)
* 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) ) {
@@ -166,7 +166,7 @@ findConfigMode(Display *dpy, int scrn, VisualID vid,
* 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;
@@ -272,7 +272,7 @@ static void __driGarbageCollectDrawables(void *drawHash)
{
__DRIid draw;
__DRIdrawable *pdraw;
- Display *dpy;
+ __DRInativeDisplay *dpy;
if (drmHashFirst(drawHash, &draw, (void **)&pdraw)) {
do {
@@ -316,7 +316,7 @@ static void __driGarbageCollectDrawables(void *drawHash)
* 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)
{
@@ -407,7 +407,7 @@ static Bool driUnbindContext3(Display *dpy, int scrn,
* 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)
@@ -498,7 +498,7 @@ static Bool DoBindContext(Display *dpy,
* 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)
{
@@ -686,7 +686,7 @@ __driUtilUpdateDrawableInfo(__DRIdrawablePrivate *pdp)
*
* 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);
@@ -706,7 +706,7 @@ static int driGetMSC( void *screenPrivate, int64_t *msc )
/**
* 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;
@@ -719,7 +719,7 @@ static int driGetSBC( Display *dpy, void *drawablePrivate, int64_t *sbc )
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 )
{
@@ -729,7 +729,7 @@ static int driWaitForSBC( Display * dpy, void *drawablePriv,
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 )
@@ -756,7 +756,7 @@ static int driWaitForMSC( Display * dpy, void *drawablePriv,
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 )
{
@@ -771,7 +771,7 @@ static int64_t driSwapBuffersMSC( Display * dpy, void *drawablePriv,
/**
* 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,
@@ -823,7 +823,7 @@ static void *driCreateNewDrawable(Display *dpy,
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
@@ -874,7 +874,7 @@ static void *driCreateNewDrawable(Display *dpy,
return (void *) pdp;
}
-static __DRIdrawable *driGetDrawable(Display *dpy, __DRIid draw,
+static __DRIdrawable *driGetDrawable(__DRInativeDisplay *dpy, __DRIid draw,
void *screenPrivate)
{
__DRIscreenPrivate *psp = (__DRIscreenPrivate *) screenPrivate;
@@ -886,7 +886,7 @@ static __DRIdrawable *driGetDrawable(Display *dpy, __DRIid draw,
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;
@@ -927,7 +927,7 @@ static void driDestroyDrawable(Display *dpy, void *drawablePrivate)
* 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;
@@ -962,7 +962,7 @@ static void driDestroyContext(Display *dpy, int scrn, void *contextPrivate)
*
*/
static void *
-driCreateNewContext(Display *dpy, const __GLcontextModes *modes,
+driCreateNewContext(__DRInativeDisplay *dpy, const __GLcontextModes *modes,
int render_type, void *sharedPrivate, __DRIcontext *pctx)
{
__DRIscreen *pDRIScreen;
@@ -1109,7 +1109,7 @@ static void *driCreateContext(Display *dpy, XVisualInfo *vis,
* 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;
@@ -1159,7 +1159,7 @@ static void driDestroyScreen(Display *dpy, int scrn, void *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,
@@ -1560,7 +1560,7 @@ int driCompareGLXAPIVersion( GLuint required_version )
static int
-driQueryFrameTracking( Display * dpy, void * priv,
+driQueryFrameTracking( __DRInativeDisplay * dpy, void * priv,
int64_t * sbc, int64_t * missedFrames,
float * lastMissedUsage, float * usage )
{
diff --git a/src/mesa/drivers/dri/common/dri_util.h b/src/mesa/drivers/dri/common/dri_util.h
index 17f26d1a210..1cc5f7cc546 100644
--- a/src/mesa/drivers/dri/common/dri_util.h
+++ b/src/mesa/drivers/dri/common/dri_util.h
@@ -254,14 +254,6 @@ struct __DRIswapInfoRec {
};
-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.
*/
@@ -357,7 +349,7 @@ struct __DRIdrawablePrivateRec {
* __driUtilUpdateDrawableInfo() which calls XF86DRIGetDrawableInfo().
*/
/*@{*/
- Display *display;
+ __DRInativeDisplay *display;
int screen;
/*@}*/
@@ -370,7 +362,7 @@ struct __DRIdrawablePrivateRec {
* Get information about the location, size, and clip rects of the
* drawable within the display.
*/
- GetDrawableInfo * getInfo;
+ PFNGLXGETDRAWABLEINFOPROC getInfo;
};
/**
@@ -395,7 +387,7 @@ struct __DRIcontextPrivateRec {
/**
* This context's display pointer.
*/
- Display *display;
+ __DRInativeDisplay *display;
/**
* Pointer to drawable currently bound to this context.
@@ -415,7 +407,7 @@ struct __DRIscreenPrivateRec {
/**
* Display for this screen
*/
- Display *display;
+ __DRInativeDisplay *display;
/**
* Current screen's number
@@ -563,17 +555,19 @@ extern void
__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
diff --git a/src/mesa/drivers/dri/i810/i810screen.c b/src/mesa/drivers/dri/i810/i810screen.c
index 8bb62217a92..8995ec0ba4c 100644
--- a/src/mesa/drivers/dri/i810/i810screen.c
+++ b/src/mesa/drivers/dri/i810/i810screen.c
@@ -401,7 +401,7 @@ void *__driCreateScreen(Display *dpy, int scrn, __DRIscreen *psc,
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)
{
@@ -422,7 +422,7 @@ void *__driCreateScreen(struct DRIDriverRec *driver,
* 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,
diff --git a/src/mesa/drivers/dri/i830/i830_screen.c b/src/mesa/drivers/dri/i830/i830_screen.c
index 1a40c79a013..4314b2160f2 100644
--- a/src/mesa/drivers/dri/i830/i830_screen.c
+++ b/src/mesa/drivers/dri/i830/i830_screen.c
@@ -392,7 +392,7 @@ void *__driCreateScreen(Display *dpy, int scrn, __DRIscreen *psc,
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)
{
@@ -551,7 +551,7 @@ i830FillInModes( unsigned pixel_bits, unsigned depth_bits,
* 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,
diff --git a/src/mesa/drivers/dri/mach64/mach64_screen.c b/src/mesa/drivers/dri/mach64/mach64_screen.c
index cd59cba8b6e..f5c35e49273 100644
--- a/src/mesa/drivers/dri/mach64/mach64_screen.c
+++ b/src/mesa/drivers/dri/mach64/mach64_screen.c
@@ -505,7 +505,7 @@ void *__driCreateScreen(Display *dpy, int scrn, __DRIscreen *psc,
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)
{
@@ -526,7 +526,7 @@ void *__driCreateScreen(struct DRIDriverRec *driver,
* 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,
diff --git a/src/mesa/drivers/dri/mga/mga_xmesa.c b/src/mesa/drivers/dri/mga/mga_xmesa.c
index df7856241fb..40d3b71002d 100644
--- a/src/mesa/drivers/dri/mga/mga_xmesa.c
+++ b/src/mesa/drivers/dri/mga/mga_xmesa.c
@@ -931,7 +931,7 @@ void *__driCreateScreen(Display *dpy, int scrn, __DRIscreen *psc,
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)
{
@@ -953,7 +953,7 @@ void *__driCreateScreen(struct DRIDriverRec *driver,
* 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,
diff --git a/src/mesa/drivers/dri/r200/r200_screen.c b/src/mesa/drivers/dri/r200/r200_screen.c
index 129d70a653e..e634390d219 100644
--- a/src/mesa/drivers/dri/r200/r200_screen.c
+++ b/src/mesa/drivers/dri/r200/r200_screen.c
@@ -608,7 +608,7 @@ void *__driCreateScreen(Display *dpy, int scrn, __DRIscreen *psc,
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)
{
@@ -630,7 +630,7 @@ void *__driCreateScreen(struct DRIDriverRec *driver,
* 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,
diff --git a/src/mesa/drivers/dri/radeon/radeon_screen.c b/src/mesa/drivers/dri/radeon/radeon_screen.c
index f080d474462..d5bb24b2489 100644
--- a/src/mesa/drivers/dri/radeon/radeon_screen.c
+++ b/src/mesa/drivers/dri/radeon/radeon_screen.c
@@ -565,7 +565,7 @@ void *__driCreateScreen(Display *dpy, int scrn, __DRIscreen *psc,
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)
{
@@ -586,7 +586,7 @@ void *__driCreateScreen(struct DRIDriverRec *driver,
* 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,
diff --git a/src/mesa/drivers/dri/tdfx/tdfx_screen.c b/src/mesa/drivers/dri/tdfx/tdfx_screen.c
index ed50529fd0f..bc87da9aa0a 100644
--- a/src/mesa/drivers/dri/tdfx/tdfx_screen.c
+++ b/src/mesa/drivers/dri/tdfx/tdfx_screen.c
@@ -402,7 +402,7 @@ static __GLcontextModes *tdfxFillInModes(unsigned pixel_bits,
* \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,
@@ -453,7 +453,7 @@ void *__driCreateScreen(Display *dpy, int scrn, __DRIscreen *psc,
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)
{