metal: allow configuring framebuffer formats
This commit is contained in:
parent
9bab4f7ce1
commit
b4ca15fec0
24 changed files with 713 additions and 58 deletions
|
|
@ -7,6 +7,7 @@ use {
|
|||
},
|
||||
compositor::MAX_EXTENTS,
|
||||
config::ConfigProxy,
|
||||
format::config_formats,
|
||||
ifs::wl_seat::{SeatId, WlSeatGlobal},
|
||||
io_uring::TaskResultExt,
|
||||
output_schedule::map_cursor_hz,
|
||||
|
|
@ -49,8 +50,8 @@ use {
|
|||
theme::{colors::Colorable, sized::Resizable},
|
||||
timer::Timer as JayTimer,
|
||||
video::{
|
||||
Connector, DrmDevice, GfxApi, TearingMode as ConfigTearingMode, Transform,
|
||||
VrrMode as ConfigVrrMode,
|
||||
Connector, DrmDevice, Format as ConfigFormat, GfxApi, TearingMode as ConfigTearingMode,
|
||||
Transform, VrrMode as ConfigVrrMode,
|
||||
},
|
||||
Axis, Direction, Workspace,
|
||||
},
|
||||
|
|
@ -1051,6 +1052,19 @@ impl ConfigProxyHandler {
|
|||
Ok(())
|
||||
}
|
||||
|
||||
fn handle_connector_set_format(
|
||||
&self,
|
||||
connector: Connector,
|
||||
format: ConfigFormat,
|
||||
) -> Result<(), CphError> {
|
||||
let Some(&format) = config_formats().get(&format) else {
|
||||
return Err(CphError::UnknownFormat(format));
|
||||
};
|
||||
let connector = self.get_connector(connector)?;
|
||||
connector.connector.set_fb_format(format);
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn handle_set_vrr_mode(
|
||||
&self,
|
||||
connector: Option<Connector>,
|
||||
|
|
@ -1919,6 +1933,9 @@ impl ConfigProxyHandler {
|
|||
ClientMessage::SetEiSocketEnabled { enabled } => {
|
||||
self.handle_set_ei_socket_enabled(enabled)
|
||||
}
|
||||
ClientMessage::ConnectorSetFormat { connector, format } => self
|
||||
.handle_connector_set_format(connector, format)
|
||||
.wrn("connector_set_format")?,
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
|
@ -1986,6 +2003,8 @@ enum CphError {
|
|||
InvalidCursorHz(f64),
|
||||
#[error("Unknown tearing mode {0:?}")]
|
||||
UnknownTearingMode(ConfigTearingMode),
|
||||
#[error("The format {0:?} is unknown")]
|
||||
UnknownFormat(ConfigFormat),
|
||||
}
|
||||
|
||||
trait WithRequestName {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue