pipe-loader: add pipe_loader_get_compatible_render_capable_device_fd()
pipe_loader_get_compatible_render_capable_device_fd() receives the fd of
a KMS-only platform device, find a compatible render-only device that is
available and returns the fd of its DRM render node.
This function will be helpful to fix a long standing issue that is
preventing us to add support for EGL_EXT_device_drm_render_node for
split display/render SoCs. And it will also help KMSRO to select a
render-only driver that we are sure that is compatible, because
currently KMSRO uses whatever render-only driver is available.
In sort, in the EGL GBM platform case, the GBM device may be created
with a KMS-only device. The information of what render driver will be
selected by KMSRO is not available before creating the EGLDevice global
list. Without this information we don't have a render node to use in the
EGL_EXT_device_drm_render_node query. We've tried to fix this before,
but failed. See [1-2].
For the moment, this function only works for platform KMS-only devices.
For other types of KMS-only devices, we'll need to add more heuristics.
[1] Detailed explanation of the issue:
https://gitlab.freedesktop.org/mesa/mesa/-/issues/5591
[2] Previous attempt to fix:
https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12796
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
Reviewed-by: Simon Ser <contact@emersion.fr>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24825>