From ccec1555c154a9c11b61127671c30553096856c8 Mon Sep 17 00:00:00 2001 From: Alexandros Frantzis Date: Tue, 4 Jun 2019 16:43:31 +0300 Subject: [PATCH] virgl: Make VIRGL_BIND_STAGING resources cacheable This could help performance when trying to recreate such resources for copy transfers. Signed-off-by: Alexandros Frantzis Reviewed-by: Chia-I Wu --- src/gallium/winsys/virgl/drm/virgl_drm_winsys.c | 3 ++- src/gallium/winsys/virgl/vtest/virgl_vtest_winsys.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/gallium/winsys/virgl/drm/virgl_drm_winsys.c b/src/gallium/winsys/virgl/drm/virgl_drm_winsys.c index f2c41bbc903..0f6403f691f 100644 --- a/src/gallium/winsys/virgl/drm/virgl_drm_winsys.c +++ b/src/gallium/winsys/virgl/drm/virgl_drm_winsys.c @@ -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, diff --git a/src/gallium/winsys/virgl/vtest/virgl_vtest_winsys.c b/src/gallium/winsys/virgl/vtest/virgl_vtest_winsys.c index ccacb81d233..9ab068b27bf 100644 --- a/src/gallium/winsys/virgl/vtest/virgl_vtest_winsys.c +++ b/src/gallium/winsys/virgl/vtest/virgl_vtest_winsys.c @@ -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, -- 2.30.2