virgl: Support VIRGL_BIND_SHARED
authorDavid Riley <davidriley@chromium.org>
Thu, 13 Jun 2019 00:16:35 +0000 (17:16 -0700)
committerDavid Riley <davidriley@chromium.org>
Wed, 19 Jun 2019 14:28:47 +0000 (07:28 -0700)
Support a new virgl bind type for shared buffers.

Signed-off-by: David Riley <davidriley@chormium.org>
Reviewed-By: Gert Wollny <gert.wollny@collabora.com>
src/gallium/drivers/virgl/virgl_hw.h
src/gallium/drivers/virgl/virgl_resource.h

index 7f300e5cd1549254bcbd805caa8a9345c522babc..3104e1bb1b16fc1927b99760a93df6bb58681111 100644 (file)
@@ -277,6 +277,7 @@ enum virgl_formats {
  * are only read by the host.
  */
 #define VIRGL_BIND_STAGING       (1 << 19)
+#define VIRGL_BIND_SHARED        (1 << 20)
 
 struct virgl_caps_bool_set1 {
         unsigned indep_blend_enable:1;
index c3374fbef70456f843adfe3cc90b97ce68f9a3e7..f9439a9489fb14637cbf6b2b3a564d16f3b72157 100644 (file)
@@ -152,6 +152,8 @@ static inline unsigned pipe_to_virgl_bind(const struct virgl_screen *vs,
    }
    if (pbind & PIPE_BIND_SCANOUT)
       outbind |= VIRGL_BIND_SCANOUT;
+   if (pbind & PIPE_BIND_SHARED)
+      outbind |= VIRGL_BIND_SHARED;
    if (pbind & PIPE_BIND_SHADER_BUFFER)
       outbind |= VIRGL_BIND_SHADER_BUFFER;
    if (pbind & PIPE_BIND_QUERY_BUFFER)