Kernel: Expose boot framebuffer device
This commit is contained in:
@@ -10,6 +10,7 @@ namespace Kernel
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
static BAN::ErrorOr<BAN::RefPtr<FramebufferDevice>> create_from_boot_framebuffer();
|
static BAN::ErrorOr<BAN::RefPtr<FramebufferDevice>> create_from_boot_framebuffer();
|
||||||
|
static BAN::RefPtr<FramebufferDevice> boot_framebuffer();
|
||||||
~FramebufferDevice();
|
~FramebufferDevice();
|
||||||
|
|
||||||
uint32_t width() const { return m_width; }
|
uint32_t width() const { return m_width; }
|
||||||
|
|||||||
@@ -12,12 +12,19 @@
|
|||||||
namespace Kernel
|
namespace Kernel
|
||||||
{
|
{
|
||||||
|
|
||||||
|
static BAN::RefPtr<FramebufferDevice> s_boot_framebuffer;
|
||||||
|
|
||||||
static uint32_t get_framebuffer_device_index()
|
static uint32_t get_framebuffer_device_index()
|
||||||
{
|
{
|
||||||
static uint32_t index = 0;
|
static uint32_t index = 0;
|
||||||
return index++;
|
return index++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BAN::RefPtr<FramebufferDevice> FramebufferDevice::boot_framebuffer()
|
||||||
|
{
|
||||||
|
return s_boot_framebuffer;
|
||||||
|
}
|
||||||
|
|
||||||
BAN::ErrorOr<BAN::RefPtr<FramebufferDevice>> FramebufferDevice::create_from_boot_framebuffer()
|
BAN::ErrorOr<BAN::RefPtr<FramebufferDevice>> FramebufferDevice::create_from_boot_framebuffer()
|
||||||
{
|
{
|
||||||
ASSERT(g_boot_info.framebuffer.type == FramebufferInfo::Type::RGB);
|
ASSERT(g_boot_info.framebuffer.type == FramebufferInfo::Type::RGB);
|
||||||
@@ -37,6 +44,7 @@ namespace Kernel
|
|||||||
auto device = BAN::RefPtr<FramebufferDevice>::adopt(device_ptr);
|
auto device = BAN::RefPtr<FramebufferDevice>::adopt(device_ptr);
|
||||||
TRY(device->initialize());
|
TRY(device->initialize());
|
||||||
DevFileSystem::get().add_device(device);
|
DevFileSystem::get().add_device(device);
|
||||||
|
s_boot_framebuffer = device;
|
||||||
return device;
|
return device;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user