summaryrefslogtreecommitdiff
path: root/src/egl/drivers/dri2/egl_dri2.c
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2013-09-27 11:39:25 -0700
committerEric Anholt <eric@anholt.net>2013-10-24 14:04:20 -0700
commitf93533d118b6dab00022cc9bc1448615a25946dc (patch)
treeeac8fb7a9f34ba1f8b14738aef46dfc0184c6dd1 /src/egl/drivers/dri2/egl_dri2.c
parent67caf36489e29c93ed1a25541944b191ed50df52 (diff)
dri: Pass in the dlsym()ed driver extension to screen creation.
This will allow a megadrivers build to reference the actual driver being loaded from the shared dri_util screen creation code. v2: Fix indentation, fallback case in EGL (review by Emil). Reviewed-by: Matt Turner <mattst88@gmail.com> (v1) Reviewed-by: Chad Versace <chad.versace@linux.intel.com> (v1) Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Diffstat (limited to 'src/egl/drivers/dri2/egl_dri2.c')
-rw-r--r--src/egl/drivers/dri2/egl_dri2.c30
1 files changed, 24 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) {