public inbox for linux-arm-kernel@lists.infradead.org 
 help / color / mirror / Atom feed
From: Rob Herring <robh@kernel•org>
To: dri-devel@lists•freedesktop.org
Cc: "Heiko Stübner" <heiko@sntech•de>,
	"Neil Armstrong" <narmstrong@baylibre•com>,
	"David Airlie" <airlied@linux•ie>,
	"Liviu Dudau" <liviu.dudau@arm•com>,
	"Sandy Huang" <hjc@rock-chips•com>,
	"Laurent Pinchart" <laurent.pinchart@ideasonboard•com>,
	"Benjamin Gaignard" <benjamin.gaignard@linaro•org>,
	"Yannick Fertre" <yannick.fertre@st•com>,
	"Kevin Hilman" <khilman@baylibre•com>,
	"Xinwei Kong" <kong.kongxinwei@hisilicon•com>,
	"Xinliang Liu" <z.liuxinliang@hisilicon•com>,
	linux-rockchip@lists•infradead.org,
	"Chen-Yu Tsai" <wens@csie•org>,
	"Noralf Trønnes" <noralf@tronnes•org>,
	"James (Qian) Wang" <james.qian.wang@arm•com>,
	"CK Hu" <ck.hu@mediatek•com>,
	"Philipp Zabel" <p.zabel@pengutronix•de>,
	"Alexandre Torgue" <alexandre.torgue@st•com>,
	"Chen Feng" <puck.chen@hisilicon•com>,
	"Maarten Lankhorst" <maarten.lankhorst@linux•intel.com>,
	"Maxime Ripard" <mripard@kernel•org>,
	linux-mediatek@lists•infradead.org,
	"Matthias Brugger" <matthias.bgg@gmail•com>,
	"Daniel Vetter" <daniel@ffwll•ch>, "Sean Paul" <sean@poorly•run>,
	linux-arm-kernel@lists•infradead.org,
	"Philippe Cornu" <philippe.cornu@st•com>,
	"Vincent Abriou" <vincent.abriou@st•com>,
	"Kieran Bingham" <kieran.bingham+renesas@ideasonboard•com>,
	"Maxime Coquelin" <mcoquelin.stm32@gmail•com>,
	"Rongrong Zou" <zourongrong@gmail•com>
Subject: [PATCH 0/6] drm: Support CMA per allocation kernel mappings
Date: Mon, 21 Oct 2019 16:45:44 -0500	[thread overview]
Message-ID: <20191021214550.1461-1-robh@kernel.org> (raw)

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

             reply	other threads:[~2019-10-21 21:46 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-21 21:45 Rob Herring [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191021214550.1461-1-robh@kernel.org \
    --to=robh@kernel$(echo .)org \
    --cc=airlied@linux$(echo .)ie \
    --cc=alexandre.torgue@st$(echo .)com \
    --cc=benjamin.gaignard@linaro$(echo .)org \
    --cc=ck.hu@mediatek$(echo .)com \
    --cc=daniel@ffwll$(echo .)ch \
    --cc=dri-devel@lists$(echo .)freedesktop.org \
    --cc=heiko@sntech$(echo .)de \
    --cc=hjc@rock-chips$(echo .)com \
    --cc=james.qian.wang@arm$(echo .)com \
    --cc=khilman@baylibre$(echo .)com \
    --cc=kieran.bingham+renesas@ideasonboard$(echo .)com \
    --cc=kong.kongxinwei@hisilicon$(echo .)com \
    --cc=laurent.pinchart@ideasonboard$(echo .)com \
    --cc=linux-arm-kernel@lists$(echo .)infradead.org \
    --cc=linux-mediatek@lists$(echo .)infradead.org \
    --cc=linux-rockchip@lists$(echo .)infradead.org \
    --cc=liviu.dudau@arm$(echo .)com \
    --cc=maarten.lankhorst@linux$(echo .)intel.com \
    --cc=matthias.bgg@gmail$(echo .)com \
    --cc=mcoquelin.stm32@gmail$(echo .)com \
    --cc=mripard@kernel$(echo .)org \
    --cc=narmstrong@baylibre$(echo .)com \
    --cc=noralf@tronnes$(echo .)org \
    --cc=p.zabel@pengutronix$(echo .)de \
    --cc=philippe.cornu@st$(echo .)com \
    --cc=puck.chen@hisilicon$(echo .)com \
    --cc=sean@poorly$(echo .)run \
    --cc=vincent.abriou@st$(echo .)com \
    --cc=wens@csie$(echo .)org \
    --cc=yannick.fertre@st$(echo .)com \
    --cc=z.liuxinliang@hisilicon$(echo .)com \
    --cc=zourongrong@gmail$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox