mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Ricardo Ribalda <ribalda@chromium.org>
Cc: Hans Verkuil <hverkuil@xs4all.nl>,
	Hans de Goede <hdegoede@redhat.com>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	Sakari Ailus <sakari.ailus@linux.intel.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Linus Walleij <linus.walleij@linaro.org>,
	Bartosz Golaszewski <brgl@bgdev.pl>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	Len Brown <lenb@kernel.org>,
	linux-media@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-usb@vger.kernel.org, devicetree@vger.kernel.org,
	linux-gpio@vger.kernel.org, linux-acpi@vger.kernel.org
Subject: Re: [PATCH v2 12/12] media: uvcvideo: Do not create MC entities for virtual entities
Date: Mon, 14 Jul 2025 17:36:17 +0300	[thread overview]
Message-ID: <20250714143617.GK8243@pendragon.ideasonboard.com> (raw)
In-Reply-To: <CANiDSCtq0cr1LgFCgvdBtWcE3z1MWZEjc0e1wTH_BYPETC+s4Q@mail.gmail.com>

On Tue, Jul 08, 2025 at 08:28:21AM +0200, Ricardo Ribalda wrote:
> On Tue, 1 Jul 2025 at 13:20, Ricardo Ribalda wrote:
> > On Sun, 29 Jun 2025 at 20:06, Laurent Pinchart wrote:
> > > Hi Ricardo,
> > >
> > > Thank you for the patch.
> > >
> > > I would use "software entities" and not "virtual entities" in the
> > > subject line and everywhere else, as those entities are not virtual.
> > >
> > > On Thu, Jun 05, 2025 at 05:53:05PM +0000, Ricardo Ribalda wrote:
> > > > Neither the GPIO nor the SWENTITY entities form part of the device
> > > > pipeline. We just create them to hold emulated uvc controls.
> > > >
> > > > When the device initializes, a warning is thrown by the v4l2 core:
> > > > uvcvideo 1-1:1.0: Entity type for entity SWENTITY was not initialized!
> > > >
> > > > There are no entity function that matches what we are doing here, and
> > > > it does not make to much sense to create a function for entities that
> > > > do not really exist.
> > >
> > > I don't agree with this. The purpose of reporting entities to userspace
> > > through the MC API is to let application enumerate what entities a
> > > device contains. Being able to enumerate software entities seems as
> > > useful as being able to enumerate hardware entities.
> >
> > What function shall we use in this case? Nothing here seems to match a
> > software entity
> > https://www.kernel.org/doc/html/latest/userspace-api/media/mediactl/media-types.html
> >
> > Any suggestion for name?
> > Shall we just live with the warning in dmesg?
> 
>  I just realised that if/when we move to the control framework, the
> software entity will be gone.... So to avoid introducing a uAPI change
> that will be reverted later I think that we should keep this patch.

You know my opinion about moving to the control framework, so that's not
a very compelling argument :-)

We could use MEDIA_ENT_F_PROC_VIDEO_PIXEL_FORMATTER, as that's the
function already used by XUs, and the SWENTITY fulfills the same role as
XUs in some devices.

> > > > Do not create MC entities for them and pretend nothing happened here.
> > > >
> > > > Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
> > > > ---
> > > >  drivers/media/usb/uvc/uvc_entity.c | 10 ++++++++++
> > > >  1 file changed, 10 insertions(+)
> > > >
> > > > diff --git a/drivers/media/usb/uvc/uvc_entity.c b/drivers/media/usb/uvc/uvc_entity.c
> > > > index d1a652ef35ec34801bd39a5124b834edf838a79e..2dbeb4ab0c4c8cc763ff2dcd2d836a50f3c6a040 100644
> > > > --- a/drivers/media/usb/uvc/uvc_entity.c
> > > > +++ b/drivers/media/usb/uvc/uvc_entity.c
> > > > @@ -72,6 +72,16 @@ static int uvc_mc_init_entity(struct uvc_video_chain *chain,
> > > >  {
> > > >       int ret;
> > > >
> > > > +     /*
> > > > +      * Do not initialize virtual entities, they do not really exist
> > > > +      * and are not connected to any other entities.
> > > > +      */
> > > > +     switch (UVC_ENTITY_TYPE(entity)) {
> > > > +     case UVC_EXT_GPIO_UNIT:
> > > > +     case UVC_SWENTITY_UNIT:
> > > > +             return 0;
> > > > +     }
> > > > +
> > > >       if (UVC_ENTITY_TYPE(entity) != UVC_TT_STREAMING) {
> > > >               u32 function;
> > > >

-- 
Regards,

Laurent Pinchart

  reply	other threads:[~2025-07-14 14:36 UTC|newest]

Thread overview: 65+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-05 17:52 [PATCH v2 00/12] media: uvcvideo: Add support for orientation and rotation Ricardo Ribalda
2025-06-05 17:52 ` [PATCH v2 01/12] media: uvcvideo: Always set default_value Ricardo Ribalda
2025-06-29 17:39   ` Laurent Pinchart
2025-07-14 13:00   ` Hans de Goede
2025-06-05 17:52 ` [PATCH v2 02/12] media: v4l: fwnode: Support ACPI's _PLD for v4l2_fwnode_device_parse Ricardo Ribalda
2025-06-29  9:21   ` Sakari Ailus
2025-07-01  9:04     ` Ricardo Ribalda
2025-07-07 21:01       ` Sakari Ailus
2025-07-14 13:03   ` Hans de Goede
2025-07-14 14:14     ` Ricardo Ribalda
2025-06-05 17:52 ` [PATCH v2 03/12] ACPI: mipi-disco-img: Do not duplicate rotation info into swnodes Ricardo Ribalda
2025-06-29  9:24   ` Sakari Ailus
2025-07-07 21:05   ` Sakari Ailus
2025-07-14 13:08   ` Hans de Goede
2025-06-05 17:52 ` [PATCH v2 04/12] media: ipu-bridge: Use v4l2_fwnode_device_parse helper Ricardo Ribalda
2025-06-06  4:27   ` kernel test robot
2025-07-14 13:11   ` Hans de Goede
2025-06-05 17:52 ` [PATCH v2 05/12] media: ipu-bridge: Use v4l2_fwnode for unknown rotations Ricardo Ribalda
2025-07-07 21:44   ` Sakari Ailus
2025-07-08  9:16     ` Ricardo Ribalda
2025-07-08  9:22       ` Sakari Ailus
2025-07-08 12:09         ` Ricardo Ribalda
2025-07-08 12:20           ` Sakari Ailus
2025-07-08 14:58             ` Ricardo Ribalda
2025-07-08 23:46               ` Sakari Ailus
2025-07-14 13:11               ` Hans de Goede
2025-06-05 17:52 ` [PATCH v2 06/12] dt-bindings: usb: usb-device: Add orientation and rotation Ricardo Ribalda
2025-06-25 18:56   ` Rob Herring
2025-06-05 17:53 ` [PATCH v2 07/12] media: uvcvideo: Make uvc_alloc_entity non static Ricardo Ribalda
2025-06-29 17:43   ` Laurent Pinchart
2025-07-14 13:31   ` Hans de Goede
2025-06-05 17:53 ` [PATCH v2 08/12] media: uvcvideo: Add support for V4L2_CID_CAMERA_ORIENTATION Ricardo Ribalda
2025-06-29 17:50   ` Laurent Pinchart
2025-07-01  9:22     ` Ricardo Ribalda
2025-07-14 14:15       ` Hans de Goede
2025-07-14 14:23       ` Laurent Pinchart
2025-07-14 14:36   ` Hans de Goede
2025-06-05 17:53 ` [PATCH v2 09/12] media: uvcvideo: Add uvc_ctrl_query_entity helper Ricardo Ribalda
2025-06-29 18:01   ` Laurent Pinchart
2025-07-14 14:24   ` Hans de Goede
2025-07-14 15:51     ` Ricardo Ribalda
2025-06-05 17:53 ` [PATCH v2 10/12] media: uvcvideo: Add get_* functions to uvc_entity Ricardo Ribalda
2025-06-29 18:12   ` Laurent Pinchart
2025-07-01 11:13     ` Ricardo Ribalda
2025-07-14 14:28       ` Hans de Goede
2025-07-14 14:29       ` Laurent Pinchart
2025-07-14 15:46         ` Ricardo Ribalda
2025-07-15 19:35           ` Laurent Pinchart
2025-07-16 10:32             ` Ricardo Ribalda
2025-08-07  7:35               ` Ricardo Ribalda
2025-09-08 10:13                 ` Laurent Pinchart
2025-09-08 11:17                   ` Hans Verkuil
2025-09-08 11:31               ` Hans de Goede
2025-06-05 17:53 ` [PATCH v2 11/12] media: uvcvideo: Add support for V4L2_CID_CAMERA_ROTATION Ricardo Ribalda
2025-06-29 18:14   ` Laurent Pinchart
2025-07-01 11:26     ` Ricardo Ribalda
2025-07-14 14:31       ` Laurent Pinchart
2025-07-14 15:59         ` Ricardo Ribalda
2025-06-05 17:53 ` [PATCH v2 12/12] media: uvcvideo: Do not create MC entities for virtual entities Ricardo Ribalda
2025-06-29 18:05   ` Laurent Pinchart
2025-07-01 11:20     ` Ricardo Ribalda
2025-07-08  6:28       ` Ricardo Ribalda
2025-07-14 14:36         ` Laurent Pinchart [this message]
2025-07-14 16:04           ` Ricardo Ribalda
2025-07-14 16:30             ` Laurent Pinchart

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=20250714143617.GK8243@pendragon.ideasonboard.com \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=brgl@bgdev.pl \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=hdegoede@redhat.com \
    --cc=hverkuil@xs4all.nl \
    --cc=krzk+dt@kernel.org \
    --cc=lenb@kernel.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=rafael@kernel.org \
    --cc=ribalda@chromium.org \
    --cc=robh@kernel.org \
    --cc=sakari.ailus@linux.intel.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

all inboxes | Powered by JetHome®