From: Boris Brezillon <boris.brezillon@collabora.com>
To: Hans Verkuil <hverkuil@xs4all.nl>
Cc: Mauro Carvalho Chehab <mchehab@kernel.org>,
Hans Verkuil <hans.verkuil@cisco.com>,
Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
Sakari Ailus <sakari.ailus@iki.fi>,
linux-media@vger.kernel.org, kernel@collabora.com,
Tomasz Figa <tfiga@chromium.org>,
Hirokazu Honda <hiroh@chromium.org>,
Nicolas Dufresne <nicolas@ndufresne.ca>,
Sylwester Nawrocki <s.nawrocki@samsung.com>
Subject: Re: [PATCH v5 2/2] media: v4l2: Get rid of ->vidioc_enum_fmt_vid_{cap,out}_mplane
Date: Tue, 4 Jun 2019 09:11:02 +0200 [thread overview]
Message-ID: <20190604091102.4a820e09@collabora.com> (raw)
In-Reply-To: <71e2f8b2-db8e-68da-f627-86b22e5a0d39@xs4all.nl>
On Tue, 4 Jun 2019 09:02:56 +0200
Hans Verkuil <hverkuil@xs4all.nl> wrote:
> On 6/3/19 3:58 PM, Boris Brezillon wrote:
> > Support for multiplanar and singleplanar formats is mutually exclusive,
> > at least in practice. In our attempt to unify support for support for
> > mplane and !mplane in v4l, let's get rid of the
> > ->vidioc_enum_fmt_{vid,out}_cap_mplane() hooks and call
> > ->vidioc_enum_fmt_{vid,out}_cap() instead.
> >
> > Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
> > ---
> > Changes in v5:
> > - None
> >
> > Changes in v4:
> > - None
> >
> > Changes in v3:
> > - Send this patch separately (was previously part of the EXT_BUF/FMT
> > rework)
> >
> > Changes in v2:
> > - None
> > ---
> > drivers/media/pci/intel/ipu3/ipu3-cio2.c | 2 +-
> > drivers/media/platform/exynos-gsc/gsc-core.c | 2 +-
> > drivers/media/platform/exynos-gsc/gsc-core.h | 2 +-
> > drivers/media/platform/exynos-gsc/gsc-m2m.c | 10 ++++-----
> > .../media/platform/exynos4-is/fimc-capture.c | 6 +++---
> > .../platform/exynos4-is/fimc-isp-video.c | 6 +++---
> > drivers/media/platform/exynos4-is/fimc-lite.c | 6 +++---
> > drivers/media/platform/exynos4-is/fimc-m2m.c | 8 +++----
> > .../media/platform/mtk-jpeg/mtk_jpeg_core.c | 4 ++--
> > drivers/media/platform/mtk-mdp/mtk_mdp_m2m.c | 18 ++++++++--------
> > .../platform/mtk-vcodec/mtk_vcodec_dec.c | 12 +++++------
> > .../platform/mtk-vcodec/mtk_vcodec_enc.c | 12 +++++------
> > .../media/platform/qcom/camss/camss-video.c | 2 +-
> > drivers/media/platform/qcom/venus/vdec.c | 4 ++--
> > drivers/media/platform/qcom/venus/venc.c | 4 ++--
> > drivers/media/platform/rcar_fdp1.c | 4 ++--
> > drivers/media/platform/rcar_jpu.c | 4 ++--
> > drivers/media/platform/renesas-ceu.c | 2 +-
> > drivers/media/platform/s5p-mfc/s5p_mfc_dec.c | 12 +++++------
> > drivers/media/platform/s5p-mfc/s5p_mfc_enc.c | 12 +++++------
> > drivers/media/platform/ti-vpe/vpe.c | 4 ++--
> > drivers/media/platform/vicodec/vicodec-core.c | 2 --
> > drivers/media/platform/vivid/vivid-core.c | 6 ++----
> > .../media/platform/vivid/vivid-vid-common.c | 20 ------------------
> > .../media/platform/vivid/vivid-vid-common.h | 2 --
> > drivers/media/v4l2-core/v4l2-dev.c | 2 --
> > drivers/media/v4l2-core/v4l2-ioctl.c | 21 ++++++++++---------
> > drivers/staging/media/ipu3/ipu3-v4l2.c | 4 ++--
> > .../media/rockchip/vpu/rockchip_vpu_v4l2.c | 12 +++++------
> > include/media/v4l2-ioctl.h | 14 ++-----------
> > 30 files changed, 91 insertions(+), 128 deletions(-)
> >
>
> <snip>
>
> > diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c b/drivers/media/v4l2-core/v4l2-ioctl.c
> > index 0fbee3caef5d..3768eb012cef 100644
> > --- a/drivers/media/v4l2-core/v4l2-ioctl.c
> > +++ b/drivers/media/v4l2-core/v4l2-ioctl.c
> > @@ -1382,6 +1382,7 @@ static void v4l_fill_fmtdesc(struct v4l2_fmtdesc *fmt)
> > static int v4l_enum_fmt(const struct v4l2_ioctl_ops *ops,
> > struct file *file, void *fh, void *arg)
> > {
> > + struct video_device *vdev = video_devdata(file);
> > struct v4l2_fmtdesc *p = arg;
> > int ret = check_fmt(file, p->type);
> >
> > @@ -1391,30 +1392,30 @@ static int v4l_enum_fmt(const struct v4l2_ioctl_ops *ops,
> >
> > switch (p->type) {
> > case V4L2_BUF_TYPE_VIDEO_CAPTURE:
> > + case V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE:
> > + if (!!(vdev->device_caps & V4L2_CAP_VIDEO_CAPTURE_MPLANE) !=
> > + p->type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE)
> > + break;
> > +
> > if (unlikely(!ops->vidioc_enum_fmt_vid_cap))
> > break;
> > ret = ops->vidioc_enum_fmt_vid_cap(file, fh, arg);
> > break;
> > - case V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE:
> > - if (unlikely(!ops->vidioc_enum_fmt_vid_cap_mplane))
> > - break;
> > - ret = ops->vidioc_enum_fmt_vid_cap_mplane(file, fh, arg);
> > - break;
>
> We got kbuild test robot complaints about this. The new check is a bit
> complicated, and I propose we do this instead:
>
> case V4L2_BUF_TYPE_VIDEO_CAPTURE:
> if (!(vdev->device_caps & V4L2_CAP_VIDEO_CAPTURE_MPLANE) &&
> ops->vidioc_enum_fmt_vid_cap)
> ret = ops->vidioc_enum_fmt_vid_cap(file, fh, arg);
> break;
> case V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE:
> if ((vdev->device_caps & V4L2_CAP_VIDEO_CAPTURE_MPLANE) &&
> ops->vidioc_enum_fmt_vid_cap)
> ret = ops->vidioc_enum_fmt_vid_cap(file, fh, arg);
> break;
>
More on that matter: it happened because I blindly fixed a warning
reported by checkpatch --strict saying that parens were useless here.
Looks like checkpatch was wrong :-/.
prev parent reply other threads:[~2019-06-04 7:11 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-03 13:58 [PATCH v5 1/2] media: v4l2: Make sure all drivers set _MPLANE caps in vdev->device_caps Boris Brezillon
2019-06-03 13:58 ` [PATCH v5 2/2] media: v4l2: Get rid of ->vidioc_enum_fmt_vid_{cap,out}_mplane Boris Brezillon
2019-06-04 0:24 ` kbuild test robot
2019-06-04 0:50 ` kbuild test robot
2019-06-04 7:02 ` Hans Verkuil
2019-06-04 7:04 ` Boris Brezillon
2019-06-04 7:11 ` Boris Brezillon [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=20190604091102.4a820e09@collabora.com \
--to=boris.brezillon@collabora.com \
--cc=hans.verkuil@cisco.com \
--cc=hiroh@chromium.org \
--cc=hverkuil@xs4all.nl \
--cc=kernel@collabora.com \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=nicolas@ndufresne.ca \
--cc=s.nawrocki@samsung.com \
--cc=sakari.ailus@iki.fi \
--cc=tfiga@chromium.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).