Kernel/Graphics: Unblank the screen when initializing bochs display

This commit is contained in:
Liav A 2021-07-03 16:42:40 +03:00 committed by Gunnar Beutner
parent 3fae7ca113
commit 00e4cc23cb
Notes: sideshowbarker 2024-07-18 11:03:42 +09:00
2 changed files with 14 additions and 0 deletions

View file

@ -65,6 +65,11 @@ UNMAP_AFTER_INIT BochsGraphicsAdapter::BochsGraphicsAdapter(PCI::Address pci_add
auto id = PCI::get_id(pci_address);
if (id.vendor_id == 0x80ee && id.device_id == 0xbeef)
m_io_required = true;
// FIXME: Although this helps with setting the screen to work on some cases,
// we need to check we actually can access the VGA MMIO remapped ioports before
// doing the unblanking.
unblank();
set_safe_resolution();
}
@ -82,6 +87,14 @@ GraphicsDevice::Type BochsGraphicsAdapter::type() const
return Type::Bochs;
}
void BochsGraphicsAdapter::unblank()
{
auto registers = map_typed_writable<volatile BochsDisplayMMIORegisters>(m_mmio_registers);
full_memory_barrier();
registers->vga_ioports[0] = 0x20;
full_memory_barrier();
}
void BochsGraphicsAdapter::set_safe_resolution()
{
VERIFY(m_framebuffer_console);

View file

@ -46,6 +46,7 @@ private:
explicit BochsGraphicsAdapter(PCI::Address);
void set_safe_resolution();
void unblank();
bool validate_setup_resolution(size_t width, size_t height);
u32 find_framebuffer_address();