Merge branch 'ihdgd_alchemist_pipes' into 'main'

drivers/graphics/ihdgd: List correct pipes for Alchemist

See merge request redox-os/base!210
This commit is contained in:
Jeremy Soller
2026-03-27 19:18:30 -06:00
2 changed files with 59 additions and 1 deletions
+2 -1
View File
@@ -392,7 +392,8 @@ impl Device {
DeviceKind::Alchemist => {
// Many registers are identical to tigerlake
dplls = Dpll::tigerlake(&gttmm)?;
pipes = Pipe::tigerlake(&gttmm)?;
pipes = Pipe::alchemist(&gttmm)?;
// FIXME transcoders are probably different too
transcoders = Transcoder::tigerlake(&gttmm)?;
// Power wells are distinct
ddis = Ddi::alchemist(&gttmm)?;
+57
View File
@@ -307,4 +307,61 @@ impl Pipe {
}
Ok(pipes)
}
pub fn alchemist(gttmm: &MmioRegion) -> Result<Vec<Self>> {
let mut pipes = Vec::with_capacity(4);
for (i, name) in ["A", "B", "C", "D"].iter().enumerate() {
let mut planes = Vec::new();
//TODO: cursor plane
for (j, name) in ["1", "2", "3", "4", "5"].iter().enumerate() {
planes.push(Plane {
name,
index: j,
// IHD-OS-ACM-Vol 2c-3.23 PLANE_BUF_CFG
buf_cfg: unsafe { gttmm.mmio(0x7057C + i * 0x1000 + j * 0x100)? },
// IHD-OS-ACM-Vol 2c-3.23 PLANE_COLOR_CTL
color_ctl: Some(unsafe { gttmm.mmio(0x704CC + i * 0x1000 + j * 0x100)? }),
color_ctl_gamma_disable: 1 << 13,
// IHD-OS-ACM-Vol 2c-3.23 PLANE_CTL
ctl: unsafe { gttmm.mmio(0x70480 + i * 0x1000 + j * 0x100)? },
ctl_source_rgb_8888: 0b01000 << 23,
ctl_source_mask: 0b11111 << 23,
// IHD-OS-ACM-Vol 2c-3.23 PLANE_OFFSET
offset: unsafe { gttmm.mmio(0x704A4 + i * 0x1000 + j * 0x100)? },
// IHD-OS-ACM-Vol 2c-3.23 PLANE_POS
pos: unsafe { gttmm.mmio(0x7048C + i * 0x1000 + j * 0x100)? },
// IHD-OS-ACM-Vol 2c-3.23 PLANE_SIZE
size: unsafe { gttmm.mmio(0x70490 + i * 0x1000 + j * 0x100)? },
// IHD-OS-ACM-Vol 2c-3.23 PLANE_STRIDE
stride: unsafe { gttmm.mmio(0x70488 + i * 0x1000 + j * 0x100)? },
// IHD-OS-ACM-Vol 2c-3.23 PLANE_SURF
surf: unsafe { gttmm.mmio(0x7049C + i * 0x1000 + j * 0x100)? },
// IHD-OS-ACM-Vol 2c-3.23 PLANE_WM
wm: [
unsafe { gttmm.mmio(0x70540 + i * 0x1000 + j * 0x100)? },
unsafe { gttmm.mmio(0x70544 + i * 0x1000 + j * 0x100)? },
unsafe { gttmm.mmio(0x70548 + i * 0x1000 + j * 0x100)? },
unsafe { gttmm.mmio(0x7054C + i * 0x1000 + j * 0x100)? },
unsafe { gttmm.mmio(0x70550 + i * 0x1000 + j * 0x100)? },
unsafe { gttmm.mmio(0x70554 + i * 0x1000 + j * 0x100)? },
unsafe { gttmm.mmio(0x70558 + i * 0x1000 + j * 0x100)? },
unsafe { gttmm.mmio(0x7055C + i * 0x1000 + j * 0x100)? },
],
wm_trans: unsafe { gttmm.mmio(0x70568 + i * 0x1000 + j * 0x100)? },
});
}
pipes.push(Pipe {
name,
index: i,
planes,
// IHD-OS-ACM-Vol 2c-3.23 PIPE_BOTTOM_COLOR
bottom_color: unsafe { gttmm.mmio(0x70034 + i * 0x1000)? },
// IHD-OS-ACM-Vol 2c-3.23 PIPE_MISC
misc: unsafe { gttmm.mmio(0x70030 + i * 0x1000)? },
// IHD-OS-ACM-Vol 2c-3.23 PIPE_SRCSZ
srcsz: unsafe { gttmm.mmio(0x6001C + i * 0x1000)? },
})
}
Ok(pipes)
}
}