1
0
mirror of https://github.com/rcore-os/rCore.git synced 2024-11-22 08:06:17 +04:00

init FramebufferInfo for VirtIOGPU

This commit is contained in:
Runji Wang 2019-11-01 17:14:43 +08:00
parent 91a4860b64
commit 1ee6796346

View File

@ -399,6 +399,21 @@ pub fn virtio_gpu_init(node: &Node) {
setup_framebuffer(&mut driver);
use super::fb;
fb::init(fb::FramebufferInfo {
xres: driver.rect.width,
yres: driver.rect.height,
xres_virtual: driver.rect.width,
yres_virtual: driver.rect.height,
xoffset: 0,
yoffset: 0,
depth: fb::ColorDepth::ColorDepth32,
format: fb::ColorFormat::RGBA8888,
paddr: virt_to_phys(driver.frame_buffer),
vaddr: driver.frame_buffer,
screen_size: (driver.rect.width * driver.rect.height * 4) as usize,
});
let driver = Arc::new(VirtIOGpuDriver(Mutex::new(driver)));
IRQ_MANAGER.write().register_all(driver.clone());
DRIVERS.write().push(driver);