aboutsummaryrefslogtreecommitdiffstats
path: root/src/egl/drivers
diff options
context:
space:
mode:
authorGiovanni Campagna <[email protected]>2014-07-23 19:28:52 +0100
committerEmil Velikov <[email protected]>2014-07-30 16:43:41 +0100
commite57ad3d38cab091ef341838b651dbda16cee007b (patch)
treefaa36d31ce343aeaa8a134c3bddfca8abecbcd52 /src/egl/drivers
parent3b176c441b7ddc5f7d2f891da3f76cf3c1814ce1 (diff)
dri: Add a new capabilities for drivers that can't share buffers
The kms-dri swrast driver cannot share buffers using the GEM, so it must tell the loader to disable extensions relying on that, without disabling the image DRI extension altogether (which would prevent the loader from working at all). This requires a new gallium capability (which is queried on the pipe_screen and for swrast drivers it's forwarded to the winsys), and requires a new version of the DRI image extension. [Emil Velikov] - Rebased on top of gallium-dri megadrivers. - Drop PIPE_CAP_BUFFER_SHARE and sw_winsys::get_param hook. The can_share_buffer cap is set at InitScreen. We use a different InitScreen (and thus value for the cap) function for kms_dri, due to deeper differences originating from dri megadrivers. Signed-off-by: Emil Velikov <[email protected]>
Diffstat (limited to 'src/egl/drivers')
-rw-r--r--src/egl/drivers/dri2/egl_dri2.c10
-rw-r--r--src/egl/drivers/dri2/platform_drm.c14
2 files changed, 21 insertions, 3 deletions
diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c
index cc7531cc466..5602ec30943 100644
--- a/src/egl/drivers/dri2/egl_dri2.c
+++ b/src/egl/drivers/dri2/egl_dri2.c
@@ -518,7 +518,15 @@ dri2_setup_screen(_EGLDisplay *disp)
}
if (dri2_dpy->image) {
- disp->Extensions.MESA_drm_image = EGL_TRUE;
+ if (dri2_dpy->image->base.version >= 10 &&
+ dri2_dpy->image->getCapabilities != NULL) {
+ int capabilities;
+
+ capabilities = dri2_dpy->image->getCapabilities(dri2_dpy->dri_screen);
+ disp->Extensions.MESA_drm_image = (capabilities & __DRI_IMAGE_CAP_GLOBAL_NAMES) != 0;
+ } else
+ disp->Extensions.MESA_drm_image = EGL_TRUE;
+
disp->Extensions.KHR_image_base = EGL_TRUE;
disp->Extensions.KHR_gl_renderbuffer_image = EGL_TRUE;
if (dri2_dpy->image->base.version >= 5 &&
diff --git a/src/egl/drivers/dri2/platform_drm.c b/src/egl/drivers/dri2/platform_drm.c
index 23a8d27b90a..e272beb943e 100644
--- a/src/egl/drivers/dri2/platform_drm.c
+++ b/src/egl/drivers/dri2/platform_drm.c
@@ -685,8 +685,18 @@ dri2_initialize_drm(_EGLDriver *drv, _EGLDisplay *disp)
disp->Extensions.EXT_buffer_age = EGL_TRUE;
#ifdef HAVE_WAYLAND_PLATFORM
- if (dri2_dpy->image)
- disp->Extensions.WL_bind_wayland_display = EGL_TRUE;
+ if (dri2_dpy->image) {
+ if (dri2_dpy->image->base.version >= 10 &&
+ dri2_dpy->image->getCapabilities != NULL) {
+ int capabilities;
+
+ capabilities =
+ dri2_dpy->image->getCapabilities(dri2_dpy->dri_screen);
+ disp->Extensions.WL_bind_wayland_display =
+ (capabilities & __DRI_IMAGE_CAP_GLOBAL_NAMES) != 0;
+ } else
+ disp->Extensions.WL_bind_wayland_display = EGL_TRUE;
+ }
#endif
/* we're supporting EGL 1.4 */