Ricardo Ribalda
20e1dbf2bb
media: uvcvideo: Use dma_alloc_noncontiguous API
On architectures where there is no coherent caching such as ARM use the
dma_alloc_noncontiguous API and handle manually the cache flushing using
dma_sync_sgtable().
If the architechture has coherent cache, the API falls back to
alloc_dma_pages, so we can remove the coherent caching code-path from the
driver, making it simpler.
With this patch on the affected architectures we can measure up to 20x
performance improvement in uvc_video_copy_data_work().
Eg: aarch64 with an external usb camera
NON_CONTIGUOUS
frames: 999
packets: 999
empty: 0 (0 %)
errors: 0
invalid: 0
pts: 0 early, 0 initial, 999 ok
scr: 0 count ok, 0 diff ok
sof: 2048 <= sof <= 0, freq 0.000 kHz
bytes 67034480 : duration 33303
FPS: 29.99
URB: 523446/4993 uS/qty: 104.836 avg 132.532 std 13.230 min 831.094 max (uS)
header: 76564/4993 uS/qty: 15.334 avg 15.229 std 3.438 min 186.875 max (uS)
latency: 468945/4992 uS/qty: 93.939 avg 132.577 std 9.531 min 824.010 max (uS)
decode: 54161/4993 uS/qty: 10.847 avg 6.313 std 1.614 min 111.458 max (uS)
raw decode speed: 9.931 Gbits/s
raw URB handling speed: 1.025 Gbits/s
throughput: 16.102 Mbits/s
URB decode CPU usage 0.162600 %
COHERENT
frames: 999
packets: 999
empty: 0 (0 %)
errors: 0
invalid: 0
pts: 0 early, 0 initial, 999 ok
scr: 0 count ok, 0 diff ok
sof: 2048 <= sof <= 0, freq 0.000 kHz
bytes 54683536 : duration 33302
FPS: 29.99
URB: 1478135/4000 uS/qty: 369.533 avg 390.357 std 22.968 min 3337.865 max (uS)
header: 79761/4000 uS/qty: 19.940 avg 18.495 std 1.875 min 336.719 max (uS)
latency: 281077/4000 uS/qty: 70.269 avg 83.102 std 5.104 min 735.000 max (uS)
decode: 1197057/4000 uS/qty: 299.264 avg 318.080 std 1.615 min 2806.667 max (uS)
raw decode speed: 365.470 Mbits/s
raw URB handling speed: 295.986 Mbits/s
throughput: 13.136 Mbits/s
URB decode CPU usage 3.594500 %
In non-affected architectures we see no significant impact.
Eg: x86 with an external usb camera
NON_CONTIGUOUS
frames: 999
packets: 999
empty: 0 (0 %)
errors: 0
invalid: 0
pts: 0 early, 0 initial, 999 ok
scr: 0 count ok, 0 diff ok
sof: 2048 <= sof <= 0, freq 0.000 kHz
bytes 70179056 : duration 33301
FPS: 29.99
URB: 288901/4897 uS/qty: 58.995 avg 26.022 std 4.319 min 253.853 max (uS)
header: 54792/4897 uS/qty: 11.189 avg 6.218 std 0.620 min 61.750 max (uS)
latency: 236602/4897 uS/qty: 48.315 avg 24.244 std 1.764 min 240.924 max (uS)
decode: 52298/4897 uS/qty: 10.679 avg 8.299 std 1.638 min 108.861 max (uS)
raw decode speed: 10.796 Gbits/s
raw URB handling speed: 1.949 Gbits/s
throughput: 16.859 Mbits/s
URB decode CPU usage 0.157000 %
COHERENT
frames: 999
packets: 999
empty: 0 (0 %)
errors: 0
invalid: 0
pts: 0 early, 0 initial, 999 ok
scr: 0 count ok, 0 diff ok
sof: 2048 <= sof <= 0, freq 0.000 kHz
bytes 71818320 : duration 33301
FPS: 29.99
URB: 321021/5000 uS/qty: 64.204 avg 23.001 std 10.430 min 268.837 max (uS)
header: 54308/5000 uS/qty: 10.861 avg 5.104 std 0.778 min 54.736 max (uS)
latency: 268799/5000 uS/qty: 53.759 avg 21.827 std 6.095 min 255.153 max (uS)
decode: 52222/5000 uS/qty: 10.444 avg 7.137 std 1.874 min 71.103 max (uS)
raw decode speed: 11.048 Gbits/s
raw URB handling speed: 1.789 Gbits/s
throughput: 17.253 Mbits/s
URB decode CPU usage 0.156800 %
Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Tomasz Figa <tfiga@chromium.org>
Signed-off-by: Christoph Hellwig <hch@lst.de>
2021-03-19 14:13:13 +01:00
..
2021-02-24 10:25:37 -08:00
2021-02-25 12:03:13 -08:00
2021-03-08 15:16:30 -08:00
2021-02-26 09:41:03 -08:00
2021-03-10 15:25:02 +01:00
2021-03-14 12:23:34 -07:00
2021-02-20 21:28:04 -08:00
2021-02-24 10:25:37 -08:00
2021-03-07 13:24:44 -08:00
2021-02-26 10:28:35 -08:00
2021-02-22 14:11:36 -08:00
2021-03-08 16:20:07 +05:30
2021-03-02 22:41:23 +11:00
2021-02-22 14:44:39 -08:00
2021-02-27 08:07:12 -08:00
2021-02-15 17:02:04 +01:00
2021-02-23 15:05:10 -08:00
2021-02-24 21:05:28 +05:30
2021-02-15 10:06:58 +01:00
2021-02-09 12:16:20 +01:00
2021-03-14 12:54:56 -07:00
2021-03-08 11:59:17 +01:00
2021-03-13 11:27:30 -08:00
2021-02-23 14:52:22 -08:00
2021-02-26 09:41:00 -08:00
2021-02-22 10:05:12 -08:00
2021-02-09 11:36:50 -06:00
2021-02-22 14:27:07 -08:00
2021-02-26 11:47:42 +01:00
2021-02-22 09:52:55 -08:00
2021-02-28 15:48:25 -08:00
2021-02-22 09:39:11 -08:00
2021-03-05 14:15:22 -04:00
2021-02-23 14:56:23 -08:00
2021-03-15 10:02:32 +01:00
2021-02-09 09:48:23 +01:00
2021-03-09 08:45:17 +00:00
2021-03-10 09:27:56 +01:00
2021-02-14 21:27:24 -07:00
2021-02-22 13:34:27 -06:00
2021-03-12 13:25:49 -08:00
2021-03-19 14:13:13 +01:00
2021-02-24 10:25:37 -08:00
2021-02-24 10:35:29 -08:00
2021-03-13 12:38:44 -08:00
2021-03-09 10:00:52 +01:00
2021-02-21 13:57:08 -08:00
2021-03-09 17:15:56 -08:00
2021-02-24 10:25:37 -08:00
2021-02-23 14:12:53 -06:00
2021-02-24 09:35:54 -08:00
2021-03-12 13:17:45 -07:00
2021-02-05 11:25:52 +01:00
2021-02-24 10:25:37 -08:00
2021-03-12 09:26:52 +05:30
2021-03-12 11:34:36 -08:00
2021-02-26 13:54:43 -08:00
2021-03-12 11:30:31 +00:00
2021-02-10 10:39:23 +01:00
2021-02-26 10:28:35 -08:00
2021-02-25 12:03:13 -08:00
2021-03-01 17:43:29 +01:00
2021-02-17 13:49:26 -08:00
2021-02-25 12:23:49 -08:00
2021-03-11 13:23:21 +00:00
2021-02-11 12:52:18 -06:00
2021-02-26 10:28:35 -08:00
2021-02-27 08:07:12 -08:00
2021-03-12 13:25:49 -08:00
2021-03-12 13:37:18 -08:00
2021-02-26 14:16:06 -08:00
2021-03-02 15:33:00 +01:00
2021-02-22 14:34:00 -08:00
2021-02-12 12:26:46 +01:00
2021-03-10 09:23:30 +01:00
2021-02-28 11:51:20 -08:00
2021-02-09 16:10:49 +01:00
2021-02-22 09:39:11 -08:00
2021-02-09 13:00:07 +01:00
2021-03-13 12:34:29 -08:00
2021-02-09 12:25:32 +01:00
2021-03-13 12:32:57 -08:00
2021-02-23 07:52:59 -05:00
2021-02-24 10:43:40 -08:00
2021-02-25 12:21:08 -08:00
2021-03-11 11:11:32 +01:00
2021-03-10 16:59:50 +01:00
2021-02-26 09:50:09 -08:00
2021-02-09 12:15:07 +01:00
2021-02-24 10:25:37 -08:00
2021-03-12 11:34:36 -08:00
2021-02-16 20:36:38 -08:00
2021-02-24 10:35:29 -08:00