linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* DMA-BUFs always uncached on arm64, causing poor camera performance on Librem 5
@ 2025-07-10  8:24 Pavel Machek
  2025-07-10  8:42 ` Lucas Stach
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Pavel Machek @ 2025-07-10  8:24 UTC (permalink / raw)
  To: kraxel, vivek.kasireddy, dri-devel, sumit.semwal,
	benjamin.gaignard, Brian.Starkey, jstultz, tjmercier, linux-media,
	linaro-mm-sig, kernel list, laurent.pinchart, l.stach,
	linux+etnaviv, christian.gmeiner, etnaviv, phone-devel

[-- Attachment #1: Type: text/plain, Size: 1315 bytes --]

Hi!

It seems that DMA-BUFs are always uncached on arm64... which is a
problem.

I'm trying to get useful camera support on Librem 5, and that includes
recording vidos (and taking photos).

memcpy() from normal memory is about 2msec/1MB. Unfortunately, for
DMA-BUFs it is 20msec/1MB, and that basically means I can't easily do
760p video recording. Plus, copying full-resolution photo buffer takes
more than 200msec!

There's possibility to do some processing on GPU, and its implemented here:

https://gitlab.com/tui/tui/-/tree/master/icam?ref_type=heads

but that hits the same problem in the end -- data is in DMA-BUF,
uncached, and takes way too long to copy out.

And that's ... wrong. DMA ended seconds ago, complete cache flush
would be way cheaper than copying single frame out, and I still have
to deal with uncached frames.

So I have two questions:

1) Is my analysis correct that, no matter how I get frame from v4l and
process it on GPU, I'll have to copy it from uncached memory in the
end?

2) Does anyone have patches / ideas / roadmap how to solve that? It
makes GPU unusable for computing, and camera basically unusable for
video.

Best regards,
								Pavel
-- 
I don't work for Nazis and criminals, and neither should you.
Boycott Putin, Trump, and Musk!

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

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

end of thread, other threads:[~2025-07-13 20:00 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-10  8:24 DMA-BUFs always uncached on arm64, causing poor camera performance on Librem 5 Pavel Machek
2025-07-10  8:42 ` Lucas Stach
2025-07-10  8:49   ` Pavel Machek
2025-07-10 21:52     ` Laurent Pinchart
2025-07-10 16:01 ` Nicolas Dufresne
2025-07-13 19:54 ` Mikhail Rudenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).