mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2] media: amphion: Add V4L2_FMT_FLAG_DYN_RESOLUTION for VC1L
@ 2026-09-29  7:30 Ming Qian
  2026-09-29 14:38 ` Frank Li
  0 siblings, 1 reply; 2+ messages in thread
From: Ming Qian @ 2026-09-29  7:30 UTC (permalink / raw)
  To: Mauro Carvalho Chehab, Hans Verkuil, Nicolas Dufresne, Ming Qian
  Cc: Zhou Peng, Elliot Chen, Frank Li, linux-imx, imx, linux-media,
	linux-kernel, Ming Qian

The amphion VPU decoder always emits an initial V4L2_EVENT_SOURCE_CHANGE
event after parsing the resolution from the stream header for VC1 Annex
L format. Without V4L2_FMT_FLAG_DYN_RESOLUTION, userspace (e.g.
GStreamer) cannot determine that the driver will signal the initial
resolution, causing it to skip waiting for the event and fail to set up
the CAPTURE queue properly.

Add V4L2_FMT_FLAG_DYN_RESOLUTION to the VC1 Annex L format entry to
indicate that the decoder will emit the source change event during
initialization, consistent with other coded formats supported by this
driver.

Fixes: e670f5d672ef ("media: amphion: only insert the first sequence startcode for vc1l format")
Reviewed-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
Signed-off-by: Ming Qian <ming.qian@oss.nxp.com>
---
Changes in v2:
- Drop the documentation patch. Nicolas pointed out that
  V4L2_FMT_FLAG_DYN_RESOLUTION postdates the stateful decoder spec, so any
  driver setting it is already required to follow that spec. The
  non-compliant drivers (coda, s5p-mfc) are pre-spec history and not worth
  bending the spec text around.
- Drop the RFC prefix, as requested by Nicolas.
- Link to v1: https://patch.msgid.link/20260608-flag-dyn-resolution-v1-0-44dc65516148@oss.nxp.com
---
 drivers/media/platform/amphion/vdec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/platform/amphion/vdec.c b/drivers/media/platform/amphion/vdec.c
index a9f0521f2e1a..75808482d090 100644
--- a/drivers/media/platform/amphion/vdec.c
+++ b/drivers/media/platform/amphion/vdec.c
@@ -136,7 +136,7 @@ static const struct vpu_format vdec_formats[] = {
 		.mem_planes = 1,
 		.comp_planes = 1,
 		.type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE,
-		.flags = V4L2_FMT_FLAG_COMPRESSED
+		.flags = V4L2_FMT_FLAG_DYN_RESOLUTION | V4L2_FMT_FLAG_COMPRESSED
 	},
 	{
 		.pixfmt = V4L2_PIX_FMT_MPEG2,

---
base-commit: 2dcdfb625c3b8fe87454e19dfbc54b3e3f0ad70e
change-id: 20260608-flag-dyn-resolution-f39fd24a0ba2


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

* Re: [PATCH v2] media: amphion: Add V4L2_FMT_FLAG_DYN_RESOLUTION for VC1L
  2026-09-29  7:30 [PATCH v2] media: amphion: Add V4L2_FMT_FLAG_DYN_RESOLUTION for VC1L Ming Qian
@ 2026-09-29 14:38 ` Frank Li
  0 siblings, 0 replies; 2+ messages in thread
From: Frank Li @ 2026-09-29 14:38 UTC (permalink / raw)
  To: Ming Qian
  Cc: Mauro Carvalho Chehab, Hans Verkuil, Nicolas Dufresne, Ming Qian,
	Zhou Peng, Elliot Chen, Frank Li, linux-imx, imx, linux-media,
	linux-kernel

On Tue, Sep 29, 2026 at 04:30:28PM +0900, Ming Qian wrote:
> The amphion VPU decoder always emits an initial V4L2_EVENT_SOURCE_CHANGE
> event after parsing the resolution from the stream header for VC1 Annex
> L format. Without V4L2_FMT_FLAG_DYN_RESOLUTION, userspace (e.g.
> GStreamer) cannot determine that the driver will signal the initial
> resolution, causing it to skip waiting for the event and fail to set up
> the CAPTURE queue properly.
>
> Add V4L2_FMT_FLAG_DYN_RESOLUTION to the VC1 Annex L format entry to
> indicate that the decoder will emit the source change event during
> initialization, consistent with other coded formats supported by this
> driver.
>
> Fixes: e670f5d672ef ("media: amphion: only insert the first sequence startcode for vc1l format")
> Reviewed-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
> Signed-off-by: Ming Qian <ming.qian@oss.nxp.com>

Reviewed-by: Frank Li <Frank.Li@nxp.com>

> ---
> Changes in v2:
> - Drop the documentation patch. Nicolas pointed out that
>   V4L2_FMT_FLAG_DYN_RESOLUTION postdates the stateful decoder spec, so any
>   driver setting it is already required to follow that spec. The
>   non-compliant drivers (coda, s5p-mfc) are pre-spec history and not worth
>   bending the spec text around.
> - Drop the RFC prefix, as requested by Nicolas.
> - Link to v1: https://patch.msgid.link/20260608-flag-dyn-resolution-v1-0-44dc65516148@oss.nxp.com
> ---
>  drivers/media/platform/amphion/vdec.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/media/platform/amphion/vdec.c b/drivers/media/platform/amphion/vdec.c
> index a9f0521f2e1a..75808482d090 100644
> --- a/drivers/media/platform/amphion/vdec.c
> +++ b/drivers/media/platform/amphion/vdec.c
> @@ -136,7 +136,7 @@ static const struct vpu_format vdec_formats[] = {
>  		.mem_planes = 1,
>  		.comp_planes = 1,
>  		.type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE,
> -		.flags = V4L2_FMT_FLAG_COMPRESSED
> +		.flags = V4L2_FMT_FLAG_DYN_RESOLUTION | V4L2_FMT_FLAG_COMPRESSED
>  	},
>  	{
>  		.pixfmt = V4L2_PIX_FMT_MPEG2,
>
> ---
> base-commit: 2dcdfb625c3b8fe87454e19dfbc54b3e3f0ad70e
> change-id: 20260608-flag-dyn-resolution-f39fd24a0ba2
>
>

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

end of thread, other threads:[~2026-09-29 14:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-29  7:30 [PATCH v2] media: amphion: Add V4L2_FMT_FLAG_DYN_RESOLUTION for VC1L Ming Qian
2026-09-29 14:38 ` Frank Li

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

all inboxes | Powered by JetHome®