Add Wayland with GPU support.
Cherry-pick from http://192.168.110.45/sdk/buildroot/-/commit/ed70e2b79cbc7a504792899e2cd3577777fd54bd
This commit is contained in:
@@ -0,0 +1,74 @@
|
||||
From 2b9a147b073ed8ff1d52246be5c885959d859c45 Mon Sep 17 00:00:00 2001
|
||||
From: Frank Binns <frank.binns@imgtec.com>
|
||||
Date: Thu, 11 Jan 2018 09:38:47 +0000
|
||||
Subject: [PATCH 34/50] egl/wayland: expose EXT_yuv_surface support
|
||||
|
||||
This adds support for YUYV configs.
|
||||
---
|
||||
src/egl/drivers/dri2/egl_dri2.c | 1 +
|
||||
src/egl/drivers/dri2/platform_wayland.c | 15 ++++++++++++++-
|
||||
2 files changed, 15 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c
|
||||
index a0b52eab983..d359934a818 100644
|
||||
--- a/src/egl/drivers/dri2/egl_dri2.c
|
||||
+++ b/src/egl/drivers/dri2/egl_dri2.c
|
||||
@@ -2798,6 +2798,7 @@ static const struct wl_drm_components_descriptor {
|
||||
{ __DRI_IMAGE_COMPONENTS_Y_U_V, EGL_TEXTURE_Y_U_V_WL, 3 },
|
||||
{ __DRI_IMAGE_COMPONENTS_Y_UV, EGL_TEXTURE_Y_UV_WL, 2 },
|
||||
{ __DRI_IMAGE_COMPONENTS_Y_XUXV, EGL_TEXTURE_Y_XUXV_WL, 2 },
|
||||
+ { __DRI_IMAGE_COMPONENTS_EXTERNAL, EGL_TEXTURE_EXTERNAL_WL, 1 },
|
||||
};
|
||||
|
||||
static _EGLImage *
|
||||
diff --git a/src/egl/drivers/dri2/platform_wayland.c b/src/egl/drivers/dri2/platform_wayland.c
|
||||
index 43ad6420174..de12ec21f53 100644
|
||||
--- a/src/egl/drivers/dri2/platform_wayland.c
|
||||
+++ b/src/egl/drivers/dri2/platform_wayland.c
|
||||
@@ -134,6 +134,13 @@ static const struct dri2_wl_visual {
|
||||
{ 11, 5, 0, -1 },
|
||||
{ 5, 6, 5, 0 },
|
||||
},
|
||||
+ {
|
||||
+ "YUYV",
|
||||
+ WL_DRM_FORMAT_YUYV, WL_SHM_FORMAT_YUYV,
|
||||
+ __DRI_IMAGE_FORMAT_YUYV, __DRI_IMAGE_FORMAT_NONE, 32,
|
||||
+ { -1, -1, -1, -1 },
|
||||
+ { 0, 0, 0, 0 },
|
||||
+ },
|
||||
};
|
||||
|
||||
static_assert(ARRAY_SIZE(dri2_wl_visuals) <= EGL_DRI2_MAX_FORMATS,
|
||||
@@ -970,6 +977,7 @@ dri2_wl_get_capability(void *loaderPrivate, enum dri_loader_cap cap)
|
||||
{
|
||||
switch (cap) {
|
||||
case DRI_LOADER_CAP_FP16:
|
||||
+ case DRI_LOADER_CAP_YUV_SURFACE_IMG:
|
||||
return 1;
|
||||
default:
|
||||
return 0;
|
||||
@@ -1561,6 +1569,7 @@ dri2_wl_add_configs_for_visuals(_EGLDisplay *disp)
|
||||
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
|
||||
unsigned int format_count[ARRAY_SIZE(dri2_wl_visuals)] = { 0 };
|
||||
unsigned int count = 0;
|
||||
+ EGLint surface_type;
|
||||
bool assigned;
|
||||
|
||||
for (unsigned i = 0; dri2_dpy->driver_configs[i]; i++) {
|
||||
@@ -1572,8 +1581,12 @@ dri2_wl_add_configs_for_visuals(_EGLDisplay *disp)
|
||||
if (!BITSET_TEST(dri2_dpy->formats, j))
|
||||
continue;
|
||||
|
||||
+ surface_type = EGL_WINDOW_BIT;
|
||||
+ if (dri2_wl_visuals[j].wl_drm_format != WL_DRM_FORMAT_YUYV)
|
||||
+ surface_type |= EGL_PBUFFER_BIT;
|
||||
+
|
||||
dri2_conf = dri2_add_config(disp, dri2_dpy->driver_configs[i],
|
||||
- count + 1, EGL_WINDOW_BIT | EGL_PBUFFER_BIT, NULL, dri2_wl_visuals[j].rgba_shifts, dri2_wl_visuals[j].rgba_sizes);
|
||||
+ count + 1, surface_type, NULL, dri2_wl_visuals[j].rgba_shifts, dri2_wl_visuals[j].rgba_sizes);
|
||||
if (dri2_conf) {
|
||||
if (dri2_conf->base.ConfigID == count + 1)
|
||||
count++;
|
||||
--
|
||||
2.17.1
|
||||
|
||||
Reference in New Issue
Block a user