/* * Copyright (c) 2021, Sahan Fernando * * SPDX-License-Identifier: BSD-2-Clause */ #pragma once #include #include #include namespace Kernel::Graphics::VirtIOGPU { class GraphicsAdapter final : public GraphicsDevice , public PCI::DeviceController { AK_MAKE_ETERNAL public: static NonnullRefPtr initialize(PCI::Address); virtual bool framebuffer_devices_initialized() const override { return m_created_framebuffer_devices; } private: explicit GraphicsAdapter(PCI::Address base_address); virtual void initialize_framebuffer_devices() override; virtual Type type() const override { return Type::Raw; } virtual void enable_consoles() override; virtual void disable_consoles() override; virtual bool modesetting_capable() const override { return false; } virtual bool double_framebuffering_capable() const override { return false; } virtual bool try_to_set_resolution(size_t, size_t, size_t) override { return false; } virtual bool set_y_offset(size_t, size_t) override { return false; } RefPtr m_gpu_device; bool m_created_framebuffer_devices { false }; }; }