~demindiro/norost-b

ef1c84f94ec309ea356cb8426e4a0b6d3476cbbf — David Hoppenbrouwers 2 years ago 88f74c4 intel-hd-graphics-5500
Wrap up work around Intel HD Graphics

It is *far* from done but it works on my laptop, which is sufficient.
Right now other tasks have higher priority (e.g. virtio-gpu, GUI ...).
2 files changed, 2 insertions(+), 18 deletions(-)

M drivers/intel_hd_graphics/src/displayport.rs
M drivers/intel_hd_graphics/src/main.rs
M drivers/intel_hd_graphics/src/displayport.rs => drivers/intel_hd_graphics/src/displayport.rs +1 -1
@@ 133,7 133,7 @@ bit2enum! {
	None      0b111
}

#[derive(Clone, Copy, PartialEq)]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum Port {
	/// Known as DDI_AUX_{CTL,DATA} in vol2a and located at an entirely different address from the
	/// other registers. Don't ask me why.

M drivers/intel_hd_graphics/src/main.rs => drivers/intel_hd_graphics/src/main.rs +1 -17
@@ 374,6 374,7 @@ fn main(_: isize, _: *const *const u8) -> isize {
						return 1;
					}
				};
				assert_eq!(port, displayport::Port::A, "TODO support multiple ports");
				let edid = edid::Edid::new(edid).unwrap();
				let mode = mode::Mode::from_edid(&edid).unwrap();



@@ 452,27 453,10 @@ fn main(_: isize, _: *const *const u8) -> isize {
					);
					backlight::enable_backlight(&mut control);

					/*
					let v = control.load(SRD_CTL_EDP);
					control.store(SRD_CTL_EDP, v | (1 << 31));
					*/
				}

				/*
				unsafe {
					vga_enable.write(&[0]).unwrap();
					vga::disable_vga(&mut control);
					// This is the most minimal sequence that kinda-but-not-really works
					plane::disable(&mut control, plane::Plane::A);
					rt::thread::sleep(Duration::from_millis(1));
					pipe::set_hv(&mut control, pipe::Pipe::A, 1919, 1079);
					panel::set_hv(&mut control, panel::Pipe::A, 1919, 1080);
					//panel::disable_fitter(&mut control, panel::Pipe::A);
					//panel::enable_fitter(&mut control, panel::Pipe::A);
					plane::enable(&mut control, plane::Plane::A, config);
				}
				*/

				let plane_buf = memory.cast::<[u8; 4]>();
				unsafe {
					let (x, mut y) = (20, 80);