[media] media: Fix a UVC performance problem on systems with non-coherent DMA
authorAl Cooper <alcooperx@gmail.com>
Thu, 18 Aug 2011 13:28:29 +0000 (10:28 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Fri, 23 Sep 2011 23:07:47 +0000 (20:07 -0300)
commit3e0ac6717b0a2593243ef3850025a42cb199880f
tree24726342cb2e85848eb0d24e9a34f4c645773706
parent227bd5b3539a50290ec48b90c42c40cc7ae27191
[media] media: Fix a UVC performance problem on systems with non-coherent DMA

The UVC driver uses usb_alloc_coherent() to allocate DMA data buffers.
On systems without coherent DMA this ends up allocating buffers in
uncached memory. The subsequent memcpy's done to coalesce the DMA
chunks into contiguous buffers then run VERY slowly. On a MIPS test
system the memcpy is about 200 times slower. This issue prevents the
system from keeping up with 720p YUYV data at 10fps.

The following patch uses kmalloc to alloc the DMA buffers instead of
usb_alloc_coherent on systems without coherent DMA. With this patch
the system was easily able to keep up with 720p at 10fps.

Signed-off-by: Al Cooper <alcooperx@gmail.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/video/uvc/uvc_video.c