All of lore.kernel.org
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Stephan Lachowsky <stephan.lachowsky@maxim-ic.com>
Cc: martin_rubli@logitech.com,
	"linux-media@vger.kernel.org" <linux-media@vger.kernel.org>
Subject: Re: [PATCH 1/5] uvcvideo: Add UVCIOC_CTRL_QUERY ioctl
Date: Mon, 7 Feb 2011 13:40:17 +0100	[thread overview]
Message-ID: <201102071340.18268.laurent.pinchart@ideasonboard.com> (raw)
In-Reply-To: <1296500724.17673.72.camel@svmlwks101>

Hi Stephan,

On Monday 31 January 2011 20:05:24 Stephan Lachowsky wrote:
> On Fri, 2011-01-07 at 08:00 -0800, Laurent Pinchart wrote:
> > From: Martin Rubli <martin_rubli@logitech.com>
> > 
> > This ioctl extends UVCIOC_CTRL_GET/SET by not only allowing to get/set
> > XU controls but to also send arbitrary UVC commands to XU controls,
> > namely GET_CUR, SET_CUR, GET_MIN, GET_MAX, GET_RES, GET_LEN, GET_INFO
> > and GET_DEF. This is required for applications to work with XU controls,
> > so that they can properly query the size and allocate the necessary
> > buffers.
> > 
> > Signed-off-by: Martin Rubli <martin_rubli@logitech.com>
> > Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> 
> I think that this is a great improvement to the existing ioctls, but I'd
> like some feedback on the vacuum around bUnitID.  The XU descriptor
> basically associates a unique address (bUnitID) with a specific
> extension unit (guidExtensionCode).  It is the GUID that specifies the
> semantics of the control, and bUnitID simply provides routing to a
> specific instance.
> 
> Now, the ioctls as currently implemented are very flexible, but I feel
> that there should be some mechanism for discovering the bUnitID(s)
> associated with a specific guidExtensionCode.  Currently there is no way
> to do this: you must either dead reckon the bUnitID value, or parse the
> USB descriptors in user space to come up with the value needed for
> UVCIOC_CTRL_GET/SET/QUERY (UVCIOC_CTRL_MAP matches on the GUID, which
> makes bUnitID opaque to the user).
> 
> I think this functionality has been missed in the dynctrl ioctls since
> their inception.  As UVC XU controls are standardized it is inevitable
> that different vendors will implement the same control with different
> bUnitID values.  I propose that we add something along the lines of
> UVCIOC_CTRL_ENUM to enumerate through the XUs so that userspace can
> simply discover the guidExtensionCode <-> bUnitID mappings that exist on
> the specific device (or any other type of XU reporting they wish).
> 
> I would be willing to implement the patch provided I get some feedback
> that this functionality belongs in the driver.  We had implemented
> something similar prior to just using to UVCIOC_CTRL_MAP'ings.

My current plan is to use the media controller API for this. All UVC entities 
would be mapped to media controller entities, and a new ioctl (not available 
yet) will be used to retrieve driver-specific entity details.

-- 
Regards,

Laurent Pinchart

  reply	other threads:[~2011-02-07 12:40 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-07 16:00 [PATCH 0/5] Make the UVC API public Laurent Pinchart
2011-01-07 16:00 ` [PATCH 1/5] uvcvideo: Add UVCIOC_CTRL_QUERY ioctl Laurent Pinchart
2011-01-31 19:05   ` Stephan Lachowsky
2011-02-07 12:40     ` Laurent Pinchart [this message]
2011-01-07 16:00 ` [PATCH 2/5] uvcvideo: Deprecate UVCIOC_CTRL_{ADD,MAP_OLD,GET,SET} Laurent Pinchart
2011-01-07 16:00 ` [PATCH 3/5] uvcvideo: Rename UVC_CONTROL_* flags to UVC_CTRL_FLAG_* Laurent Pinchart
2011-01-07 16:00 ` [PATCH 4/5] uvcvideo: Include linux/types.h in uvcvideo.h Laurent Pinchart
2011-01-07 16:00 ` [PATCH 5/5] uvcvideo: Move uvcvideo.h to include/linux 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=201102071340.18268.laurent.pinchart@ideasonboard.com \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=linux-media@vger.kernel.org \
    --cc=martin_rubli@logitech.com \
    --cc=stephan.lachowsky@maxim-ic.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.