radv/winsys: do not try to create a BO list with 0 buffers
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Wed, 22 Nov 2017 19:13:25 +0000 (20:13 +0100)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Fri, 24 Nov 2017 10:18:38 +0000 (11:18 +0100)
commit15c0df785b85ccf6cf33f3730dd3b4152b7a49e6
tree510cd33b4365b7c1b1c9e0d06be61ed15fc86527
parentf1873956dbbde78a9e4fb2df3cd2049891740bba
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>
src/amd/vulkan/winsys/amdgpu/radv_amdgpu_cs.c