All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hans Verkuil <hverkuil@xs4all.nl>
To: Philipp Zabel <p.zabel@pengutronix.de>, linux-media@vger.kernel.org
Cc: Mauro Carvalho Chehab <mchehab@kernel.org>, kernel@pengutronix.de
Subject: Re: [PATCH 6/7] media: coda: enable capture G_PARM for stateful encoder
Date: Thu, 21 Apr 2022 12:30:15 +0200	[thread overview]
Message-ID: <bf945836-a7fb-a67f-1f89-e5cc85fec808@xs4all.nl> (raw)
In-Reply-To: <20220404163533.707508-6-p.zabel@pengutronix.de>

Hi Philipp,

On 04/04/2022 18:35, Philipp Zabel wrote:
> Allow to call G_PARM with type == V4L2_BUF_TYPE_VIDEO_CAPTURE,
> to fix the following v4l2-compliance test failure:
> 
> 		fail: v4l2-test-formats.cpp(1344): ret && node->has_frmintervals
> 	test VIDIOC_G/S_PARM: FAIL
> 
> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
> ---
>  drivers/media/platform/chips-media/coda-common.c | 3 ---
>  1 file changed, 3 deletions(-)
> 
> diff --git a/drivers/media/platform/chips-media/coda-common.c b/drivers/media/platform/chips-media/coda-common.c
> index c068c16d1eb4..33fcd8c7d72b 100644
> --- a/drivers/media/platform/chips-media/coda-common.c
> +++ b/drivers/media/platform/chips-media/coda-common.c
> @@ -1341,9 +1341,6 @@ static int coda_g_parm(struct file *file, void *fh, struct v4l2_streamparm *a)
>  	struct coda_ctx *ctx = fh_to_ctx(fh);
>  	struct v4l2_fract *tpf;
>  
> -	if (a->type != V4L2_BUF_TYPE_VIDEO_OUTPUT)
> -		return -EINVAL;
> -
>  	a->parm.output.capability = V4L2_CAP_TIMEPERFRAME;
>  	tpf = &a->parm.output.timeperframe;
>  	tpf->denominator = ctx->params.framerate & CODA_FRATE_RES_MASK;

I think this is actually a v4l2-compliance bug, not a driver bug.

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 HW resources.

See https://hverkuil.home.xs4all.nl/spec/userspace-api/v4l/vidioc-enum-fmt.html#fmtdesc-flags

That flags isn't used, so v4l2-compliance shouldn't complain.

Try this v4l2-compliance patch to see if it resolved the fails for this patch
and the next patch (7/7).

v4l2-compliance patch:

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
---
diff --git a/utils/v4l2-compliance/v4l2-test-formats.cpp b/utils/v4l2-compliance/v4l2-test-formats.cpp
index 3761b1fa..269a3832 100644
--- a/utils/v4l2-compliance/v4l2-test-formats.cpp
+++ b/utils/v4l2-compliance/v4l2-test-formats.cpp
@@ -1341,8 +1341,16 @@ static int testParmType(struct node *node, unsigned type)
 	case V4L2_BUF_TYPE_VIDEO_OUTPUT:
 	case V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE:
 		if (node->g_caps() & buftype2cap[type]) {
-			fail_on_test(ret && node->has_frmintervals);
-			fail_on_test(ret && node->has_enc_cap_frame_interval);
+			if (is_stateful_enc) {
+				if (V4L2_TYPE_IS_OUTPUT(type))
+					fail_on_test(ret && node->has_frmintervals);
+				else if (node->has_enc_cap_frame_interval)
+					fail_on_test(ret);
+				else
+					fail_on_test(!ret);
+			} else {
+				fail_on_test(ret && node->has_frmintervals);
+			}
 		}
 		break;
 	default:

  parent reply	other threads:[~2022-04-21 10:30 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-04 16:35 [PATCH 1/7] media: coda: set output buffer bytesused to appease v4l2-compliance Philipp Zabel
2022-04-04 16:35 ` [PATCH 2/7] media: coda: disable encoder cmd ioctl on decoder and vice versa Philipp Zabel
2022-04-05 14:07   ` Nicolas Dufresne
2022-04-04 16:35 ` [PATCH 3/7] media: coda: disable encoder ioctls for decoder devices Philipp Zabel
2022-04-05 14:13   ` Nicolas Dufresne
2022-04-04 16:35 ` [PATCH 4/7] media: coda: disable stateful encoder ioctls for jpeg encoder Philipp Zabel
2022-04-05 14:14   ` Nicolas Dufresne
2022-04-04 16:35 ` [PATCH 5/7] media: coda: fix default JPEG colorimetry Philipp Zabel
2022-04-05 14:15   ` Nicolas Dufresne
2022-04-21 10:02   ` Hans Verkuil
2022-04-21 10:38     ` Philipp Zabel
2022-04-21 11:06       ` Hans Verkuil
2022-04-26  9:21         ` Philipp Zabel
2022-04-21 14:54     ` Philipp Zabel
2022-04-21 15:28       ` Philipp Zabel
2022-04-04 16:35 ` [PATCH 6/7] media: coda: enable capture G_PARM for stateful encoder Philipp Zabel
2022-04-05 14:19   ` Nicolas Dufresne
2022-04-21 10:30   ` Hans Verkuil [this message]
2022-04-21 14:58     ` Philipp Zabel
2022-04-25  5:34       ` Hans Verkuil
2022-04-04 16:35 ` [PATCH 7/7] media: coda: enable capture S_PARM " Philipp Zabel
2022-04-05 14:22   ` Nicolas Dufresne
2022-04-05 15:03     ` Philipp Zabel
2022-04-05 16:00       ` Nicolas Dufresne
2022-04-05 14:05 ` [PATCH 1/7] media: coda: set output buffer bytesused to appease v4l2-compliance Nicolas Dufresne
2022-04-21  9:44 ` Hans Verkuil
2022-04-21 10:24   ` Philipp Zabel
2022-04-26  5:52     ` Hans Verkuil
2022-04-26  9:32       ` Philipp Zabel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bf945836-a7fb-a67f-1f89-e5cc85fec808@xs4all.nl \
    --to=hverkuil@xs4all.nl \
    --cc=kernel@pengutronix.de \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=p.zabel@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.