From 4f804ceecd658492234cbf0fa5fb1b156a8fb79c Mon Sep 17 00:00:00 2001 From: Tomeu Vizoso <tomeu.vizoso@collabora.com> Date: Thu, 19 Apr 2018 10:26:59 +0200 Subject: [PATCH] egl/surfaceless: Do without a KMS device if using kms_swrast kms_swrast can work without a KMS device, so don't fail to init if no device was found. This allows the platform to be used in machines where no KMS device at all is present. Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com> --- src/egl/drivers/dri2/platform_surfaceless.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/egl/drivers/dri2/platform_surfaceless.c b/src/egl/drivers/dri2/platform_surfaceless.c index 70b302c0ce4..ebd954cf5a7 100644 --- a/src/egl/drivers/dri2/platform_surfaceless.c +++ b/src/egl/drivers/dri2/platform_surfaceless.c @@ -305,6 +305,16 @@ surfaceless_probe_device(_EGLDisplay *dpy, bool swrast) dri2_dpy->driver_name = NULL; } + /* No rendernodes, so let's make it without one if we don't need real HW */ + if (swrast) { + dri2_dpy->driver_name = strdup("kms_swrast"); + dri2_dpy->fd = -1; + if (dri2_load_driver_dri3(dpy)) + return true; + free(dri2_dpy->driver_name); + dri2_dpy->driver_name = NULL; + } + return false; } -- GitLab