cleanup: rename Graphics:Cursor => Graphics::Framebuffer

This commit is contained in:
2026-06-21 10:42:27 +02:00
parent 772eaee9f4
commit c92993a16a
12 changed files with 70 additions and 72 deletions
-25
View File
@@ -1,25 +0,0 @@
/*
* Cursor.hpp
* Framebuffer information storage
* Copyright (c) 2025 Daniel Hammer
*/
#pragma once
#include <cstdint>
#include <Boot/BootInfo.hpp>
namespace Graphics::Cursor {
void Initialize(const montauk::boot::Framebuffer& framebuffer);
uint32_t* GetFramebufferBase();
uint64_t GetFramebufferWidth();
uint64_t GetFramebufferHeight();
uint64_t GetFramebufferPitch();
void SetFramebuffer(uint32_t* base, uint64_t width, uint64_t height, uint64_t pitch);
uint64_t GetFramebufferPhysBase();
void MapWriteCombining();
};
@@ -1,16 +1,16 @@
/*
* Cursor.cpp
* Framebuffer.cpp
* Framebuffer information storage
* Copyright (c) 2025 Daniel Hammer
*/
#include "Cursor.hpp"
#include "Framebuffer.hpp"
#include <Terminal/Terminal.hpp>
#include <Memory/HHDM.hpp>
#include <Memory/Paging.hpp>
#include <CppLib/Stream.hpp>
namespace Graphics::Cursor {
namespace Graphics::Framebuffer {
// Framebuffer state
static uint32_t* g_FbBase = nullptr;
@@ -28,12 +28,12 @@ namespace Graphics::Cursor {
<< (uint64_t)g_FbWidth << "x" << (uint64_t)g_FbHeight << ")";
}
uint32_t* GetFramebufferBase() { return g_FbBase; }
uint64_t GetFramebufferWidth() { return g_FbWidth; }
uint64_t GetFramebufferHeight() { return g_FbHeight; }
uint64_t GetFramebufferPitch() { return g_FbPitch; }
uint32_t* GetBase() { return g_FbBase; }
uint64_t GetWidth() { return g_FbWidth; }
uint64_t GetHeight() { return g_FbHeight; }
uint64_t GetPitch() { return g_FbPitch; }
void SetFramebuffer(uint32_t* base, uint64_t width, uint64_t height, uint64_t pitch) {
void Set(uint32_t* base, uint64_t width, uint64_t height, uint64_t pitch) {
g_FbBase = base;
g_FbWidth = width;
g_FbHeight = height;
@@ -42,12 +42,12 @@ namespace Graphics::Cursor {
<< (uint64_t)g_FbWidth << "x" << (uint64_t)g_FbHeight << ")";
}
uint64_t GetFramebufferPhysBase() {
uint64_t GetPhysBase() {
return Memory::SubHHDM((uint64_t)g_FbBase);
}
void MapWriteCombining() {
uint64_t fbPhys = GetFramebufferPhysBase();
uint64_t fbPhys = GetPhysBase();
uint64_t fbSize = g_FbHeight * g_FbPitch;
uint64_t numPages = (fbSize + 0xFFF) / 0x1000;
+25
View File
@@ -0,0 +1,25 @@
/*
* Framebuffer.hpp
* Framebuffer information storage
* Copyright (c) 2025 Daniel Hammer
*/
#pragma once
#include <cstdint>
#include <Boot/BootInfo.hpp>
namespace Graphics::Framebuffer {
void Initialize(const montauk::boot::Framebuffer& framebuffer);
uint32_t* GetBase();
uint64_t GetWidth();
uint64_t GetHeight();
uint64_t GetPitch();
void Set(uint32_t* base, uint64_t width, uint64_t height, uint64_t pitch);
uint64_t GetPhysBase();
void MapWriteCombining();
};