Skip to content

Commit 658743a

Browse files
committed
drm/asahi: workqueue: Drop completed work items
This reverts commit 513cd15 ("drm/asahi: workqueue: Defer freeing the last completed work item") in asahi-6.17.9-1. Keeping the last completed work item limits the number of user space queues to at most 127 (the number of slots available for the BufferManager) since each work item keeps a slot alive. Signed-off-by: Janne Grunau <j@jannau.net>
1 parent d26a4ec commit 658743a

1 file changed

Lines changed: 1 addition & 18 deletions

File tree

drivers/gpu/drm/asahi/workqueue.rs

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,6 @@ struct WorkQueueInner {
233233
size: u32,
234234
wptr: u32,
235235
pending: KVec<Pin<KBox<SubmittedWorkContainer>>>,
236-
last_completed_work: Option<Pin<KBox<SubmittedWorkContainer>>>,
237236
last_token: Option<event::Token>,
238237
pending_jobs: usize,
239238
last_submitted: Option<event::EventValue>,
@@ -715,7 +714,6 @@ impl WorkQueue::ver {
715714
size,
716715
wptr: 0,
717716
pending: KVec::new(),
718-
last_completed_work: None,
719717
last_token: None,
720718
event: None,
721719
priority,
@@ -909,22 +907,16 @@ impl WorkQueue for WorkQueue::ver {
909907
let last_wptr = inner.pending[completed_commands - 1].inner.wptr();
910908
let pipe_type = inner.pipe_type;
911909

912-
let mut last_cmd = inner.last_completed_work.take();
913-
914910
for mut cmd in inner.pending.drain(..completed_commands) {
915911
mod_pr_debug!(
916912
"WorkQueue({:?}): Queueing command @ {:?} for cleanup\n",
917913
pipe_type,
918914
cmd.inner.gpu_va()
919915
);
920916
cmd.as_mut().inner_mut().complete();
921-
if let Some(last_cmd) = last_cmd.replace(cmd) {
922-
workqueue::system().enqueue(last_cmd);
923-
}
917+
workqueue::system().enqueue(cmd);
924918
}
925919

926-
inner.last_completed_work = last_cmd;
927-
928920
mod_pr_debug!(
929921
"WorkQueue({:?}): Completed {} commands, left pending {}, ls {:#x?}, lc {:#x?}\n",
930922
inner.pipe_type,
@@ -1021,12 +1013,3 @@ impl WorkQueue for WorkQueue::ver {
10211013
}
10221014
}
10231015
}
1024-
1025-
#[versions(AGX)]
1026-
impl Drop for WorkQueueInner::ver {
1027-
fn drop(&mut self) {
1028-
if let Some(last_cmd) = self.last_completed_work.take() {
1029-
workqueue::system().enqueue(last_cmd);
1030-
}
1031-
}
1032-
}

0 commit comments

Comments
 (0)