diff --git a/drivers/gpu/drm/asahi/file.rs b/drivers/gpu/drm/asahi/file.rs index be78c01b39aff..cdd367f64b638 100644 --- a/drivers/gpu/drm/asahi/file.rs +++ b/drivers/gpu/drm/asahi/file.rs @@ -1887,12 +1887,22 @@ impl File { } else { None }; + let cumulative_sync = gpu.as_any().is::() || { + #[cfg(CONFIG_DRM_ASAHI_G16)] + { + gpu.as_any().is::() + } + #[cfg(not(CONFIG_DRM_ASAHI_G16))] + { + false + } + }; let syncs = match SyncItem::parse_array( file, data.syncs, data.in_sync_count, data.out_sync_count, - gpu.as_any().is::() || gpu.as_any().is::(), + cumulative_sync, ) { Ok(syncs) => syncs, Err(e) => { diff --git a/drivers/gpu/drm/asahi/g16/fence.rs b/drivers/gpu/drm/asahi/g16/fence.rs index 75ca2b6768c81..e223c74f9c853 100644 --- a/drivers/gpu/drm/asahi/g16/fence.rs +++ b/drivers/gpu/drm/asahi/g16/fence.rs @@ -588,7 +588,8 @@ impl Syncs { pub(crate) fn publish(&mut self, fence: &Fence) -> Result { let first = self.input_count.min(self.syncs.len()); if let Some(bundle) = &mut self.cumulative { - bundle.publish(fence)?; + // G16 has its own power/DVFS path; never poke G17's non-M5 compute-waiter hook. + bundle.publish(fence, false)?; self.cumulative = None; self.syncs.truncate(first); return Ok(()); diff --git a/tools/testing/selftests/drivers/gpu/asahi-m4/test-fence-signalling.py b/tools/testing/selftests/drivers/gpu/asahi-m4/test-fence-signalling.py index 0843277bc9368..ffc523fa9f5e3 100644 --- a/tools/testing/selftests/drivers/gpu/asahi-m4/test-fence-signalling.py +++ b/tools/testing/selftests/drivers/gpu/asahi-m4/test-fence-signalling.py @@ -350,14 +350,20 @@ def extract_function(text, name): #[derive(Default)] pub(crate) struct BundleLog { pub(crate) published: Vec, + pub(crate) compute_only: Vec, pub(crate) failed: Vec, pub(crate) fail_publish: bool, } pub(crate) struct SignalBundle(pub(crate) Rc>); impl SignalBundle { - pub(crate) fn publish(&mut self, fence: &Fence) -> Result { + pub(crate) fn publish(&mut self, fence: &Fence, compute_only: bool) -> Result { + assert!( + !compute_only, + "G16 must not trigger G17 compute-waiter effort accounting" + ); let mut log = self.0.borrow_mut(); + log.compute_only.push(compute_only); if log.fail_publish { return Err(ENOMEM); }