Skip to content
Snippets Groups Projects
Commit 4d8c6eda authored by Mario Kleiner's avatar Mario Kleiner Committed by Emil Velikov
Browse files

winsys/radeon: Use dup fd as key in drm-winsys hash table to fix ZaphodHeads.


Same problem and fix as for nouveau's ZaphodHeads trouble.

See patch ...

"nouveau: Use dup fd as key in drm-winsys hash table to fix ZaphodHeads."

... for reference.

Cc: "10.3 10.4 10.5 10.6" <mesa-stable@lists.freedesktop.org>
Signed-off-by: default avatarMario Kleiner <mario.kleiner.de@gmail.com>
Reviewed-by: default avatarMarek Olšák <marek.olsak@amd.com>
(cherry picked from commit 28dda47a)
parent 8ef28436
No related branches found
No related tags found
No related merge requests found
......@@ -488,6 +488,10 @@ static void radeon_winsys_destroy(struct radeon_winsys *rws)
if (ws->gen >= DRV_R600) {
radeon_surface_manager_free(ws->surf_man);
}
if (ws->fd)
close(ws->fd);
FREE(rws);
}
......@@ -700,7 +704,7 @@ radeon_drm_winsys_create(int fd, radeon_screen_create_t screen_create)
return NULL;
}
ws->fd = fd;
ws->fd = dup(fd);
if (!do_winsys_init(ws))
goto fail;
......@@ -716,7 +720,7 @@ radeon_drm_winsys_create(int fd, radeon_screen_create_t screen_create)
goto fail;
if (ws->gen >= DRV_R600) {
ws->surf_man = radeon_surface_manager_new(fd);
ws->surf_man = radeon_surface_manager_new(ws->fd);
if (!ws->surf_man)
goto fail;
}
......@@ -757,7 +761,7 @@ radeon_drm_winsys_create(int fd, radeon_screen_create_t screen_create)
return NULL;
}
util_hash_table_set(fd_tab, intptr_to_pointer(fd), ws);
util_hash_table_set(fd_tab, intptr_to_pointer(ws->fd), ws);
/* We must unlock the mutex once the winsys is fully initialized, so that
* other threads attempting to create the winsys from the same fd will
......@@ -774,6 +778,9 @@ fail:
ws->kman->destroy(ws->kman);
if (ws->surf_man)
radeon_surface_manager_free(ws->surf_man);
if (ws->fd)
close(ws->fd);
FREE(ws);
return NULL;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment