Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 32 additions & 1 deletion drivers/gpu/drm/asahi/g16/power.rs
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,10 @@ pub(crate) struct Power {
pub(crate) sensor_errors: u64,
pub(crate) decisions: u64,
last_decision: Option<(u32, u32, u32, u32, u32, Option<Error>)>,
/// The ceiling was below the top state at the last decision (startup holds it low).
throttled: bool,
/// `decisions` when the ceiling last left the top state.
decisions_at_throttle: u64,
pub(crate) utilization: policy::Governor,
}

Expand Down Expand Up @@ -311,6 +315,8 @@ impl Power {
sensor_errors: 0,
decisions: 0,
last_decision: None,
throttled: true,
decisions_at_throttle: 0,
utilization: policy::Governor::new(),
})
}
Expand Down Expand Up @@ -493,7 +499,32 @@ impl Firmware {
.utilization
.govern(now, limit, !self.engine.flights.is_empty());
if decision {
dev_info!(
// Each decision goes to the debug log: under sustained heat the governor, budget and
// backstop move several times a second. The info log gets only the edges: the
// ceiling leaving the top state and coming back to it.
let throttled = limit < self.power.top;
if self.power.throttled != throttled {
self.power.throttled = throttled;
if throttled {
self.power.decisions_at_throttle = self.power.decisions;
dev_info!(
self.dev(),
"M4 cooling: ceiling S{} below the top S{} at {} mC\n",
limit,
self.power.top,
self.power.temperature_mc
);
} else {
dev_info!(
self.dev(),
"M4 cooling: back at the top S{} at {} mC after {} decisions\n",
limit,
self.power.temperature_mc,
self.power.decisions - self.power.decisions_at_throttle
);
}
}
dev_dbg!(
self.dev(),
"M4 cooling: sample_ns={:?} mc={} sensor={:?} governor={} power={} backstop={} clpc_cap={}mW(L{}) limit=S{}\n",
self.power.last_sample_ns,
Expand Down
Loading