diff options
| author | Madhurkiran Harikrishnan <madhurkiran.harikrishnan@xilinx.com> | 2020-02-12 15:02:22 -0800 |
|---|---|---|
| committer | Sai Hari Chandana Kalluri <chandana.kalluri@xilinx.com> | 2020-02-12 18:31:58 -0800 |
| commit | 5258d8cb951625f0db4e974ab079aa441211d2bb (patch) | |
| tree | d021d250af68618b29da6318815c6a7fbc970259 /meta-xilinx-bsp | |
| parent | b3cec1f78e2244a5cd4b2b9952ade9e21d831d37 (diff) | |
| download | meta-xilinx-5258d8cb951625f0db4e974ab079aa441211d2bb.tar.gz | |
weston: Migrate ZynqMP specific patches for weston to meta-xilinx
As these patches are ZynqMP specific migrate them from meta-petalinux to
meta-xilinx-bsp.
Signed-off-by: Madhurkiran Harikrishnan <madhurkiran.harikrishnan@xilinx.com>
Signed-off-by: Sai Hari Chandana Kalluri <chandana.kalluri@xilinx.com>
Diffstat (limited to 'meta-xilinx-bsp')
4 files changed, 98 insertions, 0 deletions
diff --git a/meta-xilinx-bsp/recipes-graphics/weston/files/0001-gl-renderer.c-Use-gr-egl_config-to-create-pbuffer-su.patch b/meta-xilinx-bsp/recipes-graphics/weston/files/0001-gl-renderer.c-Use-gr-egl_config-to-create-pbuffer-su.patch new file mode 100644 index 00000000..d7d411f6 --- /dev/null +++ b/meta-xilinx-bsp/recipes-graphics/weston/files/0001-gl-renderer.c-Use-gr-egl_config-to-create-pbuffer-su.patch | |||
| @@ -0,0 +1,84 @@ | |||
| 1 | From 7cc76d50bddd6ff1eb5fb19712415f385f5d3f49 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Madhurkiran Harikrishnan <madhurkiran.harikrishnan@xilinx.com> | ||
| 3 | Date: Mon, 3 Feb 2020 14:26:21 -0800 | ||
| 4 | Subject: [PATCH] gl-renderer.c: Use gr->egl_config to create pbuffer surface | ||
| 5 | |||
| 6 | The original implementation always chose first egl config for pbuffer | ||
| 7 | surface type, however the returned configs are implementation specific | ||
| 8 | and egl config may not always match between ctx and surface. Hence, | ||
| 9 | use gr->egl_config which already has the matching config but ensure that | ||
| 10 | windows and pbuffer bit are set for the surface type. | ||
| 11 | |||
| 12 | Signed-off-by: Madhurkiran Harikrishnan <madhurkiran.harikrishnan@xilinx.com> | ||
| 13 | Upstream-status: Pending | ||
| 14 | --- | ||
| 15 | libweston/renderer-gl/gl-renderer.c | 28 ++++++++++++++-------------- | ||
| 16 | 1 file changed, 14 insertions(+), 14 deletions(-) | ||
| 17 | |||
| 18 | diff --git a/libweston/renderer-gl/gl-renderer.c b/libweston/renderer-gl/gl-renderer.c | ||
| 19 | index 54f8b1c..f50c959 100644 | ||
| 20 | --- a/libweston/renderer-gl/gl-renderer.c | ||
| 21 | +++ b/libweston/renderer-gl/gl-renderer.c | ||
| 22 | @@ -3567,7 +3567,7 @@ gl_renderer_setup_egl_extensions(struct weston_compositor *ec) | ||
| 23 | } | ||
| 24 | |||
| 25 | static const EGLint gl_renderer_opaque_attribs[] = { | ||
| 26 | - EGL_SURFACE_TYPE, EGL_WINDOW_BIT, | ||
| 27 | + EGL_SURFACE_TYPE, EGL_WINDOW_BIT | EGL_PBUFFER_BIT, | ||
| 28 | EGL_RED_SIZE, 1, | ||
| 29 | EGL_GREEN_SIZE, 1, | ||
| 30 | EGL_BLUE_SIZE, 1, | ||
| 31 | @@ -3577,7 +3577,7 @@ static const EGLint gl_renderer_opaque_attribs[] = { | ||
| 32 | }; | ||
| 33 | |||
| 34 | static const EGLint gl_renderer_alpha_attribs[] = { | ||
| 35 | - EGL_SURFACE_TYPE, EGL_WINDOW_BIT, | ||
| 36 | + EGL_SURFACE_TYPE, EGL_WINDOW_BIT | EGL_PBUFFER_BIT, | ||
| 37 | EGL_RED_SIZE, 1, | ||
| 38 | EGL_GREEN_SIZE, 1, | ||
| 39 | EGL_BLUE_SIZE, 1, | ||
| 40 | @@ -3682,15 +3682,7 @@ static int | ||
| 41 | gl_renderer_create_pbuffer_surface(struct gl_renderer *gr) { | ||
| 42 | EGLConfig pbuffer_config; | ||
| 43 | |||
| 44 | - static const EGLint pbuffer_config_attribs[] = { | ||
| 45 | - EGL_SURFACE_TYPE, EGL_PBUFFER_BIT, | ||
| 46 | - EGL_RED_SIZE, 1, | ||
| 47 | - EGL_GREEN_SIZE, 1, | ||
| 48 | - EGL_BLUE_SIZE, 1, | ||
| 49 | - EGL_ALPHA_SIZE, 0, | ||
| 50 | - EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT, | ||
| 51 | - EGL_NONE | ||
| 52 | - }; | ||
| 53 | + EGLint surface_type; | ||
| 54 | |||
| 55 | static const EGLint pbuffer_attribs[] = { | ||
| 56 | EGL_WIDTH, 10, | ||
| 57 | @@ -3698,13 +3690,21 @@ gl_renderer_create_pbuffer_surface(struct gl_renderer *gr) { | ||
| 58 | EGL_NONE | ||
| 59 | }; | ||
| 60 | |||
| 61 | - if (egl_choose_config(gr, pbuffer_config_attribs, NULL, 0, &pbuffer_config) < 0) { | ||
| 62 | - weston_log("failed to choose EGL config for PbufferSurface\n"); | ||
| 63 | + if(!eglGetConfigAttrib(gr->egl_display, gr->egl_config, EGL_SURFACE_TYPE, &surface_type)) { | ||
| 64 | + weston_log("failed to get surface type for PbufferSurface\n"); | ||
| 65 | + return -1; | ||
| 66 | + } | ||
| 67 | + | ||
| 68 | + if (!((surface_type & EGL_WINDOW_BIT) && (surface_type & EGL_PBUFFER_BIT)) && | ||
| 69 | + !gr->has_configless_context) { | ||
| 70 | + weston_log("attempted to use a different EGL config for an " | ||
| 71 | + "output but EGL_KHR_no_config_context or " | ||
| 72 | + "EGL_MESA_configless_context is not supported\n"); | ||
| 73 | return -1; | ||
| 74 | } | ||
| 75 | |||
| 76 | gr->dummy_surface = eglCreatePbufferSurface(gr->egl_display, | ||
| 77 | - pbuffer_config, | ||
| 78 | + gr->egl_config, | ||
| 79 | pbuffer_attribs); | ||
| 80 | |||
| 81 | if (gr->dummy_surface == EGL_NO_SURFACE) { | ||
| 82 | -- | ||
| 83 | 2.7.4 | ||
| 84 | |||
diff --git a/meta-xilinx-bsp/recipes-graphics/weston/files/weston.ini b/meta-xilinx-bsp/recipes-graphics/weston/files/weston.ini new file mode 100644 index 00000000..783a9c6b --- /dev/null +++ b/meta-xilinx-bsp/recipes-graphics/weston/files/weston.ini | |||
| @@ -0,0 +1,4 @@ | |||
| 1 | [core] | ||
| 2 | idle-time=0 | ||
| 3 | |||
| 4 | gbm-format=rgb565 | ||
diff --git a/meta-xilinx-bsp/recipes-graphics/weston/weston-init%.bbappend b/meta-xilinx-bsp/recipes-graphics/weston/weston-init%.bbappend new file mode 100644 index 00000000..aaee7f5d --- /dev/null +++ b/meta-xilinx-bsp/recipes-graphics/weston/weston-init%.bbappend | |||
| @@ -0,0 +1,7 @@ | |||
| 1 | FILESEXTRAPATHS_prepend_zynqmp := "${THISDIR}/files:" | ||
| 2 | |||
| 3 | SRC_URI_append_zynqmp = " file://weston.ini" | ||
| 4 | |||
| 5 | do_install_append_zynqmp() { | ||
| 6 | install -Dm 0700 ${WORKDIR}/weston.ini ${D}/${sysconfdir}/xdg/weston/weston.ini | ||
| 7 | } | ||
diff --git a/meta-xilinx-bsp/recipes-graphics/weston/weston_%.bbappend b/meta-xilinx-bsp/recipes-graphics/weston/weston_%.bbappend new file mode 100644 index 00000000..177bf107 --- /dev/null +++ b/meta-xilinx-bsp/recipes-graphics/weston/weston_%.bbappend | |||
| @@ -0,0 +1,3 @@ | |||
| 1 | FILESEXTRAPATHS_prepend_zynqmp := "${THISDIR}/files:" | ||
| 2 | |||
| 3 | SRC_URI_append_zynqmp = " file://0001-gl-renderer.c-Use-gr-egl_config-to-create-pbuffer-su.patch" | ||
