OSDN Git Service

vl/dri3: fix a memory leak from front buffer
authorLeo Liu <leo.liu@amd.com>
Thu, 14 Jul 2016 13:19:59 +0000 (09:19 -0400)
committerEmil Velikov <emil.l.velikov@gmail.com>
Thu, 21 Jul 2016 12:46:55 +0000 (13:46 +0100)
commitaeb3ca97547a592e79269e6e5b08400d35b5e7e5
tree70d27aa8da6eb57ff24eab9ae0fb8f9acda41234
parentb1b601fc7ceba1f76846fdf150557b90487dceb8
vl/dri3: fix a memory leak from front buffer

Inspired by fix for mem leak of vdpau interop, resource_from_handle
set texture reference count, that need to be decreased and released,
recall there is a similar case for DRI3, that is with VA-API glx
extension, there is temporary TFP(texture from pixmap), we target it
through dma-buf. leak happens when without count down the reference.

Checked and found with mpv vo=opengl case, there only one static TFP,
the leak happens once, but for totem player using gstreamer VA-API glx,
the dynamic TFP for each frame, so leak quite a bit.

This fixes mem leak for mpv and totem.

Signed-off-by: Leo Liu <leo.liu@amd.com>
Cc: "12.0" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 134d6e4e4f980d738361bfcae1daedb8cc58b5df)
src/gallium/auxiliary/vl/vl_winsys_dri3.c