virgl: Make VIRGL_BIND_STAGING resources cacheable
authorAlexandros Frantzis <alexandros.frantzis@collabora.com>
Tue, 4 Jun 2019 13:43:31 +0000 (16:43 +0300)
committerChia-I Wu <olvaffe@gmail.com>
Sat, 8 Jun 2019 04:45:33 +0000 (21:45 -0700)
This could help performance when trying to recreate such resources for
copy transfers.

Signed-off-by: Alexandros Frantzis <alexandros.frantzis@collabora.com>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
src/gallium/winsys/virgl/drm/virgl_drm_winsys.c
src/gallium/winsys/virgl/vtest/virgl_vtest_winsys.c

index f2c41bbc903dda7ec178d0547c19ef2a09c05c3d..0f6403f691fcd5202dc4672bebb6dd5e2b879daa 100644 (file)
@@ -55,7 +55,8 @@ static inline boolean can_cache_resource_with_bind(uint32_t bind)
    return bind == VIRGL_BIND_CONSTANT_BUFFER ||
           bind == VIRGL_BIND_INDEX_BUFFER ||
           bind == VIRGL_BIND_VERTEX_BUFFER ||
-          bind == VIRGL_BIND_CUSTOM;
+          bind == VIRGL_BIND_CUSTOM ||
+          bind == VIRGL_BIND_STAGING;
 }
 
 static void virgl_hw_res_destroy(struct virgl_drm_winsys *qdws,
index ccacb81d23385bf66ef13c6666b41f3ca30b59b3..9ab068b27bf0a55312aee3d331692fae824a114e 100644 (file)
@@ -42,7 +42,8 @@ static inline boolean can_cache_resource_with_bind(uint32_t bind)
    return bind == VIRGL_BIND_CONSTANT_BUFFER ||
           bind == VIRGL_BIND_INDEX_BUFFER ||
           bind == VIRGL_BIND_VERTEX_BUFFER ||
-          bind == VIRGL_BIND_CUSTOM;
+          bind == VIRGL_BIND_CUSTOM ||
+          bind == VIRGL_BIND_STAGING;
 }
 
 static uint32_t vtest_get_transfer_size(struct virgl_hw_res *res,