1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 06:57:45 +00:00

Kernel: Remove unnecessary use of LibDraw.

BXVGADevice was using a Size object for its framebuffer size. We shouldn't
be pulling in userspace code in the kernel like this, even if it's just
headers. :^)
This commit is contained in:
Andreas Kling 2019-07-18 10:36:26 +02:00
parent 1c0669f010
commit bf8d72f5a4
2 changed files with 9 additions and 7 deletions

View file

@ -4,7 +4,6 @@
#include <AK/Types.h>
#include <Kernel/Devices/BlockDevice.h>
#include <Kernel/VM/PhysicalAddress.h>
#include <LibDraw/Size.h>
class BXVGADevice final : public BlockDevice {
AK_MAKE_ETERNAL
@ -20,8 +19,9 @@ public:
virtual int ioctl(FileDescription&, unsigned request, unsigned arg) override;
virtual KResultOr<Region*> mmap(Process&, FileDescription&, VirtualAddress preferred_vaddr, size_t offset, size_t, int prot) override;
size_t framebuffer_size_in_bytes() const { return m_framebuffer_size.area() * sizeof(u32) * 2; }
Size framebuffer_size() const { return m_framebuffer_size; }
size_t framebuffer_size_in_bytes() const { return m_framebuffer_width * m_framebuffer_height * sizeof(u32) * 2; }
int framebuffer_width() const { return m_framebuffer_width; }
int framebuffer_height() const { return m_framebuffer_height; }
private:
virtual const char* class_name() const override { return "BXVGA"; }
@ -34,5 +34,6 @@ private:
u32 find_framebuffer_address();
PhysicalAddress m_framebuffer_address;
Size m_framebuffer_size;
int m_framebuffer_width { 0 };
int m_framebuffer_height { 0 };
};