mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] media: amphion: G/S_PARM only for encoder's output queue
@ 2022-05-09  7:52 Ming Qian
  0 siblings, 0 replies; only message in thread
From: Ming Qian @ 2022-05-09  7:52 UTC (permalink / raw)
  To: mchehab, hverkuil-cisco
  Cc: shawnguo, robh+dt, s.hauer, kernel, festevam, linux-imx,
	linux-media, linux-kernel, linux-arm-kernel

G/S_PARM doesn't make sense for the capture queue of a stateful encoder,
unless V4L2_FMT_FLAG_ENC_CAP_FRAME_INTERVAL is set to reserve hardware
resources.

Otherwise it will fail the v4l2-compliance

Signed-off-by: Ming Qian <ming.qian@nxp.com>
---
 drivers/media/platform/amphion/venc.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/media/platform/amphion/venc.c b/drivers/media/platform/amphion/venc.c
index ba9f49cca155..43d61d82f58c 100644
--- a/drivers/media/platform/amphion/venc.c
+++ b/drivers/media/platform/amphion/venc.c
@@ -283,6 +283,9 @@ static int venc_g_parm(struct file *file, void *fh, struct v4l2_streamparm *parm
 	if (!parm)
 		return -EINVAL;
 
+	if (!V4L2_TYPE_IS_OUTPUT(parm->type))
+		return -EINVAL;
+
 	if (!vpu_helper_check_type(inst, parm->type))
 		return -EINVAL;
 
@@ -304,6 +307,9 @@ static int venc_s_parm(struct file *file, void *fh, struct v4l2_streamparm *parm
 	if (!parm)
 		return -EINVAL;
 
+	if (!V4L2_TYPE_IS_OUTPUT(parm->type))
+		return -EINVAL;
+
 	if (!vpu_helper_check_type(inst, parm->type))
 		return -EINVAL;
 
-- 
2.36.0


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-05-09  8:11 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-09  7:52 [PATCH] media: amphion: G/S_PARM only for encoder's output queue Ming Qian

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®