winsys/amdgpu: Add amdgpu_screen_winsys
authorMichel Dänzer <michel.daenzer@amd.com>
Fri, 28 Jun 2019 14:06:23 +0000 (16:06 +0200)
committerMichel Dänzer <michel@daenzer.net>
Wed, 3 Jul 2019 09:19:07 +0000 (09:19 +0000)
commitcb446dc0fa5c68f681108f4613560543aa4cf553
treeb9dae30fa2bcbb5453ff96022118bbaf421f4a8c
parent6fce296400cd327c671a39e84bd377174a534bf7
winsys/amdgpu: Add amdgpu_screen_winsys

It extends pipe_screen / radeon_winsys and references amdgpu_winsys.
Multiple amdgpu_screen_winsys instances may reference the same
amdgpu_winsys instance, which corresponds to an amdgpu_device_handle.

The purpose of amdgpu_screen_winsys is to keep a duplicate of the DRM
file descriptor passed to amdgpu_winsys_create, which will be needed
in the next change.

v2:
* Add comment in amdgpu_winsys_unref explaining why it always returns
  true (Marek Olšák)

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Tested-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
src/gallium/winsys/amdgpu/drm/amdgpu_bo.c
src/gallium/winsys/amdgpu/drm/amdgpu_bo.h
src/gallium/winsys/amdgpu/drm/amdgpu_cs.c
src/gallium/winsys/amdgpu/drm/amdgpu_cs.h
src/gallium/winsys/amdgpu/drm/amdgpu_surface.c
src/gallium/winsys/amdgpu/drm/amdgpu_winsys.c
src/gallium/winsys/amdgpu/drm/amdgpu_winsys.h