egl/wayland: Support RGBA ordered formats

There's no reason not to try to use RGBA ordered formats, and in some
cases doing so might lead to features such as AFBC being available when
they otherwise wouldn't.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13040>
This commit is contained in:
Derek Foreman 2021-09-23 14:37:19 -05:00 committed by Marge Bot
parent f389f963ee
commit 7fa6d3fc95
2 changed files with 17 additions and 1 deletions

View File

@ -89,7 +89,7 @@ struct zwp_linux_dmabuf_v1;
#include "util/u_vector.h"
#include "util/bitset.h"
#define EGL_DRI2_MAX_FORMATS 10
#define EGL_DRI2_MAX_FORMATS 11
struct wl_buffer;

View File

@ -128,6 +128,20 @@ static const struct dri2_wl_visual {
{ 16, 8, 0, 24 },
{ 8, 8, 8, 8 },
},
{
"ABGR8888",
WL_DRM_FORMAT_ABGR8888, WL_SHM_FORMAT_ABGR8888,
__DRI_IMAGE_FORMAT_ABGR8888, __DRI_IMAGE_FORMAT_NONE, 32,
{ 0, 8, 16, 24 },
{ 8, 8, 8, 8 },
},
{
"XBGR8888",
WL_DRM_FORMAT_XBGR8888, WL_SHM_FORMAT_XBGR8888,
__DRI_IMAGE_FORMAT_XBGR8888, __DRI_IMAGE_FORMAT_NONE, 32,
{ 0, 8, 16, -1 },
{ 8, 8, 8, 0 },
},
{
"RGB565",
WL_DRM_FORMAT_RGB565, WL_SHM_FORMAT_RGB565,
@ -812,6 +826,8 @@ dri2_wl_get_capability(void *loaderPrivate, enum dri_loader_cap cap)
switch (cap) {
case DRI_LOADER_CAP_FP16:
return 1;
case DRI_LOADER_CAP_RGBA_ORDERING:
return 1;
default:
return 0;
}