pipe-loader: add pipe_loader_get_compatible_render_capable_device_fd()
authorLeandro Ribeiro <leandro.ribeiro@collabora.com>
Thu, 17 Aug 2023 21:20:50 +0000 (18:20 -0300)
committerMarge Bot <emma+marge@anholt.net>
Tue, 17 Oct 2023 20:31:13 +0000 (20:31 +0000)
commit2b6a42191525cb43484a704c0426192a5de3d863
tree9316cade3decde8499cee62fe50c62da2e4008c1
parent3c977f55f5afd8b34c233df895a4936e9d1770a8
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>
src/gallium/auxiliary/pipe-loader/meson.build
src/gallium/auxiliary/pipe-loader/pipe_loader.h
src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c
src/gallium/winsys/kmsro/drm/meson.build