Skip to content

Commit a062c37

Browse files
committed
fixup! drm/asahi: Clean up jobs in a workqueue
1 parent 17e0e29 commit a062c37

2 files changed

Lines changed: 9 additions & 9 deletions

File tree

drivers/gpu/drm/asahi/gpu.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ pub(crate) trait GpuManager: Send + Sync {
272272
/// Get the dynamic GPU configuration for this SoC.
273273
fn get_dyncfg(&self) -> &hw::DynConfig;
274274
/// Register an unused context as garbage
275-
fn free_context(&self, data: Box<fw::types::GpuObject<fw::workqueue::GpuContextData>>);
275+
fn free_context(&self, data: KBox<fw::types::GpuObject<fw::workqueue::GpuContextData>>);
276276
/// Check whether the GPU is crashed
277277
fn is_crashed(&self) -> bool;
278278
}

drivers/gpu/drm/asahi/workqueue.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -177,23 +177,23 @@ pub(crate) trait GenSubmittedWork: Send + Sync {
177177
struct SubmittedWorkContainer {
178178
#[pin]
179179
work: Work<Self>,
180-
inner: Box<dyn GenSubmittedWork>,
180+
inner: KBox<dyn GenSubmittedWork>,
181181
}
182182

183183
impl_has_work! {
184184
impl HasWork<Self> for SubmittedWorkContainer { self.work }
185185
}
186186

187187
impl WorkItem for SubmittedWorkContainer {
188-
type Pointer = Pin<Box<SubmittedWorkContainer>>;
188+
type Pointer = Pin<KBox<SubmittedWorkContainer>>;
189189

190-
fn run(this: Pin<Box<SubmittedWorkContainer>>) {
190+
fn run(this: Pin<KBox<SubmittedWorkContainer>>) {
191191
mod_pr_debug!("WorkQueue: Freeing command @ {:?}\n", this.inner.gpu_va());
192192
}
193193
}
194194

195195
impl SubmittedWorkContainer {
196-
fn inner_mut(self: Pin<&mut Self>) -> &mut Box<dyn GenSubmittedWork> {
196+
fn inner_mut(self: Pin<&mut Self>) -> &mut KBox<dyn GenSubmittedWork> {
197197
// SAFETY: inner does not require structural pinning.
198198
unsafe { &mut self.get_unchecked_mut().inner }
199199
}
@@ -247,7 +247,7 @@ struct WorkQueueInner {
247247
pipe_type: PipeType,
248248
size: u32,
249249
wptr: u32,
250-
pending: Vec<Pin<Box<SubmittedWorkContainer>>>,
250+
pending: KVec<Pin<KBox<SubmittedWorkContainer>>>,
251251
last_token: Option<event::Token>,
252252
pending_jobs: usize,
253253
last_submitted: Option<event::EventValue>,
@@ -296,7 +296,7 @@ pub(crate) struct Job {
296296
wq: Arc<WorkQueue::ver>,
297297
event_info: QueueEventInfo::ver,
298298
start_value: EventValue,
299-
pending: Vec<Pin<Box<SubmittedWorkContainer>>>,
299+
pending: KVec<Pin<KBox<SubmittedWorkContainer>>>,
300300
committed: bool,
301301
submitted: bool,
302302
event_count: usize,
@@ -349,10 +349,10 @@ impl Job::ver {
349349
let value = self.event_info.value.next();
350350

351351
self.pending.push(
352-
Box::try_pin_init(
352+
KBox::try_pin_init(
353353
try_pin_init!(SubmittedWorkContainer {
354354
work <- new_work!("SubmittedWorkWrapper::work"),
355-
inner: Box::new(SubmittedWork::<_, _> {
355+
inner: KBox::new(SubmittedWork::<_, _> {
356356
object: command,
357357
value,
358358
error: None,

0 commit comments

Comments
 (0)