st/va: add dri3 support
authorLeo Liu <leo.liu@amd.com>
Mon, 25 Apr 2016 20:07:21 +0000 (16:07 -0400)
committerLeo Liu <leo.liu@amd.com>
Mon, 16 May 2016 20:28:51 +0000 (16:28 -0400)
Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
src/gallium/state_trackers/va/context.c

index 25d587af46fa9fe48cf887d7837e893cb65fb595..93ab3d98ec267f20cc4a673ac9d7caab203e81e4 100644 (file)
@@ -119,7 +119,11 @@ VA_DRIVER_INIT_FUNC(VADriverContextP ctx)
       return VA_STATUS_ERROR_UNIMPLEMENTED;
    case VA_DISPLAY_GLX:
    case VA_DISPLAY_X11:
-      drv->vscreen = vl_dri2_screen_create(ctx->native_dpy, ctx->x11_screen);
+#if defined(HAVE_DRI3)
+      drv->vscreen = vl_dri3_screen_create(ctx->native_dpy, ctx->x11_screen);
+#endif
+      if (!drv->vscreen)
+         drv->vscreen = vl_dri2_screen_create(ctx->native_dpy, ctx->x11_screen);
       if (!drv->vscreen)
          goto error_screen;
       break;