| From: |
| Rob Herring <robh-AT-kernel.org> |
| To: |
| dri-devel-AT-lists.freedesktop.org |
| Subject: |
| [PATCH 0/6] drm: Support CMA per allocation kernel mappings |
| Date: |
| Mon, 21 Oct 2019 16:45:44 -0500 |
| Message-ID: |
| <20191021214550.1461-1-robh@kernel.org> |
| Cc: |
| Neil Armstrong <narmstrong-AT-baylibre.com>, David Airlie <airlied-AT-linux.ie>, Liviu Dudau <liviu.dudau-AT-arm.com>, Laurent Pinchart <laurent.pinchart-AT-ideasonboard.com>, Yannick Fertre <yannick.fertre-AT-st.com>, Kevin Hilman <khilman-AT-baylibre.com>, Xinwei Kong <kong.kongxinwei-AT-hisilicon.com>, Xinliang Liu <z.liuxinliang-AT-hisilicon.com>, linux-rockchip-AT-lists.infradead.org, Chen-Yu Tsai <wens-AT-csie.org>, Kieran Bingham <kieran.bingham+renesas-AT-ideasonboard.com>, "James \(Qian\) Wang" <james.qian.wang-AT-arm.com>, Alexandre Torgue <alexandre.torgue-AT-st.com>, Chen Feng <puck.chen-AT-hisilicon.com>, linux-mediatek-AT-lists.infradead.org, Matthias Brugger <matthias.bgg-AT-gmail.com>, Sean Paul <sean-AT-poorly.run>, linux-arm-kernel-AT-lists.infradead.org, Philippe Cornu <philippe.cornu-AT-st.com>, Vincent Abriou <vincent.abriou-AT-st.com>, Maxime Coquelin <mcoquelin.stm32-AT-gmail.com>, Rongrong Zou <zourongrong-AT-gmail.com> |
| Archive-link: |
| Article |
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
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel