aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers/va/context.c
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2015-11-23 14:03:47 -0800
committerJason Ekstrand <[email protected]>2015-11-23 14:03:47 -0800
commit179fc4aae8f782453f0488e8dd508f9a01117376 (patch)
tree5f0cc77b30d86b581fb968a71ba83c5e4c2546d7 /src/gallium/state_trackers/va/context.c
parente14b2c76b40398a61f45f5d058079641661a66cb (diff)
parentd9b8fde963a53d4e06570d8bece97f806714507a (diff)
Merge remote-tracking branch 'mesa-public/master' into vulkan
This pulls in nir cloning and some much-needed upstream refactors.
Diffstat (limited to 'src/gallium/state_trackers/va/context.c')
-rw-r--r--src/gallium/state_trackers/va/context.c23
1 files changed, 5 insertions, 18 deletions
diff --git a/src/gallium/state_trackers/va/context.c b/src/gallium/state_trackers/va/context.c
index 98c4104da48..f0051e5f6a5 100644
--- a/src/gallium/state_trackers/va/context.c
+++ b/src/gallium/state_trackers/va/context.c
@@ -102,7 +102,6 @@ PUBLIC VAStatus
VA_DRIVER_INIT_FUNC(VADriverContextP ctx)
{
vlVaDriver *drv;
- int drm_fd;
struct drm_state *drm_info;
if (!ctx)
@@ -119,26 +118,20 @@ VA_DRIVER_INIT_FUNC(VADriverContextP ctx)
return VA_STATUS_ERROR_UNIMPLEMENTED;
case VA_DISPLAY_GLX:
case VA_DISPLAY_X11:
- drv->vscreen = vl_screen_create(ctx->native_dpy, ctx->x11_screen);
+ drv->vscreen = vl_dri2_screen_create(ctx->native_dpy, ctx->x11_screen);
if (!drv->vscreen)
goto error_screen;
break;
case VA_DISPLAY_DRM:
case VA_DISPLAY_DRM_RENDERNODES: {
drm_info = (struct drm_state *) ctx->drm_state;
- if (!drm_info) {
- FREE(drv);
- return VA_STATUS_ERROR_INVALID_PARAMETER;
- }
-
- drm_fd = drm_info->fd;
- if (drm_fd < 0) {
+ if (!drm_info || drm_info->fd < 0) {
FREE(drv);
return VA_STATUS_ERROR_INVALID_PARAMETER;
}
- drv->vscreen = vl_drm_screen_create(drm_fd);
+ drv->vscreen = vl_drm_screen_create(drm_info->fd);
if (!drv->vscreen)
goto error_screen;
}
@@ -182,10 +175,7 @@ error_htab:
drv->pipe->destroy(drv->pipe);
error_pipe:
- if (ctx->display_type == VA_DISPLAY_GLX || ctx->display_type == VA_DISPLAY_X11)
- vl_screen_destroy(drv->vscreen);
- else
- vl_drm_screen_destroy(drv->vscreen);
+ drv->vscreen->destroy(drv->vscreen);
error_screen:
FREE(drv);
@@ -322,10 +312,7 @@ vlVaTerminate(VADriverContextP ctx)
vl_compositor_cleanup_state(&drv->cstate);
vl_compositor_cleanup(&drv->compositor);
drv->pipe->destroy(drv->pipe);
- if (ctx->display_type == VA_DISPLAY_GLX || ctx->display_type == VA_DISPLAY_X11)
- vl_screen_destroy(drv->vscreen);
- else
- vl_drm_screen_destroy(drv->vscreen);
+ drv->vscreen->destroy(drv->vscreen);
handle_table_destroy(drv->htab);
FREE(drv);