mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
To: Kieran Bingham <kbingham@kernel.org>
Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org,
	laurent.pinchart@ideasonboard.com,
	Olivier BRAUN <olivier.braun@stereolabs.com>,
	kieran.bingham@ideasonboard.com,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	Jaejoong Kim <climbbb.kim@gmail.com>,
	Baoyou Xie <baoyou.xie@linaro.org>,
	Hans Verkuil <hans.verkuil@cisco.com>,
	Aviv Greenberg <avivgr@gmail.com>,
	Nicolas Dufresne <nicolas.dufresne@collabora.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Daniel Patrick Johnson <teknotus@teknot.us>,
	Jim Lin <jilin@nvidia.com>
Subject: Re: [RFC/RFT PATCH 1/6] uvcvideo: Refactor URB descriptors
Date: Thu, 4 Jan 2018 19:24:04 +0100 (CET)	[thread overview]
Message-ID: <alpine.DEB.2.20.1801041607070.13441@axis700.grange> (raw)
In-Reply-To: <cac2db68616f9855ceb5a57786f1ee8631b9df79.1515010476.git-series.kieran.bingham@ideasonboard.com>

Hi Kieran,

Just minor suggestions below:

On Wed, 3 Jan 2018, Kieran Bingham wrote:

> From: Kieran Bingham <kieran.bingham@ideasonboard.com>
> 
> We currently store three separate arrays for each URB reference we hold.
> 
> Objectify the data needed to track URBs into a single uvc_urb structure,
> allowing better object management and tracking of the URB.
> 
> All accesses to the data pointers through stream, are converted to use a
> uvc_urb pointer for consistency.
> 
> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> ---
>  drivers/media/usb/uvc/uvc_video.c | 46 ++++++++++++++++++++------------
>  drivers/media/usb/uvc/uvcvideo.h  | 18 ++++++++++---
>  2 files changed, 44 insertions(+), 20 deletions(-)

[snip]

> diff --git a/drivers/media/usb/uvc/uvcvideo.h b/drivers/media/usb/uvc/uvcvideo.h
> index 19e725e2bda5..4afa8ce13ea7 100644
> --- a/drivers/media/usb/uvc/uvcvideo.h
> +++ b/drivers/media/usb/uvc/uvcvideo.h
> @@ -479,6 +479,20 @@ struct uvc_stats_stream {
>  	unsigned int max_sof;		/* Maximum STC.SOF value */
>  };
>  
> +/**
> + * struct uvc_urb - URB context management structure
> + *
> + * @urb: described URB. Must be allocated with usb_alloc_urb()

Didn't you mean "describes?"

> + * @urb_buffer: memory storage for the URB
> + * @urb_dma: DMA coherent addressing for the urb_buffer

The whole struct describes URBs, so, I wouldn't repeat that in these two 
field names, I'd just call them "buffer" and "dma." OTOH, later you add 
more fields like "stream," which aren't per-URB, so, maybe you want to 
keep these prefixes.

Thanks
Guennadi

> + */
> +struct uvc_urb {
> +	struct urb *urb;
> +
> +	char *urb_buffer;
> +	dma_addr_t urb_dma;
> +};
> +
>  struct uvc_streaming {
>  	struct list_head list;
>  	struct uvc_device *dev;
> @@ -521,9 +535,7 @@ struct uvc_streaming {
>  		__u32 max_payload_size;
>  	} bulk;
>  
> -	struct urb *urb[UVC_URBS];
> -	char *urb_buffer[UVC_URBS];
> -	dma_addr_t urb_dma[UVC_URBS];
> +	struct uvc_urb uvc_urb[UVC_URBS];
>  	unsigned int urb_size;
>  
>  	__u32 sequence;
> -- 
> git-series 0.9.1
> 

  reply	other threads:[~2018-01-04 18:25 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-03 20:32 [RFC/RFT PATCH 0/6] Asynchronous UVC Kieran Bingham
2018-01-03 20:32 ` [RFC/RFT PATCH 1/6] uvcvideo: Refactor URB descriptors Kieran Bingham
2018-01-04 18:24   ` Guennadi Liakhovetski [this message]
2018-01-06 18:30     ` Kieran Bingham
2018-01-03 20:32 ` [RFC/RFT PATCH 2/6] uvcvideo: Convert decode functions to use new context structure Kieran Bingham
2018-01-03 20:32 ` [RFC/RFT PATCH 3/6] uvcvideo: Protect queue internals with helper Kieran Bingham
2018-01-04 18:25   ` Guennadi Liakhovetski
2018-01-06 18:37     ` Kieran Bingham
2018-01-03 20:32 ` [RFC/RFT PATCH 4/6] uvcvideo: queue: Simplify spin-lock usage Kieran Bingham
2018-01-03 20:32 ` [RFC/RFT PATCH 5/6] uvcvideo: queue: Support asynchronous buffer handling Kieran Bingham
2018-01-03 20:32 ` [RFC/RFT PATCH 6/6] uvcvideo: Move decode processing to process context Kieran Bingham
2018-01-04 18:54   ` Guennadi Liakhovetski
2018-01-06 18:29     ` Kieran Bingham
2018-01-03 21:13 ` [RFC/RFT PATCH 0/6] Asynchronous UVC Troy Kisky
2018-01-04 10:25   ` Kieran Bingham
2018-06-05  9:01   ` Kieran Bingham
2018-06-05 19:18     ` Troy Kisky

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=alpine.DEB.2.20.1801041607070.13441@axis700.grange \
    --to=g.liakhovetski@gmx.de \
    --cc=avivgr@gmail.com \
    --cc=baoyou.xie@linaro.org \
    --cc=climbbb.kim@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=hans.verkuil@cisco.com \
    --cc=jilin@nvidia.com \
    --cc=kbingham@kernel.org \
    --cc=kieran.bingham@ideasonboard.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=nicolas.dufresne@collabora.com \
    --cc=olivier.braun@stereolabs.com \
    --cc=teknotus@teknot.us \
    /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®