Struct GraphicsManager
Source pub struct GraphicsManager {
framebuffers: Mutex<Option<HashMap<String, Arc<FramebufferResource>>>>,
display_configs: Mutex<Vec<DisplayConfiguration>>,
active_mappings: Mutex<Vec<MmapRegion>>,
}
Expand description
Graphics Manager - singleton for managing graphics resources
Framebuffer resources mapped by logical name
Multi-display configuration (future use)
Active mmap regions (future use)
Create a new GraphicsManager instance
Get reference to the global GraphicsManager instance
Discover and register graphics devices from DeviceManager
This method scans all devices in the DeviceManager for graphics devices
and extracts their framebuffer resources for management.
Register a framebuffer resource from a specific graphics device
§Arguments
device_name - The name of the device in DeviceManager
device - The shared device reference
§Returns
Result indicating success or failure
Get a framebuffer resource by logical name
§Arguments
fb_name - The logical name of the framebuffer (e.g., “fb0”)
§Returns
Optional reference to the framebuffer resource
Get all registered framebuffer names
§Returns
Vector of logical framebuffer names
Get number of registered framebuffers
§Returns
Number of registered framebuffers
Create a FramebufferCharDevice and register it with DeviceManager
§Arguments
fb_name - The logical name of the framebuffer (e.g., “fb0”)
§Returns
Result indicating success or failure
Update the character device ID for a framebuffer resource
§Arguments
fb_name - The logical name of the framebuffer
char_device_id - The character device ID from DeviceManager
§Returns
Result indicating success or failure
Read a single byte from the specified framebuffer
§Arguments
fb_name - The logical name of the framebuffer
position - The position to read from
§Returns
The byte at the specified position, or None if invalid
Write a single byte to the specified framebuffer
§Arguments
fb_name - The logical name of the framebuffer
position - The position to write to
byte - The byte to write
§Returns
Result indicating success or failure
Read multiple bytes from the specified framebuffer
§Arguments
fb_name - The logical name of the framebuffer
position - The starting position to read from
buffer - The buffer to read data into
§Returns
The number of bytes actually read
Write multiple bytes to the specified framebuffer
§Arguments
fb_name - The logical name of the framebuffer
position - The starting position to write to
buffer - The buffer containing data to write
§Returns
Result containing the number of bytes written or an error
Immutably borrows from an owned value.
Read more
Mutably borrows from an owned value.
Read more
Returns the argument unchanged.
Calls U::from(self).
That is, this conversion is whatever the implementation of
[From]<T> for U chooses to do.
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.