Skip to content

drm: Support CMA per allocation kernel mappings

Rob Herring dri-devel linux-amlogic linux-arm-kernel linux-mediatek linux-renesas-soc linux-rockchip oe-kbuild-all 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest6 patches 18 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6drm/kirin: Use DRM_GEM_CMA_VMAP_DRIVER_OPSdrivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c+1 -100 replies
2/6drm: Introduce DRM_MODE_DUMB_KERNEL_MAP flagdrivers/gpu/drm/drm_client.c drivers/gpu/drm/drm_dumb_buffers.c include/uapi/drm/drm_mode.h+7 -14 replies
3/6drm/cma-helper: Use the dma_*_attr API variantdrivers/gpu/drm/drm_gem_cma_helper.c include/drm/drm_gem_cma_helper.h+13 -81 reply
4/6drm/cma-helper: Support DRM_MODE_DUMB_KERNEL_MAP flagdrivers/gpu/drm/arm/display/komeda/komeda_kms.c drivers/gpu/drm/arm/malidp_drv.c drivers/gpu/drm/drm_gem_cma_helper.c +5 more+36 -197 replies
5/6drm/mediatek: Convert to use CMA helpersdrivers/gpu/drm/mediatek/Makefile drivers/gpu/drm/mediatek/mtk_drm_crtc.c drivers/gpu/drm/mediatek/mtk_drm_drv.c +4 more+15 -3646 replies
6/6drm/rockchip: Convert to use generic fbdev emulationdrivers/gpu/drm/rockchip/Makefile drivers/gpu/drm/rockchip/rockchip_drm_drv.c drivers/gpu/drm/rockchip/rockchip_drm_drv.h +6 more+6 -2300 replies

Reviews trailers per patch

2 of 6 patches have a Reviewed-by or Acked-by.

PatchJames Qian Wang (Arm Technology China)Neil ArmstrongLaurent Pinchart
1/6
2/6
3/6R-b
4/6R-b R-b R-b
5/6
6/6

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 v1 thread

Cover letter [PATCH 0/6] drm: Support CMA per allocation kernel mappings

This series adds support for CMA/DMA users to skip kernel mappings for GEM allocations. The DMA API only guarantees a kernel mapping at allocation time. Creating mappings with vmap() after allocation may or may not work as not all allocations have a struct page. As virtual memory space is limited on 32-bit systems some drivers will skip kernel mappings when possible. This prevents those drivers from using CMA helpers and the generic fbdev emulation which results in a lot of duplicated code.

In order to distinguish between kernel and userspace allocations, a new flag, DRM_MODE_DUMB_KERNEL_MAP, for drm_mode_create_dumb() is introduced. This allows drivers to override the default behavior for CMA helpers of always creating a kernel mapping.

Mediatek is converted to CMA helpers and Rockchip is converted to generic fbdev support. I also have patches to convert Rockchip to CMA and shmem helpers, but they need a bit more work. Exynos can also probably be converted to use CMA helpers.

Compile tested only. I did test fbdev on Rockchip, but the h/w I have has an IOMMU, so the CMA code path doesn't get tested.

Rob

Rob Herring (6):
drm/kirin: Use DRM_GEM_CMA_VMAP_DRIVER_OPS
drm: Introduce DRM_MODE_DUMB_KERNEL_MAP flag drm/cma-helper: Use the dma_*_attr API variant drm/cma-helper: Support DRM_MODE_DUMB_KERNEL_MAP flag drm/mediatek: Convert to use CMA helpers drm/rockchip: Convert to use generic fbdev emulation

 .../gpu/drm/arm/display/komeda/komeda_kms.c   |   1 +
 drivers/gpu/drm/arm/malidp_drv.c              |   1 +
 drivers/gpu/drm/drm_client.c                  |   1 +
 drivers/gpu/drm/drm_dumb_buffers.c            |   5 +-
 drivers/gpu/drm/drm_gem_cma_helper.c          |  68 +++--
 .../gpu/drm/hisilicon/kirin/kirin_drm_ade.c   |  11 +-
 drivers/gpu/drm/mediatek/Makefile             |   1 -
 drivers/gpu/drm/mediatek/mtk_drm_crtc.c       |   2 +-
 drivers/gpu/drm/mediatek/mtk_drm_drv.c        |  28 +-
 drivers/gpu/drm/mediatek/mtk_drm_fb.c         |   1 -
 drivers/gpu/drm/mediatek/mtk_drm_gem.c        | 289 ------------------
 drivers/gpu/drm/mediatek/mtk_drm_gem.h        |  51 ----
 drivers/gpu/drm/mediatek/mtk_drm_plane.c      |   7 +-
 drivers/gpu/drm/meson/meson_drv.c             |   1 +
 drivers/gpu/drm/rcar-du/rcar_du_kms.c         |   1 +
 drivers/gpu/drm/rockchip/Makefile             |   1 -
 drivers/gpu/drm/rockchip/rockchip_drm_drv.c   |  10 +-
 drivers/gpu/drm/rockchip/rockchip_drm_drv.h   |   2 -
 drivers/gpu/drm/rockchip/rockchip_drm_fb.c    |  14 -
 drivers/gpu/drm/rockchip/rockchip_drm_fb.h    |   6 -
 drivers/gpu/drm/rockchip/rockchip_drm_fbdev.c | 170 -----------
 drivers/gpu/drm/rockchip/rockchip_drm_fbdev.h |  24 --
 drivers/gpu/drm/rockchip/rockchip_drm_gem.c   |   6 +-
 drivers/gpu/drm/rockchip/rockchip_drm_gem.h   |   4 -
 drivers/gpu/drm/stm/drv.c                     |   1 +
 drivers/gpu/drm/sun4i/sun4i_drv.c             |   1 +
 include/drm/drm_gem_cma_helper.h              |   1 +
 include/uapi/drm/drm_mode.h                   |   2 +
 28 files changed, 78 insertions(+), 632 deletions(-)
 delete mode 100644 drivers/gpu/drm/mediatek/mtk_drm_gem.c
 delete mode 100644 drivers/gpu/drm/mediatek/mtk_drm_gem.h
 delete mode 100644 drivers/gpu/drm/rockchip/rockchip_drm_fbdev.c
 delete mode 100644 drivers/gpu/drm/rockchip/rockchip_drm_fbdev.h

--
2.20.1
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel