devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH v2 03/10] drm/hisilicon: Add hisilicon DRM master driver
@ 2015-11-28 15:25 Emil Velikov
  2015-11-30  7:46 ` Daniel Vetter
  2015-12-01 10:18 ` Xinliang Liu
  0 siblings, 2 replies; 10+ messages in thread
From: Emil Velikov @ 2015-11-28 15:25 UTC (permalink / raw)
  To: Xinliang Liu
  Cc: linux-doc, Catalin Marinas, Will Deacon, linuxarm, ML dri-devel,
	xuwei5, Benjamin Gaignard, zourongrong, xuyiping, corbet, w.f,
	lijianhua, devicetree, bintian.wang, puck.chen, LAKML, andy.green,
	liguozhu, haojian.zhuang

Hi Xinliang,

On 28 November 2015 at 10:38, Xinliang Liu <xinliang.liu@linaro.org> wrote:
> Add DRM master driver for hi6220 SoC which used in HiKey board.
> Add dumb buffer feature.
> Add prime dmabuf feature.
>
> Signed-off-by: Xinliang Liu <xinliang.liu@linaro.org>
> Signed-off-by: Xinwei Kong <kong.kongxinwei@hisilicon.com>
> Signed-off-by: Andy Green <andy.green@linaro.org>
Your s-o-b should be the bottom of the list. There was a presentation
(ages ago) from Greg KH, who nicely described the order as a "chain of
command" or "guilt path". Looks like the rest of the series could use
this tweak.

> ---
>  drivers/gpu/drm/Kconfig                  |   2 +
>  drivers/gpu/drm/Makefile                 |   1 +
>  drivers/gpu/drm/hisilicon/Kconfig        |   9 ++
>  drivers/gpu/drm/hisilicon/Makefile       |   3 +
>  drivers/gpu/drm/hisilicon/hisi_drm_drv.c | 214 +++++++++++++++++++++++++++++++
>  5 files changed, 229 insertions(+)
>  create mode 100644 drivers/gpu/drm/hisilicon/Kconfig
>  create mode 100644 drivers/gpu/drm/hisilicon/Makefile
>  create mode 100644 drivers/gpu/drm/hisilicon/hisi_drm_drv.c
>
> diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig
> index 8773fad..038aae8 100644
> --- a/drivers/gpu/drm/Kconfig
> +++ b/drivers/gpu/drm/Kconfig
> @@ -274,3 +274,5 @@ source "drivers/gpu/drm/amd/amdkfd/Kconfig"
>  source "drivers/gpu/drm/imx/Kconfig"
>
>  source "drivers/gpu/drm/vc4/Kconfig"
> +
> +source "drivers/gpu/drm/hisilicon/Kconfig"
I could swear that we can a patch that sorts these alphabetically,
although it doesn't seem to have made it upstream yet :-(

> --- /dev/null
> +++ b/drivers/gpu/drm/hisilicon/hisi_drm_drv.c

> +static int hisi_drm_load(struct drm_device *dev, unsigned long flags)
> +{
The use of .load (and .unload?) callbacks is not recommended. Take a
look at Laurent Pinchart's patch [1] about the whys and hows on the
topic

> +static struct dma_buf *hisi_gem_prime_export(struct drm_device *dev,
> +                                            struct drm_gem_object *obj,
> +                                            int flags)
> +{
> +       /* we want to be able to write in mmapped buffer */
> +       flags |= O_RDWR;
Erm... something feels fishy here. Out of the existing 15 drivers
setting up the prime callbacks only one (sti) does a similar thing. So
either everyone else is missing something obvious or hisilicon and sti
can rework their inner working to remove this (dare I say it) hack.

> +static int hisi_gem_cma_dumb_create(struct drm_file *file,
> +                                   struct drm_device *dev,
> +                                   struct drm_mode_create_dumb *args)
> +{
> +       int min_pitch = DIV_ROUND_UP(args->width * args->bpp, 8);
> +
> +       /* mali gpu need pitch 8 bytes alignment for 32bpp */
> +       args->pitch = roundup(min_pitch, 8);
> +
I'm not sure you want this kind of dependency of an out of tree driver
upstream. If this is some limitation on the display engine so be it,
but tailoring things for an external module seems like a very bad
idea.

> +       return drm_gem_cma_dumb_create_internal(file, dev, args);
> +}

> +static int hisi_drm_bind(struct device *dev)
> +{
> +       dma_set_coherent_mask(dev, DMA_BIT_MASK(32));
> +       return drm_platform_init(&hisi_drm_driver, to_platform_device(dev));
As pointed out by the the kernel doc - drm_platform_init is deprecated.


Regards,
Emil

[1] http://lists.freedesktop.org/archives/dri-devel/2015-November/095466.html
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 10+ messages in thread
* [PATCH v2 00/10] Add New DRM Driver for HiSilicon hi6220 SoC
@ 2015-11-28 10:38 Xinliang Liu
  2015-11-28 10:38 ` [PATCH v2 03/10] drm/hisilicon: Add hisilicon DRM master driver Xinliang Liu
  0 siblings, 1 reply; 10+ messages in thread
From: Xinliang Liu @ 2015-11-28 10:38 UTC (permalink / raw)
  To: dri-devel, devicetree, daniel, robh, daniel, architt, airlied,
	corbet, catalin.marinas, will.deacon
  Cc: andy.green, xuyiping, linux-doc, w.f, zourongrong, linuxarm,
	xuwei5, bintian.wang, haojian.zhuang, benjamin.gaignard,
	puck.chen, lijianhua, liguozhu, linux-arm-kernel

  This patch set adds a new drm driver for HiSilicon hi6220 SoC.
Current testing and support board is Hikey board which is one of Linaro
96boards. It is an arm64 open source board. For more information about
this board, please access https://www.96boards.org.

Hardware Detail
---------------
  The display subsystem of Hi6220 SoC is shown as bellow:
 +-----+       +----------+     +-----+     +---------+
 |     |       |          |     |     |     |         |             	
 | FB  |------>|   ADE    |---->| DSI |---->| External|
 |     |       |          |     |     |     |  HDMI   |
 +-----+       +----------+     +-----+     +---------+

- ADE(Advanced Display Engine) is the display controller. It contains 7
channels, 3 overlay compositors and a LDI.
  - A channel looks like: DMA-->clip-->scale-->ctrans(or called csc).
  - Overlay compositor is response to compose planes which come from 7
  channels and pass composed image to LDI.
  - LDI is response to generate timings and RGB data stream.
- DSI converts the RGB data stream from ADE to DSI packets.
- External HDMI module is connected with DSI bus. Now Hikey use a ADI's
  ADV7533 external HDMI chip.

Change History
-------------
Changes in v2:
- Remove abtraction layer of plane/crtc/encoder/connector.
- Refactor atomic implementation according to Daniel Vetter's guides:
http://blog.ffwll.ch/2014/11/atomic-modeset-support-for-kms-drivers.html
http://blog.ffwll.ch/2015/09/xdc-2015-atomic-modesetting-for-drivers.html
http://blog.ffwll.ch/2015/08/atomic-modesetting-design-overview.html
- Use bridge instead of slave encoder to connect external HDMI.
- Move dt binding docs to bindings/display/hisilicon directory. 


Xinliang Liu (10):
  arm64: dts: hisilicon: Add display subsystem DT nodes for hi6220.
  drm/hisilicon: Add device tree binding for hi6220 display subsystem
  drm/hisilicon: Add hisilicon DRM master driver
  drm/hisilicon: Add crtc funcs for ADE
  drm/hisilicon: Add plane funcs for ADE
  drm/hisilicon: Add vblank feature
  drm/hisilicon: Add cma fbdev and hotplug
  drm/hisilicon: Add dsi encoder driver
  drm/hisilicon: Add dsi host driver
  drm/hisilicon: Add support for external bridge

 .../bindings/display/hisilicon/hisi-ade.txt        |   42 +
 .../bindings/display/hisilicon/hisi-drm.txt        |   66 ++
 .../bindings/display/hisilicon/hisi-dsi.txt        |   53 +
 arch/arm64/boot/dts/hisilicon/hi6220-hikey.dts     |   21 +
 arch/arm64/boot/dts/hisilicon/hi6220.dtsi          |   44 +
 drivers/gpu/drm/Kconfig                            |    2 +
 drivers/gpu/drm/Makefile                           |    1 +
 drivers/gpu/drm/hisilicon/Kconfig                  |   10 +
 drivers/gpu/drm/hisilicon/Makefile                 |    5 +
 drivers/gpu/drm/hisilicon/hisi_ade_reg.h           |  490 +++++++++
 drivers/gpu/drm/hisilicon/hisi_drm_ade.c           | 1068 ++++++++++++++++++++
 drivers/gpu/drm/hisilicon/hisi_drm_ade.h           |   16 +
 drivers/gpu/drm/hisilicon/hisi_drm_drv.c           |  280 +++++
 drivers/gpu/drm/hisilicon/hisi_drm_drv.h           |   19 +
 drivers/gpu/drm/hisilicon/hisi_drm_dsi.c           |  829 +++++++++++++++
 drivers/gpu/drm/hisilicon/hisi_dsi_reg.h           |   89 ++
 16 files changed, 3035 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/display/hisilicon/hisi-ade.txt
 create mode 100644 Documentation/devicetree/bindings/display/hisilicon/hisi-drm.txt
 create mode 100644 Documentation/devicetree/bindings/display/hisilicon/hisi-dsi.txt
 create mode 100644 drivers/gpu/drm/hisilicon/Kconfig
 create mode 100644 drivers/gpu/drm/hisilicon/Makefile
 create mode 100644 drivers/gpu/drm/hisilicon/hisi_ade_reg.h
 create mode 100644 drivers/gpu/drm/hisilicon/hisi_drm_ade.c
 create mode 100644 drivers/gpu/drm/hisilicon/hisi_drm_ade.h
 create mode 100644 drivers/gpu/drm/hisilicon/hisi_drm_drv.c
 create mode 100644 drivers/gpu/drm/hisilicon/hisi_drm_drv.h
 create mode 100644 drivers/gpu/drm/hisilicon/hisi_drm_dsi.c
 create mode 100644 drivers/gpu/drm/hisilicon/hisi_dsi_reg.h

-- 
1.9.1

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

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

end of thread, other threads:[~2015-12-05  1:25 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-28 15:25 [PATCH v2 03/10] drm/hisilicon: Add hisilicon DRM master driver Emil Velikov
2015-11-30  7:46 ` Daniel Vetter
2015-11-30 17:25   ` Rob Herring
2015-12-01  7:12     ` Daniel Vetter
2015-12-01 10:52   ` Xinliang Liu
2015-12-01 12:54     ` Daniel Vetter
2015-12-01 10:18 ` Xinliang Liu
  -- strict thread matches above, loose matches on Subject: below --
2015-11-28 10:38 [PATCH v2 00/10] Add New DRM Driver for HiSilicon hi6220 SoC Xinliang Liu
2015-11-28 10:38 ` [PATCH v2 03/10] drm/hisilicon: Add hisilicon DRM master driver Xinliang Liu
2015-12-03 16:21   ` Rob Herring
2015-12-05  1:25     ` Xinliang Liu

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).