On Tue, Aug 09, 2011 at 01:59:19PM -0400, Alan Stern wrote: > On Tue, 9 Aug 2011, Sarah Sharp wrote: > > > On Tue, Aug 09, 2011 at 08:48:42AM +0200, Laurent Pinchart wrote: > > > Hi Sarah, > > > > > > On Tuesday 09 August 2011 02:30:33 Sarah Sharp wrote: > > > > On Tue, Aug 09, 2011 at 12:29:33AM +0200, Laurent Pinchart wrote: > > > > > On Tuesday 09 August 2011 00:18:02 Sarah Sharp wrote: > > > > So is the header something the UVC video driver allocates, or something > > > > userspace allocates? Is the header, jpeg header, and data all confined > > > > to one frame (one usb_iso_packet_descriptor in the URB)? > > > > > > > > Scatter gather list entries can be variable length, so I don't really > > > > see where the problem is, as long as the uvcvideo driver knows how long > > > > the header for that particular frame is supposed to be. You'd just have > > > > one scatterlist per frame, with either two or three entries (I don't > > > > know if userspace passes the jpeg header and data as one buffer) that > > > > you would re-setup every time an URB completes. > > > > > > > > Of course, I don't know if the trade off in size of having a scatterlist > > > > per frame vs. the performance gain of avoiding the memcopy would be a > > > > good choice. But I do think it's feasible. > > It's not clear to me that this would help at all. If the data can be > copied from the buffer directly to userspace, skipping over the header, > then using a scatterlist wouldn't reduce the number of copies. Not > unless some sort of zerocopy direct-I/O thing were implemented. Yes, true. I've been wondering for a while whether usbfs could benefit from some similar scatter-gather and pin user pages approach for zerocopy, so I was testing the waters to see if it could be applied to uvcvideo as well. Sarah Sharp -- 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