diff options
| author | Neena Busireddy <neenareddy.busireddy@nxp.com> | 2016-02-18 15:23:48 -0600 |
|---|---|---|
| committer | Otavio Salvador <otavio@ossystems.com.br> | 2016-04-19 15:03:26 -0300 |
| commit | d9c60161a34c7cf127cda1782e4adf0d52aab947 (patch) | |
| tree | 77f0a68c84d8949ca790c65ae350072083258d8b | |
| parent | aed168c2d09c97349e5ccf9b707ed522fc56ee77 (diff) | |
| download | meta-freescale-d9c60161a34c7cf127cda1782e4adf0d52aab947.tar.gz | |
weston: Fix issues with 1.9 version
These set of patches are required to address the issues with weston 1.9
Signed-off-by: Neena Busireddy <neenareddy.busireddy@nxp.com>
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
| -rw-r--r-- | recipes-graphics/wayland/weston/0002-MGS-1111-Add-GPU-VIV-suport-for-wayland-and-weston-1.patch (renamed from recipes-graphics/wayland/weston/0001-MGS-840-Add-i.MX6-support-for-weston.patch) | 230 | ||||
| -rw-r--r-- | recipes-graphics/wayland/weston/0006-MGS-1236-imx6qp-imx6dl-First-frame-distored-when-som.patch | 106 | ||||
| -rw-r--r-- | recipes-graphics/wayland/weston/0007-MGS-1236-1-imx6qp-imx6dl-First-frame-distored-when-s.patch | 51 | ||||
| -rw-r--r-- | recipes-graphics/wayland/weston_%.bbappend | 8 |
4 files changed, 270 insertions, 125 deletions
diff --git a/recipes-graphics/wayland/weston/0001-MGS-840-Add-i.MX6-support-for-weston.patch b/recipes-graphics/wayland/weston/0002-MGS-1111-Add-GPU-VIV-suport-for-wayland-and-weston-1.patch index 80505bdcd..9d35356d2 100644 --- a/recipes-graphics/wayland/weston/0001-MGS-840-Add-i.MX6-support-for-weston.patch +++ b/recipes-graphics/wayland/weston/0002-MGS-1111-Add-GPU-VIV-suport-for-wayland-and-weston-1.patch | |||
| @@ -1,32 +1,28 @@ | |||
| 1 | From 0da66b0b96a7059392f0b62d3a13fcedf1023ba8 Mon Sep 17 00:00:00 2001 | 1 | From e766967ae24d15048c01d03de09fc39757d13ec3 Mon Sep 17 00:00:00 2001 |
| 2 | From: Prabhu <prabhu.sundararaj@freescale.com> | 2 | From: Prabhu <prabhu.sundararaj@freescale.com> |
| 3 | Date: Wed, 24 Jun 2015 17:29:03 -0500 | 3 | Date: Sat, 3 Oct 2015 19:44:33 -0500 |
| 4 | Subject: [PATCH] MGS-840 Add i.MX6 support for weston | 4 | Subject: [PATCH] MGS-1111: Add GPU-VIV suport for wayland and weston 1.9 |
| 5 | 5 | ||
| 6 | Add fbdev backend support for Vivante FBdev EGL | 6 | Add support GPU-VIV support for weston 1.9 |
| 7 | 7 | ||
| 8 | Date: June 24, 2015 | ||
| 9 | Signed-off-by: Prabhu <prabhu.sundararaj@freescale.com> | 8 | Signed-off-by: Prabhu <prabhu.sundararaj@freescale.com> |
| 10 | --- | 9 | --- |
| 11 | Makefile.am | 13 + | 10 | Makefile.am | 12 + |
| 12 | src/compositor-fbdev.c | 139 ++++- | 11 | src/compositor-fbdev.c | 128 ++++- |
| 13 | src/gal2d-renderer.c | 1337 ++++++++++++++++++++++++++++++++++++++++++++++++ | 12 | src/gal2d-renderer.c | 1342 ++++++++++++++++++++++++++++++++++++++++++++++++ |
| 14 | src/gal2d-renderer.h | 47 ++ | 13 | src/gal2d-renderer.h | 50 ++ |
| 15 | 4 files changed, 1519 insertions(+), 17 deletions(-) | 14 | 4 files changed, 1519 insertions(+), 13 deletions(-) |
| 16 | mode change 100644 => 100755 Makefile.am | ||
| 17 | create mode 100644 src/gal2d-renderer.c | 15 | create mode 100644 src/gal2d-renderer.c |
| 18 | create mode 100644 src/gal2d-renderer.h | 16 | create mode 100644 src/gal2d-renderer.h |
| 19 | 17 | ||
| 20 | diff --git a/Makefile.am b/Makefile.am | 18 | diff --git a/Makefile.am b/Makefile.am |
| 21 | old mode 100644 | 19 | index 62719c9..86d3dfa 100644 |
| 22 | new mode 100755 | ||
| 23 | index 5819b19..e7e2d49 | ||
| 24 | --- a/Makefile.am | 20 | --- a/Makefile.am |
| 25 | +++ b/Makefile.am | 21 | +++ b/Makefile.am |
| 26 | @@ -207,6 +207,19 @@ gl_renderer_la_SOURCES = \ | 22 | @@ -214,6 +214,18 @@ gl_renderer_la_SOURCES = \ |
| 27 | src/vertex-clipping.h | 23 | src/vertex-clipping.h \ |
| 24 | shared/helpers.h | ||
| 28 | endif | 25 | endif |
| 29 | |||
| 30 | +module_LTLIBRARIES += gal2d-renderer.la | 26 | +module_LTLIBRARIES += gal2d-renderer.la |
| 31 | +gal2d_renderer_la_LDFLAGS = -module -avoid-version | 27 | +gal2d_renderer_la_LDFLAGS = -module -avoid-version |
| 32 | +gal2d_renderer_la_LIBADD = $(COMPOSITOR_LIBS) $(EGL_LIBS) | 28 | +gal2d_renderer_la_LIBADD = $(COMPOSITOR_LIBS) $(EGL_LIBS) |
| @@ -39,23 +35,22 @@ index 5819b19..e7e2d49 | |||
| 39 | + src/gal2d-renderer.c \ | 35 | + src/gal2d-renderer.c \ |
| 40 | + src/vertex-clipping.c \ | 36 | + src/vertex-clipping.c \ |
| 41 | + src/vertex-clipping.h | 37 | + src/vertex-clipping.h |
| 42 | + | 38 | |
| 43 | if ENABLE_X11_COMPOSITOR | 39 | if ENABLE_X11_COMPOSITOR |
| 44 | module_LTLIBRARIES += x11-backend.la | 40 | module_LTLIBRARIES += x11-backend.la |
| 45 | x11_backend_la_LDFLAGS = -module -avoid-version | ||
| 46 | diff --git a/src/compositor-fbdev.c b/src/compositor-fbdev.c | 41 | diff --git a/src/compositor-fbdev.c b/src/compositor-fbdev.c |
| 47 | index 3f3394f..9d18c45 100644 | 42 | index 81281d0..c6f732e 100644 |
| 48 | --- a/src/compositor-fbdev.c | 43 | --- a/src/compositor-fbdev.c |
| 49 | +++ b/src/compositor-fbdev.c | 44 | +++ b/src/compositor-fbdev.c |
| 50 | @@ -45,6 +45,7 @@ | 45 | @@ -49,6 +49,7 @@ |
| 51 | #include "libinput-seat.h" | 46 | #include "libinput-seat.h" |
| 52 | #include "gl-renderer.h" | 47 | #include "gl-renderer.h" |
| 53 | #include "presentation_timing-server-protocol.h" | 48 | #include "presentation_timing-server-protocol.h" |
| 54 | +#include "gal2d-renderer.h" | 49 | +#include "gal2d-renderer.h" |
| 55 | 50 | ||
| 56 | struct fbdev_compositor { | 51 | struct fbdev_backend { |
| 57 | struct weston_compositor base; | 52 | struct weston_backend base; |
| 58 | @@ -53,7 +54,9 @@ struct fbdev_compositor { | 53 | @@ -58,7 +59,9 @@ struct fbdev_backend { |
| 59 | struct udev *udev; | 54 | struct udev *udev; |
| 60 | struct udev_input input; | 55 | struct udev_input input; |
| 61 | int use_pixman; | 56 | int use_pixman; |
| @@ -65,7 +60,7 @@ index 3f3394f..9d18c45 100644 | |||
| 65 | }; | 60 | }; |
| 66 | 61 | ||
| 67 | struct fbdev_screeninfo { | 62 | struct fbdev_screeninfo { |
| 68 | @@ -88,15 +91,20 @@ struct fbdev_output { | 63 | @@ -93,15 +96,20 @@ struct fbdev_output { |
| 69 | pixman_image_t *shadow_surface; | 64 | pixman_image_t *shadow_surface; |
| 70 | void *shadow_buf; | 65 | void *shadow_buf; |
| 71 | uint8_t depth; | 66 | uint8_t depth; |
| @@ -86,7 +81,7 @@ index 3f3394f..9d18c45 100644 | |||
| 86 | 81 | ||
| 87 | static const char default_seat[] = "seat0"; | 82 | static const char default_seat[] = "seat0"; |
| 88 | 83 | ||
| 89 | @@ -471,6 +479,10 @@ fbdev_frame_buffer_destroy(struct fbdev_output *output) | 84 | @@ -476,6 +484,10 @@ fbdev_frame_buffer_destroy(struct fbdev_output *output) |
| 90 | strerror(errno)); | 85 | strerror(errno)); |
| 91 | 86 | ||
| 92 | output->fb = NULL; | 87 | output->fb = NULL; |
| @@ -97,16 +92,16 @@ index 3f3394f..9d18c45 100644 | |||
| 97 | } | 92 | } |
| 98 | 93 | ||
| 99 | static void fbdev_output_destroy(struct weston_output *base); | 94 | static void fbdev_output_destroy(struct weston_output *base); |
| 100 | @@ -478,7 +490,7 @@ static void fbdev_output_disable(struct weston_output *base); | 95 | @@ -483,7 +495,7 @@ static void fbdev_output_disable(struct weston_output *base); |
| 101 | 96 | ||
| 102 | static int | 97 | static int |
| 103 | fbdev_output_create(struct fbdev_compositor *compositor, | 98 | fbdev_output_create(struct fbdev_backend *backend, |
| 104 | - const char *device) | 99 | - const char *device) |
| 105 | + int x, int y, const char *device) | 100 | + int x, int y, const char *device) |
| 106 | { | 101 | { |
| 107 | struct fbdev_output *output; | 102 | struct fbdev_output *output; |
| 108 | struct weston_config_section *section; | 103 | struct weston_config_section *section; |
| 109 | @@ -489,7 +501,7 @@ fbdev_output_create(struct fbdev_compositor *compositor, | 104 | @@ -494,7 +506,7 @@ fbdev_output_create(struct fbdev_backend *backend, |
| 110 | uint32_t config_transform; | 105 | uint32_t config_transform; |
| 111 | char *s; | 106 | char *s; |
| 112 | 107 | ||
| @@ -115,26 +110,26 @@ index 3f3394f..9d18c45 100644 | |||
| 115 | 110 | ||
| 116 | output = zalloc(sizeof *output); | 111 | output = zalloc(sizeof *output); |
| 117 | if (output == NULL) | 112 | if (output == NULL) |
| 118 | @@ -542,7 +554,7 @@ fbdev_output_create(struct fbdev_compositor *compositor, | 113 | @@ -547,7 +559,7 @@ fbdev_output_create(struct fbdev_backend *backend, |
| 119 | free(s); | 114 | free(s); |
| 120 | 115 | ||
| 121 | weston_output_init(&output->base, &compositor->base, | 116 | weston_output_init(&output->base, backend->compositor, |
| 122 | - 0, 0, output->fb_info.width_mm, | 117 | - 0, 0, output->fb_info.width_mm, |
| 123 | + x, y, output->fb_info.width_mm, | 118 | + x, y, output->fb_info.width_mm, |
| 124 | output->fb_info.height_mm, | 119 | output->fb_info.height_mm, |
| 125 | config_transform, | 120 | config_transform, |
| 126 | 1); | 121 | 1); |
| 127 | @@ -565,12 +577,43 @@ fbdev_output_create(struct fbdev_compositor *compositor, | 122 | @@ -570,10 +582,41 @@ fbdev_output_create(struct fbdev_backend *backend, |
| 128 | if (compositor->use_pixman) { | 123 | if (backend->use_pixman) { |
| 129 | if (pixman_renderer_output_create(&output->base) < 0) | 124 | if (pixman_renderer_output_create(&output->base) < 0) |
| 130 | goto out_shadow_surface; | 125 | goto out_shadow_surface; |
| 131 | - } else { | 126 | - } else { |
| 132 | + } | 127 | + } |
| 133 | + else if(compositor->use_gal2d) { | 128 | + else if(backend->use_gal2d) { |
| 134 | + | 129 | + |
| 135 | + char* fbenv = getenv("FB_FRAMEBUFFER_0"); | 130 | + char* fbenv = getenv("FB_FRAMEBUFFER_0"); |
| 136 | + setenv("FB_FRAMEBUFFER_0", device, 1); | 131 | + setenv("FB_FRAMEBUFFER_0", device, 1); |
| 137 | + output->display = fbGetDisplay(compositor->base.wl_display); | 132 | + output->display = fbGetDisplay(backend->compositor->wl_display); |
| 138 | + if (output->display == NULL) { | 133 | + if (output->display == NULL) { |
| 139 | + fprintf(stderr, "failed to get display\n"); | 134 | + fprintf(stderr, "failed to get display\n"); |
| 140 | + return 0; | 135 | + return 0; |
| @@ -155,64 +150,48 @@ index 3f3394f..9d18c45 100644 | |||
| 155 | + } | 150 | + } |
| 156 | + | 151 | + |
| 157 | + } | 152 | + } |
| 158 | + else { | 153 | + else { |
| 159 | setenv("HYBRIS_EGLPLATFORM", "wayland", 1); | 154 | setenv("HYBRIS_EGLPLATFORM", "wayland", 1); |
| 160 | + output->window = fbCreateWindow(compositor->display, -1, -1, 0, 0); | 155 | + output->window = fbCreateWindow(backend->display, -1, -1, 0, 0); |
| 161 | + if (output->window == NULL) { | 156 | + if (output->window == NULL) { |
| 162 | + fprintf(stderr, "failed to create window\n"); | 157 | + fprintf(stderr, "failed to create window\n"); |
| 163 | + return 0; | 158 | + return 0; |
| 164 | + } | 159 | + } |
| 165 | if (gl_renderer->output_create(&output->base, | 160 | if (gl_renderer->output_create(&output->base, |
| 166 | - (EGLNativeWindowType)NULL, NULL, | 161 | - (EGLNativeWindowType)NULL, NULL, |
| 167 | - gl_renderer->opaque_attribs, | 162 | + (EGLNativeWindowType)output->window, NULL, |
| 168 | - NULL, 0) < 0) { | 163 | gl_renderer->opaque_attribs, |
| 169 | + (NativeWindowType)output->window, NULL, | 164 | NULL, 0) < 0) { |
| 170 | + gl_renderer->opaque_attribs, | ||
| 171 | + NULL, 0) < 0) { | ||
| 172 | weston_log("gl_renderer_output_create failed.\n"); | 165 | weston_log("gl_renderer_output_create failed.\n"); |
| 173 | goto out_shadow_surface; | 166 | @@ -634,7 +677,11 @@ fbdev_output_destroy(struct weston_output *base) |
| 174 | } | ||
| 175 | @@ -629,7 +672,11 @@ fbdev_output_destroy(struct weston_output *base) | ||
| 176 | free(output->shadow_buf); | 167 | free(output->shadow_buf); |
| 177 | output->shadow_buf = NULL; | 168 | output->shadow_buf = NULL; |
| 178 | } | 169 | } |
| 179 | - } else { | 170 | - } else { |
| 180 | + } | 171 | + } |
| 181 | + else if (compositor->use_gal2d) { | 172 | + else if (backend->use_gal2d) { |
| 182 | + gal2d_renderer->output_destroy(base); | 173 | + gal2d_renderer->output_destroy(base); |
| 183 | + } | 174 | + } |
| 184 | + else { | 175 | + else { |
| 185 | gl_renderer->output_destroy(base); | 176 | gl_renderer->output_destroy(base); |
| 186 | } | 177 | } |
| 187 | 178 | ||
| 188 | @@ -692,7 +739,7 @@ fbdev_output_reenable(struct fbdev_compositor *compositor, | 179 | @@ -697,7 +744,7 @@ fbdev_output_reenable(struct fbdev_backend *backend, |
| 189 | * are re-initialised. */ | 180 | * are re-initialised. */ |
| 190 | device = output->device; | 181 | device = output->device; |
| 191 | fbdev_output_destroy(base); | 182 | fbdev_output_destroy(base); |
| 192 | - fbdev_output_create(compositor, device); | 183 | - fbdev_output_create(backend, device); |
| 193 | + fbdev_output_create(compositor, 0, 0, device); | 184 | + fbdev_output_create(backend, 0, 0, device); |
| 194 | 185 | ||
| 195 | return 0; | 186 | return 0; |
| 196 | } | 187 | } |
| 197 | @@ -850,7 +897,10 @@ fbdev_compositor_create(struct wl_display *display, int *argc, char *argv[], | 188 | @@ -863,7 +910,50 @@ fbdev_backend_create(struct weston_compositor *compositor, int *argc, char *argv |
| 198 | compositor->base.restore = fbdev_restore; | 189 | if (backend->use_pixman) { |
| 199 | 190 | if (pixman_renderer_init(compositor) < 0) | |
| 200 | compositor->prev_state = WESTON_COMPOSITOR_ACTIVE; | ||
| 201 | - compositor->use_pixman = !param->use_gl; | ||
| 202 | + compositor->use_gal2d = param->use_gal2d; | ||
| 203 | + weston_log("compositor->use_gal2d=%d\n", compositor->use_gal2d); | ||
| 204 | + if(param->use_gl == 0 && param->use_gal2d == 0) | ||
| 205 | + compositor->use_pixman = 1; | ||
| 206 | |||
| 207 | for (key = KEY_F1; key < KEY_F9; key++) | ||
| 208 | weston_compositor_add_key_binding(&compositor->base, key, | ||
| 209 | @@ -860,7 +910,50 @@ fbdev_compositor_create(struct wl_display *display, int *argc, char *argv[], | ||
| 210 | if (compositor->use_pixman) { | ||
| 211 | if (pixman_renderer_init(&compositor->base) < 0) | ||
| 212 | goto out_launcher; | 191 | goto out_launcher; |
| 213 | - } else { | 192 | - } else { |
| 214 | + } | 193 | + } |
| 215 | + else if (compositor->use_gal2d) { | 194 | + else if (backend->use_gal2d) { |
| 216 | + int x = 0, y = 0; | 195 | + int x = 0, y = 0; |
| 217 | + int i=0; | 196 | + int i=0; |
| 218 | + int count = 0; | 197 | + int count = 0; |
| @@ -225,7 +204,7 @@ index 3f3394f..9d18c45 100644 | |||
| 225 | + goto out_launcher; | 204 | + goto out_launcher; |
| 226 | + } | 205 | + } |
| 227 | + | 206 | + |
| 228 | + if (gal2d_renderer->create(&compositor->base) < 0) { | 207 | + if (gal2d_renderer->create(backend->compositor) < 0) { |
| 229 | + weston_log("gal2d_renderer_create failed.\n"); | 208 | + weston_log("gal2d_renderer_create failed.\n"); |
| 230 | + goto out_launcher; | 209 | + goto out_launcher; |
| 231 | + } | 210 | + } |
| @@ -247,30 +226,29 @@ index 3f3394f..9d18c45 100644 | |||
| 247 | + | 226 | + |
| 248 | + for(i=0; i<dispCount; i++) | 227 | + for(i=0; i<dispCount; i++) |
| 249 | + { | 228 | + { |
| 250 | + if (fbdev_output_create(compositor, x, y, displays[i]) < 0) | 229 | + if (fbdev_output_create(backend, x, y, displays[i]) < 0) |
| 251 | + goto out_pixman; | 230 | + goto out_launcher; |
| 252 | + x += container_of(compositor->base.output_list.prev, | 231 | + x += container_of(backend->compositor->output_list.prev, |
| 253 | + struct weston_output, | 232 | + struct weston_output, |
| 254 | + link)->width; | 233 | + link)->width; |
| 255 | + } | 234 | + } |
| 256 | + } | 235 | + } |
| 257 | + else { | 236 | + else { |
| 258 | gl_renderer = weston_load_module("gl-renderer.so", | 237 | gl_renderer = weston_load_module("gl-renderer.so", |
| 259 | "gl_renderer_interface"); | 238 | "gl_renderer_interface"); |
| 260 | if (!gl_renderer) { | 239 | if (!gl_renderer) { |
| 261 | @@ -868,17 +961,22 @@ fbdev_compositor_create(struct wl_display *display, int *argc, char *argv[], | 240 | @@ -871,17 +961,22 @@ fbdev_backend_create(struct weston_compositor *compositor, int *argc, char *argv |
| 262 | goto out_launcher; | 241 | goto out_launcher; |
| 263 | } | 242 | } |
| 264 | 243 | ||
| 265 | - if (gl_renderer->create(&compositor->base, NO_EGL_PLATFORM, | 244 | + backend->display = fbGetDisplay(backend->compositor->wl_display); |
| 266 | - EGL_DEFAULT_DISPLAY, | 245 | + if (backend->display == NULL) { |
| 267 | + compositor->display = fbGetDisplay(compositor->base.wl_display); | ||
| 268 | + if (compositor->display == NULL) { | ||
| 269 | + weston_log("fbGetDisplay failed.\n"); | 246 | + weston_log("fbGetDisplay failed.\n"); |
| 270 | + goto out_launcher; | 247 | + goto out_launcher; |
| 271 | + } | 248 | + } |
| 272 | + | 249 | if (gl_renderer->create(compositor, NO_EGL_PLATFORM, |
| 273 | + if (gl_renderer->create(&compositor->base, NO_EGL_PLATFORM, compositor->display, | 250 | - EGL_DEFAULT_DISPLAY, |
| 251 | + backend->display, | ||
| 274 | gl_renderer->opaque_attribs, | 252 | gl_renderer->opaque_attribs, |
| 275 | NULL, 0) < 0) { | 253 | NULL, 0) < 0) { |
| 276 | weston_log("gl_renderer_create failed.\n"); | 254 | weston_log("gl_renderer_create failed.\n"); |
| @@ -278,15 +256,15 @@ index 3f3394f..9d18c45 100644 | |||
| 278 | } | 256 | } |
| 279 | } | 257 | } |
| 280 | - | 258 | - |
| 281 | - if (fbdev_output_create(compositor, param->device) < 0) | 259 | - if (fbdev_output_create(backend, param->device) < 0) |
| 282 | - goto out_pixman; | 260 | - goto out_launcher; |
| 283 | + if(!compositor->use_gal2d) | 261 | + if(!backend->use_gal2d) |
| 284 | + if (fbdev_output_create(compositor, 0, 0, param->device) < 0) | 262 | + if (fbdev_output_create(backend, 0, 0, param->device) < 0) |
| 285 | + goto out_pixman; | 263 | + goto out_launcher; |
| 286 | 264 | ||
| 287 | udev_input_init(&compositor->input, &compositor->base, compositor->udev, seat_id); | 265 | udev_input_init(&backend->input, compositor, backend->udev, seat_id); |
| 288 | 266 | ||
| 289 | @@ -911,13 +1009,20 @@ backend_init(struct wl_display *display, int *argc, char *argv[], | 267 | @@ -911,13 +1006,20 @@ backend_init(struct weston_compositor *compositor, int *argc, char *argv[], |
| 290 | struct fbdev_parameters param = { | 268 | struct fbdev_parameters param = { |
| 291 | .tty = 0, /* default to current tty */ | 269 | .tty = 0, /* default to current tty */ |
| 292 | .device = "/dev/fb0", /* default frame buffer */ | 270 | .device = "/dev/fb0", /* default frame buffer */ |
| @@ -310,31 +288,35 @@ index 3f3394f..9d18c45 100644 | |||
| 310 | parse_options(fbdev_options, ARRAY_LENGTH(fbdev_options), argc, argv); | 288 | parse_options(fbdev_options, ARRAY_LENGTH(fbdev_options), argc, argv); |
| 311 | diff --git a/src/gal2d-renderer.c b/src/gal2d-renderer.c | 289 | diff --git a/src/gal2d-renderer.c b/src/gal2d-renderer.c |
| 312 | new file mode 100644 | 290 | new file mode 100644 |
| 313 | index 0000000..7ebbf98 | 291 | index 0000000..c68f02c |
| 314 | --- /dev/null | 292 | --- /dev/null |
| 315 | +++ b/src/gal2d-renderer.c | 293 | +++ b/src/gal2d-renderer.c |
| 316 | @@ -0,0 +1,1337 @@ | 294 | @@ -0,0 +1,1342 @@ |
| 317 | +/* | 295 | +/* |
| 318 | + * Copyright (c) 2015 Freescale Semiconductor, Inc. | 296 | + * Copyright (c) 2015 Freescale Semiconductor, Inc. |
| 319 | + * Copyright © 2012 Intel Corporation | 297 | + * Copyright © 2012 Intel Corporation |
| 298 | + * Copyright © 2015 Collabora, Ltd. | ||
| 320 | + * | 299 | + * |
| 321 | + * Permission to use, copy, modify, distribute, and sell this software and | 300 | + * Permission is hereby granted, free of charge, to any person obtaining |
| 322 | + * its documentation for any purpose is hereby granted without fee, provided | 301 | + * a copy of this software and associated documentation files (the |
| 323 | + * that the above copyright notice appear in all copies and that both that | 302 | + * "Software"), to deal in the Software without restriction, including |
| 324 | + * copyright notice and this permission notice appear in supporting | 303 | + * without limitation the rights to use, copy, modify, merge, publish, |
| 325 | + * documentation, and that the name of the copyright holders not be used in | 304 | + * distribute, sublicense, and/or sell copies of the Software, and to |
| 326 | + * advertising or publicity pertaining to distribution of the software | 305 | + * permit persons to whom the Software is furnished to do so, subject to |
| 327 | + * without specific, written prior permission. The copyright holders make | 306 | + * the following conditions: |
| 328 | + * no representations about the suitability of this software for any | ||
| 329 | + * purpose. It is provided "as is" without express or implied warranty. | ||
| 330 | + * | 307 | + * |
| 331 | + * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS | 308 | + * The above copyright notice and this permission notice (including the |
| 332 | + * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND | 309 | + * next paragraph) shall be included in all copies or substantial |
| 333 | + * FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY | 310 | + * portions of the Software. |
| 334 | + * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER | 311 | + * |
| 335 | + * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF | 312 | + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
| 336 | + * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN | 313 | + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
| 337 | + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | 314 | + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
| 315 | + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS | ||
| 316 | + * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN | ||
| 317 | + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN | ||
| 318 | + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
| 319 | + * SOFTWARE. | ||
| 338 | + */ | 320 | + */ |
| 339 | + | 321 | + |
| 340 | +#define _GNU_SOURCE | 322 | +#define _GNU_SOURCE |
| @@ -349,6 +331,7 @@ index 0000000..7ebbf98 | |||
| 349 | +#include "compositor.h" | 331 | +#include "compositor.h" |
| 350 | +#include "gal2d-renderer.h" | 332 | +#include "gal2d-renderer.h" |
| 351 | +#include "vertex-clipping.h" | 333 | +#include "vertex-clipping.h" |
| 334 | +#include "shared/helpers.h" | ||
| 352 | +#include "HAL/gc_hal.h" | 335 | +#include "HAL/gc_hal.h" |
| 353 | +#include "HAL/gc_hal_raster.h" | 336 | +#include "HAL/gc_hal_raster.h" |
| 354 | +#include "HAL/gc_hal_eglplatform.h" | 337 | +#include "HAL/gc_hal_eglplatform.h" |
| @@ -1653,31 +1636,34 @@ index 0000000..7ebbf98 | |||
| 1653 | +}; | 1636 | +}; |
| 1654 | diff --git a/src/gal2d-renderer.h b/src/gal2d-renderer.h | 1637 | diff --git a/src/gal2d-renderer.h b/src/gal2d-renderer.h |
| 1655 | new file mode 100644 | 1638 | new file mode 100644 |
| 1656 | index 0000000..fefcfd1 | 1639 | index 0000000..279358d |
| 1657 | --- /dev/null | 1640 | --- /dev/null |
| 1658 | +++ b/src/gal2d-renderer.h | 1641 | +++ b/src/gal2d-renderer.h |
| 1659 | @@ -0,0 +1,47 @@ | 1642 | @@ -0,0 +1,50 @@ |
| 1660 | +/* | 1643 | +/* |
| 1661 | + * Copyright (c) 2015 Freescale Semiconductor, Inc. | 1644 | + * Copyright (c) 2015 Freescale Semiconductor, Inc. |
| 1662 | + * Copyright © 2013 Vasily Khoruzhick <anarsoul@gmail.com> | 1645 | + * Copyright © 2013 Vasily Khoruzhick <anarsoul@gmail.com> |
| 1663 | + * | 1646 | + * |
| 1664 | + * Permission to use, copy, modify, distribute, and sell this software and | 1647 | + * Permission is hereby granted, free of charge, to any person obtaining |
| 1665 | + * its documentation for any purpose is hereby granted without fee, provided | 1648 | + * a copy of this software and associated documentation files (the |
| 1666 | + * that the above copyright notice appear in all copies and that both that | 1649 | + * "Software"), to deal in the Software without restriction, including |
| 1667 | + * copyright notice and this permission notice appear in supporting | 1650 | + * without limitation the rights to use, copy, modify, merge, publish, |
| 1668 | + * documentation, and that the name of the copyright holders not be used in | 1651 | + * distribute, sublicense, and/or sell copies of the Software, and to |
| 1669 | + * advertising or publicity pertaining to distribution of the software | 1652 | + * permit persons to whom the Software is furnished to do so, subject to |
| 1670 | + * without specific, written prior permission. The copyright holders make | 1653 | + * the following conditions: |
| 1671 | + * no representations about the suitability of this software for any | 1654 | + * |
| 1672 | + * purpose. It is provided "as is" without express or implied warranty. | 1655 | + * The above copyright notice and this permission notice (including the |
| 1656 | + * next paragraph) shall be included in all copies or substantial | ||
| 1657 | + * portions of the Software. | ||
| 1673 | + * | 1658 | + * |
| 1674 | + * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS | 1659 | + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
| 1675 | + * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND | 1660 | + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
| 1676 | + * FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY | 1661 | + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
| 1677 | + * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER | 1662 | + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS |
| 1678 | + * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF | 1663 | + * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN |
| 1679 | + * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN | 1664 | + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
| 1680 | + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | 1665 | + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
| 1666 | + * SOFTWARE. | ||
| 1681 | + */ | 1667 | + */ |
| 1682 | +#ifndef __gal_2d_renderer_h_ | 1668 | +#ifndef __gal_2d_renderer_h_ |
| 1683 | +#define __gal_2d_renderer_h_ | 1669 | +#define __gal_2d_renderer_h_ |
| @@ -1705,5 +1691,5 @@ index 0000000..fefcfd1 | |||
| 1705 | + | 1691 | + |
| 1706 | +#endif | 1692 | +#endif |
| 1707 | -- | 1693 | -- |
| 1708 | 2.3.6 | 1694 | 2.5.1 |
| 1709 | 1695 | ||
diff --git a/recipes-graphics/wayland/weston/0006-MGS-1236-imx6qp-imx6dl-First-frame-distored-when-som.patch b/recipes-graphics/wayland/weston/0006-MGS-1236-imx6qp-imx6dl-First-frame-distored-when-som.patch new file mode 100644 index 000000000..bed6f0c84 --- /dev/null +++ b/recipes-graphics/wayland/weston/0006-MGS-1236-imx6qp-imx6dl-First-frame-distored-when-som.patch | |||
| @@ -0,0 +1,106 @@ | |||
| 1 | From 2bd1096ac342e251980c639543c0fad2f7173e82 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Prabhu Sundararaj <prabhu.sundararaj@freescale.com> | ||
| 3 | Date: Wed, 9 Dec 2015 18:20:35 -0600 | ||
| 4 | Subject: [PATCH] MGS-1236 : [imx6qp/imx6dl] First frame distored when some | ||
| 5 | wayland apps run continuously using g2d | ||
| 6 | |||
| 7 | gco2D_SetSource was missing when using the blit operations and | ||
| 8 | hence causing the issue. | ||
| 9 | |||
| 10 | If the weston started without weston.ini, animations will be disabled, | ||
| 11 | for xwayland the weston.ini need to be included and hence the error | ||
| 12 | was shown. | ||
| 13 | |||
| 14 | Also removing util functions reusing from libGAL.so | ||
| 15 | |||
| 16 | Date: Dec 10, 2015 | ||
| 17 | Signed-off-by: Prabhu Sundararaj <prabhu.sundararaj@freescale.com> | ||
| 18 | --- | ||
| 19 | src/gal2d-renderer.c | 57 ++++++---------------------------------------------- | ||
| 20 | 1 file changed, 6 insertions(+), 51 deletions(-) | ||
| 21 | |||
| 22 | diff --git a/src/gal2d-renderer.c b/src/gal2d-renderer.c | ||
| 23 | index 6e7d640..dbec2d0 100644 | ||
| 24 | --- a/src/gal2d-renderer.c | ||
| 25 | +++ b/src/gal2d-renderer.c | ||
| 26 | @@ -186,56 +186,6 @@ get_output_state(struct weston_output *output) | ||
| 27 | return (struct gal2d_output_state *)output->renderer_state; | ||
| 28 | } | ||
| 29 | |||
| 30 | -static gctUINT32 | ||
| 31 | -galGetStretchFactor(gctINT32 SrcSize, gctINT32 DestSize) | ||
| 32 | -{ | ||
| 33 | - gctUINT stretchFactor; | ||
| 34 | - if ( (SrcSize > 0) && (DestSize > 1) ) | ||
| 35 | - { | ||
| 36 | - stretchFactor = ((SrcSize - 1) << 16) / (DestSize - 1); | ||
| 37 | - } | ||
| 38 | - else | ||
| 39 | - { | ||
| 40 | - stretchFactor = 0; | ||
| 41 | - } | ||
| 42 | - return stretchFactor; | ||
| 43 | -} | ||
| 44 | - | ||
| 45 | -static gceSTATUS | ||
| 46 | -galGetStretchFactors( | ||
| 47 | - IN gcsRECT_PTR SrcRect, | ||
| 48 | - IN gcsRECT_PTR DestRect, | ||
| 49 | - OUT gctUINT32 * HorFactor, | ||
| 50 | - OUT gctUINT32 * VerFactor | ||
| 51 | - ) | ||
| 52 | -{ | ||
| 53 | - if (HorFactor != gcvNULL) | ||
| 54 | - { | ||
| 55 | - gctINT32 src, dest; | ||
| 56 | - | ||
| 57 | - /* Compute width of rectangles. */ | ||
| 58 | - gcmVERIFY_OK(gcsRECT_Width(SrcRect, &src)); | ||
| 59 | - gcmVERIFY_OK(gcsRECT_Width(DestRect, &dest)); | ||
| 60 | - | ||
| 61 | - /* Compute and return horizontal stretch factor. */ | ||
| 62 | - *HorFactor = galGetStretchFactor(src, dest); | ||
| 63 | - } | ||
| 64 | - | ||
| 65 | - if (VerFactor != gcvNULL) | ||
| 66 | - { | ||
| 67 | - gctINT32 src, dest; | ||
| 68 | - | ||
| 69 | - /* Compute height of rectangles. */ | ||
| 70 | - gcmVERIFY_OK(gcsRECT_Height(SrcRect, &src)); | ||
| 71 | - gcmVERIFY_OK(gcsRECT_Height(DestRect, &dest)); | ||
| 72 | - | ||
| 73 | - /* Compute and return vertical stretch factor. */ | ||
| 74 | - *VerFactor = galGetStretchFactor(src, dest); | ||
| 75 | - } | ||
| 76 | - /* Success. */ | ||
| 77 | - return gcvSTATUS_OK; | ||
| 78 | -} | ||
| 79 | - | ||
| 80 | static gceSTATUS | ||
| 81 | gal2d_getSurfaceFormat(halDISPLAY_INFO info, gceSURF_FORMAT * Format) | ||
| 82 | { | ||
| 83 | @@ -725,6 +675,7 @@ repaint_region(struct weston_view *ev, struct weston_output *output, struct gal2 | ||
| 84 | srcStride, 1, | ||
| 85 | tiling, srcFormat, gcvSURF_0_DEGREE, | ||
| 86 | srcWidth, srcHeight); | ||
| 87 | + gcmVERIFY_OK(gco2D_SetSource(gr->gcoEngine2d, &srcRect)); | ||
| 88 | /* Setup mirror. */ | ||
| 89 | gcmONERROR(gco2D_SetBitBlitMirror(gr->gcoEngine2d, gcvFALSE, gcvFALSE)); | ||
| 90 | gcmONERROR(gco2D_SetROP(gr->gcoEngine2d, 0xCC, 0xCC)); | ||
| 91 | @@ -830,7 +781,11 @@ repaint_region(struct weston_view *ev, struct weston_output *output, struct gal2 | ||
| 92 | } | ||
| 93 | else | ||
| 94 | { | ||
| 95 | - gcmVERIFY_OK(galGetStretchFactors(&srcRect, &dstrect, &horFactor, &verFactor)); | ||
| 96 | + gcmVERIFY_OK(gco2D_CalcStretchFactor(gr->gcoEngine2d, srcRect.right - srcRect.left, | ||
| 97 | + dstrect.right - dstrect.left, &horFactor)); | ||
| 98 | + | ||
| 99 | + gcmONERROR(gco2D_CalcStretchFactor(gr->gcoEngine2d, srcRect.bottom - srcRect.top, | ||
| 100 | + dstrect.bottom - dstrect.top, &verFactor)); | ||
| 101 | |||
| 102 | if(verFactor == 65536 && horFactor == 65536) | ||
| 103 | { | ||
| 104 | -- | ||
| 105 | 2.6.2 | ||
| 106 | |||
diff --git a/recipes-graphics/wayland/weston/0007-MGS-1236-1-imx6qp-imx6dl-First-frame-distored-when-s.patch b/recipes-graphics/wayland/weston/0007-MGS-1236-1-imx6qp-imx6dl-First-frame-distored-when-s.patch new file mode 100644 index 000000000..1c094c4dc --- /dev/null +++ b/recipes-graphics/wayland/weston/0007-MGS-1236-1-imx6qp-imx6dl-First-frame-distored-when-s.patch | |||
| @@ -0,0 +1,51 @@ | |||
| 1 | From b33d44b736b7b7ae4db31dc32ff9441c753219fb Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Prabhu Sundararaj <prabhu.sundararaj@freescale.com> | ||
| 3 | Date: Mon, 28 Dec 2015 22:15:05 -0600 | ||
| 4 | Subject: [PATCH] MGS-1236-1 : [imx6qp/imx6dl] First frame distored when some | ||
| 5 | wayland apps run continuously using g2d | ||
| 6 | |||
| 7 | Remove residual galGetStretchFactors functions. the function is not needed | ||
| 8 | any more | ||
| 9 | |||
| 10 | Date: Dec 28, 2015 | ||
| 11 | Signed-off-by: Prabhu Sundararaj <prabhu.sundararaj@freescale.com> | ||
| 12 | --- | ||
| 13 | src/gal2d-renderer.c | 14 +++++++++----- | ||
| 14 | 1 file changed, 9 insertions(+), 5 deletions(-) | ||
| 15 | |||
| 16 | diff --git a/src/gal2d-renderer.c b/src/gal2d-renderer.c | ||
| 17 | index dbec2d0..2ecc8ac 100644 | ||
| 18 | --- a/src/gal2d-renderer.c | ||
| 19 | +++ b/src/gal2d-renderer.c | ||
| 20 | @@ -781,11 +781,11 @@ repaint_region(struct weston_view *ev, struct weston_output *output, struct gal2 | ||
| 21 | } | ||
| 22 | else | ||
| 23 | { | ||
| 24 | - gcmVERIFY_OK(gco2D_CalcStretchFactor(gr->gcoEngine2d, srcRect.right - srcRect.left, | ||
| 25 | - dstrect.right - dstrect.left, &horFactor)); | ||
| 26 | + gcmVERIFY_OK(gco2D_CalcStretchFactor(gr->gcoEngine2d, srcRect.right - srcRect.left, | ||
| 27 | + dstrect.right - dstrect.left, &horFactor)); | ||
| 28 | |||
| 29 | - gcmONERROR(gco2D_CalcStretchFactor(gr->gcoEngine2d, srcRect.bottom - srcRect.top, | ||
| 30 | - dstrect.bottom - dstrect.top, &verFactor)); | ||
| 31 | + gcmONERROR(gco2D_CalcStretchFactor(gr->gcoEngine2d, srcRect.bottom - srcRect.top, | ||
| 32 | + dstrect.bottom - dstrect.top, &verFactor)); | ||
| 33 | |||
| 34 | if(verFactor == 65536 && horFactor == 65536) | ||
| 35 | { | ||
| 36 | @@ -799,7 +799,11 @@ repaint_region(struct weston_view *ev, struct weston_output *output, struct gal2 | ||
| 37 | srcRect.right = srcRect.right < dstWidth ? srcRect.right : dstWidth; | ||
| 38 | srcRect.bottom = srcRect.bottom < dstHeight ? srcRect.bottom : dstHeight; | ||
| 39 | |||
| 40 | - gcmVERIFY_OK(galGetStretchFactors(&srcRect, &dstrect, &horFactor, &verFactor)); | ||
| 41 | + gcmVERIFY_OK(gco2D_CalcStretchFactor(gr->gcoEngine2d, srcRect.right - srcRect.left, | ||
| 42 | + dstrect.right - dstrect.left, &horFactor)); | ||
| 43 | + | ||
| 44 | + gcmONERROR(gco2D_CalcStretchFactor(gr->gcoEngine2d, srcRect.bottom - srcRect.top, | ||
| 45 | + dstrect.bottom - dstrect.top, &verFactor)); | ||
| 46 | /* Program the stretch factors. */ | ||
| 47 | gcmVERIFY_OK(gco2D_SetStretchFactors(gr->gcoEngine2d, horFactor, verFactor)); | ||
| 48 | |||
| 49 | -- | ||
| 50 | 2.6.2 | ||
| 51 | |||
diff --git a/recipes-graphics/wayland/weston_%.bbappend b/recipes-graphics/wayland/weston_%.bbappend index 6c8ba6d06..fae428675 100644 --- a/recipes-graphics/wayland/weston_%.bbappend +++ b/recipes-graphics/wayland/weston_%.bbappend | |||
| @@ -1,10 +1,12 @@ | |||
| 1 | FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" | 1 | FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" |
| 2 | 2 | ||
| 3 | SRC_URI_append_mx6 = " \ | 3 | SRC_URI_append_mx6 = " \ |
| 4 | file://0001-MGS-840-Add-i.MX6-support-for-weston.patch \ | 4 | file://0002-MGS-1111-Add-GPU-VIV-suport-for-wayland-and-weston-1.patch \ |
| 5 | file://0004-MGS-1235-Fix-setenv-and-clear-environments.patch \ | 5 | file://0004-MGS-1235-Fix-setenv-and-clear-environments.patch \ |
| 6 | file://0005-MGS-1252-Fix-for-Qt5_CinematicExperience-will-meet-s.patch" | 6 | file://0005-MGS-1252-Fix-for-Qt5_CinematicExperience-will-meet-s.patch \ |
| 7 | 7 | file://0006-MGS-1236-imx6qp-imx6dl-First-frame-distored-when-som.patch \ | |
| 8 | file://0007-MGS-1236-1-imx6qp-imx6dl-First-frame-distored-when-s.patch \ | ||
| 9 | " | ||
| 8 | PACKAGECONFIG_append_mx6q = " cairo-glesv2" | 10 | PACKAGECONFIG_append_mx6q = " cairo-glesv2" |
| 9 | PACKAGECONFIG_append_mx6dl = " cairo-glesv2" | 11 | PACKAGECONFIG_append_mx6dl = " cairo-glesv2" |
| 10 | PACKAGECONFIG_append_mx6sx = " cairo-glesv2" | 12 | PACKAGECONFIG_append_mx6sx = " cairo-glesv2" |
