Experimental P2P buffer sharing

Submitted by Kuehling, Felix on July 6, 2017, 8:16 p.m.

Details

Reviewer None
Submitted July 6, 2017, 8:16 p.m.
Last Updated July 19, 2017, 2:22 a.m.
Revision 4

Cover Letter(s)

Revision 1
      This patch series adds experimental P2P buffer sharing. It's disabled
by default and can be enabled with amdgpu.p2p_sharing=1.

TODO:
* Add a whitelist of chipsets that support P2P access
* Refine UVD/VCE handling on newer IP versions with GPUVM support
* Handle foreign BOs in DC path
* Test for regressions in existing multi-GPU buffer sharing use cases

Amber Lin (1):
  drm/amdgpu: handle foreign BOs in the VM mapping

Christian König (4):
  drm/amdgpu: disallow foreign BOs for UVD/VCE
  drm/amdgpu: disallow foreign BOs in the display path
  drm/amdgpu: separate BO from GEM object
  drm/amdgpu: enable foreign DMA-buf objects v2

Felix Kuehling (1):
  drm: Add helper to check exporting driver of a DMA-buf

 drivers/gpu/drm/amd/amdgpu/amdgpu.h         | 16 +++++-
 drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c      |  3 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_display.c |  6 +++
 drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c     |  6 ++-
 drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c     | 41 +++++++++++----
 drivers/gpu/drm/amd/amdgpu/amdgpu_object.c  |  7 +--
 drivers/gpu/drm/amd/amdgpu/amdgpu_prime.c   | 80 ++++++++++++++++++++++++++++-
 drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c     | 17 +++++-
 drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c      | 17 ++++--
 drivers/gpu/drm/drm_prime.c                 | 24 +++++++++
 include/drm/drmP.h                          |  2 +
 11 files changed, 193 insertions(+), 26 deletions(-)
    
Revision 2
      This patch series adds experimental P2P buffer sharing in amdgpu. It's
disabled by default and can be enabled with amdgpu.p2p_sharing=1.

v2:
* Changed drm helper function to cast to GEM object
* Added foreign BO checks to DC code paths
* Updated commit message for amdgpu_cs change

Amber Lin (1):
  drm/amdgpu: handle foreign BOs in the VM mapping

Christian König (4):
  drm/amdgpu: disallow foreign BOs for CS w/o GPUVM mapping
  drm/amdgpu: disallow foreign BOs in the display path v2
  drm/amdgpu: separate BO from GEM object
  drm/amdgpu: enable foreign DMA-buf objects v2

Felix Kuehling (1):
  drm: Add helper to cast DMA-buf to GEM object

 drivers/gpu/drm/amd/amdgpu/amdgpu.h                | 16 ++++-
 drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c             |  3 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_display.c        |  6 ++
 drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c            |  6 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c            | 41 ++++++++---
 drivers/gpu/drm/amd/amdgpu/amdgpu_object.c         |  7 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_prime.c          | 80 +++++++++++++++++++++-
 drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c            | 17 ++++-
 drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c             | 17 +++--
 drivers/gpu/drm/amd/amdgpu/dce_v10_0.c             |  5 ++
 drivers/gpu/drm/amd/amdgpu/dce_v11_0.c             |  5 ++
 drivers/gpu/drm/amd/amdgpu/dce_v6_0.c              |  5 ++
 drivers/gpu/drm/amd/amdgpu/dce_v8_0.c              |  5 ++
 .../drm/amd/display/amdgpu_dm/amdgpu_dm_types.c    |  5 ++
 drivers/gpu/drm/drm_prime.c                        | 25 +++++++
 include/drm/drmP.h                                 |  2 +
 16 files changed, 219 insertions(+), 26 deletions(-)
    
Revision 4
      This patch series adds experimental P2P buffer sharing in amdgpu. It's
disabled by default and can be enabled with amdgpu.p2p_sharing=1.

v2:
* Changed drm helper function to cast to GEM object
* Added foreign BO checks to DC code paths
* Updated commit message for amdgpu_cs change

v3:
* Use drm_gem_prime_dmabuf_to_object helper in drm_gem_prime_import

Amber Lin (1):
  drm/amdgpu: handle foreign BOs in the VM mapping

Christian König (4):
  drm/amdgpu: disallow foreign BOs for CS w/o GPUVM mapping
  drm/amdgpu: disallow foreign BOs in the display path v2
  drm/amdgpu: separate BO from GEM object
  drm/amdgpu: enable foreign DMA-buf objects v2

Felix Kuehling (1):
  drm: Add helper to cast DMA-buf to GEM object v2

 drivers/gpu/drm/amd/amdgpu/amdgpu.h                | 16 ++++-
 drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c             |  3 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_display.c        |  6 ++
 drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c            |  6 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c            | 41 ++++++++---
 drivers/gpu/drm/amd/amdgpu/amdgpu_object.c         |  7 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_prime.c          | 80 +++++++++++++++++++++-
 drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c            | 17 ++++-
 drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c             | 17 +++--
 drivers/gpu/drm/amd/amdgpu/dce_v10_0.c             |  5 ++
 drivers/gpu/drm/amd/amdgpu/dce_v11_0.c             |  5 ++
 drivers/gpu/drm/amd/amdgpu/dce_v6_0.c              |  5 ++
 drivers/gpu/drm/amd/amdgpu/dce_v8_0.c              |  5 ++
 .../drm/amd/display/amdgpu_dm/amdgpu_dm_types.c    |  5 ++
 drivers/gpu/drm/drm_prime.c                        | 43 +++++++++---
 include/drm/drmP.h                                 |  2 +
 16 files changed, 227 insertions(+), 36 deletions(-)
    

Revisions