Skip to content

Commit 35cc5a3

Browse files
committed
drm/asahi: mmu: Change step_remap() to new api
Signed-off-by: Asahi Lina <[email protected]>
1 parent 56a6b8e commit 35cc5a3

1 file changed

Lines changed: 1 addition & 14 deletions

File tree

drivers/gpu/drm/asahi/mmu.rs

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -228,8 +228,6 @@ struct StepContext {
228228
prev_va: Option<Pin<KBox<gpuvm::GpuVa<VmInner>>>>,
229229
next_va: Option<Pin<KBox<gpuvm::GpuVa<VmInner>>>>,
230230
vm_bo: Option<ARef<gpuvm::GpuVmBo<VmInner>>>,
231-
prev_vm_bo_1: Option<ARef<gpuvm::GpuVmBo<VmInner>>>,
232-
prev_vm_bo_2: Option<ARef<gpuvm::GpuVmBo<VmInner>>>,
233231
prot: u32,
234232
}
235233

@@ -339,14 +337,14 @@ impl gpuvm::DriverGpuVm for VmInner {
339337
fn step_remap(
340338
self: &mut gpuvm::UpdatingGpuVm<'_, Self>,
341339
op: &mut gpuvm::OpReMap<Self>,
340+
vm_bo: &gpuvm::GpuVmBo<Self>,
342341
ctx: &mut Self::StepContext,
343342
) -> Result {
344343
let prev_gpuva = ctx.prev_va.take().expect("Multiple step_remap calls");
345344
let next_gpuva = ctx.next_va.take().expect("Multiple step_remap calls");
346345
let va = op.unmap().va().expect("No previous VA");
347346
let orig_addr = va.addr();
348347
let orig_range = va.range();
349-
let vm_bo = va.vm_bo();
350348

351349
// Only unmap the hole between prev/next, if they exist
352350
let unmap_start = if let Some(op) = op.prev_map() {
@@ -404,17 +402,6 @@ impl gpuvm::DriverGpuVm for VmInner {
404402
}
405403
}
406404

407-
if ctx.prev_vm_bo_1.is_none() {
408-
assert!(ctx.prev_vm_bo_1.replace(vm_bo).is_none());
409-
} else if ctx.prev_vm_bo_2.is_none() {
410-
assert!(ctx.prev_vm_bo_2.replace(vm_bo).is_none());
411-
} else {
412-
dev_crit!(
413-
self.dev.as_ref(),
414-
"step_remap: too many remap ops, deadlock expected"
415-
);
416-
}
417-
418405
Ok(())
419406
}
420407
}

0 commit comments

Comments
 (0)