virgl: enable robustness if the host exposes it
authorDave Airlie <airlied@redhat.com>
Mon, 30 Jul 2018 18:45:15 +0000 (04:45 +1000)
committerDave Airlie <airlied@redhat.com>
Wed, 1 Aug 2018 04:00:38 +0000 (14:00 +1000)
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
src/gallium/drivers/virgl/virgl_hw.h
src/gallium/drivers/virgl/virgl_screen.c

index 3ccc979ac8cf4d4f703cdb82f07f7883a96f1bfc..487cbd6782494e653c91153f70eb55c059920982 100644 (file)
@@ -208,6 +208,7 @@ enum virgl_formats {
 #define VIRGL_CAP_MEMORY_BARRIER       (1 << 6)
 #define VIRGL_CAP_COMPUTE_SHADER       (1 << 7)
 #define VIRGL_CAP_FB_NO_ATTACH         (1 << 8)
+#define VIRGL_CAP_ROBUST_BUFFER_ACCESS (1 << 9)
 
 #define VIRGL_BIND_DEPTH_STENCIL (1 << 0)
 #define VIRGL_BIND_RENDER_TARGET (1 << 1)
index 223eb6f229bef51741965dc9c62811e16bfcfe05..fc43bf9dfc3318d203d62612ff7ebe5681200cce 100644 (file)
@@ -227,6 +227,8 @@ virgl_get_param(struct pipe_screen *screen, enum pipe_cap param)
       return vscreen->caps.caps.v2.capability_bits & VIRGL_CAP_TXQS;
    case PIPE_CAP_FRAMEBUFFER_NO_ATTACHMENT:
       return vscreen->caps.caps.v2.capability_bits & VIRGL_CAP_FB_NO_ATTACH;
+   case PIPE_CAP_ROBUST_BUFFER_ACCESS_BEHAVIOR:
+      return vscreen->caps.caps.v2.capability_bits & VIRGL_CAP_ROBUST_BUFFER_ACCESS;
    case PIPE_CAP_TEXTURE_GATHER_SM5:
    case PIPE_CAP_BUFFER_MAP_PERSISTENT_COHERENT:
    case PIPE_CAP_FAKE_SW_MSAA:
@@ -258,7 +260,6 @@ virgl_get_param(struct pipe_screen *screen, enum pipe_cap param)
    case PIPE_CAP_PCI_BUS:
    case PIPE_CAP_PCI_DEVICE:
    case PIPE_CAP_PCI_FUNCTION:
-   case PIPE_CAP_ROBUST_BUFFER_ACCESS_BEHAVIOR:
    case PIPE_CAP_PRIMITIVE_RESTART_FOR_PATCHES:
    case PIPE_CAP_TGSI_VOTE:
    case PIPE_CAP_MAX_WINDOW_RECTANGLES: