aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEmil Velikov <[email protected]>2017-05-12 14:19:59 +0100
committerJuan A. Suarez Romero <[email protected]>2017-06-01 04:25:10 +0200
commite4c4b86f70644e670673dd1ee3461a1654e2382c (patch)
treed51c8592c3aa538be1b7eac0b44e6719bade054d
parentda7bde9d9a6d4b93cae002eb74100ab2a5bbebec (diff)
egl/wayland: select the format based on the interface used
Rather than misleadingly depending on DRI2 for the WL_DRM vs WL_SHM formats, use the wl_drm and wl_shm interface respectively. Fixes: a1727aa75ed ("egl/wayland: Don't use DRM format codes for SHM") Signed-off-by: Emil Velikov <[email protected]> (cherry picked from commit 6ef0fc400c690362b66add9c3533fae5f21d2cae) Signed-off-by: Juan A. Suarez Romero <[email protected]>
-rw-r--r--src/egl/drivers/dri2/platform_wayland.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/egl/drivers/dri2/platform_wayland.c b/src/egl/drivers/dri2/platform_wayland.c
index 9ad06350048..e0282675330 100644
--- a/src/egl/drivers/dri2/platform_wayland.c
+++ b/src/egl/drivers/dri2/platform_wayland.c
@@ -124,7 +124,7 @@ dri2_wl_create_window_surface(_EGLDriver *drv, _EGLDisplay *disp,
if (!_eglInitSurface(&dri2_surf->base, disp, EGL_WINDOW_BIT, conf, attrib_list))
goto cleanup_surf;
- if (dri2_dpy->dri2) {
+ if (dri2_dpy->wl_drm) {
if (conf->RedSize == 5)
dri2_surf->format = WL_DRM_FORMAT_RGB565;
else if (conf->AlphaSize == 0)
@@ -132,6 +132,7 @@ dri2_wl_create_window_surface(_EGLDriver *drv, _EGLDisplay *disp,
else
dri2_surf->format = WL_DRM_FORMAT_ARGB8888;
} else {
+ assert(dri2_dpy->wl_shm);
if (conf->RedSize == 5)
dri2_surf->format = WL_SHM_FORMAT_RGB565;
else if (conf->AlphaSize == 0)