mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 16:42:44 +00:00 
			
		
		
		
	 9ee098b119
			
		
	
	
		9ee098b119
		
	
	
	
	
		
			
			Like the HID, Audio and Storage subsystem, the Graphics subsystem (which
handles GPUs technically) exposes unix device files (typically in /dev).
To ensure consistency across the repository, move all related files to a
new directory under Kernel/Devices called "GPU".
Also remove the redundant "GPU" word from the VirtIO driver directory,
and the word "Graphics" from GraphicsManagement.{h,cpp} filenames.
		
	
			
		
			
				
	
	
		
			59 lines
		
	
	
	
		
			2.3 KiB
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			59 lines
		
	
	
	
		
			2.3 KiB
		
	
	
	
		
			C++
		
	
	
	
	
	
| /*
 | |
|  * Copyright (c) 2022, Liav A. <liavalb@hotmail.co.il>
 | |
|  *
 | |
|  * SPDX-License-Identifier: BSD-2-Clause
 | |
|  */
 | |
| 
 | |
| #pragma once
 | |
| 
 | |
| #include <AK/Try.h>
 | |
| #include <Kernel/Devices/GPU/Bochs/Definitions.h>
 | |
| #include <Kernel/Devices/GPU/Console/GenericFramebufferConsole.h>
 | |
| #include <Kernel/Devices/GPU/DisplayConnector.h>
 | |
| #include <Kernel/Library/LockRefPtr.h>
 | |
| #include <Kernel/Locking/Spinlock.h>
 | |
| #include <Kernel/Memory/TypedMapping.h>
 | |
| 
 | |
| namespace Kernel {
 | |
| 
 | |
| struct BochsDisplayMMIORegisters;
 | |
| class QEMUDisplayConnector final
 | |
|     : public DisplayConnector {
 | |
|     friend class BochsGraphicsAdapter;
 | |
|     friend class DeviceManagement;
 | |
| 
 | |
| public:
 | |
|     AK_TYPEDEF_DISTINCT_ORDERED_ID(u16, IndexID);
 | |
| 
 | |
|     static NonnullLockRefPtr<QEMUDisplayConnector> must_create(PhysicalAddress framebuffer_address, size_t framebuffer_resource_size, Memory::TypedMapping<BochsDisplayMMIORegisters volatile>);
 | |
| 
 | |
| private:
 | |
|     IndexID index_id() const;
 | |
| 
 | |
|     ErrorOr<void> fetch_and_initialize_edid();
 | |
|     ErrorOr<void> create_attached_framebuffer_console();
 | |
|     QEMUDisplayConnector(PhysicalAddress framebuffer_address, size_t framebuffer_resource_size, Memory::TypedMapping<BochsDisplayMMIORegisters volatile>);
 | |
| 
 | |
|     virtual bool mutable_mode_setting_capable() const override final { return true; }
 | |
|     virtual bool double_framebuffering_capable() const override { return true; }
 | |
|     virtual ErrorOr<void> set_mode_setting(ModeSetting const&) override;
 | |
|     virtual ErrorOr<void> set_y_offset(size_t y) override;
 | |
|     virtual ErrorOr<void> set_safe_mode_setting() override final;
 | |
|     virtual ErrorOr<void> unblank() override;
 | |
|     virtual bool partial_flush_support() const override final { return false; }
 | |
|     virtual bool flush_support() const override final { return false; }
 | |
|     // Note: Paravirtualized hardware doesn't require a defined refresh rate for modesetting.
 | |
|     virtual bool refresh_rate_support() const override final { return false; }
 | |
|     virtual ErrorOr<void> flush_first_surface() override final;
 | |
| 
 | |
|     void set_framebuffer_to_big_endian_format();
 | |
|     void set_framebuffer_to_little_endian_format();
 | |
| 
 | |
|     virtual void enable_console() override final;
 | |
|     virtual void disable_console() override final;
 | |
| 
 | |
|     LockRefPtr<Graphics::GenericFramebufferConsole> m_framebuffer_console;
 | |
| 
 | |
|     Memory::TypedMapping<BochsDisplayMMIORegisters volatile> m_registers;
 | |
| };
 | |
| }
 |