From 79bec9dd83424d4ec2d4d1fa945b33a6b1fda00d Mon Sep 17 00:00:00 2001 From: Neena Busireddy Date: Mon, 18 Aug 2014 15:10:49 -0500 Subject: 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 Signed-off-by: Otavio Salvador --- ...3-Distorted-line-and-shadow-if-use-2d-com.patch | 256 +++++++++++++++++++++ ...top-shell-Don-t-assume-there-is-a-pointer.patch | 36 +++ .../0005-Enable-GAL2D-compositor-in-SoloLite.patch | 36 +++ ...6-Change-GAL2D-compositor-to-be-default-i.patch | 35 +++ recipes-graphics/wayland/weston_%.bbappend | 30 ++- 5 files changed, 385 insertions(+), 8 deletions(-) create mode 100644 recipes-graphics/wayland/weston/0003-Distorted-line-and-shadow-if-use-2d-com.patch create mode 100644 recipes-graphics/wayland/weston/0004-Desktop-shell-Don-t-assume-there-is-a-pointer.patch create mode 100644 recipes-graphics/wayland/weston/0005-Enable-GAL2D-compositor-in-SoloLite.patch create mode 100644 recipes-graphics/wayland/weston/0006-Change-GAL2D-compositor-to-be-default-i.patch 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 @@ +From 1fd17db2ab978322803683a4d2d847a0b31a4c1c Mon Sep 17 00:00:00 2001 +From: Prabhu Sundararaj +Date: Tue, 24 Jun 2014 15:44:13 -0500 +Subject: [PATCH 3/3] ENGR00319247 : Distorted line and shadow if use 2d + compositor to run wayland apps. + +Fixed blending for shadown and maintained separate surface for damage composite. + +Upstream Status: N/A + +Signed-off-by: Prabhu Sundararaj +--- + src/compositor-fbdev.c | 8 ++-- + src/gal2d-renderer.c | 102 +++++++++++++++++++++++++++++++++++-------------- + src/gal2d-renderer.h | 6 +++ + 3 files changed, 83 insertions(+), 33 deletions(-) + +diff --git a/src/compositor-fbdev.c b/src/compositor-fbdev.c +index a3d32e5..b27d199 100644 +--- a/src/compositor-fbdev.c ++++ b/src/compositor-fbdev.c +@@ -55,7 +55,7 @@ struct fbdev_compositor { + int use_pixman; + int use_gal2d; + struct wl_listener session_listener; +- EGLNativeDisplayType display; ++ NativeDisplayType display; + }; + + struct fbdev_screeninfo { +@@ -91,8 +91,8 @@ struct fbdev_output { + void *shadow_buf; + uint8_t depth; + +- EGLNativeDisplayType display; +- EGLNativeWindowType window; ++ NativeDisplayType display; ++ NativeWindowType window; + }; + + struct fbdev_parameters { +@@ -667,7 +667,7 @@ fbdev_output_create(struct fbdev_compositor *compositor, + return 0; + } + if (gl_renderer->output_create(&output->base, +- (EGLNativeWindowType)output->window, ++ (NativeWindowType)output->window, + gl_renderer->opaque_attribs, + NULL) < 0) { + weston_log("gl_renderer_output_create failed.\n"); +diff --git a/src/gal2d-renderer.c b/src/gal2d-renderer.c +index c651573..fbe39f6 100644 +--- a/src/gal2d-renderer.c ++++ b/src/gal2d-renderer.c +@@ -42,7 +42,7 @@ struct gal2d_output_state { + + int current_buffer; + pixman_region32_t buffer_damage[2]; +- EGLNativeDisplayType display; ++ NativeDisplayType display; + gcoSURF* renderSurf; + gctUINT32 nNumBuffers; + int activebuffer; +@@ -423,11 +423,9 @@ gal2dBindBuffer(struct weston_surface* es) + gcoSURF surface = gs->gco_Surface; + struct weston_buffer *buffer = gs->buffer_ref.buffer; + gcePOOL pool = gcvPOOL_DEFAULT; +- gctUINT64 node = 0; +- gctUINT bytes; +- +- gcmVERIFY_OK(gcoSURF_QueryVidMemNode(surface, &node, +- &pool, &bytes)); ++ ++ gcmVERIFY_OK(gcoSURF_QueryVidMemNode(surface, gcvNULL, ++ &pool, gcvNULL)); + + if(pool != gcvPOOL_USER) + { +@@ -801,24 +799,26 @@ draw_view(struct weston_view *ev, struct weston_output *output, + ev->surface->width, ev->surface->height); + pixman_region32_subtract(&surface_blend, &surface_blend, &ev->surface->opaque); + ++ struct gal2d_renderer *gr = get_renderer(ec); ++ + if (pixman_region32_not_empty(&ev->surface->opaque)) { + + repaint_region(ev, output, go, &repaint, &ev->surface->opaque); + } + + if (pixman_region32_not_empty(&surface_blend)) { +- struct gal2d_renderer *gr = get_renderer(ec); +- ++ + gco2D_EnableAlphaBlend(gr->gcoEngine2d, +- ev->alpha * 0xFF, ev->alpha * 0xFF, +- gcvSURF_PIXEL_ALPHA_STRAIGHT, gcvSURF_PIXEL_ALPHA_STRAIGHT, +- gcvSURF_GLOBAL_ALPHA_OFF, gcvSURF_GLOBAL_ALPHA_OFF, +- gcvSURF_BLEND_ONE, gcvSURF_BLEND_INVERSED, +- gcvSURF_COLOR_STRAIGHT, gcvSURF_COLOR_STRAIGHT); ++ ev->alpha * 0xFF, ev->alpha * 0xFF, ++ gcvSURF_PIXEL_ALPHA_STRAIGHT, gcvSURF_PIXEL_ALPHA_STRAIGHT, ++ gcvSURF_GLOBAL_ALPHA_SCALE, gcvSURF_GLOBAL_ALPHA_SCALE, ++ gcvSURF_BLEND_STRAIGHT, gcvSURF_BLEND_INVERSED, ++ gcvSURF_COLOR_STRAIGHT, gcvSURF_COLOR_STRAIGHT); + + repaint_region(ev, output, go, &repaint, &surface_blend); + } + ++ gco2D_DisableAlphaBlend(gr->gcoEngine2d); + pixman_region32_fini(&surface_blend); + + out: +@@ -866,6 +866,48 @@ gal2d_renderer_repaint_output(struct weston_output *output, + } + + static void ++gal2d_renderer_attach_egl(struct weston_surface *es, struct weston_buffer *buffer) ++{ ++ gcsWL_VIV_BUFFER *vivBuffer = wl_resource_get_user_data(buffer->resource); ++ gctUINT width = 0; ++ gctUINT height = 0; ++ gctINT stride = 0; ++ gceSURF_FORMAT format; ++ gcoSURF srcSurf = vivBuffer->surface; ++ gctUINT32 physical; ++ gctPOINTER va =0; ++ gceSTATUS status = gcvSTATUS_OK; ++ struct gal2d_surface_state *gs = get_surface_state(es); ++ ++ if(gs->gco_Surface == gcvNULL) ++ { ++ /** Construct a wrapper. */ ++ gcmONERROR(gcoSURF_ConstructWrapper(gcvNULL, &gs->gco_Surface)); ++ } ++ ++ gcmONERROR(gcoSURF_GetAlignedSize(srcSurf, &width, &height, &stride)); ++ gcmONERROR(gcoSURF_GetFormat(srcSurf, gcvNULL, &format)); ++ gcmONERROR(gcoSURF_Lock(srcSurf, &physical, (gctPOINTER *)&va)); ++ ++ /* Set the buffer. */ ++ gcmONERROR(gcoSURF_SetBuffer(gs->gco_Surface, ++ gcvSURF_BITMAP_NO_VIDMEM, ++ format, ++ stride, ++ (gctPOINTER) va, ++ (gctUINT32) physical)); ++ ++ /* Set the window. */ ++ gcmONERROR(gcoSURF_SetWindow(gs->gco_Surface, 0, 0, width, height)); ++ ++ buffer->width = vivBuffer->width; ++ buffer->height = vivBuffer->height; ++ ++ OnError: ++ galONERROR(status); ++} ++ ++static void + gal2d_renderer_flush_damage(struct weston_surface *surface) + { + struct gal2d_surface_state *gs = get_surface_state(surface); +@@ -900,10 +942,7 @@ gal2d_renderer_flush_damage(struct weston_surface *surface) + gal2dBindBuffer(surface); + } + else +- { +- gcsWL_VIV_BUFFER *vivBuffer = (gcsWL_VIV_BUFFER *)buffer; +- gs->gco_Surface = vivBuffer->surface; +- } ++ gal2d_renderer_attach_egl(surface, buffer); + + done: + pixman_region32_fini(&gs->texture_damage); +@@ -937,19 +976,17 @@ gal2d_renderer_attach(struct weston_surface *es, struct weston_buffer *buffer) + } + } + else +- { +- gcsWL_VIV_BUFFER *vivBuffer = wl_resource_get_user_data(buffer->resource); +- gs->gco_Surface = vivBuffer->surface; +- +- buffer->width = vivBuffer->width; +- buffer->height = vivBuffer->height; +- } ++ gal2d_renderer_attach_egl(es, buffer); + } + + static void + surface_state_destroy(struct gal2d_surface_state *gs, struct gal2d_renderer *gr) + { +- wl_list_remove(&gs->surface_destroy_listener.link); ++ if(gs->gco_Surface) ++ { ++ gcoSURF_Destroy(gs->gco_Surface); ++ } ++ wl_list_remove(&gs->surface_destroy_listener.link); + wl_list_remove(&gs->renderer_destroy_listener.link); + if(gs->surface) + gs->surface->renderer_state = NULL; +@@ -1043,8 +1080,12 @@ gal2d_renderer_output_destroy(struct weston_output *output) + { + struct gal2d_output_state *go = get_output_state(output); + gctUINT32 i; +- +- if(go->nNumBuffers <= 1 ) ++ ++ for (i = 0; i < 2; i++) ++ { ++ pixman_region32_fini(&go->buffer_damage[i]); ++ } ++ if(go->nNumBuffers <= 1 ) + { + if(go->offscreenSurface) + gcmVERIFY_OK(gcoSURF_Destroy(go->offscreenSurface)); +@@ -1107,8 +1148,8 @@ OnError: + } + + static int +-gal2d_renderer_output_create(struct weston_output *output, EGLNativeDisplayType display, +- EGLNativeWindowType window) ++gal2d_renderer_output_create(struct weston_output *output, NativeDisplayType display, ++ NativeWindowType window) + + { + struct gal2d_renderer *gr = get_renderer(output->compositor); +@@ -1174,6 +1215,9 @@ gal2d_renderer_output_create(struct weston_output *output, EGLNativeDisplayType + gal2d_clear(output); + gal2d_flip_surface(output); + } ++ ++ for (i = 0; i < 2; i++) ++ pixman_region32_init(&go->buffer_damage[i]); + OnError: + galONERROR(status); + /* Return the status. */ +diff --git a/src/gal2d-renderer.h b/src/gal2d-renderer.h +index 3b89f73..1322a7d 100644 +--- a/src/gal2d-renderer.h ++++ b/src/gal2d-renderer.h +@@ -24,7 +24,13 @@ + #define __gal_2d_renderer_h_ + + #include "compositor.h" ++#ifdef ENABLE_EGL + #include ++#else ++#include ++typedef HALNativeDisplayType NativeDisplayType; ++typedef HALNativeWindowType NativeWindowType; ++#endif + + + struct gal2d_renderer_interface { +-- +2.0.0 + 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 @@ +From 1194ccebc0db14ba681bd8272e01715b3e7008cc Mon Sep 17 00:00:00 2001 +From: Yong Gan +Date: Fri, 27 Jun 2014 11:33:53 +0800 +Subject: [PATCH] ENGR00320189 desktop-shell: Don't assume there is a pointer + when resizing + +Fixes a crash on touch devices without a pointer, when touching +the window frame of a client. +cherry-pick from 5872b6821be7c9c0a17a0de962e3f4a04f5d0c6f + +Date: Jun 27, 2014 + +Upstream Status: N/A + +Signed-off-by Yong Gan +--- + desktop-shell/shell.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/desktop-shell/shell.c b/desktop-shell/shell.c +index 84f5c83..d965618 100644 +--- a/desktop-shell/shell.c ++++ b/desktop-shell/shell.c +@@ -1784,7 +1784,8 @@ common_surface_resize(struct wl_resource *resource, + struct shell_surface *shsurf = wl_resource_get_user_data(resource); + struct weston_surface *surface; + +- if (seat->pointer->button_count == 0 || ++ if (seat->pointer == NULL || ++ seat->pointer->button_count == 0 || + seat->pointer->grab_serial != serial || + seat->pointer->focus == NULL) + return; +-- +1.7.9.5 + 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 @@ +From 1eea925312fb7e1bc1cf42e001069cbac887b128 Mon Sep 17 00:00:00 2001 +From: Yong Gan +Date: Wed, 2 Jul 2014 11:27:26 +0800 +Subject: [PATCH] ENGR00320243 Enable GAL2D compositor in SoloLite + +Build gal2d-renderer.so when EGL was not enabled. + +Date: Jul 02, 2014 +Signed-off-by Yong Gan +--- + Makefile.am | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Makefile.am b/Makefile.am +index 2bccfe9..42148b1 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -162,6 +162,7 @@ gl_renderer_la_SOURCES = \ + src/gl-renderer.c \ + src/vertex-clipping.c \ + src/vertex-clipping.h ++endif + + module_LTLIBRARIES += gal2d-renderer.la + gal2d_renderer_la_LDFLAGS = -module -avoid-version +@@ -175,7 +176,6 @@ gal2d_renderer_la_SOURCES = \ + src/gal2d-renderer.c \ + src/vertex-clipping.c \ + src/vertex-clipping.h +-endif + + if ENABLE_X11_COMPOSITOR + module_LTLIBRARIES += x11-backend.la +-- +1.7.9.5 + 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 @@ +From 916e1fe5ca320f3115e904ae5543da3c5603d70e Mon Sep 17 00:00:00 2001 +From: Yong Gan +Date: Fri, 4 Jul 2014 09:57:11 +0800 +Subject: [PATCH] ENGR00321030 Change GAL2D compositor to be default in + SoloLite. + +Change GAL2D compositor to be default When EGL is not enabled. + +Date: Jul 03, 2014 +Signed-off-by Yong Gan +--- + src/compositor-fbdev.c | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/src/compositor-fbdev.c b/src/compositor-fbdev.c +index b27d199..bdc6ec9 100644 +--- a/src/compositor-fbdev.c ++++ b/src/compositor-fbdev.c +@@ -1060,8 +1060,13 @@ backend_init(struct wl_display *display, int *argc, char *argv[], + struct fbdev_parameters param = { + .tty = 0, /* default to current tty */ + .device = "/dev/fb0", /* default frame buffer */ ++#ifdef ENABLE_EGL + .use_gl = 1, + .use_gal2d = 0, ++#else ++ .use_gl = 0, ++ .use_gal2d = 1, ++#endif + }; + + const struct weston_option fbdev_options[] = { +-- +1.7.9.5 + 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 @@ FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" -SRC_URI_append_mx6 = " \ - file://0001-ENGR00314805-1-Add-Vivante-EGL-support.patch \ - file://0002-ENGR00314805-2-Add-Vivante-GAL2D-support.patch" - -PACKAGECONFIG_mx6 = "fbdev egl cairo-glesv2" +SRC_URI_append_mx6 = " file://0001-ENGR00314805-1-Add-Vivante-EGL-support.patch \ + file://0002-ENGR00314805-2-Add-Vivante-GAL2D-support.patch \ + file://0003-Distorted-line-and-shadow-if-use-2d-com.patch \ + file://0004-Desktop-shell-Don-t-assume-there-is-a-pointer.patch \ + file://0005-Enable-GAL2D-compositor-in-SoloLite.patch \ + file://0006-Change-GAL2D-compositor-to-be-default-i.patch \ + " +PACKAGECONFIG_mx6 = "fbdev" +PACKAGECONFIG_append_mx6q = " egl cairo-glesv2" +PACKAGECONFIG_append_mx6dl = " egl cairo-glesv2" EXTRA_OECONF_append_mx6 = " \ --disable-libunwind \ --disable-xwayland-test \ WESTON_NATIVE_BACKEND=fbdev-backend.so \ " - EXTRA_OEMAKE_append_mx6 = " \ - COMPOSITOR_LIBS="-lGLESv2 -lEGL -lGAL -lwayland-server -lxkbcommon -lpixman-1" \ COMPOSITOR_CFLAGS="-I ${STAGING_INCDIR}/pixman-1 -DLINUX=1 -DEGL_API_FB -DEGL_API_WL" \ FB_COMPOSITOR_CFLAGS="-DLINUX=1 -DEGL_API_FB -DEGL_API_WL" \ - FB_COMPOSITOR_LIBS="-lGLESv2 -lEGL -lwayland-server -lxkbcommon" \ SIMPLE_EGL_CLIENT_CFLAGS="-DLINUX -DEGL_API_FB -DEGL_API_WL" \ EGL_TESTS_CFLAGS="-DLINUX -DEGL_API_FB -DEGL_API_WL" \ CLIENT_CFLAGS="-I ${STAGING_INCDIR}/cairo -I ${STAGING_INCDIR}/pixman-1 -DLINUX -DEGL_API_FB -DEGL_API_WL" \ " +EXTRA_OEMAKE_append_mx6q = " \ + COMPOSITOR_LIBS="-lGLESv2 -lEGL -lGAL -lwayland-server -lxkbcommon -lpixman-1" \ + FB_COMPOSITOR_LIBS="-lGLESv2 -lEGL -lwayland-server -lxkbcommon" \ +" +EXTRA_OEMAKE_append_mx6dl = " \ + COMPOSITOR_LIBS="-lGLESv2 -lEGL -lGAL -lwayland-server -lxkbcommon -lpixman-1" \ + FB_COMPOSITOR_LIBS="-lGLESv2 -lEGL -lwayland-server -lxkbcommon" \ +" +EXTRA_OEMAKE_append_mx6sl = " \ + COMPOSITOR_LIBS="-lEGL -lGAL -lwayland-server -lxkbcommon -lpixman-1" \ + FB_COMPOSITOR_LIBS="-lEGL -lwayland-server -lxkbcommon" \ +" -- cgit v1.2.3-54-g00ecf