Linux-Rockchip Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] media: verisilicon: Fix format enumeration when post-processor is mandatory
@ 2026-04-28  8:37 Benjamin Gaignard
  2026-04-28 14:30 ` Nicolas Dufresne
  2026-04-29 18:05 ` Nicolas Dufresne
  0 siblings, 2 replies; 3+ messages in thread
From: Benjamin Gaignard @ 2026-04-28  8:37 UTC (permalink / raw)
  To: nicolas.dufresne, p.zabel, mchehab, hverkuil
  Cc: linux-media, linux-rockchip, linux-kernel, kernel,
	Benjamin Gaignard

When a post-processor pixel format is mandatory (i.e. when an AV1
bitstream use film grain feature) the driver must only enumerate
post-processed format.
Use the context format to know what is suppose to be enumerated.

Signed-off-by: Benjamin Gaignard <benjamin.gaignard@collabora.com>
Fixes: 80c7373a456e ("media: verisilicon: Conditionally ignore native formats")
---
 drivers/media/platform/verisilicon/hantro_v4l2.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/platform/verisilicon/hantro_v4l2.c b/drivers/media/platform/verisilicon/hantro_v4l2.c
index fcf3bd9bcda2..f538d4562744 100644
--- a/drivers/media/platform/verisilicon/hantro_v4l2.c
+++ b/drivers/media/platform/verisilicon/hantro_v4l2.c
@@ -242,7 +242,7 @@ static int vidioc_enum_fmt(struct file *file, void *priv,
 	 */
 	skip_mode_none = capture == ctx->is_encoder;
 
-	formats = hantro_get_formats(ctx, &num_fmts, HANTRO_AUTO_POSTPROC);
+	formats = hantro_get_formats(ctx, &num_fmts, ctx->need_postproc);
 	for (i = 0; i < num_fmts; i++) {
 		bool mode_none = formats[i].codec_mode == HANTRO_MODE_NONE;
 		fmt = &formats[i];
-- 
2.43.0


_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

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

* Re: [PATCH] media: verisilicon: Fix format enumeration when post-processor is mandatory
  2026-04-28  8:37 [PATCH] media: verisilicon: Fix format enumeration when post-processor is mandatory Benjamin Gaignard
@ 2026-04-28 14:30 ` Nicolas Dufresne
  2026-04-29 18:05 ` Nicolas Dufresne
  1 sibling, 0 replies; 3+ messages in thread
From: Nicolas Dufresne @ 2026-04-28 14:30 UTC (permalink / raw)
  To: Benjamin Gaignard, p.zabel, mchehab, hverkuil
  Cc: linux-media, linux-rockchip, linux-kernel, kernel


[-- Attachment #1.1: Type: text/plain, Size: 1348 bytes --]

Le mardi 28 avril 2026 à 10:37 +0200, Benjamin Gaignard a écrit :
> When a post-processor pixel format is mandatory (i.e. when an AV1
> bitstream use film grain feature) the driver must only enumerate
> post-processed format.
> Use the context format to know what is suppose to be enumerated.
> 
> Signed-off-by: Benjamin Gaignard <benjamin.gaignard@collabora.com>
> Fixes: 80c7373a456e ("media: verisilicon: Conditionally ignore native formats")

Reviewed-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>

> ---
>  drivers/media/platform/verisilicon/hantro_v4l2.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/media/platform/verisilicon/hantro_v4l2.c b/drivers/media/platform/verisilicon/hantro_v4l2.c
> index fcf3bd9bcda2..f538d4562744 100644
> --- a/drivers/media/platform/verisilicon/hantro_v4l2.c
> +++ b/drivers/media/platform/verisilicon/hantro_v4l2.c
> @@ -242,7 +242,7 @@ static int vidioc_enum_fmt(struct file *file, void *priv,
>  	 */
>  	skip_mode_none = capture == ctx->is_encoder;
>  
> -	formats = hantro_get_formats(ctx, &num_fmts, HANTRO_AUTO_POSTPROC);
> +	formats = hantro_get_formats(ctx, &num_fmts, ctx->need_postproc);
>  	for (i = 0; i < num_fmts; i++) {
>  		bool mode_none = formats[i].codec_mode == HANTRO_MODE_NONE;
>  		fmt = &formats[i];

[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

[-- Attachment #2: Type: text/plain, Size: 170 bytes --]

_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

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

* Re: [PATCH] media: verisilicon: Fix format enumeration when post-processor is mandatory
  2026-04-28  8:37 [PATCH] media: verisilicon: Fix format enumeration when post-processor is mandatory Benjamin Gaignard
  2026-04-28 14:30 ` Nicolas Dufresne
@ 2026-04-29 18:05 ` Nicolas Dufresne
  1 sibling, 0 replies; 3+ messages in thread
From: Nicolas Dufresne @ 2026-04-29 18:05 UTC (permalink / raw)
  To: Benjamin Gaignard, p.zabel, mchehab, hverkuil
  Cc: linux-media, linux-rockchip, linux-kernel, kernel


[-- Attachment #1.1: Type: text/plain, Size: 1601 bytes --]

Hi Benjamin,

Le mardi 28 avril 2026 à 10:37 +0200, Benjamin Gaignard a écrit :
> When a post-processor pixel format is mandatory (i.e. when an AV1
> bitstream use film grain feature) the driver must only enumerate
> post-processed format.
> Use the context format to know what is suppose to be enumerated.
> 
> Signed-off-by: Benjamin Gaignard <benjamin.gaignard@collabora.com>
> Fixes: 80c7373a456e ("media: verisilicon: Conditionally ignore native
> formats")
> ---
>  drivers/media/platform/verisilicon/hantro_v4l2.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/media/platform/verisilicon/hantro_v4l2.c
> b/drivers/media/platform/verisilicon/hantro_v4l2.c
> index fcf3bd9bcda2..f538d4562744 100644
> --- a/drivers/media/platform/verisilicon/hantro_v4l2.c
> +++ b/drivers/media/platform/verisilicon/hantro_v4l2.c
> @@ -242,7 +242,7 @@ static int vidioc_enum_fmt(struct file *file, void *priv,
>  	 */
>  	skip_mode_none = capture == ctx->is_encoder;
>  
> -	formats = hantro_get_formats(ctx, &num_fmts, HANTRO_AUTO_POSTPROC);
> +	formats = hantro_get_formats(ctx, &num_fmts, ctx->need_postproc);

Looks like this is a subset of another of your patch, which was pending a commit
message fix.

https://patchwork.linuxtv.org/project/linux-media/patch/20250624122938.62004-1-benjamin.gaignard@collabora.com/

I've picked the other patch and applied my commit message suggestion.

Nicolas

>  	for (i = 0; i < num_fmts; i++) {
>  		bool mode_none = formats[i].codec_mode == HANTRO_MODE_NONE;
>  		fmt = &formats[i];

[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

[-- Attachment #2: Type: text/plain, Size: 170 bytes --]

_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

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

end of thread, other threads:[~2026-04-29 18:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-28  8:37 [PATCH] media: verisilicon: Fix format enumeration when post-processor is mandatory Benjamin Gaignard
2026-04-28 14:30 ` Nicolas Dufresne
2026-04-29 18:05 ` Nicolas Dufresne

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox