From cd115270fc160a297ae2697cb4284307dc2f813d Mon Sep 17 00:00:00 2001 From: Liav A Date: Fri, 24 Jun 2022 13:17:20 +0300 Subject: [PATCH] Kernel/Graphics: Move GenericDisplayConnector code to a new sub-folder In the same fashion like in the Linux kernel, we support pre-initialized framebuffers that were set up by either the BIOS or the bootloader. These framebuffers can be backed by any kind of video hardware, and are not tied to VGA hardware at all. Therefore, this code should be in a separate sub-folder in the Graphics subsystem to indicate this. --- Kernel/CMakeLists.txt | 2 +- Kernel/Graphics/{VGA => Generic}/DisplayConnector.cpp | 2 +- Kernel/Graphics/{VGA => Generic}/DisplayConnector.h | 5 ++++- Kernel/Graphics/VGA/VGACompatibleAdapter.h | 2 +- 4 files changed, 7 insertions(+), 4 deletions(-) rename Kernel/Graphics/{VGA => Generic}/DisplayConnector.cpp (97%) rename Kernel/Graphics/{VGA => Generic}/DisplayConnector.h (82%) diff --git a/Kernel/CMakeLists.txt b/Kernel/CMakeLists.txt index 74bb9cb5d7..ad71ee6b53 100644 --- a/Kernel/CMakeLists.txt +++ b/Kernel/CMakeLists.txt @@ -81,10 +81,10 @@ set(KERNEL_SOURCES Graphics/Console/TextModeConsole.cpp Graphics/Console/VGAConsole.cpp Graphics/DisplayConnector.cpp + Graphics/Generic/DisplayConnector.cpp Graphics/GraphicsManagement.cpp Graphics/Intel/NativeDisplayConnector.cpp Graphics/Intel/NativeGraphicsAdapter.cpp - Graphics/VGA/DisplayConnector.cpp Graphics/VGA/ISAAdapter.cpp Graphics/VGA/PCIAdapter.cpp Graphics/VGA/VGACompatibleAdapter.cpp diff --git a/Kernel/Graphics/VGA/DisplayConnector.cpp b/Kernel/Graphics/Generic/DisplayConnector.cpp similarity index 97% rename from Kernel/Graphics/VGA/DisplayConnector.cpp rename to Kernel/Graphics/Generic/DisplayConnector.cpp index d394e8f2fa..26d79d43cc 100644 --- a/Kernel/Graphics/VGA/DisplayConnector.cpp +++ b/Kernel/Graphics/Generic/DisplayConnector.cpp @@ -8,8 +8,8 @@ #include #include #include +#include #include -#include namespace Kernel { diff --git a/Kernel/Graphics/VGA/DisplayConnector.h b/Kernel/Graphics/Generic/DisplayConnector.h similarity index 82% rename from Kernel/Graphics/VGA/DisplayConnector.h rename to Kernel/Graphics/Generic/DisplayConnector.h index ac48386f2c..2cf6deac76 100644 --- a/Kernel/Graphics/VGA/DisplayConnector.h +++ b/Kernel/Graphics/Generic/DisplayConnector.h @@ -36,7 +36,10 @@ protected: virtual bool partial_flush_support() const override final { return false; } virtual bool flush_support() const override final { return false; } - // Note: This is possibly a paravirtualized hardware, but since we don't know, we assume there's no refresh rate... + // Note: This is "possibly" a paravirtualized hardware, but since we don't know, we assume there's no refresh rate... + // We rely on the BIOS and/or the bootloader to initialize the hardware for us, so we don't really care about + // the specific implementation and settings that were chosen with the given hardware as long as we just + // have a dummy framebuffer to work with. virtual bool refresh_rate_support() const override final { return false; } virtual ErrorOr flush_first_surface() override final; diff --git a/Kernel/Graphics/VGA/VGACompatibleAdapter.h b/Kernel/Graphics/VGA/VGACompatibleAdapter.h index ec90b50fad..8683a32d81 100644 --- a/Kernel/Graphics/VGA/VGACompatibleAdapter.h +++ b/Kernel/Graphics/VGA/VGACompatibleAdapter.h @@ -9,8 +9,8 @@ #include #include #include +#include #include -#include #include namespace Kernel {