Skip to content
Merged
Show file tree
Hide file tree
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
12 changes: 11 additions & 1 deletion drivers/gpu/drm/asahi/file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1887,12 +1887,22 @@ impl File {
} else {
None
};
let cumulative_sync = gpu.as_any().is::<crate::g17::Gpu>() || {
#[cfg(CONFIG_DRM_ASAHI_G16)]
{
gpu.as_any().is::<crate::g16::Gpu>()
}
#[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::<crate::g17::Gpu>() || gpu.as_any().is::<crate::g16::Gpu>(),
cumulative_sync,
) {
Ok(syncs) => syncs,
Err(e) => {
Expand Down
3 changes: 2 additions & 1 deletion drivers/gpu/drm/asahi/g16/fence.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -350,14 +350,20 @@ def extract_function(text, name):
#[derive(Default)]
pub(crate) struct BundleLog {
pub(crate) published: Vec<Fence>,
pub(crate) compute_only: Vec<bool>,
pub(crate) failed: Vec<Fence>,
pub(crate) fail_publish: bool,
}

pub(crate) struct SignalBundle(pub(crate) Rc<RefCell<BundleLog>>);
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);
}
Expand Down
Loading