Skip to content
Snippets Groups Projects
Commit 4f804cee authored by Tomeu Vizoso's avatar Tomeu Vizoso
Browse files

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: default avatarTomeu Vizoso <tomeu.vizoso@collabora.com>
parent 54adda6a
No related merge requests found
......@@ -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;
}
......
  • You and Pekka are right - surfaceless does not really need any KMS specifics/dumb buffers and alike. Since it's more or less identical to OSMesa the "null" SW winsys out to be enough - that one is part of the normal gallium swrast_dri.so.

    I believe the KMS one was used here since it provides extra DRI extension features (the drmGetCap hunk etc). So here I'd just go with:

    • removing the swrast (aka reverting the commit that introduces it), and
    • setting up only the driver_name (to swrast) in case of software rendering
    Edited by Emil Velikov
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment