Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dma heap changes. #574

Merged
merged 3 commits into from
Oct 4, 2023
Merged

Dma heap changes. #574

merged 3 commits into from
Oct 4, 2023

Conversation

naushir
Copy link
Collaborator

@naushir naushir commented Oct 4, 2023

No description provided.

@naushir
Copy link
Collaborator Author

naushir commented Oct 4, 2023

@davidplowman

core/dma_heaps.hpp Outdated Show resolved Hide resolved
core/dma_heaps.cpp Outdated Show resolved Hide resolved
core/dma_heaps.hpp Outdated Show resolved Hide resolved
Add a dma heap allocator class that will be used to allocate framebuffers
instead of using V4L2 to allocate them.

Signed-off-by: Naushir Patuck <[email protected]>
Switch to using the dma heap allocator for all libcamera framebuffers
that will be used in requests.

Signed-off-by: Naushir Patuck <[email protected]>
With the dma heap allocator, we need to carefully handle CPU coherency
with the framebuffers.  To do this, add two helper classes,
BufferReadSync and BufferWriteSync that need to be constructed when
accessing a buffer for read or write respectively.  This replaces the
existing LibcameraApp::Mmap() function.

Note that for simplicity, when a request is complete, we mark the buffer
read coherent automatically until the buffer is re-sent back in a future
request.  This makes the function of BufferReadSync mostly a no-op.

Signed-off-by: Naushir Patuck <[email protected]>
@davidplowman
Copy link
Collaborator

My other questions notwithstanding, I'm happy merge whenever you want. Perhaps we should also patch up the style checker complaints? Otherwise they might haunt us forever...!

@naushir naushir merged commit 57949d5 into main Oct 4, 2023
8 of 9 checks passed
@naushir naushir deleted the dma_heap branch October 4, 2023 12:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants