head-management: add drm-color-space-info-v1 extension
This commit is contained in:
parent
1195613fc6
commit
6647b93e1e
9 changed files with 117 additions and 1 deletions
|
|
@ -1,6 +1,9 @@
|
|||
use {
|
||||
crate::{
|
||||
backend::{ConnectorId, Mode, MonitorInfo, transaction::BackendConnectorTransactionError},
|
||||
backend::{
|
||||
BackendColorSpace, BackendTransferFunction, ConnectorId, Mode, MonitorInfo,
|
||||
transaction::BackendConnectorTransactionError,
|
||||
},
|
||||
client::ClientId,
|
||||
format::Format,
|
||||
globals::GlobalName,
|
||||
|
|
@ -84,6 +87,8 @@ pub struct HeadState {
|
|||
pub tearing_enabled: bool,
|
||||
pub tearing_active: bool,
|
||||
pub format: &'static Format,
|
||||
pub color_space: BackendColorSpace,
|
||||
pub transfer_function: BackendTransferFunction,
|
||||
}
|
||||
|
||||
impl HeadState {
|
||||
|
|
@ -420,4 +425,21 @@ impl HeadManagers {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub fn handle_colors_change(
|
||||
&self,
|
||||
color_space: BackendColorSpace,
|
||||
transfer_function: BackendTransferFunction,
|
||||
) {
|
||||
let state = &mut *self.state.borrow_mut();
|
||||
state.color_space = color_space;
|
||||
state.transfer_function = transfer_function;
|
||||
for head in self.managers.lock().values() {
|
||||
skip_in_transaction!(head);
|
||||
if let Some(ext) = &head.ext.drm_color_space_info_v1 {
|
||||
ext.send_state(state);
|
||||
head.session.schedule_done();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue