[weston,v4] simple-dmabuf-drm: nv12: properly fill Y plane

Submitted by Emilio Pozuelo Monfort on July 12, 2018, 11:46 a.m.

Details

Message ID 20180712114626.13383-4-emilio.pozuelo@collabora.co.uk
State Superseded
Headers show
Series "simple-dmabuf-drm: fix build with --disable-egl" ( rev: 9 ) in Wayland

Not browsing as part of any series.

Commit Message

Emilio Pozuelo Monfort July 12, 2018, 11:46 a.m.
We want 0..255 values, not 0..254.

Signed-off-by: Emilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk>
---
New patch.

 clients/simple-dmabuf-drm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/clients/simple-dmabuf-drm.c b/clients/simple-dmabuf-drm.c
index 4f88f12e..198d88e8 100644
--- a/clients/simple-dmabuf-drm.c
+++ b/clients/simple-dmabuf-drm.c
@@ -147,7 +147,7 @@  fill_content(struct buffer *my_buf, uint64_t modifier)
 			for (y = 0; y < my_buf->height; y++) {
 				pix8 = my_buf->mmap + y * my_buf->stride;
 				for (x = 0; x < my_buf->width; x++)
-					*pix8++ = x % 0xff;
+					*pix8++ = x % 256;
 			}
 			/* second plane (CbCr) is half the size of Y */
 			for (y = 0; y < my_buf->height; y++) {

Comments

Hi Emilio,

On Thu, 12 Jul 2018 at 12:46, Emilio Pozuelo Monfort <pochu27@gmail.com> wrote:
> @@ -147,7 +147,7 @@ fill_content(struct buffer *my_buf, uint64_t modifier)
>                         for (y = 0; y < my_buf->height; y++) {
>                                 pix8 = my_buf->mmap + y * my_buf->stride;
>                                 for (x = 0; x < my_buf->width; x++)
> -                                       *pix8++ = x % 0xff;
> +                                       *pix8++ = x % 256;

This somehow ended up also squashed into the GBM rewrite. I've pulled
it out of that patch.

Cheers,
Daniel