mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 22:38:05 +02:00
radv/amdgpu: fix device deduplication
To correctly deduplicate device inside the winsys, it should use the fd or amdgpu_device_handle. Using the allocated ac_drm_device as key is obviously broken. Not deduplicating devices breaks memory budget and a bunch of games were broken. Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/12686 Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/12775 Fixes:a565f2994f("amd: move all uses of libdrm_amdgpu to ac_linux_drm") Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34005> (cherry picked from commitc627097841)
This commit is contained in:
parent
22991d17a3
commit
e5f0fd5626
2 changed files with 3 additions and 3 deletions
|
|
@ -1994,7 +1994,7 @@
|
|||
"description": "radv/amdgpu: fix device deduplication",
|
||||
"nominated": true,
|
||||
"nomination_type": 2,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": "a565f2994fec38e20cce46589698dd5487e3ea61",
|
||||
"notes": null
|
||||
|
|
|
|||
|
|
@ -234,7 +234,7 @@ radv_amdgpu_winsys_create(int fd, uint64_t debug_flags, uint64_t perftest_flags,
|
|||
goto fail;
|
||||
}
|
||||
|
||||
struct hash_entry *entry = _mesa_hash_table_search(winsyses, dev);
|
||||
struct hash_entry *entry = _mesa_hash_table_search(winsyses, (void *)ac_drm_device_get_cookie(dev));
|
||||
if (entry) {
|
||||
ws = (struct radv_amdgpu_winsys *)entry->data;
|
||||
++ws->refcount;
|
||||
|
|
@ -325,7 +325,7 @@ radv_amdgpu_winsys_create(int fd, uint64_t debug_flags, uint64_t perftest_flags,
|
|||
radv_amdgpu_bo_init_functions(ws);
|
||||
radv_amdgpu_cs_init_functions(ws);
|
||||
|
||||
_mesa_hash_table_insert(winsyses, dev, ws);
|
||||
_mesa_hash_table_insert(winsyses, (void *)ac_drm_device_get_cookie(dev), ws);
|
||||
simple_mtx_unlock(&winsys_creation_mutex);
|
||||
|
||||
return &ws->base;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue