summaryrefslogtreecommitdiffstats
path: root/src/egl/drivers/dri2/platform_drm.c
diff options
context:
space:
mode:
authorEmil Velikov <emil.velikov@collabora.com>2016-08-25 13:15:43 +0100
committerEmil Velikov <emil.l.velikov@gmail.com>2016-10-14 12:53:39 +0100
commit98f5d0106a8ee45e58a6bf162720da3f6f614a95 (patch)
tree0179539bacaae92ba76661c02509bed009a3875f /src/egl/drivers/dri2/platform_drm.c
parent637d001a97a82142bc20d410655098a0b7b39694 (diff)
downloadexternal_mesa3d-98f5d0106a8ee45e58a6bf162720da3f6f614a95.zip
external_mesa3d-98f5d0106a8ee45e58a6bf162720da3f6f614a95.tar.gz
external_mesa3d-98f5d0106a8ee45e58a6bf162720da3f6f614a95.tar.bz2
egl/dri2: set WL_bind_wayland_display in a consistent way
Introduce a helper and use it throughout the platform code. This allows us to reduce the amount of ifdef(s) and (potentially) use kms_swrast_dri.so for !drm platforms (namely wayland and x11). Note: in the future as other platforms (android, surfaceless) support the extension they can reuse the helper. v2: Rebase, check for device_name. Signed-off-by: Emil Velikov <emil.velikov@collabora.com> Reviewed-by: Daniel Stone <daniels@collabora.com> Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Diffstat (limited to 'src/egl/drivers/dri2/platform_drm.c')
-rw-r--r--src/egl/drivers/dri2/platform_drm.c16
1 files changed, 2 insertions, 14 deletions
diff --git a/src/egl/drivers/dri2/platform_drm.c b/src/egl/drivers/dri2/platform_drm.c
index 2668dff..bb1515f 100644
--- a/src/egl/drivers/dri2/platform_drm.c
+++ b/src/egl/drivers/dri2/platform_drm.c
@@ -697,21 +697,9 @@ dri2_initialize_drm(_EGLDriver *drv, _EGLDisplay *disp)
disp->Extensions.EXT_buffer_age = EGL_TRUE;
#ifdef HAVE_WAYLAND_PLATFORM
- if (dri2_dpy->image) {
- dri2_dpy->device_name = loader_get_device_name_for_fd(dri2_dpy->fd);
-
- 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;
- }
+ dri2_dpy->device_name = loader_get_device_name_for_fd(dri2_dpy->fd);
#endif
+ dri2_set_WL_bind_wayland_display(drv, disp);
/* Fill vtbl last to prevent accidentally calling virtual function during
* initialization.