-
- Downloads
WIP: rust: drm/kms: Add drm_crtc bindings
This introduces basic bindings for DRM CRTCs which follow the same general
pattern as connectors and planes (e.g. AsRawCrtc, AsRawCrtcState, etc.).
There is one big difference though - drm_crtc_state appears to be the one
atomic state that actually has data which can be mutated from outside of
the atomic commit phase - which means we can't keep rust referencs to it,
and instead need to use the Opaque type and implement things through
pointers instead.
This should be the last mode object we're introducing for the time being
with its own atomic state. Note that we've not added bindings for private
modesetting objects yet, but I don't think those will be needed for rvkms -
and the same general patterns we're using here should work for adding
private modesetting objects.
Signed-off-by:
Lyude Paul <lyude@redhat.com>
---
TODO:
* Add commit data in the future
V3:
* Add safety comments for ModeObject implementation
* Make AsRawCrtc unsafe, as we need a guarantee that `as_raw()` will always
return a pointer to a valid `drm_crtc`.
* Update safety comments in atomic_duplicate_state_callback
* Rename generics in Crtc::new to PrimaryData and CursorData
* Add missing safety comment in Crtc::new()
* Improve safety comments in AsRawCrtc
* Break up the conversion from Pin<Box<Crtc>> to &Crtc a bit
* Document why there's an UnsafeCell in CrtcState, because even I forgot
the reason for this :).
* Introduce UnregisteredCrtc type
* Don't have AsRawCrtc be a supertrait of StaticModeObject. We don't want
Unregistered mode object variants to be able to return a pointer to the
DRM device since that would break the UnregisteredKmsDevice pattern.
rust/kernel/drm/kms/crtc.rs
0 → 100644
This diff is collapsed.
Please register or sign in to comment