Skip to content

Commit

Permalink
drm/surface/legacy: Remove unused active field of State
Browse files Browse the repository at this point in the history
This field is currently set, but never read.

This logically doesn't need to be part of `state`/`pending` either,
since a full commit is not needed to change the DPMS state.
  • Loading branch information
ids1024 committed Oct 9, 2024
1 parent 11503c3 commit c54e079
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions src/backend/drm/surface/legacy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ use tracing::{debug, info, info_span, instrument, trace};

#[derive(Debug, PartialEq, Eq, Clone)]
pub struct State {
pub active: bool,
pub mode: Mode,
pub connectors: HashSet<connector::Handle>,
}
Expand Down Expand Up @@ -74,9 +73,6 @@ impl State {
// we need to be sure, we require a mode to always be set without relying on the compiler.
// So we cheat, because it works and is easier to handle later.
Ok(State {
// On legacy there is not (reliable) way to read-back the dpms state.
// So we just always assume it is off.
active: false,
mode: current_mode.unwrap_or_else(|| unsafe { std::mem::zeroed() }),
connectors: current_connectors,
})
Expand Down Expand Up @@ -107,7 +103,6 @@ impl LegacyDrmSurface {

let state = State::current_state(&*fd, crtc)?;
let pending = State {
active: true,
mode,
connectors: connectors.iter().copied().collect(),
};
Expand Down

0 comments on commit c54e079

Please sign in to comment.