Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

media: coda: V4L2_PIX_FMT_GREY for coda960 JPEG Encoder

support greyscale pix fmt input for coda9_jpeg_encoder. The hardware
supports it, so allow V4L2 Mem2Mem JPEG Encoder use it as well. Tested
on an i.MX6QP.

[hverkuil: updated the Subject line as suggested by Philipp]

Signed-off-by: Martin Weber <martin.weber@br-automation.com>
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>

authored by

Martin Weber and committed by
Mauro Carvalho Chehab
ea8587d9 dca7cc1c

+7 -1
+7 -1
drivers/media/platform/coda/coda-common.c
··· 43 43 #define CODA_NAME "coda" 44 44 45 45 #define CODADX6_MAX_INSTANCES 4 46 - #define CODA_MAX_FORMATS 4 46 + #define CODA_MAX_FORMATS 5 47 47 48 48 #define CODA_ISRAM_SIZE (2048 * 2) 49 49 ··· 247 247 V4L2_PIX_FMT_YUV420, 248 248 V4L2_PIX_FMT_YVU420, 249 249 V4L2_PIX_FMT_YUV422P, 250 + V4L2_PIX_FMT_GREY, 250 251 }, 251 252 .dst_formats = { 252 253 V4L2_PIX_FMT_JPEG, ··· 626 625 f->fmt.pix.bytesperline = round_up(f->fmt.pix.width, 16); 627 626 f->fmt.pix.sizeimage = f->fmt.pix.bytesperline * 628 627 f->fmt.pix.height * 2; 628 + break; 629 + case V4L2_PIX_FMT_GREY: 630 + /* keep 16 pixel alignment of 8-bit pixel data */ 631 + f->fmt.pix.bytesperline = round_up(f->fmt.pix.width, 16); 632 + f->fmt.pix.sizeimage = f->fmt.pix.bytesperline * f->fmt.pix.height; 629 633 break; 630 634 case V4L2_PIX_FMT_JPEG: 631 635 case V4L2_PIX_FMT_H264: