asahi: wrap: Handle freeing shmems

Needed for some Metal demos that end up creating multiple queues.

This is still definitely broken/not fully correct, but it at least
gets things working for those.

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24258>
This commit is contained in:
Asahi Lina
2023-07-11 02:23:33 +09:00
committed by Marge Bot
parent 0dc819f284
commit 2c2858c2af
2 changed files with 14 additions and 1 deletions
+2 -1
View File
@@ -818,7 +818,8 @@ agxdecode_track_free(struct agx_bo *bo)
for (unsigned i = 0; i < mmap_count; ++i) {
if (mmap_array[i].handle == bo->handle &&
mmap_array[i].type == bo->type) {
(mmap_array[i].type == AGX_ALLOC_REGULAR) ==
(bo->type == AGX_ALLOC_REGULAR)) {
assert(!found && "mapped multiple times!");
found = true;
+12
View File
@@ -228,6 +228,18 @@ wrap_Method(mach_port_t connection, uint32_t selector, const uint64_t *input,
break;
}
case AGX_SELECTOR_FREE_SHMEM: {
assert(inputCnt == 1);
assert(inputStruct == NULL);
assert(output == NULL);
assert(outputStruct == NULL);
agxdecode_track_free(
&(struct agx_bo){.type = AGX_ALLOC_CMDBUF, .handle = input[0]});
break;
}
default:
/* Dump the outputs */
if (outputCnt) {