@@ -28,6 +28,7 @@
use super::{
ModeObject,
RcModeObject,
+ encoder::*,
KmsDriver,
};
use macros::pin_data;
@@ -227,6 +228,20 @@ pub fn new(
ARef::from_raw(NonNull::new_unchecked(Box::into_raw(Pin::into_inner_unchecked(new))))
})
}
+
+ /// Attach an encoder to this [`Connector`].
+ ///
+ /// TODO: Move this to an `UnregisteredConnector` interface somehow…
+ #[must_use]
+ pub fn attach_encoder<E>(&self, encoder: &Encoder<E>) -> Result
+ where
+ E: DriverEncoder<Driver = T::Driver>
+ {
+ // SAFETY: FFI call with no special requirements
+ to_result(unsafe {
+ bindings::drm_connector_attach_encoder(self.as_raw(), encoder.as_raw())
+ })
+ }
}
/// A trait implemented by any type that acts as a [`struct drm_connector`] interface.