Skip to content

Commit 46b8733

Browse files
rawfb_drm: install connector
Signed-off-by: Andy-Python-Programmer <[email protected]>
1 parent 1a62983 commit 46b8733

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

src/aero_kernel/src/drivers/drm/mod.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,8 @@ impl ModeObject for Encoder {
102102
}
103103
}
104104

105+
/// Represents a display connector; transmits the signal to the display, detects
106+
/// display connection, removal and exposes the display's supported modes.
105107
#[derive(Default)]
106108
struct Connector {
107109
id: u32,
@@ -188,6 +190,14 @@ impl Drm {
188190
crtc.id = crtcs.len() as u32;
189191
crtcs.push(crtc);
190192
}
193+
194+
/// Installs and initializes the connector identifier.
195+
pub fn install_connector(&self, mut connector: Connector) {
196+
let mut connectors = self.connectors.lock();
197+
198+
connector.id = connectors.len() as u32;
199+
connectors.push(connector);
200+
}
191201
}
192202

193203
impl INodeInterface for Drm {

src/aero_kernel/src/drivers/drm/rawfb.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ impl DrmDevice for RawFramebuffer {
5353

5454
fn init() {
5555
let crtc = Crtc::default();
56+
let connector = Connector::default();
5657

5758
let dri = devfs::DEV_FILESYSTEM
5859
.root_dir()
@@ -63,6 +64,7 @@ fn init() {
6364
let rfb = Drm::new(Arc::new(RawFramebuffer {}));
6465

6566
rfb.install_crtc(crtc);
67+
rfb.install_connector(connector);
6668

6769
devfs::install_device_at(dri, rfb).expect("ramfs: failed to install DRM device");
6870
}

0 commit comments

Comments
 (0)