/* * Copyright (c) 2021, Liav A. * * SPDX-License-Identifier: BSD-2-Clause */ #pragma once #include #include #include #include #include namespace Kernel { class BochsFramebufferDevice final : public FramebufferDevice { AK_MAKE_ETERNAL friend class BochsGraphicsAdapter; public: static NonnullRefPtr create(const BochsGraphicsAdapter&, PhysicalAddress, size_t, size_t, size_t); virtual size_t framebuffer_size_in_bytes() const override { return m_framebuffer_pitch * m_framebuffer_height * 2; } virtual ~BochsFramebufferDevice() = default; private: virtual int ioctl(FileDescription&, unsigned request, FlatPtr arg) override; BochsFramebufferDevice(const BochsGraphicsAdapter&, PhysicalAddress, size_t, size_t, size_t); virtual const char* class_name() const override { return "BXVGA"; } void set_y_offset(size_t); size_t m_y_offset { 0 }; NonnullRefPtr m_bochs_adapter; }; }