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

Platform Device improvements and Timer abstraction #982

Open
wants to merge 5 commits into
base: rust
Choose a base branch
from

Conversation

mairacanal
Copy link

Hi folks,

This PR is a collection of some abstractions that I wrote while developing the VGEM driver in Rust. So, they are dependencies of the driver itself. The complete driver can be seen in this PR, which is rebased on top of Lina's DRM abstractions branch. Also, there is a blog post describing a bit more of the idea of the project.

Unfortunately, this PR cannot be rebased on top of rust-next, because it depends on the Platform Device abstraction. As this is my first time writing safe abstractions, I would like to hear your feedback on the abstractions, especially the Timer abstraction.

Thanks for your attention!

Currently, platform device holds only a pointer, which is safe to be
used from any thread. This is useful for devices that are not probed,
such as virtual devices.

Signed-off-by: Maíra Canal <mcanal@igalia.com>
Allows drivers to directly allocate and register a device. Although this
style of driver is discouraged, it is useful for virtual devices that
cannot be probed. Also, handles the deallocation of a registered device
through the Drop trait.

Signed-off-by: Maíra Canal <mcanal@igalia.com>
Allows drivers to configure the DMA masks for a device, dealing with the
case where the device does not have dev->dma_mask appropriately setup.
Implemented here, not in device, because it requires a mutable platform
device reference.

Signed-off-by: Maíra Canal <mcanal@igalia.com>
Create an abstraction to allow Rust drivers to open a new devres group for
the device with a defined id. Moreover, implement the related Drop trait
to release the devres group.

Signed-off-by: Maíra Canal <mcanal@igalia.com>
Timers are used in the kernel to allow drivers to call callbacks after a
given time. So, add an abstraction to allow Rust drivers to interact
with this subsystem.

Signed-off-by: Maíra Canal <mcanal@igalia.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant