All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hans Verkuil <hans.verkuil@cisco.com>
To: linux-media@vger.kernel.org
Cc: Pawel Osciak <pawel@osciak.com>,
	Marek Szyprowski <m.szyprowski@samsung.com>
Subject: [RFC PATCH 6/6] v4l2-dev: G_PARM was incorrectly enabled for all video nodes.
Date: Thu, 19 Jul 2012 14:00:24 +0200	[thread overview]
Message-ID: <3397e353a24c32221363ba1438ab03364c08b8a9.1342699069.git.hans.verkuil@cisco.com> (raw)
In-Reply-To: <1342699224-12642-1-git-send-email-hans.verkuil@cisco.com>
In-Reply-To: <903c0da0d6e7354d6f884f0ddec783143165e54c.1342699069.git.hans.verkuil@cisco.com>

G_PARM should only be enabled if:

- vidioc_g_parm is present
- or: it is a video node and vidioc_g_std or tvnorms are set.

Without this additional check v4l2-compliance would complain about
being able to use g_parm when it didn't expect it.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
---
 drivers/media/video/v4l2-dev.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/media/video/v4l2-dev.c b/drivers/media/video/v4l2-dev.c
index d13c47f..beadd97 100644
--- a/drivers/media/video/v4l2-dev.c
+++ b/drivers/media/video/v4l2-dev.c
@@ -697,7 +697,8 @@ static void determine_valid_ioctls(struct video_device *vdev)
 	SET_VALID_IOCTL(ops, VIDIOC_TRY_ENCODER_CMD, vidioc_try_encoder_cmd);
 	SET_VALID_IOCTL(ops, VIDIOC_DECODER_CMD, vidioc_decoder_cmd);
 	SET_VALID_IOCTL(ops, VIDIOC_TRY_DECODER_CMD, vidioc_try_decoder_cmd);
-	if (ops->vidioc_g_parm || vdev->vfl_type == VFL_TYPE_GRABBER)
+	if (ops->vidioc_g_parm || (vdev->vfl_type == VFL_TYPE_GRABBER &&
+					(ops->vidioc_g_std || vdev->tvnorms)))
 		set_bit(_IOC_NR(VIDIOC_G_PARM), valid_ioctls);
 	SET_VALID_IOCTL(ops, VIDIOC_S_PARM, vidioc_s_parm);
 	SET_VALID_IOCTL(ops, VIDIOC_G_TUNER, vidioc_g_tuner);
-- 
1.7.10


      parent reply	other threads:[~2012-07-19 12:00 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-19 12:00 [RFC PATCH 0/6] mem2mem_testdev: fix v4l2-compliance errors Hans Verkuil
2012-07-19 12:00 ` [RFC PATCH 1/6] mem2mem_testdev: convert to the control framework and v4l2_fh Hans Verkuil
2012-07-19 12:00   ` [RFC PATCH 2/6] mem2mem_testdev: set bus_info and device_caps Hans Verkuil
2012-07-19 12:00   ` [RFC PATCH 3/6] v4l2-mem2mem: support events in v4l2_m2m_poll Hans Verkuil
2012-07-19 12:00   ` [RFC PATCH 4/6] mem2mem_testdev: add control events support Hans Verkuil
2012-07-19 12:00   ` [RFC PATCH 5/6] mem2mem_testdev: set default size and fix colorspace Hans Verkuil
2012-07-19 12:00   ` Hans Verkuil [this message]

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=3397e353a24c32221363ba1438ab03364c08b8a9.1342699069.git.hans.verkuil@cisco.com \
    --to=hans.verkuil@cisco.com \
    --cc=linux-media@vger.kernel.org \
    --cc=m.szyprowski@samsung.com \
    --cc=pawel@osciak.com \
    /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.