[Mesa-dev] [PATCH] st/va: fix incorrect use of resource_destroy
Marek Olšák
maraeo at gmail.com
Sat Nov 3 00:56:42 UTC 2018
From: Marek Olšák <marek.olsak at amd.com>
---
src/gallium/state_trackers/va/surface.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/src/gallium/state_trackers/va/surface.c b/src/gallium/state_trackers/va/surface.c
index 5376be28531..9646427ea5f 100644
--- a/src/gallium/state_trackers/va/surface.c
+++ b/src/gallium/state_trackers/va/surface.c
@@ -591,24 +591,22 @@ surface_from_external_memory(VADriverContextP ctx, vlVaSurface *surface,
}
surface->buffer = vl_video_buffer_create_ex2(drv->pipe, templat, resources);
if (!surface->buffer) {
result = VA_STATUS_ERROR_ALLOCATION_FAILED;
goto fail;
}
return VA_STATUS_SUCCESS;
fail:
- for (i = 0; i < VL_NUM_COMPONENTS; i++) {
- if (resources[i])
- pscreen->resource_destroy(pscreen, resources[i]);
- }
+ for (i = 0; i < VL_NUM_COMPONENTS; i++)
+ pipe_resource_reference(&resources[i], NULL);
return result;
}
VAStatus
vlVaHandleSurfaceAllocate(vlVaDriver *drv, vlVaSurface *surface,
struct pipe_video_buffer *templat)
{
struct pipe_surface **surfaces;
unsigned i;
--
2.17.1
More information about the mesa-dev
mailing list