From 28703d605dbf660964c19edb719ea403aafb8b61 Mon Sep 17 00:00:00 2001 From: Emil Velikov Date: Wed, 7 Dec 2016 14:04:03 +0000 Subject: st/va: check if vl_*_screen_create has failed only once MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Emil Velikov Reviewed-by: Nayan Deshmukh Reviewed-by: Christian König --- src/gallium/state_trackers/va/context.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/gallium/state_trackers') diff --git a/src/gallium/state_trackers/va/context.c b/src/gallium/state_trackers/va/context.c index 44d25aed8d..ae9154a332 100644 --- a/src/gallium/state_trackers/va/context.c +++ b/src/gallium/state_trackers/va/context.c @@ -120,8 +120,6 @@ VA_DRIVER_INIT_FUNC(VADriverContextP ctx) drv->vscreen = vl_dri3_screen_create(ctx->native_dpy, ctx->x11_screen); if (!drv->vscreen) drv->vscreen = vl_dri2_screen_create(ctx->native_dpy, ctx->x11_screen); - if (!drv->vscreen) - goto error_screen; break; case VA_DISPLAY_WAYLAND: case VA_DISPLAY_DRM: @@ -134,8 +132,6 @@ VA_DRIVER_INIT_FUNC(VADriverContextP ctx) } drv->vscreen = vl_drm_screen_create(drm_info->fd); - if (!drv->vscreen) - goto error_screen; break; } default: @@ -143,6 +139,9 @@ VA_DRIVER_INIT_FUNC(VADriverContextP ctx) return VA_STATUS_ERROR_INVALID_DISPLAY; } + if (!drv->vscreen) + goto error_screen; + drv->pipe = drv->vscreen->pscreen->context_create(drv->vscreen->pscreen, drv->vscreen, 0); if (!drv->pipe) -- cgit v1.2.3