From 60b0e12830310e7c05b4043857ed277b28b1c781 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Tue, 1 Jun 2004 20:24:59 +0000 Subject: 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'. --- src/mesa/drivers/dri/common/dri_util.c | 50 +++++++++++++++++----------------- src/mesa/drivers/dri/common/dri_util.h | 20 +++++--------- 2 files changed, 32 insertions(+), 38 deletions(-) (limited to 'src/mesa/drivers/dri/common') diff --git a/src/mesa/drivers/dri/common/dri_util.c b/src/mesa/drivers/dri/common/dri_util.c index 13101755b3..4dbd57ae86 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 17f26d1a21..1cc5f7cc54 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 -- cgit v1.2.3