summaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers/vdpau/presentation.c
diff options
context:
space:
mode:
authorChristian König <christian.koenig@amd.com>2014-08-13 15:49:18 +0200
committerChristian König <christian.koenig@amd.com>2014-08-14 11:57:07 +0200
commit6fb42ee7a632e181160ac4be234b30e50a1b91d5 (patch)
tree962b6f4da56cdc0d8791f65177a4ce111dc0a966 /src/gallium/state_trackers/vdpau/presentation.c
parentc1df492d03862f75698ba5d50d4f46cd528ffc0d (diff)
downloadexternal_mesa3d-6fb42ee7a632e181160ac4be234b30e50a1b91d5.zip
external_mesa3d-6fb42ee7a632e181160ac4be234b30e50a1b91d5.tar.gz
external_mesa3d-6fb42ee7a632e181160ac4be234b30e50a1b91d5.tar.bz2
st/vdpau: add device reference counting
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 <christian.koenig@amd.com> Acked-by: Ilia Mirkin <imirkin@alum.mit.edu>
Diffstat (limited to 'src/gallium/state_trackers/vdpau/presentation.c')
-rw-r--r--src/gallium/state_trackers/vdpau/presentation.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/gallium/state_trackers/vdpau/presentation.c b/src/gallium/state_trackers/vdpau/presentation.c
index cb6cb38..7f8dbed 100644
--- a/src/gallium/state_trackers/vdpau/presentation.c
+++ b/src/gallium/state_trackers/vdpau/presentation.c
@@ -62,7 +62,7 @@ vlVdpPresentationQueueCreate(VdpDevice device,
if (!pq)
return VDP_STATUS_RESOURCES;
- pq->device = dev;
+ DeviceReference(&pq->device, dev);
pq->drawable = pqt->drawable;
pipe_mutex_lock(dev->mutex);
@@ -83,6 +83,7 @@ vlVdpPresentationQueueCreate(VdpDevice device,
no_handle:
no_compositor:
+ DeviceReference(&pq->device, NULL);
FREE(pq);
return ret;
}
@@ -104,6 +105,7 @@ vlVdpPresentationQueueDestroy(VdpPresentationQueue presentation_queue)
pipe_mutex_unlock(pq->device->mutex);
vlRemoveDataHTAB(presentation_queue);
+ DeviceReference(&pq->device, NULL);
FREE(pq);
return VDP_STATUS_OK;