pub struct FramebufferCharDevice {
fb_resource: Arc<FramebufferResource>,
mappings: RwLock<BTreeMap<usize, MockMapping>>,
}Expand description
Framebuffer character device implementation
This device provides character-based access to framebuffer memory. It acts as a bridge between user-space programs and the graphics hardware through the GraphicsManager.
Note: This device is stateless and does not maintain position information. Position management is handled by the FileObject layer for proper POSIX semantics.
Fields§
§fb_resource: Arc<FramebufferResource>The framebuffer resource this device represents
mappings: RwLock<BTreeMap<usize, MockMapping>>Track mappings for testing purposes
Implementations§
Source§impl FramebufferCharDevice
impl FramebufferCharDevice
Sourcepub fn new(fb_resource: Arc<FramebufferResource>) -> Self
pub fn new(fb_resource: Arc<FramebufferResource>) -> Self
Sourcepub fn get_framebuffer_name(&self) -> &str
pub fn get_framebuffer_name(&self) -> &str
Get the framebuffer name this device represents
Source§impl FramebufferCharDevice
impl FramebufferCharDevice
Sourcefn current_var_info(&self) -> FbVarScreenInfo
fn current_var_info(&self) -> FbVarScreenInfo
Build a FbVarScreenInfo reflecting the current framebuffer configuration
Sourcefn handle_get_vscreeninfo(&self, arg: usize) -> Result<i32, &'static str>
fn handle_get_vscreeninfo(&self, arg: usize) -> Result<i32, &'static str>
Handle FBIOGET_VSCREENINFO control command
Sourcefn handle_get_fscreeninfo(&self, arg: usize) -> Result<i32, &'static str>
fn handle_get_fscreeninfo(&self, arg: usize) -> Result<i32, &'static str>
Handle FBIOGET_FSCREENINFO control command
Sourcefn handle_flush(&self, _arg: usize) -> Result<i32, &'static str>
fn handle_flush(&self, _arg: usize) -> Result<i32, &'static str>
Handle FBIO_FLUSH control command
This command forces any pending framebuffer changes to be displayed. For memory-mapped framebuffers, this typically involves ensuring CPU caches are flushed and any display controller updates are triggered.
Sourcefn trigger_display_update(&self) -> Result<(), &'static str>
fn trigger_display_update(&self) -> Result<(), &'static str>
Trigger display controller update
Some display controllers require explicit commands to update the display from framebuffer contents. This method handles such updates.
Sourcefn handle_put_vscreeninfo(&self, arg: usize) -> Result<i32, &'static str>
fn handle_put_vscreeninfo(&self, arg: usize) -> Result<i32, &'static str>
Handle FBIOPUT_VSCREENINFO control command
Trait Implementations§
Source§impl CharDevice for FramebufferCharDevice
impl CharDevice for FramebufferCharDevice
Source§fn read_byte(&self) -> Option<u8>
fn read_byte(&self) -> Option<u8>
Read a single byte from the framebuffer
This method is not supported in the new position-per-file-handle architecture. Use read_at() through a DevFileObject instead for proper position management.
§Returns
Always returns None to indicate unsupported operation
Source§fn write_byte(&self, _byte: u8) -> Result<(), &'static str>
fn write_byte(&self, _byte: u8) -> Result<(), &'static str>
Write a single byte to the framebuffer
This method is not supported in the new position-per-file-handle architecture. Use write_at() through a DevFileObject instead for proper position management.
§Arguments
_byte- The byte to write (ignored)
§Returns
Always returns an error to indicate unsupported operation