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 <lionel.g.landwerlin@intel.com>
Fixes: 57e4d0aa1c ("i965: fix export of GEM handles")
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10386>
(cherry picked from commit 03e97e94e7)
This commit is contained in:
Lionel Landwerlin 2021-04-21 22:46:52 +03:00 committed by Dylan Baker
parent 6b1197e728
commit 0d5e73d205
2 changed files with 1 additions and 3 deletions

View file

@ -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"
},

View file

@ -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;
}