amdgpu: Add new function to get fd.
authorBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Tue, 16 Nov 2021 00:41:49 +0000 (01:41 +0100)
committerBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Tue, 23 Nov 2021 16:02:05 +0000 (16:02 +0000)
commitf70e8ae83590d2a1fb1972dc7e875dd6a9355b77
tree85314d99f17bab58881bf770e560186f3f1e5240
parentb40d0a7d6c247347f777c417e92f84ec67ea0b39
amdgpu: Add new function to get fd.

Dual purpose:
 - The drm fd dedupe functionality confuses the radeonsi
   amdgpu winsys if radeonsi isn't the first thing opening
   the device. By exposing the fd we can detect this case.
 - For a common mesa Vulkan sync objects implementation
   with syncobj. (notable: no buffer allocation)

Both shouldn't interferece with libdrm_amdgpu functionality
though it does somewhat piece the abstraction of the library.

Signed-off-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Gitlab: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3424
Gitlab: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5630
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
amdgpu/amdgpu-symbols.txt
amdgpu/amdgpu.h
amdgpu/amdgpu_device.c