[Mesa-dev] [Review Request (master branch) 1/2] svga: Ensure copy_region_fallback can be used for resource copy

Neha Bhende bhenden at vmware.com
Wed Jan 29 16:10:26 UTC 2020


Verify preconditions for copy_region_fallback() before using it, else
try cpu_blit if it fails to meet preconditions

Fixes crash with viewperf after merged-master-2019-12-10

Fixes: b30589cbd3dd ("mesa/st: Reuse st_choose_matching_format from st_choose_format()")

Reviewed-by: Charmaine Lee <charmainel at vmware.com
---
 src/gallium/drivers/svga/svga_pipe_blit.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/svga/svga_pipe_blit.c b/src/gallium/drivers/svga/svga_pipe_blit.c
index d889d4a13a8..242b4110220 100644
--- a/src/gallium/drivers/svga/svga_pipe_blit.c
+++ b/src/gallium/drivers/svga/svga_pipe_blit.c
@@ -881,8 +881,10 @@ svga_resource_copy_region(struct pipe_context *pipe,
           try_blit(svga, &blit))
          goto done;
 
-      copy_region_fallback(svga, dst_tex, dst_level, dstx, dsty, dstz,
-                           src_tex, src_level, src_box);
+      if (!try_cpu_copy_region(svga, &blit)) {
+         if (!try_cpu_blit(svga, &blit))
+            debug_printf("Blit failed.\n");
+      }
    }
 
 done:
-- 
2.17.1



More information about the mesa-dev mailing list