From 0d5e73d205b18160b9ad2bbddc3a5287040fbf9a Mon Sep 17 00:00:00 2001 From: Lionel Landwerlin Date: Wed, 21 Apr 2021 22:46:52 +0300 Subject: [PATCH] i965/bufmgr: fix invalid assertion The idea behind this assert is that if a buffer is in bufmgr->handle_table it's because it has been shared from i965 to the outside. This is when we add the drm FD associated to this BO to bo->exports. But we also import buffer from the outside into i965 and those buffers don't have an associated drm FD added to bo->exports. If you import the same buffer more than once, you'll run into this assert. v2: Also drop assert from brw_bo_gem_create_from_name() (Ian) Signed-off-by: Lionel Landwerlin Fixes: 57e4d0aa1c16d3 ("i965: fix export of GEM handles") Reviewed-by: Ian Romanick Part-of: (cherry picked from commit 03e97e94e791ce64a0478f369aaf6afc80cfbe8f) --- .pick_status.json | 2 +- src/mesa/drivers/dri/i965/brw_bufmgr.c | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index da2ffdeaa71..3342d8bcfc0 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -463,7 +463,7 @@ "description": "i965/bufmgr: fix invalid assertion", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "master_sha": null, "because_sha": "57e4d0aa1c16d3be36ccee4065c55901cb6fad43" }, diff --git a/src/mesa/drivers/dri/i965/brw_bufmgr.c b/src/mesa/drivers/dri/i965/brw_bufmgr.c index 13c4fa08ef0..dc0ea07f7ac 100644 --- a/src/mesa/drivers/dri/i965/brw_bufmgr.c +++ b/src/mesa/drivers/dri/i965/brw_bufmgr.c @@ -794,7 +794,6 @@ brw_bo_gem_create_from_name(struct brw_bufmgr *bufmgr, */ bo = hash_find_bo(bufmgr->handle_table, open_arg.handle); if (bo) { - assert(list_is_empty(&bo->exports)); brw_bo_reference(bo); goto out; } @@ -1485,7 +1484,6 @@ brw_bo_gem_create_from_prime_internal(struct brw_bufmgr *bufmgr, int prime_fd, */ bo = hash_find_bo(bufmgr->handle_table, handle); if (bo) { - assert(list_is_empty(&bo->exports)); brw_bo_reference(bo); goto out; }