res: Account for GLXPixmap references too
GLX_EXT_tetxure_from_pixmap operates on a GLXPixmap, which takes a reference on the backing pixmap; that GLXPixmap might be long-lived, so we should account for it in ResQueryClientPixmapBytes. Acked-by: Michel Dänzer <michel.daenzer@amd.com> Signed-off-by: Adam Jackson <ajax@redhat.com>
This commit is contained in:
parent
5d6ad0d3a7
commit
ce82ae1964
19
glx/glxext.c
19
glx/glxext.c
|
@ -336,6 +336,23 @@ checkScreenVisuals(void)
|
||||||
return False;
|
return False;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
GetGLXDrawableBytes(void *value, XID id, ResourceSizePtr size)
|
||||||
|
{
|
||||||
|
__GLXdrawable *draw = value;
|
||||||
|
|
||||||
|
size->resourceSize = 0;
|
||||||
|
size->pixmapRefSize = 0;
|
||||||
|
size->refCnt = 1;
|
||||||
|
|
||||||
|
if (draw->type == GLX_DRAWABLE_PIXMAP) {
|
||||||
|
SizeType pixmapSizeFunc = GetResourceTypeSizeFunc(RT_PIXMAP);
|
||||||
|
ResourceSizeRec pixmapSize = { 0, };
|
||||||
|
pixmapSizeFunc((PixmapPtr)draw->pDraw, draw->pDraw->id, &pixmapSize);
|
||||||
|
size->pixmapRefSize += pixmapSize.pixmapRefSize;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** Initialize the GLX extension.
|
** Initialize the GLX extension.
|
||||||
*/
|
*/
|
||||||
|
@ -365,6 +382,8 @@ GlxExtensionInit(void)
|
||||||
if (!__glXContextRes || !__glXDrawableRes)
|
if (!__glXContextRes || !__glXDrawableRes)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
SetResourceTypeSizeFunc(__glXDrawableRes, GetGLXDrawableBytes);
|
||||||
|
|
||||||
if (!dixRegisterPrivateKey
|
if (!dixRegisterPrivateKey
|
||||||
(&glxClientPrivateKeyRec, PRIVATE_CLIENT, sizeof(__GLXclientState)))
|
(&glxClientPrivateKeyRec, PRIVATE_CLIENT, sizeof(__GLXclientState)))
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in New Issue