drivers/graphics: Require Debug to be implemented for Buffer
This commit is contained in:
@@ -77,7 +77,7 @@ pub trait GraphicsAdapter: Sized + Debug {
|
||||
fn handle_cursor(&mut self, cursor: Option<&CursorPlane<Self::Buffer>>, dirty_fb: bool);
|
||||
}
|
||||
|
||||
pub trait Buffer {
|
||||
pub trait Buffer: Debug {
|
||||
fn width(&self) -> u32;
|
||||
fn height(&self) -> u32;
|
||||
}
|
||||
|
||||
@@ -146,6 +146,7 @@ impl DeviceFb {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct DumbFb {
|
||||
width: usize,
|
||||
height: usize,
|
||||
|
||||
@@ -179,6 +179,7 @@ impl FrameBuffer {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct GraphicScreen {
|
||||
width: usize,
|
||||
height: usize,
|
||||
|
||||
@@ -42,6 +42,17 @@ pub struct VirtGpuFramebuffer<'a> {
|
||||
height: u32,
|
||||
}
|
||||
|
||||
impl<'a> fmt::Debug for VirtGpuFramebuffer<'a> {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
f.debug_struct("VirtGpuFramebuffer")
|
||||
.field("id", &self.id)
|
||||
.field("sgl", &self.sgl)
|
||||
.field("width", &self.width)
|
||||
.field("height", &self.height)
|
||||
.finish_non_exhaustive()
|
||||
}
|
||||
}
|
||||
|
||||
impl DrmBuffer for VirtGpuFramebuffer<'_> {
|
||||
fn width(&self) -> u32 {
|
||||
self.width
|
||||
|
||||
Reference in New Issue
Block a user