radv/winsys: do not try to create a BO list with 0 buffers
This happens when all BOs have the RADEON_FLAG_NO_INTERPROCESS_SHARING (DRM version >= 3.23) flag set. This flag is mainly used for reducing overhead on the userspace side because we don't have to put those BOs inside the list. Though, if the driver tries to create a list with 0 buffers inside it, libdrm returns -EINVAL and the app just crashes. This fixes a bunch of CTS dEQP-VK.sparse_resources.* fails (~100). Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Reviewed-by: Dave Airlie <airlied@redhat.com> Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
This commit is contained in:
parent
f1873956db
commit
15c0df785b
|
@ -518,7 +518,8 @@ static int radv_amdgpu_create_bo_list(struct radv_amdgpu_winsys *ws,
|
|||
struct radeon_winsys_cs *extra_cs,
|
||||
amdgpu_bo_list_handle *bo_list)
|
||||
{
|
||||
int r;
|
||||
int r = 0;
|
||||
|
||||
if (ws->debug_all_bos) {
|
||||
struct radv_amdgpu_winsys_bo *bo;
|
||||
amdgpu_bo_handle *handles;
|
||||
|
@ -636,8 +637,13 @@ static int radv_amdgpu_create_bo_list(struct radv_amdgpu_winsys *ws,
|
|||
}
|
||||
}
|
||||
}
|
||||
r = amdgpu_bo_list_create(ws->dev, unique_bo_count, handles,
|
||||
priorities, bo_list);
|
||||
|
||||
if (unique_bo_count > 0) {
|
||||
r = amdgpu_bo_list_create(ws->dev, unique_bo_count, handles,
|
||||
priorities, bo_list);
|
||||
} else {
|
||||
*bo_list = 0;
|
||||
}
|
||||
|
||||
free(handles);
|
||||
free(priorities);
|
||||
|
|
Loading…
Reference in New Issue