Skip to content

Commit

Permalink
kms: Debug statements
Browse files Browse the repository at this point in the history
  • Loading branch information
Drakulix committed Jan 17, 2024
1 parent 0780dd1 commit 2934266
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/backend/kms/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,9 @@ pub fn init_backend(
let backend = state.backend.kms();
if let Some(device) = backend.devices.get_mut(&node) {
device.explicit_clients.remove(&id);
info!(?device.render_node, "Explicit client {:?} removed", &id);
if !device.in_use(&backend.primary) {
info!(?device.render_node, "Device not in use, removing");
backend.api.as_mut().remove_node(&node);
}
}
Expand Down Expand Up @@ -658,6 +660,7 @@ impl State {
let mut w = self.common.shell.global_space().size.w;
{
let backend = self.backend.kms();
info!(?render_node, "Adding node for initialization");
backend
.api
.as_mut()
Expand Down Expand Up @@ -739,6 +742,10 @@ impl State {
}

if !device.in_use(&backend.primary) {
info!(
?render_node,
"Removing node after initialization - not in use"
);
backend.api.as_mut().remove_node(&render_node);
}

Expand Down Expand Up @@ -835,6 +842,8 @@ impl State {
outputs_removed.push(surface.output.clone());
}
}

info!(?device.render_node, "Device changed, adding node");
backend
.api
.as_mut()
Expand Down Expand Up @@ -913,6 +922,7 @@ impl State {
}

if !device.in_use(&backend.primary) {
info!(?device.render_node, "Changed device still unused, removing");
backend.api.as_mut().remove_node(&device.render_node);
}
}
Expand Down Expand Up @@ -1440,6 +1450,7 @@ impl Surface {
impl KmsState {
pub fn add_explicit_client(&mut self, node: DrmNode, id: ClientId) {
if let Some(device) = self.devices.get_mut(&node) {
info!(?node, "Explicit client {:?}, adding node", &id);
device.explicit_clients.insert(id);
if let Err(err) = self.api.as_mut().add_node(node, device.gbm.clone()) {
warn!("Failed to initialize device: {}", err);
Expand Down

0 comments on commit 2934266

Please sign in to comment.