Fix the stride setting error in the fbinfo.

Signed-off-by: Tom Hochstein <[email protected]>
---
 ...014-MGS-1987-Get-stride-from-the-FB-buffe.patch | 76 ++++++++++++++++++++++
 recipes-graphics/wayland/weston_%.bbappend         |  1 +
 2 files changed, 77 insertions(+)
 create mode 100644 
recipes-graphics/wayland/weston/0014-MGS-1987-Get-stride-from-the-FB-buffe.patch

diff --git 
a/recipes-graphics/wayland/weston/0014-MGS-1987-Get-stride-from-the-FB-buffe.patch
 
b/recipes-graphics/wayland/weston/0014-MGS-1987-Get-stride-from-the-FB-buffe.patch
new file mode 100644
index 0000000..a4658a7
--- /dev/null
+++ 
b/recipes-graphics/wayland/weston/0014-MGS-1987-Get-stride-from-the-FB-buffe.patch
@@ -0,0 +1,76 @@
+From 735e58c6066fe1148d803168c6241a4d8cb5c973 Mon Sep 17 00:00:00 2001
+From: "yong.gan" <[email protected]>
+Date: Wed, 6 Jul 2016 08:28:18 +0800
+Subject: [PATCH] MGS-1987: Get stride from the FB buffe.
+
+Fix the stride setting error in the fbinfo.
+
+Date: Jul 6, 2016
+Signed-off-by: Yong Gan <[email protected]>
+---
+ src/g2d-renderer.c | 14 +++++++-------
+ 1 file changed, 7 insertions(+), 7 deletions(-)
+
+diff --git a/src/g2d-renderer.c b/src/g2d-renderer.c
+index 0c26e91..30bf1a5 100644
+--- a/src/g2d-renderer.c
++++ b/src/g2d-renderer.c
+@@ -63,6 +63,7 @@ struct fb_screeninfo {
+       unsigned int y_resolution;
+       size_t buffer_length; /* length of frame buffer memory in bytes */
+       size_t physical;
++      size_t stride;
+       enum g2d_format pixel_format; /* frame buffer pixel format */
+       int fb_fd;
+ };
+@@ -322,8 +323,6 @@ get_g2dSurface(gcsWL_VIV_BUFFER *buffer, struct 
g2d_surfaceEx *g2dSurface)
+               weston_log("invalid EGL buffer in function %s\n", __func__);
+               return;
+       }
+-      int width  = buffer->alignedWidth;
+-      int height = buffer->alignedHeight;
+       g2d_getG2dFormat(buffer->format, &g2dSurface->base.format);
+       g2d_getG2dTiling(buffer->tiling, &g2dSurface->tiling);
+       g2dSurface->base.planes[0] = buffer->physical[0] + buffer->gpuBaseAddr;
+@@ -333,9 +332,9 @@ get_g2dSurface(gcsWL_VIV_BUFFER *buffer, struct 
g2d_surfaceEx *g2dSurface)
+       g2dSurface->base.top = 0;
+       g2dSurface->base.right = buffer->width;
+       g2dSurface->base.bottom = buffer->height;
+-      g2dSurface->base.stride = width;
+-      g2dSurface->base.width  = width;
+-      g2dSurface->base.height = height;
++      g2dSurface->base.stride = buffer->alignedWidth;
++      g2dSurface->base.width  = buffer->width;
++      g2dSurface->base.height = buffer->height;
+       g2dSurface->base.rot    = G2D_ROTATION_0;
+ }
+ 
+@@ -821,7 +820,7 @@ g2d_renderer_attach_shm(struct weston_surface *es, struct 
weston_buffer *buffer,
+       gs->g2d_surface.base.right  = buffer->width;
+       gs->g2d_surface.base.bottom = buffer->height;
+       gs->g2d_surface.base.stride = alignedWidth;
+-      gs->g2d_surface.base.width  = alignedWidth;
++      gs->g2d_surface.base.width  = buffer->width;
+       gs->g2d_surface.base.height = buffer->height;
+       gs->g2d_surface.base.rot    = G2D_ROTATION_0;
+       gs->g2d_surface.base.clrcolor = 0xFF400000;
+@@ -1079,7 +1078,7 @@ get_G2dSurface_from_screeninfo(struct fb_screeninfo 
*info, struct g2d_surfaceEx*
+               g2dSurface->base.top  = 0;
+               g2dSurface->base.right  = info->x_resolution;
+               g2dSurface->base.bottom = info->y_resolution;
+-              g2dSurface->base.stride = info->x_resolution;
++              g2dSurface->base.stride = info->stride;
+               g2dSurface->base.width  = info->x_resolution;
+               g2dSurface->base.height = info->y_resolution;
+               g2dSurface->base.format = info->pixel_format;
+@@ -1119,6 +1118,7 @@ fb_query_screen_info(struct g2d_output_state *output, 
int fd,
+       info->y_resolution = varinfo->yres;
+       info->physical = fixinfo->smem_start;
+       info->buffer_length = fixinfo->smem_len;
++      info->stride = fixinfo->line_length / (varinfo->bits_per_pixel >> 3);
+       calculate_g2d_format(varinfo, &info->pixel_format);
+ 
+       if (info->pixel_format < 0) {
+-- 
+1.9.1
+
diff --git a/recipes-graphics/wayland/weston_%.bbappend 
b/recipes-graphics/wayland/weston_%.bbappend
index 0468149..c79a3fd 100644
--- a/recipes-graphics/wayland/weston_%.bbappend
+++ b/recipes-graphics/wayland/weston_%.bbappend
@@ -12,6 +12,7 @@ SRC_URI_append_imxgpu2d = " \
     file://0011-MGS-1724-xwld-G2D-compositor-build-failed-in-slevk-b.patch \
     file://0012-MGS-1783-xwld-Add-clone-mode-support-for-multi-displ.patch \
     file://0013-MGS-1945-Use-common-API-to-support-G2d-compositor.patch    \
+    file://0014-MGS-1987-Get-stride-from-the-FB-buffe.patch                \
 "
 
 PACKAGECONFIG_IMX_TO_APPEND = ""
-- 
1.9.1

-- 
_______________________________________________
meta-freescale mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/meta-freescale

Reply via email to