This is an automatic generated email to let you know that the following patch 
were queued:

Subject: media: coda: V4L2_PIX_FMT_GREY for coda960 JPEG Encoder
Author:  Martin Weber <[email protected]>
Date:    Tue Nov 9 11:43:09 2021 +0000

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 <[email protected]>
Reviewed-by: Philipp Zabel <[email protected]>
Signed-off-by: Hans Verkuil <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>

 drivers/media/platform/coda/coda-common.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

---

diff --git a/drivers/media/platform/coda/coda-common.c 
b/drivers/media/platform/coda/coda-common.c
index 0e312b0842d7..3cfd4368e9a9 100644
--- a/drivers/media/platform/coda/coda-common.c
+++ b/drivers/media/platform/coda/coda-common.c
@@ -43,7 +43,7 @@
 #define CODA_NAME              "coda"
 
 #define CODADX6_MAX_INSTANCES  4
-#define CODA_MAX_FORMATS       4
+#define CODA_MAX_FORMATS       5
 
 #define CODA_ISRAM_SIZE        (2048 * 2)
 
@@ -247,6 +247,7 @@ static const struct coda_video_device coda9_jpeg_encoder = {
                V4L2_PIX_FMT_YUV420,
                V4L2_PIX_FMT_YVU420,
                V4L2_PIX_FMT_YUV422P,
+               V4L2_PIX_FMT_GREY,
        },
        .dst_formats = {
                V4L2_PIX_FMT_JPEG,
@@ -626,6 +627,11 @@ static int coda_try_fmt(struct coda_ctx *ctx, const struct 
coda_codec *codec,
                f->fmt.pix.sizeimage = f->fmt.pix.bytesperline *
                                        f->fmt.pix.height * 2;
                break;
+       case V4L2_PIX_FMT_GREY:
+               /* keep 16 pixel alignment of 8-bit pixel data */
+               f->fmt.pix.bytesperline = round_up(f->fmt.pix.width, 16);
+               f->fmt.pix.sizeimage = f->fmt.pix.bytesperline * 
f->fmt.pix.height;
+               break;
        case V4L2_PIX_FMT_JPEG:
        case V4L2_PIX_FMT_H264:
        case V4L2_PIX_FMT_MPEG4:

_______________________________________________
linuxtv-commits mailing list
[email protected]
https://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits

Reply via email to