Skip to content
Merged
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
31 changes: 9 additions & 22 deletions drivers/gpu/drm/asahi/g17/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -900,8 +900,9 @@ impl Firmware {
}

/// Both outer slots and their capacity are checked before any host-port
/// write. An EAGAIN retry drops the old views and revalidates them under a
/// power hold. After a successful transaction, publication is infallible.
/// write. The host command port needs no core power, and its transaction
/// fails only once the register mapping is gone; the error propagates.
/// After a successful transaction, publication is infallible.
fn submit_m5_render_pair(
&mut self,
priority: u8,
Expand All @@ -912,26 +913,12 @@ impl Firmware {
deferred: bool,
cursors: Option<[u32; 3]>,
) -> Result<[u32; 2]> {
let mut commit_accounting = Some(commit_accounting);
let mut publish_inner = Some(publish_inner);
let mut cursors = cursors;
for attempt in 0..2 {
let pair = self.init.m5_work_pair(priority, &records[0], &records[1], cursors.take())?;
pair.prepare();
if let Some(commit) = commit_accounting.take() { commit()?; }
match self.bridge.regs.submit_m5_work(submission) {
Err(error) if error == EAGAIN && attempt == 0 => {
drop(pair);
self.acquire_registration_power()?;
}
Err(error) => return Err(error),
Ok(()) => {
if let Some(publish) = publish_inner.take() { publish(); }
return Ok(if deferred { pair.next() } else { pair.publish() });
}
}
}
Err(EAGAIN)
let pair = self.init.m5_work_pair(priority, &records[0], &records[1], cursors)?;
pair.prepare();
commit_accounting()?;
self.bridge.regs.submit_m5_work(submission)?;
publish_inner();
Ok(if deferred { pair.next() } else { pair.publish() })
}

/// Called at actual submission publication, not while a queued job is merely being built.
Expand Down
Loading