From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Philipp Zabel <p.zabel@pengutronix.de>
Cc: Steve Longerbeam <slongerbeam@gmail.com>,
linux-media@vger.kernel.org, Rui Miguel Silva <rmfrfs@gmail.com>,
Ezequiel Garcia <ezequiel@collabora.com>
Subject: Re: [PATCH 20/75] media: imx: capture: Rename ioctl operations with legacy prefix
Date: Sat, 9 Jan 2021 03:09:45 +0200 [thread overview]
Message-ID: <X/kCWdynMK8w4sV+@pendragon.ideasonboard.com> (raw)
In-Reply-To: <fbf3aaa4454f2ada8f7b8f5e8b990a4e66577427.camel@pengutronix.de>
Hi Philipp,
On Thu, Jan 07, 2021 at 11:52:33AM +0100, Philipp Zabel wrote:
> On Wed, 2021-01-06 at 09:51 -0800, Steve Longerbeam wrote:
> > Hi Laurent,
> >
> > I guess I have fallen behind the times with v4l2, but I wasn't aware
> > that the /dev/video nodes and VIDIOC_* APIs are now considered legacy!
>
> I don't think Laurent considers the video node legacy, just the fact
> that the current implementation looks at the subdev source pad's active
> format in ENUM_FRAMESIZES and ENUM_/G/S/TRY_FMT.
Correct. The legacy part here is control of the source subdev through
the video node. It should instead be handled with the media controller
API. The DMA engine side is still handled through the video node, and
that's totally fine.
> I see the behavior of VIDIOC_ENUM_FMT was extended/defined for MC-
> centric devices last year, to allow enumerating all pixel formats or
> filter pixel formats for a given mbus format:
>
> e5b6b07a1b45 ("media: v4l2: Extend VIDIOC_ENUM_FMT to support MC-centric devices")
> cfe9e707c564 ("media: open.rst: document mc-centric and video-node-centric")
>
> > On 1/5/21 7:27 AM, Laurent Pinchart wrote:
> > > The i.MX media drivers implement a legacy video node API, where the
> > > format of the video node is influenced by the active format of the
> > > connected subdev (both for enumeration and for the get, set and try
> > > format ioctls), and where controls exposed by the subdevs in the
> > > pipeline are inherited by the video node.
>
> But I don't quite understand why G/S/TRY_FMT should not respect the
> connected subdev source pad's active format. Should MC-centric devices
> allow to set non-working configurations and only error out on stream
> start? Is this documented?
It's the currently recommended practice, but I'm not sure it's
documented.
There are multiple issues here. One of them is that we could limit
VIDIOC_S_FMT to formats compatible with the connected source subdev with
minimum complexity in the implementation, but the source subdev could
then see its configuration being changed by userspace, and updating the
format on the video node automatically would be not only more difficult,
but potentially confusing for userspace as formats are not supposed to
change automatically. For this reason, we need to validate the full
pipeline at stream on time in any case, and restricting the format
ioctls on the video node to the active configuration of the connected
subdev would thus not be that useful.
Another issue is that we've had cases in the past where it was useful
for userspace to configure the video node with a format not matching the
connected subdev, with the subdev configuration later being changed to
match the video node, before starting the stream. I'm not sure if this
use case is still valid today though.
> The current "legacy" vb2_ops check the subdev in ENUM_FRAMESIZES and
> ENUM_FRAMEINTERVALS, and in TRY_FMT/S_FMT to determine format and
> possible interlacing options. If the MC-centric ops just drop that,
> there is no way to determine which interlacing combinations are actually
> supported.
Could you elaborate a little bit here ? We don't have an API to
explicitly enumerate supported interlacing types. This can be done by
calling VIDIOC_TRY_FMT with all field types and see which ones are
supported. You can still do so with the MC-based API, the video node
will return from VIDIOC_TRY_FMT the interlacing types intrinsicly
supported by the video node, and you can query from the source subdev
the interlacing types supported by the source. Userspace can then
combine the information to find what is supported. In this case, with a
source producing V4L2_FIELD_SEQ_TB, and the video node not reporting
V4L2_FIELD_SEQ_TB but reporting V4L2_FIELD_INTERLACED_TB, wouldn't the
application be able to know that V4L2_FIELD_INTERLACED_TB will work ?
--
Regards,
Laurent Pinchart
next prev parent reply other threads:[~2021-01-09 1:10 UTC|newest]
Thread overview: 121+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-05 15:27 [PATCH 00/75] media: imx: Miscellaneous fixes and cleanups for i.MX7 Laurent Pinchart
2021-01-05 15:27 ` [PATCH 01/75] media: imx: Drop dependency on I2C Laurent Pinchart
2021-01-06 14:21 ` Philipp Zabel
2021-01-05 15:27 ` [PATCH 02/75] media: imx: Move dependency on VIDEO_DEV to common Kconfig symbol Laurent Pinchart
2021-01-06 14:21 ` Philipp Zabel
2021-01-05 15:27 ` [PATCH 03/75] media: imx: Drop manual dependency on VIDEO_IMX_MEDIA Laurent Pinchart
2021-01-06 14:22 ` Philipp Zabel
2021-01-05 15:27 ` [PATCH 04/75] media: imx: Move IMX_IPUV3_CORE dependency to VIDEO_IMX_CSI Laurent Pinchart
2021-01-06 14:24 ` Philipp Zabel
2021-01-06 15:42 ` Laurent Pinchart
2021-01-05 15:27 ` [PATCH 05/75] media: imx: Compile imx6-media-objs only for CONFIG_VIDEO_IMX_CSI Laurent Pinchart
2021-01-08 17:42 ` Ezequiel Garcia
2021-01-08 17:47 ` Laurent Pinchart
2021-01-08 18:05 ` Ezequiel Garcia
2021-01-05 15:27 ` [PATCH 06/75] media: imx: Set default sizes through macros in all drivers Laurent Pinchart
2021-01-05 15:27 ` [PATCH 07/75] media: imx: utils: Add ability to filter pixel formats by mbus code Laurent Pinchart
2021-01-05 15:27 ` [PATCH 08/75] media: imx: capture: Use dev_* instead of v4l2_* to log messages Laurent Pinchart
2021-01-06 14:25 ` Philipp Zabel
2021-01-05 15:27 ` [PATCH 09/75] media: imx: capture: Use device name to construct bus_info Laurent Pinchart
2021-01-06 14:26 ` Philipp Zabel
2021-01-05 15:27 ` [PATCH 10/75] media: imx: capture: Remove forward declaration of capture_qops Laurent Pinchart
2021-01-06 14:26 ` Philipp Zabel
2021-01-05 15:27 ` [PATCH 11/75] media: imx: capture: Handle errors from v4l2_fh_open() Laurent Pinchart
2021-01-06 14:27 ` Philipp Zabel
2021-01-05 15:27 ` [PATCH 12/75] media: imx: capture: Clean up capture_priv structure Laurent Pinchart
2021-01-05 15:27 ` [PATCH 13/75] media: imx: capture: Remove capture_priv stop field Laurent Pinchart
2021-01-06 14:29 ` Philipp Zabel
2021-01-05 15:27 ` [PATCH 14/75] media: imx: capture: Move queue and ctrl handler init to init function Laurent Pinchart
2021-01-06 14:30 ` Philipp Zabel
2021-01-05 15:27 ` [PATCH 15/75] media: imx: capture: Initialize video_device programmatically Laurent Pinchart
2021-01-06 14:31 ` Philipp Zabel
2021-01-05 15:27 ` [PATCH 16/75] media: imx: capture: Register the video device after completing init Laurent Pinchart
2021-01-05 15:27 ` [PATCH 17/75] media: imx: capture: Store v4l2_pix_format in imx_media_video_dev Laurent Pinchart
2021-01-06 14:33 ` Philipp Zabel
2021-01-05 15:27 ` [PATCH 18/75] media: imx: capture: Move default format init to a separate function Laurent Pinchart
2021-01-05 15:27 ` [PATCH 19/75] media: imx: capture: Rename querycap handler to capture_querycap Laurent Pinchart
2021-01-06 17:45 ` Steve Longerbeam
2021-01-05 15:27 ` [PATCH 20/75] media: imx: capture: Rename ioctl operations with legacy prefix Laurent Pinchart
2021-01-06 17:51 ` Steve Longerbeam
2021-01-07 10:52 ` Philipp Zabel
2021-01-08 0:03 ` Fabio Estevam
2021-01-09 1:09 ` Laurent Pinchart [this message]
2021-01-11 8:40 ` Philipp Zabel
2021-02-14 21:33 ` Laurent Pinchart
2021-01-05 15:27 ` [PATCH 21/75] media: imx: capture: Add a mechanism to disable control inheritance Laurent Pinchart
2021-01-05 15:27 ` [PATCH 22/75] media: imx: capture: Remove unneeded variable in __capture_legacy_try_fmt Laurent Pinchart
2021-01-06 17:55 ` Steve Longerbeam
2021-01-05 15:28 ` [PATCH 23/75] media: imx: capture: Pass v4l2_pix_format to __capture_legacy_try_fmt() Laurent Pinchart
2021-01-06 17:57 ` Steve Longerbeam
2021-01-05 15:28 ` [PATCH 24/75] media: imx: capture: Return -EPIPE from __capture_legacy_try_fmt() Laurent Pinchart
2021-01-05 15:28 ` [PATCH 25/75] media: imx: capture: Extract format lookup from __capture_legacy_try_fmt Laurent Pinchart
2021-01-05 15:28 ` [PATCH 26/75] media: imx: capture: Simplify capture_validate_fmt() implementation Laurent Pinchart
2021-01-05 15:28 ` [PATCH 27/75] media: imx: capture: Simplify __capture_legacy_try_fmt() Laurent Pinchart
2021-01-06 17:59 ` Steve Longerbeam
2021-01-05 15:28 ` [PATCH 28/75] media: imx: capture: Decouple video node from source with MC-centric API Laurent Pinchart
2021-01-05 15:28 ` [PATCH 29/75] media: imx: capture: Expose V4L2_CAP_IO_MC for the " Laurent Pinchart
2021-01-05 15:28 ` [PATCH 30/75] media: imx: imx7-media-csi: Disable legacy video node API Laurent Pinchart
2021-01-05 15:28 ` [PATCH 31/75] media: imx: capture: Support creating immutable link to capture device Laurent Pinchart
2021-01-06 17:44 ` Steve Longerbeam
2021-01-09 0:41 ` Laurent Pinchart
2021-01-08 17:37 ` Ezequiel Garcia
2021-01-09 0:48 ` Laurent Pinchart
2021-01-05 15:28 ` [PATCH 32/75] media: imx: imx7-media-csi: Remove control handler Laurent Pinchart
2021-01-05 15:28 ` [PATCH 33/75] media: imx: imx7-media-csi: Move (de)init from link setup to .s_stream() Laurent Pinchart
2021-01-05 15:28 ` [PATCH 34/75] media: imx: imx7-media-csi: Create immutable link to capture device Laurent Pinchart
2021-01-05 15:28 ` [PATCH 35/75] media: imx: imx7-media-csi: Replace CSICR*_RESET_VAL with values Laurent Pinchart
2021-01-05 15:28 ` [PATCH 36/75] media: imx: imx7-media-csi: Tidy up register fields macros Laurent Pinchart
2021-01-05 15:28 ` [PATCH 37/75] media: imx: imx7-media-csi: Reorganize code in sections Laurent Pinchart
2021-01-05 15:28 ` [PATCH 38/75] media: imx: imx7-media-csi: Validate capture format in .link_validate() Laurent Pinchart
2021-01-05 15:28 ` [PATCH 39/75] media: imx: imx7-media-csi: Rename imx7_csi_dma_start() to *_setup() Laurent Pinchart
2021-01-05 15:28 ` [PATCH 40/75] media: imx: imx7-media-csi: Split imx7_csi_dma_stop() Laurent Pinchart
2021-01-05 15:28 ` [PATCH 41/75] media: imx: imx7-media-csi: Move CSI configuration before source start Laurent Pinchart
2021-01-05 15:28 ` [PATCH 42/75] media: imx: imx7-media-csi: Merge streaming_start() with csi_enable() Laurent Pinchart
2021-01-05 15:28 ` [PATCH 43/75] media: imx: imx7-media-csi: Merge hw_reset() with init_interface() Laurent Pinchart
2021-01-05 15:28 ` [PATCH 44/75] media: imx: imx7-media-csi: Set the MIPI data type based on the bus code Laurent Pinchart
2021-01-05 15:28 ` [PATCH 45/75] media: imx: imx7-media-csi: Don't set the buffer stride when disabling Laurent Pinchart
2021-01-05 15:28 ` [PATCH 46/75] media: imx: imx7-media-csi: Merge all config in imx7_csi_configure() Laurent Pinchart
2021-01-05 15:28 ` [PATCH 47/75] media: imx: imx7-media-csi: Clear all configurable CSICR18 fields Laurent Pinchart
2021-01-05 15:28 ` [PATCH 48/75] media: imx: imx7-media-csi: Set RFF burst type in imx7_csi_configure() Laurent Pinchart
2021-01-05 15:28 ` [PATCH 49/75] media: imx: imx7-media-csi: Simplify imx7_csi_rx_fifo_clear() Laurent Pinchart
2021-01-05 15:28 ` [PATCH 50/75] media: imx: imx7-media-csi: Don't double-enable the CSI Laurent Pinchart
2021-01-05 15:28 ` [PATCH 51/75] media: imx: imx7-media-csi: Don't double-enable the RxFIFO Laurent Pinchart
2021-01-05 15:28 ` [PATCH 52/75] media: imx: imx7-media-csi: Remove double reflash of DMA controller Laurent Pinchart
2021-01-05 15:28 ` [PATCH 53/75] media: imx: imx7-media-csi: Don't enable SOF and EOF interrupts Laurent Pinchart
2021-01-05 15:28 ` [PATCH 54/75] media: imx: imx7_media-csi: Add support for additional Bayer patterns Laurent Pinchart
2021-01-05 15:28 ` [PATCH 55/75] media: v4l2-mc: Add link flags to v4l2_create_fwnode_links_to_pad() Laurent Pinchart
2021-01-05 15:28 ` [PATCH 56/75] media: imx: imx7_media-csi: Create immutable link to source device Laurent Pinchart
2021-01-05 15:28 ` [PATCH 57/75] dt-bindings: media: Convert i.MX7 MIPI CSI-2 receiver binding to YAML Laurent Pinchart
2021-01-05 15:43 ` Laurent Pinchart
2021-01-05 15:28 ` [PATCH 58/75] dt-bindings: media: fsl,imx7-mipi-csi2: Drop the reset-names property Laurent Pinchart
2021-01-05 15:28 ` [PATCH 59/75] dt-bindings: media: fsl,imx7-mipi-csi2: Drop fsl,csis-hs-settle property Laurent Pinchart
2021-01-06 22:49 ` Sakari Ailus
2021-01-06 22:53 ` Sakari Ailus
2021-01-05 15:28 ` [PATCH 60/75] media: imx: imx7_mipi_csis: Acquire reset control without naming it Laurent Pinchart
2021-01-05 15:28 ` [PATCH 61/75] media: imx: imx7_mipi_csis: Fix input size alignment Laurent Pinchart
2021-01-05 15:28 ` [PATCH 62/75] media: imx: imx7_mipi_csis: Make source .s_power() optional Laurent Pinchart
2021-01-05 15:28 ` [PATCH 63/75] media: imx: imx7_mipi_csis: Avoid double get of wrap clock Laurent Pinchart
2021-01-05 15:28 ` [PATCH 64/75] media: imx: imx7_mipi_csis: Drop 10-bit YUV support Laurent Pinchart
2021-01-05 15:28 ` [PATCH 65/75] media: imx: imx7_mipi_csis: Fix UYVY8 media bus format Laurent Pinchart
2021-01-05 15:28 ` [PATCH 66/75] media: imx: imx7_mipi_csis: Inline mipi_csis_set_hsync_settle() Laurent Pinchart
2021-01-05 15:28 ` [PATCH 67/75] media: imx: imx7_mipi_csis: Move link setup check out of locked section Laurent Pinchart
2021-01-05 15:28 ` [PATCH 68/75] media: imx: imx7_mipi_csis: Calculate Ths_settle from source pixel rate Laurent Pinchart
2021-01-06 22:59 ` Sakari Ailus
2021-01-09 0:52 ` Laurent Pinchart
2021-01-11 9:39 ` Rui Miguel Silva
2021-01-05 15:28 ` [PATCH 69/75] media: imx: imx7_mipi_csis: Turn register access macros into functions Laurent Pinchart
2021-01-05 15:28 ` [PATCH 70/75] media: imx: imx7_mipi_csis: Fully initialize MIPI_CSIS_DPHYCTRL register Laurent Pinchart
2021-01-05 15:28 ` [PATCH 71/75] media: imx: imx7_mipi_csis: Define macros for DPHY_BCTRL_L fields Laurent Pinchart
2021-01-05 15:28 ` [PATCH 72/75] media: imx: imx7_mipi_csis: Make ISP registers macros take channel ID Laurent Pinchart
2021-01-05 15:28 ` [PATCH 73/75] media: imx: imx7_mipi_csis: Rename register macros to match datasheet Laurent Pinchart
2021-01-05 15:28 ` [PATCH 74/75] media: imx: imx7_mipi_csis: Use register macros in mipi_csis_dump_regs() Laurent Pinchart
2021-01-05 15:28 ` [PATCH 75/75] media: imx: imx7_mipi_csis: Print shadow registers " Laurent Pinchart
2021-01-05 17:45 ` [PATCH 00/75] media: imx: Miscellaneous fixes and cleanups for i.MX7 Fabio Estevam
2021-01-05 19:00 ` Fabio Estevam
2021-01-06 15:41 ` Laurent Pinchart
2021-01-06 21:10 ` Fabio Estevam
2021-01-09 1:10 ` Laurent Pinchart
2021-01-09 1:47 ` Fabio Estevam
2021-02-15 0:23 ` Laurent Pinchart
2021-01-05 19:29 ` Rui Miguel Silva
2021-01-11 9:53 ` Rui Miguel Silva
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=X/kCWdynMK8w4sV+@pendragon.ideasonboard.com \
--to=laurent.pinchart@ideasonboard.com \
--cc=ezequiel@collabora.com \
--cc=linux-media@vger.kernel.org \
--cc=p.zabel@pengutronix.de \
--cc=rmfrfs@gmail.com \
--cc=slongerbeam@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox