diff options
author | Adam Jackson <[email protected]> | 2019-08-30 15:35:22 -0400 |
---|---|---|
committer | Adam Jackson <[email protected]> | 2019-09-20 19:10:31 +0000 |
commit | e74c9473592dafce4fb0005555ce9406b4200012 (patch) | |
tree | 2924333a57ebb28b5dcd53d7c84aa2aff45ab24b /src/egl | |
parent | cb8bbbef314f508b754d6bd564ab9fa08e29276f (diff) |
egl/wayland: Add FP16 format support
Reviewed-by: Kevin Strasser <[email protected]>
Diffstat (limited to 'src/egl')
-rw-r--r-- | src/egl/drivers/dri2/egl_dri2.h | 2 | ||||
-rw-r--r-- | src/egl/drivers/dri2/platform_wayland.c | 21 | ||||
-rw-r--r-- | src/egl/wayland/wayland-drm/wayland-drm.xml | 2 |
3 files changed, 24 insertions, 1 deletions
diff --git a/src/egl/drivers/dri2/egl_dri2.h b/src/egl/drivers/dri2/egl_dri2.h index 2a8307ab321..146f954eacf 100644 --- a/src/egl/drivers/dri2/egl_dri2.h +++ b/src/egl/drivers/dri2/egl_dri2.h @@ -83,7 +83,7 @@ struct zwp_linux_dmabuf_v1; #include "util/u_vector.h" #include "util/bitset.h" -#define EGL_DRI2_MAX_FORMATS 8 +#define EGL_DRI2_MAX_FORMATS 10 struct wl_buffer; diff --git a/src/egl/drivers/dri2/platform_wayland.c b/src/egl/drivers/dri2/platform_wayland.c index 55f99fe662c..b93d8139281 100644 --- a/src/egl/drivers/dri2/platform_wayland.c +++ b/src/egl/drivers/dri2/platform_wayland.c @@ -51,6 +51,13 @@ #include "wayland-drm-client-protocol.h" #include "linux-dmabuf-unstable-v1-client-protocol.h" +/* cheesy workaround until wayland 1.18 is released */ +#if WAYLAND_VERSION_MAJOR > 1 || \ + (WAYLAND_VERSION_MAJOR == 1 && WAYLAND_VERSION_MINOR < 18) +#define WL_SHM_FORMAT_ABGR16161616F 0x48344241 +#define WL_SHM_FORMAT_XBGR16161616F 0x48344258 +#endif + /* * The index of entries in this table is used as a bitmask in * dri2_dpy->formats, which tracks the formats supported by our server. @@ -73,6 +80,20 @@ static const struct dri2_wl_visual { unsigned int rgba_sizes[4]; } dri2_wl_visuals[] = { { + "ABGR16F", + WL_DRM_FORMAT_ABGR16F, WL_SHM_FORMAT_ABGR16161616F, + __DRI_IMAGE_FORMAT_ABGR16161616F, 0, 64, + { 0, 16, 32, 48 }, + { 16, 16, 16, 16 }, + }, + { + "XBGR16F", + WL_DRM_FORMAT_XBGR16F, WL_SHM_FORMAT_XBGR16161616F, + __DRI_IMAGE_FORMAT_XBGR16161616F, 0, 64, + { 0, 16, 32, -1 }, + { 16, 16, 16, 0 }, + }, + { "XRGB2101010", WL_DRM_FORMAT_XRGB2101010, WL_SHM_FORMAT_XRGB2101010, __DRI_IMAGE_FORMAT_XRGB2101010, __DRI_IMAGE_FORMAT_XBGR2101010, 32, diff --git a/src/egl/wayland/wayland-drm/wayland-drm.xml b/src/egl/wayland/wayland-drm/wayland-drm.xml index a1f2540e426..eaf2654ab26 100644 --- a/src/egl/wayland/wayland-drm/wayland-drm.xml +++ b/src/egl/wayland/wayland-drm/wayland-drm.xml @@ -100,6 +100,8 @@ <entry name="yvu422" value="0x36315659"/> <entry name="yuv444" value="0x34325559"/> <entry name="yvu444" value="0x34325659"/> + <entry name="abgr16f" value="0x48344241"/> + <entry name="xbgr16f" value="0x48344258"/> </enum> <!-- Call this request with the magic received from drmGetMagic(). |