mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 21:17:45 +00:00
Kernel: Move all Graphics-related code into Devices/GPU directory
Like the HID, Audio and Storage subsystem, the Graphics subsystem (which handles GPUs technically) exposes unix device files (typically in /dev). To ensure consistency across the repository, move all related files to a new directory under Kernel/Devices called "GPU". Also remove the redundant "GPU" word from the VirtIO driver directory, and the word "Graphics" from GraphicsManagement.{h,cpp} filenames.
This commit is contained in:
parent
31a7dabf02
commit
9ee098b119
69 changed files with 167 additions and 167 deletions
80
Kernel/Devices/GPU/Intel/NativeDisplayConnector.h
Normal file
80
Kernel/Devices/GPU/Intel/NativeDisplayConnector.h
Normal file
|
@ -0,0 +1,80 @@
|
|||
/*
|
||||
* Copyright (c) 2022, Liav A. <liavalb@hotmail.co.il>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <AK/Try.h>
|
||||
#include <Kernel/Devices/GPU/Console/GenericFramebufferConsole.h>
|
||||
#include <Kernel/Devices/GPU/Definitions.h>
|
||||
#include <Kernel/Devices/GPU/DisplayConnector.h>
|
||||
#include <Kernel/Devices/GPU/Intel/Auxiliary/GMBusConnector.h>
|
||||
#include <Kernel/Library/LockRefPtr.h>
|
||||
#include <Kernel/Memory/TypedMapping.h>
|
||||
|
||||
namespace Kernel {
|
||||
|
||||
class IntelDisplayConnectorGroup;
|
||||
class IntelNativeDisplayConnector final
|
||||
: public DisplayConnector {
|
||||
friend class IntelDisplayConnectorGroup;
|
||||
friend class DeviceManagement;
|
||||
|
||||
public:
|
||||
enum class Type {
|
||||
Invalid,
|
||||
Analog,
|
||||
DVO,
|
||||
LVDS,
|
||||
TVOut,
|
||||
HDMI,
|
||||
DisplayPort,
|
||||
EmbeddedDisplayPort,
|
||||
};
|
||||
|
||||
enum class ConnectorIndex : size_t {
|
||||
PortA = 0,
|
||||
PortB = 1,
|
||||
PortC = 2,
|
||||
PortD = 3,
|
||||
PortE = 4,
|
||||
PortF = 5,
|
||||
PortH = 6,
|
||||
PortG = 7,
|
||||
PortI = 8,
|
||||
};
|
||||
|
||||
static ErrorOr<NonnullLockRefPtr<IntelNativeDisplayConnector>> try_create_with_display_connector_group(IntelDisplayConnectorGroup const&, ConnectorIndex, Type, PhysicalAddress framebuffer_address, size_t framebuffer_resource_size);
|
||||
|
||||
void set_edid_bytes(Badge<IntelDisplayConnectorGroup>, Array<u8, 128> const& edid_bytes);
|
||||
ErrorOr<void> create_attached_framebuffer_console(Badge<IntelDisplayConnectorGroup>);
|
||||
|
||||
ConnectorIndex connector_index() const { return m_connector_index; }
|
||||
|
||||
private:
|
||||
// ^DisplayConnector
|
||||
// FIXME: Implement modesetting capabilities in runtime from userland...
|
||||
virtual bool mutable_mode_setting_capable() const override { return false; }
|
||||
// FIXME: Implement double buffering capabilities in runtime from userland...
|
||||
virtual bool double_framebuffering_capable() const override { return false; }
|
||||
virtual ErrorOr<void> set_mode_setting(ModeSetting const&) override;
|
||||
virtual ErrorOr<void> set_safe_mode_setting() override;
|
||||
virtual ErrorOr<void> set_y_offset(size_t y) override;
|
||||
virtual ErrorOr<void> unblank() override;
|
||||
virtual ErrorOr<void> flush_first_surface() override final;
|
||||
virtual void enable_console() override;
|
||||
virtual void disable_console() override;
|
||||
virtual bool partial_flush_support() const override { return false; }
|
||||
virtual bool flush_support() const override { return false; }
|
||||
// Note: Paravirtualized hardware doesn't require a defined refresh rate for modesetting.
|
||||
virtual bool refresh_rate_support() const override { return true; }
|
||||
|
||||
IntelNativeDisplayConnector(IntelDisplayConnectorGroup const&, ConnectorIndex connector_index, Type, PhysicalAddress framebuffer_address, size_t framebuffer_resource_size);
|
||||
Type const m_type { Type::Analog };
|
||||
ConnectorIndex const m_connector_index { 0 };
|
||||
NonnullLockRefPtr<IntelDisplayConnectorGroup> m_parent_connector_group;
|
||||
LockRefPtr<Graphics::GenericFramebufferConsole> m_framebuffer_console;
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue