All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] V4L2_PIX_FMT_GREYSCALE for coda960 JPEG Encoder
@ 2021-11-09 11:43 Martin Weber
  2021-11-11 16:17 ` Philipp Zabel
  0 siblings, 1 reply; 3+ messages in thread
From: Martin Weber @ 2021-11-09 11:43 UTC (permalink / raw)
  To: linux-media; +Cc: p.zabel

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.

Signed-off-by: Martin S. Weber <martin.weber@br-automation.com>
---
 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 87a2c706f747..51b833a55690 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:
-- 
2.30.2

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] V4L2_PIX_FMT_GREYSCALE for coda960 JPEG Encoder
  2021-11-09 11:43 [PATCH] V4L2_PIX_FMT_GREYSCALE for coda960 JPEG Encoder Martin Weber
@ 2021-11-11 16:17 ` Philipp Zabel
  2021-11-15 14:39   ` Hans Verkuil
  0 siblings, 1 reply; 3+ messages in thread
From: Philipp Zabel @ 2021-11-11 16:17 UTC (permalink / raw)
  To: Martin Weber, linux-media

Hi Martin,

On Tue, 2021-11-09 at 11:43 +0000, Martin Weber wrote:
> 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.
> 
> Signed-off-by: Martin S. Weber <martin.weber@br-automation.com>

thank you for the patch! I never tested grayscale encoding, so I didn't
expect it to work out of the box :)

The code is fine, just a small formal issue: the subject should be in
the style used in the media subsystem. For example:

  media: coda: V4L2_PIX_FMT_GREY for coda960 JPEG encoder

(note that there is no V4L2_PIX_FMT_GREYSCALE). Please resend a v2 with
the subject fixed and feel free to add:

Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>

regards
Philipp

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] V4L2_PIX_FMT_GREYSCALE for coda960 JPEG Encoder
  2021-11-11 16:17 ` Philipp Zabel
@ 2021-11-15 14:39   ` Hans Verkuil
  0 siblings, 0 replies; 3+ messages in thread
From: Hans Verkuil @ 2021-11-15 14:39 UTC (permalink / raw)
  To: Philipp Zabel, Martin Weber, linux-media

Hi Martin,

No need for a v2, I've fixed up the subject line and will merge it.

Just remember it for the next time you post a patch :-)

Regards,

	Hans

On 11/11/2021 17:17, Philipp Zabel wrote:
> Hi Martin,
> 
> On Tue, 2021-11-09 at 11:43 +0000, Martin Weber wrote:
>> 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.
>>
>> Signed-off-by: Martin S. Weber <martin.weber@br-automation.com>
> 
> thank you for the patch! I never tested grayscale encoding, so I didn't
> expect it to work out of the box :)
> 
> The code is fine, just a small formal issue: the subject should be in
> the style used in the media subsystem. For example:
> 
>   media: coda: V4L2_PIX_FMT_GREY for coda960 JPEG encoder
> 
> (note that there is no V4L2_PIX_FMT_GREYSCALE). Please resend a v2 with
> the subject fixed and feel free to add:
> 
> Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
> 
> regards
> Philipp
> 


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-11-15 14:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-09 11:43 [PATCH] V4L2_PIX_FMT_GREYSCALE for coda960 JPEG Encoder Martin Weber
2021-11-11 16:17 ` Philipp Zabel
2021-11-15 14:39   ` Hans Verkuil

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.