Skip to content

Commit 695183d

Browse files
bwidawskDrakulix
authored andcommitted
Add Display impl for few more KMS objects
1 parent 9208993 commit 695183d

File tree

4 files changed

+24
-0
lines changed

4 files changed

+24
-0
lines changed

src/control/crtc.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,12 @@ pub struct Info {
6262
pub(crate) gamma_length: u32,
6363
}
6464

65+
impl std::fmt::Display for Info {
66+
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
67+
write!(f, "CRTC {}", self.handle.0)
68+
}
69+
}
70+
6571
impl Info {
6672
/// Returns the handle to this CRTC.
6773
pub fn handle(&self) -> Handle {

src/control/encoder.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,12 @@ pub struct Info {
5353
pub(crate) pos_clones: u32,
5454
}
5555

56+
impl std::fmt::Display for Info {
57+
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
58+
write!(f, "Encoder {}", self.handle.0)
59+
}
60+
}
61+
5662
impl Info {
5763
/// Returns the handle to this encoder.
5864
pub fn handle(&self) -> Handle {

src/control/framebuffer.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,12 @@ pub struct Info {
5555
pub(crate) buffer: Option<buffer::Handle>,
5656
}
5757

58+
impl std::fmt::Display for Info {
59+
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
60+
write!(f, "Framebuffer {}", self.handle.0)
61+
}
62+
}
63+
5864
impl Info {
5965
/// Returns the handle to this framebuffer.
6066
pub fn handle(&self) -> Handle {

src/control/plane.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,12 @@ pub struct Info {
6565
pub(crate) formats: Vec<u32>,
6666
}
6767

68+
impl std::fmt::Display for Info {
69+
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
70+
write!(f, "Plane {}", self.handle.0)
71+
}
72+
}
73+
6874
impl Info {
6975
/// Returns the handle to this plane.
7076
pub fn handle(&self) -> Handle {

0 commit comments

Comments
 (0)