typedef struct __DRIversionRec __DRIversion;
typedef struct __DRIinterfaceMethodsRec __DRIinterfaceMethods;
typedef unsigned long __DRIid;
-typedef void __DRInativeDisplay;
/*@}*/
*
* \sa glXGetScreenDriver, glXGetProcAddress, glXGetDriverConfig
*/
-typedef const char * (* PFNGLXGETSCREENDRIVERPROC) (__DRInativeDisplay *dpy, int scrNum);
+typedef const char * (* PFNGLXGETSCREENDRIVERPROC) (__DRIscreen *screen);
/**
* Type of a pointer to \c glXGetDriverConfig, as returned by
#define __DRI_INTERFACE_VERSION 20070105
-typedef void *(CREATENEWSCREENFUNC)(__DRInativeDisplay *dpy, int scrn,
- __DRIscreen *psc, const __GLcontextModes * modes,
+typedef void *(CREATENEWSCREENFUNC)(int scr, __DRIscreen *psc,
+ const __GLcontextModes * modes,
const __DRIversion * ddx_version, const __DRIversion * dri_version,
const __DRIversion * drm_version, const __DRIframebuffer * frame_buffer,
void * pSAREA, int fd, int internal_api_version,
*/
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.
/**
* Create the server-side portion of the GL context.
*/
- GLboolean (* createContext)( __DRInativeDisplay *dpy, int screenNum,
+ GLboolean (* createContext)( __DRIscreen *screen,
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 );
+ GLboolean (* destroyContext)( __DRIscreen *screen, __DRIid context );
/**
* Create the server-side portion of the drawable.
*/
- GLboolean (*createDrawable)( __DRInativeDisplay * ndpy, int screen,
+ GLboolean (*createDrawable)( __DRIscreen *screen,
__DRIid drawable, drm_drawable_t * hHWDrawable );
/**
* Destroy the server-side portion of the drawable.
*/
- GLboolean (*destroyDrawable)( __DRInativeDisplay * ndpy, int screen,
- __DRIid drawable );
+ GLboolean (*destroyDrawable)( __DRIscreen *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,
+ GLboolean (* getDrawableInfo) ( __DRIscreen *screen, __DRIid drawable,
+ 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,
* 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);
+ GLboolean (*getMSCRate)(__DRIdrawable *draw,
+ int32_t * numerator, int32_t * denominator);
/*@}*/
/**
* drawable was actually done directly to the front buffer (instead
* of backing storage, for example)
*/
- void (*reportDamage)(__DRInativeDisplay * dpy, int screen,
- __DRIid drawable,
+ void (*reportDamage)(__DRIdrawable *draw,
int x, int y,
drm_clip_rect_t *rects, int num_rects,
- int front_buffer);
+ GLboolean front_buffer);
};
/**
* Method to destroy the private DRI screen data.
*/
- void (*destroyScreen)(__DRInativeDisplay *dpy, int scrn, void *screenPrivate);
+ void (*destroyScreen)(void *screenPrivate);
/**
* Method to create the private DRI drawable data and initialize the
* drawable dependent methods.
*/
- void *(*createNewDrawable)(__DRInativeDisplay *dpy, const __GLcontextModes *modes,
+ void *(*createNewDrawable)(__DRIscreen *screen,
+ const __GLcontextModes *modes,
__DRIid draw, __DRIdrawable *pdraw,
int renderType, const int *attrs);
* \since Internal API version 20030815.
*/
/*@{*/
- void *(*allocateMemory)(__DRInativeDisplay *dpy, int scrn, GLsizei size,
+ void *(*allocateMemory)(__DRIscreen *screen, GLsizei size,
GLfloat readfreq, GLfloat writefreq,
GLfloat priority);
- void (*freeMemory)(__DRInativeDisplay *dpy, int scrn, GLvoid *pointer);
+ void (*freeMemory)(__DRIscreen *screen, GLvoid *pointer);
- GLuint (*memoryOffset)(__DRInativeDisplay *dpy, int scrn, const GLvoid *pointer);
+ GLuint (*memoryOffset)(__DRIscreen *screen, const GLvoid *pointer);
/*@}*/
/**
*
* \since Internal API version 20031201.
*/
- void * (*createNewContext)(__DRInativeDisplay *dpy, const __GLcontextModes *modes,
+ void * (*createNewContext)(__DRIscreen *screen,
+ const __GLcontextModes *modes,
int render_type,
void *sharedPrivate, __DRIcontext *pctx);
/**
* Method to destroy the private DRI context data.
*/
- void (*destroyContext)(__DRInativeDisplay *dpy, int scrn, void *contextPrivate);
+ void (*destroyContext)(void *contextPrivate);
/**
* Opaque pointer to private per context direct rendering data.
*
* \since Internal API version 20050727.
*/
- GLboolean (*bindContext)(__DRInativeDisplay *dpy, int scrn,
- __DRIdrawable *pdraw,
+ GLboolean (*bindContext)(__DRIdrawable *pdraw,
__DRIdrawable *pread,
__DRIcontext *ctx);
*
* \since Internal API version 20050727.
*/
- GLboolean (*unbindContext)(__DRInativeDisplay *dpy, int scrn,
- __DRIcontext *ctx);
+ GLboolean (*unbindContext)(__DRIcontext *ctx);
};
/**
/**
* Method to destroy the private DRI drawable data.
*/
- void (*destroyDrawable)(__DRInativeDisplay *dpy, void *drawablePrivate);
+ void (*destroyDrawable)(void *drawablePrivate);
/**
* Method to swap the front and back buffers.
*/
- void (*swapBuffers)(__DRInativeDisplay *dpy, void *drawablePrivate);
+ void (*swapBuffers)(void *drawablePrivate);
/**
* Opaque pointer to private per drawable direct rendering data.
*
* \since Internal API version 20030317.
*/
- int (*getSBC)(__DRInativeDisplay *dpy, void *drawablePrivate, int64_t *sbc );
+ int (*getSBC)(void *drawablePrivate, int64_t *sbc );
/**
* Wait for the SBC to be greater than or equal target_sbc.
*
* \since Internal API version 20030317.
*/
- int (*waitForSBC)( __DRInativeDisplay * dpy, void *drawablePriv,
+ int (*waitForSBC)( void *drawablePriv,
int64_t target_sbc,
int64_t * msc, int64_t * sbc );
*
* \since Internal API version 20030317.
*/
- int (*waitForMSC)( __DRInativeDisplay * dpy, void *drawablePriv,
+ int (*waitForMSC)( void *drawablePriv,
int64_t target_msc, int64_t divisor, int64_t remainder,
int64_t * msc, int64_t * sbc );
*
* \since Internal API version 20030317.
*/
- int64_t (*swapBuffersMSC)(__DRInativeDisplay *dpy, void *drawablePrivate,
+ int64_t (*swapBuffersMSC)(void *drawablePrivate,
int64_t target_msc,
int64_t divisor, int64_t remainder);
*
* \since Internal API version 20030317.
*/
- int (*frameTracking)(__DRInativeDisplay *dpy, void *drawablePrivate, GLboolean enable);
+ int (*frameTracking)(void *drawablePrivate, GLboolean enable);
/**
* Retrieve frame usage information.
*
* \since Internal API version 20030317.
*/
- int (*queryFrameTracking)(__DRInativeDisplay *dpy, void *drawablePrivate,
+ int (*queryFrameTracking)(void *drawablePrivate,
int64_t * sbc, int64_t * missedFrames,
float * lastMissedUsage, float * usage );
*
* \since Internal API version 20060314.
*/
- void (*copySubBuffer)(__DRInativeDisplay *dpy, void *drawablePrivate,
+ void (*copySubBuffer)(void *drawablePrivate,
int x, int y, int w, int h);
};
context, hHWContext );
}
-PUBLIC GLboolean XF86DRIDestroyContext( __DRInativeDisplay * ndpy, int screen,
+PUBLIC GLboolean XF86DRIDestroyContext(Display *dpy, int screen,
__DRIid context )
{
- Display * const dpy = (Display *) ndpy;
XExtDisplayInfo *info = find_display (dpy);
xXF86DRIDestroyContextReq *req;
return True;
}
-PUBLIC GLboolean XF86DRICreateDrawable( __DRInativeDisplay * ndpy, int screen,
+PUBLIC GLboolean XF86DRICreateDrawable(Display *dpy, int screen,
__DRIid drawable, drm_drawable_t * hHWDrawable )
{
- Display * const dpy = (Display *) ndpy;
XExtDisplayInfo *info = find_display (dpy);
xXF86DRICreateDrawableReply rep;
xXF86DRICreateDrawableReq *req;
return 0;
}
-PUBLIC GLboolean XF86DRIDestroyDrawable( __DRInativeDisplay * ndpy, int screen,
+PUBLIC GLboolean XF86DRIDestroyDrawable(Display *dpy, int screen,
__DRIid drawable )
{
- Display * const dpy = (Display *) ndpy;
XExtDisplayInfo *info = find_display (dpy);
xXF86DRIDestroyDrawableReq *req;
int (*oldXErrorHandler)(Display *, XErrorEvent *);
#define __GLX_MAX_TEXTURE_UNITS 32
+typedef struct __GLXscreenConfigsRec __GLXscreenConfigs;
typedef struct __GLXcontextRec __GLXcontext;
+typedef struct __GLXdrawableRec __GLXdrawable;
typedef struct __GLXdisplayPrivateRec __GLXdisplayPrivate;
typedef struct _glapi_table __GLapi;
#ifdef GLX_DIRECT_RENDERING
+#define containerOf(ptr, type, member) \
+ (type *)( (char *)ptr - offsetof(type,member) )
+
#include <GL/internal/dri_interface.h>
* Screen number.
*/
GLint screen;
+ __GLXscreenConfigs *psc;
/**
* \c GL_TRUE if the context was created with ImportContext, which
* One of these records exists per screen of the display. It contains
* a pointer to the config data for that screen (if the screen supports GL).
*/
-typedef struct __GLXscreenConfigsRec {
+struct __GLXscreenConfigsRec {
/**
* GLX extension string reported by the X-server.
*/
*/
__DRIscreen driScreen;
__glxHashTable *drawHash;
+ Display *dpy;
+ int scr;
#endif
/**
GLboolean ext_list_first_time;
/*@}*/
-} __GLXscreenConfigs;
+};
/**
* Per display private data. One of these records exists for each display
#endif
};
+#ifdef GLX_DIRECT_RENDERING
+
+struct __GLXdrawableRec {
+ XID drawable;
+ __GLXscreenConfigs *psc;
+ __DRIdrawable driDrawable;
+};
+
+#endif
+
+
+
void __glXFreeContext(__GLXcontext*);
extern GLubyte *__glXFlushRenderBuffer(__GLXcontext*, GLubyte*);
/* Get the unadjusted system time */
extern int __glXGetUST( int64_t * ust );
-extern Bool __glXGetMscRateOML(Display * dpy, GLXDrawable drawable,
- int32_t * numerator, int32_t * denominator);
+extern GLboolean __glXGetMscRateOML(__DRIdrawable *draw,
+ int32_t * numerator, int32_t * denominator);
#endif /* !__GLX_client_h__ */
if (!windowExistsFlag) {
/* Destroy the local drawable data, if the drawable no
longer exists in the Xserver */
- (*pdraw->destroyDrawable)(dpy, pdraw->private);
+ (*pdraw->destroyDrawable)(pdraw->private);
Xfree(pdraw);
}
} while (__glxHashNext(sc->drawHash, &draw, (void *)&pdraw) == 1);
GetDRIDrawable( Display *dpy, GLXDrawable drawable, int * const scrn_num )
{
__GLXdisplayPrivate * const priv = __glXInitialize(dpy);
- __DRIdrawable * const pdraw;
+ __GLXdrawable * const pdraw;
const unsigned screen_count = ScreenCount(dpy);
unsigned i;
__GLXscreenConfigs *sc;
if (__glxHashLookup(sc->drawHash, drawable, (void *) &pdraw) == 0) {
if (scrn_num != NULL)
*scrn_num = i;
- return pdraw;
+ return &pdraw->driDrawable;
}
}
void * const shared = (shareList != NULL)
? shareList->driContext.private : NULL;
gc->driContext.private =
- (*psc->driScreen.createNewContext)( dpy, mode, renderType,
+ (*psc->driScreen.createNewContext)( &psc->driScreen,
+ mode, renderType,
shared,
&gc->driContext );
if (gc->driContext.private) {
gc->isDirect = GL_TRUE;
gc->screen = mode->screen;
+ gc->psc = psc;
gc->vid = mode->visualID;
gc->fbconfigID = mode->fbconfigID;
gc->mode = mode;
/* Destroy the direct rendering context */
if (gc->isDirect) {
if (gc->driContext.private) {
- (*gc->driContext.destroyContext)(dpy, gc->screen,
- gc->driContext.private);
+ (*gc->driContext.destroyContext)(gc->driContext.private);
gc->driContext.private = NULL;
}
GarbageCollectDRIDrawables(dpy, gc->screen);
__DRIdrawable *pdraw = GetDRIDrawable( dpy, drawable, NULL );
if ( pdraw != NULL ) {
- (*pdraw->swapBuffers)(dpy, pdraw->private);
+ (*pdraw->swapBuffers)(pdraw->private);
return;
}
#endif
if ( (pdraw != NULL) && (pdraw->frameTracking != NULL)
&& __glXExtensionBitIsEnabled( psc, MESA_swap_frame_usage_bit ) ) {
- status = pdraw->frameTracking( dpy, pdraw->private, GL_TRUE );
+ status = pdraw->frameTracking( pdraw->private, GL_TRUE );
}
#else
(void) dpy;
if ( (pdraw != NULL) && (pdraw->frameTracking != NULL)
&& __glXExtensionBitIsEnabled( psc, MESA_swap_frame_usage_bit ) ) {
- status = pdraw->frameTracking( dpy, pdraw->private, GL_FALSE );
+ status = pdraw->frameTracking( pdraw->private, GL_FALSE );
}
#else
(void) dpy;
int64_t sbc, missedFrames;
float lastMissedUsage;
- status = pdraw->queryFrameTracking( dpy, pdraw->private, &sbc,
+ status = pdraw->queryFrameTracking( pdraw->private, &sbc,
&missedFrames, &lastMissedUsage,
usage );
}
&& __glXExtensionBitIsEnabled( psc, MESA_swap_frame_usage_bit ) ) {
float usage;
- status = pdraw->queryFrameTracking( dpy, pdraw->private, sbc,
+ status = pdraw->queryFrameTracking( pdraw->private, sbc,
missedFrames, lastMissedUsage,
& usage );
}
int64_t msc;
int64_t sbc;
- ret = (*pdraw->waitForMSC)( gc->currentDpy, pdraw->private,
+ ret = (*pdraw->waitForMSC)( pdraw->private,
0, divisor, remainder,
& msc, & sbc );
*count = (unsigned) msc;
return ( (pdraw && pdraw->getSBC && psc->driScreen.getMSC)
&& __glXExtensionBitIsEnabled( psc, OML_sync_control_bit )
&& ((*psc->driScreen.getMSC)( psc->driScreen.private, msc ) == 0)
- && ((*pdraw->getSBC)( dpy, psc->driScreen.private, sbc ) == 0)
+ && ((*pdraw->getSBC)( psc->driScreen.private, sbc ) == 0)
&& (__glXGetUST( ust ) == 0) );
}
#else
* when GLX_OML_sync_control appears in the client extension string.
*/
-Bool __glXGetMscRateOML(Display * dpy, GLXDrawable drawable,
- int32_t * numerator, int32_t * denominator)
+GLboolean __glXGetMscRateOML(__DRIdrawable *draw,
+ int32_t * numerator, int32_t * denominator)
{
#if defined( GLX_DIRECT_RENDERING ) && defined( XF86VIDMODE )
+ __GLXdrawable *glxDraw =
+ containerOf(draw, __GLXdrawable, driDrawable);
+ __GLXscreenConfigs *psc = glxDraw->psc;
+ Display *dpy = psc->dpy;
__GLXdisplayPrivate * const priv = __glXInitialize(dpy);
if ( priv != NULL ) {
XF86VidModeModeLine mode_line;
int dot_clock;
- int screen_num;
int i;
- if (GetDRIDrawable( dpy, drawable, & screen_num) != NULL
- && XF86VidModeQueryVersion( dpy, & i, & i )
- && XF86VidModeGetModeLine( dpy, screen_num, & dot_clock,
- & mode_line ) ) {
+ if (XF86VidModeQueryVersion( dpy, & i, & i ) &&
+ XF86VidModeGetModeLine(dpy, psc->scr, &dot_clock, &mode_line) ) {
unsigned n = dot_clock * 1000;
unsigned d = mode_line.vtotal * mode_line.htotal;
*numerator = n;
*denominator = d;
- (void) drawable;
return True;
}
}
#else
- (void) dpy;
- (void) drawable;
+ (void) draw;
(void) numerator;
(void) denominator;
#endif
if ( (pdraw != NULL) && (pdraw->swapBuffersMSC != NULL)
&& __glXExtensionBitIsEnabled( psc, OML_sync_control_bit ) ) {
- return (*pdraw->swapBuffersMSC)(dpy, pdraw->private, target_msc,
+ return (*pdraw->swapBuffersMSC)(pdraw->private, target_msc,
divisor, remainder);
}
#else
if ( (pdraw != NULL) && (pdraw->waitForMSC != NULL)
&& __glXExtensionBitIsEnabled( psc, OML_sync_control_bit ) ) {
- ret = (*pdraw->waitForMSC)( dpy, pdraw->private, target_msc,
+ ret = (*pdraw->waitForMSC)( pdraw->private, target_msc,
divisor, remainder, msc, sbc );
/* __glXGetUST returns zero on success and non-zero on failure.
if ( (pdraw != NULL) && (pdraw->waitForSBC != NULL)
&& __glXExtensionBitIsEnabled( psc, OML_sync_control_bit )) {
- ret = (*pdraw->waitForSBC)( dpy, pdraw->private, target_sbc, msc, sbc );
+ ret = (*pdraw->waitForSBC)( pdraw->private, target_sbc, msc, sbc );
/* __glXGetUST returns zero on success and non-zero on failure.
* This function returns True on success and False on failure.
if ( __glXExtensionBitIsEnabled( psc, MESA_allocate_memory_bit ) ) {
if (psc && psc->driScreen.private && psc->driScreen.allocateMemory) {
- return (*psc->driScreen.allocateMemory)( dpy, scrn, size,
+ return (*psc->driScreen.allocateMemory)( &psc->driScreen, size,
readFreq, writeFreq,
priority );
}
if ( __glXExtensionBitIsEnabled( psc, MESA_allocate_memory_bit ) ) {
if (psc && psc->driScreen.private && psc->driScreen.freeMemory) {
- (*psc->driScreen.freeMemory)( dpy, scrn, pointer );
+ (*psc->driScreen.freeMemory)( &psc->driScreen, pointer );
}
}
#else
if ( __glXExtensionBitIsEnabled( psc, MESA_allocate_memory_bit ) ) {
if (psc && psc->driScreen.private && psc->driScreen.memoryOffset) {
- return (*psc->driScreen.memoryOffset)( dpy, scrn, pointer );
+ return (*psc->driScreen.memoryOffset)( &psc->driScreen, pointer );
}
}
#else
if ( pdraw != NULL ) {
__GLXscreenConfigs * const psc = GetGLXScreenConfigs( dpy, screen );
if ( __glXExtensionBitIsEnabled( psc, MESA_copy_sub_buffer_bit ) ) {
- (*pdraw->copySubBuffer)(dpy, pdraw->private, x, y, width, height);
+ (*pdraw->copySubBuffer)(pdraw->private, x, y, width, height);
}
return;
#define INIT_MESA_SPARC
#endif
-#ifdef GLX_DIRECT_RENDERING
-static __DRIscreen *__glXFindDRIScreen(__DRInativeDisplay *dpy, int scrn);
-#endif /* GLX_DIRECT_RENDERING */
-
static Bool MakeContextCurrent(Display *dpy, GLXDrawable draw,
GLXDrawable read, GLXContext gc);
#ifdef GLX_DIRECT_RENDERING
/* Free the direct rendering per screen data */
if (psc->driScreen.private)
- (*psc->driScreen.destroyScreen)(priv->dpy, i,
- psc->driScreen.private);
+ (*psc->driScreen.destroyScreen)(psc->driScreen.private);
psc->driScreen.private = NULL;
__glxHashDestroy(psc->drawHash);
#endif
}
#ifdef XDAMAGE_1_1_INTERFACE
-static GLboolean has_damage_post(__DRInativeDisplay *dpy)
+static GLboolean has_damage_post(Display *dpy)
{
static GLboolean inited = GL_FALSE;
static GLboolean has_damage;
}
#endif /* XDAMAGE_1_1_INTERFACE */
-static void __glXReportDamage(__DRInativeDisplay *dpy, int screen,
- __DRIid drawable,
+static void __glXReportDamage(__DRIdrawable *driDraw,
int x, int y,
drm_clip_rect_t *rects, int num_rects,
GLboolean front_buffer)
XserverRegion region;
int i;
int x_off, y_off;
+ __GLXdrawable *glxDraw =
+ containerOf(driDraw, __GLXdrawable, driDrawable);
+ __GLXscreenConfigs *psc = glxDraw->psc;
+ Display *dpy = psc->dpy;
+ Drawable drawable;
if (!has_damage_post(dpy))
return;
if (front_buffer) {
x_off = x;
y_off = y;
- drawable = RootWindow(dpy, screen);
+ drawable = RootWindow(dpy, psc->scr);
} else{
x_off = 0;
y_off = 0;
+ drawable = glxDraw->drawable;
}
xrects = malloc(sizeof(XRectangle) * num_rects);
#endif
}
+static GLboolean
+__glXDRICreateContext(__DRIscreen *screen, int configID,
+ void *pid, drm_context_t *hHWContext)
+{
+ __GLXscreenConfigs *psc =
+ containerOf(screen, __GLXscreenConfigs, driScreen);
+ Display *dpy = psc->dpy;
+
+ return XF86DRICreateContextWithConfig(dpy, psc->scr,
+ configID, pid, hHWContext);
+}
+
+static GLboolean
+__glXDRIDestroyContext(__DRIscreen *screen, __DRIid context_id)
+{
+ __GLXscreenConfigs *psc =
+ containerOf(screen, __GLXscreenConfigs, driScreen);
+ Display *dpy = psc->dpy;
+
+ return XF86DRIDestroyContext(dpy, psc->scr, context_id);
+}
+
+static GLboolean
+__glXDRICreateDrawable( __DRIscreen *screen,
+ __DRIid drawable, drm_drawable_t *hHWDrawable )
+{
+ __GLXscreenConfigs *psc =
+ containerOf(screen, __GLXscreenConfigs, driScreen);
+ Display *dpy = psc->dpy;
+
+ return XF86DRICreateDrawable(dpy, psc->scr, drawable, hHWDrawable);
+}
+
+static GLboolean
+__glXDRIDestroyDrawable(__DRIscreen *screen, __DRIid drawable)
+{
+ __GLXscreenConfigs *psc =
+ containerOf(screen, __GLXscreenConfigs, driScreen);
+ Display *dpy = psc->dpy;
+
+ return XF86DRIDestroyDrawable(dpy, psc->scr, drawable);
+}
+
+static GLboolean
+__glXDRIGetDrawableInfo(__DRIscreen *screen, __DRIid drawable,
+ unsigned int *index, unsigned int *stamp,
+ int *X, int *Y, int *W, int *H,
+ int *numClipRects, drm_clip_rect_t ** pClipRects,
+ int *backX, int *backY,
+ int *numBackClipRects, drm_clip_rect_t **pBackClipRects)
+{
+ __GLXscreenConfigs *psc =
+ containerOf(screen, __GLXscreenConfigs, driScreen);
+ Display *dpy = psc->dpy;
+
+ return XF86DRIGetDrawableInfo(dpy, psc->scr, drawable,
+ index, stamp, X, Y, W, H,
+ numClipRects, pClipRects,
+ backX, backY,
+ numBackClipRects, pBackClipRects);
+}
+
+
/**
* Table of functions exported by the loader to the driver.
*/
_gl_context_modes_create,
_gl_context_modes_destroy,
- __glXFindDRIScreen,
-
- XF86DRICreateContextWithConfig,
- XF86DRIDestroyContext,
+ __glXDRICreateContext,
+ __glXDRIDestroyContext,
- XF86DRICreateDrawable,
- XF86DRIDestroyDrawable,
- XF86DRIGetDrawableInfo,
+ __glXDRICreateDrawable,
+ __glXDRIDestroyDrawable,
+ __glXDRIGetDrawableInfo,
__glXGetUST,
__glXGetMscRateOML,
err_msg = "InitDriver";
err_extra = NULL;
- psp = (*createNewScreen)(dpy, scrn,
+ psp = (*createNewScreen)(scrn,
&psc->driScreen,
psc->configs,
& ddx_version,
UnlockDisplay(dpy);
#ifdef GLX_DIRECT_RENDERING
+ psc->scr = i;
+ psc->dpy = dpy;
/* Create drawable hash */
psc->drawHash = __glxHashCreate();
if ( psc->drawHash == NULL ) {
}
-/************************************************************************/
-
-#ifdef GLX_DIRECT_RENDERING
-/* Return the DRI per screen structure */
-__DRIscreen *__glXFindDRIScreen(__DRInativeDisplay *dpy, int scrn)
-{
- __DRIscreen *pDRIScreen = NULL;
- XExtDisplayInfo *info = __glXFindDisplay(dpy);
- XExtData **privList, *found;
- __GLXdisplayPrivate *dpyPriv;
- XEDataObject dataObj;
-
- __glXLock();
- dataObj.display = dpy;
- privList = XEHeadOfExtensionList(dataObj);
- found = XFindOnExtensionList(privList, info->codes->extension);
- __glXUnlock();
-
- if (found) {
- dpyPriv = (__GLXdisplayPrivate *)found->private_data;
- pDRIScreen = &dpyPriv->screenConfigs[scrn].driScreen;
- }
-
- return pDRIScreen;
-}
-#endif
-
/************************************************************************/
static Bool SendMakeCurrentRequest( Display *dpy, CARD8 opcode,
FetchDRIDrawable( Display *dpy, GLXDrawable drawable, GLXContext gc)
{
__GLXdisplayPrivate * const priv = __glXInitialize(dpy);
- __DRIdrawable *pdraw;
+ __GLXdrawable *pdraw;
__GLXscreenConfigs *sc;
void *empty_attribute_list = NULL;
sc = &priv->screenConfigs[gc->screen];
if (__glxHashLookup(sc->drawHash, drawable, (void *) &pdraw) == 0)
- return pdraw;
+ return &pdraw->driDrawable;
/* Allocate a new drawable */
- pdraw = (__DRIdrawable *)Xmalloc(sizeof(__DRIdrawable));
+ pdraw = Xmalloc(sizeof(*pdraw));
if (!pdraw)
return NULL;
+ pdraw->drawable = drawable;
+ pdraw->psc = sc;
+
/* Create a new drawable */
- pdraw->private =
- (*sc->driScreen.createNewDrawable)(dpy,
+ pdraw->driDrawable.private =
+ (*sc->driScreen.createNewDrawable)(&sc->driScreen,
gc->mode,
- drawable, pdraw,
+ drawable, &pdraw->driDrawable,
GLX_WINDOW_BIT,
empty_attribute_list);
- if (!pdraw->private) {
+ if (!pdraw->driDrawable.private) {
/* ERROR!!! */
Xfree(pdraw);
return NULL;
}
if (__glxHashInsert(sc->drawHash, drawable, pdraw)) {
- (*pdraw->destroyDrawable)(dpy, pdraw->private);
+ (*pdraw->driDrawable.destroyDrawable)(pdraw->driDrawable.private);
Xfree(pdraw);
return NULL;
}
- return pdraw;
+ return &pdraw->driDrawable;
}
static Bool BindContextWrapper( Display *dpy, GLXContext gc,
__DRIdrawable *pdraw = FetchDRIDrawable(dpy, draw, gc);
__DRIdrawable *pread = FetchDRIDrawable(dpy, read, gc);
- return (*gc->driContext.bindContext)(dpy, gc->screen, pdraw, pread,
- & gc->driContext);
+ return (*gc->driContext.bindContext)(pdraw, pread, &gc->driContext);
}
static Bool UnbindContextWrapper( GLXContext gc )
{
- return (*gc->driContext.unbindContext)(gc->currentDpy, gc->screen,
- &gc->driContext );
+ return (*gc->driContext.unbindContext)(&gc->driContext);
}
#endif /* GLX_DIRECT_RENDERING */
if (oldGC->isDirect) {
if (oldGC->driContext.private) {
(*oldGC->driContext.destroyContext)
- (dpy, oldGC->screen, oldGC->driContext.private);
+ (oldGC->driContext.private);
oldGC->driContext.private = NULL;
}
}
Bool XF86DRICreateContextWithConfig( Display *dpy, int screen, int configID,
XID *ptr_to_returned_context_id, drm_context_t *hHWContext );
-extern GLboolean XF86DRIDestroyContext( __DRInativeDisplay *dpy, int screen,
+extern GLboolean XF86DRIDestroyContext( Display *dpy, int screen,
__DRIid context_id );
-extern GLboolean XF86DRICreateDrawable( __DRInativeDisplay *dpy, int screen,
+extern GLboolean XF86DRICreateDrawable( Display *dpy, int screen,
__DRIid drawable, drm_drawable_t *hHWDrawable );
-extern GLboolean XF86DRIDestroyDrawable( __DRInativeDisplay *dpy, int screen,
+extern GLboolean XF86DRIDestroyDrawable( Display *dpy, int screen,
__DRIid drawable);
Bool XF86DRIGetDrawableInfo( Display *dpy, int screen, Drawable drawable,
#include "drm_sarea.h"
#ifndef GLX_OML_sync_control
-typedef GLboolean ( * PFNGLXGETMSCRATEOMLPROC) (__DRInativeDisplay *dpy, __DRIid drawable, int32_t *numerator, int32_t *denominator);
+typedef GLboolean ( * PFNGLXGETMSCRATEOMLPROC) (__DRIdrawable *drawable, int32_t *numerator, int32_t *denominator);
#endif
/* This pointer *must* be set by the driver's __driCreateNewScreen funciton!
static int api_ver = 0;
/* forward declarations */
-static int driQueryFrameTracking( __DRInativeDisplay *dpy, void *priv,
+static int driQueryFrameTracking( void *priv,
int64_t *sbc, int64_t *missedFrames,
float *lastMissedUsage, float *usage );
-static void *driCreateNewDrawable(__DRInativeDisplay *dpy,
- const __GLcontextModes *modes,
+static void *driCreateNewDrawable(__DRIscreen *screen,
+ const __GLcontextModes *modes,
__DRIid draw, __DRIdrawable *pdraw,
int renderType, const int *attrs);
-static void driDestroyDrawable(__DRInativeDisplay *dpy, void *drawablePrivate);
+static void driDestroyDrawable(void *drawablePrivate);
/**
/**
* Unbind context.
*
- * \param dpy the display handle.
- * \param scrn the screen number.
+ * \param scrn the screen.
* \param gc context.
*
* \return \c GL_TRUE on success, or \c GL_FALSE on failure.
* While casting the opaque private pointers associated with the parameters
* into their respective real types it also assures they are not \c NULL.
*/
-static GLboolean driUnbindContext(__DRInativeDisplay *dpy, int scrn,
- __DRIcontext *ctx)
+static GLboolean driUnbindContext(__DRIcontext *ctx)
{
- __DRIscreen *pDRIScreen;
__DRIcontextPrivate *pcp;
__DRIscreenPrivate *psp;
__DRIdrawablePrivate *pdp;
** calling driUnbindContext.
*/
- if (ctx == NULL) {
- /* ERROR!!! */
- return GL_FALSE;
- }
+ if (ctx == NULL)
+ return GL_FALSE;
- pDRIScreen = (*dri_interface->getScreen)(dpy, scrn);
- if ( (pDRIScreen == NULL) || (pDRIScreen->private == NULL) ) {
- /* ERROR!!! */
- return GL_FALSE;
- }
-
- psp = (__DRIscreenPrivate *)pDRIScreen->private;
pcp = (__DRIcontextPrivate *)ctx->private;
+ psp = (__DRIscreenPrivate *)pcp->driScreenPriv;
pdp = (__DRIdrawablePrivate *)pcp->driDrawablePriv;
prp = (__DRIdrawablePrivate *)pcp->driReadablePriv;
* for \c glXMakeCurrentReadSGI or GLX 1.3's \c glXMakeContextCurrent
* function.
*/
-static GLboolean DoBindContext(__DRInativeDisplay *dpy,
- __DRIdrawable *pdraw,
+static GLboolean DoBindContext(__DRIdrawable *pdraw,
__DRIdrawable *pread,
- __DRIcontext *ctx,
- __DRIscreenPrivate *psp)
+ __DRIcontext *ctx)
{
__DRIdrawablePrivate *pdp;
__DRIdrawablePrivate *prp;
__DRIcontextPrivate * const pcp = ctx->private;
-
+ __DRIscreenPrivate *psp = pcp->driScreenPriv;
pdp = (__DRIdrawablePrivate *) pdraw->private;
prp = (__DRIdrawablePrivate *) pread->private;
* for \c glXMakeCurrentReadSGI or GLX 1.3's \c glXMakeContextCurrent
* function.
*/
-static GLboolean driBindContext(__DRInativeDisplay *dpy, int scrn,
- __DRIdrawable *pdraw,
+static GLboolean driBindContext(__DRIdrawable *pdraw,
__DRIdrawable *pread,
__DRIcontext * ctx)
{
- __DRIscreen *pDRIScreen;
-
/*
** Assume error checking is done properly in glXMakeCurrent before
** calling driBindContext.
*/
- if (ctx == NULL || pdraw == None || pread == None) {
- /* ERROR!!! */
- return GL_FALSE;
- }
-
- pDRIScreen = (*dri_interface->getScreen)(dpy, scrn);
- if ( (pDRIScreen == NULL) || (pDRIScreen->private == NULL) ) {
- /* ERROR!!! */
+ if (ctx == NULL || pdraw == None || pread == None)
return GL_FALSE;
- }
- return DoBindContext( dpy, pdraw, pread, ctx,
- (__DRIscreenPrivate *)pDRIScreen->private );
+ return DoBindContext( pdraw, pread, ctx );
}
/*@}*/
DRM_SPINUNLOCK(&psp->pSAREA->drawable_lock, psp->drawLockID);
- if (! (*dri_interface->getDrawableInfo)(pdp->display, pdp->screen, pdp->draw,
+ if (! (*dri_interface->getDrawableInfo)(pdp->driScreenPriv->psc, pdp->draw,
&pdp->index, &pdp->lastStamp,
&pdp->x, &pdp->y, &pdp->w, &pdp->h,
&pdp->numClipRects, &pdp->pClipRects,
/**
* Swap buffers.
*
- * \param dpy the display handle.
* \param drawablePrivate opaque pointer to the per-drawable private info.
*
* \internal
*
* Is called directly from glXSwapBuffers().
*/
-static void driSwapBuffers( __DRInativeDisplay *dpy, void *drawablePrivate )
+static void driSwapBuffers(void *drawablePrivate)
{
__DRIdrawablePrivate *dPriv = (__DRIdrawablePrivate *) drawablePrivate;
drm_clip_rect_t rect;
* front buffer, so we report the damage there rather than to the backing
* store (if any).
*/
- (*dri_interface->reportDamage)(dpy, dPriv->screen, dPriv->draw,
- dPriv->x, dPriv->y,
+ (*dri_interface->reportDamage)(dPriv->pdraw, dPriv->x, dPriv->y,
&rect, 1, GL_TRUE);
}
/**
* Called directly from a number of higher-level GLX functions.
*/
-static int driGetSBC( __DRInativeDisplay *dpy, void *drawablePrivate, int64_t *sbc )
+static int driGetSBC( void *drawablePrivate, int64_t *sbc )
{
__DRIdrawablePrivate *dPriv = (__DRIdrawablePrivate *) drawablePrivate;
__DRIswapInfo sInfo;
return status;
}
-static int driWaitForSBC( __DRInativeDisplay * dpy, void *drawablePriv,
- int64_t target_sbc,
+static int driWaitForSBC( void *drawablePriv, int64_t target_sbc,
int64_t * msc, int64_t * sbc )
{
__DRIdrawablePrivate *dPriv = (__DRIdrawablePrivate *) drawablePriv;
msc, sbc );
}
-static int driWaitForMSC( __DRInativeDisplay * dpy, void *drawablePriv,
- int64_t target_msc,
+static int driWaitForMSC( void *drawablePriv, int64_t target_msc,
int64_t divisor, int64_t remainder,
int64_t * msc, int64_t * sbc )
{
return status;
}
-static int64_t driSwapBuffersMSC( __DRInativeDisplay * dpy, void *drawablePriv,
- int64_t target_msc,
+static int64_t driSwapBuffersMSC( void *drawablePriv, int64_t target_msc,
int64_t divisor, int64_t remainder )
{
__DRIdrawablePrivate *dPriv = (__DRIdrawablePrivate *) drawablePriv;
remainder );
}
-static void driCopySubBuffer( __DRInativeDisplay *dpy, void *drawablePrivate,
+static void driCopySubBuffer( void *drawablePrivate,
int x, int y, int w, int h)
{
__DRIdrawablePrivate *dPriv = (__DRIdrawablePrivate *) drawablePrivate;
dPriv->driScreenPriv->DriverAPI.CopySubBuffer(dPriv, x, y, w, h);
- (void) dpy;
}
/**
* This is called via __DRIscreenRec's createNewDrawable pointer.
*/
-static void *driCreateNewDrawable(__DRInativeDisplay *dpy,
+static void *driCreateNewDrawable(__DRIscreen *screen,
const __GLcontextModes *modes,
__DRIid draw,
__DRIdrawable *pdraw,
int renderType,
const int *attrs)
{
- __DRIscreen * const pDRIScreen = (*dri_interface->getScreen)(dpy, modes->screen);
__DRIscreenPrivate *psp;
__DRIdrawablePrivate *pdp;
*/
(void) attrs;
- if ( (pDRIScreen == NULL) || (pDRIScreen->private == NULL) ) {
- return NULL;
- }
-
pdp = (__DRIdrawablePrivate *)_mesa_malloc(sizeof(__DRIdrawablePrivate));
if (!pdp) {
return NULL;
}
- if (!(*dri_interface->createDrawable)(dpy, modes->screen, draw, &pdp->hHWDrawable)) {
+ /* Ensure that modes->screen and screen are the same screen? */
+
+ if (!(*dri_interface->createDrawable)(screen, draw, &pdp->hHWDrawable)) {
_mesa_free(pdp);
return NULL;
}
pdp->numBackClipRects = 0;
pdp->pClipRects = NULL;
pdp->pBackClipRects = NULL;
- pdp->display = dpy;
- pdp->screen = modes->screen;
- psp = (__DRIscreenPrivate *)pDRIScreen->private;
+ psp = (__DRIscreenPrivate *)screen->private;
pdp->driScreenPriv = psp;
pdp->driContextPriv = &psp->dummyContextPriv;
if (!(*psp->DriverAPI.CreateBuffer)(psp, pdp, modes,
renderType == GLX_PIXMAP_BIT)) {
- (void)(*dri_interface->destroyDrawable)(dpy, modes->screen, pdp->draw);
+ (void)(*dri_interface->destroyDrawable)(screen, pdp->draw);
_mesa_free(pdp);
return NULL;
}
}
static void
-driDestroyDrawable(__DRInativeDisplay *dpy, void *drawablePrivate)
+driDestroyDrawable(void *drawablePrivate)
{
__DRIdrawablePrivate *pdp = (__DRIdrawablePrivate *) drawablePrivate;
__DRIscreenPrivate *psp;
- int scrn;
if (pdp) {
psp = pdp->driScreenPriv;
- scrn = psp->myNum;
(*psp->DriverAPI.DestroyBuffer)(pdp);
- (void)(*dri_interface->destroyDrawable)(dpy, scrn, pdp->draw);
+ (void)(*dri_interface->destroyDrawable)(psp->psc, pdp->draw);
if (pdp->pClipRects) {
_mesa_free(pdp->pClipRects);
pdp->pClipRects = NULL;
/**
* Destroy the per-context private information.
*
- * \param dpy the display handle.
- * \param scrn the screen number.
* \param contextPrivate opaque pointer to the per-drawable private info.
*
* \internal
* drmDestroyContext(), and finally frees \p contextPrivate.
*/
static void
-driDestroyContext(__DRInativeDisplay *dpy, int scrn, void *contextPrivate)
+driDestroyContext(void *contextPrivate)
{
__DRIcontextPrivate *pcp = (__DRIcontextPrivate *) contextPrivate;
if (pcp) {
(*pcp->driScreenPriv->DriverAPI.DestroyContext)(pcp);
- (void) (*dri_interface->destroyContext)(dpy, scrn, pcp->contextID);
+ (void) (*dri_interface->destroyContext)(pcp->driScreenPriv->psc,
+ pcp->contextID);
_mesa_free(pcp);
}
}
*
*/
static void *
-driCreateNewContext(__DRInativeDisplay *dpy, const __GLcontextModes *modes,
+driCreateNewContext(__DRIscreen *screen, const __GLcontextModes *modes,
int render_type, void *sharedPrivate, __DRIcontext *pctx)
{
- __DRIscreen *pDRIScreen;
__DRIcontextPrivate *pcp;
__DRIcontextPrivate *pshare = (__DRIcontextPrivate *) sharedPrivate;
__DRIscreenPrivate *psp;
void * const shareCtx = (pshare != NULL) ? pshare->driverPrivate : NULL;
- pDRIScreen = (*dri_interface->getScreen)(dpy, modes->screen);
- if ( (pDRIScreen == NULL) || (pDRIScreen->private == NULL) ) {
- /* ERROR!!! */
- return NULL;
- }
-
- psp = (__DRIscreenPrivate *)pDRIScreen->private;
+ psp = (__DRIscreenPrivate *)screen->private;
pcp = (__DRIcontextPrivate *)_mesa_malloc(sizeof(__DRIcontextPrivate));
if (!pcp) {
return NULL;
}
- if (! (*dri_interface->createContext)(dpy, modes->screen, modes->fbconfigID,
- &pcp->contextID, &pcp->hHWContext)) {
+ if (! (*dri_interface->createContext)(screen, modes->fbconfigID,
+ &pcp->contextID, &pcp->hHWContext)) {
_mesa_free(pcp);
return NULL;
}
- pcp->display = dpy;
pcp->driScreenPriv = psp;
pcp->driDrawablePriv = NULL;
pctx->unbindContext = driUnbindContext;
if ( !(*psp->DriverAPI.CreateContext)(modes, pcp, shareCtx) ) {
- (void) (*dri_interface->destroyContext)(dpy, modes->screen,
- pcp->contextID);
+ (void) (*dri_interface->destroyContext)(screen, pcp->contextID);
_mesa_free(pcp);
return NULL;
}
* This function calls __DriverAPIRec::DestroyScreen on \p screenPrivate, calls
* drmClose(), and finally frees \p screenPrivate.
*/
-static void driDestroyScreen(__DRInativeDisplay *dpy, int scrn, void *screenPrivate)
+static void driDestroyScreen(void *screenPrivate)
{
__DRIscreenPrivate *psp = (__DRIscreenPrivate *) screenPrivate;
* loader that is too old to even load this driver.
*/
__DRIscreenPrivate *
-__driUtilCreateNewScreen(__DRInativeDisplay *dpy, int scrn, __DRIscreen *psc,
+__driUtilCreateNewScreen(int scr, __DRIscreen *psc,
__GLcontextModes * modes,
const __DRIversion * ddx_version,
const __DRIversion * dri_version,
return NULL;
}
- psp->display = dpy;
- psp->myNum = scrn;
psp->psc = psc;
psp->modes = modes;
psp->fbBPP = psp->fbStride * 8 / frame_buffer->width;
psp->fd = fd;
+ psp->myNum = scr;
/*
** Do not init dummy context here; actual initialization will be
static int
-driQueryFrameTracking( __DRInativeDisplay * dpy, void * priv,
+driQueryFrameTracking( void * priv,
int64_t * sbc, int64_t * missedFrames,
float * lastMissedUsage, float * usage )
{
float usage = 1.0;
- if ( (*dri_interface->getMSCRate)( dPriv->display, dPriv->draw, &n, &d ) ) {
+ if ( (*dri_interface->getMSCRate)(dPriv->pdraw, &n, &d) ) {
interval = (dPriv->pdraw->swap_interval != 0)
? dPriv->pdraw->swap_interval : 1;
*/
__DRIscreenPrivate *driScreenPriv;
- /**
- * \name Display and screen information.
- *
- * Basically just need these for when the locking code needs to call
- * \c __driUtilUpdateDrawableInfo.
- */
- /*@{*/
- __DRInativeDisplay *display;
- int screen;
- /*@}*/
-
/**
* Called via glXSwapBuffers().
*/
void *driverPrivate;
/**
- * This context's display pointer.
+ * Pointer back to the \c __DRIcontext that contains this structure.
*/
- __DRInativeDisplay *display;
+ __DRIcontext *pctx;
/**
* Pointer to drawable currently bound to this context for drawing.
* Per-screen private driver information.
*/
struct __DRIscreenPrivateRec {
- /**
- * Display for this screen
- */
- __DRInativeDisplay *display;
-
/**
* Current screen's number
*/
__driUtilUpdateDrawableInfo(__DRIdrawablePrivate *pdp);
-extern __DRIscreenPrivate * __driUtilCreateNewScreen( __DRInativeDisplay *dpy,
- int scrn, __DRIscreen *psc, __GLcontextModes * modes,
+extern __DRIscreenPrivate * __driUtilCreateNewScreen( int scr, __DRIscreen *psc,
+ __GLcontextModes * modes,
const __DRIversion * ddx_version, const __DRIversion * dri_version,
const __DRIversion * drm_version, const __DRIframebuffer * frame_buffer,
drm_sarea_t *pSAREA, int fd, int internal_api_version,
* failure.
*/
PUBLIC
-void * __driCreateNewScreen_20050727( __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 )
+void * __DRI_CREATE_NEW_SCREEN(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;
return NULL;
}
- psp = __driUtilCreateNewScreen(dpy, scrn, psc, NULL,
+ psp = __driUtilCreateNewScreen(scrn, psc, NULL,
ddx_version, dri_version, drm_version,
frame_buffer, pSAREA, fd,
internal_api_version, &ffbAPI);
* failure.
*/
PUBLIC
-void * __driCreateNewScreen_20070105( __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 )
-
+void *__DRI_CREATE_NEW_SCREEN(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 ddx_expected = { 1, 0, 0 };
return NULL;
}
- psp = __driUtilCreateNewScreen(dpy, scrn, psc, NULL,
+ psp = __driUtilCreateNewScreen(scrn, psc, NULL,
ddx_version, dri_version, drm_version,
frame_buffer, pSAREA, fd,
internal_api_version, &i810API);
* \return A pointer to a \c __DRIscreenPrivate on success, or \c NULL on
* failure.
*/
-PUBLIC void *
-__driCreateNewScreen_20050727(__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)
+PUBLIC
+void * __DRI_CREATE_NEW_SCREEN(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 ddx_expected = { 1, 5, 0 };
return NULL;
}
- psp = __driUtilCreateNewScreen(dpy, scrn, psc, NULL,
- ddx_version, dri_version, drm_version,
- frame_buffer, pSAREA, fd,
- internal_api_version, &intelAPI);
-
+ psp = __driUtilCreateNewScreen(scrn, psc, NULL,
+ ddx_version, dri_version, drm_version,
+ frame_buffer, pSAREA, fd,
+ internal_api_version, &intelAPI);
if (psp != NULL) {
I830DRIPtr dri_priv = (I830DRIPtr) psp->pDevPriv;
*driver_modes = intelFillInModes(dri_priv->cpp * 8,
* failure.
*/
PUBLIC
-void * __driCreateNewScreen_20050727( __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 )
+void * __DRI_CREATE_NEW_SCREEN( 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;
return NULL;
}
- psp = __driUtilCreateNewScreen(dpy, scrn, psc, NULL,
+ psp = __driUtilCreateNewScreen(scrn, psc, NULL,
ddx_version, dri_version, drm_version,
frame_buffer, pSAREA, fd,
internal_api_version, &intelAPI);
* failure.
*/
PUBLIC
-void * __driCreateNewScreen_20050727( __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 )
+void * __DRI_CREATE_NEW_SCREEN(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;
return NULL;
}
- psp = __driUtilCreateNewScreen(dpy, scrn, psc, NULL,
+ psp = __driUtilCreateNewScreen(scrn, psc, NULL,
ddx_version, dri_version, drm_version,
frame_buffer, pSAREA, fd,
internal_api_version, &mach64API);
* failure.
*/
PUBLIC
-void * __driCreateNewScreen_20050727( __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 )
+void * __DRI_CREATE_NEW_SCREEN(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;
return NULL;
}
- psp = __driUtilCreateNewScreen(dpy, scrn, psc, NULL,
+ psp = __driUtilCreateNewScreen(scrn, psc, NULL,
ddx_version, dri_version, drm_version,
frame_buffer, pSAREA, fd,
internal_api_version, &mgaAPI);
* failure.
*/
PUBLIC
-void * __driCreateNewScreen_20050727( __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)
+void * __DRI_CREATE_NEW_SCREEN(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;
return NULL;
}
- psp = __driUtilCreateNewScreen(dpy, scrn, psc, NULL,
+ psp = __driUtilCreateNewScreen(scrn, psc, NULL,
ddx_version, dri_version, drm_version,
frame_buffer, pSAREA, fd,
internal_api_version, &nouveauAPI);
* failure.
*/
PUBLIC
-void * __driCreateNewScreen_20050727( __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 )
+void * __DRI_CREATE_NEW_SCREEN(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;
return NULL;
}
- psp = __driUtilCreateNewScreen(dpy, scrn, psc, NULL,
+ psp = __driUtilCreateNewScreen(scrn, psc, NULL,
ddx_version, dri_version, drm_version,
frame_buffer, pSAREA, fd,
internal_api_version, &r128API);
* the kernel data structures, and the current context to get the
* device fd.
*/
-void *r200AllocateMemoryMESA(__DRInativeDisplay *dpy, int scrn, GLsizei size,
+void *r200AllocateMemoryMESA(__DRIscreen *screen, GLsizei size,
GLfloat readfreq, GLfloat writefreq,
GLfloat priority)
{
/* Called via glXFreeMemoryMESA() */
-void r200FreeMemoryMESA(__DRInativeDisplay *dpy, int scrn, GLvoid *pointer)
+void r200FreeMemoryMESA(__DRIscreen *screen, GLvoid *pointer)
{
GET_CURRENT_CONTEXT(ctx);
r200ContextPtr rmesa;
}
/* Called via glXGetMemoryOffsetMESA() */
-GLuint r200GetMemoryOffsetMESA(__DRInativeDisplay *dpy, int scrn, const GLvoid *pointer)
+GLuint r200GetMemoryOffsetMESA(__DRIscreen *screen, const GLvoid *pointer)
{
GET_CURRENT_CONTEXT(ctx);
r200ContextPtr rmesa;
extern void r200WaitForVBlank( r200ContextPtr rmesa );
extern void r200InitIoctlFuncs( struct dd_function_table *functions );
-extern void *r200AllocateMemoryMESA( __DRInativeDisplay *dpy, int scrn, GLsizei size, GLfloat readfreq,
+extern void *r200AllocateMemoryMESA( __DRIscreen *screen, GLsizei size, GLfloat readfreq,
GLfloat writefreq, GLfloat priority );
-extern void r200FreeMemoryMESA( __DRInativeDisplay *dpy, int scrn, GLvoid *pointer );
-extern GLuint r200GetMemoryOffsetMESA( __DRInativeDisplay *dpy, int scrn, const GLvoid *pointer );
+extern void r200FreeMemoryMESA( __DRIscreen *screen, GLvoid *pointer );
+extern GLuint r200GetMemoryOffsetMESA( __DRIscreen *screen, const GLvoid *pointer );
extern GLboolean r200IsGartMemory( r200ContextPtr rmesa, const GLvoid *pointer,
GLint size );
* failure.
*/
PUBLIC void *
-__driCreateNewScreen_20050727( __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 )
+__DRI_CREATE_NEW_SCREEN(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;
#if !RADEON_COMMON
return NULL;
}
#if !RADEON_COMMON || (RADEON_COMMON && defined(RADEON_COMMON_FOR_R300))
- psp = __driUtilCreateNewScreen(dpy, scrn, psc, NULL,
+ psp = __driUtilCreateNewScreen(scrn, psc, NULL,
ddx_version, dri_version, drm_version,
frame_buffer, pSAREA, fd,
internal_api_version, &radeonAPI);
#elif RADEON_COMMON && defined(RADEON_COMMON_FOR_R200)
- psp = __driUtilCreateNewScreen(dpy, scrn, psc, NULL,
+ psp = __driUtilCreateNewScreen(scrn, psc, NULL,
ddx_version, dri_version, drm_version,
frame_buffer, pSAREA, fd,
internal_api_version, &r200API);
* failure.
*/
PUBLIC
-void * __driCreateNewScreen_20050727( __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 )
+void * __DRI_CREATE_NEW_SCREEN(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;
return NULL;
}
- psp = __driUtilCreateNewScreen(dpy, scrn, psc, NULL,
+ psp = __driUtilCreateNewScreen(scrn, psc, NULL,
ddx_version, dri_version, drm_version,
frame_buffer, pSAREA, fd,
internal_api_version, &savageAPI);
* failure.
*/
PUBLIC
-void * __driCreateNewScreen_20050727( __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 )
+void * __DRI_CREATE_NEW_SCREEN(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;
return NULL;
}
- psp = __driUtilCreateNewScreen(dpy, scrn, psc, NULL,
+ psp = __driUtilCreateNewScreen(scrn, psc, NULL,
ddx_version, dri_version, drm_version,
frame_buffer, pSAREA, fd,
internal_api_version, &sisAPI);
* failure.
*/
PUBLIC
-void * __driCreateNewScreen_20050727( __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 )
+void *__DRI_CREATE_NEW_SCREEN(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 ddx_expected = { 1, 1, 0 };
return NULL;
}
- psp = __driUtilCreateNewScreen(dpy, scrn, psc, NULL,
+ psp = __driUtilCreateNewScreen(scrn, psc, NULL,
ddx_version, dri_version, drm_version,
frame_buffer, pSAREA, fd,
internal_api_version, &tdfxAPI);
};
-PUBLIC void *__driCreateNewScreen_20050727( __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 )
+PUBLIC void *
+__DRI_CREATE_NEW_SCREEN(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 ddx_expected = { 4, 0, 0 };
return NULL;
}
- psp = __driUtilCreateNewScreen(dpy, scrn, psc, NULL,
+ psp = __driUtilCreateNewScreen(scrn, psc, NULL,
ddx_version, dri_version, drm_version,
frame_buffer, pSAREA, fd,
internal_api_version, &tridentAPI);
_tnl_allow_pixel_fog(ctx, GL_FALSE);
_tnl_allow_vertex_fog(ctx, GL_TRUE);
-/* vmesa->display = dpy; */
- vmesa->display = sPriv->display;
-
vmesa->hHWContext = driContextPriv->hHWContext;
vmesa->driFd = sPriv->fd;
vmesa->driHwLock = &sPriv->pSAREA->lock;
drm_context_t hHWContext;
drm_hw_lock_t *driHwLock;
int driFd;
- __DRInativeDisplay *display;
/**
* DRI drawable bound to this context for drawing.
* failure.
*/
PUBLIC
-void * __driCreateNewScreen_20050727( __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 )
+void * __DRI_CREATE_NEW_SCREEN(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;
return NULL;
}
- psp = __driUtilCreateNewScreen(dpy, scrn, psc, NULL,
+ psp = __driUtilCreateNewScreen(scrn, psc, NULL,
ddx_version, dri_version, drm_version,
frame_buffer, pSAREA, fd,
internal_api_version, &viaAPI);