Stefan Dirsch
ab04f3beda
* required to fix build with wayland on openSUSE 13.1 OBS-URL: https://build.opensuse.org/package/show/X11:XOrg/Mesa?expand=0&rev=453
59 lines
1.7 KiB
Diff
59 lines
1.7 KiB
Diff
From 5d277737eef98b4c5913bb5a29c16776c82c5d7c Mon Sep 17 00:00:00 2001
|
|
From: Stefan Dirsch <sndirsch@suse.de>
|
|
Date: Tue, 23 Jun 2015 16:19:51 +0200
|
|
Subject: [PATCH] Fixed build against wayland 1.2.1
|
|
|
|
Wayland 1.2.1 still lacks definition of WL_SHM_FORMAT_RGB565 format.
|
|
|
|
Signed-off-by: Stefan Dirsch <sndirsch@suse.com>
|
|
|
|
---
|
|
src/egl/drivers/dri2/platform_wayland.c | 8 ++++++++
|
|
1 file changed, 8 insertions(+)
|
|
|
|
diff --git a/src/egl/drivers/dri2/platform_wayland.c b/src/egl/drivers/dri2/platform_wayland.c
|
|
index ea2f9f2..ee2b324 100644
|
|
--- a/src/egl/drivers/dri2/platform_wayland.c
|
|
+++ b/src/egl/drivers/dri2/platform_wayland.c
|
|
@@ -1236,9 +1236,11 @@ dri2_initialize_wayland_drm(_EGLDriver *drv, _EGLDisplay *disp)
|
|
static int
|
|
dri2_wl_swrast_get_stride_for_format(int format, int w)
|
|
{
|
|
+#ifdef WL_SHM_FORMAT_RGB565
|
|
if (format == WL_SHM_FORMAT_RGB565)
|
|
return 2 * w;
|
|
else /* ARGB8888 || XRGB8888 */
|
|
+#endif
|
|
return 4 * w;
|
|
}
|
|
|
|
@@ -1672,9 +1674,13 @@ dri2_wl_swrast_create_window_surface(_EGLDriver *drv, _EGLDisplay *disp,
|
|
if (!_eglInitSurface(&dri2_surf->base, disp, EGL_WINDOW_BIT, conf, attrib_list))
|
|
goto cleanup_surf;
|
|
|
|
+#ifdef WL_SHM_FORMAT_RGB565
|
|
if (conf->RedSize == 5)
|
|
dri2_surf->format = WL_SHM_FORMAT_RGB565;
|
|
else if (conf->AlphaSize == 0)
|
|
+#else
|
|
+ if (conf->AlphaSize == 0)
|
|
+#endif
|
|
dri2_surf->format = WL_SHM_FORMAT_XRGB8888;
|
|
else
|
|
dri2_surf->format = WL_SHM_FORMAT_ARGB8888;
|
|
@@ -1728,9 +1734,11 @@ shm_handle_format(void *data, struct wl_shm *shm, uint32_t format)
|
|
case WL_SHM_FORMAT_XRGB8888:
|
|
dri2_dpy->formats |= HAS_XRGB8888;
|
|
break;
|
|
+#ifdef WL_SHM_FORMAT_RGB565
|
|
case WL_SHM_FORMAT_RGB565:
|
|
dri2_dpy->formats |= HAS_RGB565;
|
|
break;
|
|
+#endif
|
|
}
|
|
}
|
|
|
|
--
|
|
1.8.4.5
|
|
|