drivers/graphics: Slightly simplify add_connector
This commit is contained in:
@@ -66,9 +66,16 @@ impl<T: GraphicsAdapter> DrmObjects<T> {
|
||||
}
|
||||
|
||||
pub fn add_connector(&mut self, driver_data: T::Connector) -> DrmObjectId {
|
||||
let encoder_id = self.add(DrmEncoder {
|
||||
crtc_id: DrmObjectId::INVALID,
|
||||
possible_crtcs: 0,
|
||||
possible_clones: 0,
|
||||
});
|
||||
self.encoders.push(encoder_id);
|
||||
|
||||
let connector_id = self.add(DrmConnector {
|
||||
modes: vec![],
|
||||
encoder_id: DrmObjectId::INVALID,
|
||||
encoder_id,
|
||||
connector_type: 0,
|
||||
connector_type_id: 0,
|
||||
connection: DrmConnectorStatus::Unknown,
|
||||
@@ -79,15 +86,6 @@ impl<T: GraphicsAdapter> DrmObjects<T> {
|
||||
});
|
||||
self.connectors.push(connector_id);
|
||||
|
||||
let encoder_id = self.add(DrmEncoder {
|
||||
crtc_id: DrmObjectId::INVALID,
|
||||
possible_crtcs: 0,
|
||||
possible_clones: 0,
|
||||
});
|
||||
self.encoders.push(encoder_id);
|
||||
|
||||
self.get_connector_mut(connector_id).unwrap().encoder_id = encoder_id;
|
||||
|
||||
connector_id
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user