mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 04:07:45 +00:00
Kernel/Graphics: Use DisplayConnector design for the Bochs driver
This commit is contained in:
parent
6d7e2596e0
commit
e9a74cbefb
8 changed files with 450 additions and 226 deletions
|
@ -20,18 +20,17 @@ namespace Kernel {
|
|||
class GraphicsManagement;
|
||||
struct BochsDisplayMMIORegisters;
|
||||
|
||||
class BochsDisplayConnector;
|
||||
class BochsGraphicsAdapter final : public GenericGraphicsAdapter
|
||||
, public PCI::Device {
|
||||
friend class GraphicsManagement;
|
||||
|
||||
private:
|
||||
TYPEDEF_DISTINCT_ORDERED_ID(u16, IndexID);
|
||||
|
||||
public:
|
||||
static NonnullRefPtr<BochsGraphicsAdapter> initialize(PCI::DeviceIdentifier const&);
|
||||
virtual ~BochsGraphicsAdapter() = default;
|
||||
virtual bool framebuffer_devices_initialized() const override { return !m_framebuffer_device.is_null(); }
|
||||
|
||||
// FIXME: Remove all of these methods when we get rid of the FramebufferDevice class.
|
||||
virtual bool framebuffer_devices_initialized() const override { return false; }
|
||||
virtual bool modesetting_capable() const override { return true; }
|
||||
virtual bool double_framebuffering_capable() const override { return true; }
|
||||
|
||||
|
@ -40,39 +39,19 @@ public:
|
|||
private:
|
||||
ErrorOr<ByteBuffer> get_edid(size_t output_port_index) const override;
|
||||
|
||||
ErrorOr<void> initialize_adapter(PCI::DeviceIdentifier const&);
|
||||
|
||||
// ^GenericGraphicsAdapter
|
||||
virtual bool try_to_set_resolution(size_t output_port_index, size_t width, size_t height) override;
|
||||
virtual bool set_y_offset(size_t output_port_index, size_t y) override;
|
||||
|
||||
virtual void initialize_framebuffer_devices() override;
|
||||
|
||||
virtual void enable_consoles() override;
|
||||
virtual void disable_consoles() override;
|
||||
// FIXME: Remove all of these methods when we get rid of the FramebufferDevice class.
|
||||
virtual bool try_to_set_resolution(size_t, size_t, size_t) override { VERIFY_NOT_REACHED(); }
|
||||
virtual bool set_y_offset(size_t, size_t) override { VERIFY_NOT_REACHED(); }
|
||||
virtual void initialize_framebuffer_devices() override { }
|
||||
virtual void enable_consoles() override { }
|
||||
virtual void disable_consoles() override { }
|
||||
|
||||
explicit BochsGraphicsAdapter(PCI::DeviceIdentifier const&);
|
||||
|
||||
IndexID index_id() const;
|
||||
|
||||
void set_safe_resolution();
|
||||
void unblank();
|
||||
|
||||
bool validate_setup_resolution(size_t width, size_t height);
|
||||
u32 find_framebuffer_address();
|
||||
void set_resolution_registers(size_t width, size_t height);
|
||||
void set_resolution_registers_via_io(size_t width, size_t height);
|
||||
bool validate_setup_resolution_with_io(size_t width, size_t height);
|
||||
void set_y_offset(size_t);
|
||||
|
||||
void set_framebuffer_to_big_endian_format();
|
||||
void set_framebuffer_to_little_endian_format();
|
||||
|
||||
PhysicalAddress m_mmio_registers;
|
||||
Memory::TypedMapping<BochsDisplayMMIORegisters volatile> m_registers;
|
||||
RefPtr<FramebufferDevice> m_framebuffer_device;
|
||||
RefPtr<Graphics::GenericFramebufferConsole> m_framebuffer_console;
|
||||
Spinlock m_console_mode_switch_lock;
|
||||
bool m_console_enabled { false };
|
||||
bool m_io_required { false };
|
||||
RefPtr<BochsDisplayConnector> m_display_connector;
|
||||
bool m_is_vga_capable { false };
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue