forge
Explore
Log in

Don't you dare go Hollow

B4: report GPU reset once at decoder poisoning, not on every poisoned() call

Browse files at this commit

392204e183bdcd4b959bc7973314e78f0a55210fAhmet Kaan GümüşParent: 3ca94e3
poisoned() is called from check_alive on every decode after poisoning, so
it bumped the global reset epoch each time and killed every live session.
poison() now reports only on the first transition.
Evidence: review of 3ca94e37; cargo check and clippy ec-hw clean.
crates/ec-hw/src/dec/mod.rsmodified+3 -1
@@ -473,7 +473,9 @@ impl Session {
473473 }
474474
475475 fn poison(&self) {
476- self.poisoned.store(true, Ordering::Release);
476+ if !self.poisoned.swap(true, Ordering::AcqRel) {
477+ crate::reset::report_gpu_reset();
478+ }
477479 }
478480
479481 /// Wait for a submitted picture, condemning every session on a reset.
crates/ec-hw/src/error.rsmodified+0 -1
@@ -55,7 +55,6 @@ impl Error {
5555
5656 /// The decoder was poisoned by a hung or lost GPU context.
5757 pub fn poisoned(what: impl Into<String>) -> Error {
58- crate::reset::report_gpu_reset();
5958 Error::hw_reset(format!("hardware decoder poisoned: {}", what.into()))
6059 }
6160