summaryrefslogtreecommitdiffstats
path: root/src/egl
diff options
context:
space:
mode:
Diffstat (limited to 'src/egl')
-rw-r--r--src/egl/drivers/dri2/egl_dri2.c30
-rw-r--r--src/egl/drivers/dri2/egl_dri2.h1
2 files changed, 25 insertions, 6 deletions
diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c
index c2576846380..a64f4e8e9c2 100644
--- a/src/egl/drivers/dri2/egl_dri2.c
+++ b/src/egl/drivers/dri2/egl_dri2.c
@@ -449,6 +449,7 @@ dri2_load_driver(_EGLDisplay *disp)
dlclose(dri2_dpy->driver);
return EGL_FALSE;
}
+ dri2_dpy->driver_extensions = extensions;
return EGL_TRUE;
}
@@ -469,6 +470,7 @@ dri2_load_driver_swrast(_EGLDisplay *disp)
dlclose(dri2_dpy->driver);
return EGL_FALSE;
}
+ dri2_dpy->driver_extensions = extensions;
return EGL_TRUE;
}
@@ -534,14 +536,30 @@ dri2_create_screen(_EGLDisplay *disp)
dri2_dpy = disp->DriverData;
if (dri2_dpy->dri2) {
- dri2_dpy->dri_screen =
- dri2_dpy->dri2->createNewScreen(0, dri2_dpy->fd, dri2_dpy->extensions,
- &dri2_dpy->driver_configs, disp);
+ if (dri2_dpy->dri2->base.version >= 4) {
+ dri2_dpy->dri_screen =
+ dri2_dpy->dri2->createNewScreen2(0, dri2_dpy->fd,
+ dri2_dpy->extensions,
+ dri2_dpy->driver_extensions,
+ &dri2_dpy->driver_configs, disp);
+ } else {
+ dri2_dpy->dri_screen =
+ dri2_dpy->dri2->createNewScreen(0, dri2_dpy->fd,
+ dri2_dpy->extensions,
+ &dri2_dpy->driver_configs, disp);
+ }
} else {
assert(dri2_dpy->swrast);
- dri2_dpy->dri_screen =
- dri2_dpy->swrast->createNewScreen(0, dri2_dpy->extensions,
- &dri2_dpy->driver_configs, disp);
+ if (dri2_dpy->swrast->base.version >= 4) {
+ dri2_dpy->dri_screen =
+ dri2_dpy->swrast->createNewScreen2(0, dri2_dpy->extensions,
+ dri2_dpy->driver_extensions,
+ &dri2_dpy->driver_configs, disp);
+ } else {
+ dri2_dpy->dri_screen =
+ dri2_dpy->swrast->createNewScreen(0, dri2_dpy->extensions,
+ &dri2_dpy->driver_configs, disp);
+ }
}
if (dri2_dpy->dri_screen == NULL) {
diff --git a/src/egl/drivers/dri2/egl_dri2.h b/src/egl/drivers/dri2/egl_dri2.h
index 4a39efbde09..c7d64846c7e 100644
--- a/src/egl/drivers/dri2/egl_dri2.h
+++ b/src/egl/drivers/dri2/egl_dri2.h
@@ -118,6 +118,7 @@ struct dri2_egl_display
__DRIdri2LoaderExtension dri2_loader_extension;
__DRIswrastLoaderExtension swrast_loader_extension;
const __DRIextension *extensions[4];
+ const __DRIextension **driver_extensions;
#ifdef HAVE_X11_PLATFORM
xcb_connection_t *conn;