[PATCH v7 1/4] drm/layerscape: Add Freescale DCU DRM driver

2015-07-13 Thread Wang J.W.
Hi Paul,

Thank you for your review.

> -Original Message-
> From: Paul Bolle [mailto:pebolle at tiscali.nl]
> Sent: Saturday, July 11, 2015 9:16 PM
> To: Wang Jianwei-B52261
> Cc: dri-devel at lists.freedesktop.org; linux-kernel at vger.kernel.org; 
> linux-
> arm-kernel at lists.infradead.org; devicetree at vger.kernel.org;
> airlied at linux.ie; daniel.vetter at ffwll.ch; mark.yao at rock-chips.com; 
> Wood
> Scott-B07421; thierry.reding at gmail.com; Wang Huan-B18965; Xiubo Li
> Subject: Re: [PATCH v7 1/4] drm/layerscape: Add Freescale DCU DRM driver
> 
> A question and a nit follow.
> 
> On vr, 2015-07-10 at 19:17 +0800, Jianwei Wang wrote:
> > --- /dev/null
> > +++ b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c
> 
> > +MODULE_ALIAS("platform:fsl-dcu-drm");
> 
> Question: this appears to be only useful if there's a corresponding struct
> platform_device. That is, a platform_device with a "fsl-dcu-drm"
> .name. It will fire off a "MODALIAS=platform:fsl-dcu-drm" uevent when it's
> created.
> 
> I couldn't find this corresponding platform_device. Does it exist? Or is
> this alias needed for some other reason?
> 
> > --- /dev/null
> > +++ b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.h
> 
> > +#define DRIVER_NAME"fsl-dcu-drm"
> 
> Nit: I don't think DRIVER_NAME is actually used anywhere. 
> 

Yes, you are right. Both are useless, I'll remove them.
I copied source code from other DRM driver at first, and forgot to remove them.
Thanks for your kindly remind.


BR.
Jianwei

> Thanks,
> 
> 
> Paul Bolle


[PATCH v7 1/4] drm/layerscape: Add Freescale DCU DRM driver

2015-07-11 Thread Paul Bolle
A question and a nit follow.

On vr, 2015-07-10 at 19:17 +0800, Jianwei Wang wrote:
> --- /dev/null
> +++ b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c

> +MODULE_ALIAS("platform:fsl-dcu-drm");

Question: this appears to be only useful if there's a corresponding
struct platform_device. That is, a platform_device with a "fsl-dcu-drm"
.name. It will fire off a "MODALIAS=platform:fsl-dcu-drm" uevent when
it's created.

I couldn't find this corresponding platform_device. Does it exist? Or is
this alias needed for some other reason?

> --- /dev/null
> +++ b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.h

> +#define DRIVER_NAME  "fsl-dcu-drm"

Nit: I don't think DRIVER_NAME is actually used anywhere.

Thanks,


Paul Bolle


[PATCH v7 1/4] drm/layerscape: Add Freescale DCU DRM driver

2015-07-10 Thread Jianwei Wang
This patch add support for Two Dimensional Animation and Compositing
Engine (2D-ACE) on the Freescale SoCs.

2D-ACE is a Freescale display controller. 2D-ACE describes
the functionality of the module extremely well its name is a value
that cannot be used as a token in programming languages.
Instead the valid token "DCU" is used to tag the register names and
function names.

The Display Controller Unit (DCU) module is a system master that
fetches graphics stored in internal or external memory and displays
them on a TFT LCD panel. A wide range of panel sizes is supported
and the timing of the interface signals is highly configurable.
Graphics are read directly from memory and then blended in real-time,
which allows for dynamic content creation with minimal CPU
intervention.

The features:
(1) Full RGB888 output to TFT LCD panel.
(2) For the current LCD panel, WQVGA "480x272" is supported.
(3) Blending of each pixel using up to 4 source layers
dependent on size of panel.
(4) Each graphic layer can be placed with one pixel resolution
in either axis.
(5) Each graphic layer support RGB565 and RGB888 direct colors
without alpha
channel and BGRA BGRA ARGB1555 direct colors with an
alpha channel and
YUV422 format.
(6) Each graphic layer support alpha blending with 8-bit
resolution.

This is a simplified version, only one primary plane, one
framebuffer created for
fbdev, one crtc, one connector for TFT LCD panel, an encoder.

Signed-off-by: Alison Wang 
Signed-off-by: Xiubo Li 
Signed-off-by: Jianwei Wang 
---


Changed in V7

- Remove redundant functions and replace deprecated hooker
Adviced by Daniel Vetter
- Replace drm_platform_init with drm_dev_alloc/register
Adviced by Daniel Vetter

Changed in V6

- Add NEC nl4827hc19_05b panel to panel-simple.c
Adviced by Mark Yao
- Add DRIVER_ATOMIC for driver_features
Adviced by Mark Yao
- check fsl_dev if it's NULL at PM suspend/resume
Adviced by Mark Yao

Changed in V5

- Update commit message
- Add layer registers initialization
- Remove unused functions
- Rename driver folder
Adviced by Stefan Agner
- Move pixel clock control functions to fsl_dcu_drm_drv.c
- remove redundant enable the clock implicitly using regmap
- Add maintainer message

Changed in V4:

-This version doesn't have functionality changed
Just a minor adjustment.

Changed in V3:

- Test driver on Vybrid board and add compatible string
- Remove unused functions
- set default crtc for encoder
- replace legacy functions with atomic help functions
Adviced by Daniel Vetter
- Set the unique name of the DRM device
- Implement irq handle function for vblank interrupt

Changed in v2: 
- Add atomic support
Adviced by Daniel Vetter
- Modify bindings file
- Rename node for compatibility
- Move platform related code out for compatibility
Adviced by Stefan Agner


 MAINTAINERS |   7 +
 drivers/gpu/drm/Kconfig |   2 +
 drivers/gpu/drm/Makefile|   1 +
 drivers/gpu/drm/fsl-dcu/Kconfig |  18 ++
 drivers/gpu/drm/fsl-dcu/Makefile|   7 +
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_connector.c | 183 +++
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_connector.h |  31 ++
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_crtc.c  | 159 ++
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_crtc.h  |  22 ++
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c   | 401 
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.h   | 223 +
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_fbdev.c |  26 ++
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_kms.c   |  42 +++
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_kms.h   |  17 +
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_plane.c | 195 
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_plane.h |  23 ++
 16 files changed, 1357 insertions(+)
 create mode 100644 drivers/gpu/drm/fsl-dcu/Kconfig
 create mode 100644 drivers/gpu/drm/fsl-dcu/Makefile
 create mode 100644 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_connector.c
 create mode 100644 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_connector.h
 create mode 100644 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_crtc.c
 create mode 100644 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_crtc.h
 create mode 100644 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c
 create mode 100644 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.h
 create mode 100644 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_fbdev.c
 create mode 100644 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_kms.c
 create mode 100644 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_kms.h
 create mode 100644 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_plane.c
 create mode 100644 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_plane.h

diff --git a/MAINTAINERS b/MAINTAINERS
index 6761318..b25b948 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -3404,6 +3404,13 @@ S:   Maintained
 F: drivers/gpu/drm/imx/
 F: Documentation/devicetree/bindings/drm/imx/

+DRM DRIVERS FOR FREESCALE DCU
+M: Jianwei Wang 
+M: Alison Wang 
+L: dri-devel at lists.freedesktop.org
+S: 

[PATCH v7 1/4] drm/layerscape: Add Freescale DCU DRM driver

2015-07-10 Thread Daniel Vetter
On Fri, Jul 10, 2015 at 07:17:40PM +0800, Jianwei Wang wrote:
> This patch add support for Two Dimensional Animation and Compositing
> Engine (2D-ACE) on the Freescale SoCs.
> 
> 2D-ACE is a Freescale display controller. 2D-ACE describes
> the functionality of the module extremely well its name is a value
> that cannot be used as a token in programming languages.
> Instead the valid token "DCU" is used to tag the register names and
> function names.
> 
> The Display Controller Unit (DCU) module is a system master that
> fetches graphics stored in internal or external memory and displays
> them on a TFT LCD panel. A wide range of panel sizes is supported
> and the timing of the interface signals is highly configurable.
> Graphics are read directly from memory and then blended in real-time,
> which allows for dynamic content creation with minimal CPU
> intervention.
> 
> The features:
> (1) Full RGB888 output to TFT LCD panel.
> (2) For the current LCD panel, WQVGA "480x272" is supported.
> (3) Blending of each pixel using up to 4 source layers
> dependent on size of panel.
> (4) Each graphic layer can be placed with one pixel resolution
> in either axis.
> (5) Each graphic layer support RGB565 and RGB888 direct colors
> without alpha
> channel and BGRA BGRA ARGB1555 direct colors with an
> alpha channel and
> YUV422 format.
> (6) Each graphic layer support alpha blending with 8-bit
> resolution.
> 
> This is a simplified version, only one primary plane, one
> framebuffer created for
> fbdev, one crtc, one connector for TFT LCD panel, an encoder.
> 
> Signed-off-by: Alison Wang 
> Signed-off-by: Xiubo Li 
> Signed-off-by: Jianwei Wang 

Can't find any other use of deprecated functions or legacy code patterns
or anything else that we've recently started cleaning up, looks good. No
detailed review though (for one I lack hw docs).

Acked-by: Daniel Vetter 

Might be good to get some cross-review from some other arm soc drm driver
team, then send a pull request to Dave for 4.3.

Cheers, Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch