Re: [PATCH 1/1] usb: gadget/uvc: Add support to allocate UVC payload and header as SG elements

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Laurent,

On 5/1/2013 3:53 AM, Laurent Pinchart wrote:
Hi Bhupesh,

On Wednesday 01 May 2013 01:08:23 Bhupesh SHARMA wrote:
On 4/29/2013 8:08 PM, Laurent Pinchart wrote:
On Wednesday 17 April 2013 09:44:25 Bhupesh Sharma wrote:
This patch adds the support in UVC webcam gadget to allocate UVC header
and payload as Scatter-Gather elements which can be used on a SG-capable
UDC controller.

A module parameter has been introduced for the same. One can set the
module parameter 'sg_mode' to 1 to turn on this feature (by default this
feature is turned-off).

This ensures that we don't require a memcpy from CPU side to append UVC
header in front of the UVC payload atleast for SG capable UDC contollers.

Signed-off-by: Bhupesh Sharma <bhupesh.sharma@xxxxxx>
---
Note that to ease review and integration of this patch, I have rebased it
on the following patch already circulated for review last week:

[PATCH 1/1] usb: gadget/uvc: Add support for Bulk endpoint to be used as

                               Video Streaming ep

http://www.mail-archive.com/linux-usb@xxxxxxxxxxxxxxx/msg19546.html

The above patch was rebased on Laurent's UVC gadget git tree available
here (head uvc-gadget):
git://linuxtv.org/pinchartl/uvcvideo.git

This will allow the patches to be pulled into Felipe's repo in one go
after review and any subsequent rework (if required).

   drivers/usb/gadget/f_uvc.c     |    8 +++
   drivers/usb/gadget/uvc.h       |    2 +
   drivers/usb/gadget/uvc_video.c |  113 ++++++++++++++++++++++++++++-----
   3 files changed, 109 insertions(+), 14 deletions(-)

diff --git a/drivers/usb/gadget/f_uvc.c b/drivers/usb/gadget/f_uvc.c
index e5953eb..ccf0253 100644
--- a/drivers/usb/gadget/f_uvc.c
+++ b/drivers/usb/gadget/f_uvc.c
@@ -50,6 +50,11 @@ module_param(bulk_streaming_ep, bool,
S_IRUGO|S_IWUSR);

   MODULE_PARM_DESC(bulk_streaming_ep, "0 (Use ISOC video streaming ep) /
   "

   					"1 (Use BULK video streaming ep)");

+static bool sg_mode;
+module_param(sg_mode, bool, S_IRUGO|S_IWUSR);
+MODULE_PARM_DESC(sg_mode, "0 (Don't use SG feature) / "
+			"1 (Use scatterlist for SG-capable controllers)");
+

Can't this be queried automatically from the UDC at runtime ?

Yes, it can be. But I believe its better to still provide a module
parameter to the UVC webcam module user as some UDCs may have flaky SG
implementations in H/W and then the user will not be able to use the
UVC gadget without using the SG feature of SG-capable UDCs.

I believe in worst-case its better to fall-back on memcpy from CPU if
the SG features in the UDC are not yet properly supported.

In that case could we default to use SG with UDCs that support it, and have a
module parameter to disable SG ?


Ok. Let me implement something on these lines and I will soon send out a V2.

Regards,
Bhupesh
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux