gfx_hal/display/control.rs
1//! Display power control structures.
2
3/// Error occurring while controlling the display power.
4#[derive(Clone, Debug, PartialEq, thiserror::Error)]
5pub enum DisplayControlError {
6 /// Host memory exhausted.
7 #[error("Out of host memory")]
8 OutOfHostMemory,
9 /// The feature is unsupported by the device
10 #[error("The feature is unsupported by the device")]
11 UnsupportedFeature,
12}
13
14/// Available power states of a display.
15#[derive(Clone, Debug, PartialEq)]
16pub enum PowerState {
17 /// Specifies that the display is powered down
18 Off,
19 /// Specifies that the display is put into a low power mode, from which it may be able to transition back to PowerState::On more quickly than if it were in PowerState::Off.
20 /// This state may be the same as PowerState::Off
21 Suspend,
22 /// Specifies that the display is powered on.
23 On,
24}
25
26/// Device event
27#[derive(Clone, Debug, PartialEq)]
28pub enum DeviceEvent {
29 /// Specifies that the fence is signaled when a display is plugged into or unplugged from the specified device.
30 /// Applications can use this notification to determine when they need to re-enumerate the available displays on a device.
31 DisplayHotplug,
32}
33
34/// Device event
35#[derive(Clone, Debug, PartialEq)]
36pub enum DisplayEvent {
37 /// Specifies that the fence is signaled when the first pixel of the next display refresh cycle leaves the display engine for the display.
38 FirstPixelOut,
39}