feat: expand Intel GPU display management

This commit is contained in:
2026-07-30 17:12:08 +01:00
parent 86de3400a9
commit 471903bafb
25 changed files with 1715 additions and 16 deletions
+12
View File
@@ -17,12 +17,20 @@ namespace Graphics::Framebuffer {
static uint64_t g_FbWidth = 0;
static uint64_t g_FbHeight = 0;
static uint64_t g_FbPitch = 0; // in bytes
static uint8_t g_Edid[256] = {};
static uint64_t g_EdidSize = 0;
void Initialize(const montauk::boot::Framebuffer& framebuffer) {
g_FbBase = reinterpret_cast<uint32_t*>(framebuffer.address);
g_FbWidth = framebuffer.width;
g_FbHeight = framebuffer.height;
g_FbPitch = framebuffer.pitch;
g_EdidSize = framebuffer.edidSize;
if (g_EdidSize > sizeof(g_Edid)) g_EdidSize = sizeof(g_Edid);
if (framebuffer.edid == nullptr) g_EdidSize = 0;
for (uint64_t i = 0; i < g_EdidSize; i++) {
g_Edid[i] = framebuffer.edid[i];
}
Kt::KernelLogStream(Kt::OK, "Graphics") << "Framebuffer initialized ("
<< (uint64_t)g_FbWidth << "x" << (uint64_t)g_FbHeight << ")";
@@ -32,6 +40,10 @@ namespace Graphics::Framebuffer {
uint64_t GetWidth() { return g_FbWidth; }
uint64_t GetHeight() { return g_FbHeight; }
uint64_t GetPitch() { return g_FbPitch; }
const uint8_t* GetEdid(uint64_t* size) {
if (size) *size = g_EdidSize;
return g_EdidSize ? g_Edid : nullptr;
}
void Set(uint32_t* base, uint64_t width, uint64_t height, uint64_t pitch) {
g_FbBase = base;