glx: Drop screen argument to GetGLXDRIDrawable
We'll just get it from the returned drawable when we need it.
This commit is contained in:
@@ -397,7 +397,7 @@ static void
|
|||||||
dri2_wait_x(__GLXcontext *gc)
|
dri2_wait_x(__GLXcontext *gc)
|
||||||
{
|
{
|
||||||
struct dri2_drawable *priv = (struct dri2_drawable *)
|
struct dri2_drawable *priv = (struct dri2_drawable *)
|
||||||
GetGLXDRIDrawable(gc->currentDpy, gc->currentDrawable, NULL);
|
GetGLXDRIDrawable(gc->currentDpy, gc->currentDrawable);
|
||||||
|
|
||||||
if (priv == NULL || !priv->have_fake_front)
|
if (priv == NULL || !priv->have_fake_front)
|
||||||
return;
|
return;
|
||||||
@@ -409,7 +409,7 @@ static void
|
|||||||
dri2_wait_gl(__GLXcontext *gc)
|
dri2_wait_gl(__GLXcontext *gc)
|
||||||
{
|
{
|
||||||
struct dri2_drawable *priv = (struct dri2_drawable *)
|
struct dri2_drawable *priv = (struct dri2_drawable *)
|
||||||
GetGLXDRIDrawable(gc->currentDpy, gc->currentDrawable, NULL);
|
GetGLXDRIDrawable(gc->currentDpy, gc->currentDrawable);
|
||||||
|
|
||||||
if (priv == NULL || !priv->have_fake_front)
|
if (priv == NULL || !priv->have_fake_front)
|
||||||
return;
|
return;
|
||||||
@@ -638,7 +638,7 @@ dri2_bind_tex_image(Display * dpy,
|
|||||||
int buffer, const int *attrib_list)
|
int buffer, const int *attrib_list)
|
||||||
{
|
{
|
||||||
GLXContext gc = __glXGetCurrentContext();
|
GLXContext gc = __glXGetCurrentContext();
|
||||||
__GLXDRIdrawable *base = GetGLXDRIDrawable(dpy, drawable, NULL);
|
__GLXDRIdrawable *base = GetGLXDRIDrawable(dpy, drawable);
|
||||||
__GLXdisplayPrivate *dpyPriv = __glXInitialize(dpy);
|
__GLXdisplayPrivate *dpyPriv = __glXInitialize(dpy);
|
||||||
struct dri2_drawable *pdraw = (struct dri2_drawable *) base;
|
struct dri2_drawable *pdraw = (struct dri2_drawable *) base;
|
||||||
struct dri2_display *pdp =
|
struct dri2_display *pdp =
|
||||||
|
@@ -95,7 +95,7 @@ ChangeDrawableAttribute(Display * dpy, GLXDrawable drawable,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
pdraw = GetGLXDRIDrawable(dpy, drawable, NULL);
|
pdraw = GetGLXDRIDrawable(dpy, drawable);
|
||||||
|
|
||||||
opcode = __glXSetupForCommand(dpy);
|
opcode = __glXSetupForCommand(dpy);
|
||||||
if (!opcode)
|
if (!opcode)
|
||||||
@@ -214,14 +214,12 @@ CreateDRIDrawable(Display *dpy, const __GLcontextModes *fbconfig,
|
|||||||
static void
|
static void
|
||||||
DestroyDRIDrawable(Display *dpy, GLXDrawable drawable, int destroy_xdrawable)
|
DestroyDRIDrawable(Display *dpy, GLXDrawable drawable, int destroy_xdrawable)
|
||||||
{
|
{
|
||||||
int screen;
|
|
||||||
__GLXdisplayPrivate *const priv = __glXInitialize(dpy);
|
__GLXdisplayPrivate *const priv = __glXInitialize(dpy);
|
||||||
__GLXDRIdrawable *pdraw = GetGLXDRIDrawable(dpy, drawable, &screen);
|
__GLXDRIdrawable *pdraw = GetGLXDRIDrawable(dpy, drawable);
|
||||||
__GLXscreenConfigs *psc = priv->screenConfigs[screen];
|
|
||||||
|
|
||||||
if (pdraw != NULL) {
|
if (pdraw != NULL) {
|
||||||
if (destroy_xdrawable)
|
if (destroy_xdrawable)
|
||||||
XFreePixmap(psc->dpy, pdraw->xDrawable);
|
XFreePixmap(pdraw->psc->dpy, pdraw->xDrawable);
|
||||||
(*pdraw->destroyDrawable) (pdraw);
|
(*pdraw->destroyDrawable) (pdraw);
|
||||||
__glxHashDelete(priv->drawHash, drawable);
|
__glxHashDelete(priv->drawHash, drawable);
|
||||||
}
|
}
|
||||||
@@ -341,7 +339,7 @@ GetDrawableAttribute(Display * dpy, GLXDrawable drawable,
|
|||||||
|
|
||||||
#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
|
#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
|
||||||
{
|
{
|
||||||
__GLXDRIdrawable *pdraw = GetGLXDRIDrawable(dpy, drawable, NULL);
|
__GLXDRIdrawable *pdraw = GetGLXDRIDrawable(dpy, drawable);
|
||||||
|
|
||||||
if (pdraw != NULL && !pdraw->textureTarget)
|
if (pdraw != NULL && !pdraw->textureTarget)
|
||||||
pdraw->textureTarget =
|
pdraw->textureTarget =
|
||||||
|
@@ -791,7 +791,7 @@ __glxGetMscRate(__GLXDRIdrawable *glxDraw,
|
|||||||
XExtDisplayInfo *__glXFindDisplay (Display *dpy);
|
XExtDisplayInfo *__glXFindDisplay (Display *dpy);
|
||||||
|
|
||||||
extern __GLXDRIdrawable *
|
extern __GLXDRIdrawable *
|
||||||
GetGLXDRIDrawable(Display *dpy, GLXDrawable drawable, int *const scrn_num);
|
GetGLXDRIDrawable(Display *dpy, GLXDrawable drawable);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@@ -126,7 +126,7 @@ GarbageCollectDRIDrawables(__GLXscreenConfigs * sc)
|
|||||||
* the drawable is not associated with a direct-rendering context.
|
* the drawable is not associated with a direct-rendering context.
|
||||||
*/
|
*/
|
||||||
_X_HIDDEN __GLXDRIdrawable *
|
_X_HIDDEN __GLXDRIdrawable *
|
||||||
GetGLXDRIDrawable(Display * dpy, GLXDrawable drawable, int *const scrn_num)
|
GetGLXDRIDrawable(Display * dpy, GLXDrawable drawable)
|
||||||
{
|
{
|
||||||
__GLXdisplayPrivate *priv = __glXInitialize(dpy);
|
__GLXdisplayPrivate *priv = __glXInitialize(dpy);
|
||||||
__GLXDRIdrawable *pdraw;
|
__GLXDRIdrawable *pdraw;
|
||||||
@@ -134,11 +134,8 @@ GetGLXDRIDrawable(Display * dpy, GLXDrawable drawable, int *const scrn_num)
|
|||||||
if (priv == NULL)
|
if (priv == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
if (__glxHashLookup(priv->drawHash, drawable, (void *) &pdraw) == 0) {
|
if (__glxHashLookup(priv->drawHash, drawable, (void *) &pdraw) == 0)
|
||||||
if (scrn_num != NULL)
|
|
||||||
*scrn_num = pdraw->psc->scr;
|
|
||||||
return pdraw;
|
return pdraw;
|
||||||
}
|
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
@@ -1022,7 +1019,7 @@ glXDestroyGLXPixmap(Display * dpy, GLXPixmap glxpixmap)
|
|||||||
#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
|
#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
|
||||||
{
|
{
|
||||||
__GLXdisplayPrivate *const priv = __glXInitialize(dpy);
|
__GLXdisplayPrivate *const priv = __glXInitialize(dpy);
|
||||||
__GLXDRIdrawable *pdraw = GetGLXDRIDrawable(dpy, glxpixmap, NULL);
|
__GLXDRIdrawable *pdraw = GetGLXDRIDrawable(dpy, glxpixmap);
|
||||||
|
|
||||||
if (pdraw != NULL) {
|
if (pdraw != NULL) {
|
||||||
(*pdraw->destroyDrawable) (pdraw);
|
(*pdraw->destroyDrawable) (pdraw);
|
||||||
@@ -1054,7 +1051,7 @@ glXSwapBuffers(Display * dpy, GLXDrawable drawable)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
|
#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
|
||||||
__GLXDRIdrawable *pdraw = GetGLXDRIDrawable(dpy, drawable, NULL);
|
__GLXDRIdrawable *pdraw = GetGLXDRIDrawable(dpy, drawable);
|
||||||
|
|
||||||
if (pdraw != NULL) {
|
if (pdraw != NULL) {
|
||||||
glFlush();
|
glFlush();
|
||||||
@@ -2019,9 +2016,8 @@ __glXSwapIntervalSGI(int interval)
|
|||||||
|
|
||||||
#ifdef GLX_DIRECT_RENDERING
|
#ifdef GLX_DIRECT_RENDERING
|
||||||
if (gc->driContext && psc->driScreen && psc->driScreen->setSwapInterval) {
|
if (gc->driContext && psc->driScreen && psc->driScreen->setSwapInterval) {
|
||||||
__GLXDRIdrawable *pdraw = GetGLXDRIDrawable(gc->currentDpy,
|
__GLXDRIdrawable *pdraw =
|
||||||
gc->currentDrawable,
|
GetGLXDRIDrawable(gc->currentDpy, gc->currentDrawable);
|
||||||
NULL);
|
|
||||||
psc->driScreen->setSwapInterval(pdraw, interval);
|
psc->driScreen->setSwapInterval(pdraw, interval);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -2066,8 +2062,8 @@ __glXSwapIntervalMESA(unsigned int interval)
|
|||||||
|
|
||||||
psc = GetGLXScreenConfigs( gc->currentDpy, gc->screen);
|
psc = GetGLXScreenConfigs( gc->currentDpy, gc->screen);
|
||||||
if (psc->driScreen && psc->driScreen->setSwapInterval) {
|
if (psc->driScreen && psc->driScreen->setSwapInterval) {
|
||||||
__GLXDRIdrawable *pdraw = GetGLXDRIDrawable(gc->currentDpy,
|
__GLXDRIdrawable *pdraw =
|
||||||
gc->currentDrawable, NULL);
|
GetGLXDRIDrawable(gc->currentDpy, gc->currentDrawable);
|
||||||
return psc->driScreen->setSwapInterval(pdraw, interval);
|
return psc->driScreen->setSwapInterval(pdraw, interval);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2088,8 +2084,8 @@ __glXGetSwapIntervalMESA(void)
|
|||||||
|
|
||||||
psc = GetGLXScreenConfigs( gc->currentDpy, gc->screen);
|
psc = GetGLXScreenConfigs( gc->currentDpy, gc->screen);
|
||||||
if (psc->driScreen && psc->driScreen->getSwapInterval) {
|
if (psc->driScreen && psc->driScreen->getSwapInterval) {
|
||||||
__GLXDRIdrawable *pdraw = GetGLXDRIDrawable(gc->currentDpy,
|
__GLXDRIdrawable *pdraw =
|
||||||
gc->currentDrawable, NULL);
|
GetGLXDRIDrawable(gc->currentDpy, gc->currentDrawable);
|
||||||
return psc->driScreen->getSwapInterval(pdraw);
|
return psc->driScreen->getSwapInterval(pdraw);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2123,7 +2119,7 @@ __glXGetVideoSyncSGI(unsigned int *count)
|
|||||||
|
|
||||||
psc = GetGLXScreenConfigs(gc->currentDpy, gc->screen);
|
psc = GetGLXScreenConfigs(gc->currentDpy, gc->screen);
|
||||||
#ifdef GLX_DIRECT_RENDERING
|
#ifdef GLX_DIRECT_RENDERING
|
||||||
pdraw = GetGLXDRIDrawable(gc->currentDpy, gc->currentDrawable, NULL);
|
pdraw = GetGLXDRIDrawable(gc->currentDpy, gc->currentDrawable);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* FIXME: Looking at the GLX_SGI_video_sync spec in the extension registry,
|
/* FIXME: Looking at the GLX_SGI_video_sync spec in the extension registry,
|
||||||
@@ -2165,7 +2161,7 @@ __glXWaitVideoSyncSGI(int divisor, int remainder, unsigned int *count)
|
|||||||
|
|
||||||
psc = GetGLXScreenConfigs( gc->currentDpy, gc->screen);
|
psc = GetGLXScreenConfigs( gc->currentDpy, gc->screen);
|
||||||
#ifdef GLX_DIRECT_RENDERING
|
#ifdef GLX_DIRECT_RENDERING
|
||||||
pdraw = GetGLXDRIDrawable(gc->currentDpy, gc->currentDrawable, NULL);
|
pdraw = GetGLXDRIDrawable(gc->currentDpy, gc->currentDrawable);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef GLX_DIRECT_RENDERING
|
#ifdef GLX_DIRECT_RENDERING
|
||||||
@@ -2341,7 +2337,7 @@ __glXGetSyncValuesOML(Display * dpy, GLXDrawable drawable,
|
|||||||
int64_t * ust, int64_t * msc, int64_t * sbc)
|
int64_t * ust, int64_t * msc, int64_t * sbc)
|
||||||
{
|
{
|
||||||
__GLXdisplayPrivate * const priv = __glXInitialize(dpy);
|
__GLXdisplayPrivate * const priv = __glXInitialize(dpy);
|
||||||
int i, ret;
|
int ret;
|
||||||
#ifdef GLX_DIRECT_RENDERING
|
#ifdef GLX_DIRECT_RENDERING
|
||||||
__GLXDRIdrawable *pdraw;
|
__GLXDRIdrawable *pdraw;
|
||||||
#endif
|
#endif
|
||||||
@@ -2351,9 +2347,9 @@ __glXGetSyncValuesOML(Display * dpy, GLXDrawable drawable,
|
|||||||
return False;
|
return False;
|
||||||
|
|
||||||
#ifdef GLX_DIRECT_RENDERING
|
#ifdef GLX_DIRECT_RENDERING
|
||||||
pdraw = GetGLXDRIDrawable(dpy, drawable, &i);
|
pdraw = GetGLXDRIDrawable(dpy, drawable);
|
||||||
psc = priv->screenConfigs[i];
|
psc = pdraw ? pdraw->psc : NULL;
|
||||||
if (pdraw && psc && psc->driScreen && psc->driScreen->getDrawableMSC) {
|
if (pdraw && psc->driScreen->getDrawableMSC) {
|
||||||
ret = psc->driScreen->getDrawableMSC(psc, pdraw, ust, msc, sbc);
|
ret = psc->driScreen->getDrawableMSC(psc, pdraw, ust, msc, sbc);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@@ -2450,7 +2446,7 @@ __glXGetMscRateOML(Display * dpy, GLXDrawable drawable,
|
|||||||
int32_t * numerator, int32_t * denominator)
|
int32_t * numerator, int32_t * denominator)
|
||||||
{
|
{
|
||||||
#if defined( GLX_DIRECT_RENDERING ) && defined( XF86VIDMODE )
|
#if defined( GLX_DIRECT_RENDERING ) && defined( XF86VIDMODE )
|
||||||
__GLXDRIdrawable *draw = GetGLXDRIDrawable(dpy, drawable, NULL);
|
__GLXDRIdrawable *draw = GetGLXDRIDrawable(dpy, drawable);
|
||||||
|
|
||||||
if (draw == NULL)
|
if (draw == NULL)
|
||||||
return False;
|
return False;
|
||||||
@@ -2471,11 +2467,10 @@ __glXSwapBuffersMscOML(Display * dpy, GLXDrawable drawable,
|
|||||||
int64_t target_msc, int64_t divisor, int64_t remainder)
|
int64_t target_msc, int64_t divisor, int64_t remainder)
|
||||||
{
|
{
|
||||||
GLXContext gc = __glXGetCurrentContext();
|
GLXContext gc = __glXGetCurrentContext();
|
||||||
int screen;
|
|
||||||
#ifdef GLX_DIRECT_RENDERING
|
#ifdef GLX_DIRECT_RENDERING
|
||||||
__GLXDRIdrawable *pdraw = GetGLXDRIDrawable(dpy, drawable, &screen);
|
__GLXDRIdrawable *pdraw = GetGLXDRIDrawable(dpy, drawable);
|
||||||
|
__GLXscreenConfigs *psc = pdraw ? pdraw->psc : NULL;
|
||||||
#endif
|
#endif
|
||||||
__GLXscreenConfigs *const psc = GetGLXScreenConfigs(dpy, screen);
|
|
||||||
|
|
||||||
if (!gc) /* no GLX for this */
|
if (!gc) /* no GLX for this */
|
||||||
return -1;
|
return -1;
|
||||||
@@ -2514,11 +2509,10 @@ __glXWaitForMscOML(Display * dpy, GLXDrawable drawable,
|
|||||||
int64_t remainder, int64_t * ust,
|
int64_t remainder, int64_t * ust,
|
||||||
int64_t * msc, int64_t * sbc)
|
int64_t * msc, int64_t * sbc)
|
||||||
{
|
{
|
||||||
int screen;
|
|
||||||
#ifdef GLX_DIRECT_RENDERING
|
#ifdef GLX_DIRECT_RENDERING
|
||||||
__GLXDRIdrawable *pdraw = GetGLXDRIDrawable(dpy, drawable, &screen);
|
__GLXDRIdrawable *pdraw = GetGLXDRIDrawable(dpy, drawable);
|
||||||
#endif
|
#endif
|
||||||
__GLXscreenConfigs * const psc = GetGLXScreenConfigs( dpy, screen );
|
__GLXscreenConfigs *psc = pdraw ? pdraw->psc : NULL;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
|
|
||||||
@@ -2547,11 +2541,10 @@ __glXWaitForSbcOML(Display * dpy, GLXDrawable drawable,
|
|||||||
int64_t target_sbc, int64_t * ust,
|
int64_t target_sbc, int64_t * ust,
|
||||||
int64_t * msc, int64_t * sbc)
|
int64_t * msc, int64_t * sbc)
|
||||||
{
|
{
|
||||||
int screen;
|
|
||||||
#ifdef GLX_DIRECT_RENDERING
|
#ifdef GLX_DIRECT_RENDERING
|
||||||
__GLXDRIdrawable *pdraw = GetGLXDRIDrawable(dpy, drawable, &screen);
|
__GLXDRIdrawable *pdraw = GetGLXDRIDrawable(dpy, drawable);
|
||||||
#endif
|
#endif
|
||||||
__GLXscreenConfigs *const psc = GetGLXScreenConfigs(dpy, screen);
|
__GLXscreenConfigs *psc = pdraw ? pdraw->psc : NULL;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
/* The OML_sync_control spec says this should "generate a GLX_BAD_VALUE
|
/* The OML_sync_control spec says this should "generate a GLX_BAD_VALUE
|
||||||
@@ -2639,10 +2632,9 @@ __glXCopySubBufferMESA(Display * dpy, GLXDrawable drawable,
|
|||||||
CARD8 opcode;
|
CARD8 opcode;
|
||||||
|
|
||||||
#ifdef __DRI_COPY_SUB_BUFFER
|
#ifdef __DRI_COPY_SUB_BUFFER
|
||||||
int screen;
|
__GLXDRIdrawable *pdraw = GetGLXDRIDrawable(dpy, drawable);
|
||||||
__GLXDRIdrawable *pdraw = GetGLXDRIDrawable(dpy, drawable, &screen);
|
|
||||||
if (pdraw != NULL) {
|
if (pdraw != NULL) {
|
||||||
__GLXscreenConfigs *const psc = GetGLXScreenConfigs(dpy, screen);
|
__GLXscreenConfigs *psc = pdraw->psc;
|
||||||
if (psc->driScreen->copySubBuffer != NULL) {
|
if (psc->driScreen->copySubBuffer != NULL) {
|
||||||
glFlush();
|
glFlush();
|
||||||
(*psc->driScreen->copySubBuffer) (pdraw, x, y, width, height);
|
(*psc->driScreen->copySubBuffer) (pdraw, x, y, width, height);
|
||||||
|
Reference in New Issue
Block a user