From: Hans Verkuil <hverkuil@xs4all.nl>
To: Ramakrishnan Muthukrishnan <ram@fastmail.in>,
linux-media@vger.kernel.org
Cc: Ramakrishnan Muthukrishnan <ramakrmu@cisco.com>
Subject: Re: [REVIEW PATCH 1/4] media: v4l2-core: remove the use of V4L2_FL_USE_FH_PRIO flag.
Date: Fri, 20 Jun 2014 09:00:35 +0200 [thread overview]
Message-ID: <53A3DC13.7060603@xs4all.nl> (raw)
In-Reply-To: <1403198580-3126-2-git-send-email-ram@fastmail.in>
On 06/19/2014 07:22 PM, Ramakrishnan Muthukrishnan wrote:
> From: Ramakrishnan Muthukrishnan <ramakrmu@cisco.com>
>
> Since all the drivers that use `struct v4l2_fh' use the core priority
> checking instead of doing it themselves, this flag can be removed.
>
> This patch removes the usage of the flag from v4l2-core.
>
> Signed-off-by: Ramakrishnan Muthukrishnan <ramakrmu@cisco.com>
Reviewed-by: Hans Verkuil <hans.verkuil@cisco.com>
Thanks!
Hans
> ---
> drivers/media/v4l2-core/v4l2-dev.c | 6 ++----
> drivers/media/v4l2-core/v4l2-fh.c | 13 +++++++++----
> drivers/media/v4l2-core/v4l2-ioctl.c | 9 +++------
> 3 files changed, 14 insertions(+), 14 deletions(-)
>
> diff --git a/drivers/media/v4l2-core/v4l2-dev.c b/drivers/media/v4l2-core/v4l2-dev.c
> index 634d863..35698aa 100644
> --- a/drivers/media/v4l2-core/v4l2-dev.c
> +++ b/drivers/media/v4l2-core/v4l2-dev.c
> @@ -563,11 +563,9 @@ static void determine_valid_ioctls(struct video_device *vdev)
> /* vfl_type and vfl_dir independent ioctls */
>
> SET_VALID_IOCTL(ops, VIDIOC_QUERYCAP, vidioc_querycap);
> - if (ops->vidioc_g_priority ||
> - test_bit(V4L2_FL_USE_FH_PRIO, &vdev->flags))
> + if (ops->vidioc_g_priority)
> set_bit(_IOC_NR(VIDIOC_G_PRIORITY), valid_ioctls);
> - if (ops->vidioc_s_priority ||
> - test_bit(V4L2_FL_USE_FH_PRIO, &vdev->flags))
> + if (ops->vidioc_s_priority)
> set_bit(_IOC_NR(VIDIOC_S_PRIORITY), valid_ioctls);
> SET_VALID_IOCTL(ops, VIDIOC_STREAMON, vidioc_streamon);
> SET_VALID_IOCTL(ops, VIDIOC_STREAMOFF, vidioc_streamoff);
> diff --git a/drivers/media/v4l2-core/v4l2-fh.c b/drivers/media/v4l2-core/v4l2-fh.c
> index e57c002..c97067a 100644
> --- a/drivers/media/v4l2-core/v4l2-fh.c
> +++ b/drivers/media/v4l2-core/v4l2-fh.c
> @@ -37,6 +37,13 @@ void v4l2_fh_init(struct v4l2_fh *fh, struct video_device *vdev)
> fh->ctrl_handler = vdev->ctrl_handler;
> INIT_LIST_HEAD(&fh->list);
> set_bit(V4L2_FL_USES_V4L2_FH, &fh->vdev->flags);
> + /*
> + * determine_valid_ioctls() does not know if struct v4l2_fh
> + * is used by this driver, but here we do. So enable the
> + * prio ioctls here.
> + */
> + set_bit(_IOC_NR(VIDIOC_G_PRIORITY), vdev->valid_ioctls);
> + set_bit(_IOC_NR(VIDIOC_S_PRIORITY), vdev->valid_ioctls);
> fh->prio = V4L2_PRIORITY_UNSET;
> init_waitqueue_head(&fh->wait);
> INIT_LIST_HEAD(&fh->available);
> @@ -49,8 +56,7 @@ void v4l2_fh_add(struct v4l2_fh *fh)
> {
> unsigned long flags;
>
> - if (test_bit(V4L2_FL_USE_FH_PRIO, &fh->vdev->flags))
> - v4l2_prio_open(fh->vdev->prio, &fh->prio);
> + v4l2_prio_open(fh->vdev->prio, &fh->prio);
> spin_lock_irqsave(&fh->vdev->fh_lock, flags);
> list_add(&fh->list, &fh->vdev->fh_list);
> spin_unlock_irqrestore(&fh->vdev->fh_lock, flags);
> @@ -78,8 +84,7 @@ void v4l2_fh_del(struct v4l2_fh *fh)
> spin_lock_irqsave(&fh->vdev->fh_lock, flags);
> list_del_init(&fh->list);
> spin_unlock_irqrestore(&fh->vdev->fh_lock, flags);
> - if (test_bit(V4L2_FL_USE_FH_PRIO, &fh->vdev->flags))
> - v4l2_prio_close(fh->vdev->prio, fh->prio);
> + v4l2_prio_close(fh->vdev->prio, fh->prio);
> }
> EXPORT_SYMBOL_GPL(v4l2_fh_del);
>
> diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c b/drivers/media/v4l2-core/v4l2-ioctl.c
> index 16bffd8..8d4a25d 100644
> --- a/drivers/media/v4l2-core/v4l2-ioctl.c
> +++ b/drivers/media/v4l2-core/v4l2-ioctl.c
> @@ -2190,7 +2190,6 @@ static long __video_do_ioctl(struct file *file,
> const struct v4l2_ioctl_info *info;
> void *fh = file->private_data;
> struct v4l2_fh *vfh = NULL;
> - int use_fh_prio = 0;
> int debug = vfd->debug;
> long ret = -ENOTTY;
>
> @@ -2200,10 +2199,8 @@ static long __video_do_ioctl(struct file *file,
> return ret;
> }
>
> - if (test_bit(V4L2_FL_USES_V4L2_FH, &vfd->flags)) {
> + if (test_bit(V4L2_FL_USES_V4L2_FH, &vfd->flags))
> vfh = file->private_data;
> - use_fh_prio = test_bit(V4L2_FL_USE_FH_PRIO, &vfd->flags);
> - }
>
> if (v4l2_is_known_ioctl(cmd)) {
> info = &v4l2_ioctls[_IOC_NR(cmd)];
> @@ -2212,7 +2209,7 @@ static long __video_do_ioctl(struct file *file,
> !((info->flags & INFO_FL_CTRL) && vfh && vfh->ctrl_handler))
> goto done;
>
> - if (use_fh_prio && (info->flags & INFO_FL_PRIO)) {
> + if (vfh && (info->flags & INFO_FL_PRIO)) {
> ret = v4l2_prio_check(vfd->prio, vfh->prio);
> if (ret)
> goto done;
> @@ -2237,7 +2234,7 @@ static long __video_do_ioctl(struct file *file,
> ret = -ENOTTY;
> } else {
> ret = ops->vidioc_default(file, fh,
> - use_fh_prio ? v4l2_prio_check(vfd->prio, vfh->prio) >= 0 : 0,
> + vfh ? v4l2_prio_check(vfd->prio, vfh->prio) >= 0 : 0,
> cmd, arg);
> }
>
>
next prev parent reply other threads:[~2014-06-20 7:01 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-19 17:22 [REVIEW PATCH] media: remove V4L2_FL_USE_FH_PRIO flag and its usage Ramakrishnan Muthukrishnan
2014-06-19 17:22 ` [REVIEW PATCH 1/4] media: v4l2-core: remove the use of V4L2_FL_USE_FH_PRIO flag Ramakrishnan Muthukrishnan
2014-06-20 7:00 ` Hans Verkuil [this message]
2014-06-19 17:22 ` [REVIEW PATCH 2/4] media: remove the setting of the flag V4L2_FL_USE_FH_PRIO Ramakrishnan Muthukrishnan
2014-06-20 7:01 ` Hans Verkuil
2014-06-19 17:22 ` [REVIEW PATCH 3/4] media: v4l2-dev.h: remove V4L2_FL_USE_FH_PRIO flag Ramakrishnan Muthukrishnan
2014-06-20 7:01 ` Hans Verkuil
2014-06-19 17:23 ` [REVIEW PATCH 4/4] media: Documentation: " Ramakrishnan Muthukrishnan
2014-06-20 7:02 ` Hans Verkuil
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=53A3DC13.7060603@xs4all.nl \
--to=hverkuil@xs4all.nl \
--cc=linux-media@vger.kernel.org \
--cc=ram@fastmail.in \
--cc=ramakrmu@cisco.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.