aboutsummaryrefslogtreecommitdiffstats
path: root/recipes-graphics/wayland/weston/0007-MGS-391-Weston-Performance-Optimisation-for-single-b.patch
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-graphics/wayland/weston/0007-MGS-391-Weston-Performance-Optimisation-for-single-b.patch')
-rw-r--r--recipes-graphics/wayland/weston/0007-MGS-391-Weston-Performance-Optimisation-for-single-b.patch183
1 files changed, 183 insertions, 0 deletions
diff --git a/recipes-graphics/wayland/weston/0007-MGS-391-Weston-Performance-Optimisation-for-single-b.patch b/recipes-graphics/wayland/weston/0007-MGS-391-Weston-Performance-Optimisation-for-single-b.patch
new file mode 100644
index 0000000..295d4e8
--- /dev/null
+++ b/recipes-graphics/wayland/weston/0007-MGS-391-Weston-Performance-Optimisation-for-single-b.patch
@@ -0,0 +1,183 @@
+From 399460e202d2b23ffda661499845bcc4d86dc86c Mon Sep 17 00:00:00 2001
+From: Prabhu Sundararaj <prabhu.sundararaj@freescale.com>
+Date: Wed, 31 Dec 2014 16:59:16 -0600
+Subject: [PATCH] MGS-391: Weston: Performance Optimisation for single buffer
+ mode
+Organization: O.S. Systems Software LTDA.
+
+Blit direct to the onscreen whenever compositing is needed which
+will help to improve bandwidth utilization
+
+Upstream-Status: Pending
+
+Signed-off-by: Prabhu Sundararaj <prabhu.sundararaj@freescale.com>
+---
+ src/gal2d-renderer.c | 114 ++++++++++++++++++++++++++++++++++++---------------
+ 1 file changed, 81 insertions(+), 33 deletions(-)
+
+diff --git a/src/gal2d-renderer.c b/src/gal2d-renderer.c
+index 4cccaf1..e07a2f9 100644
+--- a/src/gal2d-renderer.c
++++ b/src/gal2d-renderer.c
+@@ -55,6 +55,9 @@ struct gal2d_output_state {
+ gctSIGNAL signal;
+ gctSIGNAL busySignal;
+ gcsHAL_INTERFACE iface;
++ int directBlit;
++ gctINT width;
++ gctINT height;
+ };
+
+ struct gal2d_surface_state {
+@@ -515,34 +518,37 @@ update_surface(struct weston_output *output)
+ struct gal2d_output_state *go = get_output_state(output);
+ gceSTATUS status = gcvSTATUS_OK;
+
+- if(go->offscreenSurface && go->nNumBuffers == 1)
++ if(go->nNumBuffers == 1)
+ {
+- make_current(gr, go->renderSurf[go->activebuffer]);
+-
+- gctUINT srcWidth = 0;
+- gctUINT srcHeight = 0;
+- gctINT srcStride = 0;
+- gceSURF_FORMAT srcFormat;;
+- gcsRECT dstRect = {0};
+- gcoSURF srcSurface = go->offscreenSurface;
+- gctUINT32 physical;
+- gctPOINTER va =0;
+-
+- gcmONERROR(gcoSURF_GetAlignedSize(srcSurface, &srcWidth, &srcHeight, &srcStride));
+- gcmONERROR(gcoSURF_GetFormat(srcSurface, gcvNULL, &srcFormat));
+- gcmONERROR(gcoSURF_Lock(srcSurface, &physical, (gctPOINTER *)&va));
+- gcmONERROR(gco2D_SetColorSource(gr->gcoEngine2d, physical, srcStride, srcFormat,
+- gcvFALSE, srcWidth, gcvFALSE, gcvSURF_OPAQUE, 0));
+-
+- dstRect.left = 0;
+- dstRect.top = 0;
+- dstRect.right = srcWidth;
+- dstRect.bottom = srcHeight;
+-
+- gcmONERROR(gco2D_SetSource(gr->gcoEngine2d, &dstRect));
+- gcmONERROR(gco2D_SetClipping(gr->gcoEngine2d, &dstRect));
+- gcmONERROR(gco2D_Blit(gr->gcoEngine2d, 1, &dstRect, 0xCC, 0xCC, go->format));
+- gcmONERROR(gcoSURF_Unlock(srcSurface, (gctPOINTER *)&va));
++ if(!go->directBlit && go->offscreenSurface)
++ {
++ make_current(gr, go->renderSurf[go->activebuffer]);
++
++ gctUINT srcWidth = 0;
++ gctUINT srcHeight = 0;
++ gctINT srcStride = 0;
++ gceSURF_FORMAT srcFormat;;
++ gcsRECT dstRect = {0};
++ gcoSURF srcSurface = go->offscreenSurface;
++ gctUINT32 physical;
++ gctPOINTER va =0;
++
++ gcmONERROR(gcoSURF_GetAlignedSize(srcSurface, &srcWidth, &srcHeight, &srcStride));
++ gcmONERROR(gcoSURF_GetFormat(srcSurface, gcvNULL, &srcFormat));
++ gcmONERROR(gcoSURF_Lock(srcSurface, &physical, (gctPOINTER *)&va));
++ gcmONERROR(gco2D_SetColorSource(gr->gcoEngine2d, physical, srcStride, srcFormat,
++ gcvFALSE, srcWidth, gcvFALSE, gcvSURF_OPAQUE, 0));
++
++ dstRect.left = 0;
++ dstRect.top = 0;
++ dstRect.right = srcWidth;
++ dstRect.bottom = srcHeight;
++
++ gcmONERROR(gco2D_SetSource(gr->gcoEngine2d, &dstRect));
++ gcmONERROR(gco2D_SetClipping(gr->gcoEngine2d, &dstRect));
++ gcmONERROR(gco2D_Blit(gr->gcoEngine2d, 1, &dstRect, 0xCC, 0xCC, go->format));
++ gcmONERROR(gcoSURF_Unlock(srcSurface, (gctPOINTER *)&va));
++ }
+ gcmONERROR(gcoHAL_Commit(gr->gcoHal, gcvFALSE));
+ }
+ else if(go->nNumBuffers > 1)
+@@ -554,18 +560,61 @@ OnError:
+ galONERROR(status);
+ return status;
+ }
++
++static int
++is_view_visible(struct weston_view *view)
++{
++ /* Return false, if surface is guaranteed to be totally obscured. */
++ int ret;
++ pixman_region32_t unocc;
++
++ pixman_region32_init(&unocc);
++ pixman_region32_subtract(&unocc, &view->transform.boundingbox,
++ &view->clip);
++ ret = pixman_region32_not_empty(&unocc);
++ pixman_region32_fini(&unocc);
++
++ return ret;
++}
+
+ static int
+ use_output(struct weston_output *output)
+ {
++ struct weston_compositor *compositor = output->compositor;
++ struct weston_view *view;
+ struct gal2d_output_state *go = get_output_state(output);
+ struct gal2d_renderer *gr = get_renderer(output->compositor);
+ gceSTATUS status = gcvSTATUS_OK;
+
+ gcoSURF surface;
+- surface = go->nNumBuffers > 1 ?
+- go->renderSurf[go->activebuffer] :
+- go->offscreenSurface; /*go->renderSurf[0];*/
++ int visibleViews=0;
++ int fullscreenViews=0;
++
++ surface = go->renderSurf[go->activebuffer];
++ if(go->nNumBuffers == 1)
++ {
++ wl_list_for_each_reverse(view, &compositor->view_list, link)
++ if (view->plane == &compositor->primary_plane && is_view_visible(view))
++ {
++ visibleViews++;
++ if(view->surface->width == go->width && view->surface->height == go->height)
++ {
++ pixman_box32_t *bb_rects;
++ int nbb=0;
++ bb_rects = pixman_region32_rectangles(&view->transform.boundingbox, &nbb);
++ if(nbb == 1)
++ if(bb_rects[0].x1 == 0 && bb_rects[0].y1 ==0)
++ fullscreenViews++;
++ }
++ }
++
++ go->directBlit = ((visibleViews == 1) || (fullscreenViews > 1));
++
++ if(!go->directBlit)
++ {
++ surface = go->offscreenSurface;
++ }
++ }
+ make_current(gr, surface);
+ return status;
+ }
+@@ -1190,8 +1239,7 @@ gal2d_renderer_output_create(struct weston_output *output, NativeDisplayType dis
+ struct gal2d_renderer *gr = get_renderer(output->compositor);
+ struct gal2d_output_state *go = calloc(1, sizeof *go);
+ halDISPLAY_INFO info;
+- gctUINT32 backOffset = 0;
+- gctINT width, height;
++ gctUINT32 backOffset = 0;
+ gceSTATUS status = gcvSTATUS_OK;
+ gctUINT32 i;
+
+@@ -1216,7 +1264,7 @@ gal2d_renderer_output_create(struct weston_output *output, NativeDisplayType dis
+ go->activebuffer = 0;
+
+ go->renderSurf = malloc(sizeof(gcoSURF) * go->nNumBuffers);
+- gcoOS_GetDisplayVirtual(go->display, &width, &height);
++ gcoOS_GetDisplayVirtual(go->display, &go->width, &go->height);
+ gcoOS_SetSwapInterval(go->display, 1);
+
+ /*Needed only for multi Buffer */
+--
+2.1.4
+