[PATCH libdrm 0/9] amdgpu:

Christian König ckoenig.leichtzumerken at gmail.com
Mon Jun 24 17:31:14 UTC 2019


Patches #1 - #3 look good to me, but I'm not sure if the rest is such a 
good idea.

Basically you not only want to use the same FD for CS, but also for 
basically all buffer functions and as far as I can see we break that here.

I would rather add a new function to export the KMS handle for a certain 
BO/FD pair. Exporting the handle based on a type was also like trying to 
squeeze a round pig through a square hole in the first place.

KMS, flink and DMA-buf fd are fundamentally different and shouldn't be 
handled by the same function in the first place.

The only tricky part in this scenario is to know when to close the KMS 
handle again.

Christian.

Am 24.06.19 um 18:53 schrieb Michel Dänzer:
> From: Michel Dänzer <michel.daenzer at amd.com>
>
> The motivation for these patches is https://bugs.freedesktop.org/110903 .
>
> Patches 1-3 are preparatory.
>
> Patches 4 & 5 are the core patches allowing the issues discussed in the
> bug report to be fixed.
>
> Patches 6-8 are further optimizations / cleanups.
>
> Patch 9 is the Mesa patch making use of the new
> amdgpu_bo_handle_type_kms_user API to fix the user visible problem.
>
> Note that the libdrm patches need to land first, a libdrm release needs
> to be made, and the Mesa patch needs to bump the libdrm_amdgpu version
> requirement to that release's version before it can land.
>
> Michel Dänzer (9):
>    amdgpu: Pass file descriptor directly to amdgpu_close_kms_handle
>    amdgpu: Add BO handle to table in amdgpu_bo_create
>    amdgpu: Rename fd_mutex/list to dev_mutex/list
>    amdgpu: Add struct amdgpu_core_device and amdgpu_core_bo
>    amdgpu: Add amdgpu_bo_handle_type_kms_user
>    amdgpu: Re-use an existing amdgpu_device when possible
>    amdgpu: Use normal integers for device / core BO reference counting
>    amdgpu: Drop refcount member from struct amdgpu_core_bo/device
>    winsys/amdgpu: Use amdgpu_bo_handle_type_kms_user for API KMS handles
>
>   amdgpu/amdgpu.h               |  14 +-
>   amdgpu/amdgpu_asic_id.c       |   4 +-
>   amdgpu/amdgpu_bo.c            | 367 ++++++++++++++++++++++------------
>   amdgpu/amdgpu_cs.c            |  64 +++---
>   amdgpu/amdgpu_device.c        | 281 +++++++++++++-------------
>   amdgpu/amdgpu_gpu_info.c      |  35 ++--
>   amdgpu/amdgpu_internal.h      |  31 ++-
>   amdgpu/amdgpu_vamgr.c         |   9 +-
>   amdgpu/amdgpu_vm.c            |   4 +-
>   tests/amdgpu/amdgpu_test.c    |   2 +-
>   tests/amdgpu/bo_tests.c       |   2 +-
>   tests/amdgpu/cs_tests.c       |   8 +-
>   tests/amdgpu/deadlock_tests.c |   8 +-
>   tests/amdgpu/uvd_enc_tests.c  |   2 +-
>   tests/amdgpu/vce_tests.c      |  12 +-
>   tests/amdgpu/vcn_tests.c      |   4 +-
>   tests/amdgpu/vm_tests.c       |   2 +-
>   17 files changed, 500 insertions(+), 349 deletions(-)
>



More information about the dri-devel mailing list