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

Feature/custom userptr allocator to take into account special hardware-aligment requirements for some v4l devices #103

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

molysgaard
Copy link

@molysgaard molysgaard commented Jun 21, 2024

Hi there.

When using the userptr io-mode for V4L, the v4l driver can have special alignment requirements for the buffers that are given to it.
I hit this limitation by experimenting with the V4L2 drivers for CSI cameras on Nvidia Tegra devices.

This PR tries to allow for specifying custom allocators for the crate in a backward compatible way, and I thought it would be nice to contribute it back to upstream.
If there are any things you would like different, or require changes, please don't hesitate to mention it.

I was unsure where to base this change on, so I based it on the last released version of the crate. I see that main has moved since then.

Regards Morten

This is usefull for devices where there are specific alignment
requirements of the memory being written to by the V4L subsystem.
One example where this is the case is the CSI-camera support Nvidia Tegra devices.
@raymanfx
Copy link
Owner

raymanfx commented Aug 8, 2024

Hi, sorry for the delayed response. I agree something along these lines is needed for the cases you mention. Though I think I would prefer a less invasive approach - let the user provide the memory. The library should provide the memory constraints (e.g. size, caching etc) and take in memory provided by the application.

This mandates a minor re-architecture that I'm working on at the moment. There have been attempts in the past, but I never got around to finish the work and release it. Let's see whether it can be done this time without being drowned in other real-life events (or vacation ..)

@molysgaard
Copy link
Author

Hi. Yeah, letting the client application supply the memory is a better overall architecture. The reason my MR is as it is is that I was afraid to create a large architectural change.
I would be very happy if you are able to pull off such a change!

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