.flushFrontBuffer = surfaceless_flush_front_buffer,
};
+static const __DRIswrastLoaderExtension swrast_loader_extension = {
+ .base = { __DRI_SWRAST_LOADER, 1 },
+ .getDrawableInfo = NULL,
+ .putImage = NULL,
+ .getImage = NULL,
+};
+
#define DRM_RENDER_DEV_NAME "%s/renderD%d"
static const __DRIextension *image_loader_extensions[] = {
NULL,
};
+static const __DRIextension *swrast_loader_extensions[] = {
+ &swrast_loader_extension.base,
+ &image_loader_extension.base,
+ &image_lookup_extension.base,
+ &use_invalidate.base,
+ NULL,
+};
+
static bool
surfaceless_probe_device(_EGLDisplay *dpy, bool swrast)
{
if (fd < 0)
continue;
- if (swrast)
+ if (swrast) {
dri2_dpy->driver_name = strdup("kms_swrast");
- else
+ dri2_dpy->loader_extensions = swrast_loader_extensions;
+ } else {
dri2_dpy->driver_name = loader_get_driver_for_fd(fd);
+ dri2_dpy->loader_extensions = image_loader_extensions;
+ }
if (!dri2_dpy->driver_name) {
close(fd);
continue;
dri2_dpy->fd = -1;
free(dri2_dpy->driver_name);
dri2_dpy->driver_name = NULL;
+ dri2_dpy->loader_extensions = NULL;
}
return false;
goto cleanup;
}
- dri2_dpy->loader_extensions = image_loader_extensions;
-
if (!dri2_create_screen(disp)) {
err = "DRI2: failed to create screen";
goto cleanup;