diff options
| author | Lauren Post <lauren.post@freescale.com> | 2013-10-01 12:01:54 -0500 |
|---|---|---|
| committer | Otavio Salvador <otavio@ossystems.com.br> | 2013-11-18 13:45:36 -0200 |
| commit | bce654fbc44d931494eb8f2662ada6d57c57d9dc (patch) | |
| tree | 496d6a3f044d90aac5673a363dcf26c31310eae9 | |
| parent | c285cc44b1c0a51c3c29a1a0bf778e45b3a71ccd (diff) | |
| download | meta-fsl-arm-dora-next.tar.gz | |
wayland: Update weston 1.1.0 for i.MX waylanddora-next
Change-Id: Ief472ec91a57afb39e6e9a2d33898ca75fb13218
Signed-off-by: Lauren Post <lauren.post@freescale.com>
3 files changed, 619 insertions, 0 deletions
diff --git a/recipes-graphics/wayland/weston/0001-DRM-condition.patch b/recipes-graphics/wayland/weston/0001-DRM-condition.patch new file mode 100644 index 0000000..93eab54 --- /dev/null +++ b/recipes-graphics/wayland/weston/0001-DRM-condition.patch | |||
| @@ -0,0 +1,46 @@ | |||
| 1 | From e1bfeb25d4d2d2ef6002986cca615817848b27dd Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Prabhu Sundararaj <prabhu.sundararaj@freescale.com> | ||
| 3 | Date: Thu, 11 Apr 2013 23:27:31 -0500 | ||
| 4 | Subject: [PATCH] DRM condition | ||
| 5 | |||
| 6 | Signed-off-by: Prabhu Sundararaj <prabhu.sundararaj@freescale.com> | ||
| 7 | --- | ||
| 8 | src/launcher-util.c | 8 ++++++-- | ||
| 9 | 1 file changed, 6 insertions(+), 2 deletions(-) | ||
| 10 | |||
| 11 | diff --git a/src/launcher-util.c b/src/launcher-util.c | ||
| 12 | index 9196e4f..7168f60 100644 | ||
| 13 | --- a/src/launcher-util.c | ||
| 14 | +++ b/src/launcher-util.c | ||
| 15 | @@ -30,9 +30,9 @@ | ||
| 16 | #include <sys/stat.h> | ||
| 17 | #include <sys/uio.h> | ||
| 18 | #include <fcntl.h> | ||
| 19 | - | ||
| 20 | +#if defined(DRM) | ||
| 21 | #include <xf86drm.h> | ||
| 22 | - | ||
| 23 | +#endif | ||
| 24 | #include "compositor.h" | ||
| 25 | #include "launcher-util.h" | ||
| 26 | #include "weston-launch.h" | ||
| 27 | @@ -107,6 +107,7 @@ int | ||
| 28 | weston_launcher_drm_set_master(struct weston_compositor *compositor, | ||
| 29 | int drm_fd, char master) | ||
| 30 | { | ||
| 31 | +#if defined(DRM) | ||
| 32 | struct msghdr msg; | ||
| 33 | struct cmsghdr *cmsg; | ||
| 34 | struct iovec iov; | ||
| 35 | @@ -156,5 +157,8 @@ weston_launcher_drm_set_master(struct weston_compositor *compositor, | ||
| 36 | return -1; | ||
| 37 | |||
| 38 | return ret; | ||
| 39 | +#else | ||
| 40 | + return 0; | ||
| 41 | +#endif | ||
| 42 | } | ||
| 43 | |||
| 44 | -- | ||
| 45 | 1.8.1.4 | ||
| 46 | |||
diff --git a/recipes-graphics/wayland/weston/0002-Add-support-for-Vivante-3D-GPU.patch b/recipes-graphics/wayland/weston/0002-Add-support-for-Vivante-3D-GPU.patch new file mode 100644 index 0000000..d8d484b --- /dev/null +++ b/recipes-graphics/wayland/weston/0002-Add-support-for-Vivante-3D-GPU.patch | |||
| @@ -0,0 +1,526 @@ | |||
| 1 | From 807ca60da555a8fd638cb7c39825b21bb5ec855c Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Prabhu Sundararaj <b3876@freescale.com> | ||
| 3 | Date: Tue, 17 Sep 2013 16:46:25 -0500 | ||
| 4 | Subject: [PATCH 2/2] Add support for Vivante 3D GPU | ||
| 5 | |||
| 6 | Signed-off-by: Prabhu Sundararaj <b3876@freescale.com> | ||
| 7 | --- | ||
| 8 | src/compositor-fbdev.c | 376 +++++++++++++++++++++++++++++++------------------ | ||
| 9 | 1 file changed, 237 insertions(+), 139 deletions(-) | ||
| 10 | |||
| 11 | diff --git a/src/compositor-fbdev.c b/src/compositor-fbdev.c | ||
| 12 | index 9d9eff5..cb98532 100644 | ||
| 13 | --- a/src/compositor-fbdev.c | ||
| 14 | +++ b/src/compositor-fbdev.c | ||
| 15 | @@ -44,6 +44,8 @@ | ||
| 16 | #include "compositor.h" | ||
| 17 | #include "launcher-util.h" | ||
| 18 | #include "pixman-renderer.h" | ||
| 19 | +#include <EGL/egl.h> | ||
| 20 | +#include "gl-renderer.h" | ||
| 21 | #include "udev-seat.h" | ||
| 22 | |||
| 23 | struct fbdev_compositor { | ||
| 24 | @@ -52,6 +54,9 @@ struct fbdev_compositor { | ||
| 25 | |||
| 26 | struct udev *udev; | ||
| 27 | struct tty *tty; | ||
| 28 | + NativeDisplayType display; | ||
| 29 | + NativeWindowType window; | ||
| 30 | + int use_pixman; | ||
| 31 | }; | ||
| 32 | |||
| 33 | struct fbdev_screeninfo { | ||
| 34 | @@ -138,63 +143,71 @@ fbdev_output_repaint(struct weston_output *base, pixman_region32_t *damage) | ||
| 35 | { | ||
| 36 | struct fbdev_output *output = to_fbdev_output(base); | ||
| 37 | struct weston_compositor *ec = output->base.compositor; | ||
| 38 | - pixman_box32_t *rects; | ||
| 39 | - int nrects, i, src_x, src_y, x1, y1, x2, y2, width, height; | ||
| 40 | - | ||
| 41 | - /* Repaint the damaged region onto the back buffer. */ | ||
| 42 | - pixman_renderer_output_set_buffer(base, output->shadow_surface); | ||
| 43 | - ec->renderer->repaint_output(base, damage); | ||
| 44 | - | ||
| 45 | - /* Transform and composite onto the frame buffer. */ | ||
| 46 | - width = pixman_image_get_width(output->shadow_surface); | ||
| 47 | - height = pixman_image_get_height(output->shadow_surface); | ||
| 48 | - rects = pixman_region32_rectangles(damage, &nrects); | ||
| 49 | - | ||
| 50 | - for (i = 0; i < nrects; i++) { | ||
| 51 | - switch (base->transform) { | ||
| 52 | - default: | ||
| 53 | - case WL_OUTPUT_TRANSFORM_NORMAL: | ||
| 54 | - x1 = rects[i].x1; | ||
| 55 | - x2 = rects[i].x2; | ||
| 56 | - y1 = rects[i].y1; | ||
| 57 | - y2 = rects[i].y2; | ||
| 58 | - break; | ||
| 59 | - case WL_OUTPUT_TRANSFORM_180: | ||
| 60 | - x1 = width - rects[i].x2; | ||
| 61 | - x2 = width - rects[i].x1; | ||
| 62 | - y1 = height - rects[i].y2; | ||
| 63 | - y2 = height - rects[i].y1; | ||
| 64 | - break; | ||
| 65 | - case WL_OUTPUT_TRANSFORM_90: | ||
| 66 | - x1 = height - rects[i].y2; | ||
| 67 | - x2 = height - rects[i].y1; | ||
| 68 | - y1 = rects[i].x1; | ||
| 69 | - y2 = rects[i].x2; | ||
| 70 | - break; | ||
| 71 | - case WL_OUTPUT_TRANSFORM_270: | ||
| 72 | - x1 = rects[i].y1; | ||
| 73 | - x2 = rects[i].y2; | ||
| 74 | - y1 = width - rects[i].x2; | ||
| 75 | - y2 = width - rects[i].x1; | ||
| 76 | - break; | ||
| 77 | + struct fbdev_compositor *compositor = to_fbdev_compositor(ec); | ||
| 78 | + | ||
| 79 | + if (compositor->use_pixman) | ||
| 80 | + { | ||
| 81 | + pixman_box32_t *rects; | ||
| 82 | + int nrects, i, src_x, src_y, x1, y1, x2, y2, width, height; | ||
| 83 | + /* Repaint the damaged region onto the back buffer. */ | ||
| 84 | + pixman_renderer_output_set_buffer(base, output->shadow_surface); | ||
| 85 | + ec->renderer->repaint_output(base, damage); | ||
| 86 | + | ||
| 87 | + /* Transform and composite onto the frame buffer. */ | ||
| 88 | + width = pixman_image_get_width(output->shadow_surface); | ||
| 89 | + height = pixman_image_get_height(output->shadow_surface); | ||
| 90 | + rects = pixman_region32_rectangles(damage, &nrects); | ||
| 91 | + | ||
| 92 | + for (i = 0; i < nrects; i++) { | ||
| 93 | + switch (base->transform) { | ||
| 94 | + default: | ||
| 95 | + case WL_OUTPUT_TRANSFORM_NORMAL: | ||
| 96 | + x1 = rects[i].x1; | ||
| 97 | + x2 = rects[i].x2; | ||
| 98 | + y1 = rects[i].y1; | ||
| 99 | + y2 = rects[i].y2; | ||
| 100 | + break; | ||
| 101 | + case WL_OUTPUT_TRANSFORM_180: | ||
| 102 | + x1 = width - rects[i].x2; | ||
| 103 | + x2 = width - rects[i].x1; | ||
| 104 | + y1 = height - rects[i].y2; | ||
| 105 | + y2 = height - rects[i].y1; | ||
| 106 | + break; | ||
| 107 | + case WL_OUTPUT_TRANSFORM_90: | ||
| 108 | + x1 = height - rects[i].y2; | ||
| 109 | + x2 = height - rects[i].y1; | ||
| 110 | + y1 = rects[i].x1; | ||
| 111 | + y2 = rects[i].x2; | ||
| 112 | + break; | ||
| 113 | + case WL_OUTPUT_TRANSFORM_270: | ||
| 114 | + x1 = rects[i].y1; | ||
| 115 | + x2 = rects[i].y2; | ||
| 116 | + y1 = width - rects[i].x2; | ||
| 117 | + y2 = width - rects[i].x1; | ||
| 118 | + break; | ||
| 119 | + } | ||
| 120 | + src_x = x1; | ||
| 121 | + src_y = y1; | ||
| 122 | + | ||
| 123 | + pixman_image_composite32(PIXMAN_OP_SRC, | ||
| 124 | + output->shadow_surface, /* src */ | ||
| 125 | + NULL /* mask */, | ||
| 126 | + output->hw_surface, /* dest */ | ||
| 127 | + src_x, src_y, /* src_x, src_y */ | ||
| 128 | + 0, 0, /* mask_x, mask_y */ | ||
| 129 | + x1, y1, /* dest_x, dest_y */ | ||
| 130 | + x2 - x1, /* width */ | ||
| 131 | + y2 - y1 /* height */); | ||
| 132 | + /* Update the damage region. */ | ||
| 133 | + pixman_region32_subtract(&ec->primary_plane.damage, | ||
| 134 | + &ec->primary_plane.damage, damage); | ||
| 135 | } | ||
| 136 | - src_x = x1; | ||
| 137 | - src_y = y1; | ||
| 138 | - | ||
| 139 | - pixman_image_composite32(PIXMAN_OP_SRC, | ||
| 140 | - output->shadow_surface, /* src */ | ||
| 141 | - NULL /* mask */, | ||
| 142 | - output->hw_surface, /* dest */ | ||
| 143 | - src_x, src_y, /* src_x, src_y */ | ||
| 144 | - 0, 0, /* mask_x, mask_y */ | ||
| 145 | - x1, y1, /* dest_x, dest_y */ | ||
| 146 | - x2 - x1, /* width */ | ||
| 147 | - y2 - y1 /* height */); | ||
| 148 | } | ||
| 149 | - | ||
| 150 | - /* Update the damage region. */ | ||
| 151 | - pixman_region32_subtract(&ec->primary_plane.damage, | ||
| 152 | - &ec->primary_plane.damage, damage); | ||
| 153 | + else | ||
| 154 | + { | ||
| 155 | + ec->renderer->repaint_output(base, damage); | ||
| 156 | + } | ||
| 157 | + | ||
| 158 | |||
| 159 | /* Schedule the end of the frame. We do not sync this to the frame | ||
| 160 | * buffer clock because users who want that should be using the DRM | ||
| 161 | @@ -203,8 +216,9 @@ fbdev_output_repaint(struct weston_output *base, pixman_region32_t *damage) | ||
| 162 | * | ||
| 163 | * Finish the frame synchronised to the specified refresh rate. The | ||
| 164 | * refresh rate is given in mHz and the interval in ms. */ | ||
| 165 | - wl_event_source_timer_update(output->finish_frame_timer, | ||
| 166 | - 1000000 / output->mode.refresh); | ||
| 167 | + /*wl_event_source_timer_update(output->finish_frame_timer, | ||
| 168 | + 1000000 / output->mode.refresh);*/ | ||
| 169 | + wl_event_source_timer_update(output->finish_frame_timer, 1); | ||
| 170 | } | ||
| 171 | |||
| 172 | static int | ||
| 173 | @@ -313,6 +327,38 @@ calculate_refresh_rate(struct fb_var_screeninfo *vinfo) | ||
| 174 | } | ||
| 175 | |||
| 176 | static int | ||
| 177 | +fbdev_init_egl(struct fbdev_compositor *compositor, | ||
| 178 | + struct fbdev_output *output) | ||
| 179 | +{ | ||
| 180 | + | ||
| 181 | + static const EGLint config_attrs[] = { | ||
| 182 | + EGL_SAMPLES, 0, | ||
| 183 | + EGL_RED_SIZE, 8, | ||
| 184 | + EGL_GREEN_SIZE, 8, | ||
| 185 | + EGL_BLUE_SIZE, 8, | ||
| 186 | + EGL_ALPHA_SIZE, EGL_DONT_CARE, | ||
| 187 | + EGL_DEPTH_SIZE, 0, | ||
| 188 | + EGL_SURFACE_TYPE, EGL_WINDOW_BIT, | ||
| 189 | + EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT, | ||
| 190 | + EGL_NONE, | ||
| 191 | + }; | ||
| 192 | + | ||
| 193 | + | ||
| 194 | + EGLint visual_id = 0; | ||
| 195 | + if (gl_renderer_create(&compositor->base, | ||
| 196 | + compositor->display, config_attrs, | ||
| 197 | + &visual_id) < 0) | ||
| 198 | + return -1; | ||
| 199 | + | ||
| 200 | + if (gl_renderer_output_create(&output->base, | ||
| 201 | + compositor->window) < 0) { | ||
| 202 | + compositor->base.renderer->destroy(&compositor->base); | ||
| 203 | + return -1; | ||
| 204 | + } | ||
| 205 | + return 0; | ||
| 206 | +} | ||
| 207 | + | ||
| 208 | +static int | ||
| 209 | fbdev_query_screen_info(struct fbdev_output *output, int fd, | ||
| 210 | struct fbdev_screeninfo *info) | ||
| 211 | { | ||
| 212 | @@ -468,11 +514,14 @@ fbdev_frame_buffer_destroy(struct fbdev_output *output) | ||
| 213 | { | ||
| 214 | weston_log("Destroying fbdev frame buffer.\n"); | ||
| 215 | |||
| 216 | - if (munmap(output->fb, output->fb_info.buffer_length) < 0) | ||
| 217 | - weston_log("Failed to munmap frame buffer: %s\n", | ||
| 218 | - strerror(errno)); | ||
| 219 | + if(output->compositor->use_pixman) | ||
| 220 | + { | ||
| 221 | + if (munmap(output->fb, output->fb_info.buffer_length) < 0) | ||
| 222 | + weston_log("Failed to munmap frame buffer: %s\n", | ||
| 223 | + strerror(errno)); | ||
| 224 | |||
| 225 | - output->fb = NULL; | ||
| 226 | + output->fb = NULL; | ||
| 227 | + } | ||
| 228 | } | ||
| 229 | |||
| 230 | static void fbdev_output_destroy(struct weston_output *base); | ||
| 231 | @@ -506,9 +555,25 @@ fbdev_output_create(struct fbdev_compositor *compositor, | ||
| 232 | goto out_free; | ||
| 233 | } | ||
| 234 | |||
| 235 | + if(compositor->use_pixman) | ||
| 236 | + { | ||
| 237 | if (fbdev_frame_buffer_map(output, fb_fd) < 0) { | ||
| 238 | weston_log("Mapping frame buffer failed.\n"); | ||
| 239 | goto out_free; | ||
| 240 | + } | ||
| 241 | + } | ||
| 242 | + else | ||
| 243 | + { | ||
| 244 | + compositor->display = fbGetDisplay(compositor->base.wl_display); | ||
| 245 | + if (compositor->display == NULL) { | ||
| 246 | + fprintf(stderr, "failed to get display\n"); | ||
| 247 | + return 0; | ||
| 248 | + } | ||
| 249 | + compositor->window = fbCreateWindow(compositor->display, -1, -1, 0, 0); | ||
| 250 | + if (compositor->window == NULL) { | ||
| 251 | + fprintf(stderr, "failed to create window\n"); | ||
| 252 | + return 0; | ||
| 253 | + } | ||
| 254 | } | ||
| 255 | |||
| 256 | output->base.start_repaint_loop = fbdev_output_start_repaint_loop; | ||
| 257 | @@ -539,71 +604,73 @@ fbdev_output_create(struct fbdev_compositor *compositor, | ||
| 258 | output->fb_info.height_mm, | ||
| 259 | WL_OUTPUT_TRANSFORM_NORMAL); | ||
| 260 | |||
| 261 | - width = output->fb_info.x_resolution; | ||
| 262 | - height = output->fb_info.y_resolution; | ||
| 263 | - | ||
| 264 | - pixman_transform_init_identity(&transform); | ||
| 265 | - switch (output->base.transform) { | ||
| 266 | - default: | ||
| 267 | - case WL_OUTPUT_TRANSFORM_NORMAL: | ||
| 268 | - shadow_width = width; | ||
| 269 | - shadow_height = height; | ||
| 270 | - pixman_transform_rotate(&transform, | ||
| 271 | - NULL, 0, 0); | ||
| 272 | - pixman_transform_translate(&transform, NULL, | ||
| 273 | - 0, 0); | ||
| 274 | - break; | ||
| 275 | - case WL_OUTPUT_TRANSFORM_180: | ||
| 276 | - shadow_width = width; | ||
| 277 | - shadow_height = height; | ||
| 278 | - pixman_transform_rotate(&transform, | ||
| 279 | - NULL, -pixman_fixed_1, 0); | ||
| 280 | - pixman_transform_translate(NULL, &transform, | ||
| 281 | - pixman_int_to_fixed(shadow_width), | ||
| 282 | - pixman_int_to_fixed(shadow_height)); | ||
| 283 | - break; | ||
| 284 | - case WL_OUTPUT_TRANSFORM_270: | ||
| 285 | - shadow_width = height; | ||
| 286 | - shadow_height = width; | ||
| 287 | - pixman_transform_rotate(&transform, | ||
| 288 | - NULL, 0, pixman_fixed_1); | ||
| 289 | - pixman_transform_translate(&transform, | ||
| 290 | - NULL, | ||
| 291 | - pixman_int_to_fixed(shadow_width), | ||
| 292 | - 0); | ||
| 293 | - break; | ||
| 294 | - case WL_OUTPUT_TRANSFORM_90: | ||
| 295 | - shadow_width = height; | ||
| 296 | - shadow_height = width; | ||
| 297 | - pixman_transform_rotate(&transform, | ||
| 298 | - NULL, 0, -pixman_fixed_1); | ||
| 299 | - pixman_transform_translate(&transform, | ||
| 300 | - NULL, | ||
| 301 | - 0, | ||
| 302 | - pixman_int_to_fixed(shadow_height)); | ||
| 303 | - break; | ||
| 304 | - } | ||
| 305 | - | ||
| 306 | - bytes_per_pixel = output->fb_info.bits_per_pixel / 8; | ||
| 307 | + if(compositor->use_pixman) | ||
| 308 | + { | ||
| 309 | + width = output->fb_info.x_resolution; | ||
| 310 | + height = output->fb_info.y_resolution; | ||
| 311 | |||
| 312 | - output->shadow_buf = malloc(width * height * bytes_per_pixel); | ||
| 313 | - output->shadow_surface = | ||
| 314 | - pixman_image_create_bits(output->fb_info.pixel_format, | ||
| 315 | - shadow_width, shadow_height, | ||
| 316 | - output->shadow_buf, | ||
| 317 | - shadow_width * bytes_per_pixel); | ||
| 318 | - if (output->shadow_buf == NULL || output->shadow_surface == NULL) { | ||
| 319 | - weston_log("Failed to create surface for frame buffer.\n"); | ||
| 320 | - goto out_hw_surface; | ||
| 321 | - } | ||
| 322 | + pixman_transform_init_identity(&transform); | ||
| 323 | + switch (output->base.transform) { | ||
| 324 | + default: | ||
| 325 | + case WL_OUTPUT_TRANSFORM_NORMAL: | ||
| 326 | + shadow_width = width; | ||
| 327 | + shadow_height = height; | ||
| 328 | + pixman_transform_rotate(&transform, | ||
| 329 | + NULL, 0, 0); | ||
| 330 | + pixman_transform_translate(&transform, NULL, | ||
| 331 | + 0, 0); | ||
| 332 | + break; | ||
| 333 | + case WL_OUTPUT_TRANSFORM_180: | ||
| 334 | + shadow_width = width; | ||
| 335 | + shadow_height = height; | ||
| 336 | + pixman_transform_rotate(&transform, | ||
| 337 | + NULL, -pixman_fixed_1, 0); | ||
| 338 | + pixman_transform_translate(NULL, &transform, | ||
| 339 | + pixman_int_to_fixed(shadow_width), | ||
| 340 | + pixman_int_to_fixed(shadow_height)); | ||
| 341 | + break; | ||
| 342 | + case WL_OUTPUT_TRANSFORM_270: | ||
| 343 | + shadow_width = height; | ||
| 344 | + shadow_height = width; | ||
| 345 | + pixman_transform_rotate(&transform, | ||
| 346 | + NULL, 0, pixman_fixed_1); | ||
| 347 | + pixman_transform_translate(&transform, | ||
| 348 | + NULL, | ||
| 349 | + pixman_int_to_fixed(shadow_width), | ||
| 350 | + 0); | ||
| 351 | + break; | ||
| 352 | + case WL_OUTPUT_TRANSFORM_90: | ||
| 353 | + shadow_width = height; | ||
| 354 | + shadow_height = width; | ||
| 355 | + pixman_transform_rotate(&transform, | ||
| 356 | + NULL, 0, -pixman_fixed_1); | ||
| 357 | + pixman_transform_translate(&transform, | ||
| 358 | + NULL, | ||
| 359 | + 0, | ||
| 360 | + pixman_int_to_fixed(shadow_height)); | ||
| 361 | + break; | ||
| 362 | + } | ||
| 363 | |||
| 364 | - /* No need in transform for normal output */ | ||
| 365 | - if (output->base.transform != WL_OUTPUT_TRANSFORM_NORMAL) | ||
| 366 | - pixman_image_set_transform(output->shadow_surface, &transform); | ||
| 367 | + bytes_per_pixel = output->fb_info.bits_per_pixel / 8; | ||
| 368 | + | ||
| 369 | + output->shadow_buf = malloc(width * height * bytes_per_pixel); | ||
| 370 | + output->shadow_surface = | ||
| 371 | + pixman_image_create_bits(output->fb_info.pixel_format, | ||
| 372 | + shadow_width, shadow_height, | ||
| 373 | + output->shadow_buf, | ||
| 374 | + shadow_width * bytes_per_pixel); | ||
| 375 | + if (output->shadow_buf == NULL || output->shadow_surface == NULL) { | ||
| 376 | + weston_log("Failed to create surface for frame buffer.\n"); | ||
| 377 | + goto out_hw_surface; | ||
| 378 | + } | ||
| 379 | |||
| 380 | - if (pixman_renderer_output_create(&output->base) < 0) | ||
| 381 | - goto out_shadow_surface; | ||
| 382 | + /* No need in transform for normal output */ | ||
| 383 | + if (output->base.transform != WL_OUTPUT_TRANSFORM_NORMAL) | ||
| 384 | + pixman_image_set_transform(output->shadow_surface, &transform); | ||
| 385 | |||
| 386 | + if (pixman_renderer_output_create(&output->base) < 0) | ||
| 387 | + goto out_shadow_surface; | ||
| 388 | + } | ||
| 389 | loop = wl_display_get_event_loop(compositor->base.wl_display); | ||
| 390 | output->finish_frame_timer = | ||
| 391 | wl_event_loop_add_timer(loop, finish_frame_handler, output); | ||
| 392 | @@ -615,15 +682,25 @@ fbdev_output_create(struct fbdev_compositor *compositor, | ||
| 393 | weston_log_continue(STAMP_SPACE "guessing %d Hz and 96 dpi\n", | ||
| 394 | output->mode.refresh / 1000); | ||
| 395 | |||
| 396 | + printf("compositor->use_pixman=%d\n",compositor->use_pixman); | ||
| 397 | + if(!compositor->use_pixman) | ||
| 398 | + { | ||
| 399 | + if (fbdev_init_egl(compositor, output) < 0) | ||
| 400 | + goto out_hw_surface; | ||
| 401 | + } | ||
| 402 | return 0; | ||
| 403 | |||
| 404 | out_shadow_surface: | ||
| 405 | pixman_image_unref(output->shadow_surface); | ||
| 406 | output->shadow_surface = NULL; | ||
| 407 | out_hw_surface: | ||
| 408 | - free(output->shadow_buf); | ||
| 409 | - pixman_image_unref(output->hw_surface); | ||
| 410 | - output->hw_surface = NULL; | ||
| 411 | + | ||
| 412 | + if(compositor->use_pixman) | ||
| 413 | + { | ||
| 414 | + free(output->shadow_buf); | ||
| 415 | + pixman_image_unref(output->hw_surface); | ||
| 416 | + output->hw_surface = NULL; | ||
| 417 | + } | ||
| 418 | weston_output_destroy(&output->base); | ||
| 419 | fbdev_frame_buffer_destroy(output); | ||
| 420 | out_free: | ||
| 421 | @@ -636,24 +713,36 @@ static void | ||
| 422 | fbdev_output_destroy(struct weston_output *base) | ||
| 423 | { | ||
| 424 | struct fbdev_output *output = to_fbdev_output(base); | ||
| 425 | + struct fbdev_compositor *compositor = to_fbdev_compositor(output->base.compositor); | ||
| 426 | |||
| 427 | weston_log("Destroying fbdev output.\n"); | ||
| 428 | |||
| 429 | /* Close the frame buffer. */ | ||
| 430 | fbdev_output_disable(base); | ||
| 431 | + if(compositor->use_pixman) | ||
| 432 | + { | ||
| 433 | |||
| 434 | - if (base->renderer_state != NULL) | ||
| 435 | - pixman_renderer_output_destroy(base); | ||
| 436 | |||
| 437 | - if (output->shadow_surface != NULL) { | ||
| 438 | - pixman_image_unref(output->shadow_surface); | ||
| 439 | - output->shadow_surface = NULL; | ||
| 440 | - } | ||
| 441 | + if (base->renderer_state != NULL) | ||
| 442 | + pixman_renderer_output_destroy(base); | ||
| 443 | |||
| 444 | - if (output->shadow_buf != NULL) { | ||
| 445 | - free(output->shadow_buf); | ||
| 446 | - output->shadow_buf = NULL; | ||
| 447 | + if (output->shadow_surface != NULL) { | ||
| 448 | + pixman_image_unref(output->shadow_surface); | ||
| 449 | + output->shadow_surface = NULL; | ||
| 450 | + } | ||
| 451 | + | ||
| 452 | + if (output->shadow_buf != NULL) { | ||
| 453 | + free(output->shadow_buf); | ||
| 454 | + output->shadow_buf = NULL; | ||
| 455 | + } | ||
| 456 | } | ||
| 457 | + else | ||
| 458 | + { | ||
| 459 | + fbDestroyDisplay(compositor->display); | ||
| 460 | + fbDestroyWindow(compositor->window); | ||
| 461 | + | ||
| 462 | + gl_renderer_output_destroy(base); | ||
| 463 | + } | ||
| 464 | |||
| 465 | /* Remove the output. */ | ||
| 466 | wl_list_remove(&output->base.link); | ||
| 467 | @@ -834,7 +923,9 @@ switch_vt_binding(struct wl_seat *seat, uint32_t time, uint32_t key, void *data) | ||
| 468 | } | ||
| 469 | |||
| 470 | static struct weston_compositor * | ||
| 471 | -fbdev_compositor_create(struct wl_display *display, int *argc, char *argv[], | ||
| 472 | +fbdev_compositor_create(struct wl_display *display, | ||
| 473 | + int use_pixman, | ||
| 474 | + int argc, char *argv[], | ||
| 475 | const char *config_file, struct fbdev_parameters *param) | ||
| 476 | { | ||
| 477 | struct fbdev_compositor *compositor; | ||
| 478 | @@ -863,6 +954,10 @@ fbdev_compositor_create(struct wl_display *display, int *argc, char *argv[], | ||
| 479 | weston_log("Failed to initialize tty.\n"); | ||
| 480 | goto out_udev; | ||
| 481 | } | ||
| 482 | + weston_log("Using %s renderer\n", use_pixman ? "pixman" : "gl"); | ||
| 483 | + printf("use_pixman=%d \n", use_pixman); | ||
| 484 | + compositor->use_pixman = use_pixman; | ||
| 485 | + | ||
| 486 | |||
| 487 | compositor->base.destroy = fbdev_compositor_destroy; | ||
| 488 | compositor->base.restore = fbdev_restore; | ||
| 489 | @@ -875,9 +970,10 @@ fbdev_compositor_create(struct wl_display *display, int *argc, char *argv[], | ||
| 490 | MODIFIER_CTRL | MODIFIER_ALT, | ||
| 491 | switch_vt_binding, | ||
| 492 | compositor); | ||
| 493 | - | ||
| 494 | - if (pixman_renderer_init(&compositor->base) < 0) | ||
| 495 | - goto out_tty; | ||
| 496 | + if (compositor->use_pixman) { | ||
| 497 | + if (pixman_renderer_init(&compositor->base) < 0) | ||
| 498 | + goto out_tty; | ||
| 499 | + } | ||
| 500 | |||
| 501 | if (fbdev_output_create(compositor, param->device) < 0) | ||
| 502 | goto out_pixman; | ||
| 503 | @@ -908,6 +1004,7 @@ WL_EXPORT struct weston_compositor * | ||
| 504 | backend_init(struct wl_display *display, int *argc, char *argv[], | ||
| 505 | const char *config_file) | ||
| 506 | { | ||
| 507 | + int use_pixman = 0; | ||
| 508 | /* TODO: Ideally, available frame buffers should be enumerated using | ||
| 509 | * udev, rather than passing a device node in as a parameter. */ | ||
| 510 | struct fbdev_parameters param = { | ||
| 511 | @@ -918,10 +1015,11 @@ backend_init(struct wl_display *display, int *argc, char *argv[], | ||
| 512 | const struct weston_option fbdev_options[] = { | ||
| 513 | { WESTON_OPTION_INTEGER, "tty", 0, ¶m.tty }, | ||
| 514 | { WESTON_OPTION_STRING, "device", 0, ¶m.device }, | ||
| 515 | + { WESTON_OPTION_BOOLEAN, "use-pixman", 0, &use_pixman }, | ||
| 516 | }; | ||
| 517 | |||
| 518 | parse_options(fbdev_options, ARRAY_LENGTH(fbdev_options), argc, argv); | ||
| 519 | |||
| 520 | - return fbdev_compositor_create(display, argc, argv, config_file, | ||
| 521 | + return fbdev_compositor_create(display, use_pixman, argc, argv, config_file, | ||
| 522 | ¶m); | ||
| 523 | } | ||
| 524 | -- | ||
| 525 | 1.8.3.2 | ||
| 526 | |||
diff --git a/recipes-graphics/wayland/weston_1.1.0.bbappend b/recipes-graphics/wayland/weston_1.1.0.bbappend new file mode 100644 index 0000000..5b03b52 --- /dev/null +++ b/recipes-graphics/wayland/weston_1.1.0.bbappend | |||
| @@ -0,0 +1,47 @@ | |||
| 1 | FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" | ||
| 2 | |||
| 3 | SRC_URI += "file://0001-DRM-condition.patch \ | ||
| 4 | file://0002-Add-support-for-Vivante-3D-GPU.patch \ | ||
| 5 | file://weston.sh" | ||
| 6 | |||
| 7 | PACKAGECONFIG = "fbdev" | ||
| 8 | |||
| 9 | EXTRA_OECONF += "\ | ||
| 10 | --enable-simple-egl-clients \ | ||
| 11 | --disable-libunwind \ | ||
| 12 | --disable-xwayland-test \ | ||
| 13 | WESTON_NATIVE_BACKEND=fbdev-backend.so" | ||
| 14 | |||
| 15 | export COMPOSITOR_LIBS="-lGLESv2 -lEGL -lGAL -lwayland-server -lxkbcommon -lpixman-1" | ||
| 16 | export COMPOSITOR_CFLAGS="-I ${STAGING_DIR_HOST}/usr/include/pixman-1 -DLINUX=1 -DEGL_API_FB -DEGL_API_WL" | ||
| 17 | export FB_COMPOSITOR_CFLAGS="-DLINUX=1 -DEGL_API_FB -DEGL_API_WL -I $WLD/include" | ||
| 18 | export FB_COMPOSITOR_LIBS="-lGLESv2 -lEGL -lwayland-server -lxkbcommon" | ||
| 19 | export SIMPLE_EGL_CLIENT_CFLAGS="-DLINUX -DEGL_API_FB -DEGL_API_WL" | ||
| 20 | |||
| 21 | do_install_append () { | ||
| 22 | install -d ${D}${sysconfdir}/profile.d/ | ||
| 23 | install -m 0755 ${WORKDIR}/weston.sh ${D}${sysconfdir}/profile.d/ | ||
| 24 | } | ||
| 25 | |||
| 26 | python __anonymous () { | ||
| 27 | if d.getVar('SOC_FAMILY', True) == 'mx6': | ||
| 28 | extra_oeconf = d.getVar('EXTRA_OECONF', True).split() | ||
| 29 | take_out = ['--disable-simple-egl-clients'] | ||
| 30 | new_extra_oeconf = [] | ||
| 31 | for i in extra_oeconf: | ||
| 32 | if i not in take_out: | ||
| 33 | new_extra_oeconf.append(i) | ||
| 34 | d.setVar('EXTRA_OECONF', ' '.join(new_extra_oeconf)) | ||
| 35 | |||
| 36 | depends = d.getVar('DEPENDS', True).split() | ||
| 37 | take_out = ['mesa'] | ||
| 38 | new_depends = [] | ||
| 39 | for i in depends: | ||
| 40 | if i not in take_out: | ||
| 41 | new_depends.append(i) | ||
| 42 | d.setVar('DEPENDS', ' '.join(new_depends)) | ||
| 43 | } | ||
| 44 | |||
| 45 | FILES_${PN} += "${sysconfdir}/profile.d/weston.sh" | ||
| 46 | |||
| 47 | PACKAGE_ARCH_mx6 = "${MACHINE_ARCH}" | ||
