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:
@@ -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;
|
||||
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user