2021-03-05 14:23:08 +02:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2021, Liav A. <liavalb@hotmail.co.il>
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <AK/String.h>
|
|
|
|
#include <AK/Types.h>
|
2021-06-25 09:46:17 +03:00
|
|
|
#include <Kernel/Bus/PCI/Definitions.h>
|
2021-03-05 14:23:08 +02:00
|
|
|
#include <Kernel/Devices/BlockDevice.h>
|
|
|
|
#include <Kernel/PhysicalAddress.h>
|
|
|
|
|
|
|
|
namespace Kernel {
|
|
|
|
class GraphicsDevice : public RefCounted<GraphicsDevice> {
|
|
|
|
public:
|
|
|
|
enum class Type {
|
|
|
|
VGACompatible,
|
|
|
|
Bochs,
|
|
|
|
SVGA,
|
|
|
|
Raw
|
|
|
|
};
|
|
|
|
virtual ~GraphicsDevice() = default;
|
|
|
|
virtual void initialize_framebuffer_devices() = 0;
|
|
|
|
virtual Type type() const = 0;
|
2021-04-16 22:58:51 +03:00
|
|
|
virtual void enable_consoles() = 0;
|
|
|
|
virtual void disable_consoles() = 0;
|
|
|
|
bool consoles_enabled() const { return m_consoles_enabled; }
|
|
|
|
virtual bool framebuffer_devices_initialized() const = 0;
|
2021-03-05 14:23:08 +02:00
|
|
|
|
2021-05-22 09:51:55 +03:00
|
|
|
virtual bool modesetting_capable() const = 0;
|
|
|
|
virtual bool double_framebuffering_capable() const = 0;
|
|
|
|
|
|
|
|
virtual bool try_to_set_resolution(size_t output_port_index, size_t width, size_t height) = 0;
|
|
|
|
virtual bool set_y_offset(size_t output_port_index, size_t y) = 0;
|
|
|
|
|
2021-03-05 14:23:08 +02:00
|
|
|
protected:
|
2021-07-03 05:04:02 +03:00
|
|
|
GraphicsDevice() = default;
|
2021-04-16 22:58:51 +03:00
|
|
|
|
|
|
|
bool m_consoles_enabled { false };
|
2021-03-05 14:23:08 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|