mirror of
https://github.com/AsahiLinux/m1n1
synced 2025-02-16 21:58:27 +00:00
m1n1.agx.context: Add a separate allocator for GEM objects
Signed-off-by: Asahi Lina <lina@asahilina.net>
This commit is contained in:
parent
85e6208a79
commit
027dea9145
2 changed files with 5 additions and 1 deletions
|
@ -35,6 +35,9 @@ class GPUContext:
|
|||
guard_pages=1,
|
||||
va_block=32768, nG=1, AP=0, PXN=1, UXN=1)
|
||||
|
||||
self.gobj = GPUAllocator(agx, "GEM", 0x1500000000, 0x100000000, ctx=None,
|
||||
guard_pages=1, nG=1, AP=0, PXN=1, UXN=1)
|
||||
|
||||
self.pipeline_base = 0x1100000000
|
||||
self.pipeline_size = 1 << 32
|
||||
self.pobj = GPUAllocator(agx, "Pipelines", self.pipeline_base + 0x10000, self.pipeline_size,
|
||||
|
@ -43,6 +46,7 @@ class GPUContext:
|
|||
def bind(self, ctx_id):
|
||||
self.ctx = ctx_id
|
||||
self.uobj.ctx = ctx_id
|
||||
self.gobj.ctx = ctx_id
|
||||
self.pobj.ctx = ctx_id
|
||||
self.uat.bind_context(ctx_id, self.ttbr0_base)
|
||||
|
||||
|
|
|
@ -145,7 +145,7 @@ class DRMAsahiShim:
|
|||
if args.flags & ASAHI_BO_PIPELINE:
|
||||
alloc = self.renderer.ctx.pobj
|
||||
else:
|
||||
alloc = self.renderer.ctx.uobj
|
||||
alloc = self.renderer.ctx.gobj
|
||||
|
||||
obj = alloc.new(HexDump(Bytes(args.size)), name=f"GBM offset {memfd_offset:#x}", track=False)
|
||||
obj._memfd_offset = memfd_offset
|
||||
|
|
Loading…
Add table
Reference in a new issue