GraphicsManager

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

Fields§

§framebuffers: Mutex<Option<HashMap<String, Arc<FramebufferResource>>>>

Framebuffer resources mapped by logical name

§display_configs: Mutex<Vec<DisplayConfiguration>>

Multi-display configuration (future use)

§active_mappings: Mutex<Vec<MmapRegion>>

Active mmap regions (future use)

Implementations§

Source§

impl GraphicsManager

Source

pub const fn new() -> Self

Create a new GraphicsManager instance

Source

pub fn get_manager() -> &'static GraphicsManager

Get reference to the global GraphicsManager instance

Source

pub fn discover_graphics_devices(&self)

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.

Source

pub fn register_framebuffer_from_device( &self, device_id: usize, device: SharedDevice, ) -> Result<(), &'static str>

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

Source

pub fn get_framebuffer(&self, fb_name: &str) -> Option<Arc<FramebufferResource>>

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

Source

pub fn get_framebuffer_names(&self) -> Vec<String>

Get all registered framebuffer names

§Returns

Vector of logical framebuffer names

Source

pub fn get_framebuffer_count(&self) -> usize

Get number of registered framebuffers

§Returns

Number of registered framebuffers

Source

pub fn create_framebuffer_char_device( &self, fb_name: &str, ) -> Result<(), &'static str>

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

Source

pub fn set_char_device_id( &self, fb_name: &str, char_device_id: usize, ) -> Result<(), &'static str>

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

Source

pub fn read_byte_from_framebuffer( &self, fb_name: &str, position: usize, ) -> Option<u8>

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

Source

pub fn write_byte_to_framebuffer( &self, fb_name: &str, position: usize, byte: u8, ) -> Result<(), &'static str>

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

Source

pub fn read_framebuffer( &self, fb_name: &str, position: usize, buffer: &mut [u8], ) -> usize

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

Source

pub fn write_framebuffer( &self, fb_name: &str, position: usize, buffer: &[u8], ) -> Result<usize, &'static str>

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

Auto Trait Implementations§

§

impl !Freeze for GraphicsManager

§

impl !RefUnwindSafe for GraphicsManager

§

impl Send for GraphicsManager

§

impl Sync for GraphicsManager

§

impl Unpin for GraphicsManager

§

impl !UnwindSafe for GraphicsManager

Blanket Implementations§

§

impl<T> Any for T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Into<U> for T
where U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.