1
0
Fork 0
forked from wry/wry

metal: allow configuring framebuffer formats

This commit is contained in:
Julian Orth 2024-09-04 19:56:01 +02:00
parent 9bab4f7ce1
commit b4ca15fec0
24 changed files with 713 additions and 58 deletions

View file

@ -25,7 +25,7 @@ use {
timer::Timer,
video::{
connector_type::{ConnectorType, CON_UNKNOWN},
Connector, DrmDevice, GfxApi, Mode, TearingMode, Transform, VrrMode,
Connector, DrmDevice, Format, GfxApi, Mode, TearingMode, Transform, VrrMode,
},
Axis, Direction, ModifiedKeySym, PciId, Workspace,
},
@ -754,6 +754,10 @@ impl Client {
self.send(&ClientMessage::ConnectorSetScale { connector, scale });
}
pub fn connector_set_format(&self, connector: Connector, format: Format) {
self.send(&ClientMessage::ConnectorSetFormat { connector, format });
}
pub fn connector_get_scale(&self, connector: Connector) -> f64 {
let res = self.send_with_response(&ClientMessage::ConnectorGetScale { connector });
get_response!(res, 1.0, ConnectorGetScale { scale });

View file

@ -9,8 +9,8 @@ use {
theme::{colors::Colorable, sized::Resizable, Color},
timer::Timer,
video::{
connector_type::ConnectorType, Connector, DrmDevice, GfxApi, TearingMode, Transform,
VrrMode,
connector_type::ConnectorType, Connector, DrmDevice, Format, GfxApi, TearingMode,
Transform, VrrMode,
},
Axis, Direction, PciId, Workspace,
_private::{PollableId, WireMode},
@ -509,6 +509,10 @@ pub enum ClientMessage<'a> {
SetEiSocketEnabled {
enabled: bool,
},
ConnectorSetFormat {
connector: Connector,
format: Format,
},
}
#[derive(Serialize, Deserialize, Debug)]