st/dri: Allow kms_swrast to work without a device FD
A KMS device isn't strictly needed for the kms_swrast to work, so stop
failing to init if the FD is -1. Also don't call DRM_IOCTL_GET_CAP in
that case.
This allows the driver to be used in machines where no KMS device at all
is present.
Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
-
With these in place one ends up (most or less) with drisw_init_screen().
Major difference is that the latter uses the DRISW winsys. Maybe we'd want something like null_swrast_dri.so - or although it would be much better of explicitly request the winsys we'd want to use without making one extra module for each possible winsys.
As-is things look very hacky. kms_swrast was introduced because you need an actual KMS device for its dumb buffers.
Edit: Thinking about "explicitly request the winsys" suggestion, the following came to mind:
Introduce createNewScreen3/selectWinsysType or other entry point to the __DRI_SWRAST extension that allows one to say "I want null/kms/dri/wrapper winsys". Then frontends like EGL/surfaceless can explicitly request the null one.
Edited by Emil Velikov