Verified Commit 92305f99 authored by Jeremy Soller's avatar Jeremy Soller
Browse files

Use EDID active protocol instead

parent 426fc818
......@@ -17,7 +17,7 @@ use crate::{
use super::super::{
disk::DiskEfi,
display::{EdidDiscovered, Output},
display::{EdidActive, Output},
};
use self::memory_map::{MemoryMapIter, memory_map};
......@@ -138,7 +138,7 @@ impl Os<
fn name(&self) -> &str {
"x86_64/UEFI"
}
fn alloc_zeroed_page_aligned(&self, size: usize) -> *mut u8 {
assert!(size != 0);
......@@ -206,7 +206,7 @@ impl Os<
fn best_resolution(&self) -> Option<(u32, u32)> {
//TODO: get this per output
match EdidDiscovered::one() {
match EdidActive::one() {
Ok(efi_edid) => {
let edid = unsafe {
slice::from_raw_parts(efi_edid.0.Edid, efi_edid.0.SizeOfEdid as usize)
......
......@@ -14,24 +14,25 @@ impl Protocol<GraphicsOutput> for Output {
}
}
const EDID_DISCOVERED_PROTOCOL_GUID: Guid = Guid(
0x1c0c34f6, 0xd380, 0x41fa, [0xa0, 0x49, 0x8a, 0xd0, 0x6c, 0x1a, 0x66, 0xaa]
const EDID_ACTIVE_PROTOCOL_GUID: Guid = Guid(
0xbd8c1056, 0x9f36, 0x44ec, [0x92, 0xa8, 0xa6, 0x33, 0x7f, 0x81, 0x79, 0x86]
);
#[allow(non_snake_case)]
#[repr(C)]
pub struct EdidDiscoveredProtocol {
pub struct EdidActiveProtocol {
pub SizeOfEdid: u32,
pub Edid: *const u8,
}
pub struct EdidDiscovered(pub &'static mut EdidDiscoveredProtocol);
pub struct EdidActive(pub &'static mut EdidActiveProtocol);
impl Protocol<EdidDiscoveredProtocol> for EdidDiscovered {
impl Protocol<EdidActiveProtocol> for EdidActive {
fn guid() -> Guid {
EDID_DISCOVERED_PROTOCOL_GUID
EDID_ACTIVE_PROTOCOL_GUID
}
fn new(inner: &'static mut EdidDiscoveredProtocol) -> Self {
EdidDiscovered(inner)
fn new(inner: &'static mut EdidActiveProtocol) -> Self {
EdidActive(inner)
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment