[Mesa-dev] [PATCH v2 15/27] st/va: check if vl_*_screen_create has failed only once

Emil Velikov emil.l.velikov at gmail.com
Thu May 4 16:33:06 UTC 2017


From: Emil Velikov <emil.velikov at collabora.com>

Signed-off-by: Emil Velikov <emil.velikov at collabora.com>
Reviewed-by: Nayan Deshmukh <nayan26deshmukh at gmail.com>
---
 src/gallium/state_trackers/va/context.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/src/gallium/state_trackers/va/context.c b/src/gallium/state_trackers/va/context.c
index 44d25aed8dc..ae9154a332a 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)
-- 
2.12.2



More information about the mesa-dev mailing list