1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 05:38:11 +00:00

Kernel/Graphics: Add basic support for Intel native accelerator

We simply modeset the resolution after determining the preferred
resolution after getting the EDID from the attached display.
This commit is contained in:
Liav A 2021-04-12 22:07:30 +03:00 committed by Andreas Kling
parent 6a728e2d76
commit cc92538d49
7 changed files with 882 additions and 0 deletions

View file

@ -10,6 +10,7 @@
#include <Kernel/Debug.h>
#include <Kernel/Graphics/BochsGraphicsAdapter.h>
#include <Kernel/Graphics/GraphicsManagement.h>
#include <Kernel/Graphics/IntelNativeGraphicsAdapter.h>
#include <Kernel/Graphics/VGACompatibleAdapter.h>
#include <Kernel/Multiboot.h>
@ -38,6 +39,11 @@ UNMAP_AFTER_INIT RefPtr<GraphicsDevice> GraphicsManagement::determine_graphics_d
return BochsGraphicsAdapter::initialize(address);
}
if (PCI::get_class(address) == 0x3 && PCI::get_subclass(address) == 0x0) {
if (id.vendor_id == 0x8086) {
auto adapter = IntelNativeGraphicsAdapter::initialize(address);
if (!adapter.is_null())
return adapter;
}
VERIFY(multiboot_info_ptr->framebuffer_type == MULTIBOOT_FRAMEBUFFER_TYPE_RGB || multiboot_info_ptr->framebuffer_type == MULTIBOOT_FRAMEBUFFER_TYPE_EGA_TEXT);
return VGACompatibleAdapter::initialize_with_preset_resolution(address,
PhysicalAddress((u32)(multiboot_info_ptr->framebuffer_addr)),