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

Endianness and layout of driver/device exchange structures #6

Open
Gnurou opened this issue May 14, 2024 · 2 comments
Open

Endianness and layout of driver/device exchange structures #6

Gnurou opened this issue May 14, 2024 · 2 comments

Comments

@Gnurou
Copy link
Collaborator

Gnurou commented May 14, 2024

Right now there is no decided endianness or architecture decided for the representation of the V4L2 structures used on virtqueues.

Architecture is rather obvious, 64-bit V4L2 headers should be used.

Endianness is less obvious. Converting endianness in structures requires quite some boilerplate. Maybe we can have the guest decide which endianness to use?

In any case, it looks like we might need to define our own set of V4L2 structures with the desired layout, both in C and Rust.

@Gnurou
Copy link
Collaborator Author

Gnurou commented Oct 18, 2024

On the device side, we should be able to partially address the issue if we build v4l2r in 64-bit mode (i.e. ask it to generate 64-bit headers). We can then maybe use some macros (or better, and existing crate) to handle endianness.

@Gnurou
Copy link
Collaborator Author

Gnurou commented Oct 18, 2024

Addressing this will also require the proxy V4L2 device to use different versions of the V4L2 structures for doing its own ioctls. We might want to turn it into its own crate and make it depend on a different build of v4l2r.

Since the virtio-media v4l2r bindings will be compiled with the 64-bit layout, it's probably a good idea to rename or alias them using the vmedia_ prefix instead of v4l2_.

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

No branches or pull requests

1 participant