mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-07 09:18:04 +02:00
zink: prune dmabuf export tracking when adding resource binds
this avoids invalid access for the stack resource in add_resource_bind()
when adding a new bind to an exportable resource
cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27395>
(cherry picked from commit 7b7a581a52)
This commit is contained in:
parent
3ba68813f2
commit
1933436ada
2 changed files with 6 additions and 1 deletions
|
|
@ -10364,7 +10364,7 @@
|
|||
"description": "zink: prune dmabuf export tracking when adding resource binds",
|
||||
"nominated": true,
|
||||
"nomination_type": 0,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": null,
|
||||
"notes": null
|
||||
|
|
|
|||
|
|
@ -1611,6 +1611,11 @@ add_resource_bind(struct zink_context *ctx, struct zink_resource *res, unsigned
|
|||
box.depth = util_num_layers(&res->base.b, i);
|
||||
ctx->base.resource_copy_region(&ctx->base, &res->base.b, i, 0, 0, 0, &staging.base.b, i, &box);
|
||||
}
|
||||
if (old_obj->exportable) {
|
||||
simple_mtx_lock(&ctx->batch.state->exportable_lock);
|
||||
_mesa_set_remove_key(&ctx->batch.state->dmabuf_exports, &staging);
|
||||
simple_mtx_unlock(&ctx->batch.state->exportable_lock);
|
||||
}
|
||||
zink_resource_object_reference(screen, &old_obj, NULL);
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue