Skip to content

Commit 4ef3583

Browse files
hoshinolinajannau
authored andcommitted
drm/asahi: mmu: Preallocate page tables before sm_map()
Signed-off-by: Asahi Lina <lina@asahilina.net>
1 parent 7085710 commit 4ef3583

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
@@ -1115,6 +1115,9 @@ impl Vm {
11151115
let sgt = gem.sg_table()?;
11161116
let mut inner = self.inner.exec_lock(Some(gem), true)?;
11171117

1118+
// Preallocate the page tables, to fail early if we ENOMEM
1119+
inner.page_table.alloc_pages(addr..(addr + size))?;
1120+
11181121
let vm_bo = inner.obtain_bo()?;
11191122

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

0 commit comments

Comments
 (0)