Kernel/Graphics: Re-organize the DisplayConnector class a bit

Move methods that are overriding the virtual methods in the File class,
to a private access scope in the DisplayConnector class because nobody
tries to access them in any derived class of this class.
This commit is contained in:
Liav A 2022-06-10 20:25:22 +03:00 committed by Linus Groh
parent 6291821489
commit 938d579d16
Notes: sideshowbarker 2024-07-17 10:19:55 +09:00

View file

@ -105,16 +105,6 @@ public:
protected:
void set_edid_bytes(Array<u8, 128> const& edid_bytes);
// ^File
virtual bool is_seekable() const override { return true; }
virtual bool can_read(OpenFileDescription const&, u64) const final override { return true; }
virtual bool can_write(OpenFileDescription const&, u64) const final override { return true; }
virtual ErrorOr<size_t> read(OpenFileDescription&, u64, UserOrKernelBuffer&, size_t) override final;
virtual ErrorOr<size_t> write(OpenFileDescription&, u64, UserOrKernelBuffer const&, size_t) override final;
virtual ErrorOr<Memory::Region*> mmap(Process&, OpenFileDescription&, Memory::VirtualRange const&, u64, int, bool) override final;
virtual ErrorOr<void> ioctl(OpenFileDescription&, unsigned request, Userspace<void*> arg) override final;
virtual StringView class_name() const override final { return "DisplayConnector"sv; }
DisplayConnector(PhysicalAddress framebuffer_address, size_t framebuffer_resource_size, bool enable_write_combine_optimization);
DisplayConnector(size_t framebuffer_resource_size, bool enable_write_combine_optimization);
virtual void enable_console() = 0;
@ -141,6 +131,16 @@ protected:
u8* framebuffer_data() { return m_framebuffer_data; }
private:
// ^File
virtual bool is_seekable() const override { return true; }
virtual bool can_read(OpenFileDescription const&, u64) const final override { return true; }
virtual bool can_write(OpenFileDescription const&, u64) const final override { return true; }
virtual ErrorOr<size_t> read(OpenFileDescription&, u64, UserOrKernelBuffer&, size_t) override final;
virtual ErrorOr<size_t> write(OpenFileDescription&, u64, UserOrKernelBuffer const&, size_t) override final;
virtual ErrorOr<Memory::Region*> mmap(Process&, OpenFileDescription&, Memory::VirtualRange const&, u64, int, bool) override final;
virtual ErrorOr<void> ioctl(OpenFileDescription&, unsigned request, Userspace<void*> arg) override final;
virtual StringView class_name() const override final { return "DisplayConnector"sv; }
DisplayConnector& operator=(DisplayConnector const&) = delete;
DisplayConnector& operator=(DisplayConnector&&) = delete;
DisplayConnector(DisplayConnector&&) = delete;