asahi: Mark KMS exported resource BOs as shared
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user