mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-24 21:50:12 +01: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>
This commit is contained in:
parent
bd45b738b7
commit
c627097841
1 changed files with 2 additions and 2 deletions
|
|
@ -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