err_msg = "InitDriver";
err_extra = NULL;
psp = (*createNewScreen)(scrn,
- &psc->driScreen,
+ &psc->__driScreen,
& ddx_version,
& dri_version,
& drm_version,
drm_context_t hwContext;
__DRIcontext *shared;
- if (psc && psc->driScreen.private) {
+ if (psc && psc->driScreen) {
shared = (shareList != NULL) ? &shareList->driContext : NULL;
if (!XF86DRICreateContextWithConfig(psc->dpy, psc->scr,
return;
gc->driContext.private =
- (*psc->driScreen.createNewContext)( &psc->driScreen,
- mode, renderType,
- shared,
- hwContext,
- &gc->driContext );
+ (*psc->__driScreen.createNewContext)( &psc->__driScreen,
+ mode, renderType,
+ shared,
+ hwContext,
+ &gc->driContext );
if (gc->driContext.private) {
gc->isDirect = GL_TRUE;
gc->screen = mode->screen;
static void driDestroyScreen(__GLXscreenConfigs *psc)
{
/* Free the direct rendering per screen data */
- if (psc->driScreen.private)
- (*psc->driScreen.destroyScreen)(&psc->driScreen);
- psc->driScreen.private = NULL;
+ if (psc->__driScreen.private)
+ (*psc->__driScreen.destroyScreen)(&psc->__driScreen);
+ psc->__driScreen.private = NULL;
if (psc->drawHash)
__glxHashDestroy(psc->drawHash);
if (psc->driver)
dlclose(psc->driver);
}
-static void driCreateScreen(__GLXscreenConfigs *psc, int screen,
- __GLXdisplayPrivate *priv)
+static __GLXDRIscreen *driCreateScreen(__GLXscreenConfigs *psc, int screen,
+ __GLXdisplayPrivate *priv)
{
PFNCREATENEWSCREENFUNC createNewScreen;
__GLXDRIdisplayPrivate *pdp;
+ __GLXDRIscreen *psp;
- if (priv->driDisplay == NULL)
- return;
+ psp = Xmalloc(sizeof *psp);
+ if (psp == NULL)
+ return NULL;
/* Create drawable hash */
psc->drawHash = __glxHashCreate();
if ( psc->drawHash == NULL )
- return;
+ return NULL;
/* Initialize per screen dynamic client GLX extensions */
psc->ext_list_first_time = GL_TRUE;
psc->driver = driGetDriver(priv->dpy, screen);
createNewScreen = dlsym(psc->driver, createNewScreenName);
if (createNewScreenName == NULL)
- return;
+ return NULL;
pdp = (__GLXDRIdisplayPrivate *) priv->driDisplay;
- psc->driScreen.private =
+ psc->__driScreen.private =
CallCreateNewScreen(psc->dpy, screen, psc, pdp, createNewScreen);
- if (psc->driScreen.private != NULL)
+ if (psc->__driScreen.private != NULL)
__glXScrEnableDRIExtension(psc);
- psc->driDestroyScreen = driDestroyScreen;
- psc->driCreateContext = driCreateContext;
+ psp->destroyScreen = driDestroyScreen;
+ psp->createContext = driCreateContext;
+
+ return psp;
}
/* Called from __glXFreeDisplayPrivate.
* \c driCreateDisplay call.
*/
typedef struct __GLXDRIdisplayRec __GLXDRIdisplay;
+typedef struct __GLXDRIscreenRec __GLXDRIscreen;
+
struct __GLXDRIdisplayRec {
/**
* Method to destroy the private DRI display data.
*/
void (*destroyDisplay)(__GLXDRIdisplay *display);
- void (*createScreen)(__GLXscreenConfigs *psc, int screen,
- __GLXdisplayPrivate *priv);
+ __GLXDRIscreen *(*createScreen)(__GLXscreenConfigs *psc, int screen,
+ __GLXdisplayPrivate *priv);
+};
+
+struct __GLXDRIscreenRec {
+
+ void (*destroyScreen)(__GLXscreenConfigs *psc);
+
+ void (*createContext)(__GLXscreenConfigs *psc,
+ const __GLcontextModes *mode,
+ GLXContext gc, GLXContext shareList, int renderType);
};
/*
/**
* Per screen direct rendering interface functions and data.
*/
- __DRIscreen driScreen;
+ __DRIscreen __driScreen;
__glxHashTable *drawHash;
Display *dpy;
int scr;
void *driver;
- void (*driDestroyScreen)(__GLXscreenConfigs *psc);
-
- void (*driCreateContext)(__GLXscreenConfigs *psc,
- const __GLcontextModes *mode,
- GLXContext gc,
- GLXContext shareList, int renderType);
+ __GLXDRIscreen *driScreen;
#ifdef __DRI_COPY_SUB_BUFFER
__DRIcopySubBufferExtension *copySubBuffer;
mode = fbconfig;
}
- psc->driCreateContext(psc, mode, gc, shareList, renderType);
+ psc->driScreen->createContext(psc, mode, gc, shareList, renderType);
}
#endif
__glXCalculateUsableExtensions(psc,
#ifdef GLX_DIRECT_RENDERING
- (psc->driScreen.private != NULL),
+ (psc->driScreen != NULL),
#else
GL_FALSE,
#endif
__GLXscreenConfigs * const psc = GetGLXScreenConfigs( gc->currentDpy,
gc->screen );
- if ( (psc != NULL) && (psc->driScreen.private != NULL) ) {
+ if ( (psc != NULL) && (psc->driScreen != NULL) ) {
__DRIdrawable * const pdraw =
GetDRIDrawable(gc->currentDpy, gc->currentDrawable, NULL);
if (psc->swapControl != NULL && pdraw != NULL) {
__GLXscreenConfigs * const psc = GetGLXScreenConfigs( gc->currentDpy,
gc->screen );
- if ( (psc != NULL) && (psc->driScreen.private != NULL) ) {
+ if ( (psc != NULL) && (psc->driScreen != NULL) ) {
__DRIdrawable * const pdraw =
GetDRIDrawable(gc->currentDpy, gc->currentDrawable, NULL);
if (psc->swapControl != NULL && pdraw != NULL) {
if ( (gc != NULL) && gc->isDirect ) {
__GLXscreenConfigs * const psc = GetGLXScreenConfigs( gc->currentDpy,
gc->screen );
- if ( psc->msc && psc->driScreen.private ) {
+ if ( psc->msc && psc->driScreen ) {
__DRIdrawable * const pdraw =
GetDRIDrawable(gc->currentDpy, gc->currentDrawable, NULL);
int64_t temp;
int ret;
- ret = (*psc->msc->getDrawableMSC)(&psc->driScreen, pdraw, &temp);
+ ret = (*psc->msc->getDrawableMSC)(&psc->__driScreen, pdraw, &temp);
*count = (unsigned) temp;
return (ret == 0) ? 0 : GLX_BAD_CONTEXT;
if ( (gc != NULL) && gc->isDirect ) {
__GLXscreenConfigs * const psc = GetGLXScreenConfigs( gc->currentDpy,
gc->screen );
- if (psc->msc != NULL && psc->driScreen.private ) {
+ if (psc->msc != NULL && psc->driScreen ) {
__DRIdrawable * const pdraw =
GetDRIDrawable(gc->currentDpy, gc->currentDrawable, NULL);
int ret;
__GLXscreenConfigs * const psc = GetGLXScreenConfigs( dpy, scrn );
if (psc && psc->allocate)
- return (*psc->allocate->allocateMemory)( &psc->driScreen, size,
+ return (*psc->allocate->allocateMemory)( &psc->__driScreen, size,
readFreq, writeFreq,
priority );
__GLXscreenConfigs * const psc = GetGLXScreenConfigs( dpy, scrn );
if (psc && psc->allocate)
- (*psc->allocate->freeMemory)( &psc->driScreen, pointer );
+ (*psc->allocate->freeMemory)( &psc->__driScreen, pointer );
#else
(void) dpy;
__GLXscreenConfigs * const psc = GetGLXScreenConfigs( dpy, scrn );
if (psc && psc->allocate)
- return (*psc->allocate->memoryOffset)( &psc->driScreen, pointer );
+ return (*psc->allocate->memoryOffset)( &psc->__driScreen, pointer );
#else
(void) dpy;
Xfree((char*) psc->serverGLXexts);
#ifdef GLX_DIRECT_RENDERING
- psc->driDestroyScreen(psc);
+ psc->driScreen->destroyScreen(psc);
#endif
}
XFree((char*) priv->screenConfigs);
psc->scr = i;
psc->dpy = dpy;
#ifdef GLX_DIRECT_RENDERING
- (*priv->driDisplay->createScreen)(psc, i, priv);
+ psc->driScreen = (*priv->driDisplay->createScreen)(psc, i, priv);
#endif
}
SyncHandle();
/* Create a new drawable */
pdraw->driDrawable.private =
- (*sc->driScreen.createNewDrawable)(&sc->driScreen,
- gc->mode,
- &pdraw->driDrawable,
- hwDrawable,
- GLX_WINDOW_BIT,
- empty_attribute_list);
+ (*sc->__driScreen.createNewDrawable)(&sc->__driScreen,
+ gc->mode,
+ &pdraw->driDrawable,
+ hwDrawable,
+ GLX_WINDOW_BIT,
+ empty_attribute_list);
if (!pdraw->driDrawable.private) {
XF86DRIDestroyDrawable(dpy, sc->scr, drawable);
__glXExtensionsCtr();
__glXExtensionsCtrScreen(psc);
- extensions = psc->driScreen.getExtensions(&psc->driScreen);
+ extensions = psc->__driScreen.getExtensions(&psc->__driScreen);
for (i = 0; extensions[i]; i++) {
#ifdef __DRI_COPY_SUB_BUFFER
if (strcmp(extensions[i]->name, __DRI_COPY_SUB_BUFFER) == 0) {