Skip to content

drm: Provide a dedicated DMA device for PRIME import

Thomas Zimmermann dri-devel 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest5 patches 9 repliesIn review
  2. v14 patches 4 repliesSuperseded

Changes in v2 from the cover letter

- maintain reference on dma_dev (Jani)
- improve docs (Maxime)
- update appletbdrm

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5drm/prime: Support dedicated DMA device for dma-buf importsdrivers/gpu/drm/drm_drv.c drivers/gpu/drm/drm_prime.c include/drm/drm_device.h+63 -12 replies
2/5drm/appletbdrm: Set struct drm_device.dma_devdrivers/gpu/drm/tiny/appletbdrm.c+10 -171 reply
3/5drm/gm12u320: Set struct drm_device.dma_devdrivers/gpu/drm/tiny/gm12u320.c+13 -330 replies
4/5drm/gud: Set struct drm_device.dma_devdrivers/gpu/drm/gud/gud_drv.c drivers/gpu/drm/gud/gud_internal.h+9 -250 replies
5/5drm/udl: Set struct drm_device.dma_devdrivers/gpu/drm/udl/udl_drv.c drivers/gpu/drm/udl/udl_drv.h drivers/gpu/drm/udl/udl_main.c+7 -250 replies

Reviews trailers per patch

2 of 5 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchAditya GargJani NikulaMaxime Ripard
SeriesR-b
1/5R-b R-b
2/5T-b R-b
3/5
4/5
5/5

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v2 thread

Cover letter [PATCH v2 0/5] drm: Provide a dedicated DMA device for PRIME import

Importing dma-bufs via PRIME requires a DMA-capable hardware device. This is not the case for USB, where DMA is performed entirely by the USB controller instead of the USB devices.

Drivers for USB-based hardware maintain their own workarounds for this problem. The original idea to resolve this was to provide different PRIME helpers for such devices, but the dma-buf code internally assumes DMA functionality as well. So that ideas is not realistic.

Let's instead turn the current workaround into a feature. Patch 1 adds a dma_dev field to struct drm_device and makes the PRIME code use it. Patches 2 to 5 replace related driver code.

It will also be useful in other code. The exynos and mediatek drivers already maintain a dedicated DMA device for non-PRIME code. They could likely use dma_dev as well. GEM-DMA helpers currently allocate DMA memory with the regular parent device. They should support the dma_dev settings as well.

Tested with udl.

v2:
- maintain reference on dma_dev (Jani)
- improve docs (Maxime)
- update appletbdrm

Thomas Zimmermann (5):
drm/prime: Support dedicated DMA device for dma-buf imports drm/appletbdrm: Set struct drm_device.dma_dev drm/gm12u320: Set struct drm_device.dma_dev drm/gud: Set struct drm_device.dma_dev
drm/udl: Set struct drm_device.dma_dev

 drivers/gpu/drm/drm_drv.c          | 21 ++++++++++++++
 drivers/gpu/drm/drm_prime.c        |  2 +-
 drivers/gpu/drm/gud/gud_drv.c      | 33 ++++++---------------
 drivers/gpu/drm/gud/gud_internal.h |  1 -
 drivers/gpu/drm/tiny/appletbdrm.c  | 27 +++++++-----------
 drivers/gpu/drm/tiny/gm12u320.c    | 46 +++++++++---------------------
 drivers/gpu/drm/udl/udl_drv.c      | 17 -----------
 drivers/gpu/drm/udl/udl_drv.h      |  1 -
 drivers/gpu/drm/udl/udl_main.c     | 14 ++++-----
 include/drm/drm_device.h           | 41 ++++++++++++++++++++++++++
 10 files changed, 102 insertions(+), 101 deletions(-)
Signature · 1 line
2.48.1