From 2832cbea7ae078c0ad1ef93a6041d3d3bd0fd243 Mon Sep 17 00:00:00 2001 From: Iago Toral Quiroga Date: Tue, 15 Dec 2020 09:21:49 +0100 Subject: [PATCH] v3dv: fix BO list for TFU jobs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Instead of checking whether the source and destination are the same, we should check if the underlying BOs are the same, since we may be suballocating resources from the same allocation and the kernel will fail to execute jobs if the BO list has duplicated entries. Fixes aborts with Unreal Engine due to failed TFU jobs. Fixes: 30f1fc25ce ('v3dv: implement TFU blits') Reviewed-by: Alejandro PiƱeiro Part-of: --- src/broadcom/vulkan/v3dv_meta_copy.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/broadcom/vulkan/v3dv_meta_copy.c b/src/broadcom/vulkan/v3dv_meta_copy.c index f1d6893f73e..42c5bcdcaf0 100644 --- a/src/broadcom/vulkan/v3dv_meta_copy.c +++ b/src/broadcom/vulkan/v3dv_meta_copy.c @@ -1466,7 +1466,7 @@ emit_tfu_job(struct v3dv_cmd_buffer *cmd_buffer, .ios = (height << 16) | width, .bo_handles = { dst_bo->handle, - src != dst ? src_bo->handle : 0 + src_bo->handle != dst_bo->handle ? src_bo->handle : 0 }, }; @@ -2640,7 +2640,7 @@ copy_buffer_to_image_tfu(struct v3dv_cmd_buffer *cmd_buffer, .ios = (height << 16) | width, .bo_handles = { dst_bo->handle, - src_bo != dst_bo ? src_bo->handle : 0 + src_bo->handle != dst_bo->handle ? src_bo->handle : 0 }, };