summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeena Busireddy <neena.busireddy@freescale.com>2014-08-18 15:10:49 -0500
committerOtavio Salvador <otavio@ossystems.com.br>2014-08-20 17:38:57 -0300
commit79bec9dd83424d4ec2d4d1fa945b33a6b1fda00d (patch)
tree0d85ec6781a939a8466c2802f238483ab19f18af
parentee593934ea024ebe30e102dcff9aadf5ad168a24 (diff)
downloadmeta-fsl-arm-79bec9dd83424d4ec2d4d1fa945b33a6b1fda00d.tar.gz
weston: Add sololite changes
Sololite does not support 3D GPU hardware acceleration, so remove gles flags from compilation. Also, included the patches to enable GAL2D compositor and change GAL2D compositor to be default when EGL is not enabled in Sololite. Patch for crashes on touch device without a pointer is applicable for all iMX6 machines. Signed-off-by: Neena Busireddy <neena.busireddy@freescale.com> Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
-rw-r--r--recipes-graphics/wayland/weston/0003-Distorted-line-and-shadow-if-use-2d-com.patch256
-rw-r--r--recipes-graphics/wayland/weston/0004-Desktop-shell-Don-t-assume-there-is-a-pointer.patch36
-rw-r--r--recipes-graphics/wayland/weston/0005-Enable-GAL2D-compositor-in-SoloLite.patch36
-rw-r--r--recipes-graphics/wayland/weston/0006-Change-GAL2D-compositor-to-be-default-i.patch35
-rw-r--r--recipes-graphics/wayland/weston_%.bbappend30
5 files changed, 385 insertions, 8 deletions
diff --git a/recipes-graphics/wayland/weston/0003-Distorted-line-and-shadow-if-use-2d-com.patch b/recipes-graphics/wayland/weston/0003-Distorted-line-and-shadow-if-use-2d-com.patch
new file mode 100644
index 0000000..0e7ffd0
--- /dev/null
+++ b/recipes-graphics/wayland/weston/0003-Distorted-line-and-shadow-if-use-2d-com.patch
@@ -0,0 +1,256 @@
1From 1fd17db2ab978322803683a4d2d847a0b31a4c1c Mon Sep 17 00:00:00 2001
2From: Prabhu Sundararaj <prabhu.sundararaj@freescale.com>
3Date: Tue, 24 Jun 2014 15:44:13 -0500
4Subject: [PATCH 3/3] ENGR00319247 : Distorted line and shadow if use 2d
5 compositor to run wayland apps.
6
7Fixed blending for shadown and maintained separate surface for damage composite.
8
9Upstream Status: N/A
10
11Signed-off-by: Prabhu Sundararaj <prabhu.sundararaj@freescale.com>
12---
13 src/compositor-fbdev.c | 8 ++--
14 src/gal2d-renderer.c | 102 +++++++++++++++++++++++++++++++++++--------------
15 src/gal2d-renderer.h | 6 +++
16 3 files changed, 83 insertions(+), 33 deletions(-)
17
18diff --git a/src/compositor-fbdev.c b/src/compositor-fbdev.c
19index a3d32e5..b27d199 100644
20--- a/src/compositor-fbdev.c
21+++ b/src/compositor-fbdev.c
22@@ -55,7 +55,7 @@ struct fbdev_compositor {
23 int use_pixman;
24 int use_gal2d;
25 struct wl_listener session_listener;
26- EGLNativeDisplayType display;
27+ NativeDisplayType display;
28 };
29
30 struct fbdev_screeninfo {
31@@ -91,8 +91,8 @@ struct fbdev_output {
32 void *shadow_buf;
33 uint8_t depth;
34
35- EGLNativeDisplayType display;
36- EGLNativeWindowType window;
37+ NativeDisplayType display;
38+ NativeWindowType window;
39 };
40
41 struct fbdev_parameters {
42@@ -667,7 +667,7 @@ fbdev_output_create(struct fbdev_compositor *compositor,
43 return 0;
44 }
45 if (gl_renderer->output_create(&output->base,
46- (EGLNativeWindowType)output->window,
47+ (NativeWindowType)output->window,
48 gl_renderer->opaque_attribs,
49 NULL) < 0) {
50 weston_log("gl_renderer_output_create failed.\n");
51diff --git a/src/gal2d-renderer.c b/src/gal2d-renderer.c
52index c651573..fbe39f6 100644
53--- a/src/gal2d-renderer.c
54+++ b/src/gal2d-renderer.c
55@@ -42,7 +42,7 @@ struct gal2d_output_state {
56
57 int current_buffer;
58 pixman_region32_t buffer_damage[2];
59- EGLNativeDisplayType display;
60+ NativeDisplayType display;
61 gcoSURF* renderSurf;
62 gctUINT32 nNumBuffers;
63 int activebuffer;
64@@ -423,11 +423,9 @@ gal2dBindBuffer(struct weston_surface* es)
65 gcoSURF surface = gs->gco_Surface;
66 struct weston_buffer *buffer = gs->buffer_ref.buffer;
67 gcePOOL pool = gcvPOOL_DEFAULT;
68- gctUINT64 node = 0;
69- gctUINT bytes;
70-
71- gcmVERIFY_OK(gcoSURF_QueryVidMemNode(surface, &node,
72- &pool, &bytes));
73+
74+ gcmVERIFY_OK(gcoSURF_QueryVidMemNode(surface, gcvNULL,
75+ &pool, gcvNULL));
76
77 if(pool != gcvPOOL_USER)
78 {
79@@ -801,24 +799,26 @@ draw_view(struct weston_view *ev, struct weston_output *output,
80 ev->surface->width, ev->surface->height);
81 pixman_region32_subtract(&surface_blend, &surface_blend, &ev->surface->opaque);
82
83+ struct gal2d_renderer *gr = get_renderer(ec);
84+
85 if (pixman_region32_not_empty(&ev->surface->opaque)) {
86
87 repaint_region(ev, output, go, &repaint, &ev->surface->opaque);
88 }
89
90 if (pixman_region32_not_empty(&surface_blend)) {
91- struct gal2d_renderer *gr = get_renderer(ec);
92-
93+
94 gco2D_EnableAlphaBlend(gr->gcoEngine2d,
95- ev->alpha * 0xFF, ev->alpha * 0xFF,
96- gcvSURF_PIXEL_ALPHA_STRAIGHT, gcvSURF_PIXEL_ALPHA_STRAIGHT,
97- gcvSURF_GLOBAL_ALPHA_OFF, gcvSURF_GLOBAL_ALPHA_OFF,
98- gcvSURF_BLEND_ONE, gcvSURF_BLEND_INVERSED,
99- gcvSURF_COLOR_STRAIGHT, gcvSURF_COLOR_STRAIGHT);
100+ ev->alpha * 0xFF, ev->alpha * 0xFF,
101+ gcvSURF_PIXEL_ALPHA_STRAIGHT, gcvSURF_PIXEL_ALPHA_STRAIGHT,
102+ gcvSURF_GLOBAL_ALPHA_SCALE, gcvSURF_GLOBAL_ALPHA_SCALE,
103+ gcvSURF_BLEND_STRAIGHT, gcvSURF_BLEND_INVERSED,
104+ gcvSURF_COLOR_STRAIGHT, gcvSURF_COLOR_STRAIGHT);
105
106 repaint_region(ev, output, go, &repaint, &surface_blend);
107 }
108
109+ gco2D_DisableAlphaBlend(gr->gcoEngine2d);
110 pixman_region32_fini(&surface_blend);
111
112 out:
113@@ -866,6 +866,48 @@ gal2d_renderer_repaint_output(struct weston_output *output,
114 }
115
116 static void
117+gal2d_renderer_attach_egl(struct weston_surface *es, struct weston_buffer *buffer)
118+{
119+ gcsWL_VIV_BUFFER *vivBuffer = wl_resource_get_user_data(buffer->resource);
120+ gctUINT width = 0;
121+ gctUINT height = 0;
122+ gctINT stride = 0;
123+ gceSURF_FORMAT format;
124+ gcoSURF srcSurf = vivBuffer->surface;
125+ gctUINT32 physical;
126+ gctPOINTER va =0;
127+ gceSTATUS status = gcvSTATUS_OK;
128+ struct gal2d_surface_state *gs = get_surface_state(es);
129+
130+ if(gs->gco_Surface == gcvNULL)
131+ {
132+ /** Construct a wrapper. */
133+ gcmONERROR(gcoSURF_ConstructWrapper(gcvNULL, &gs->gco_Surface));
134+ }
135+
136+ gcmONERROR(gcoSURF_GetAlignedSize(srcSurf, &width, &height, &stride));
137+ gcmONERROR(gcoSURF_GetFormat(srcSurf, gcvNULL, &format));
138+ gcmONERROR(gcoSURF_Lock(srcSurf, &physical, (gctPOINTER *)&va));
139+
140+ /* Set the buffer. */
141+ gcmONERROR(gcoSURF_SetBuffer(gs->gco_Surface,
142+ gcvSURF_BITMAP_NO_VIDMEM,
143+ format,
144+ stride,
145+ (gctPOINTER) va,
146+ (gctUINT32) physical));
147+
148+ /* Set the window. */
149+ gcmONERROR(gcoSURF_SetWindow(gs->gco_Surface, 0, 0, width, height));
150+
151+ buffer->width = vivBuffer->width;
152+ buffer->height = vivBuffer->height;
153+
154+ OnError:
155+ galONERROR(status);
156+}
157+
158+static void
159 gal2d_renderer_flush_damage(struct weston_surface *surface)
160 {
161 struct gal2d_surface_state *gs = get_surface_state(surface);
162@@ -900,10 +942,7 @@ gal2d_renderer_flush_damage(struct weston_surface *surface)
163 gal2dBindBuffer(surface);
164 }
165 else
166- {
167- gcsWL_VIV_BUFFER *vivBuffer = (gcsWL_VIV_BUFFER *)buffer;
168- gs->gco_Surface = vivBuffer->surface;
169- }
170+ gal2d_renderer_attach_egl(surface, buffer);
171
172 done:
173 pixman_region32_fini(&gs->texture_damage);
174@@ -937,19 +976,17 @@ gal2d_renderer_attach(struct weston_surface *es, struct weston_buffer *buffer)
175 }
176 }
177 else
178- {
179- gcsWL_VIV_BUFFER *vivBuffer = wl_resource_get_user_data(buffer->resource);
180- gs->gco_Surface = vivBuffer->surface;
181-
182- buffer->width = vivBuffer->width;
183- buffer->height = vivBuffer->height;
184- }
185+ gal2d_renderer_attach_egl(es, buffer);
186 }
187
188 static void
189 surface_state_destroy(struct gal2d_surface_state *gs, struct gal2d_renderer *gr)
190 {
191- wl_list_remove(&gs->surface_destroy_listener.link);
192+ if(gs->gco_Surface)
193+ {
194+ gcoSURF_Destroy(gs->gco_Surface);
195+ }
196+ wl_list_remove(&gs->surface_destroy_listener.link);
197 wl_list_remove(&gs->renderer_destroy_listener.link);
198 if(gs->surface)
199 gs->surface->renderer_state = NULL;
200@@ -1043,8 +1080,12 @@ gal2d_renderer_output_destroy(struct weston_output *output)
201 {
202 struct gal2d_output_state *go = get_output_state(output);
203 gctUINT32 i;
204-
205- if(go->nNumBuffers <= 1 )
206+
207+ for (i = 0; i < 2; i++)
208+ {
209+ pixman_region32_fini(&go->buffer_damage[i]);
210+ }
211+ if(go->nNumBuffers <= 1 )
212 {
213 if(go->offscreenSurface)
214 gcmVERIFY_OK(gcoSURF_Destroy(go->offscreenSurface));
215@@ -1107,8 +1148,8 @@ OnError:
216 }
217
218 static int
219-gal2d_renderer_output_create(struct weston_output *output, EGLNativeDisplayType display,
220- EGLNativeWindowType window)
221+gal2d_renderer_output_create(struct weston_output *output, NativeDisplayType display,
222+ NativeWindowType window)
223
224 {
225 struct gal2d_renderer *gr = get_renderer(output->compositor);
226@@ -1174,6 +1215,9 @@ gal2d_renderer_output_create(struct weston_output *output, EGLNativeDisplayType
227 gal2d_clear(output);
228 gal2d_flip_surface(output);
229 }
230+
231+ for (i = 0; i < 2; i++)
232+ pixman_region32_init(&go->buffer_damage[i]);
233 OnError:
234 galONERROR(status);
235 /* Return the status. */
236diff --git a/src/gal2d-renderer.h b/src/gal2d-renderer.h
237index 3b89f73..1322a7d 100644
238--- a/src/gal2d-renderer.h
239+++ b/src/gal2d-renderer.h
240@@ -24,7 +24,13 @@
241 #define __gal_2d_renderer_h_
242
243 #include "compositor.h"
244+#ifdef ENABLE_EGL
245 #include <EGL/egl.h>
246+#else
247+#include <HAL/gc_hal_eglplatform.h>
248+typedef HALNativeDisplayType NativeDisplayType;
249+typedef HALNativeWindowType NativeWindowType;
250+#endif
251
252
253 struct gal2d_renderer_interface {
254--
2552.0.0
256
diff --git a/recipes-graphics/wayland/weston/0004-Desktop-shell-Don-t-assume-there-is-a-pointer.patch b/recipes-graphics/wayland/weston/0004-Desktop-shell-Don-t-assume-there-is-a-pointer.patch
new file mode 100644
index 0000000..f6ef253
--- /dev/null
+++ b/recipes-graphics/wayland/weston/0004-Desktop-shell-Don-t-assume-there-is-a-pointer.patch
@@ -0,0 +1,36 @@
1From 1194ccebc0db14ba681bd8272e01715b3e7008cc Mon Sep 17 00:00:00 2001
2From: Yong Gan <b45748@freescale.com>
3Date: Fri, 27 Jun 2014 11:33:53 +0800
4Subject: [PATCH] ENGR00320189 desktop-shell: Don't assume there is a pointer
5 when resizing
6
7Fixes a crash on touch devices without a pointer, when touching
8the window frame of a client.
9cherry-pick from 5872b6821be7c9c0a17a0de962e3f4a04f5d0c6f
10
11Date: Jun 27, 2014
12
13Upstream Status: N/A
14
15Signed-off-by Yong Gan <B45748@freescale.com>
16---
17 desktop-shell/shell.c | 3 ++-
18 1 file changed, 2 insertions(+), 1 deletion(-)
19
20diff --git a/desktop-shell/shell.c b/desktop-shell/shell.c
21index 84f5c83..d965618 100644
22--- a/desktop-shell/shell.c
23+++ b/desktop-shell/shell.c
24@@ -1784,7 +1784,8 @@ common_surface_resize(struct wl_resource *resource,
25 struct shell_surface *shsurf = wl_resource_get_user_data(resource);
26 struct weston_surface *surface;
27
28- if (seat->pointer->button_count == 0 ||
29+ if (seat->pointer == NULL ||
30+ seat->pointer->button_count == 0 ||
31 seat->pointer->grab_serial != serial ||
32 seat->pointer->focus == NULL)
33 return;
34--
351.7.9.5
36
diff --git a/recipes-graphics/wayland/weston/0005-Enable-GAL2D-compositor-in-SoloLite.patch b/recipes-graphics/wayland/weston/0005-Enable-GAL2D-compositor-in-SoloLite.patch
new file mode 100644
index 0000000..cf08900
--- /dev/null
+++ b/recipes-graphics/wayland/weston/0005-Enable-GAL2D-compositor-in-SoloLite.patch
@@ -0,0 +1,36 @@
1From 1eea925312fb7e1bc1cf42e001069cbac887b128 Mon Sep 17 00:00:00 2001
2From: Yong Gan <b45748@freescale.com>
3Date: Wed, 2 Jul 2014 11:27:26 +0800
4Subject: [PATCH] ENGR00320243 Enable GAL2D compositor in SoloLite
5
6Build gal2d-renderer.so when EGL was not enabled.
7
8Date: Jul 02, 2014
9Signed-off-by Yong Gan <yong.gan@freescale.com>
10---
11 Makefile.am | 2 +-
12 1 file changed, 1 insertion(+), 1 deletion(-)
13
14diff --git a/Makefile.am b/Makefile.am
15index 2bccfe9..42148b1 100644
16--- a/Makefile.am
17+++ b/Makefile.am
18@@ -162,6 +162,7 @@ gl_renderer_la_SOURCES = \
19 src/gl-renderer.c \
20 src/vertex-clipping.c \
21 src/vertex-clipping.h
22+endif
23
24 module_LTLIBRARIES += gal2d-renderer.la
25 gal2d_renderer_la_LDFLAGS = -module -avoid-version
26@@ -175,7 +176,6 @@ gal2d_renderer_la_SOURCES = \
27 src/gal2d-renderer.c \
28 src/vertex-clipping.c \
29 src/vertex-clipping.h
30-endif
31
32 if ENABLE_X11_COMPOSITOR
33 module_LTLIBRARIES += x11-backend.la
34--
351.7.9.5
36
diff --git a/recipes-graphics/wayland/weston/0006-Change-GAL2D-compositor-to-be-default-i.patch b/recipes-graphics/wayland/weston/0006-Change-GAL2D-compositor-to-be-default-i.patch
new file mode 100644
index 0000000..e0a855f
--- /dev/null
+++ b/recipes-graphics/wayland/weston/0006-Change-GAL2D-compositor-to-be-default-i.patch
@@ -0,0 +1,35 @@
1From 916e1fe5ca320f3115e904ae5543da3c5603d70e Mon Sep 17 00:00:00 2001
2From: Yong Gan <b45748@freescale.com>
3Date: Fri, 4 Jul 2014 09:57:11 +0800
4Subject: [PATCH] ENGR00321030 Change GAL2D compositor to be default in
5 SoloLite.
6
7Change GAL2D compositor to be default When EGL is not enabled.
8
9Date: Jul 03, 2014
10Signed-off-by Yong Gan <yong.gan@freescale.com>
11---
12 src/compositor-fbdev.c | 5 +++++
13 1 file changed, 5 insertions(+)
14
15diff --git a/src/compositor-fbdev.c b/src/compositor-fbdev.c
16index b27d199..bdc6ec9 100644
17--- a/src/compositor-fbdev.c
18+++ b/src/compositor-fbdev.c
19@@ -1060,8 +1060,13 @@ backend_init(struct wl_display *display, int *argc, char *argv[],
20 struct fbdev_parameters param = {
21 .tty = 0, /* default to current tty */
22 .device = "/dev/fb0", /* default frame buffer */
23+#ifdef ENABLE_EGL
24 .use_gl = 1,
25 .use_gal2d = 0,
26+#else
27+ .use_gl = 0,
28+ .use_gal2d = 1,
29+#endif
30 };
31
32 const struct weston_option fbdev_options[] = {
33--
341.7.9.5
35
diff --git a/recipes-graphics/wayland/weston_%.bbappend b/recipes-graphics/wayland/weston_%.bbappend
index 06aaed8..d6d1945 100644
--- a/recipes-graphics/wayland/weston_%.bbappend
+++ b/recipes-graphics/wayland/weston_%.bbappend
@@ -1,23 +1,37 @@
1FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" 1FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
2 2
3SRC_URI_append_mx6 = " \ 3SRC_URI_append_mx6 = " file://0001-ENGR00314805-1-Add-Vivante-EGL-support.patch \
4 file://0001-ENGR00314805-1-Add-Vivante-EGL-support.patch \ 4 file://0002-ENGR00314805-2-Add-Vivante-GAL2D-support.patch \
5 file://0002-ENGR00314805-2-Add-Vivante-GAL2D-support.patch" 5 file://0003-Distorted-line-and-shadow-if-use-2d-com.patch \
6 6 file://0004-Desktop-shell-Don-t-assume-there-is-a-pointer.patch \
7PACKAGECONFIG_mx6 = "fbdev egl cairo-glesv2" 7 file://0005-Enable-GAL2D-compositor-in-SoloLite.patch \
8 file://0006-Change-GAL2D-compositor-to-be-default-i.patch \
9 "
10PACKAGECONFIG_mx6 = "fbdev"
11PACKAGECONFIG_append_mx6q = " egl cairo-glesv2"
12PACKAGECONFIG_append_mx6dl = " egl cairo-glesv2"
8 13
9EXTRA_OECONF_append_mx6 = " \ 14EXTRA_OECONF_append_mx6 = " \
10 --disable-libunwind \ 15 --disable-libunwind \
11 --disable-xwayland-test \ 16 --disable-xwayland-test \
12 WESTON_NATIVE_BACKEND=fbdev-backend.so \ 17 WESTON_NATIVE_BACKEND=fbdev-backend.so \
13" 18"
14
15EXTRA_OEMAKE_append_mx6 = " \ 19EXTRA_OEMAKE_append_mx6 = " \
16 COMPOSITOR_LIBS="-lGLESv2 -lEGL -lGAL -lwayland-server -lxkbcommon -lpixman-1" \
17 COMPOSITOR_CFLAGS="-I ${STAGING_INCDIR}/pixman-1 -DLINUX=1 -DEGL_API_FB -DEGL_API_WL" \ 20 COMPOSITOR_CFLAGS="-I ${STAGING_INCDIR}/pixman-1 -DLINUX=1 -DEGL_API_FB -DEGL_API_WL" \
18 FB_COMPOSITOR_CFLAGS="-DLINUX=1 -DEGL_API_FB -DEGL_API_WL" \ 21 FB_COMPOSITOR_CFLAGS="-DLINUX=1 -DEGL_API_FB -DEGL_API_WL" \
19 FB_COMPOSITOR_LIBS="-lGLESv2 -lEGL -lwayland-server -lxkbcommon" \
20 SIMPLE_EGL_CLIENT_CFLAGS="-DLINUX -DEGL_API_FB -DEGL_API_WL" \ 22 SIMPLE_EGL_CLIENT_CFLAGS="-DLINUX -DEGL_API_FB -DEGL_API_WL" \
21 EGL_TESTS_CFLAGS="-DLINUX -DEGL_API_FB -DEGL_API_WL" \ 23 EGL_TESTS_CFLAGS="-DLINUX -DEGL_API_FB -DEGL_API_WL" \
22 CLIENT_CFLAGS="-I ${STAGING_INCDIR}/cairo -I ${STAGING_INCDIR}/pixman-1 -DLINUX -DEGL_API_FB -DEGL_API_WL" \ 24 CLIENT_CFLAGS="-I ${STAGING_INCDIR}/cairo -I ${STAGING_INCDIR}/pixman-1 -DLINUX -DEGL_API_FB -DEGL_API_WL" \
23" 25"
26EXTRA_OEMAKE_append_mx6q = " \
27 COMPOSITOR_LIBS="-lGLESv2 -lEGL -lGAL -lwayland-server -lxkbcommon -lpixman-1" \
28 FB_COMPOSITOR_LIBS="-lGLESv2 -lEGL -lwayland-server -lxkbcommon" \
29"
30EXTRA_OEMAKE_append_mx6dl = " \
31 COMPOSITOR_LIBS="-lGLESv2 -lEGL -lGAL -lwayland-server -lxkbcommon -lpixman-1" \
32 FB_COMPOSITOR_LIBS="-lGLESv2 -lEGL -lwayland-server -lxkbcommon" \
33"
34EXTRA_OEMAKE_append_mx6sl = " \
35 COMPOSITOR_LIBS="-lEGL -lGAL -lwayland-server -lxkbcommon -lpixman-1" \
36 FB_COMPOSITOR_LIBS="-lEGL -lwayland-server -lxkbcommon" \
37"