asahi: Mark KMS exported resource BOs as shared
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run

Fixes: #13524

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36097>
This commit is contained in:
Asahi Lina 2025-07-13 17:01:41 +09:00 committed by Marge Bot
parent a8f33c35f9
commit 067d820c9d

View file

@ -260,6 +260,15 @@ agx_resource_get_handle(struct pipe_screen *pscreen, struct pipe_context *ctx,
} else if (handle->type == WINSYS_HANDLE_TYPE_KMS) {
rsrc_debug(rsrc, "Get handle: %p (KMS)\n", rsrc);
/* BO must be considered shared at this point.
* The seemingly redundant check exists because if the BO is
* already shared then mutating the BO would be potentially
* racy.
*/
assert(rsrc->bo->flags & AGX_BO_SHAREABLE);
if (!(rsrc->bo->flags & AGX_BO_SHARED))
rsrc->bo->flags |= AGX_BO_SHARED;
handle->handle = rsrc->bo->handle;
} else if (handle->type == WINSYS_HANDLE_TYPE_FD) {
int fd = agx_bo_export(dev, rsrc->bo);