All of lore.kernel.org
 help / color / mirror / Atom feed
* Uncached buffers from CMA DMA heap on some Arm devices?
@ 2024-01-24 18:27 Milan Zamazal
  2024-01-25 11:41 ` Lucas Stach
  0 siblings, 1 reply; 11+ messages in thread
From: Milan Zamazal @ 2024-01-24 18:27 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: iommu, Will Deacon, catalin.marinas, Bryan O'Donoghue,
	Andrey Konovalov, Pavel Machek, Maxime Ripard, Laurent Pinchart,
	kieran.bingham, Hans de Goede

Hello,

in the libcamera project, we experience a major performance problem related to
DMA buffers while working on camera image processing using CPU.  This happens
only with some Arm boards, we have observed it on Debix Model A (NXP i.MX 8M
Plus) and PinePhone.  We use /dev/dma_heap/linux,cma (or reserved) DMA buffer
heap on Arm.

Reading V4L2 camera data from buffers is very slow.  When we memcpy the data
from the buffer to a malloc'ed memory before working with it (reading each byte
multiple times, without any big non-sequential jumps across the data), we get
more than 10 times speed up.  It looks like the input buffer is uncached.

We experience slow down also when writing to output buffers.  It doesn't seem to
matter whether we write to the output byte-by-byte or memcpy larger chunks.

We are having trouble to understand what's the problem with the buffers on some
hardware and what we can realistically do about it.  Could you please help us
clarify this?  Is it possible to force the DMA buffer CMA heap to be cached?
Or is there anything else we can do or try?

Thank you,
Milan


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2024-01-29 18:30 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-24 18:27 Uncached buffers from CMA DMA heap on some Arm devices? Milan Zamazal
2024-01-25 11:41 ` Lucas Stach
2024-01-26 11:22   ` Milan Zamazal
2024-01-26 12:19     ` Maxime Ripard
2024-01-26 12:17   ` Maxime Ripard
2024-01-29 12:05     ` Laurent Pinchart
2024-01-29 10:23   ` Pavel Machek
2024-01-29 10:32     ` Maxime Ripard
2024-01-29 12:07       ` Laurent Pinchart
2024-01-29 13:12         ` Lucas Stach
2024-01-29 18:30       ` Pavel Machek

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.