Comment 25 for bug 328232

Revision history for this message
In , portis (portis24) wrote :

(In reply to comment #19)
> FYI, latest fix is from Michel (see below), hopefully it will be pushed soon.
>
>
> diff --git a/glx/glxext.c b/glx/glxext.c
> index c882372..e74d00e 100644
> --- a/glx/glxext.c
> +++ b/glx/glxext.c
> @@ -119,17 +119,25 @@ static int ContextGone(__GLXcontext* cx, XID id)
> static Bool DrawableGone(__GLXdrawable *glxPriv, XID xid)
> {
> ScreenPtr pScreen = glxPriv->pDraw->pScreen;
> + PixmapPtr pPixmap = NULL;
> + int refcount;
>
> switch (glxPriv->type) {
> case GLX_DRAWABLE_PIXMAP:
> case GLX_DRAWABLE_PBUFFER:
> - (*pScreen->DestroyPixmap)((PixmapPtr) glxPriv->pDraw);
> + pPixmap = (PixmapPtr) glxPriv->pDraw;
> break;
> }
>
> - glxPriv->pDraw = NULL;
> - glxPriv->drawId = 0;
> + refcount = glxPriv->refCount;
> __glXUnrefDrawable(glxPriv);
> + if (refcount > 1) {
> + glxPriv->pDraw = NULL;
> + glxPriv->drawId = 0;
> + }
> +
> + if (pPixmap)
> + (*pScreen->DestroyPixmap)(pPixmap);
>
> return True;
> }
>

This is what I get with this patch. After running 2h55m:

sudo lsof | grep "drm mm object" | wc -l
3695

cat /proc/dri/0/gem_objects
13819 objects
1520975872 object bytes
4 pinned
13828096 pin bytes
244764672 gtt bytes
260313088 gtt total