From 6fb42ee7a632e181160ac4be234b30e50a1b91d5 Mon Sep 17 00:00:00 2001 From: Christian König Date: Wed, 13 Aug 2014 15:49:18 +0200 Subject: st/vdpau: add device reference counting MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This fixes an issue with flash where it tries to destroy a decoder after already destroying the device associated with the decoder. Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=82517 Signed-off-by: Christian König Acked-by: Ilia Mirkin --- src/gallium/state_trackers/vdpau/bitmap.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/gallium/state_trackers/vdpau/bitmap.c') diff --git a/src/gallium/state_trackers/vdpau/bitmap.c b/src/gallium/state_trackers/vdpau/bitmap.c index a06892132e9..97a428727a5 100644 --- a/src/gallium/state_trackers/vdpau/bitmap.c +++ b/src/gallium/state_trackers/vdpau/bitmap.c @@ -67,7 +67,7 @@ vlVdpBitmapSurfaceCreate(VdpDevice device, if (!vlsurface) return VDP_STATUS_RESOURCES; - vlsurface->device = dev; + DeviceReference(&vlsurface->device, dev); memset(&res_tmpl, 0, sizeof(res_tmpl)); res_tmpl.target = PIPE_TEXTURE_2D; @@ -117,6 +117,7 @@ err_sampler: pipe_sampler_view_reference(&vlsurface->sampler_view, NULL); err_unlock: pipe_mutex_unlock(dev->mutex); + DeviceReference(&vlsurface->device, NULL); FREE(vlsurface); return ret; } @@ -138,6 +139,7 @@ vlVdpBitmapSurfaceDestroy(VdpBitmapSurface surface) pipe_mutex_unlock(vlsurface->device->mutex); vlRemoveDataHTAB(surface); + DeviceReference(&vlsurface->device, NULL); FREE(vlsurface); return VDP_STATUS_OK; -- cgit v1.2.3