Skip to content

Commit 643c2f6

Browse files
hoshinolinajannau
authored andcommitted
fixup! drm/asahi: Add the Asahi driver for Apple AGX GPUs
1 parent d85ac21 commit 643c2f6

2 files changed

Lines changed: 19 additions & 13 deletions

File tree

drivers/gpu/drm/asahi/file.rs

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -88,18 +88,16 @@ impl SyncItem {
8888
let fence = if out {
8989
None
9090
} else {
91-
Some(
92-
syncobj
93-
.fence_get()
94-
.ok_or_else(|| {
95-
cls_pr_debug!(
96-
Errors,
97-
"Failed to get fence from timeline sync object\n"
98-
);
99-
EINVAL
100-
})?
101-
.chain_find_seqno(data.timeline_value)?,
102-
)
91+
syncobj
92+
.fence_get()
93+
.ok_or_else(|| {
94+
cls_pr_debug!(
95+
Errors,
96+
"Failed to get fence from timeline sync object\n"
97+
);
98+
EINVAL
99+
})?
100+
.chain_find_seqno(data.timeline_value)?
103101
};
104102

105103
Ok(SyncItem {

drivers/gpu/drm/asahi/queue/mod.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -574,6 +574,12 @@ impl Queue for Queue::ver {
574574

575575
mod_dev_dbg!(self.dev, "[Submission {}] Creating job\n", id);
576576

577+
// FIXME: I think this can violate the fence seqno ordering contract.
578+
// If we have e.g. a render submission with no barriers and then a compute submission
579+
// with no barriers, it's possible for the compute submission to complete first, and
580+
// therefore its fence. Maybe we should have separate fence contexts for render
581+
// and compute, and then do a ? (Vert+frag should be fine since there is no vert
582+
// without frag, and frag always serializes.)
577583
let fence: UserFence<JobFence::ver> = self
578584
.fence_ctx
579585
.new_fence::<JobFence::ver>(
@@ -616,7 +622,9 @@ impl Queue for Queue::ver {
616622
in_syncs.len()
617623
);
618624
for sync in in_syncs {
619-
job.add_dependency(sync.fence.expect("in_sync missing fence"))?;
625+
if let Some(fence) = sync.fence {
626+
job.add_dependency(fence)?;
627+
}
620628
}
621629

622630
let mut last_render = None;

0 commit comments

Comments
 (0)