Skip to content

Commit 29e96a1

Browse files
committed
drm/asahi: mmu: Preallocate page tables before sm_map()
Signed-off-by: Asahi Lina <lina@asahilina.net>
1 parent 42f72b5 commit 29e96a1

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

drivers/gpu/drm/asahi/mmu.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1109,6 +1109,9 @@ impl Vm {
11091109
let sgt = gem.sg_table()?;
11101110
let mut inner = self.inner.exec_lock(Some(gem), true)?;
11111111

1112+
// Preallocate the page tables, to fail early if we ENOMEM
1113+
inner.page_table.alloc_pages(addr..(addr + size))?;
1114+
11121115
let vm_bo = inner.obtain_bo()?;
11131116

11141117
let mut vm_bo_guard = vm_bo.inner().sgt.lock();

0 commit comments

Comments
 (0)