Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751264AbdH1JmE (ORCPT ); Mon, 28 Aug 2017 05:42:04 -0400 Received: from lb3-smtp-cloud7.xs4all.net ([194.109.24.31]:32910 "EHLO lb3-smtp-cloud7.xs4all.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750825AbdH1JmC (ORCPT ); Mon, 28 Aug 2017 05:42:02 -0400 Subject: Re: [PATCH v4 6/7] media: videodev2: add a flag for MC-centric devices To: Mauro Carvalho Chehab , Linux Doc Mailing List , Linux Media Mailing List References: <638ed268ca84c5e8ea810a2c27e397ab7e90585b.1503747774.git.mchehab@s-opensource.com> Cc: Mauro Carvalho Chehab , linux-kernel@vger.kernel.org, Jonathan Corbet , Hans Verkuil , Laurent Pinchart , Sakari Ailus From: Hans Verkuil Message-ID: <7c8a51f6-92b7-0262-9a41-7eb28234638f@xs4all.nl> Date: Mon, 28 Aug 2017 11:41:58 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.1 MIME-Version: 1.0 In-Reply-To: <638ed268ca84c5e8ea810a2c27e397ab7e90585b.1503747774.git.mchehab@s-opensource.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-CMAE-Envelope: MS4wfL+aD8A4EZ0U2JDeTMrmFbuhFBGXvK6/Y4+qmfr/+AZzZCFtDdDDeBIUrd18oVF+veCemrkjlOePcjsIfo/DXmDrLFuALgibXTtWHtxkW/nvprNzBcrc t3MN4wqroAtCGuc6ny3XTOv2VeAnjkkG88JrBbG76F4GfEY71YS9L5FazY0OpGox7UdMukowXDYUu5XXD1XShKqizHIvLuB2aLMivp/SRPe2KK98YBfZUNWx 07zw7JnP+8AE/2TFxjFn/EyFTxF9bNvfOxDOFQJhj4jD+l8jlZEs5FOGyFOx5L1iNIG5Ep+cRIj0mA1ZiBhXhOCzGszELpDC/83N4zhAvbFiVmAUbzldJIEp z7VuQZbs4OtdykrZcyjV4dSEGk+nrBL8lWBoGG0HrvGbxadpkOi/ZGdUuLoOkMPlrr1d5EqCUaB47LUfhkvXJVsS1OF6LyW0GfPwvtp/H8rb4wsBulrS06p3 mRVunj8Mrr3cvmvh Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3657 Lines: 95 On 26/08/17 13:53, Mauro Carvalho Chehab wrote: > As both vdev-centric and MC-centric devices may implement the > same APIs, we need a flag to allow userspace to distinguish > between them. > > Signed-off-by: Mauro Carvalho Chehab > --- > Documentation/media/uapi/v4l/open.rst | 7 +++++++ > Documentation/media/uapi/v4l/vidioc-querycap.rst | 5 +++++ > Documentation/media/videodev2.h.rst.exceptions | 1 + > include/uapi/linux/videodev2.h | 2 ++ > 4 files changed, 15 insertions(+) > > diff --git a/Documentation/media/uapi/v4l/open.rst b/Documentation/media/uapi/v4l/open.rst > index 64b1de047b1b..d0930fc170f0 100644 > --- a/Documentation/media/uapi/v4l/open.rst > +++ b/Documentation/media/uapi/v4l/open.rst > @@ -46,6 +46,13 @@ the periferal can be used. For such devices, the sub-devices' configuration > can be controlled via the :ref:`sub-device API `, which creates one > device node per sub-device. > > +.. attention:: > + > + Devices that require **mc-centric** hardware peripheral control should MC-centric As mentioned in my review of a previous patch I dislike the term "peripheral". I think it should be dropped here. > + report a ``V4L2_MC_CENTRIC`` :c:type:`v4l2_capability` flag > + (see :ref:`VIDIOC_QUERYCAP`). > + > + > In summary, for **MC-centric** hardware peripheral control: > > - The **V4L2 device** node is responsible for controlling the streaming > diff --git a/Documentation/media/uapi/v4l/vidioc-querycap.rst b/Documentation/media/uapi/v4l/vidioc-querycap.rst > index 12e0d9a63cd8..2b08723375bc 100644 > --- a/Documentation/media/uapi/v4l/vidioc-querycap.rst > +++ b/Documentation/media/uapi/v4l/vidioc-querycap.rst > @@ -252,6 +252,11 @@ specification the ioctl returns an ``EINVAL`` error code. > * - ``V4L2_CAP_TOUCH`` > - 0x10000000 > - This is a touch device. > + * - ``V4L2_MC_CENTRIC`` > + - 0x20000000 > + - Indicates that the device require **mc-centric** hardware MC-centric > + control, and thus can't be used by **v4l2-centric** applications. vdev-centric TBD: I still think I prefer V4L2-centric over vdev-centric. > + See :ref:`v4l2_hardware_control` for more details. > * - ``V4L2_CAP_DEVICE_CAPS`` > - 0x80000000 > - The driver fills the ``device_caps`` field. This capability can > diff --git a/Documentation/media/videodev2.h.rst.exceptions b/Documentation/media/videodev2.h.rst.exceptions > index a5cb0a8686ac..b51a575f9f75 100644 > --- a/Documentation/media/videodev2.h.rst.exceptions > +++ b/Documentation/media/videodev2.h.rst.exceptions > @@ -157,6 +157,7 @@ replace define V4L2_CAP_META_CAPTURE device-capabilities > replace define V4L2_CAP_READWRITE device-capabilities > replace define V4L2_CAP_ASYNCIO device-capabilities > replace define V4L2_CAP_STREAMING device-capabilities > +replace define V4L2_CAP_MC_CENTRIC device-capabilities > replace define V4L2_CAP_DEVICE_CAPS device-capabilities > replace define V4L2_CAP_TOUCH device-capabilities > > diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h > index 45cf7359822c..7b490fe97980 100644 > --- a/include/uapi/linux/videodev2.h > +++ b/include/uapi/linux/videodev2.h > @@ -460,6 +460,8 @@ struct v4l2_capability { > > #define V4L2_CAP_TOUCH 0x10000000 /* Is a touch device */ > > +#define V4L2_CAP_MC_CENTRIC 0x20000000 /* Device require mc-centric hardware control */ requires MC-centric > + > #define V4L2_CAP_DEVICE_CAPS 0x80000000 /* sets device capabilities field */ > > /* > Regards, Hans