typedef struct __DRIdriverRec __DRIdriver;
typedef struct __DRIframebufferRec __DRIframebuffer;
typedef struct __DRIversionRec __DRIversion;
+typedef struct __DRIinterfaceMethodsRec __DRIinterfaceMethods;
typedef unsigned long __DRIid;
typedef void __DRInativeDisplay;
/*@}*/
extern __DRIscreen *__glXFindDRIScreen(__DRInativeDisplay *dpy, int scrn);
-/**
- * Type of a pointer to \c __glXGetInternalVersion, as returned by
- * \c glXGetProcAddress.
- *
- * \sa __glXGetInternalVersion, glXGetProcAddress
- */
-typedef int (* PFNGLXGETINTERNALVERSIONPROC) ( void );
-
-/**
- * Type of a pointer to \c __glXWindowExists, as returned by
- * \c glXGetProcAddress.
- *
- * \sa __glXWindowExists, glXGetProcAddress
- */
-typedef GLboolean (* PFNGLXWINDOWEXISTSPROC) (__DRInativeDisplay *dpy, __DRIid draw);
-
-/**
- * Type of a pointer to \c __glXGetUST, as returned by \c glXGetProcAddress.
- *
- * \sa __glXGetUST, glXGetProcAddress
- */
-typedef int (* PFNGLXGETUSTPROC) ( int64_t * ust );
-
-/**
- * Type of pointer to \c __glXCreateContextModes, as returned by
- * \c glXGetProcAddress.
- *
- * \sa _gl_context_modes_create, glXGetProcAddress
- */
-
-typedef __GLcontextModes * (* PFNGLXCREATECONTEXTMODES) ( unsigned count,
- size_t minimum_bytes_per_struct );
/**
* Type of a pointer to \c glXGetScreenDriver, as returned by
*/
typedef void (* PFNGLXSCRENABLEEXTENSIONPROC) ( void *psc, const char * name );
-/**
- * Type of a pointer to \c __glXGetDrawableInfo, as returned by
- * \c glXGetProcAddress. This function is used to get information about the
- * position, size, and clip rects of a drawable.
- *
- * \sa __glXGetDrawableInfo, glXGetProcAddress
- */
-typedef GLboolean (* 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,
- int * backX, int * backY,
- int * numBackClipRects, drm_clip_rect_t ** pBackClipRects );
/* Test for the xf86dri.h header file */
#ifndef _XF86DRI_H_
const __DRIversion * ddx_version, const __DRIversion * dri_version,
const __DRIversion * drm_version, const __DRIframebuffer * frame_buffer,
void * pSAREA, int fd, int internal_api_version,
+ const __DRIinterfaceMethods * interface,
__GLcontextModes ** driver_modes);
typedef CREATENEWSCREENFUNC* PFNCREATENEWSCREENFUNC;
-extern CREATENEWSCREENFUNC __driCreateNewScreen_20050722;
+extern CREATENEWSCREENFUNC __driCreateNewScreen_20050725;
/**
int patch; /**< Patch-level. */
};
+
+typedef void (*__DRIfuncPtr)(void);
+
+struct __DRIinterfaceMethodsRec {
+ /**
+ * Get pointer to named function.
+ */
+ __DRIfuncPtr (*getProcAddress)( const char * proc_name );
+
+ /**
+ * Create a list of \c __GLcontextModes structures.
+ */
+ __GLcontextModes * (*createContextModes)(unsigned count,
+ size_t minimum_bytes_per_struct);
+
+ /**
+ * Destroy a list of \c __GLcontextModes structures.
+ *
+ * \todo
+ * Determine if the drivers actually need to call this.
+ */
+ void (*destroyContextModes)( __GLcontextModes * modes );
+
+ /**
+ * Get the \c __DRIscreen for a given display and screen number.
+ */
+ __DRIscreen *(*getScreen)(__DRInativeDisplay *dpy, int screenNum);
+
+
+ /**
+ * \name Client/server protocol functions.
+ *
+ * These functions implement the DRI client/server protocol for
+ * context and drawable operations. Platforms that do not implement
+ * the wire protocol (e.g., EGL) will implement glorified no-op functions.
+ */
+ /*@{*/
+ /**
+ * Determine if the specified window ID still exists.
+ *
+ * \note
+ * Implementations may assume that the driver will only pass an ID into
+ * this function that actually corresponds to a window. On
+ * implementations where windows can only be destroyed by the DRI driver
+ * (e.g., EGL), this function is allowed to always return \c GL_TRUE.
+ */
+ GLboolean (*windowExists)(__DRInativeDisplay *dpy, __DRIid draw);
+
+ /**
+ * Create the server-side portion of the GL context.
+ */
+ GLboolean (* createContext)( __DRInativeDisplay *dpy, int screenNum,
+ int configID, void * contextID, drm_context_t * hw_context );
+
+ /**
+ * Destroy the server-side portion of the GL context.
+ */
+ GLboolean (* destroyContext)( __DRInativeDisplay *dpy, int screenNum,
+ __DRIid context );
+
+ /**
+ * Create the server-side portion of the drawable.
+ */
+ GLboolean (*createDrawable)( __DRInativeDisplay * ndpy, int screen,
+ __DRIid drawable, drm_drawable_t * hHWDrawable );
+
+ /**
+ * Destroy the server-side portion of the drawable.
+ */
+ GLboolean (*destroyDrawable)( __DRInativeDisplay * ndpy, int screen,
+ __DRIid drawable );
+
+ /**
+ * This function is used to get information about the position, size, and
+ * clip rects of a drawable.
+ */
+ GLboolean (* getDrawableInfo) ( __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,
+ int * backX, int * backY,
+ int * numBackClipRects, drm_clip_rect_t ** pBackClipRects );
+ /*@}*/
+
+
+ /**
+ * \name Timing related functions.
+ */
+ /*@{*/
+ /**
+ * Get the 64-bit unadjusted system time (UST).
+ */
+ int (*getUST)(int64_t * ust);
+
+ /**
+ * Get the media stream counter (MSC) rate.
+ *
+ * Matching the definition in GLX_OML_sync_control, this function returns
+ * the rate of the "media stream counter". In practical terms, this is
+ * the frame refresh rate of the display.
+ */
+ GLboolean (*getMSCRate)(__DRInativeDisplay * dpy, __DRIid drawable,
+ int32_t * numerator, int32_t * denominator);
+ /*@}*/
+};
+
+
/**
* Framebuffer information record. Used by libGL to communicate information
* about the framebuffer to the driver's \c __driCreateNewScreen function.
/**
* Method to bind a DRI drawable to a DRI graphics context.
*
- * \since Internal API version 20050722.
+ * \since Internal API version 20050725.
*/
GLboolean (*bindContext)(__DRInativeDisplay *dpy, int scrn, __DRIid draw,
__DRIid read, __DRIcontext *ctx);
/**
* Method to unbind a DRI drawable from a DRI graphics context.
*
- * \since Internal API version 20050722.
+ * \since Internal API version 20050725.
*/
GLboolean (*unbindContext)(__DRInativeDisplay *dpy, int scrn, __DRIid draw,
__DRIid read, __DRIcontext *ctx);
* \todo
* Create a macro or something so that this is automatically updated.
*/
-static const char createNewScreenName[] = "__driCreateNewScreen_20050722";
+static const char createNewScreenName[] = "__driCreateNewScreen_20050725";
/**
extern const char *glXGetDriverConfig (const char *driverName);
+extern Bool __glXWindowExists(Display *dpy, GLXDrawable draw);
+
#endif
/************************************************************************/
#ifdef GLX_DIRECT_RENDERING
#include "indirect_init.h"
#include "xf86vmode.h"
+#include "xf86dri.h"
#endif
#include "glxextensions.h"
#include "glcontextmodes.h"
static const char __glXGLXClientVersion[] = "1.4";
-#if defined(GLX_DIRECT_RENDERING)
-#include "xf86dri.h"
-
-static Bool __glXWindowExists(Display *dpy, GLXDrawable draw);
-#endif
-
-
/****************************************************************************/
/**
* Get the __DRIdrawable for the drawable associated with a GLXContext
GLX_FUNCTION( glXGetSyncValuesOML ),
#ifdef GLX_DIRECT_RENDERING
- /***
- *** Internal functions useful to DRI drivers
- *** With this, the DRI drivers shouldn't need dlopen()/dlsym() to
- *** access internal libGL functions which may or may not exist.
- ***/
- GLX_FUNCTION( __glXInitialize ),
- GLX_FUNCTION( __glXFindDRIScreen ),
- GLX_FUNCTION( __glXGetInternalVersion ),
- GLX_FUNCTION( __glXWindowExists ),
- GLX_FUNCTION2( __glXCreateContextWithConfig, XF86DRICreateContextWithConfig ),
- GLX_FUNCTION2( __glXGetDrawableInfo, XF86DRIGetDrawableInfo ),
-
/*** DRI configuration ***/
GLX_FUNCTION( glXGetScreenDriver ),
GLX_FUNCTION( glXGetDriverConfig ),
-
- GLX_FUNCTION( __glXScrEnableExtension ),
-
- GLX_FUNCTION( __glXGetUST ),
-
- GLX_FUNCTION2( __glXCreateContextModes, _gl_context_modes_create ),
- GLX_FUNCTION2( __glXDestroyContextModes, _gl_context_modes_destroy ),
#endif
{ NULL, NULL } /* end of list */
* 20040415 - Added support for bindContext3 and unbindContext3.
* 20040602 - Add __glXGetDrawableInfo. I though that was there
* months ago. :(
- * 20050722 - Gut all the old interfaces. This breaks compatability with
+ * 20050725 - Gut all the old interfaces. This breaks compatability with
* any DRI driver built to any previous version.
*/
- return 20050722;
+ return 20050725;
}
*
* \since Internal API version 20021128.
*/
-static Bool __glXWindowExists(Display *dpy, GLXDrawable draw)
+Bool __glXWindowExists(Display *dpy, GLXDrawable draw)
{
XWindowAttributes xwa;
int (*oldXErrorHandler)(Display *, XErrorEvent *);
}
+/**
+ * Implement \c __DRIinterfaceMethods::getProcAddress.
+ */
+static __DRIfuncPtr get_proc_address( const char * proc_name )
+{
+ if (strcmp( proc_name, "glxEnableExtension" ) == 0) {
+ return (__DRIfuncPtr) __glXScrEnableExtension;
+ }
+
+ return NULL;
+}
+
+
+/**
+ * Table of functions exported by the loader to the driver.
+ */
+static const __DRIinterfaceMethods interface_methods = {
+ get_proc_address,
+
+ _gl_context_modes_create,
+ _gl_context_modes_destroy,
+
+ __glXFindDRIScreen,
+ __glXWindowExists,
+
+ XF86DRICreateContextWithConfig,
+ XF86DRIDestroyContext,
+
+ XF86DRICreateDrawable,
+ XF86DRIDestroyDrawable,
+ XF86DRIGetDrawableInfo,
+
+ __glXGetUST,
+ glXGetMscRateOML,
+};
+
/**
* Perform the required libGL-side initialization and call the client-side
pSAREA,
fd,
api_ver,
+ & interface_methods,
& driver_modes );
filter_modes( & configs->configs,
typedef GLboolean ( * PFNGLXGETMSCRATEOMLPROC) (__DRInativeDisplay *dpy, __DRIid drawable, int32_t *numerator, int32_t *denominator);
#endif
+/* This pointer *must* be set by the driver's __driCreateNewScreen funciton!
+ */
+const __DRIinterfaceMethods * dri_interface = NULL;
+
/**
* Weak thread-safety dispatch pointer. Older versions of libGL will not have
* this symbol, so a "weak" version is included here so that the driver will
*/
static const int empty_attribute_list[1] = { None };
-/**
- * Function used to determine if a drawable (window) still exists. Ideally
- * this function comes from libGL. With older versions of libGL from XFree86
- * we can fall-back to an internal version.
- *
- * \sa __driWindowExists __glXWindowExists
- */
-static PFNGLXWINDOWEXISTSPROC window_exists;
-
-typedef GLboolean (*PFNGLXCREATECONTEXTWITHCONFIGPROC)( __DRInativeDisplay*, int, int, void *,
- drm_context_t * );
-
-static PFNGLXCREATECONTEXTWITHCONFIGPROC create_context_with_config;
/**
* Cached copy of the internal API version used by libGL and the client-side
}
}
-typedef __DRIscreen *(*PFNGLXFINDDRISCREEN)(__DRInativeDisplay *, int);
-static PFNGLXFINDDRISCREEN glx_find_dri_screen = NULL;
-
/*****************************************************************/
/** \name Drawable list management */
do {
__DRIdrawablePrivate *pdp = (__DRIdrawablePrivate *)pdraw->private;
dpy = pdp->driScreenPriv->display;
- if (! (*window_exists)(dpy, draw)) {
+ if (! (*dri_interface->windowExists)(dpy, draw)) {
/* Destroy the local drawable data in the hash table, if the
drawable no longer exists in the Xserver */
drmHashDelete(drawHash, draw);
return GL_FALSE;
}
- pDRIScreen = (*glx_find_dri_screen)(dpy, scrn);
+ pDRIScreen = (*dri_interface->getScreen)(dpy, scrn);
if ( (pDRIScreen == NULL) || (pDRIScreen->private == NULL) ) {
/* ERROR!!! */
return GL_FALSE;
return GL_FALSE;
}
- pDRIScreen = (*glx_find_dri_screen)(dpy, scrn);
+ pDRIScreen = (*dri_interface->getScreen)(dpy, scrn);
if ( (pDRIScreen == NULL) || (pDRIScreen->private == NULL) ) {
/* ERROR!!! */
return GL_FALSE;
* \param pdp pointer to the private drawable information to update.
*
* This function basically updates the __DRIdrawablePrivate struct's
- * cliprect information by calling \c __DRIDrawablePrivate::getInfo. This is
- * usually called by the DRI_VALIDATE_DRAWABLE_INFO macro which
+ * cliprect information by calling \c __DRIinterfaceMethods::getDrawableInfo.
+ * This is usually called by the DRI_VALIDATE_DRAWABLE_INFO macro which
* compares the __DRIdrwablePrivate pStamp and lastStamp values. If
* the values are different that means we have to update the clipping
* info.
DRM_SPINUNLOCK(&psp->pSAREA->drawable_lock, psp->drawLockID);
if (!__driFindDrawable(psp->drawHash, pdp->draw) ||
- ! (*pdp->getInfo)(pdp->display, pdp->screen, pdp->draw,
+ ! (*dri_interface->getDrawableInfo)(pdp->display, pdp->screen, pdp->draw,
&pdp->index, &pdp->lastStamp,
&pdp->x, &pdp->y, &pdp->w, &pdp->h,
&pdp->numClipRects, &pdp->pClipRects,
int renderType,
const int *attrs)
{
- __DRIscreen * const pDRIScreen = (*glx_find_dri_screen)(dpy, modes->screen);
+ __DRIscreen * const pDRIScreen = (*dri_interface->getScreen)(dpy, modes->screen);
__DRIscreenPrivate *psp;
__DRIdrawablePrivate *pdp;
return NULL;
}
- if (!XF86DRICreateDrawable(dpy, modes->screen, draw, &pdp->hHWDrawable)) {
+ if (!(*dri_interface->createDrawable)(dpy, modes->screen, draw, &pdp->hHWDrawable)) {
_mesa_free(pdp);
return NULL;
}
pdp->driScreenPriv = psp;
pdp->driContextPriv = &psp->dummyContextPriv;
- pdp->getInfo = (PFNGLXGETDRAWABLEINFOPROC)
- glXGetProcAddress( (const GLubyte *) "__glXGetDrawableInfo" );
- if ( pdp->getInfo == NULL ) {
- (void)XF86DRIDestroyDrawable(dpy, modes->screen, pdp->draw);
- _mesa_free(pdp);
- return NULL;
- }
-
if (!(*psp->DriverAPI.CreateBuffer)(psp, pdp, modes,
renderType == GLX_PIXMAP_BIT)) {
- (void)XF86DRIDestroyDrawable(dpy, modes->screen, pdp->draw);
+ (void)(*dri_interface->destroyDrawable)(dpy, modes->screen, pdp->draw);
_mesa_free(pdp);
return NULL;
}
if (pdp) {
(*psp->DriverAPI.DestroyBuffer)(pdp);
- if ((*window_exists)(dpy, pdp->draw))
- (void)XF86DRIDestroyDrawable(dpy, scrn, pdp->draw);
+ if ((*dri_interface->windowExists)(dpy, pdp->draw))
+ (void)(*dri_interface->destroyDrawable)(dpy, scrn, pdp->draw);
if (pdp->pClipRects) {
_mesa_free(pdp->pClipRects);
pdp->pClipRects = NULL;
if (pcp) {
(*pcp->driScreenPriv->DriverAPI.DestroyContext)(pcp);
__driGarbageCollectDrawables(pcp->driScreenPriv->drawHash);
- (void)XF86DRIDestroyContext(dpy, scrn, pcp->contextID);
+ (void) (*dri_interface->destroyContext)(dpy, scrn, pcp->contextID);
_mesa_free(pcp);
}
}
__DRIscreenPrivate *psp;
void * const shareCtx = (pshare != NULL) ? pshare->driverPrivate : NULL;
- pDRIScreen = (*glx_find_dri_screen)(dpy, modes->screen);
+ pDRIScreen = (*dri_interface->getScreen)(dpy, modes->screen);
if ( (pDRIScreen == NULL) || (pDRIScreen->private == NULL) ) {
/* ERROR!!! */
return NULL;
return NULL;
}
- if (! (*create_context_with_config)(dpy, modes->screen, modes->fbconfigID,
+ if (! (*dri_interface->createContext)(dpy, modes->screen, modes->fbconfigID,
&pcp->contextID, &pcp->hHWContext)) {
_mesa_free(pcp);
return NULL;
pctx->unbindContext = driUnbindContext;
if ( !(*psp->DriverAPI.CreateContext)(modes, pcp, shareCtx) ) {
- (void)XF86DRIDestroyContext(dpy, modes->screen, pcp->contextID);
+ (void) (*dri_interface->destroyContext)(dpy, modes->screen,
+ pcp->contextID);
_mesa_free(pcp);
return NULL;
}
__DRIscreenPrivate *psp;
- window_exists = (PFNGLXWINDOWEXISTSPROC)
- glXGetProcAddress( (const GLubyte *) "__glXWindowExists" );
-
- if ( window_exists == NULL ) {
- return NULL;
- }
-
- glx_find_dri_screen =
- (PFNGLXFINDDRISCREEN)glXGetProcAddress("__glXFindDRIScreen");
- if ( glx_find_dri_screen == NULL ) {
- return NULL;
- }
-
- create_context_with_config = (PFNGLXCREATECONTEXTWITHCONFIGPROC)
- glXGetProcAddress( (const GLubyte *) "__glXCreateContextWithConfig" );
- if ( create_context_with_config == NULL ) {
- return NULL;
- }
-
api_ver = internal_api_version;
psp = (__DRIscreenPrivate *)_mesa_malloc(sizeof(__DRIscreenPrivate));
int64_t * sbc, int64_t * missedFrames,
float * lastMissedUsage, float * usage )
{
- static PFNGLXGETUSTPROC get_ust;
__DRIswapInfo sInfo;
int status;
int64_t ust;
__DRIdrawablePrivate * dpriv = (__DRIdrawablePrivate *) priv;
- if ( get_ust == NULL ) {
- get_ust = (PFNGLXGETUSTPROC) glXGetProcAddress( (const GLubyte *) "__glXGetUST" );
- }
status = dpriv->driScreenPriv->DriverAPI.GetSwapInfo( dpriv, & sInfo );
if ( status == 0 ) {
*missedFrames = sInfo.swap_missed_count;
*lastMissedUsage = sInfo.swap_missed_usage;
- (*get_ust)( & ust );
+ (*dri_interface->getUST)( & ust );
*usage = driCalculateSwapUsage( dpriv, sInfo.swap_ust, ust );
}
driCalculateSwapUsage( __DRIdrawablePrivate *dPriv, int64_t last_swap_ust,
int64_t current_ust )
{
- static PFNGLXGETMSCRATEOMLPROC get_msc_rate = NULL;
int32_t n;
int32_t d;
int interval;
float usage = 1.0;
- if ( get_msc_rate == NULL ) {
- get_msc_rate = (PFNGLXGETMSCRATEOMLPROC)
- glXGetProcAddress( (const GLubyte *) "glXGetMscRateOML" );
- }
-
- if ( (get_msc_rate != NULL)
- && get_msc_rate( dPriv->display, dPriv->draw, &n, &d ) ) {
+ if ( (*dri_interface->getMSCRate)( dPriv->display, dPriv->draw, &n, &d ) ) {
interval = (dPriv->pdraw->swap_interval != 0)
? dPriv->pdraw->swap_interval : 1;
* \name Display and screen information.
*
* Basically just need these for when the locking code needs to call
- * __driUtilUpdateDrawableInfo() which calls XF86DRIGetDrawableInfo().
+ * \c __driUtilUpdateDrawableInfo.
*/
/*@{*/
__DRInativeDisplay *display;
* Called via glXSwapBuffers().
*/
void (*swapBuffers)( __DRIdrawablePrivate *dPriv );
-
- /**
- * Get information about the location, size, and clip rects of the
- * drawable within the display.
- */
- PFNGLXGETDRAWABLEINFOPROC getInfo;
};
/**
driCalculateSwapUsage( __DRIdrawablePrivate *dPriv,
int64_t last_swap_ust, int64_t current_ust );
-/* Test for the GLX header glx.h */
-#ifndef GLX
-extern void
-(*glXGetProcAddress(const GLubyte *procname))( void );
-#endif
+/**
+ * Pointer to the \c __DRIinterfaceMethods passed to the driver by the loader.
+ *
+ * This pointer is set in the driver's \c __driCreateNewScreen function and
+ * is defined in dri_util.c.
+ */
+extern const __DRIinterfaceMethods * dri_interface;
#endif /* _DRI_UTIL_H_ */
#define FB_CONTEXT(ctx) ((fbContextPtr)(ctx->DriverCtx))
-static PFNGLXCREATECONTEXTMODES create_context_modes = NULL;
static const GLubyte *
get_string(GLcontext *ctx, GLenum pname)
fb_type = GL_UNSIGNED_INT_8_8_8_8_REV;
}
- modes = (*create_context_modes)( num_modes, sizeof( __GLcontextModes ) );
+ modes = (*dri_interface->createContextModes)( num_modes, sizeof( __GLcontextModes ) );
m = modes;
if ( ! driFillInModes( & m, fb_format, fb_type,
depth_bits_array, stencil_bits_array, depth_buffer_factor,
frame_buffer, pSAREA, fd,
internal_api_version, &fbAPI);
if ( psp != NULL ) {
- create_context_modes = (PFNGLXCREATECONTEXTMODES)
- glXGetProcAddress( (const GLubyte *) "__glXCreateContextModes" );
- if ( create_context_modes != NULL ) {
-
- *driver_modes = fbFillInModes( psp->fbBPP,
- (psp->fbBPP == 16) ? 16 : 24,
- (psp->fbBPP == 16) ? 0 : 8,
- 1);
- }
+ *driver_modes = fbFillInModes( psp->fbBPP,
+ (psp->fbBPP == 16) ? 16 : 24,
+ (psp->fbBPP == 16) ? 0 : 8,
+ 1);
}
return (void *) psp;
};
-static PFNGLXCREATECONTEXTMODES create_context_modes = NULL;
-
static __GLcontextModes *
ffbFillInModes( unsigned pixel_bits, unsigned depth_bits,
unsigned stencil_bits, GLboolean have_back_buffer )
fb_type = GL_UNSIGNED_INT_8_8_8_8_REV;
}
- modes = (*create_context_modes)( num_modes, sizeof( __GLcontextModes ) );
+ modes = (*dri_interface->createContextModes)( num_modes, sizeof( __GLcontextModes ) );
m = modes;
if ( ! driFillInModes( & m, fb_format, fb_type,
depth_bits_array, stencil_bits_array, depth_buffer_factor,
* failure.
*/
PUBLIC
-void * __driCreateNewScreen_20050722( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc,
+void * __driCreateNewScreen_20050725( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc,
const __GLcontextModes * modes,
const __DRIversion * ddx_version,
const __DRIversion * dri_version,
const __DRIframebuffer * frame_buffer,
drmAddress pSAREA, int fd,
int internal_api_version,
+ const __DRIinterfaceMethods * interface,
__GLcontextModes ** driver_modes )
{
static const __DRIversion dri_expected = { 4, 0, 0 };
static const __DRIversion drm_expected = { 0, 0, 1 };
+ dri_interface = interface;
+
if ( ! driCheckDriDdxDrmVersions2( "ffb",
dri_version, & dri_expected,
ddx_version, & ddx_expected,
frame_buffer, pSAREA, fd,
internal_api_version, &ffbAPI);
if ( psp != NULL ) {
- create_context_modes = (PFNGLXCREATECONTEXTMODES)
- glXGetProcAddress( (const GLubyte *) "__glXCreateContextModes" );
- if ( create_context_modes != NULL ) {
- *driver_modes = ffbFillInModes( 32, 16, 0, GL_TRUE );
- }
+ *driver_modes = ffbFillInModes( 32, 16, 0, GL_TRUE );
}
return (void *) psp;
#include "GL/internal/dri_interface.h"
-static PFNGLXCREATECONTEXTMODES create_context_modes = NULL;
-
static __GLcontextModes *fill_in_modes( __GLcontextModes *modes,
unsigned pixel_bits,
unsigned depth_bits,
num_modes = depth_buffer_factor * back_buffer_factor * 4;
- modes = (*create_context_modes)( num_modes, sizeof( __GLcontextModes ) );
+ modes = (*dri_interface->createContextModes)( num_modes, sizeof( __GLcontextModes ) );
m = modes;
for ( i = 0 ; i < depth_buffer_factor ; i++ ) {
m = fill_in_modes( m, pixel_bits,
* failure.
*/
PUBLIC
-void * __driCreateNewScreen_20050722( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc,
+void * __driCreateNewScreen_20050725( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc,
const __GLcontextModes * modes,
const __DRIversion * ddx_version,
const __DRIversion * dri_version,
const __DRIframebuffer * frame_buffer,
drmAddress pSAREA, int fd,
int internal_api_version,
+ const __DRIinterfaceMethods * interface,
__GLcontextModes ** driver_modes )
{
static const __DRIversion dri_expected = { 4, 0, 0 };
static const __DRIversion drm_expected = { 1, 2, 0 };
+ dri_interface = interface;
+
if ( ! driCheckDriDdxDrmVersions2( "i810",
dri_version, & dri_expected,
ddx_version, & ddx_expected,
frame_buffer, pSAREA, fd,
internal_api_version, &i810API);
if ( psp != NULL ) {
- create_context_modes = (PFNGLXCREATECONTEXTMODES)
- glXGetProcAddress( (const GLubyte *) "__glXCreateContextModes" );
- if ( create_context_modes != NULL ) {
- *driver_modes = i810FillInModes( 16,
- 16, 0,
- 1);
- }
+ *driver_modes = i810FillInModes( 16,
+ 16, 0,
+ 1);
}
return (void *) psp;
DRI_CONF_END;
const GLuint __driNConfigOptions = 2;
-static PFNGLXCREATECONTEXTMODES create_context_modes = NULL;
static int i830_malloc_proxy_buf(drmBufMapPtr buffers)
{
i830ScreenPrivate *i830Screen;
I830DRIPtr gDRIPriv = (I830DRIPtr)sPriv->pDevPriv;
PFNGLXSCRENABLEEXTENSIONPROC glx_enable_extension =
- (PFNGLXSCRENABLEEXTENSIONPROC) glXGetProcAddress( (const GLubyte *) "__glXScrEnableExtension" );
+ (PFNGLXSCRENABLEEXTENSIONPROC) (*dri_interface->getProcAddress("glxEnableExtension"));
void * const psc = sPriv->psc->screenConfigs;
fb_type = GL_UNSIGNED_INT_8_8_8_8_REV;
}
- modes = (*create_context_modes)( num_modes, sizeof( __GLcontextModes ) );
+ modes = (*dri_interface->createContextModes)( num_modes, sizeof( __GLcontextModes ) );
m = modes;
if ( ! driFillInModes( & m, fb_format, fb_type,
depth_bits_array, stencil_bits_array, depth_buffer_factor,
* failure.
*/
PUBLIC
-void * __driCreateNewScreen_20050722( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc,
+void * __driCreateNewScreen_20050725( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc,
const __GLcontextModes * modes,
const __DRIversion * ddx_version,
const __DRIversion * dri_version,
const __DRIframebuffer * frame_buffer,
drmAddress pSAREA, int fd,
int internal_api_version,
+ const __DRIinterfaceMethods * interface,
__GLcontextModes ** driver_modes )
{
static const __DRIversion dri_expected = { 4, 0, 0 };
static const __DRIversion drm_expected = { 1, 3, 0 };
+ dri_interface = interface;
+
if ( ! driCheckDriDdxDrmVersions2( "i830",
dri_version, & dri_expected,
ddx_version, & ddx_expected,
frame_buffer, pSAREA, fd,
internal_api_version, &i830API);
if ( psp != NULL ) {
- create_context_modes = (PFNGLXCREATECONTEXTMODES)
- glXGetProcAddress( (const GLubyte *) "__glXCreateContextModes" );
- if ( create_context_modes != NULL ) {
- I830DRIPtr dri_priv = (I830DRIPtr) psp->pDevPriv;
- *driver_modes = i830FillInModes( dri_priv->cpp * 8,
- (dri_priv->cpp == 2) ? 16 : 24,
- (dri_priv->cpp == 2) ? 0 : 8,
- (dri_priv->backOffset != dri_priv->depthOffset) );
- }
+ I830DRIPtr dri_priv = (I830DRIPtr) psp->pDevPriv;
+ *driver_modes = i830FillInModes( dri_priv->cpp * 8,
+ (dri_priv->cpp == 2) ? 16 : 24,
+ (dri_priv->cpp == 2) ? 0 : 8,
+ (dri_priv->backOffset != dri_priv->depthOffset) );
}
return (void *) psp;
DRI_CONF_END;
const GLuint __driNConfigOptions = 1;
-static PFNGLXCREATECONTEXTMODES create_context_modes = NULL;
-
static void intelPrintDRIInfo(intelScreenPrivate *intelScreen,
__DRIscreenPrivate *sPriv,
intelScreenPrivate *intelScreen;
I830DRIPtr gDRIPriv = (I830DRIPtr)sPriv->pDevPriv;
PFNGLXSCRENABLEEXTENSIONPROC glx_enable_extension =
- (PFNGLXSCRENABLEEXTENSIONPROC) glXGetProcAddress( (const GLubyte *) "__glXScrEnableExtension" );
+ (PFNGLXSCRENABLEEXTENSIONPROC) (*dri_interface->getProcAddress("glxEnableExtension"));
void * const psc = sPriv->psc->screenConfigs;
fb_type = GL_UNSIGNED_INT_8_8_8_8_REV;
}
- modes = (*create_context_modes)( num_modes, sizeof( __GLcontextModes ) );
+ modes = (*dri_interface->createContextModes)( num_modes, sizeof( __GLcontextModes ) );
m = modes;
if ( ! driFillInModes( & m, fb_format, fb_type,
depth_bits_array, stencil_bits_array, depth_buffer_factor,
* failure.
*/
PUBLIC
-void * __driCreateNewScreen_20050722( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc,
+void * __driCreateNewScreen_20050725( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc,
const __GLcontextModes * modes,
const __DRIversion * ddx_version,
const __DRIversion * dri_version,
const __DRIframebuffer * frame_buffer,
drmAddress pSAREA, int fd,
int internal_api_version,
+ const __DRIinterfaceMethods * interface,
__GLcontextModes ** driver_modes )
{
static const __DRIversion dri_expected = { 4, 0, 0 };
static const __DRIversion drm_expected = { 1, 1, 0 };
+ dri_interface = interface;
+
if ( ! driCheckDriDdxDrmVersions2( "i915",
dri_version, & dri_expected,
ddx_version, & ddx_expected,
frame_buffer, pSAREA, fd,
internal_api_version, &intelAPI);
if ( psp != NULL ) {
- create_context_modes = (PFNGLXCREATECONTEXTMODES)
- glXGetProcAddress( (const GLubyte *) "__glXCreateContextModes" );
- if ( create_context_modes != NULL ) {
- I830DRIPtr dri_priv = (I830DRIPtr) psp->pDevPriv;
- *driver_modes = intelFillInModes( dri_priv->cpp * 8,
- (dri_priv->cpp == 2) ? 16 : 24,
- (dri_priv->cpp == 2) ? 0 : 8,
- (dri_priv->backOffset != dri_priv->depthOffset) );
- }
+ I830DRIPtr dri_priv = (I830DRIPtr) psp->pDevPriv;
+ *driver_modes = intelFillInModes( dri_priv->cpp * 8,
+ (dri_priv->cpp == 2) ? 16 : 24,
+ (dri_priv->cpp == 2) ? 0 : 8,
+ (dri_priv->backOffset != dri_priv->depthOffset) );
}
return (void *) psp;
static const GLuint __driNConfigOptions = 2;
#endif
-static PFNGLXCREATECONTEXTMODES create_context_modes = NULL;
static __GLcontextModes * fill_in_modes( __GLcontextModes * modes,
unsigned pixel_bits,
num_modes = depth_buffer_factor * back_buffer_factor * 4;
- modes = (*create_context_modes)( num_modes, sizeof( __GLcontextModes ) );
+ modes = (*dri_interface->createContextModes)( num_modes, sizeof( __GLcontextModes ) );
m = modes;
for ( i = 0 ; i < depth_buffer_factor ; i++ ) {
m = fill_in_modes( m, pixel_bits,
mach64ScreenPtr mach64Screen;
ATIDRIPtr serverInfo = (ATIDRIPtr)sPriv->pDevPriv;
PFNGLXSCRENABLEEXTENSIONPROC glx_enable_extension =
- (PFNGLXSCRENABLEEXTENSIONPROC) glXGetProcAddress( (const GLubyte *) "__glXScrEnableExtension" );
+ (PFNGLXSCRENABLEEXTENSIONPROC) (*dri_interface->getProcAddress("glxEnableExtension"));
void * const psc = sPriv->psc->screenConfigs;
* failure.
*/
PUBLIC
-void * __driCreateNewScreen_20050722( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc,
+void * __driCreateNewScreen_20050725( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc,
const __GLcontextModes * modes,
const __DRIversion * ddx_version,
const __DRIversion * dri_version,
const __DRIframebuffer * frame_buffer,
drmAddress pSAREA, int fd,
int internal_api_version,
+ const __DRIinterfaceMethods * interface,
__GLcontextModes ** driver_modes )
{
static const __DRIversion dri_expected = { 4, 0, 0 };
static const __DRIversion drm_expected = { 1, 0, 0 };
+ dri_interface = interface;
+
if ( ! driCheckDriDdxDrmVersions2( "Mach64",
dri_version, & dri_expected,
ddx_version, & ddx_expected,
frame_buffer, pSAREA, fd,
internal_api_version, &mach64API);
if ( psp != NULL ) {
- create_context_modes = (PFNGLXCREATECONTEXTMODES)
- glXGetProcAddress( (const GLubyte *) "__glXCreateContextModes" );
- if ( create_context_modes != NULL ) {
- ATIDRIPtr dri_priv = (ATIDRIPtr) psp->pDevPriv;
- *driver_modes = mach64FillInModes( dri_priv->cpp * 8,
- 16,
- 0,
- 1);
- }
+ ATIDRIPtr dri_priv = (ATIDRIPtr) psp->pDevPriv;
+ *driver_modes = mach64FillInModes( dri_priv->cpp * 8,
+ 16,
+ 0,
+ 1);
}
return (void *) psp;
DRI_CONF_END;
static const GLuint __driNConfigOptions = 6;
-static PFNGLXCREATECONTEXTMODES create_context_modes = NULL;
-
#ifndef MGA_DEBUG
int MGA_DEBUG = 0;
#endif
fb_type = GL_UNSIGNED_INT_8_8_8_8_REV;
}
- modes = (*create_context_modes)( num_modes, sizeof( __GLcontextModes ) );
+ modes = (*dri_interface->createContextModes)( num_modes, sizeof( __GLcontextModes ) );
m = modes;
if ( ! driFillInModes( & m, fb_format, fb_type,
depth_bits_array, stencil_bits_array, depth_buffer_factor,
mgaScreenPrivate *mgaScreen;
MGADRIPtr serverInfo = (MGADRIPtr)sPriv->pDevPriv;
PFNGLXSCRENABLEEXTENSIONPROC glx_enable_extension =
- (PFNGLXSCRENABLEEXTENSIONPROC) glXGetProcAddress( (const GLubyte *) "__glXScrEnableExtension" );
+ (PFNGLXSCRENABLEEXTENSIONPROC) (*dri_interface->getProcAddress("glxEnableExtension"));
void * const psc = sPriv->psc->screenConfigs;
};
-static int
-get_ust_nop( int64_t * ust )
-{
- *ust = 1;
- return 0;
-}
-
-
static GLboolean
mgaCreateContext( const __GLcontextModes *mesaVis,
__DRIcontextPrivate *driContextPriv,
mmesa->vblank_flags = (mmesa->mgaScreen->irq == 0)
? VBLANK_FLAG_NO_IRQ : driGetDefaultVBlankFlags(&mmesa->optionCache);
- mmesa->get_ust = (PFNGLXGETUSTPROC) glXGetProcAddress( (const GLubyte *) "__glXGetUST" );
- if ( mmesa->get_ust == NULL ) {
- mmesa->get_ust = get_ust_nop;
- }
-
- (*mmesa->get_ust)( & mmesa->swap_ust );
+ (*dri_interface->getUST)( & mmesa->swap_ust );
if (driQueryOptionb(&mmesa->optionCache, "no_rast")) {
fprintf(stderr, "disabling 3D acceleration\n");
* failure.
*/
PUBLIC
-void * __driCreateNewScreen_20050722( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc,
+void * __driCreateNewScreen_20050725( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc,
const __GLcontextModes * modes,
const __DRIversion * ddx_version,
const __DRIversion * dri_version,
const __DRIframebuffer * frame_buffer,
drmAddress pSAREA, int fd,
int internal_api_version,
+ const __DRIinterfaceMethods * interface,
__GLcontextModes ** driver_modes )
{
static const __DRIversion dri_expected = { 4, 0, 0 };
static const __DRIversion drm_expected = { 3, 0, 0 };
+ dri_interface = interface;
+
if ( ! driCheckDriDdxDrmVersions2( "MGA",
dri_version, & dri_expected,
ddx_version, & ddx_expected,
frame_buffer, pSAREA, fd,
internal_api_version, &mgaAPI);
if ( psp != NULL ) {
- create_context_modes = (PFNGLXCREATECONTEXTMODES)
- glXGetProcAddress( (const GLubyte *) "__glXCreateContextModes" );
- if ( create_context_modes != NULL ) {
- MGADRIPtr dri_priv = (MGADRIPtr) psp->pDevPriv;
- *driver_modes = mgaFillInModes( dri_priv->cpp * 8,
- (dri_priv->cpp == 2) ? 16 : 24,
- (dri_priv->cpp == 2) ? 0 : 8,
- (dri_priv->backOffset != dri_priv->depthOffset) );
- }
+ MGADRIPtr dri_priv = (MGADRIPtr) psp->pDevPriv;
+ *driver_modes = mgaFillInModes( dri_priv->cpp * 8,
+ (dri_priv->cpp == 2) ? 16 : 24,
+ (dri_priv->cpp == 2) ? 0 : 8,
+ (dri_priv->backOffset != dri_priv->depthOffset) );
}
return (void *) psp;
uint32_t last_frame_fence;
- PFNGLXGETUSTPROC get_ust;
-
/* Drawable, cliprect and scissor information
*/
int dirty_cliprects; /* which sets of cliprects are uptodate? */
& missed_target );
if ( missed_target ) {
mmesa->swap_missed_count++;
- (void) (*mmesa->get_ust)( & mmesa->swap_missed_ust );
+ (void) (*dri_interface->getUST)( & mmesa->swap_missed_ust );
}
LOCK_HARDWARE( mmesa );
mmesa->dirty |= MGA_UPLOAD_CLIPRECTS;
mmesa->swap_count++;
- (void) (*mmesa->get_ust)( & mmesa->swap_ust );
+ (void) (*dri_interface->getUST)( & mmesa->swap_ust );
}
#define PCI_CHIP_RAGE128RL 0x524C
#endif
-static PFNGLXCREATECONTEXTMODES create_context_modes = NULL;
/* Create the device specific screen private data struct.
*/
r128ScreenPtr r128Screen;
R128DRIPtr r128DRIPriv = (R128DRIPtr)sPriv->pDevPriv;
PFNGLXSCRENABLEEXTENSIONPROC glx_enable_extension =
- (PFNGLXSCRENABLEEXTENSIONPROC) glXGetProcAddress( (const GLubyte *) "__glXScrEnableExtension" );
+ (PFNGLXSCRENABLEEXTENSIONPROC) (*dri_interface->getProcAddress("glxEnableExtension"));
void * const psc = sPriv->psc->screenConfigs;
fb_type = GL_UNSIGNED_INT_8_8_8_8_REV;
}
- modes = (*create_context_modes)( num_modes, sizeof( __GLcontextModes ) );
+ modes = (*dri_interface->createContextModes)( num_modes, sizeof( __GLcontextModes ) );
m = modes;
if ( ! driFillInModes( & m, fb_format, fb_type,
depth_bits_array, stencil_bits_array, depth_buffer_factor,
* failure.
*/
PUBLIC
-void * __driCreateNewScreen_20050722( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc,
+void * __driCreateNewScreen_20050725( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc,
const __GLcontextModes * modes,
const __DRIversion * ddx_version,
const __DRIversion * dri_version,
const __DRIframebuffer * frame_buffer,
drmAddress pSAREA, int fd,
int internal_api_version,
+ const __DRIinterfaceMethods * interface,
__GLcontextModes ** driver_modes )
{
static const __DRIversion drm_expected = { 2, 2, 0 };
+ dri_interface = interface;
+
if ( ! driCheckDriDdxDrmVersions2( "Rage128",
dri_version, & dri_expected,
ddx_version, & ddx_expected,
frame_buffer, pSAREA, fd,
internal_api_version, &r128API);
if ( psp != NULL ) {
- create_context_modes = (PFNGLXCREATECONTEXTMODES)
- glXGetProcAddress( (const GLubyte *) "__glXCreateContextModes" );
- if ( create_context_modes != NULL ) {
- R128DRIPtr dri_priv = (R128DRIPtr) psp->pDevPriv;
- *driver_modes = r128FillInModes( dri_priv->bpp,
- (dri_priv->bpp == 16) ? 16 : 24,
- (dri_priv->bpp == 16) ? 0 : 8,
- (dri_priv->backOffset != dri_priv->depthOffset) );
- }
+ R128DRIPtr dri_priv = (R128DRIPtr) psp->pDevPriv;
+ *driver_modes = r128FillInModes( dri_priv->bpp,
+ (dri_priv->bpp == 16) ? 16 : 24,
+ (dri_priv->bpp == 16) ? 0 : 8,
+ (dri_priv->backOffset != dri_priv->depthOffset) );
}
return (void *) psp;
};
-static int
-get_ust_nop( int64_t * ust )
-{
- *ust = 1;
- return 0;
-}
-
-
/* Create the device specific rendering context.
*/
GLboolean r200CreateContext( const __GLcontextModes *glVisual,
rmesa->prefer_gart_client_texturing =
(getenv("R200_GART_CLIENT_TEXTURES") != 0);
- rmesa->get_ust = (PFNGLXGETUSTPROC) glXGetProcAddress( (const GLubyte *) "__glXGetUST" );
- if ( rmesa->get_ust == NULL ) {
- rmesa->get_ust = get_ust_nop;
- }
- (*rmesa->get_ust)( & rmesa->swap_ust );
+ (*dri_interface->getUST)( & rmesa->swap_ust );
#if DO_DEBUG
GLuint swap_count;
GLuint swap_missed_count;
- PFNGLXGETUSTPROC get_ust;
/* r200_tcl.c
*/
rmesa->hw.all_dirty = GL_TRUE;
rmesa->swap_count++;
- (*rmesa->get_ust)( & ust );
+ (*dri_interface->getUST)( & ust );
if ( missed_target ) {
rmesa->swap_missed_count++;
rmesa->swap_missed_ust = ust - rmesa->swap_ust;
driWaitForVBlank( dPriv, & rmesa->vbl_seq, rmesa->vblank_flags, & missed_target );
if ( missed_target ) {
rmesa->swap_missed_count++;
- (void) (*rmesa->get_ust)( & rmesa->swap_missed_ust );
+ (void) (*dri_interface->getUST)( & rmesa->swap_missed_ust );
}
LOCK_HARDWARE( rmesa );
}
rmesa->swap_count++;
- (void) (*rmesa->get_ust)( & rmesa->swap_ust );
+ (void) (*dri_interface->getUST)( & rmesa->swap_ust );
if ( rmesa->sarea->pfCurrentPage == 1 ) {
rmesa->state.color.drawOffset = rmesa->r200Screen->frontOffset;
#endif
-static PFNGLXCREATECONTEXTMODES create_context_modes = NULL;
static r200ScreenPtr __r200Screen;
fb_type = GL_UNSIGNED_INT_8_8_8_8_REV;
}
- modes = (*create_context_modes)( num_modes, sizeof( __GLcontextModes ) );
+ modes = (*dri_interface->createContextModes)( num_modes, sizeof( __GLcontextModes ) );
m = modes;
if ( ! driFillInModes( & m, fb_format, fb_type,
depth_bits_array, stencil_bits_array, depth_buffer_factor,
RADEONDRIPtr dri_priv = (RADEONDRIPtr)sPriv->pDevPriv;
unsigned char *RADEONMMIO;
PFNGLXSCRENABLEEXTENSIONPROC glx_enable_extension =
- (PFNGLXSCRENABLEEXTENSIONPROC) glXGetProcAddress( (const GLubyte *) "__glXScrEnableExtension" );
+ (PFNGLXSCRENABLEEXTENSIONPROC) (*dri_interface->getProcAddress("glxEnableExtension"));
void * const psc = sPriv->psc->screenConfigs;
* failure.
*/
PUBLIC
-void * __driCreateNewScreen_20050722( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc,
+void * __driCreateNewScreen_20050725( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc,
const __GLcontextModes * modes,
const __DRIversion * ddx_version,
const __DRIversion * dri_version,
const __DRIframebuffer * frame_buffer,
drmAddress pSAREA, int fd,
int internal_api_version,
+ const __DRIinterfaceMethods * interface,
__GLcontextModes ** driver_modes )
{
static const __DRIversion dri_expected = { 4, 0, 0 };
static const __DRIversion drm_expected = { 1, 5, 0 };
+ dri_interface = interface;
+
if ( ! driCheckDriDdxDrmVersions3( "R200",
dri_version, & dri_expected,
ddx_version, & ddx_expected,
frame_buffer, pSAREA, fd,
internal_api_version, &r200API);
if ( psp != NULL ) {
- create_context_modes = (PFNGLXCREATECONTEXTMODES)
- glXGetProcAddress( (const GLubyte *) "__glXCreateContextModes" );
- if ( create_context_modes != NULL ) {
- RADEONDRIPtr dri_priv = (RADEONDRIPtr) psp->pDevPriv;
- *driver_modes = r200FillInModes( dri_priv->bpp,
- (dri_priv->bpp == 16) ? 16 : 24,
- (dri_priv->bpp == 16) ? 0 : 8,
- (dri_priv->backOffset != dri_priv->depthOffset) );
- }
+ RADEONDRIPtr dri_priv = (RADEONDRIPtr) psp->pDevPriv;
+ *driver_modes = r200FillInModes( dri_priv->bpp,
+ (dri_priv->bpp == 16) ? 16 : 24,
+ (dri_priv->bpp == 16) ? 0 : 8,
+ (dri_priv->backOffset != dri_priv->depthOffset) );
}
return (void *) psp;
}
-static int get_ust_nop(int64_t * ust)
-{
- *ust = 1;
- return 0;
-}
-
/**
* Create and initialize all common fields of the context,
* including the Mesa context itself.
radeon->vblank_flags = (radeon->radeonScreen->irq != 0)
? driGetDefaultVBlankFlags(&radeon->optionCache) : VBLANK_FLAG_NO_IRQ;
- radeon->get_ust =
- (PFNGLXGETUSTPROC) glXGetProcAddress((const GLubyte *)
- "__glXGetUST");
- if (radeon->get_ust == NULL) {
- radeon->get_ust = get_ust_nop;
- }
- (*radeon->get_ust) (&radeon->swap_ust);
+ (*dri_interface->getUST) (&radeon->swap_ust);
return GL_TRUE;
}
GLuint swap_count;
GLuint swap_missed_count;
- PFNGLXGETUSTPROC get_ust;
/* Derived state */
struct radeon_state state;
((r300ContextPtr)radeon)->hw.all_dirty = GL_TRUE;
radeon->swap_count++;
- (*radeon->get_ust) (&ust);
+ (*dri_interface->getUST) (&ust);
if (missed_target) {
radeon->swap_missed_count++;
radeon->swap_missed_ust = ust - radeon->swap_ust;
&missed_target);
if (missed_target) {
radeon->swap_missed_count++;
- (void)(*radeon->get_ust) (&radeon->swap_missed_ust);
+ (void)(*dri_interface->getUST) (&radeon->swap_missed_ust);
}
LOCK_HARDWARE(radeon);
}
radeon->swap_count++;
- (void)(*radeon->get_ust) (&radeon->swap_ust);
+ (void)(*dri_interface->getUST) (&radeon->swap_ust);
if (radeon->sarea->pfCurrentPage == 1) {
radeon->state.color.drawOffset = radeon->radeonScreen->frontOffset;
#define PCI_CHIP_R420_JK 0x4a4b
#endif
-static PFNGLXCREATECONTEXTMODES create_context_modes = NULL;
static radeonScreenPtr __radeonScreen;
fb_type = GL_UNSIGNED_INT_8_8_8_8_REV;
}
- modes = (*create_context_modes) (num_modes, sizeof(__GLcontextModes));
+ modes = (*dri_interface->createContextModes) (num_modes, sizeof(__GLcontextModes));
m = modes;
if (!driFillInModes(&m, fb_format, fb_type,
depth_bits_array, stencil_bits_array,
unsigned char *RADEONMMIO;
PFNGLXSCRENABLEEXTENSIONPROC glx_enable_extension =
(PFNGLXSCRENABLEEXTENSIONPROC)
- glXGetProcAddress((const GLubyte *) "__glXScrEnableExtension");
+ (*dri_interface->getProcAddress("glxEnableExtension"));
void *const psc = sPriv->psc->screenConfigs;
* \return A pointer to a \c __DRIscreenPrivate on success, or \c NULL on
* failure.
*/
-void *__driCreateNewScreen_20050722(__DRInativeDisplay * dpy, int scrn,
+void *__driCreateNewScreen_20050725(__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, int internal_api_version,
+ const __DRIinterfaceMethods * interface,
__GLcontextModes ** driver_modes)
{
__DRIscreenPrivate *psp;
static const __DRIversion dri_expected = { 4, 0, 0 };
static const __DRIversion drm_expected = { 1, 11, 1 };
+ dri_interface = interface;
+
if (!driCheckDriDdxDrmVersions3("R300",
dri_version, &dri_expected,
ddx_version, &ddx_expected,
frame_buffer, pSAREA, fd,
internal_api_version, &radeonAPI);
if (psp != NULL) {
- create_context_modes = (PFNGLXCREATECONTEXTMODES)
- glXGetProcAddress((const GLubyte *)
- "__glXCreateContextModes");
- if (create_context_modes != NULL) {
- RADEONDRIPtr dri_priv = (RADEONDRIPtr) psp->pDevPriv;
- *driver_modes = radeonFillInModes(dri_priv->bpp,
- (dri_priv->bpp ==
- 16) ? 16 : 24,
- (dri_priv->bpp ==
- 16) ? 0 : 8,
- (dri_priv->backOffset !=
- dri_priv->
- depthOffset));
- }
+ RADEONDRIPtr dri_priv = (RADEONDRIPtr) psp->pDevPriv;
+ *driver_modes = radeonFillInModes(dri_priv->bpp,
+ (dri_priv->bpp ==
+ 16) ? 16 : 24,
+ (dri_priv->bpp ==
+ 16) ? 0 : 8,
+ (dri_priv->backOffset !=
+ dri_priv->depthOffset));
}
return (void *)psp;
};
-static int
-get_ust_nop( int64_t * ust )
-{
- *ust = 1;
- return 0;
-}
-
-
/* Create the device specific context.
*/
GLboolean
rmesa->vblank_flags = (rmesa->radeonScreen->irq != 0)
? driGetDefaultVBlankFlags(&rmesa->optionCache) : VBLANK_FLAG_NO_IRQ;
- rmesa->get_ust = (PFNGLXGETUSTPROC) glXGetProcAddress( (const GLubyte *) "__glXGetUST" );
- if ( rmesa->get_ust == NULL ) {
- rmesa->get_ust = get_ust_nop;
- }
- (*rmesa->get_ust)( & rmesa->swap_ust );
+ (*dri_interface->getUST)( & rmesa->swap_ust );
#if DO_DEBUG
GLuint swap_count;
GLuint swap_missed_count;
- PFNGLXGETUSTPROC get_ust;
/* radeon_tcl.c
*/
UNLOCK_HARDWARE( rmesa );
rmesa->swap_count++;
- (*rmesa->get_ust)( & ust );
+ (*dri_interface->getUST)( & ust );
if ( missed_target ) {
rmesa->swap_missed_count++;
rmesa->swap_missed_ust = ust - rmesa->swap_ust;
driWaitForVBlank( dPriv, & rmesa->vbl_seq, rmesa->vblank_flags, & missed_target );
if ( missed_target ) {
rmesa->swap_missed_count++;
- (void) (*rmesa->get_ust)( & rmesa->swap_missed_ust );
+ (void) (*dri_interface->getUST)( & rmesa->swap_missed_ust );
}
LOCK_HARDWARE( rmesa );
}
rmesa->swap_count++;
- (void) (*rmesa->get_ust)( & rmesa->swap_ust );
+ (void) (*dri_interface->getUST)( & rmesa->swap_ust );
if ( rmesa->sarea->pfCurrentPage == 1 ) {
rmesa->state.color.drawOffset = rmesa->radeonScreen->frontOffset;
#define PCI_CHIP_RS250_4437 0x4437
#endif
-static PFNGLXCREATECONTEXTMODES create_context_modes = NULL;
static int getSwapInfo( __DRIdrawablePrivate *dPriv, __DRIswapInfo * sInfo );
fb_type = GL_UNSIGNED_INT_8_8_8_8_REV;
}
- modes = (*create_context_modes)( num_modes, sizeof( __GLcontextModes ) );
+ modes = (*dri_interface->createContextModes)( num_modes, sizeof( __GLcontextModes ) );
m = modes;
if ( ! driFillInModes( & m, fb_format, fb_type,
depth_bits_array, stencil_bits_array, depth_buffer_factor,
RADEONDRIPtr dri_priv = (RADEONDRIPtr)sPriv->pDevPriv;
unsigned char *RADEONMMIO;
PFNGLXSCRENABLEEXTENSIONPROC glx_enable_extension =
- (PFNGLXSCRENABLEEXTENSIONPROC) glXGetProcAddress( (const GLubyte *) "__glXScrEnableExtension" );
+ (PFNGLXSCRENABLEEXTENSIONPROC) (*dri_interface->getProcAddress("glxEnableExtension"));
void * const psc = sPriv->psc->screenConfigs;
* failure.
*/
PUBLIC
-void * __driCreateNewScreen_20050722( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc,
+void * __driCreateNewScreen_20050725( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc,
const __GLcontextModes * modes,
const __DRIversion * ddx_version,
const __DRIversion * dri_version,
const __DRIframebuffer * frame_buffer,
drmAddress pSAREA, int fd,
int internal_api_version,
+ const __DRIinterfaceMethods * interface,
__GLcontextModes ** driver_modes )
{
static const __DRIversion dri_expected = { 4, 0, 0 };
static const __DRIversion drm_expected = { 1, 3, 0 };
+ dri_interface = interface;
+
if ( ! driCheckDriDdxDrmVersions3( "Radeon",
dri_version, & dri_expected,
ddx_version, & ddx_expected,
frame_buffer, pSAREA, fd,
internal_api_version, &radeonAPI);
if ( psp != NULL ) {
- create_context_modes = (PFNGLXCREATECONTEXTMODES)
- glXGetProcAddress( (const GLubyte *) "__glXCreateContextModes" );
- if ( create_context_modes != NULL ) {
- RADEONDRIPtr dri_priv = (RADEONDRIPtr) psp->pDevPriv;
- *driver_modes = radeonFillInModes( dri_priv->bpp,
- (dri_priv->bpp == 16) ? 16 : 24,
- (dri_priv->bpp == 16) ? 0 : 8,
- (dri_priv->backOffset != dri_priv->depthOffset) );
- }
+ RADEONDRIPtr dri_priv = (RADEONDRIPtr) psp->pDevPriv;
+ *driver_modes = radeonFillInModes( dri_priv->bpp,
+ (dri_priv->bpp == 16) ? 16 : 24,
+ (dri_priv->bpp == 16) ? 0 : 8,
+ (dri_priv->backOffset != dri_priv->depthOffset) );
}
return (void *) psp;
DRI_CONF_END;
static const GLuint __driNConfigOptions = 10;
-static PFNGLXCREATECONTEXTMODES create_context_modes = NULL;
static const struct dri_debug_control debug_control[] =
{
fb_type = GL_UNSIGNED_INT_8_8_8_8_REV;
}
- modes = (*create_context_modes)( num_modes, sizeof( __GLcontextModes ) );
+ modes = (*dri_interface->createContextModes)( num_modes, sizeof( __GLcontextModes ) );
m = modes;
if ( ! driFillInModes( & m, fb_format, fb_type,
depth_bits_array, stencil_bits_array, depth_buffer_factor,
* failure.
*/
PUBLIC
-void * __driCreateNewScreen_20050722( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc,
+void * __driCreateNewScreen_20050725( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc,
const __GLcontextModes * modes,
const __DRIversion * ddx_version,
const __DRIversion * dri_version,
const __DRIframebuffer * frame_buffer,
drmAddress pSAREA, int fd,
int internal_api_version,
+ const __DRIinterfaceMethods * interface,
__GLcontextModes ** driver_modes )
{
static const __DRIversion dri_expected = { 4, 0, 0 };
static const __DRIversion drm_expected = { 2, 1, 0 };
+ dri_interface = interface;
+
if ( ! driCheckDriDdxDrmVersions2( "Savage",
dri_version, & dri_expected,
ddx_version, & ddx_expected,
frame_buffer, pSAREA, fd,
internal_api_version, &savageAPI);
if ( psp != NULL ) {
- create_context_modes = (PFNGLXCREATECONTEXTMODES)
- glXGetProcAddress( (const GLubyte *) "__glXCreateContextModes" );
- if ( create_context_modes != NULL ) {
- SAVAGEDRIPtr dri_priv = (SAVAGEDRIPtr)psp->pDevPriv;
- *driver_modes = savageFillInModes( dri_priv->cpp*8,
- (dri_priv->cpp == 2) ? 16 : 24,
- (dri_priv->cpp == 2) ? 0 : 8,
- (dri_priv->backOffset != dri_priv->depthOffset) );
- }
+ SAVAGEDRIPtr dri_priv = (SAVAGEDRIPtr)psp->pDevPriv;
+ *driver_modes = savageFillInModes( dri_priv->cpp*8,
+ (dri_priv->cpp == 2) ? 16 : 24,
+ (dri_priv->cpp == 2) ? 0 : 8,
+ (dri_priv->backOffset != dri_priv->depthOffset) );
}
return (void *) psp;
DRI_CONF_END;
static const GLuint __driNConfigOptions = 2;
-static PFNGLXCREATECONTEXTMODES create_context_modes = NULL;
static __GLcontextModes *
sisFillInModes(int bpp)
fb_type = GL_UNSIGNED_INT_8_8_8_8_REV;
}
- modes = (*create_context_modes)(num_modes, sizeof(__GLcontextModes));
+ modes = (*dri_interface->createContextModes)(num_modes, sizeof(__GLcontextModes));
m = modes;
if (!driFillInModes(&m, fb_format, fb_type, depth_bits_array,
stencil_bits_array, depth_buffer_factor,
* failure.
*/
PUBLIC
-void * __driCreateNewScreen_20050722( __DRInativeDisplay *dpy, int scrn,
+void * __driCreateNewScreen_20050725( __DRInativeDisplay *dpy, int scrn,
__DRIscreen *psc,
const __GLcontextModes *modes,
const __DRIversion *ddx_version,
const __DRIframebuffer *frame_buffer,
drmAddress pSAREA, int fd,
int internal_api_version,
+ const __DRIinterfaceMethods * interface,
__GLcontextModes **driver_modes )
{
static const __DRIversion dri_expected = {4, 0, 0};
static const __DRIversion drm_expected = {1, 0, 0};
+ dri_interface = interface;
+
if (!driCheckDriDdxDrmVersions2("SiS", dri_version, &dri_expected,
ddx_version, &ddx_expected,
drm_version, &drm_expected)) {
frame_buffer, pSAREA, fd,
internal_api_version, &sisAPI);
if (psp != NULL) {
- create_context_modes = (PFNGLXCREATECONTEXTMODES)
- glXGetProcAddress((const GLubyte *)"__glXCreateContextModes");
- if (create_context_modes != NULL) {
- SISDRIPtr dri_priv = (SISDRIPtr)psp->pDevPriv;
- *driver_modes = sisFillInModes(dri_priv->bytesPerPixel * 8);
- }
+ SISDRIPtr dri_priv = (SISDRIPtr)psp->pDevPriv;
+ *driver_modes = sisFillInModes(dri_priv->bytesPerPixel * 8);
}
return (void *)psp;
.SwapBuffersMSC = NULL
};
-static PFNGLXCREATECONTEXTMODES create_context_modes = NULL;
static __GLcontextModes *tdfxFillInModes(unsigned pixel_bits,
unsigned depth_bits,
num_modes = (depth_bits == 16) ? 32 : 16;
- modes = (*create_context_modes)(num_modes, sizeof(__GLcontextModes));
+ modes = (*dri_interface->createContextModes)(num_modes, sizeof(__GLcontextModes));
m = modes;
for (i = 0; i <= 1; i++) {
* failure.
*/
PUBLIC
-void * __driCreateNewScreen_20050722( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc,
+void * __driCreateNewScreen_20050725( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc,
const __GLcontextModes * modes,
const __DRIversion * ddx_version,
const __DRIversion * dri_version,
const __DRIframebuffer * frame_buffer,
drmAddress pSAREA, int fd,
int internal_api_version,
+ const __DRIinterfaceMethods * interface,
__GLcontextModes ** driver_modes )
{
__DRIscreenPrivate *psp;
static const __DRIversion dri_expected = { 4, 0, 0 };
static const __DRIversion drm_expected = { 1, 0, 0 };
+ dri_interface = interface;
+
if ( ! driCheckDriDdxDrmVersions2( "tdfx",
dri_version, & dri_expected,
ddx_version, & ddx_expected,
frame_buffer, pSAREA, fd,
internal_api_version, &tdfxAPI);
- create_context_modes = (PFNGLXCREATECONTEXTMODES)
- glXGetProcAddress((const GLubyte *)"__glXCreateContextModes");
-
- if (create_context_modes != NULL) {
+ if (psp != NULL) {
/* divined from tdfx_dri.c, sketchy */
TDFXDRIPtr dri_priv = (TDFXDRIPtr) psp->pDevPriv;
int bpp = (dri_priv->cpp > 2) ? 24 : 16;
TRIDENTDRIPtr tDRIPriv = (TRIDENTDRIPtr)sPriv->pDevPriv;
tridentScreenPtr tridentScreen;
-#if 0
- /* Check the DRI version */
- {
- int major, minor, patch;
- if ( XF86DRIQueryVersion( sPriv->display, &major, &minor, &patch ) ) {
- if ( major != 3 || minor != 1 || patch < 0 ) {
- __driUtilMessage( "r128 DRI driver expected DRI version 3.1.x but got version %d.%d.%d", major, minor, patch );
- return GL_FALSE;
- }
- }
- }
-
- /* Check that the DDX driver version is compatible */
- if ( sPriv->ddxMajor != 4 ||
- sPriv->ddxMinor != 0 ||
- sPriv->ddxPatch < 0 ) {
- __driUtilMessage( "r128 DRI driver expected DDX driver version 4.0.x but got version %d.%d.%d", sPriv->ddxMajor, sPriv->ddxMinor, sPriv->ddxPatch );
- return GL_FALSE;
- }
-
- /* Check that the DRM driver version is compatible */
- if ( sPriv->drmMajor != 2 ||
- sPriv->drmMinor != 1 ||
- sPriv->drmPatch < 0 ) {
- __driUtilMessage( "r128 DRI driver expected DRM driver version 2.1.x but got version %d.%d.%d", sPriv->drmMajor, sPriv->drmMinor, sPriv->drmPatch );
- return GL_FALSE;
- }
-#endif
/* Allocate the private area */
tridentScreen = (tridentScreenPtr) CALLOC( sizeof(*tridentScreen) );
tridentUnbindContext,
};
-static PFNGLXCREATECONTEXTMODES create_context_modes = NULL;
-PUBLIC void *__driCreateNewScreen_20050722( __DRInativeDisplay *dpy, int scrn,
+PUBLIC void *__driCreateNewScreen_20050725( __DRInativeDisplay *dpy, int scrn,
__DRIscreen *psc,
const __GLcontextModes * modes,
const __DRIversion * ddx_version,
const __DRIframebuffer * frame_buffer,
drmAddress pSAREA, int fd,
int internal_api_version,
+ const __DRIinterfaceMethods * interface,
__GLcontextModes ** driver_modes )
{
__DRIscreenPrivate *psp;
- /* XXX version checks */
+ static const __DRIversion ddx_expected = { 4, 0, 0 };
+ static const __DRIversion dri_expected = { 3, 1, 0 };
+ static const __DRIversion drm_expected = { 1, 0, 0 };
+
+ dri_interface = interface;
+
+ if ( ! driCheckDriDdxDrmVersions2( "Trident",
+ dri_version, & dri_expected,
+ ddx_version, & ddx_expected,
+ drm_version, & drm_expected ) ) {
+ return NULL;
+ }
psp = __driUtilCreateNewScreen(dpy, scrn, psc, NULL,
ddx_version, dri_version, drm_version,
internal_api_version, &tridentAPI);
if ( psp != NULL ) {
- create_context_modes = (PFNGLXCREATECONTEXTMODES)
- glXGetProcAddress( (const GLubyte *) "__glXCreateContextModes" );
#if 0
- if ( create_context_modes != NULL ) {
- TRIDENTDRIPtr dri_priv = (TRIDENTDRIPtr) psp->pDevPriv;
- *driver_modes = tridentFillInModes( dri_priv->bytesPerPixel * 8,
- GL_TRUE );
- }
+ TRIDENTDRIPtr dri_priv = (TRIDENTDRIPtr) psp->pDevPriv;
+ *driver_modes = tridentFillInModes( dri_priv->bytesPerPixel * 8,
+ GL_TRUE );
#endif
}
return (void *) psp;
via_free_dma_buffer(vmesa);
}
-static int
-get_ust_nop( int64_t * ust )
-{
- *ust = 1;
- return 0;
-}
GLboolean
viaCreateContext(const __GLcontextModes *visual,
if (getenv("VIA_PAGEFLIP"))
vmesa->allowPageFlip = 1;
-
- vmesa->get_ust =
- (PFNGLXGETUSTPROC) glXGetProcAddress( (const GLubyte *) "__glXGetUST" );
- if ( vmesa->get_ust == NULL ) {
- vmesa->get_ust = get_ust_nop;
- }
- vmesa->get_ust( &vmesa->swap_ust );
+
+ (*dri_interface->getUST)( &vmesa->swap_ust );
vmesa->regMMIOBase = (GLuint *)((GLuint)viaScreen->reg);
GLuint swap_count;
GLuint swap_missed_count;
- PFNGLXGETUSTPROC get_ust;
GLuint pfCurrentOffset;
GLboolean allowPageFlip;
vmesa->vblank_flags, & missed_target );
if ( missed_target ) {
vmesa->swap_missed_count++;
- vmesa->get_ust( &vmesa->swap_missed_ust );
+ (*dri_interface->getUST)( &vmesa->swap_missed_ust );
}
}
while (!viaCheckBreadcrumb(vmesa, value));
viaEmitBreadcrumbLocked(vmesa);
UNLOCK_HARDWARE(vmesa);
- vmesa->get_ust( &vmesa->swap_ust );
+ (*dri_interface->getUST)( &vmesa->swap_ust );
}
viaEmitBreadcrumbLocked(vmesa);
UNLOCK_HARDWARE(vmesa);
- vmesa->get_ust( &vmesa->swap_ust );
+ (*dri_interface->getUST)( &vmesa->swap_ust );
/* KW: FIXME: When buffers are freed, could free frontbuffer by
static const GLuint __driNConfigOptions = 3;
-static PFNGLXCREATECONTEXTMODES create_context_modes = NULL;
-
static int getSwapInfo( __DRIdrawablePrivate *dPriv, __DRIswapInfo * sInfo );
static drmBufMapPtr via_create_empty_buffers(void)
viaScreenPrivate *viaScreen;
VIADRIPtr gDRIPriv = (VIADRIPtr)sPriv->pDevPriv;
PFNGLXSCRENABLEEXTENSIONPROC glx_enable_extension =
- (PFNGLXSCRENABLEEXTENSIONPROC) glXGetProcAddress(
- (const GLubyte *) "__glXScrEnableExtension" );
+ (PFNGLXSCRENABLEEXTENSIONPROC) (*dri_interface->getProcAddress("glxEnableExtension"));
void * const psc = sPriv->psc->screenConfigs;
fb_type = GL_UNSIGNED_INT_8_8_8_8_REV;
}
- modes = (*create_context_modes)( num_modes, sizeof( __GLcontextModes ) );
+ modes = (*dri_interface->createContextModes)( num_modes, sizeof( __GLcontextModes ) );
m = modes;
if ( ! driFillInModes( & m, fb_format, fb_type,
depth_bits_array, stencil_bits_array,
* failure.
*/
PUBLIC
-void * __driCreateNewScreen_20050722( __DRInativeDisplay *dpy, int scrn,
+void * __driCreateNewScreen_20050725( __DRInativeDisplay *dpy, int scrn,
__DRIscreen *psc,
const __GLcontextModes * modes,
const __DRIversion * ddx_version,
const __DRIframebuffer * frame_buffer,
drmAddress pSAREA, int fd,
int internal_api_version,
+ const __DRIinterfaceMethods * interface,
__GLcontextModes ** driver_modes )
{
static const __DRIversion dri_expected = { 4, 0, 0 };
static const __DRIversion drm_expected = { 2, 3, 0 };
+ dri_interface = interface;
+
if ( ! driCheckDriDdxDrmVersions2( "Unichrome",
dri_version, & dri_expected,
ddx_version, & ddx_expected,
frame_buffer, pSAREA, fd,
internal_api_version, &viaAPI);
if ( psp != NULL ) {
- create_context_modes = (PFNGLXCREATECONTEXTMODES)
- glXGetProcAddress( (const GLubyte *) "__glXCreateContextModes" );
- if ( create_context_modes != NULL ) {
- VIADRIPtr dri_priv = (VIADRIPtr) psp->pDevPriv;
- *driver_modes = viaFillInModes( dri_priv->bytesPerPixel * 8,
- GL_TRUE );
- }
+ VIADRIPtr dri_priv = (VIADRIPtr) psp->pDevPriv;
+ *driver_modes = viaFillInModes( dri_priv->bytesPerPixel * 8,
+ GL_TRUE );
}
fprintf(stderr, "%s - succeeded\n", __FUNCTION__);