v3dv: implement device detection on actual hardware
authorIago Toral Quiroga <itoral@igalia.com>
Mon, 20 Jan 2020 09:45:06 +0000 (10:45 +0100)
committerMarge Bot <eric+marge@anholt.net>
Tue, 13 Oct 2020 21:21:26 +0000 (21:21 +0000)
commit1d92c314f858e4ffa2e9328030d6e47a28ac6b5f
tree5c61da6d43cb5a57417618d63e6ef6f8fae7ccad
parent1ae844c1c899d7fa7bb2a20a5dfa733bc2450f6a
v3dv: implement device detection on actual hardware

When running on the real hardware we have two devices: the v3d render
node and the vc4 display node. We need the latter to allocate
winsys BOs for v3d to render into. Since exporting these BOs is
a privileged operation, we need to obtain the fd for this device
through the display server. For now we only support doing this through
the XCB DRI3 platform.

Also, do not duplicate or re-open the DRM devices when creating logical
devices. The simulator checks that the file descriptor is exactly
the same we used to initialize it when we created the physical device
and aborts if it sees a different fd number, even if it points to the
same device.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6766>
src/broadcom/vulkan/v3dv_device.c
src/broadcom/vulkan/v3dv_private.h