winsys/amdgpu: Re-use amdgpu_screen_winsys when possible
authorMichel Dänzer <mdaenzer@redhat.com>
Tue, 28 Jan 2020 10:07:15 +0000 (11:07 +0100)
committerMarge Bot <eric+marge@anholt.net>
Wed, 29 Jan 2020 15:51:01 +0000 (15:51 +0000)
commit9f2bed49d476a15af0df270307f9051d810ea0ab
tree967f13b23346b04be91b4bd9598261588a87b424
parentf21b40d0bf3c5662945d8e35f1925a5a208df366
winsys/amdgpu: Re-use amdgpu_screen_winsys when possible

Namely, if os_same_file_description determined that the DRM file
descriptor references the same file description.

v2:
* Adapt to amdgpu_winsys::sws_list_lock.
v3:
* Fix comparison of amdgpu_screen_winsys file descriptions, see
  https://gitlab.freedesktop.org/mesa/mesa/issues/2413 .
* Lock amdgpu_winsys::sws_list_lock for traversing the sws_list in
  amdgpu_winsys_create.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3582>
src/gallium/winsys/amdgpu/drm/amdgpu_winsys.c
src/gallium/winsys/amdgpu/drm/amdgpu_winsys.h