diff --git a/drivers/gpu/drm/asahi/g16/power.rs b/drivers/gpu/drm/asahi/g16/power.rs index a68b6c67a95ee..7e0aee12eb862 100644 --- a/drivers/gpu/drm/asahi/g16/power.rs +++ b/drivers/gpu/drm/asahi/g16/power.rs @@ -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)>, + /// 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, } @@ -311,6 +315,8 @@ impl Power { sensor_errors: 0, decisions: 0, last_decision: None, + throttled: true, + decisions_at_throttle: 0, utilization: policy::Governor::new(), }) } @@ -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,