summaryrefslogtreecommitdiff
path: root/Kernel/Graphics
diff options
context:
space:
mode:
authorEvan Smal <evan.smal@hotmail.com>2022-12-28 17:55:04 -0500
committerJelle Raaijmakers <jelle@gmta.nl>2023-01-05 01:44:19 +0100
commit288a73ea0e21ab1f98dba68e6b71d37da87b5591 (patch)
tree5d0d6e511155b5e23face6f3440a1a8aaec75f19 /Kernel/Graphics
parent6a5be5f1c555fa880822d988e52058b50a3eea84 (diff)
downloadserenity-288a73ea0e21ab1f98dba68e6b71d37da87b5591.zip
Kernel: Add dmesgln_pci logging for Kernel::PCI
A virtual method named device_name() was added to Kernel::PCI to support logging the PCI::Device name and address using dmesgln_pci. Previously, PCI::Device did not store the device name. All devices inheriting from PCI::Device now use dmesgln_pci where they previously used dmesgln.
Diffstat (limited to 'Kernel/Graphics')
-rw-r--r--Kernel/Graphics/Bochs/GraphicsAdapter.h1
-rw-r--r--Kernel/Graphics/Intel/NativeGraphicsAdapter.cpp4
-rw-r--r--Kernel/Graphics/Intel/NativeGraphicsAdapter.h2
-rw-r--r--Kernel/Graphics/VMWare/GraphicsAdapter.h2
-rw-r--r--Kernel/Graphics/VirtIOGPU/GraphicsAdapter.h2
5 files changed, 9 insertions, 2 deletions
diff --git a/Kernel/Graphics/Bochs/GraphicsAdapter.h b/Kernel/Graphics/Bochs/GraphicsAdapter.h
index bb298a3a5f..5fca7601a1 100644
--- a/Kernel/Graphics/Bochs/GraphicsAdapter.h
+++ b/Kernel/Graphics/Bochs/GraphicsAdapter.h
@@ -26,6 +26,7 @@ class BochsGraphicsAdapter final : public GenericGraphicsAdapter
public:
static NonnullLockRefPtr<BochsGraphicsAdapter> initialize(PCI::DeviceIdentifier const&);
virtual ~BochsGraphicsAdapter() = default;
+ virtual StringView device_name() const override { return "BochsGraphicsAdapter"sv; }
private:
ErrorOr<void> initialize_adapter(PCI::DeviceIdentifier const&);
diff --git a/Kernel/Graphics/Intel/NativeGraphicsAdapter.cpp b/Kernel/Graphics/Intel/NativeGraphicsAdapter.cpp
index 3029e1c814..f410fceb75 100644
--- a/Kernel/Graphics/Intel/NativeGraphicsAdapter.cpp
+++ b/Kernel/Graphics/Intel/NativeGraphicsAdapter.cpp
@@ -43,8 +43,8 @@ ErrorOr<void> IntelNativeGraphicsAdapter::initialize_adapter()
auto bar0_space_size = PCI::get_BAR_space_size(address, PCI::HeaderType0BaseRegister::BAR0);
VERIFY(bar0_space_size == 0x80000);
auto bar2_space_size = PCI::get_BAR_space_size(address, PCI::HeaderType0BaseRegister::BAR2);
- dmesgln("Intel Native Graphics Adapter @ {}, MMIO @ {}, space size is {:x} bytes", address, PhysicalAddress(PCI::get_BAR0(address)), bar0_space_size);
- dmesgln("Intel Native Graphics Adapter @ {}, framebuffer @ {}", address, PhysicalAddress(PCI::get_BAR2(address)));
+ dmesgln_pci(*this, "MMIO @ {}, space size is {:x} bytes", PhysicalAddress(PCI::get_BAR0(address)), bar0_space_size);
+ dmesgln_pci(*this, "framebuffer @ {}", PhysicalAddress(PCI::get_BAR2(address)));
PCI::enable_bus_mastering(address);
m_display_connector = IntelNativeDisplayConnector::must_create(PhysicalAddress(PCI::get_BAR2(address) & 0xfffffff0), bar2_space_size, PhysicalAddress(PCI::get_BAR0(address) & 0xfffffff0), bar0_space_size);
diff --git a/Kernel/Graphics/Intel/NativeGraphicsAdapter.h b/Kernel/Graphics/Intel/NativeGraphicsAdapter.h
index dc8a72c5e8..b7c58dea8a 100644
--- a/Kernel/Graphics/Intel/NativeGraphicsAdapter.h
+++ b/Kernel/Graphics/Intel/NativeGraphicsAdapter.h
@@ -24,6 +24,8 @@ public:
virtual ~IntelNativeGraphicsAdapter() = default;
+ virtual StringView device_name() const override { return "IntelNativeGraphicsAdapter"sv; }
+
private:
ErrorOr<void> initialize_adapter();
diff --git a/Kernel/Graphics/VMWare/GraphicsAdapter.h b/Kernel/Graphics/VMWare/GraphicsAdapter.h
index 705b60865e..fd159fb9fa 100644
--- a/Kernel/Graphics/VMWare/GraphicsAdapter.h
+++ b/Kernel/Graphics/VMWare/GraphicsAdapter.h
@@ -29,6 +29,8 @@ public:
static LockRefPtr<VMWareGraphicsAdapter> try_initialize(PCI::DeviceIdentifier const&);
virtual ~VMWareGraphicsAdapter() = default;
+ virtual StringView device_name() const override { return "VMWareGraphicsAdapter"sv; }
+
ErrorOr<void> modeset_primary_screen_resolution(Badge<VMWareDisplayConnector>, size_t width, size_t height);
size_t primary_screen_width(Badge<VMWareDisplayConnector>) const;
size_t primary_screen_height(Badge<VMWareDisplayConnector>) const;
diff --git a/Kernel/Graphics/VirtIOGPU/GraphicsAdapter.h b/Kernel/Graphics/VirtIOGPU/GraphicsAdapter.h
index 5b93a51820..bc6bf22b5e 100644
--- a/Kernel/Graphics/VirtIOGPU/GraphicsAdapter.h
+++ b/Kernel/Graphics/VirtIOGPU/GraphicsAdapter.h
@@ -41,6 +41,8 @@ public:
virtual void initialize() override;
+ virtual StringView device_name() const override { return "VirtIOGraphicsAdapter"sv; }
+
ErrorOr<void> mode_set_resolution(Badge<VirtIODisplayConnector>, VirtIODisplayConnector&, size_t width, size_t height);
void set_dirty_displayed_rect(Badge<VirtIODisplayConnector>, VirtIODisplayConnector&, Graphics::VirtIOGPU::Protocol::Rect const& dirty_rect, bool main_buffer);
ErrorOr<void> flush_displayed_image(Badge<VirtIODisplayConnector>, VirtIODisplayConnector&, Graphics::VirtIOGPU::Protocol::Rect const& dirty_rect, bool main_buffer);