linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/6] drm: Support CMA per allocation kernel mappings
@ 2019-10-21 21:45 Rob Herring
  2019-10-21 21:45 ` [PATCH 1/6] drm/kirin: Use DRM_GEM_CMA_VMAP_DRIVER_OPS Rob Herring
                   ` (5 more replies)
  0 siblings, 6 replies; 26+ messages in thread
From: Rob Herring @ 2019-10-21 21:45 UTC (permalink / raw)
  To: dri-devel
  Cc: Heiko Stübner, Neil Armstrong, David Airlie, Liviu Dudau,
	Sandy Huang, Laurent Pinchart, Benjamin Gaignard, Yannick Fertre,
	Kevin Hilman, Xinwei Kong, Xinliang Liu, linux-rockchip,
	Chen-Yu Tsai, Noralf Trønnes, James (Qian) Wang, CK Hu,
	Philipp Zabel, Alexandre Torgue, Chen Feng, Maarten Lankhorst,
	Maxime Ripard, linux-mediatek, Matthias Brugger, Daniel Vetter,
	Sean Paul, linux-arm-kernel, Philippe Cornu, Vincent Abriou,
	Kieran Bingham, Maxime Coquelin, Rongrong Zou

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

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 26+ messages in thread

end of thread, other threads:[~2019-12-17  1:12 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-10-21 21:45 [PATCH 0/6] drm: Support CMA per allocation kernel mappings Rob Herring
2019-10-21 21:45 ` [PATCH 1/6] drm/kirin: Use DRM_GEM_CMA_VMAP_DRIVER_OPS Rob Herring
2019-10-21 21:45 ` [PATCH 2/6] drm: Introduce DRM_MODE_DUMB_KERNEL_MAP flag Rob Herring
2019-10-22 11:14   ` Laurent Pinchart
2019-10-22 12:42     ` Rob Herring
2019-10-23 14:28       ` Laurent Pinchart
2019-10-23 17:03         ` Rob Herring
2019-10-21 21:45 ` [PATCH 3/6] drm/cma-helper: Use the dma_*_attr API variant Rob Herring
2019-10-22  1:01   ` kbuild test robot
2019-10-22 11:18   ` Laurent Pinchart
2019-10-21 21:45 ` [PATCH 4/6] drm/cma-helper: Support DRM_MODE_DUMB_KERNEL_MAP flag Rob Herring
2019-10-22  6:13   ` james qian wang (Arm Technology China)
2019-10-22  7:50   ` Neil Armstrong
2019-10-22 11:30   ` Laurent Pinchart
2019-10-22 11:40     ` Geert Uytterhoeven
2019-10-22 19:52       ` Rob Herring
2019-10-22 20:02     ` Rob Herring
2019-10-23 14:27       ` Laurent Pinchart
2019-10-21 21:45 ` [PATCH 5/6] drm/mediatek: Convert to use CMA helpers Rob Herring
2019-10-22 17:07   ` Matthias Brugger
2019-10-23 17:42     ` Rob Herring
2019-10-23 21:06       ` CK Hu
2019-10-23 22:56         ` Rob Herring
2019-10-24  7:02           ` CK Hu
2019-12-17  1:12             ` Laurent Pinchart
2019-10-21 21:45 ` [PATCH 6/6] drm/rockchip: Convert to use generic fbdev emulation Rob Herring

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).