m1n1.hw.uat: Add ioperm()

Signed-off-by: Asahi Lina <lina@asahilina.net>
This commit is contained in:
Asahi Lina 2022-08-23 15:55:19 +09:00
parent cc1284f264
commit b4c687ce13

View file

@ -455,6 +455,18 @@ class UAT(Reloadable):
return ranges return ranges
def ioperm(self, ctx, addr):
page = align_down(addr, self.PAGE_SIZE)
table_addr = self.gpu_region + ctx * 16
for (offset, size, ptecls) in self.LEVELS:
pte = self.fetch_pte(table_addr, page >> offset, size, ptecls)
if not pte.valid():
break
table_addr = pte.offset()
return pte
def get_pt(self, addr, size=None, uncached=False): def get_pt(self, addr, size=None, uncached=False):
if size is None: if size is None:
size = self.Lx_SIZE size = self.Lx_SIZE