summaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers/va/context.c
diff options
context:
space:
mode:
authorNayan Deshmukh <[email protected]>2017-01-03 16:17:47 +0530
committerChristian König <[email protected]>2017-01-03 12:02:15 +0100
commitb6737a8bcd03ea68952799144c0c6e6e6679bee9 (patch)
tree3c679b1f9ba8579a044bfaaef612e1f9952ee8d5 /src/gallium/state_trackers/va/context.c
parent29aad4e8bd72fc022ade03f49bc8aa25419a3773 (diff)
st/va: error handling
handle the cases when vl_compositor_set_csc_matrix(), vl_compositor_init_state() and vl_compositor_init() fail Signed-off-by: Nayan Deshmukh <[email protected]> Reviewed-by: Christian König <[email protected]>
Diffstat (limited to 'src/gallium/state_trackers/va/context.c')
-rw-r--r--src/gallium/state_trackers/va/context.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/src/gallium/state_trackers/va/context.c b/src/gallium/state_trackers/va/context.c
index 65ba7db4de7..884b7947f1c 100644
--- a/src/gallium/state_trackers/va/context.c
+++ b/src/gallium/state_trackers/va/context.c
@@ -155,11 +155,14 @@ VA_DRIVER_INIT_FUNC(VADriverContextP ctx)
if (!drv->htab)
goto error_htab;
- vl_compositor_init(&drv->compositor, drv->pipe);
- vl_compositor_init_state(&drv->cstate, drv->pipe);
+ if (!vl_compositor_init(&drv->compositor, drv->pipe))
+ goto error_compositor;
+ if (!vl_compositor_init_state(&drv->cstate, drv->pipe))
+ goto error_compositor_state;
vl_csc_get_matrix(VL_CSC_COLOR_STANDARD_BT_601, NULL, true, &drv->csc);
- vl_compositor_set_csc_matrix(&drv->cstate, (const vl_csc_matrix *)&drv->csc, 1.0f, 0.0f);
+ if (!vl_compositor_set_csc_matrix(&drv->cstate, (const vl_csc_matrix *)&drv->csc, 1.0f, 0.0f))
+ goto error_csc_matrix;
pipe_mutex_init(drv->mutex);
ctx->pDriverData = (void *)drv;
@@ -177,6 +180,15 @@ VA_DRIVER_INIT_FUNC(VADriverContextP ctx)
return VA_STATUS_SUCCESS;
+error_csc_matrix:
+ vl_compositor_cleanup_state(&drv->cstate);
+
+error_compositor_state:
+ vl_compositor_cleanup(&drv->cstate);
+
+error_compositor:
+ handle_table_destroy(drv->htab);
+
error_htab:
drv->pipe->destroy(drv->pipe);