[PATCH] MAINTAINERS: update for Freescale DCU DRM driver

2016-01-07 Thread Jianwei Wang
Acked-by: Jianwei Wang 

On Thu, Jan 7, 2016 at 2:02 PM, Stefan Agner  wrote:
> Promote myself as new maintainer of the Freescale DCU DRM driver.
>
> Signed-off-by: Stefan Agner 
> ---
> This has been previously discussed privately. The original driver
> author and maintainer Jianwei does not work for Freescale anymore
> and can not carve out spare time to maintain the driver.
>
> As I started to make use of the driver on the Freescale Vybrid SoC
> and already posted several fixes and improvements, I am willing to
> maintain the driver.
>
> Thanks Jianwei for your work on that driver!
>
> Dave, I hope you are OK with that?
>
> I plan to send a pull request with the patches which have been on the
> ml lately, specifically the "Fix no fb check bug" and my fixes and
> enhancements patchset, along with this maintainer change, does that
> sound reasonable?
>
> There is one more pending patchset for this drivers, the TCON and
> Vybrid support patchset, but this is probably not ready yet. I also
> plan to post another patchset which enables multiple overlay planes
> and a cursor plane.
>
> --
> Stefan
>
>  MAINTAINERS | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/MAINTAINERS b/MAINTAINERS
> index e9caa4b..3f0aea3 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -3678,7 +3678,7 @@ F:include/drm/exynos*
>  F: include/uapi/drm/exynos*
>
>  DRM DRIVERS FOR FREESCALE DCU
> -M: Jianwei Wang 
> +M: Stefan Agner 
>  M: Alison Wang 
>  L: dri-devel at lists.freedesktop.org
>  S: Supported
> --
> 2.6.4
>


[PATCH] drm/fsl-dcu: Add multi layers support

2015-08-31 Thread Jianwei Wang
For DCU support atmost 16 layers(on ls1021a) or 64 layers(on vf610),
add (total_layer - 1) overlay planes.

Signed-off-by: Jianwei Wang 
---
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_plane.c | 27 ++-
 1 file changed, 26 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_plane.c 
b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_plane.c
index 8787920..1195568 100644
--- a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_plane.c
+++ b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_plane.c
@@ -236,7 +236,10 @@ static const u32 fsl_dcu_drm_plane_formats[] = {

 struct drm_plane *fsl_dcu_drm_primary_create_plane(struct drm_device *dev)
 {
+   struct fsl_dcu_drm_device *fsl_dev = dev->dev_private;
struct drm_plane *primary;
+   struct drm_plane *overlay;
+   unsigned int total_layer, formats_size, i;
int ret;

primary = kzalloc(sizeof(*primary), GFP_KERNEL);
@@ -245,11 +248,12 @@ struct drm_plane *fsl_dcu_drm_primary_create_plane(struct 
drm_device *dev)
return NULL;
}

+   formats_size = ARRAY_SIZE(fsl_dcu_drm_plane_formats);
/* possible_crtc's will be filled in later by crtc_init */
ret = drm_universal_plane_init(dev, primary, 0,
   _dcu_drm_plane_funcs,
   fsl_dcu_drm_plane_formats,
-  ARRAY_SIZE(fsl_dcu_drm_plane_formats),
+  formats_size,
   DRM_PLANE_TYPE_PRIMARY);
if (ret) {
kfree(primary);
@@ -257,5 +261,26 @@ struct drm_plane *fsl_dcu_drm_primary_create_plane(struct 
drm_device *dev)
}
drm_plane_helper_add(primary, _dcu_drm_plane_helper_funcs);

+   total_layer = fsl_dev->soc->total_layer;
+   for (i = 0; i < total_layer - 1; i++) {
+   overlay = kzalloc(sizeof(*overlay), GFP_KERNEL);
+   if (!overlay) {
+   DRM_DEBUG_KMS("Failed to allocate overlay plane\n");
+   goto out;
+   }
+
+   ret = drm_universal_plane_init(dev, overlay, 1,
+  _dcu_drm_plane_funcs,
+  fsl_dcu_drm_plane_formats,
+  formats_size,
+  DRM_PLANE_TYPE_OVERLAY);
+   if (ret) {
+   kfree(overlay);
+   goto out;
+   }
+   drm_plane_helper_add(overlay, _dcu_drm_plane_helper_funcs);
+   }
+
+out:
return primary;
 }
-- 
2.1.0.27.g96db324



[PATCH] drm/fsl-dcu: Cleanup vblank interrupt mask and status setting code

2015-08-31 Thread Jianwei Wang
Switch update interrupt mask bit with regmap_update_bits, and clear
interrupt status by writing 1 to relevant bit before setting mask in
fsl_dcu_drm_irq_init function.

Signed-off-by: Jianwei Wang 
---
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c | 26 +++---
 1 file changed, 7 insertions(+), 19 deletions(-)

diff --git a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c 
b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c
index 9a8e2da..bf36971 100644
--- a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c
+++ b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c
@@ -38,21 +38,17 @@ static const struct regmap_config fsl_dcu_regmap_config = {
 static int fsl_dcu_drm_irq_init(struct drm_device *dev)
 {
struct fsl_dcu_drm_device *fsl_dev = dev->dev_private;
-   unsigned int value;
int ret;

ret = drm_irq_install(dev, fsl_dev->irq);
if (ret < 0)
dev_err(dev->dev, "failed to install IRQ handler\n");

-   ret = regmap_write(fsl_dev->regmap, DCU_INT_STATUS, 0);
+   ret = regmap_write(fsl_dev->regmap, DCU_INT_STATUS, 0x);
if (ret)
dev_err(dev->dev, "set DCU_INT_STATUS failed\n");
-   ret = regmap_read(fsl_dev->regmap, DCU_INT_MASK, );
-   if (ret)
-   dev_err(dev->dev, "read DCU_INT_MASK failed\n");
-   value &= DCU_INT_MASK_VBLANK;
-   ret = regmap_write(fsl_dev->regmap, DCU_INT_MASK, value);
+   ret = regmap_update_bits(fsl_dev->regmap, DCU_INT_MASK,
+DCU_INT_MASK_VBLANK, ~DCU_INT_MASK_VBLANK);
if (ret)
dev_err(dev->dev, "set DCU_INT_MASK failed\n");
ret = regmap_write(fsl_dev->regmap, DCU_UPDATE_MODE,
@@ -143,14 +139,10 @@ static irqreturn_t fsl_dcu_drm_irq(int irq, void *arg)
 static int fsl_dcu_drm_enable_vblank(struct drm_device *dev, int crtc)
 {
struct fsl_dcu_drm_device *fsl_dev = dev->dev_private;
-   unsigned int value;
int ret;

-   ret = regmap_read(fsl_dev->regmap, DCU_INT_MASK, );
-   if (ret)
-   dev_err(dev->dev, "read DCU_INT_MASK failed\n");
-   value &= ~DCU_INT_MASK_VBLANK;
-   ret = regmap_write(fsl_dev->regmap, DCU_INT_MASK, value);
+   ret = regmap_update_bits(fsl_dev->regmap, DCU_INT_MASK,
+DCU_INT_MASK_VBLANK, ~DCU_INT_MASK_VBLANK);
if (ret)
dev_err(dev->dev, "set DCU_INT_MASK failed\n");
return 0;
@@ -159,14 +151,10 @@ static int fsl_dcu_drm_enable_vblank(struct drm_device 
*dev, int crtc)
 static void fsl_dcu_drm_disable_vblank(struct drm_device *dev, int crtc)
 {
struct fsl_dcu_drm_device *fsl_dev = dev->dev_private;
-   unsigned int value;
int ret;

-   ret = regmap_read(fsl_dev->regmap, DCU_INT_MASK, );
-   if (ret)
-   dev_err(dev->dev, "read DCU_INT_MASK failed\n");
-   value |= DCU_INT_MASK_VBLANK;
-   ret = regmap_write(fsl_dev->regmap, DCU_INT_MASK, value);
+   ret = regmap_update_bits(fsl_dev->regmap, DCU_INT_MASK,
+DCU_INT_MASK_VBLANK, DCU_INT_MASK_VBLANK);
if (ret)
dev_err(dev->dev, "set DCU_INT_MASK failed\n");
 }
-- 
2.1.0.27.g96db324



[PATCH] drm/fsl-dcu: Fix no fb check bug

2015-08-31 Thread Jianwei Wang
For state->fb may be NULL in fsl_dcu_drm_plane_atomic_check function,
if so, return -EINVAL. No need check in fsl_dcu_drm_plane_atomic_update
anymore.

Signed-off-by: Jianwei Wang 
---
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_plane.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_plane.c 
b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_plane.c
index 82be6b8..8787920 100644
--- a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_plane.c
+++ b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_plane.c
@@ -41,6 +41,9 @@ static int fsl_dcu_drm_plane_atomic_check(struct drm_plane 
*plane,
 {
struct drm_framebuffer *fb = state->fb;

+   if (!fb)
+   return -EINVAL;
+
switch (fb->pixel_format) {
case DRM_FORMAT_RGB565:
case DRM_FORMAT_RGB888:
@@ -84,9 +87,6 @@ static void fsl_dcu_drm_plane_atomic_update(struct drm_plane 
*plane,
unsigned int alpha, bpp;
int index, ret;

-   if (!fb)
-   return;
-
index = fsl_dcu_drm_plane_index(plane);
if (index < 0)
return;
-- 
2.1.0.27.g96db324



[PATCH 2/2] arm:dts:ls1021a: Add SiI902x dts node

2015-08-27 Thread Jianwei Wang
The SiI902x is a HDMI transmitter.

Signed-off-by: Alison Wang 
Signed-off-by: Xiubo Li 
Signed-off-by: Jianwei Wang 
---
 arch/arm/boot/dts/ls1021a-twr.dts | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/arch/arm/boot/dts/ls1021a-twr.dts 
b/arch/arm/boot/dts/ls1021a-twr.dts
index a2c591e..c3140f0 100644
--- a/arch/arm/boot/dts/ls1021a-twr.dts
+++ b/arch/arm/boot/dts/ls1021a-twr.dts
@@ -79,6 +79,12 @@

  {
status = "okay";
+
+   hdmi: sii9022a at 39 {
+   compatible = "sii902x";
+   reg = <0x39>;
+   interrupts = ;
+   };
 };

  {
-- 
2.1.0.27.g96db324



[PATCH 1/2] drm/layerscape: Add HDMI support for DCU DRM driver

2015-08-27 Thread Jianwei Wang
Some Freescale SoCs, there has an DVI/HDMI controller and a PHY,
attached to one of their display controller unit's LCDC interfaces.
This patch adds a driver for SiI902x. The SiI902x is a HDMI
transmitter It supports resolutions from standard definition
480i/p and 576i/p all the way to high-definition 720p, 1080i,
and 1080p, the highest resolution supported by HDTVs today.

Signed-off-by: Alison Wang 
Signed-off-by: Xiubo Li 
Signed-off-by: Jianwei Wang 
---
 .../devicetree/bindings/video/SiI902x.txt  |  17 +
 drivers/gpu/drm/fsl-dcu/Makefile   |   1 +
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_hdmi.c | 639 +
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_kms.c  |  10 +
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_output.h   |  10 +
 5 files changed, 677 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/video/SiI902x.txt
 create mode 100644 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_hdmi.c

diff --git a/Documentation/devicetree/bindings/video/SiI902x.txt 
b/Documentation/devicetree/bindings/video/SiI902x.txt
new file mode 100644
index 000..d304499
--- /dev/null
+++ b/Documentation/devicetree/bindings/video/SiI902x.txt
@@ -0,0 +1,17 @@
+Device-Tree bindings for the SiI902x hdmi transmitter.
+
+Required properties:
+- compatible:  Should be "sii902x".
+- reg: The I2C address of the device.
+- interrupts:  Interrupt number to the cpu.
+
+Example:
+
+ {
+   status = "okay";
+   hdmi: sii9022a at 39 {
+ compatible = "sii902x";
+ reg = <0x39>;
+ interrupts = ;
+   };
+};
diff --git a/drivers/gpu/drm/fsl-dcu/Makefile b/drivers/gpu/drm/fsl-dcu/Makefile
index 6ea1523..98cacc2 100644
--- a/drivers/gpu/drm/fsl-dcu/Makefile
+++ b/drivers/gpu/drm/fsl-dcu/Makefile
@@ -1,6 +1,7 @@
 fsl-dcu-drm-y := fsl_dcu_drm_drv.o \
 fsl_dcu_drm_kms.o \
 fsl_dcu_drm_rgb.o \
+fsl_dcu_drm_hdmi.o \
 fsl_dcu_drm_plane.o \
 fsl_dcu_drm_crtc.o \
 fsl_dcu_drm_fbdev.o
diff --git a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_hdmi.c 
b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_hdmi.c
new file mode 100644
index 000..b91c8ca
--- /dev/null
+++ b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_hdmi.c
@@ -0,0 +1,639 @@
+/*
+ * Copyright 2015 Freescale Semiconductor, Inc.
+ *
+ * Freescale DCU drm device driver
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+
+#include "fsl_dcu_drm_drv.h"
+#include "fsl_dcu_drm_output.h"
+
+#define SII902X_INPUT_BUS_FMT  0x08
+#define SII902X_TPI_AVI_INPUT_FMT  0x09
+#define SII902X_TPI_AVI_OUTPUT_FMT 0x0A
+#define SII902X_SYS_CONTROL0x1A
+#define SII902X_SYS_CTR_DDC_REQBIT(2)
+#define SII902X_SYS_CTR_DDC_BUS_AVAI   (BIT(2) | BIT(1))
+#define SII902X_TPI_FAMILY_DEV_ID  0x1B
+#define SII902X_TPI_DEV_REV_ID 0x1C
+#define SII902X_TPI_REV_LEVEL_ID   0x1D
+#define SII902X_POWER_STATE0x1E
+#define SII902X_TPI_AUDIO_CFG0 0x24
+#define SII902X_TPI_AUDIO_CFG1 0x25
+#define SII902X_TPI_AUDIO_CFG2 0x26
+#define SII902X_TPI_AUDIO_CFG3 0x27
+#define SII902X_TPI_HDCP_REV   0x30
+#define SII902X_TPI_INT_ENABLE 0x3C
+#define SII902X_TPI_INT_STATUS 0x3D
+#define SII902X_TPI_INT_PLUG_INBIT(2)
+#define SII902X_GENERAL_PURPOSE_IO00xBC
+#define SII902X_GENERAL_PURPOSE_IO10xBD
+#define SII902X_GENERAL_PURPOSE_IO20xBE
+#define SII902X_TRANS_MODE_DIFF0xC7
+
+bool g_enable_hdmi;
+
+struct sii902x_data {
+   struct i2c_client *client;
+   struct delayed_work det_work;
+   struct fb_info *fbi;
+   struct fsl_dcu_drm_hdmicon *hdmicon;
+} *sii902x;
+
+static struct i2c_client *sii902x_to_i2c(struct sii902x_data *sii902x)
+{
+   return sii902x->client;
+}
+
+static s32 sii902x_write(const struct i2c_client *client,
+u8 command, u8 value)
+{
+   return i2c_smbus_write_byte_data(client, command, value);
+}
+
+static s32 sii902x_read(const struct i2c_client *client, u8 command)
+{
+   int val;
+
+   val = i2c_smbus_read_word_data(client, command);
+
+   return val & 0xff;
+}
+
+static void sii902x_power_up_tx(struct sii902x_data *sii902x)
+{
+   struct i2c_client *client = sii902x_to_i2c(sii902x);
+   int val;
+
+   val = sii902x_read(client, SII902X_POWER_STATE);
+   val &= ~0x3;
+   sii902x_write(client, SII902X_POWER_STATE, val);
+}
+
+static int sii902x_get_edid_preconfig(void)
+{
+   int old, dat, ret = 0, cnt = 100

[PULL] Add Freescale DCU DRM driver

2015-08-19 Thread Jianwei Wang
On Wed, Aug 19, 2015 at 7:36 PM, Dave Airlie  wrote:
>> Hi Dave,
>>
>> Warnings are fixed.  The pull request...
>
> Close but no cigar,
>
>
> CC [M]  drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.o
> /home/airlied/devel/kernel/drm-next/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c:
> In function ‘fsl_dcu_drm_probe’:294947a5c7f6d228b70fcc51a89527e74a38a2c5
> /home/airlied/devel/kernel/drm-next/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c:321:5:
> warning: ‘ret’ may be used uninitialized in this function
> [-Wmaybe-uninitialized]checkout
>   if (ret < 0) {
>  ^
>
> this looks like a real bug as well.checkout
>
> Dave.

I really feel so sorry, it's really a small bug caused by my previous
careless. It is fixed and I have checkout and compiled again.

Jianwei.

The following changes since commit 294947a5c7f6d228b70fcc51a89527e74a38a2c5:

  Merge branch 'vmwgfx-next' of
git://people.freedesktop.org/~thomash/linux into drm-next (2015-08-17
16:03:48 +1000)

are available in the git repository at:


  https://github.com/Jianwei-Wang/linux-drm-fsl-dcu.git drm-next-fsl-dcu

for you to fetch changes up to b55a1b9c55ee9ed5b7d1d2acbabb078a454dbeea:

  MAINTAINERS: Add Freescale DCU DRM driver maintainer (2015-08-19
22:26:33 -0400)

----
Jianwei Wang (3):
  drm/layerscape: Add Freescale DCU DRM driver
  devicetree: Add NEC to the vendor-prefix list
  MAINTAINERS: Add Freescale DCU DRM driver maintainer

 Documentation/devicetree/bindings/vendor-prefixes.txt |   1 +
 Documentation/devicetree/bindings/video/fsl,dcu.txt   |  22 ++
 MAINTAINERS   |   9 +++
 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_crtc.c| 210

 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_crtc.h|  19 ++
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c | 404

 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.h | 197
+
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_fbdev.c   |  23 +++
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_kms.c |  43 
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_output.h  |  33 +
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_plane.c   | 261
++
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_plane.h   |  17 +
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_rgb.c | 182
+
 17 files changed, 1449 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/video/fsl,dcu.txt
 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_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_output.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
 create mode 100644 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_rgb.c


[PULL] Add Freescale DCU DRM driver

2015-08-18 Thread Jianwei Wang
On Tue, Aug 18, 2015 at 12:20 AM, Dave Airlie  wrote:
> On 18 August 2015 at 12:47, Jianwei Wang  
> wrote:
>> On Mon, Aug 17, 2015 at 2:09 AM, Dave Airlie  wrote:
>>> On 31 July 2015 at 12:55, Jianwei Wang  
>>> wrote:
>>>> Hi Dave,
>>>>
>>>> This is the pull request for Freescale DCU DRM driver.
>>>>
>>> Hi,
>>>
>>> Thierry pulled the panel stuff already, so can you rebase this on
>>> drm-next to drop that patch?
>>>
>>> Dave.
>>>
>>
>> Okay.
>>
> nearly, there now build this, and fix the warnings :-)
>
> and try again!
>
> Dave.
>

Hi Dave,

Warnings are fixed.  The pull request...

Jianwei.

The following changes since commit 294947a5c7f6d228b70fcc51a89527e74a38a2c5:

  Merge branch 'vmwgfx-next' of
git://people.freedesktop.org/~thomash/linux into drm-next (2015-08-17
16:03:48 +1000)

are available in the git repository at:


  https://github.com/Jianwei-Wang/linux-drm-fsl-dcu.git drm-next-fsl-dcu

for you to fetch changes up to 6c145b0e6df5bb3c6395f1442134b0289ac5c3c0:

  MAINTAINERS: Add Freescale DCU DRM driver maintainer (2015-08-18
04:34:14 -0400)


Jianwei Wang (3):
  drm/layerscape: Add Freescale DCU DRM driver
  devicetree: Add NEC to the vendor-prefix list
  MAINTAINERS: Add Freescale DCU DRM driver maintainer

 Documentation/devicetree/bindings/vendor-prefixes.txt |   1 +
 Documentation/devicetree/bindings/video/fsl,dcu.txt   |  22 ++
 MAINTAINERS   |   9 +++
 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_crtc.c| 210

 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_crtc.h|  19 ++
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c | 404

 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.h | 197
+
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_fbdev.c   |  23 +++
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_kms.c |  43 
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_output.h  |  33 +
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_plane.c   | 261
++
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_plane.h   |  17 +
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_rgb.c | 182
+
 17 files changed, 1449 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/video/fsl,dcu.txt
 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_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_output.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
 create mode 100644 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_rgb.c


[PULL] Add Freescale DCU DRM driver

2015-08-17 Thread Jianwei Wang
On Mon, Aug 17, 2015 at 2:09 AM, Dave Airlie  wrote:
> On 31 July 2015 at 12:55, Jianwei Wang  wrote:
>> Hi Dave,
>>
>> This is the pull request for Freescale DCU DRM driver.
>>
> Hi,
>
> Thierry pulled the panel stuff already, so can you rebase this on
> drm-next to drop that patch?
>
> Dave.
>

Okay.

The following changes since commit 294947a5c7f6d228b70fcc51a89527e74a38a2c5:

  Merge branch 'vmwgfx-next' of
git://people.freedesktop.org/~thomash/linux into drm-next (2015-08-17
16:03:48 +1000)

are available in the git repository at:


  https://github.com/Jianwei-Wang/linux-drm-fsl-dcu.git drm-next-fsl-dcu

for you to fetch changes up to bd7d7f4369093a3181654331942454c8ee92998e:

  MAINTAINERS: add Freescale DCU DRM driver maintainer (2015-08-17
22:21:31 -0400)

--------
Jianwei Wang (3):
  drm/layerscape: Add Freescale DCU DRM driver
  devicetree: Add NEC to the vendor-prefix list
  MAINTAINERS: add Freescale DCU DRM driver maintainer

 Documentation/devicetree/bindings/vendor-prefixes.txt |   1 +
 Documentation/devicetree/bindings/video/fsl,dcu.txt   |  22 ++
 MAINTAINERS   |   9 +++
 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_crtc.c| 208

 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_crtc.h|  19 ++
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c | 404

 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.h | 197
+
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_fbdev.c   |  23 +++
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_kms.c |  43 
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_output.h  |  33 +
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_plane.c   | 261
++
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_plane.h   |  17 +
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_rgb.c | 182
+
 17 files changed, 1447 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/video/fsl,dcu.txt
 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_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_output.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
 create mode 100644 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_rgb.c


[PATCH v14 3/6] drm/panel: simple: Add support for NEC NL4827HC19-05B 480x272 panel

2015-08-14 Thread Jianwei Wang
On Thu, Aug 13, 2015 at 8:23 AM, Thierry Reding
 wrote:
> On Wed, Jul 29, 2015 at 04:30:02PM +0800, Jianwei Wang wrote:
>> This adds support for the NEC NL4827HC19-05B 480x272 panel to the DRM
>> simple panel driver.
>>
>> Signed-off-by: Alison Wang 
>> Signed-off-by: Xiubo Li 
>> Signed-off-by: Jianwei Wang 
>> Acked-by: Daniel Vetter 
>> ---
>>  .../bindings/panel/nec,nl4827hc19_05b.txt  |  7 ++
>>  drivers/gpu/drm/panel/panel-simple.c   | 26 
>> ++
>>  2 files changed, 33 insertions(+)
>>  create mode 100644 
>> Documentation/devicetree/bindings/panel/nec,nl4827hc19_05b.txt
>>
>> diff --git a/Documentation/devicetree/bindings/panel/nec,nl4827hc19_05b.txt 
>> b/Documentation/devicetree/bindings/panel/nec,nl4827hc19_05b.txt
>> new file mode 100644
>> index 000..20e9473
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/panel/nec,nl4827hc19_05b.txt
>> @@ -0,0 +1,7 @@
>> +NEC LCD Technologies,Ltd. WQVGA TFT LCD panel
>> +
>> +Required properties:
>> +- compatible: should be "nec,nl4827hc19_05b"
>
> Underscores are deprecated in compatible strings, so I've applied this
> with "nec,nl4827hc19-05b".
>
> Thierry

Okay, thanks.

Jianwei


[PULL] Add Freescale DCU DRM driver

2015-07-31 Thread Jianwei Wang
Hi Dave,

This is the pull request for Freescale DCU DRM driver.


The following changes since commit dcd14dd957f02ef679c61325a2221a0574bdcab3:

  Merge tag 'topic/connector-locking-2015-07-23' of
git://anongit.freedesktop.org/drm-intel into drm-next (2015-07-24
14:30:29 +1000)

are available in the git repository at:

  https://github.com/Jianwei-Wang/linux-drm-fsl-dcu.git drm-next-fsl-dcu

for you to fetch changes up to 0a16af5a9d87785f99ee5efdb04d88536e3e9d96:

  MAINTAINERS: add Freescale DCU DRM driver maintainer (2015-07-29
16:01:58 +0800)


Jianwei Wang (4):
  drm/layerscape: Add Freescale DCU DRM driver
  devicetree: Add NEC to the vendor-prefix list
  drm/panel: simple: Add support for NEC NL4827HC19-05B 480x272 panel
  MAINTAINERS: add Freescale DCU DRM driver maintainer

 Documentation/devicetree/bindings/panel/nec,nl4827hc19_05b.txt |   7 ++
 Documentation/devicetree/bindings/vendor-prefixes.txt  |   1 +
 Documentation/devicetree/bindings/video/fsl,dcu.txt|  22 
 MAINTAINERS|   9 ++
 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_crtc.c | 208

 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_crtc.h |  19 
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c  | 404
+
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.h  | 197
++
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_fbdev.c|  23 
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_kms.c  |  43 
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_output.h   |  33 ++
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_plane.c| 261

 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_plane.h|  17 +++
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_rgb.c  | 182
+++
 drivers/gpu/drm/panel/panel-simple.c   |  26 +
 19 files changed, 1480 insertions(+)
 create mode 100644
Documentation/devicetree/bindings/panel/nec,nl4827hc19_05b.txt
 create mode 100644 Documentation/devicetree/bindings/video/fsl,dcu.txt
 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_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_output.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
 create mode 100644 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_rgb.c


[PATCH v14 6/6] arm:dts:ls1021a: Add a TFT LCD panel dts node

2015-07-29 Thread Jianwei Wang
Add a TFT LCD panel. the TFT LCD panel is WQVGA "480x272",
and the bpp is 24.

Signed-off-by: Alison Wang 
Signed-off-by: Xiubo Li 
Signed-off-by: Jianwei Wang 
---
 arch/arm/boot/dts/ls1021a-twr.dts | 11 +++
 1 file changed, 11 insertions(+)

diff --git a/arch/arm/boot/dts/ls1021a-twr.dts 
b/arch/arm/boot/dts/ls1021a-twr.dts
index a2c591e..2443329 100644
--- a/arch/arm/boot/dts/ls1021a-twr.dts
+++ b/arch/arm/boot/dts/ls1021a-twr.dts
@@ -56,6 +56,17 @@
enet0_sgmii_phy = _phy2;
enet1_sgmii_phy = _phy0;
};
+
+   panel: panel {
+   compatible = "nec,nl4827hc19_05b";
+   };
+
+};
+
+ {
+   fsl,panel = <>;
+   status = "okay";
+
 };

  {
-- 
2.1.0.27.g96db324



[PATCH v14 5/6] arm:dts:ls1021a: Add DCU dts node

2015-07-29 Thread Jianwei Wang
Add DCU node, DCU is a display controller of Freescale
named 2D-ACE.

Signed-off-by: Alison Wang 
Signed-off-by: Xiubo Li 
Signed-off-by: Jianwei Wang 
---
 arch/arm/boot/dts/ls1021a.dtsi | 10 ++
 1 file changed, 10 insertions(+)

diff --git a/arch/arm/boot/dts/ls1021a.dtsi b/arch/arm/boot/dts/ls1021a.dtsi
index c70bb27..6d6e3e2 100644
--- a/arch/arm/boot/dts/ls1021a.dtsi
+++ b/arch/arm/boot/dts/ls1021a.dtsi
@@ -383,6 +383,16 @@
 <_clk 1>;
};

+   dcu: dcu at 2ce {
+   compatible = "fsl,ls1021a-dcu";
+   reg = <0x0 0x2ce 0x0 0x1>;
+   interrupts = ;
+   clocks = <_clk 0>;
+   clock-names = "dcu";
+   big-endian;
+   status = "disabled";
+   };
+
mdio0: mdio at 2d24000 {
compatible = "gianfar";
device_type = "mdio";
-- 
2.1.0.27.g96db324



[PATCH v14 4/6] MAINTAINERS: add Freescale DCU DRM driver maintainer

2015-07-29 Thread Jianwei Wang
Add Alison and myself as maintainers of the Freescale DCU DRM driver.

Signed-off-by: Alison Wang 
Signed-off-by: Xiubo Li 
Signed-off-by: Jianwei Wang 
---
 MAINTAINERS | 9 +
 1 file changed, 9 insertions(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index 9c9dd5f..66746e4 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -3555,6 +3555,15 @@ F:   drivers/gpu/drm/exynos/
 F: include/drm/exynos*
 F: include/uapi/drm/exynos*

+DRM DRIVERS FOR FREESCALE DCU
+M: Jianwei Wang 
+M: Alison Wang 
+L: dri-devel at lists.freedesktop.org
+S: Supported
+F: drivers/gpu/drm/fsl-dcu/
+F: Documentation/devicetree/bindings/video/fsl,dcu.txt
+F: Documentation/devicetree/bindings/panel/nec,nl4827hc19_05b.txt
+
 DRM DRIVERS FOR FREESCALE IMX
 M: Philipp Zabel 
 L: dri-devel at lists.freedesktop.org
-- 
2.1.0.27.g96db324



[PATCH v14 3/6] drm/panel: simple: Add support for NEC NL4827HC19-05B 480x272 panel

2015-07-29 Thread Jianwei Wang
This adds support for the NEC NL4827HC19-05B 480x272 panel to the DRM
simple panel driver.

Signed-off-by: Alison Wang 
Signed-off-by: Xiubo Li 
Signed-off-by: Jianwei Wang 
Acked-by: Daniel Vetter 
---
 .../bindings/panel/nec,nl4827hc19_05b.txt  |  7 ++
 drivers/gpu/drm/panel/panel-simple.c   | 26 ++
 2 files changed, 33 insertions(+)
 create mode 100644 
Documentation/devicetree/bindings/panel/nec,nl4827hc19_05b.txt

diff --git a/Documentation/devicetree/bindings/panel/nec,nl4827hc19_05b.txt 
b/Documentation/devicetree/bindings/panel/nec,nl4827hc19_05b.txt
new file mode 100644
index 000..20e9473
--- /dev/null
+++ b/Documentation/devicetree/bindings/panel/nec,nl4827hc19_05b.txt
@@ -0,0 +1,7 @@
+NEC LCD Technologies,Ltd. WQVGA TFT LCD panel
+
+Required properties:
+- compatible: should be "nec,nl4827hc19_05b"
+
+This binding is compatible with the simple-panel binding, which is specified
+in simple-panel.txt in this directory.
diff --git a/drivers/gpu/drm/panel/panel-simple.c 
b/drivers/gpu/drm/panel/panel-simple.c
index f94201b..db61dd1 100644
--- a/drivers/gpu/drm/panel/panel-simple.c
+++ b/drivers/gpu/drm/panel/panel-simple.c
@@ -943,6 +943,29 @@ static const struct panel_desc lg_lp129qe = {
},
 };

+static const struct drm_display_mode nec_nl4827hc19_05b_mode = {
+   .clock = 10870,
+   .hdisplay = 480,
+   .hsync_start = 480 + 2,
+   .hsync_end = 480 + 2 + 41,
+   .htotal = 480 + 2 + 41 + 2,
+   .vdisplay = 272,
+   .vsync_start = 272 + 2,
+   .vsync_end = 272 + 2 + 4,
+   .vtotal = 272 + 2 + 4 + 2,
+   .vrefresh = 74,
+};
+
+static const struct panel_desc nec_nl4827hc19_05b = {
+   .modes = _nl4827hc19_05b_mode,
+   .num_modes = 1,
+   .size = {
+   .width = 95,
+   .height = 54,
+   },
+   .bus_format = MEDIA_BUS_FMT_RGB888_1X24
+};
+
 static const struct drm_display_mode ortustech_com43h4m85ulc_mode  = {
.clock = 25000,
.hdisplay = 480,
@@ -1113,6 +1136,9 @@ static const struct of_device_id platform_of_match[] = {
.compatible = "lg,lp129qe",
.data = _lp129qe,
}, {
+   .compatible = "nec,nl4827hc19_05b",
+   .data = _nl4827hc19_05b,
+   }, {
.compatible = "ortustech,com43h4m85ulc",
.data = _com43h4m85ulc,
}, {
-- 
2.1.0.27.g96db324



[PATCH v14 2/6] devicetree: Add NEC to the vendor-prefix list

2015-07-29 Thread Jianwei Wang
NEC represent NEC LCD Technologies, Ltd.

Signed-off-by: Alison Wang 
Signed-off-by: Xiubo Li 
Signed-off-by: Jianwei Wang 
---
 Documentation/devicetree/bindings/vendor-prefixes.txt | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/vendor-prefixes.txt 
b/Documentation/devicetree/bindings/vendor-prefixes.txt
index d444757..42ca6bc 100644
--- a/Documentation/devicetree/bindings/vendor-prefixes.txt
+++ b/Documentation/devicetree/bindings/vendor-prefixes.txt
@@ -140,6 +140,7 @@ mundoreader Mundo Reader S.L.
 murata Murata Manufacturing Co., Ltd.
 mxicy  Macronix International Co., Ltd.
 national   National Semiconductor
+necNEC LCD Technologies, Ltd.
 neonodeNeonode Inc.
 netgearNETGEAR
 netlogic   Broadcom Corporation (formerly NetLogic Microsystems)
-- 
2.1.0.27.g96db324



[PATCH v14 1/6] drm/layerscape: Add Freescale DCU DRM driver

2015-07-29 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) Blending of each pixel using up to 4 source layers
dependent
on size of panel.
(3) Each graphic layer can be placed with one pixel resolution
in either axis.
(4) 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.
(5) Each graphic layer support alpha blending with 8-bit
resolution.

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

Signed-off-by: Alison Wang 
Signed-off-by: Xiubo Li 
Signed-off-by: Jianwei Wang 
Acked-by: Daniel Vetter 
---
 .../devicetree/bindings/video/fsl,dcu.txt  |  22 ++
 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_crtc.c | 208 +++
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_crtc.h |  19 +
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c  | 404 +
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.h  | 197 ++
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_fbdev.c|  23 ++
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_kms.c  |  43 +++
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_output.h   |  33 ++
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_plane.c| 261 +
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_plane.h|  17 +
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_rgb.c  | 182 ++
 15 files changed, 1437 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/video/fsl,dcu.txt
 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_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_output.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
 create mode 100644 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_rgb.c

diff --git a/Documentation/devicetree/bindings/video/fsl,dcu.txt 
b/Documentation/devicetree/bindings/video/fsl,dcu.txt
new file mode 100644
index 000..ebf1be9
--- /dev/null
+++ b/Documentation/devicetree/bindings/video/fsl,dcu.txt
@@ -0,0 +1,22 @@
+Device Tree bindings for Freescale DCU DRM Driver
+
+Required properties:
+- compatible:  Should be one of
+   * "fsl,ls1021a-dcu".
+   * "fsl,vf610-dcu".
+
+- reg: Address and length of the register set for dcu.
+- clocks:  From common clock binding: handle to dcu clock.
+- clock-names: From common clock binding: Shall be "dcu".
+- big-endian   Boolean property, LS1021A DCU registers are big-endian.
+- fsl,panel:   The phandle to panel node.
+
+Examples:
+dcu: dcu at 2ce {
+   compatible = "fsl,ls1021a-dcu";
+   reg = <0x0 0x2ce 0x0 0x1>;
+   clocks = <_clk 0>;
+   clock-names = "dcu";
+   big-endian;
+   fsl,panel = <>;
+};
diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig
index c46ca31..9cfd14e 100644
--- a/drivers/gpu/drm/Kconfig
+++ b/drivers/gpu/drm/Kconfig
@@ -231,6 +231,8 @@ source "drivers/gpu/drm/virtio/Kconfig"

 source "drivers/gpu/drm/msm/Kconfig"

+source "drivers/gpu/drm/fsl-dcu/Kconfig"
+
 source "drivers/gpu/drm/tegra/Kconfig"

 source "drivers/gpu/drm/panel/Kconfig"
diff --git a/drivers/gpu/drm/Makefile b/drivers/gpu/drm/Makefile
index 5713d05..11cb81e 100644
--- a/drivers/gpu/drm/Makefile
+++ b/drivers/gpu/drm/Makefile
@@ -70,3 +70,4 @@ obj-$(CONFIG_DRM_IMX) += imx

[PATCH v14 0/6] drm/layerscape: Add Freescale DCU DRM driver

2015-07-29 Thread Jianwei Wang
Changed in v14

-Remove drm_modeset_lock_all before drm_mode_config_reset

Changed in v13
-set regmap_config.cache_type to REGCACHE_RBTREE
-add call drm_modeset_lock_all before drm_mode_config_reset
-adjust patch order for creating pull request

Changed in v12

-Add one patch for MAINTAINER entry for drm/layerscape
Adviced by Daniel Vetter
-Add #include 

Changed in V11
-set regmap_config.cache_type to REGCACHE_FLAT
Advanced by Alexander Stein

Changed in V10
-adjust commit log, remove meaningless statement
-cleanup code for it's format and style.
-remove platform related code out, including of tcon(vf610) and scfg(ls1021a)
-remove useless sentences: encoder->crtc = crtc; and connector->encoder = 
encoder; and so on
-add vendor prefix for panel pandle
-make a DCU_CTRLDESCLN(x, y)  to avoid high repetition
-introduce per-SoC capability structure to avoid check on the OF node's 
compatible string
-Implement some functions: crtc enable and disable, enable and disable VBLANK, 
plane atomic_disable and atomic_enable -atomic_check and so on
-move DCU config sentence to the right place
-move get resources functions to  ->probe()
-move fsl,dcu.txt to video/ folder
-add big-endian describe
All advaced by Thierry Reding

Changed in V9

put node after calling of_drm_find_panel
split clk_prepare_enable() to clk_prepare() and clk_enable(), just call 
clk_prepare once, and check return value
check regmap_write/regmap_read return return value
remove useless ".owner= THIS_MODULE,"
All advanced by Mark Yao

Changed in V8

- Remove useless code
#define DRIVER_NAME "fsl-dcu-drm"
MODULE_ALIAS("platform:fsl-dcu-drm");
Adviced by Paul Bolle

Changed in V7

- Remove redundant functions and replace deprecated hook
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


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) Blending of each pixel using up to 4 source layers
dependent
on size of panel.
(3) Each graphic layer can be placed with one pixel resolution
in either axis.
(4) 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.
(5) Each graphic layer support alpha blending with 8-bit
resolution.

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

---
 .../devicetree/bindings/video/fsl,dcu.txt  |  22 ++
 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_crtc.c | 208 +++
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_crtc.h |  19 +
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c  | 404 +
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.h  | 197 ++
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_fbdev.c|  23 ++
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_kms.c  

[PATCH v13 0/6] drm/layerscape: Add Freescale DCU DRM driver

2015-07-29 Thread Jianwei Wang
On Wed, Jul 29, 2015 at 3:21 PM, Daniel Vetter  wrote:
> On Wed, Jul 29, 2015 at 02:54:46PM +0800, Jianwei Wang wrote:
>> Changed in v13
>> -set regmap_config.cache_type to REGCACHE_RBTREE
>> -add call drm_modeset_lock_all before drm_mode_config_reset
>
> This was a bug in one of my recently merged patches, please don't call
> drm_modeset_lock_all before config_reset. Instead please test "drm: Fixup
> locking WARNINGs in drm_mode_config_reset" which should address this
> problem too.
>

I have test that patch, It's okay. I'll remove drm_modeset_lock_all.

Thanks
Jianwei

> Thanks, Daniel
>
>> -adjust patch order for creating pull request
>>
>> Changed in v12
>>
>> -Add one patch for MAINTAINER entry for drm/layerscape
>> Adviced by Daniel Vetter
>> -Add #include 
>>
>> Changed in V11
>> -set regmap_config.cache_type to REGCACHE_FLAT
>> Advanced by Alexander Stein
>>
>> Changed in V10
>> -adjust commit log, remove meaningless statement
>> -cleanup code for it's format and style.
>> -remove platform related code out, including of tcon(vf610) and scfg(ls1021a)
>> -remove useless sentences: encoder->crtc = crtc; and connector->encoder = 
>> encoder; and so on
>> -add vendor prefix for panel pandle
>> -make a DCU_CTRLDESCLN(x, y)  to avoid high repetition
>> -introduce per-SoC capability structure to avoid check on the OF node's 
>> compatible string
>> -Implement some functions: crtc enable and disable, enable and disable 
>> VBLANK, plane atomic_disable and atomic_enable -atomic_check and so on
>> -move DCU config sentence to the right place
>> -move get resources functions to  ->probe()
>> -move fsl,dcu.txt to video/ folder
>> -add big-endian describe
>> All advaced by Thierry Reding
>>
>> Changed in V9
>>
>> put node after calling of_drm_find_panel
>> split clk_prepare_enable() to clk_prepare() and clk_enable(), just call 
>> clk_prepare once, and check return value
>> check regmap_write/regmap_read return return value
>> remove useless ".owner= THIS_MODULE,"
>> All advanced by Mark Yao
>>
>> Changed in V8
>>
>> - Remove useless code
>> #define DRIVER_NAME "fsl-dcu-drm"
>> MODULE_ALIAS("platform:fsl-dcu-drm");
>> Adviced by Paul Bolle
>>
>> Changed in V7
>>
>> - Remove redundant functions and replace deprecated hook
>> 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
>>
>> 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 s

[PATCH v13 6/6] arm:dts:ls1021a: Add a TFT LCD panel dts node

2015-07-29 Thread Jianwei Wang
Add a TFT LCD panel. the TFT LCD panel is WQVGA "480x272",
and the bpp is 24.

Signed-off-by: Alison Wang 
Signed-off-by: Xiubo Li 
Signed-off-by: Jianwei Wang 
---
 arch/arm/boot/dts/ls1021a-twr.dts | 11 +++
 1 file changed, 11 insertions(+)

diff --git a/arch/arm/boot/dts/ls1021a-twr.dts 
b/arch/arm/boot/dts/ls1021a-twr.dts
index a2c591e..2443329 100644
--- a/arch/arm/boot/dts/ls1021a-twr.dts
+++ b/arch/arm/boot/dts/ls1021a-twr.dts
@@ -56,6 +56,17 @@
enet0_sgmii_phy = _phy2;
enet1_sgmii_phy = _phy0;
};
+
+   panel: panel {
+   compatible = "nec,nl4827hc19_05b";
+   };
+
+};
+
+ {
+   fsl,panel = <>;
+   status = "okay";
+
 };

  {
-- 
2.1.0.27.g96db324



[PATCH v13 5/6] arm:dts:ls1021a: Add DCU dts node

2015-07-29 Thread Jianwei Wang
Add DCU node, DCU is a display controller of Freescale
named 2D-ACE.

Signed-off-by: Alison Wang 
Signed-off-by: Xiubo Li 
Signed-off-by: Jianwei Wang 
---
 arch/arm/boot/dts/ls1021a.dtsi | 10 ++
 1 file changed, 10 insertions(+)

diff --git a/arch/arm/boot/dts/ls1021a.dtsi b/arch/arm/boot/dts/ls1021a.dtsi
index c70bb27..6d6e3e2 100644
--- a/arch/arm/boot/dts/ls1021a.dtsi
+++ b/arch/arm/boot/dts/ls1021a.dtsi
@@ -383,6 +383,16 @@
 <_clk 1>;
};

+   dcu: dcu at 2ce {
+   compatible = "fsl,ls1021a-dcu";
+   reg = <0x0 0x2ce 0x0 0x1>;
+   interrupts = ;
+   clocks = <_clk 0>;
+   clock-names = "dcu";
+   big-endian;
+   status = "disabled";
+   };
+
mdio0: mdio at 2d24000 {
compatible = "gianfar";
device_type = "mdio";
-- 
2.1.0.27.g96db324



[PATCH v13 4/6] MAINTAINERS: add Freescale DCU DRM driver maintainer

2015-07-29 Thread Jianwei Wang
Add Alison and myself as maintainers of the Freescale DCU DRM driver.

Signed-off-by: Alison Wang 
Signed-off-by: Xiubo Li 
Signed-off-by: Jianwei Wang 
---
 MAINTAINERS | 9 +
 1 file changed, 9 insertions(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index 9c9dd5f..66746e4 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -3555,6 +3555,15 @@ F:   drivers/gpu/drm/exynos/
 F: include/drm/exynos*
 F: include/uapi/drm/exynos*

+DRM DRIVERS FOR FREESCALE DCU
+M: Jianwei Wang 
+M: Alison Wang 
+L: dri-devel at lists.freedesktop.org
+S: Supported
+F: drivers/gpu/drm/fsl-dcu/
+F: Documentation/devicetree/bindings/video/fsl,dcu.txt
+F: Documentation/devicetree/bindings/panel/nec,nl4827hc19_05b.txt
+
 DRM DRIVERS FOR FREESCALE IMX
 M: Philipp Zabel 
 L: dri-devel at lists.freedesktop.org
-- 
2.1.0.27.g96db324



[PATCH v13 3/6] drm/panel: simple: Add support for NEC NL4827HC19-05B 480x272 panel

2015-07-29 Thread Jianwei Wang
This adds support for the NEC NL4827HC19-05B 480x272 panel to the DRM
simple panel driver.

Signed-off-by: Alison Wang 
Signed-off-by: Xiubo Li 
Signed-off-by: Jianwei Wang 
Acked-by: Daniel Vetter 
---
 .../bindings/panel/nec,nl4827hc19_05b.txt  |  7 ++
 drivers/gpu/drm/panel/panel-simple.c   | 26 ++
 2 files changed, 33 insertions(+)
 create mode 100644 
Documentation/devicetree/bindings/panel/nec,nl4827hc19_05b.txt

diff --git a/Documentation/devicetree/bindings/panel/nec,nl4827hc19_05b.txt 
b/Documentation/devicetree/bindings/panel/nec,nl4827hc19_05b.txt
new file mode 100644
index 000..20e9473
--- /dev/null
+++ b/Documentation/devicetree/bindings/panel/nec,nl4827hc19_05b.txt
@@ -0,0 +1,7 @@
+NEC LCD Technologies,Ltd. WQVGA TFT LCD panel
+
+Required properties:
+- compatible: should be "nec,nl4827hc19_05b"
+
+This binding is compatible with the simple-panel binding, which is specified
+in simple-panel.txt in this directory.
diff --git a/drivers/gpu/drm/panel/panel-simple.c 
b/drivers/gpu/drm/panel/panel-simple.c
index f94201b..db61dd1 100644
--- a/drivers/gpu/drm/panel/panel-simple.c
+++ b/drivers/gpu/drm/panel/panel-simple.c
@@ -943,6 +943,29 @@ static const struct panel_desc lg_lp129qe = {
},
 };

+static const struct drm_display_mode nec_nl4827hc19_05b_mode = {
+   .clock = 10870,
+   .hdisplay = 480,
+   .hsync_start = 480 + 2,
+   .hsync_end = 480 + 2 + 41,
+   .htotal = 480 + 2 + 41 + 2,
+   .vdisplay = 272,
+   .vsync_start = 272 + 2,
+   .vsync_end = 272 + 2 + 4,
+   .vtotal = 272 + 2 + 4 + 2,
+   .vrefresh = 74,
+};
+
+static const struct panel_desc nec_nl4827hc19_05b = {
+   .modes = _nl4827hc19_05b_mode,
+   .num_modes = 1,
+   .size = {
+   .width = 95,
+   .height = 54,
+   },
+   .bus_format = MEDIA_BUS_FMT_RGB888_1X24
+};
+
 static const struct drm_display_mode ortustech_com43h4m85ulc_mode  = {
.clock = 25000,
.hdisplay = 480,
@@ -1113,6 +1136,9 @@ static const struct of_device_id platform_of_match[] = {
.compatible = "lg,lp129qe",
.data = _lp129qe,
}, {
+   .compatible = "nec,nl4827hc19_05b",
+   .data = _nl4827hc19_05b,
+   }, {
.compatible = "ortustech,com43h4m85ulc",
.data = _com43h4m85ulc,
}, {
-- 
2.1.0.27.g96db324



[PATCH v13 2/6] devicetree: Add NEC to the vendor-prefix list

2015-07-29 Thread Jianwei Wang
NEC represent NEC LCD Technologies, Ltd.

Signed-off-by: Alison Wang 
Signed-off-by: Xiubo Li 
Signed-off-by: Jianwei Wang 
---
 Documentation/devicetree/bindings/vendor-prefixes.txt | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/vendor-prefixes.txt 
b/Documentation/devicetree/bindings/vendor-prefixes.txt
index d444757..42ca6bc 100644
--- a/Documentation/devicetree/bindings/vendor-prefixes.txt
+++ b/Documentation/devicetree/bindings/vendor-prefixes.txt
@@ -140,6 +140,7 @@ mundoreader Mundo Reader S.L.
 murata Murata Manufacturing Co., Ltd.
 mxicy  Macronix International Co., Ltd.
 national   National Semiconductor
+necNEC LCD Technologies, Ltd.
 neonodeNeonode Inc.
 netgearNETGEAR
 netlogic   Broadcom Corporation (formerly NetLogic Microsystems)
-- 
2.1.0.27.g96db324



[PATCH v13 1/6] drm/layerscape: Add Freescale DCU DRM driver

2015-07-29 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) Blending of each pixel using up to 4 source layers
dependent
on size of panel.
(3) Each graphic layer can be placed with one pixel resolution
in either axis.
(4) 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.
(5) Each graphic layer support alpha blending with 8-bit
resolution.

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

Signed-off-by: Alison Wang 
Signed-off-by: Xiubo Li 
Signed-off-by: Jianwei Wang 
Acked-by: Daniel Vetter 
---
 .../devicetree/bindings/video/fsl,dcu.txt  |  22 ++
 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_crtc.c | 208 +++
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_crtc.h |  19 +
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c  | 404 +
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.h  | 197 ++
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_fbdev.c|  23 ++
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_kms.c  |  45 +++
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_output.h   |  33 ++
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_plane.c| 261 +
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_plane.h|  17 +
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_rgb.c  | 182 ++
 15 files changed, 1439 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/video/fsl,dcu.txt
 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_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_output.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
 create mode 100644 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_rgb.c

diff --git a/Documentation/devicetree/bindings/video/fsl,dcu.txt 
b/Documentation/devicetree/bindings/video/fsl,dcu.txt
new file mode 100644
index 000..ebf1be9
--- /dev/null
+++ b/Documentation/devicetree/bindings/video/fsl,dcu.txt
@@ -0,0 +1,22 @@
+Device Tree bindings for Freescale DCU DRM Driver
+
+Required properties:
+- compatible:  Should be one of
+   * "fsl,ls1021a-dcu".
+   * "fsl,vf610-dcu".
+
+- reg: Address and length of the register set for dcu.
+- clocks:  From common clock binding: handle to dcu clock.
+- clock-names: From common clock binding: Shall be "dcu".
+- big-endian   Boolean property, LS1021A DCU registers are big-endian.
+- fsl,panel:   The phandle to panel node.
+
+Examples:
+dcu: dcu at 2ce {
+   compatible = "fsl,ls1021a-dcu";
+   reg = <0x0 0x2ce 0x0 0x1>;
+   clocks = <_clk 0>;
+   clock-names = "dcu";
+   big-endian;
+   fsl,panel = <>;
+};
diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig
index c46ca31..9cfd14e 100644
--- a/drivers/gpu/drm/Kconfig
+++ b/drivers/gpu/drm/Kconfig
@@ -231,6 +231,8 @@ source "drivers/gpu/drm/virtio/Kconfig"

 source "drivers/gpu/drm/msm/Kconfig"

+source "drivers/gpu/drm/fsl-dcu/Kconfig"
+
 source "drivers/gpu/drm/tegra/Kconfig"

 source "drivers/gpu/drm/panel/Kconfig"
diff --git a/drivers/gpu/drm/Makefile b/drivers/gpu/drm/Makefile
index 5713d05..11cb81e 100644
--- a/drivers/gpu/drm/Makefile
+++ b/drivers/gpu/drm/Makefile
@@ -70,3 +70,4 @@ obj-$(CONFIG_DRM_IMX) += imx

[PATCH v13 0/6] drm/layerscape: Add Freescale DCU DRM driver

2015-07-29 Thread Jianwei Wang
Changed in v13
-set regmap_config.cache_type to REGCACHE_RBTREE
-add call drm_modeset_lock_all before drm_mode_config_reset
-adjust patch order for creating pull request

Changed in v12

-Add one patch for MAINTAINER entry for drm/layerscape
Adviced by Daniel Vetter
-Add #include 

Changed in V11
-set regmap_config.cache_type to REGCACHE_FLAT
Advanced by Alexander Stein

Changed in V10
-adjust commit log, remove meaningless statement
-cleanup code for it's format and style.
-remove platform related code out, including of tcon(vf610) and scfg(ls1021a)
-remove useless sentences: encoder->crtc = crtc; and connector->encoder = 
encoder; and so on
-add vendor prefix for panel pandle
-make a DCU_CTRLDESCLN(x, y)  to avoid high repetition
-introduce per-SoC capability structure to avoid check on the OF node's 
compatible string
-Implement some functions: crtc enable and disable, enable and disable VBLANK, 
plane atomic_disable and atomic_enable -atomic_check and so on
-move DCU config sentence to the right place
-move get resources functions to  ->probe()
-move fsl,dcu.txt to video/ folder
-add big-endian describe
All advaced by Thierry Reding

Changed in V9

put node after calling of_drm_find_panel
split clk_prepare_enable() to clk_prepare() and clk_enable(), just call 
clk_prepare once, and check return value
check regmap_write/regmap_read return return value
remove useless ".owner= THIS_MODULE,"
All advanced by Mark Yao

Changed in V8

- Remove useless code
#define DRIVER_NAME "fsl-dcu-drm"
MODULE_ALIAS("platform:fsl-dcu-drm");
Adviced by Paul Bolle

Changed in V7

- Remove redundant functions and replace deprecated hook
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

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) Blending of each pixel using up to 4 source layers
dependent
on size of panel.
(3) Each graphic layer can be placed with one pixel resolution
in either axis.
(4) 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.
(5) Each graphic layer support alpha blending with 8-bit
resolution.

.../devicetree/bindings/video/fsl,dcu.txt  |  22 ++
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_crtc.c | 208 +++
drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_crtc.h |  19 +
drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c  | 404 +
drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.h  | 197 ++
drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_fbdev.c|  23 ++
drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_kms.c  |  45 +++
drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_output.h   |  33 ++
drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_plane.c| 261 +
drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_plane.h|  17 +

[PATCH v12 4/6] arm/dts/ls1021a: Add DCU dts node

2015-07-27 Thread Jianwei Wang
On Sat, Jul 25, 2015 at 11:27 AM, Shawn Guo  wrote:
>
> On Fri, Jul 24, 2015 at 06:34:12PM +0800, Jianwei Wang wrote:
> > Add DCU node, DCU is a display controller of Freescale
> > named 2D-ACE.
> >
> > Signed-off-by: Alison Wang 
> > Signed-off-by: Xiubo Li 
> > Signed-off-by: Jianwei Wang 
>
> For dts patches sent to me, please use prefix like "ARM: dts: ls1021a:
> ..." in the subject.
>
> Shawn

Okay, thanks.

Jianwei

>
> > ---
> >  arch/arm/boot/dts/ls1021a.dtsi | 10 ++
> >  1 file changed, 10 insertions(+)
> >
> > diff --git a/arch/arm/boot/dts/ls1021a.dtsi b/arch/arm/boot/dts/ls1021a.dtsi
> > index c70bb27..6d6e3e2 100644
> > --- a/arch/arm/boot/dts/ls1021a.dtsi
> > +++ b/arch/arm/boot/dts/ls1021a.dtsi
> > @@ -383,6 +383,16 @@
> ><_clk 1>;
> >   };
> >
> > + dcu: dcu at 2ce {
> > + compatible = "fsl,ls1021a-dcu";
> > + reg = <0x0 0x2ce 0x0 0x1>;
> > + interrupts = ;
> > + clocks = <_clk 0>;
> > + clock-names = "dcu";
> > + big-endian;
> > + status = "disabled";
> > + };
> > +
> >   mdio0: mdio at 2d24000 {
> >   compatible = "gianfar";
> >   device_type = "mdio";
> > --
> > 2.1.0.27.g96db324
> >
> >
> > ___
> > linux-arm-kernel mailing list
> > linux-arm-kernel at lists.infradead.org
> > http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
> >


[PATCH v12 6/6] MAINTAINERS: add Freescale DCU DRM driver maintainer

2015-07-24 Thread Jianwei Wang
Add Alison and myself as maintainers of the Freescale DCU DRM driver.

Signed-off-by: Alison Wang 
Signed-off-by: Xiubo Li 
Signed-off-by: Jianwei Wang 
---
 MAINTAINERS | 9 +
 1 file changed, 9 insertions(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index 6761318..387a84a 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -3397,6 +3397,15 @@ F:   drivers/gpu/drm/exynos/
 F: include/drm/exynos*
 F: include/uapi/drm/exynos*

+DRM DRIVERS FOR FREESCALE DCU
+M: Jianwei Wang 
+M: Alison Wang 
+L: dri-devel at lists.freedesktop.org
+S: Supported
+F: drivers/gpu/drm/fsl-dcu/
+F: Documentation/devicetree/bindings/video/fsl,dcu.txt
+F: Documentation/devicetree/bindings/panel/nec,nl4827hc19_05b.txt
+
 DRM DRIVERS FOR FREESCALE IMX
 M: Philipp Zabel 
 L: dri-devel at lists.freedesktop.org
-- 
2.1.0.27.g96db324



[PATCH v12 5/6] arm/dts/ls1021a: Add a TFT LCD panel dts node

2015-07-24 Thread Jianwei Wang
Add a TFT LCD panel. the TFT LCD panel is WQVGA "480x272",
and the bpp is 24.

Signed-off-by: Alison Wang 
Signed-off-by: Xiubo Li 
Signed-off-by: Jianwei Wang 
---
 arch/arm/boot/dts/ls1021a-twr.dts | 11 +++
 1 file changed, 11 insertions(+)

diff --git a/arch/arm/boot/dts/ls1021a-twr.dts 
b/arch/arm/boot/dts/ls1021a-twr.dts
index a2c591e..2443329 100644
--- a/arch/arm/boot/dts/ls1021a-twr.dts
+++ b/arch/arm/boot/dts/ls1021a-twr.dts
@@ -56,6 +56,17 @@
enet0_sgmii_phy = _phy2;
enet1_sgmii_phy = _phy0;
};
+
+   panel: panel {
+   compatible = "nec,nl4827hc19_05b";
+   };
+
+};
+
+ {
+   fsl,panel = <>;
+   status = "okay";
+
 };

  {
-- 
2.1.0.27.g96db324



[PATCH v12 4/6] arm/dts/ls1021a: Add DCU dts node

2015-07-24 Thread Jianwei Wang
Add DCU node, DCU is a display controller of Freescale
named 2D-ACE.

Signed-off-by: Alison Wang 
Signed-off-by: Xiubo Li 
Signed-off-by: Jianwei Wang 
---
 arch/arm/boot/dts/ls1021a.dtsi | 10 ++
 1 file changed, 10 insertions(+)

diff --git a/arch/arm/boot/dts/ls1021a.dtsi b/arch/arm/boot/dts/ls1021a.dtsi
index c70bb27..6d6e3e2 100644
--- a/arch/arm/boot/dts/ls1021a.dtsi
+++ b/arch/arm/boot/dts/ls1021a.dtsi
@@ -383,6 +383,16 @@
 <_clk 1>;
};

+   dcu: dcu at 2ce {
+   compatible = "fsl,ls1021a-dcu";
+   reg = <0x0 0x2ce 0x0 0x1>;
+   interrupts = ;
+   clocks = <_clk 0>;
+   clock-names = "dcu";
+   big-endian;
+   status = "disabled";
+   };
+
mdio0: mdio at 2d24000 {
compatible = "gianfar";
device_type = "mdio";
-- 
2.1.0.27.g96db324



[PATCH v12 3/6] drm/panel: simple: Add support for NEC NL4827HC19-05B 480x272 panel

2015-07-24 Thread Jianwei Wang
This adds support for the NEC NL4827HC19-05B 480x272 panel to the DRM
simple panel driver.

Signed-off-by: Alison Wang 
Signed-off-by: Xiubo Li 
Signed-off-by: Jianwei Wang 
Acked-by: Daniel Vetter 
---
 .../bindings/panel/nec,nl4827hc19_05b.txt  |  7 ++
 drivers/gpu/drm/panel/panel-simple.c   | 26 ++
 2 files changed, 33 insertions(+)
 create mode 100644 
Documentation/devicetree/bindings/panel/nec,nl4827hc19_05b.txt

diff --git a/Documentation/devicetree/bindings/panel/nec,nl4827hc19_05b.txt 
b/Documentation/devicetree/bindings/panel/nec,nl4827hc19_05b.txt
new file mode 100644
index 000..20e9473
--- /dev/null
+++ b/Documentation/devicetree/bindings/panel/nec,nl4827hc19_05b.txt
@@ -0,0 +1,7 @@
+NEC LCD Technologies,Ltd. WQVGA TFT LCD panel
+
+Required properties:
+- compatible: should be "nec,nl4827hc19_05b"
+
+This binding is compatible with the simple-panel binding, which is specified
+in simple-panel.txt in this directory.
diff --git a/drivers/gpu/drm/panel/panel-simple.c 
b/drivers/gpu/drm/panel/panel-simple.c
index f94201b..db61dd1 100644
--- a/drivers/gpu/drm/panel/panel-simple.c
+++ b/drivers/gpu/drm/panel/panel-simple.c
@@ -943,6 +943,29 @@ static const struct panel_desc lg_lp129qe = {
},
 };

+static const struct drm_display_mode nec_nl4827hc19_05b_mode = {
+   .clock = 10870,
+   .hdisplay = 480,
+   .hsync_start = 480 + 2,
+   .hsync_end = 480 + 2 + 41,
+   .htotal = 480 + 2 + 41 + 2,
+   .vdisplay = 272,
+   .vsync_start = 272 + 2,
+   .vsync_end = 272 + 2 + 4,
+   .vtotal = 272 + 2 + 4 + 2,
+   .vrefresh = 74,
+};
+
+static const struct panel_desc nec_nl4827hc19_05b = {
+   .modes = _nl4827hc19_05b_mode,
+   .num_modes = 1,
+   .size = {
+   .width = 95,
+   .height = 54,
+   },
+   .bus_format = MEDIA_BUS_FMT_RGB888_1X24
+};
+
 static const struct drm_display_mode ortustech_com43h4m85ulc_mode  = {
.clock = 25000,
.hdisplay = 480,
@@ -1113,6 +1136,9 @@ static const struct of_device_id platform_of_match[] = {
.compatible = "lg,lp129qe",
.data = _lp129qe,
}, {
+   .compatible = "nec,nl4827hc19_05b",
+   .data = _nl4827hc19_05b,
+   }, {
.compatible = "ortustech,com43h4m85ulc",
.data = _com43h4m85ulc,
}, {
-- 
2.1.0.27.g96db324



[PATCH v12 2/6] devicetree: Add NEC to the vendor-prefix list

2015-07-24 Thread Jianwei Wang
NEC represent NEC LCD Technologies, Ltd.

Signed-off-by: Alison Wang 
Signed-off-by: Xiubo Li 
Signed-off-by: Jianwei Wang 
---
 Documentation/devicetree/bindings/vendor-prefixes.txt | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/vendor-prefixes.txt 
b/Documentation/devicetree/bindings/vendor-prefixes.txt
index 8033919..9f22b3e 100644
--- a/Documentation/devicetree/bindings/vendor-prefixes.txt
+++ b/Documentation/devicetree/bindings/vendor-prefixes.txt
@@ -131,6 +131,7 @@ mundoreader Mundo Reader S.L.
 murata Murata Manufacturing Co., Ltd.
 mxicy  Macronix International Co., Ltd.
 national   National Semiconductor
+necNEC LCD Technologies, Ltd.
 neonodeNeonode Inc.
 netgearNETGEAR
 netlogic   Broadcom Corporation (formerly NetLogic Microsystems)
-- 
2.1.0.27.g96db324



[PATCH v12 1/6] drm/layerscape: Add Freescale DCU DRM driver

2015-07-24 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) Blending of each pixel using up to 4 source layers
dependent
on size of panel.
(3) Each graphic layer can be placed with one pixel resolution
in either axis.
(4) 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.
(5) Each graphic layer support alpha blending with 8-bit
resolution.

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

Signed-off-by: Alison Wang 
Signed-off-by: Xiubo Li 
Signed-off-by: Jianwei Wang 
Acked-by: Daniel Vetter 
---
 .../devicetree/bindings/video/fsl,dcu.txt  |  22 ++
 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_crtc.c | 208 +++
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_crtc.h |  19 +
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c  | 404 +
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.h  | 197 ++
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_fbdev.c|  23 ++
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_kms.c  |  43 +++
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_output.h   |  33 ++
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_plane.c| 261 +
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_plane.h|  17 +
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_rgb.c  | 182 ++
 15 files changed, 1437 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/video/fsl,dcu.txt
 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_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_output.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
 create mode 100644 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_rgb.c

diff --git a/Documentation/devicetree/bindings/video/fsl,dcu.txt 
b/Documentation/devicetree/bindings/video/fsl,dcu.txt
new file mode 100644
index 000..ebf1be9
--- /dev/null
+++ b/Documentation/devicetree/bindings/video/fsl,dcu.txt
@@ -0,0 +1,22 @@
+Device Tree bindings for Freescale DCU DRM Driver
+
+Required properties:
+- compatible:  Should be one of
+   * "fsl,ls1021a-dcu".
+   * "fsl,vf610-dcu".
+
+- reg: Address and length of the register set for dcu.
+- clocks:  From common clock binding: handle to dcu clock.
+- clock-names: From common clock binding: Shall be "dcu".
+- big-endian   Boolean property, LS1021A DCU registers are big-endian.
+- fsl,panel:   The phandle to panel node.
+
+Examples:
+dcu: dcu at 2ce {
+   compatible = "fsl,ls1021a-dcu";
+   reg = <0x0 0x2ce 0x0 0x1>;
+   clocks = <_clk 0>;
+   clock-names = "dcu";
+   big-endian;
+   fsl,panel = <>;
+};
diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig
index c46ca31..9cfd14e 100644
--- a/drivers/gpu/drm/Kconfig
+++ b/drivers/gpu/drm/Kconfig
@@ -231,6 +231,8 @@ source "drivers/gpu/drm/virtio/Kconfig"

 source "drivers/gpu/drm/msm/Kconfig"

+source "drivers/gpu/drm/fsl-dcu/Kconfig"
+
 source "drivers/gpu/drm/tegra/Kconfig"

 source "drivers/gpu/drm/panel/Kconfig"
diff --git a/drivers/gpu/drm/Makefile b/drivers/gpu/drm/Makefile
index 5713d05..11cb81e 100644
--- a/drivers/gpu/drm/Makefile
+++ b/drivers/gpu/drm/Makefile
@@ -70,3 +70,4 @@ obj-$(CONFIG_DRM_IMX) += imx

[PATCH v12 0/6] drm/layerscape: Add Freescale DCU DRM driver

2015-07-24 Thread Jianwei Wang
Resend v12 for lack of patch 0/6

This patchset add support for Two Dimensional Animation and Compositing
Engine (2D-ACE) on the Freescale LS102x SoCs.

Changed in v12

-Add one patch for MAINTAINER entry for drm/layerscape
Adviced by Daniel Vetter
-Add #include 

Changed in V11
-set regmap_config.cache_type to REGCACHE_FLAT
Advanced by Alexander Stein

Changed in V10
-adjust commit log, remove meaningless statement
-cleanup code for it's format and style.
-remove platform related code out, including of tcon(vf610) and scfg(ls1021a)
-remove useless sentences: encoder->crtc = crtc; and connector->encoder = 
encoder; and so on
-add vendor prefix for panel pandle
-make a DCU_CTRLDESCLN(x, y)  to avoid high repetition
-introduce per-SoC capability structure to avoid check on the OF node's 
compatible string
-Implement some functions: crtc enable and disable, enable and disable VBLANK, 
plane atomic_disable and atomic_enable -atomic_check and so on
-move DCU config sentence to the right place
-move get resources functions to  ->probe()
-move fsl,dcu.txt to video/ folder
-add big-endian describe
All advaced by Thierry Reding

Changed in V9

put node after calling of_drm_find_panel
split clk_prepare_enable() to clk_prepare() and clk_enable(), just call 
clk_prepare once, and check return value
check regmap_write/regmap_read return return value
remove useless ".owner= THIS_MODULE,"
All advanced by Mark Yao

Changed in V8

- Remove useless code
#define DRIVER_NAME "fsl-dcu-drm"
MODULE_ALIAS("platform:fsl-dcu-drm");
Adviced by Paul Bolle

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

.../devicetree/bindings/video/fsl,dcu.txt  |  22 ++
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_crtc.c | 208 +++
drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_crtc.h |  19 +
drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c  | 404 +
drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.h  | 197 ++
drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_fbdev.c|  23 ++
drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_kms.c  |  43 +++
drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_output.h   |  33 ++
drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_plane.c| 261 +
drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_plane.h|  17 +
drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_rgb.c  | 182 ++
15 files changed, 1437 insertions(+)
create mode 100644 Documentation/devicetree/bindings/video/fsl,dcu.txt
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_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_output.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
create mode 100644 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_rgb.c




[PATCH v12 6/6] MAINTAINERS: add Freescale DCU DRM driver maintainer

2015-07-24 Thread Jianwei Wang
Add Alison and myself as maintainers of the Freescale DCU DRM driver.

Signed-off-by: Alison Wang 
Signed-off-by: Xiubo Li 
Signed-off-by: Jianwei Wang 
---
 MAINTAINERS | 9 +
 1 file changed, 9 insertions(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index 6761318..387a84a 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -3397,6 +3397,15 @@ F:   drivers/gpu/drm/exynos/
 F: include/drm/exynos*
 F: include/uapi/drm/exynos*

+DRM DRIVERS FOR FREESCALE DCU
+M: Jianwei Wang 
+M: Alison Wang 
+L: dri-devel at lists.freedesktop.org
+S: Supported
+F: drivers/gpu/drm/fsl-dcu/
+F: Documentation/devicetree/bindings/video/fsl,dcu.txt
+F: Documentation/devicetree/bindings/panel/nec,nl4827hc19_05b.txt
+
 DRM DRIVERS FOR FREESCALE IMX
 M: Philipp Zabel 
 L: dri-devel at lists.freedesktop.org
-- 
2.1.0.27.g96db324



[PATCH v12 5/6] arm/dts/ls1021a: Add a TFT LCD panel dts node

2015-07-24 Thread Jianwei Wang
Add a TFT LCD panel. the TFT LCD panel is WQVGA "480x272",
and the bpp is 24.

Signed-off-by: Alison Wang 
Signed-off-by: Xiubo Li 
Signed-off-by: Jianwei Wang 
---
 arch/arm/boot/dts/ls1021a-twr.dts | 11 +++
 1 file changed, 11 insertions(+)

diff --git a/arch/arm/boot/dts/ls1021a-twr.dts 
b/arch/arm/boot/dts/ls1021a-twr.dts
index a2c591e..2443329 100644
--- a/arch/arm/boot/dts/ls1021a-twr.dts
+++ b/arch/arm/boot/dts/ls1021a-twr.dts
@@ -56,6 +56,17 @@
enet0_sgmii_phy = _phy2;
enet1_sgmii_phy = _phy0;
};
+
+   panel: panel {
+   compatible = "nec,nl4827hc19_05b";
+   };
+
+};
+
+ {
+   fsl,panel = <>;
+   status = "okay";
+
 };

  {
-- 
2.1.0.27.g96db324



[PATCH v12 4/6] arm/dts/ls1021a: Add DCU dts node

2015-07-24 Thread Jianwei Wang
Add DCU node, DCU is a display controller of Freescale
named 2D-ACE.

Signed-off-by: Alison Wang 
Signed-off-by: Xiubo Li 
Signed-off-by: Jianwei Wang 
---
 arch/arm/boot/dts/ls1021a.dtsi | 10 ++
 1 file changed, 10 insertions(+)

diff --git a/arch/arm/boot/dts/ls1021a.dtsi b/arch/arm/boot/dts/ls1021a.dtsi
index c70bb27..6d6e3e2 100644
--- a/arch/arm/boot/dts/ls1021a.dtsi
+++ b/arch/arm/boot/dts/ls1021a.dtsi
@@ -383,6 +383,16 @@
 <_clk 1>;
};

+   dcu: dcu at 2ce {
+   compatible = "fsl,ls1021a-dcu";
+   reg = <0x0 0x2ce 0x0 0x1>;
+   interrupts = ;
+   clocks = <_clk 0>;
+   clock-names = "dcu";
+   big-endian;
+   status = "disabled";
+   };
+
mdio0: mdio at 2d24000 {
compatible = "gianfar";
device_type = "mdio";
-- 
2.1.0.27.g96db324



[PATCH v12 3/6] drm/panel: simple: Add support for NEC NL4827HC19-05B 480x272 panel

2015-07-24 Thread Jianwei Wang
This adds support for the NEC NL4827HC19-05B 480x272 panel to the DRM
simple panel driver.

Signed-off-by: Alison Wang 
Signed-off-by: Xiubo Li 
Signed-off-by: Jianwei Wang 
Acked-by: Daniel Vetter 
---
 .../bindings/panel/nec,nl4827hc19_05b.txt  |  7 ++
 drivers/gpu/drm/panel/panel-simple.c   | 26 ++
 2 files changed, 33 insertions(+)
 create mode 100644 
Documentation/devicetree/bindings/panel/nec,nl4827hc19_05b.txt

diff --git a/Documentation/devicetree/bindings/panel/nec,nl4827hc19_05b.txt 
b/Documentation/devicetree/bindings/panel/nec,nl4827hc19_05b.txt
new file mode 100644
index 000..20e9473
--- /dev/null
+++ b/Documentation/devicetree/bindings/panel/nec,nl4827hc19_05b.txt
@@ -0,0 +1,7 @@
+NEC LCD Technologies,Ltd. WQVGA TFT LCD panel
+
+Required properties:
+- compatible: should be "nec,nl4827hc19_05b"
+
+This binding is compatible with the simple-panel binding, which is specified
+in simple-panel.txt in this directory.
diff --git a/drivers/gpu/drm/panel/panel-simple.c 
b/drivers/gpu/drm/panel/panel-simple.c
index f94201b..db61dd1 100644
--- a/drivers/gpu/drm/panel/panel-simple.c
+++ b/drivers/gpu/drm/panel/panel-simple.c
@@ -943,6 +943,29 @@ static const struct panel_desc lg_lp129qe = {
},
 };

+static const struct drm_display_mode nec_nl4827hc19_05b_mode = {
+   .clock = 10870,
+   .hdisplay = 480,
+   .hsync_start = 480 + 2,
+   .hsync_end = 480 + 2 + 41,
+   .htotal = 480 + 2 + 41 + 2,
+   .vdisplay = 272,
+   .vsync_start = 272 + 2,
+   .vsync_end = 272 + 2 + 4,
+   .vtotal = 272 + 2 + 4 + 2,
+   .vrefresh = 74,
+};
+
+static const struct panel_desc nec_nl4827hc19_05b = {
+   .modes = _nl4827hc19_05b_mode,
+   .num_modes = 1,
+   .size = {
+   .width = 95,
+   .height = 54,
+   },
+   .bus_format = MEDIA_BUS_FMT_RGB888_1X24
+};
+
 static const struct drm_display_mode ortustech_com43h4m85ulc_mode  = {
.clock = 25000,
.hdisplay = 480,
@@ -1113,6 +1136,9 @@ static const struct of_device_id platform_of_match[] = {
.compatible = "lg,lp129qe",
.data = _lp129qe,
}, {
+   .compatible = "nec,nl4827hc19_05b",
+   .data = _nl4827hc19_05b,
+   }, {
.compatible = "ortustech,com43h4m85ulc",
.data = _com43h4m85ulc,
}, {
-- 
2.1.0.27.g96db324



[PATCH v12 2/6] devicetree: Add NEC to the vendor-prefix list

2015-07-24 Thread Jianwei Wang
NEC represent NEC LCD Technologies, Ltd.

Signed-off-by: Alison Wang 
Signed-off-by: Xiubo Li 
Signed-off-by: Jianwei Wang 
---
 Documentation/devicetree/bindings/vendor-prefixes.txt | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/vendor-prefixes.txt 
b/Documentation/devicetree/bindings/vendor-prefixes.txt
index 8033919..9f22b3e 100644
--- a/Documentation/devicetree/bindings/vendor-prefixes.txt
+++ b/Documentation/devicetree/bindings/vendor-prefixes.txt
@@ -131,6 +131,7 @@ mundoreader Mundo Reader S.L.
 murata Murata Manufacturing Co., Ltd.
 mxicy  Macronix International Co., Ltd.
 national   National Semiconductor
+necNEC LCD Technologies, Ltd.
 neonodeNeonode Inc.
 netgearNETGEAR
 netlogic   Broadcom Corporation (formerly NetLogic Microsystems)
-- 
2.1.0.27.g96db324



[PATCH v12 1/6] drm/layerscape: Add Freescale DCU DRM driver

2015-07-24 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) Blending of each pixel using up to 4 source layers
dependent
on size of panel.
(3) Each graphic layer can be placed with one pixel resolution
in either axis.
(4) 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.
(5) Each graphic layer support alpha blending with 8-bit
resolution.

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

Signed-off-by: Alison Wang 
Signed-off-by: Xiubo Li 
Signed-off-by: Jianwei Wang 
Acked-by: Daniel Vetter 
---
 .../devicetree/bindings/video/fsl,dcu.txt  |  22 ++
 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_crtc.c | 208 +++
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_crtc.h |  19 +
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c  | 404 +
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.h  | 197 ++
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_fbdev.c|  23 ++
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_kms.c  |  43 +++
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_output.h   |  33 ++
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_plane.c| 261 +
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_plane.h|  17 +
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_rgb.c  | 182 ++
 15 files changed, 1437 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/video/fsl,dcu.txt
 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_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_output.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
 create mode 100644 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_rgb.c

diff --git a/Documentation/devicetree/bindings/video/fsl,dcu.txt 
b/Documentation/devicetree/bindings/video/fsl,dcu.txt
new file mode 100644
index 000..ebf1be9
--- /dev/null
+++ b/Documentation/devicetree/bindings/video/fsl,dcu.txt
@@ -0,0 +1,22 @@
+Device Tree bindings for Freescale DCU DRM Driver
+
+Required properties:
+- compatible:  Should be one of
+   * "fsl,ls1021a-dcu".
+   * "fsl,vf610-dcu".
+
+- reg: Address and length of the register set for dcu.
+- clocks:  From common clock binding: handle to dcu clock.
+- clock-names: From common clock binding: Shall be "dcu".
+- big-endian   Boolean property, LS1021A DCU registers are big-endian.
+- fsl,panel:   The phandle to panel node.
+
+Examples:
+dcu: dcu at 2ce {
+   compatible = "fsl,ls1021a-dcu";
+   reg = <0x0 0x2ce 0x0 0x1>;
+   clocks = <_clk 0>;
+   clock-names = "dcu";
+   big-endian;
+   fsl,panel = <>;
+};
diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig
index c46ca31..9cfd14e 100644
--- a/drivers/gpu/drm/Kconfig
+++ b/drivers/gpu/drm/Kconfig
@@ -231,6 +231,8 @@ source "drivers/gpu/drm/virtio/Kconfig"

 source "drivers/gpu/drm/msm/Kconfig"

+source "drivers/gpu/drm/fsl-dcu/Kconfig"
+
 source "drivers/gpu/drm/tegra/Kconfig"

 source "drivers/gpu/drm/panel/Kconfig"
diff --git a/drivers/gpu/drm/Makefile b/drivers/gpu/drm/Makefile
index 5713d05..11cb81e 100644
--- a/drivers/gpu/drm/Makefile
+++ b/drivers/gpu/drm/Makefile
@@ -70,3 +70,4 @@ obj-$(CONFIG_DRM_IMX) += imx

[PATCH v12 0/6] drm/layerscape: Add Freescale DCU DRM driver

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

Changed in v12

-Add one patch for MAINTAINER entry for drm/layerscape
Adviced by Daniel Vetter
-Add #include  in fsl_dcu_drm_drv.c

Changed in V11
-set regmap_config.cache_type to REGCACHE_FLAT
Advanced by Alexander Stein

Changed in V10
-adjust commit log, remove meaningless statement
-cleanup code for it's format and style.
-remove platform related code out, including of tcon(vf610) and scfg(ls1021a)
-remove useless sentences: encoder->crtc = crtc; and connector->encoder = 
encoder; and so on
-add vendor prefix for panel pandle
-make a DCU_CTRLDESCLN(x, y)  to avoid high repetition
-introduce per-SoC capability structure to avoid check on the OF node's 
compatible string
-Implement some functions: crtc enable and disable, enable and disable VBLANK, 
plane atomic_disable and atomic_enable -atomic_check and so on
-move DCU config sentence to the right place
-move get resources functions to  ->probe()
-move fsl,dcu.txt to video/ folder
-add big-endian describe
All advaced by Thierry Reding

Changed in V9

put node after calling of_drm_find_panel
split clk_prepare_enable() to clk_prepare() and clk_enable(), just call 
clk_prepare once, and check return value
check regmap_write/regmap_read return return value
remove useless ".owner= THIS_MODULE,"
All advanced by Mark Yao

Changed in V8

- Remove useless code
#define DRIVER_NAME "fsl-dcu-drm"
MODULE_ALIAS("platform:fsl-dcu-drm");
Adviced by Paul Bolle

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



[PATCH v11 1/5] drm/layerscape: Add Freescale DCU DRM driver

2015-07-24 Thread Jianwei Wang
On Fri, Jul 24, 2015 at 3:48 PM, Daniel Vetter  wrote:
> On Fri, Jul 24, 2015 at 11:21:57AM +0800, jianwei wang wrote:
>> Hi Dave,
>>
>> I think Freescale DCU DRM driver is ready now, can it land?
>>
>> I have worked on this driver for about nine month. Daniel Vetter,
>> Thierry Reding, Mark yao,
>> Alexander Stein, Paul Bolle, Alison Wang, Stefan Agner reviewed this
>> pathset. The latest
>> version v11 has been send out about an week, and no more comments any more.
>
> On a quick look about overall process there's a few bits missing still:
> - review from dt maintainer for the device-tree pieces (review from an
>   original author like Alice Wang doesn't count).
> - needs one patch for MAINTAINER entry for drm/layerscape.
> - just send a pull request to Dave once you have this all.
>
> Cheers, Daniel

Okay, Thanks!

BR.
Jianwei

>>
>> BR.
>> Jianwei
>>
>> On Mon, Jul 20, 2015 at 5:53 PM, 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) Blending of each pixel using up to 4 source layers
>> > dependent
>> > on size of panel.
>> > (3) Each graphic layer can be placed with one pixel resolution
>> > in either axis.
>> > (4) 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.
>> > (5) Each graphic layer support alpha blending with 8-bit
>> > resolution.
>> >
>> > This is a simplified version, only one primary plane, one
>> > framebuffer, one crtc, one connector and one encoder for TFT
>> > LCD panel.
>> >
>> > Signed-off-by: Alison Wang 
>> > Signed-off-by: Xiubo Li 
>> > Signed-off-by: Jianwei Wang 
>> > Acked-by: Daniel Vetter 
>> > Reviewed-by: Alison Wang 
>> > ---
>> >
>> >
>> > Changed in V11
>> > -set regmap_config.cache_type to REGCACHE_FLAT
>> > Advanced by Alexander Stein
>> >
>> > Changed in V10
>> > -adjust commit log, remove meaningless statement
>> > -cleanup code for it's format and style.
>> > -remove platform related code out, including of tcon(vf610) and 
>> > scfg(ls1021a)
>> > -remove useless sentences: encoder->crtc = crtc; and connector->encoder = 
>> > encoder; and so on
>> > -add vendor prefix for panel pandle
>> > -make a DCU_CTRLDESCLN(x, y)  to avoid high repetition
>> > -introduce per-SoC capability structure to avoid check on the OF node's 
>> > compatible string
>> > -Implement some functions: crtc enable and disable, enable and disable 
>> > VBLANK, plane atomic_disable and atomic_enable -atomic_check and so on
>> > -move DCU config sentence to the right place
>> > -move get resources functions to  ->probe()
>> > -move fsl,dcu.txt to video/ folder
>> > -add big-endian describe
>> > All advaced by Thierry Reding
>> >
>> > Changed in V9
>> >
>> > -put node after calling of_drm_find_panel
>> > -split clk_prepare_enable() to clk_prepare() and clk_enable(), just call 
>> > clk_prepare once, and check return value
>> > -check regmap_write/regmap_read return return value
>> > -remove useless ".owner= THIS_MODULE,"
>> > All advanced by Mark Yao
>> >
>> > Changed in V8
>> >
>> > - Remove useless code
>> >  #define DRIVER_NAME "fsl-dcu-drm"
>> >  MODULE_ALIAS("platform:fs

[PATCH v11 1/5] drm/layerscape: Add Freescale DCU DRM driver

2015-07-24 Thread jianwei wang
Hi Dave,

I think Freescale DCU DRM driver is ready now, can it land?

I have worked on this driver for about nine month. Daniel Vetter,
Thierry Reding, Mark yao,
Alexander Stein, Paul Bolle, Alison Wang, Stefan Agner reviewed this
pathset. The latest
version v11 has been send out about an week, and no more comments any more.

BR.
Jianwei

On Mon, Jul 20, 2015 at 5:53 PM, 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) Blending of each pixel using up to 4 source layers
> dependent
> on size of panel.
> (3) Each graphic layer can be placed with one pixel resolution
> in either axis.
> (4) 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.
> (5) Each graphic layer support alpha blending with 8-bit
> resolution.
>
> This is a simplified version, only one primary plane, one
> framebuffer, one crtc, one connector and one encoder for TFT
> LCD panel.
>
> Signed-off-by: Alison Wang 
> Signed-off-by: Xiubo Li 
> Signed-off-by: Jianwei Wang 
> Acked-by: Daniel Vetter 
> Reviewed-by: Alison Wang 
> ---
>
>
> Changed in V11
> -set regmap_config.cache_type to REGCACHE_FLAT
> Advanced by Alexander Stein
>
> Changed in V10
> -adjust commit log, remove meaningless statement
> -cleanup code for it's format and style.
> -remove platform related code out, including of tcon(vf610) and scfg(ls1021a)
> -remove useless sentences: encoder->crtc = crtc; and connector->encoder = 
> encoder; and so on
> -add vendor prefix for panel pandle
> -make a DCU_CTRLDESCLN(x, y)  to avoid high repetition
> -introduce per-SoC capability structure to avoid check on the OF node's 
> compatible string
> -Implement some functions: crtc enable and disable, enable and disable 
> VBLANK, plane atomic_disable and atomic_enable -atomic_check and so on
> -move DCU config sentence to the right place
> -move get resources functions to  ->probe()
> -move fsl,dcu.txt to video/ folder
> -add big-endian describe
> All advaced by Thierry Reding
>
> Changed in V9
>
> -put node after calling of_drm_find_panel
> -split clk_prepare_enable() to clk_prepare() and clk_enable(), just call 
> clk_prepare once, and check return value
> -check regmap_write/regmap_read return return value
> -remove useless ".owner= THIS_MODULE,"
> All advanced by Mark Yao
>
> Changed in V8
>
> - Remove useless code
>  #define DRIVER_NAME "fsl-dcu-drm"
>  MODULE_ALIAS("platform:fsl-dcu-drm");
> Adviced by Paul Bolle
>
> 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 

[PATCH v10 1/5] drm/layerscape: Add Freescale DCU DRM driver

2015-07-20 Thread jianwei wang
Hi Alexander,

Thank you for your review.

On Mon, Jul 20, 2015 at 3:18 PM, Alexander Stein
 wrote:
> On Friday 17 July 2015 18:38:59, Jianwei Wang wrote:
>> [...]
>> +static const struct regmap_config fsl_dcu_regmap_config = {
>> + .reg_bits = 32,
>> + .reg_stride = 4,
>> + .val_bits = 32,
>> +};
>
> This defaults to REGCACHE_NONE which in the end sets regmap.cache_only = true.
>
>> [...]
>> +#ifdef CONFIG_PM_SLEEP
>> +static int fsl_dcu_drm_pm_suspend(struct device *dev)
>> +{
>> + struct fsl_dcu_drm_device *fsl_dev = dev_get_drvdata(dev);
>> +
>> + if (!fsl_dev)
>> + return 0;
>> +
>> + drm_kms_helper_poll_disable(fsl_dev->drm);
>> + regcache_cache_only(fsl_dev->regmap, true);
>
> This should raise a warning (see 
> http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/drivers/base/regmap/regcache.c#n472)
>  as map->cache_bypass is set because of REGCACHE_NONE.
> I think you set the cache_type to REGCACHE_FLAT, but neither _LZO or _RBTREE 
> (see https://lkml.org/lkml/2015/7/16/552 for that)
>

okay

BR.
Jianwei


> Best regards,
> Alexander
> --
> Dipl.-Inf. Alexander Stein
> SYS TEC electronic GmbH
> alexander.stein at systec-electronic.com
>
> Legal and Commercial Address:
> Am Windrad 2
> 08468 Heinsdorfergrund
> Germany
>
> Office: +49 (0) 3765 38600-11xx
> Fax:+49 (0) 0) 3765 38600-41xx
>
> Managing Directors:
> Director Technology/CEO: Dipl.-Phys. Siegmar Schmidt;
> Director Commercial Affairs/COO: Dipl. Ing. (FH) Armin von Collrepp
> Commercial Registry:
> Amtsgericht Chemnitz, HRB 28082; USt.-Id Nr. DE150534010
>


[PATCH v11 5/5] arm/dts/ls1021a: Add a TFT LCD panel dts node

2015-07-20 Thread Jianwei Wang
Add a TFT LCD panel. the TFT LCD panel is WQVGA "480x272",
and the bpp is 24.

Signed-off-by: Alison Wang 
Signed-off-by: Xiubo Li 
Signed-off-by: Jianwei Wang 
Reviewed-by: Alison Wang 
---
 arch/arm/boot/dts/ls1021a-twr.dts | 11 +++
 1 file changed, 11 insertions(+)

diff --git a/arch/arm/boot/dts/ls1021a-twr.dts 
b/arch/arm/boot/dts/ls1021a-twr.dts
index a2c591e..2443329 100644
--- a/arch/arm/boot/dts/ls1021a-twr.dts
+++ b/arch/arm/boot/dts/ls1021a-twr.dts
@@ -56,6 +56,17 @@
enet0_sgmii_phy = _phy2;
enet1_sgmii_phy = _phy0;
};
+
+   panel: panel {
+   compatible = "nec,nl4827hc19_05b";
+   };
+
+};
+
+ {
+   fsl,panel = <>;
+   status = "okay";
+
 };

  {
-- 
2.1.0.27.g96db324



[PATCH v11 4/5] arm/dts/ls1021a: Add DCU dts node

2015-07-20 Thread Jianwei Wang
Add DCU node, DCU is a display controller of Freescale
named 2D-ACE.

Signed-off-by: Alison Wang 
Signed-off-by: Xiubo Li 
Signed-off-by: Jianwei Wang 
Reviewed-by: Alison Wang 
---
 arch/arm/boot/dts/ls1021a.dtsi | 10 ++
 1 file changed, 10 insertions(+)

diff --git a/arch/arm/boot/dts/ls1021a.dtsi b/arch/arm/boot/dts/ls1021a.dtsi
index c70bb27..6d6e3e2 100644
--- a/arch/arm/boot/dts/ls1021a.dtsi
+++ b/arch/arm/boot/dts/ls1021a.dtsi
@@ -383,6 +383,16 @@
 <_clk 1>;
};

+   dcu: dcu at 2ce {
+   compatible = "fsl,ls1021a-dcu";
+   reg = <0x0 0x2ce 0x0 0x1>;
+   interrupts = ;
+   clocks = <_clk 0>;
+   clock-names = "dcu";
+   big-endian;
+   status = "disabled";
+   };
+
mdio0: mdio at 2d24000 {
compatible = "gianfar";
device_type = "mdio";
-- 
2.1.0.27.g96db324



[PATCH v11 3/5] drm/panel: simple: Add support for NEC NL4827HC19-05B 480x272 panel

2015-07-20 Thread Jianwei Wang
This adds support for the NEC NL4827HC19-05B 480x272 panel to the DRM
simple panel driver.

Signed-off-by: Alison Wang 
Signed-off-by: Xiubo Li 
Signed-off-by: Jianwei Wang 
Acked-by: Daniel Vetter 
---
 .../bindings/panel/nec,nl4827hc19_05b.txt  |  7 ++
 MAINTAINERS|  1 +
 drivers/gpu/drm/panel/panel-simple.c   | 26 ++
 3 files changed, 34 insertions(+)
 create mode 100644 
Documentation/devicetree/bindings/panel/nec,nl4827hc19_05b.txt

diff --git a/Documentation/devicetree/bindings/panel/nec,nl4827hc19_05b.txt 
b/Documentation/devicetree/bindings/panel/nec,nl4827hc19_05b.txt
new file mode 100644
index 000..20e9473
--- /dev/null
+++ b/Documentation/devicetree/bindings/panel/nec,nl4827hc19_05b.txt
@@ -0,0 +1,7 @@
+NEC LCD Technologies,Ltd. WQVGA TFT LCD panel
+
+Required properties:
+- compatible: should be "nec,nl4827hc19_05b"
+
+This binding is compatible with the simple-panel binding, which is specified
+in simple-panel.txt in this directory.
diff --git a/MAINTAINERS b/MAINTAINERS
index dc9d371..5a97a6a 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -3557,6 +3557,7 @@ L:dri-devel at lists.freedesktop.org
 S: Supported
 F: drivers/gpu/drm/fsl-dcu/
 F: Documentation/devicetree/bindings/video/fsl,dcu.txt
+F: Documentation/devicetree/bindings/panel/nec,nl4827hc19_05b.txt

 DRM DRIVERS FOR FREESCALE IMX
 M: Philipp Zabel 
diff --git a/drivers/gpu/drm/panel/panel-simple.c 
b/drivers/gpu/drm/panel/panel-simple.c
index f94201b..db61dd1 100644
--- a/drivers/gpu/drm/panel/panel-simple.c
+++ b/drivers/gpu/drm/panel/panel-simple.c
@@ -943,6 +943,29 @@ static const struct panel_desc lg_lp129qe = {
},
 };

+static const struct drm_display_mode nec_nl4827hc19_05b_mode = {
+   .clock = 10870,
+   .hdisplay = 480,
+   .hsync_start = 480 + 2,
+   .hsync_end = 480 + 2 + 41,
+   .htotal = 480 + 2 + 41 + 2,
+   .vdisplay = 272,
+   .vsync_start = 272 + 2,
+   .vsync_end = 272 + 2 + 4,
+   .vtotal = 272 + 2 + 4 + 2,
+   .vrefresh = 74,
+};
+
+static const struct panel_desc nec_nl4827hc19_05b = {
+   .modes = _nl4827hc19_05b_mode,
+   .num_modes = 1,
+   .size = {
+   .width = 95,
+   .height = 54,
+   },
+   .bus_format = MEDIA_BUS_FMT_RGB888_1X24
+};
+
 static const struct drm_display_mode ortustech_com43h4m85ulc_mode  = {
.clock = 25000,
.hdisplay = 480,
@@ -1113,6 +1136,9 @@ static const struct of_device_id platform_of_match[] = {
.compatible = "lg,lp129qe",
.data = _lp129qe,
}, {
+   .compatible = "nec,nl4827hc19_05b",
+   .data = _nl4827hc19_05b,
+   }, {
.compatible = "ortustech,com43h4m85ulc",
.data = _com43h4m85ulc,
}, {
-- 
2.1.0.27.g96db324



[PATCH v11 2/5] devicetree: Add NEC to the vendor-prefix list

2015-07-20 Thread Jianwei Wang
NEC represent NEC LCD Technologies, Ltd.

Signed-off-by: Alison Wang 
Signed-off-by: Xiubo Li 
Signed-off-by: Jianwei Wang 
---
 Documentation/devicetree/bindings/vendor-prefixes.txt | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/vendor-prefixes.txt 
b/Documentation/devicetree/bindings/vendor-prefixes.txt
index d444757..42ca6bc 100644
--- a/Documentation/devicetree/bindings/vendor-prefixes.txt
+++ b/Documentation/devicetree/bindings/vendor-prefixes.txt
@@ -140,6 +140,7 @@ mundoreader Mundo Reader S.L.
 murata Murata Manufacturing Co., Ltd.
 mxicy  Macronix International Co., Ltd.
 national   National Semiconductor
+necNEC LCD Technologies, Ltd.
 neonodeNeonode Inc.
 netgearNETGEAR
 netlogic   Broadcom Corporation (formerly NetLogic Microsystems)
-- 
2.1.0.27.g96db324



[PATCH v11 1/5] drm/layerscape: Add Freescale DCU DRM driver

2015-07-20 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) Blending of each pixel using up to 4 source layers
dependent
on size of panel.
(3) Each graphic layer can be placed with one pixel resolution
in either axis.
(4) 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.
(5) Each graphic layer support alpha blending with 8-bit
resolution.

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

Signed-off-by: Alison Wang 
Signed-off-by: Xiubo Li 
Signed-off-by: Jianwei Wang 
Acked-by: Daniel Vetter 
Reviewed-by: Alison Wang 
---


Changed in V11
-set regmap_config.cache_type to REGCACHE_FLAT
Advanced by Alexander Stein

Changed in V10
-adjust commit log, remove meaningless statement
-cleanup code for it's format and style.
-remove platform related code out, including of tcon(vf610) and scfg(ls1021a)
-remove useless sentences: encoder->crtc = crtc; and connector->encoder = 
encoder; and so on
-add vendor prefix for panel pandle
-make a DCU_CTRLDESCLN(x, y)  to avoid high repetition
-introduce per-SoC capability structure to avoid check on the OF node's 
compatible string
-Implement some functions: crtc enable and disable, enable and disable VBLANK, 
plane atomic_disable and atomic_enable -atomic_check and so on
-move DCU config sentence to the right place
-move get resources functions to  ->probe()
-move fsl,dcu.txt to video/ folder
-add big-endian describe
All advaced by Thierry Reding

Changed in V9

-put node after calling of_drm_find_panel
-split clk_prepare_enable() to clk_prepare() and clk_enable(), just call 
clk_prepare once, and check return value
-check regmap_write/regmap_read return return value
-remove useless ".owner= THIS_MODULE,"
All advanced by Mark Yao

Changed in V8

- Remove useless code
 #define DRIVER_NAME "fsl-dcu-drm"
 MODULE_ALIAS("platform:fsl-dcu-drm");
Adviced by Paul Bolle

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


 .../devicetree/bindings/video/fsl,dcu.txt  |  22 ++
 MAINTAINERS|   8 +
 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_crtc.c | 208 +++
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_crtc.h |  19 +
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c  | 403 +
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.h  | 197 ++
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_fbdev.c|  23 ++
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_kms.c  |  43 +++
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_output.h   |  33 ++
 drivers/gpu/drm/fsl-dcu/fsl_dc

[PATCH v10 5/5] arm/dts/ls1021a: Add a TFT LCD panel dts node

2015-07-17 Thread Jianwei Wang
From: Jianwei Wang <jianwei.wang@gmail.com>

Add a  TFT LCD panel. the TFT LCD panel is WQVGA "480x272",
and the bpp is 24.

Signed-off-by: Alison Wang 
Signed-off-by: Xiubo Li 
Signed-off-by: Jianwei Wang 
Reviewed-by: Alison Wang 
---
 arch/arm/boot/dts/ls1021a-twr.dts | 11 +++
 1 file changed, 11 insertions(+)

diff --git a/arch/arm/boot/dts/ls1021a-twr.dts 
b/arch/arm/boot/dts/ls1021a-twr.dts
index a2c591e..2443329 100644
--- a/arch/arm/boot/dts/ls1021a-twr.dts
+++ b/arch/arm/boot/dts/ls1021a-twr.dts
@@ -56,6 +56,17 @@
enet0_sgmii_phy = _phy2;
enet1_sgmii_phy = _phy0;
};
+
+   panel: panel {
+   compatible = "nec,nl4827hc19_05b";
+   };
+
+};
+
+ {
+   fsl,panel = <>;
+   status = "okay";
+
 };

  {
-- 
2.1.0.27.g96db324



[PATCH v10 4/5] arm/dts/ls1021a: Add DCU dts node

2015-07-17 Thread Jianwei Wang
From: Jianwei Wang <jianwei.wang@gmail.com>

Add DCU node, DCU is a display controller of Freescale
named 2D-ACE.

Signed-off-by: Alison Wang 
Signed-off-by: Xiubo Li 
Signed-off-by: Jianwei Wang 
Reviewed-by: Alison Wang 
---
 arch/arm/boot/dts/ls1021a.dtsi | 10 ++
 1 file changed, 10 insertions(+)

diff --git a/arch/arm/boot/dts/ls1021a.dtsi b/arch/arm/boot/dts/ls1021a.dtsi
index c70bb27..6d6e3e2 100644
--- a/arch/arm/boot/dts/ls1021a.dtsi
+++ b/arch/arm/boot/dts/ls1021a.dtsi
@@ -383,6 +383,16 @@
 <_clk 1>;
};

+   dcu: dcu at 2ce {
+   compatible = "fsl,ls1021a-dcu";
+   reg = <0x0 0x2ce 0x0 0x1>;
+   interrupts = ;
+   clocks = <_clk 0>;
+   clock-names = "dcu";
+   big-endian;
+   status = "disabled";
+   };
+
mdio0: mdio at 2d24000 {
compatible = "gianfar";
device_type = "mdio";
-- 
2.1.0.27.g96db324



[PATCH v10 3/5] drm/panel: simple: Add support for NEC NL4827HC19-05B 480x272 panel

2015-07-17 Thread Jianwei Wang
From: Jianwei Wang <jianwei.wang@gmail.com>

This adds support for the NEC NL4827HC19-05B 480x272 panel to the DRM
simple panel driver.

Signed-off-by: Alison Wang 
Signed-off-by: Xiubo Li 
Signed-off-by: Jianwei Wang 
Acked-by: Daniel Vetter 
---
 .../bindings/panel/nec,nl4827hc19_05b.txt  |  7 ++
 MAINTAINERS|  1 +
 drivers/gpu/drm/panel/panel-simple.c   | 26 ++
 3 files changed, 34 insertions(+)
 create mode 100644 
Documentation/devicetree/bindings/panel/nec,nl4827hc19_05b.txt

diff --git a/Documentation/devicetree/bindings/panel/nec,nl4827hc19_05b.txt 
b/Documentation/devicetree/bindings/panel/nec,nl4827hc19_05b.txt
new file mode 100644
index 000..20e9473
--- /dev/null
+++ b/Documentation/devicetree/bindings/panel/nec,nl4827hc19_05b.txt
@@ -0,0 +1,7 @@
+NEC LCD Technologies,Ltd. WQVGA TFT LCD panel
+
+Required properties:
+- compatible: should be "nec,nl4827hc19_05b"
+
+This binding is compatible with the simple-panel binding, which is specified
+in simple-panel.txt in this directory.
diff --git a/MAINTAINERS b/MAINTAINERS
index d4dfe14..387a84a 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -3404,6 +3404,7 @@ L:dri-devel at lists.freedesktop.org
 S: Supported
 F: drivers/gpu/drm/fsl-dcu/
 F: Documentation/devicetree/bindings/video/fsl,dcu.txt
+F: Documentation/devicetree/bindings/panel/nec,nl4827hc19_05b.txt

 DRM DRIVERS FOR FREESCALE IMX
 M: Philipp Zabel 
diff --git a/drivers/gpu/drm/panel/panel-simple.c 
b/drivers/gpu/drm/panel/panel-simple.c
index f94201b..db61dd1 100644
--- a/drivers/gpu/drm/panel/panel-simple.c
+++ b/drivers/gpu/drm/panel/panel-simple.c
@@ -943,6 +943,29 @@ static const struct panel_desc lg_lp129qe = {
},
 };

+static const struct drm_display_mode nec_nl4827hc19_05b_mode = {
+   .clock = 10870,
+   .hdisplay = 480,
+   .hsync_start = 480 + 2,
+   .hsync_end = 480 + 2 + 41,
+   .htotal = 480 + 2 + 41 + 2,
+   .vdisplay = 272,
+   .vsync_start = 272 + 2,
+   .vsync_end = 272 + 2 + 4,
+   .vtotal = 272 + 2 + 4 + 2,
+   .vrefresh = 74,
+};
+
+static const struct panel_desc nec_nl4827hc19_05b = {
+   .modes = _nl4827hc19_05b_mode,
+   .num_modes = 1,
+   .size = {
+   .width = 95,
+   .height = 54,
+   },
+   .bus_format = MEDIA_BUS_FMT_RGB888_1X24
+};
+
 static const struct drm_display_mode ortustech_com43h4m85ulc_mode  = {
.clock = 25000,
.hdisplay = 480,
@@ -1113,6 +1136,9 @@ static const struct of_device_id platform_of_match[] = {
.compatible = "lg,lp129qe",
.data = _lp129qe,
}, {
+   .compatible = "nec,nl4827hc19_05b",
+   .data = _nl4827hc19_05b,
+   }, {
.compatible = "ortustech,com43h4m85ulc",
.data = _com43h4m85ulc,
}, {
-- 
2.1.0.27.g96db324



[PATCH v10 2/5] devicetree: Add NEC to the vendor-prefix list

2015-07-17 Thread Jianwei Wang
From: Jianwei Wang <jianwei.wang@gmail.com>

NEC represent NEC LCD Technologies, Ltd.

Signed-off-by: Alison Wang 
Signed-off-by: Xiubo Li 
Signed-off-by: Jianwei Wang 
---
 Documentation/devicetree/bindings/vendor-prefixes.txt | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/vendor-prefixes.txt 
b/Documentation/devicetree/bindings/vendor-prefixes.txt
index 8033919..9f22b3e 100644
--- a/Documentation/devicetree/bindings/vendor-prefixes.txt
+++ b/Documentation/devicetree/bindings/vendor-prefixes.txt
@@ -131,6 +131,7 @@ mundoreader Mundo Reader S.L.
 murata Murata Manufacturing Co., Ltd.
 mxicy  Macronix International Co., Ltd.
 national   National Semiconductor
+necNEC LCD Technologies, Ltd.
 neonodeNeonode Inc.
 netgearNETGEAR
 netlogic   Broadcom Corporation (formerly NetLogic Microsystems)
-- 
2.1.0.27.g96db324



[PATCH v10 1/5] drm/layerscape: Add Freescale DCU DRM driver

2015-07-17 Thread Jianwei Wang
From: Jianwei Wang <jianwei.wang@gmail.com>

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) Blending of each pixel using up to 4 source layers
dependent
on size of panel.
(3) Each graphic layer can be placed with one pixel resolution
in either axis.
(4) 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.
(5) Each graphic layer support alpha blending with 8-bit
resolution.

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

Signed-off-by: Alison Wang 
Signed-off-by: Xiubo Li 
Signed-off-by: Jianwei Wang 
Acked-by: Daniel Vetter 
Reviewed-by: Alison Wang 
---


Changed in V10
-adjust commit log, remove meaningless statement
-cleanup code for it's format and style.
-remove platform related code out, including of tcon(vf610) and scfg(ls1021a)
-remove useless sentences: encoder->crtc = crtc; and connector->encoder = 
encoder; and so on
-add vendor prefix for panel pandle
-make a DCU_CTRLDESCLN(x, y)  to avoid high repetition
-introduce per-SoC capability structure to avoid check on the OF node's 
compatible string
-Implement some functions: crtc enable and disable, enable and disable VBLANK, 
plane
 atomic_disable and atomic_enable -atomic_check and so on
-move DCU config sentence to the right place
-move get resources functions to  ->probe()
-move fsl,dcu.txt to video/ folder
-add big-endian describe
All advaced by Thierry Reding

Changed in V9

-put node after calling of_drm_find_panel
-split clk_prepare_enable() to clk_prepare() and clk_enable(),
 just call clk_prepare once, and check return value
-check regmap_write/regmap_read return return value
-remove useless ".owner= THIS_MODULE,"
All advanced by Mark Yao

Changed in V8

- Remove useless code
 #define DRIVER_NAME "fsl-dcu-drm"
 MODULE_ALIAS("platform:fsl-dcu-drm");
Adviced by Paul Bolle

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


 .../devicetree/bindings/video/fsl,dcu.txt  |  22 ++
 MAINTAINERS|   8 +
 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_crtc.c | 208 +++
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_crtc.h |  19 +
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c  | 402 +
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.h  | 197 ++
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_fbdev.c|  23 ++
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_kms.c  |  43 +++
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_output.h   |  33 ++
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_plane.c| 261 +++

[PATCH v9 4/4] arm/dts/ls1021a: Add a TFT LCD panel dts node

2015-07-13 Thread Jianwei Wang
Add a TFT LCD panel. the TFT LCD panel is WQVGA "480x272",
and the bpp is 24.

Signed-off-by: Alison Wang 
Signed-off-by: Xiubo Li 
Signed-off-by: Jianwei Wang 
Reviewed-by: Alison Wang 
---
 arch/arm/boot/dts/ls1021a-twr.dts | 11 +++
 1 file changed, 11 insertions(+)

diff --git a/arch/arm/boot/dts/ls1021a-twr.dts 
b/arch/arm/boot/dts/ls1021a-twr.dts
index a2c591e..f6ad7ba 100644
--- a/arch/arm/boot/dts/ls1021a-twr.dts
+++ b/arch/arm/boot/dts/ls1021a-twr.dts
@@ -56,6 +56,17 @@
enet0_sgmii_phy = _phy2;
enet1_sgmii_phy = _phy0;
};
+
+   panel: panel {
+   compatible = "nec,nl4827hc19_05b";
+   };
+
+};
+
+ {
+   panel = <>;
+   status = "okay";
+
 };

  {
-- 
2.1.0.27.g96db324



[PATCH v9 3/4] arm/dts/ls1021a: Add DCU dts node

2015-07-13 Thread Jianwei Wang
Add DCU node, DCU is a display controller of Freescale
named 2D-ACE.

Signed-off-by: Alison Wang 
Signed-off-by: Xiubo Li 
Signed-off-by: Jianwei Wang 
Reviewed-by: Alison Wang 
---
 .../devicetree/bindings/drm/fsl-dcu/fsl,dcu.txt  | 20 
 MAINTAINERS  |  1 +
 arch/arm/boot/dts/ls1021a.dtsi   | 10 ++
 3 files changed, 31 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/drm/fsl-dcu/fsl,dcu.txt

diff --git a/Documentation/devicetree/bindings/drm/fsl-dcu/fsl,dcu.txt 
b/Documentation/devicetree/bindings/drm/fsl-dcu/fsl,dcu.txt
new file mode 100644
index 000..eb61ea5
--- /dev/null
+++ b/Documentation/devicetree/bindings/drm/fsl-dcu/fsl,dcu.txt
@@ -0,0 +1,20 @@
+Device Tree bindings for Freescale DCU DRM Driver
+
+Required properties:
+- compatible:   Should be one of
+   * "fsl,ls1021a-dcu".
+   * "fsl,vf610-dcu".
+- reg:  Address and length of the register set for dcu.
+- clocks:   From common clock binding: handle to dcu clock.
+- clock-names:  From common clock binding: Shall be "dcu".
+- panel:   The phandle to panel node.
+
+Examples:
+dcu: dcu at 2ce {
+   compatible = "fsl,ls1021a-dcu";
+   reg = <0x0 0x2ce 0x0 0x1>;
+   clocks = <_clk 0>;
+   clock-names = "dcu";
+   big-endian;
+   panel = <>;
+};
diff --git a/MAINTAINERS b/MAINTAINERS
index e191ded..fffb8c9 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -3410,6 +3410,7 @@ M:Alison Wang 
 L: dri-devel at lists.freedesktop.org
 S: Supported
 F: drivers/gpu/drm/fsl-dcu/
+F:  Documentation/devicetree/bindings/drm/fsl-dcu/
 F:  Documentation/devicetree/bindings/panel/nec,nl4827hc19_05b.txt

 DRM DRIVERS FOR NVIDIA TEGRA
diff --git a/arch/arm/boot/dts/ls1021a.dtsi b/arch/arm/boot/dts/ls1021a.dtsi
index c70bb27..6d6e3e2 100644
--- a/arch/arm/boot/dts/ls1021a.dtsi
+++ b/arch/arm/boot/dts/ls1021a.dtsi
@@ -383,6 +383,16 @@
 <_clk 1>;
};

+   dcu: dcu at 2ce {
+   compatible = "fsl,ls1021a-dcu";
+   reg = <0x0 0x2ce 0x0 0x1>;
+   interrupts = ;
+   clocks = <_clk 0>;
+   clock-names = "dcu";
+   big-endian;
+   status = "disabled";
+   };
+
mdio0: mdio at 2d24000 {
compatible = "gianfar";
device_type = "mdio";
-- 
2.1.0.27.g96db324



[PATCH v9 2/4] drm/panel: simple: Add support for NEC NL4827HC19-05B 480x272 panel

2015-07-13 Thread Jianwei Wang
This adds support for the NEC NL4827HC19-05B 480x272 panel to the DRM
simple panel driver.

Signed-off-by: Alison Wang 
Signed-off-by: Xiubo Li 
Signed-off-by: Jianwei Wang 
Acked-by: Daniel Vetter 
---
 .../bindings/panel/nec,nl4827hc19_05b.txt  |  7 ++
 .../devicetree/bindings/vendor-prefixes.txt|  1 +
 MAINTAINERS|  1 -
 drivers/gpu/drm/panel/panel-simple.c   | 26 ++
 4 files changed, 34 insertions(+), 1 deletion(-)
 create mode 100644 
Documentation/devicetree/bindings/panel/nec,nl4827hc19_05b.txt

diff --git a/Documentation/devicetree/bindings/panel/nec,nl4827hc19_05b.txt 
b/Documentation/devicetree/bindings/panel/nec,nl4827hc19_05b.txt
new file mode 100644
index 000..20e9473
--- /dev/null
+++ b/Documentation/devicetree/bindings/panel/nec,nl4827hc19_05b.txt
@@ -0,0 +1,7 @@
+NEC LCD Technologies,Ltd. WQVGA TFT LCD panel
+
+Required properties:
+- compatible: should be "nec,nl4827hc19_05b"
+
+This binding is compatible with the simple-panel binding, which is specified
+in simple-panel.txt in this directory.
diff --git a/Documentation/devicetree/bindings/vendor-prefixes.txt 
b/Documentation/devicetree/bindings/vendor-prefixes.txt
index 8033919..9f22b3e 100644
--- a/Documentation/devicetree/bindings/vendor-prefixes.txt
+++ b/Documentation/devicetree/bindings/vendor-prefixes.txt
@@ -131,6 +131,7 @@ mundoreader Mundo Reader S.L.
 murata Murata Manufacturing Co., Ltd.
 mxicy  Macronix International Co., Ltd.
 national   National Semiconductor
+necNEC LCD Technologies, Ltd.
 neonodeNeonode Inc.
 netgearNETGEAR
 netlogic   Broadcom Corporation (formerly NetLogic Microsystems)
diff --git a/MAINTAINERS b/MAINTAINERS
index fffb8c9..e191ded 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -3410,7 +3410,6 @@ M:Alison Wang 
 L: dri-devel at lists.freedesktop.org
 S: Supported
 F: drivers/gpu/drm/fsl-dcu/
-F:  Documentation/devicetree/bindings/drm/fsl-dcu/
 F:  Documentation/devicetree/bindings/panel/nec,nl4827hc19_05b.txt

 DRM DRIVERS FOR NVIDIA TEGRA
diff --git a/drivers/gpu/drm/panel/panel-simple.c 
b/drivers/gpu/drm/panel/panel-simple.c
index f94201b..eb12fe4 100644
--- a/drivers/gpu/drm/panel/panel-simple.c
+++ b/drivers/gpu/drm/panel/panel-simple.c
@@ -1036,6 +1036,29 @@ static const struct panel_desc shelly_sca07010_bfn_lnn = 
{
.bus_format = MEDIA_BUS_FMT_RGB666_1X18,
 };

+static const struct drm_display_mode nec_nl4827hc19_05b_mode = {
+   .clock = 10870,
+   .hdisplay = 480,
+   .hsync_start = 480 + 2,
+   .hsync_end = 480 + 2 + 41,
+   .htotal = 480 + 2 + 41 + 2,
+   .vdisplay = 272,
+   .vsync_start = 272 + 2,
+   .vsync_end = 272 + 2 + 4,
+   .vtotal = 272 + 2 + 4 + 2,
+   .vrefresh = 74,
+};
+
+static const struct panel_desc nec_nl4827hc19_05b = {
+   .modes = _nl4827hc19_05b_mode,
+   .num_modes = 1,
+   .size = {
+   .width = 95,
+   .height = 54,
+   },
+   .bus_format = MEDIA_BUS_FMT_RGB888_1X24
+};
+
 static const struct of_device_id platform_of_match[] = {
{
.compatible = "ampire,am800480r3tmqwa1h",
@@ -1125,6 +1148,9 @@ static const struct of_device_id platform_of_match[] = {
.compatible = "shelly,sca07010-bfn-lnn",
.data = _sca07010_bfn_lnn,
}, {
+   .compatible = "nec,nl4827hc19_05b",
+   .data = _nl4827hc19_05b,
+   }, {
/* sentinel */
}
 };
-- 
2.1.0.27.g96db324



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

2015-07-13 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, one crtc, one connector and one encoder for TFT
LCD panel.

Signed-off-by: Alison Wang 
Signed-off-by: Xiubo Li 
Signed-off-by: Jianwei Wang 
Acked-by: Daniel Vetter 
Reviewed-by: Alison Wang 
---


Changed in V9

-put node after calling of_drm_find_panel
-split clk_prepare_enable() to clk_prepare() and clk_enable(),
 just call clk_prepare once, and check return value
-check regmap_write/regmap_read return return value
-remove useless ".owner= THIS_MODULE,"
All advanced by Mark Yao

Changed in V8

- Remove useless code
#define DRIVER_NAME "fsl-dcu-drm"
MODULE_ALIAS("platform:fsl-dcu-drm");
Adviced by Paul Bolle

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 |   9 +
 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 | 187 ++
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_connector.h |  31 ++
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_crtc.c  | 212 +++
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_crtc.h  |  22 ++
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c   | 453 
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.h   | 222 
 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 | 227 
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_plane.h |  23 ++
 16 files changed, 1499 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

[PATCH v8 4/4] arm/dts/ls1021a: Add a TFT LCD panel dts node

2015-07-13 Thread Jianwei Wang
Add a  TFT LCD panel. the TFT LCD panel is WQVGA "480x272",
and the bpp is 24.

Signed-off-by: Alison Wang 
Signed-off-by: Xiubo Li 
Signed-off-by: Jianwei Wang 
Reviewed-by: Alison Wang 
---
 arch/arm/boot/dts/ls1021a-twr.dts | 11 +++
 1 file changed, 11 insertions(+)

diff --git a/arch/arm/boot/dts/ls1021a-twr.dts 
b/arch/arm/boot/dts/ls1021a-twr.dts
index a2c591e..f6ad7ba 100644
--- a/arch/arm/boot/dts/ls1021a-twr.dts
+++ b/arch/arm/boot/dts/ls1021a-twr.dts
@@ -56,6 +56,17 @@
enet0_sgmii_phy = _phy2;
enet1_sgmii_phy = _phy0;
};
+
+   panel: panel {
+   compatible = "nec,nl4827hc19_05b";
+   };
+
+};
+
+ {
+   panel = <>;
+   status = "okay";
+
 };

  {
-- 
2.1.0.27.g96db324



[PATCH v8 3/4] arm/dts/ls1021a: Add DCU dts node

2015-07-13 Thread Jianwei Wang
Add DCU node, DCU is a display controller of Freescale
named 2D-ACE.

Signed-off-by: Alison Wang 
Signed-off-by: Xiubo Li 
Signed-off-by: Jianwei Wang 
Reviewed-by: Alison Wang 
---
 .../devicetree/bindings/drm/fsl-dcu/fsl,dcu.txt  | 20 
 MAINTAINERS  |  1 +
 arch/arm/boot/dts/ls1021a.dtsi   | 10 ++
 3 files changed, 31 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/drm/fsl-dcu/fsl,dcu.txt

diff --git a/Documentation/devicetree/bindings/drm/fsl-dcu/fsl,dcu.txt 
b/Documentation/devicetree/bindings/drm/fsl-dcu/fsl,dcu.txt
new file mode 100644
index 000..eb61ea5
--- /dev/null
+++ b/Documentation/devicetree/bindings/drm/fsl-dcu/fsl,dcu.txt
@@ -0,0 +1,20 @@
+Device Tree bindings for Freescale DCU DRM Driver
+
+Required properties:
+- compatible:   Should be one of
+   * "fsl,ls1021a-dcu".
+   * "fsl,vf610-dcu".
+- reg:  Address and length of the register set for dcu.
+- clocks:   From common clock binding: handle to dcu clock.
+- clock-names:  From common clock binding: Shall be "dcu".
+- panel:   The phandle to panel node.
+
+Examples:
+dcu: dcu at 2ce {
+   compatible = "fsl,ls1021a-dcu";
+   reg = <0x0 0x2ce 0x0 0x1>;
+   clocks = <_clk 0>;
+   clock-names = "dcu";
+   big-endian;
+   panel = <>;
+};
diff --git a/MAINTAINERS b/MAINTAINERS
index e191ded..fffb8c9 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -3410,6 +3410,7 @@ M:Alison Wang 
 L: dri-devel at lists.freedesktop.org
 S: Supported
 F: drivers/gpu/drm/fsl-dcu/
+F:  Documentation/devicetree/bindings/drm/fsl-dcu/
 F:  Documentation/devicetree/bindings/panel/nec,nl4827hc19_05b.txt

 DRM DRIVERS FOR NVIDIA TEGRA
diff --git a/arch/arm/boot/dts/ls1021a.dtsi b/arch/arm/boot/dts/ls1021a.dtsi
index c70bb27..6d6e3e2 100644
--- a/arch/arm/boot/dts/ls1021a.dtsi
+++ b/arch/arm/boot/dts/ls1021a.dtsi
@@ -383,6 +383,16 @@
 <_clk 1>;
};

+   dcu: dcu at 2ce {
+   compatible = "fsl,ls1021a-dcu";
+   reg = <0x0 0x2ce 0x0 0x1>;
+   interrupts = ;
+   clocks = <_clk 0>;
+   clock-names = "dcu";
+   big-endian;
+   status = "disabled";
+   };
+
mdio0: mdio at 2d24000 {
compatible = "gianfar";
device_type = "mdio";
-- 
2.1.0.27.g96db324



[PATCH v8 2/4] drm/panel: simple: Add support for NEC NL4827HC19-05B 480x272 panel

2015-07-13 Thread Jianwei Wang
This adds support for the NEC NL4827HC19-05B 480x272 panel to the DRM
simple panel driver.

Signed-off-by: Jianwei Wang 
Acked-by: Daniel Vetter 
---
 .../bindings/panel/nec,nl4827hc19_05b.txt  |  7 ++
 .../devicetree/bindings/vendor-prefixes.txt|  1 +
 MAINTAINERS|  1 +
 drivers/gpu/drm/panel/panel-simple.c   | 26 ++
 4 files changed, 35 insertions(+)
 create mode 100644 
Documentation/devicetree/bindings/panel/nec,nl4827hc19_05b.txt

diff --git a/Documentation/devicetree/bindings/panel/nec,nl4827hc19_05b.txt 
b/Documentation/devicetree/bindings/panel/nec,nl4827hc19_05b.txt
new file mode 100644
index 000..20e9473
--- /dev/null
+++ b/Documentation/devicetree/bindings/panel/nec,nl4827hc19_05b.txt
@@ -0,0 +1,7 @@
+NEC LCD Technologies,Ltd. WQVGA TFT LCD panel
+
+Required properties:
+- compatible: should be "nec,nl4827hc19_05b"
+
+This binding is compatible with the simple-panel binding, which is specified
+in simple-panel.txt in this directory.
diff --git a/Documentation/devicetree/bindings/vendor-prefixes.txt 
b/Documentation/devicetree/bindings/vendor-prefixes.txt
index 8033919..9f22b3e 100644
--- a/Documentation/devicetree/bindings/vendor-prefixes.txt
+++ b/Documentation/devicetree/bindings/vendor-prefixes.txt
@@ -131,6 +131,7 @@ mundoreader Mundo Reader S.L.
 murata Murata Manufacturing Co., Ltd.
 mxicy  Macronix International Co., Ltd.
 national   National Semiconductor
+necNEC LCD Technologies, Ltd.
 neonodeNeonode Inc.
 netgearNETGEAR
 netlogic   Broadcom Corporation (formerly NetLogic Microsystems)
diff --git a/MAINTAINERS b/MAINTAINERS
index b25b948..e191ded 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -3410,6 +3410,7 @@ M:Alison Wang 
 L: dri-devel at lists.freedesktop.org
 S: Supported
 F: drivers/gpu/drm/fsl-dcu/
+F:  Documentation/devicetree/bindings/panel/nec,nl4827hc19_05b.txt

 DRM DRIVERS FOR NVIDIA TEGRA
 M: Thierry Reding 
diff --git a/drivers/gpu/drm/panel/panel-simple.c 
b/drivers/gpu/drm/panel/panel-simple.c
index f94201b..eb12fe4 100644
--- a/drivers/gpu/drm/panel/panel-simple.c
+++ b/drivers/gpu/drm/panel/panel-simple.c
@@ -1036,6 +1036,29 @@ static const struct panel_desc shelly_sca07010_bfn_lnn = 
{
.bus_format = MEDIA_BUS_FMT_RGB666_1X18,
 };

+static const struct drm_display_mode nec_nl4827hc19_05b_mode = {
+   .clock = 10870,
+   .hdisplay = 480,
+   .hsync_start = 480 + 2,
+   .hsync_end = 480 + 2 + 41,
+   .htotal = 480 + 2 + 41 + 2,
+   .vdisplay = 272,
+   .vsync_start = 272 + 2,
+   .vsync_end = 272 + 2 + 4,
+   .vtotal = 272 + 2 + 4 + 2,
+   .vrefresh = 74,
+};
+
+static const struct panel_desc nec_nl4827hc19_05b = {
+   .modes = _nl4827hc19_05b_mode,
+   .num_modes = 1,
+   .size = {
+   .width = 95,
+   .height = 54,
+   },
+   .bus_format = MEDIA_BUS_FMT_RGB888_1X24
+};
+
 static const struct of_device_id platform_of_match[] = {
{
.compatible = "ampire,am800480r3tmqwa1h",
@@ -1125,6 +1148,9 @@ static const struct of_device_id platform_of_match[] = {
.compatible = "shelly,sca07010-bfn-lnn",
.data = _sca07010_bfn_lnn,
}, {
+   .compatible = "nec,nl4827hc19_05b",
+   .data = _nl4827hc19_05b,
+   }, {
/* sentinel */
}
 };
-- 
2.1.0.27.g96db324



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

2015-07-13 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, one crtc, one connector and one encoder for TFT LCD panel.

Signed-off-by: Alison Wang 
Signed-off-by: Xiubo Li 
Signed-off-by: Jianwei Wang 
Acked-by: Daniel Vetter 
Reviewed-by: Alison Wang 
---


hanged in V8
- Remove useless code
  #define DRIVER_NAME "fsl-dcu-drm"
  MODULE_ALIAS("platform:fsl-dcu-drm");
Adviced by Paul Bolle

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
Adviced by Stefan Agner
- 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   | 400 
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.h   | 222 +
 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, 1355 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
@@ -3

[PATCH v7 4/4] arm/dts/ls1021a: Add a TFT LCD panel dts node

2015-07-10 Thread Jianwei Wang
Add a TFT LCD panel. the TFT LCD panel is WQVGA "480x272",
and the bpp is 24.

Signed-off-by: Alison Wang 
Signed-off-by: Xiubo Li 
Signed-off-by: Jianwei Wang 
---
 arch/arm/boot/dts/ls1021a-twr.dts | 11 +++
 1 file changed, 11 insertions(+)

diff --git a/arch/arm/boot/dts/ls1021a-twr.dts 
b/arch/arm/boot/dts/ls1021a-twr.dts
index a2c591e..f6ad7ba 100644
--- a/arch/arm/boot/dts/ls1021a-twr.dts
+++ b/arch/arm/boot/dts/ls1021a-twr.dts
@@ -56,6 +56,17 @@
enet0_sgmii_phy = _phy2;
enet1_sgmii_phy = _phy0;
};
+
+   panel: panel {
+   compatible = "nec,nl4827hc19_05b";
+   };
+
+};
+
+ {
+   panel = <>;
+   status = "okay";
+
 };

  {
-- 
2.1.0.27.g96db324



[PATCH v7 3/4] arm/dts/ls1021a: Add DCU dts node

2015-07-10 Thread Jianwei Wang
Add DCU node, DCU is a display controller of Freescale
named 2D-ACE.

Signed-off-by: Alison Wang 
Signed-off-by: Xiubo Li 
Signed-off-by: Jianwei Wang 
---
 .../devicetree/bindings/drm/fsl-dcu/fsl,dcu.txt| 49 ++
 MAINTAINERS|  1 +
 arch/arm/boot/dts/ls1021a.dtsi | 10 +
 3 files changed, 60 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/drm/fsl-dcu/fsl,dcu.txt

diff --git a/Documentation/devicetree/bindings/drm/fsl-dcu/fsl,dcu.txt 
b/Documentation/devicetree/bindings/drm/fsl-dcu/fsl,dcu.txt
new file mode 100644
index 000..d65631d
--- /dev/null
+++ b/Documentation/devicetree/bindings/drm/fsl-dcu/fsl,dcu.txt
@@ -0,0 +1,49 @@
+Device Tree bindings for Freescale DCU DRM Driver
+
+Required properties:
+- compatible:   Should be one of
+   * "fsl,ls1021a-dcu".
+   * "fsl,vf610-dcu".
+- reg:  Address and length of the register set for dcu.
+- clocks:   From common clock binding: handle to dcu clock.
+- clock-names:  From common clock binding: Shall be "dcu".
+- display:  The phandle to display node.
+
+Required properties:
+- bits-per-pixel:   <16> for RGB565,
+   <24> for RGB888,
+   <32> for RGB.
+
+Required timing node for dispplay sub-node:
+- display-timings:  Refer to binding doc display-timing.txt for details.
+
+Examples:
+dcu: dcu at 2ce {
+   compatible = "fsl,ls1021a-dcu";
+   reg = <0x0 0x2ce 0x0 0x1>;
+   clocks = <_clk 0>;
+   clock-names = "dcu";
+   big-endian;
+   display = <>;
+
+   display: display at 0 {
+   bits-per-pixel = <24>;
+
+   display-timings {
+   native-mode = <>;
+   timing0: nl4827hc19 {
+   clock-frequency = <1087>;
+   hactive = <480>;
+   vactive = <272>;
+   hback-porch = <2>;
+   hfront-porch = <2>;
+   vback-porch = <1>;
+   vfront-porch = <1>;
+   hsync-len = <41>;
+   vsync-len = <2>;
+   hsync-active = <1>;
+   vsync-active = <1>;
+   };
+   };
+   };
+};
diff --git a/MAINTAINERS b/MAINTAINERS
index e191ded..fffb8c9 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -3410,6 +3410,7 @@ M:Alison Wang 
 L: dri-devel at lists.freedesktop.org
 S: Supported
 F: drivers/gpu/drm/fsl-dcu/
+F:  Documentation/devicetree/bindings/drm/fsl-dcu/
 F:  Documentation/devicetree/bindings/panel/nec,nl4827hc19_05b.txt

 DRM DRIVERS FOR NVIDIA TEGRA
diff --git a/arch/arm/boot/dts/ls1021a.dtsi b/arch/arm/boot/dts/ls1021a.dtsi
index c70bb27..6d6e3e2 100644
--- a/arch/arm/boot/dts/ls1021a.dtsi
+++ b/arch/arm/boot/dts/ls1021a.dtsi
@@ -383,6 +383,16 @@
 <_clk 1>;
};

+   dcu: dcu at 2ce {
+   compatible = "fsl,ls1021a-dcu";
+   reg = <0x0 0x2ce 0x0 0x1>;
+   interrupts = ;
+   clocks = <_clk 0>;
+   clock-names = "dcu";
+   big-endian;
+   status = "disabled";
+   };
+
mdio0: mdio at 2d24000 {
compatible = "gianfar";
device_type = "mdio";
-- 
2.1.0.27.g96db324



[PATCH v7 2/4] drm/panel: simple: Add support for NEC NL4827HC19-05B 480x272 panel

2015-07-10 Thread Jianwei Wang
This adds support for the  NEC NL4827HC19-05B 480x272 panel to the DRM
simple panel driver.

Signed-off-by: Jianwei Wang 
---
 .../bindings/panel/nec,nl4827hc19_05b.txt  |  7 ++
 .../devicetree/bindings/vendor-prefixes.txt|  1 +
 MAINTAINERS|  1 +
 drivers/gpu/drm/panel/panel-simple.c   | 26 ++
 4 files changed, 35 insertions(+)
 create mode 100644 
Documentation/devicetree/bindings/panel/nec,nl4827hc19_05b.txt

diff --git a/Documentation/devicetree/bindings/panel/nec,nl4827hc19_05b.txt 
b/Documentation/devicetree/bindings/panel/nec,nl4827hc19_05b.txt
new file mode 100644
index 000..20e9473
--- /dev/null
+++ b/Documentation/devicetree/bindings/panel/nec,nl4827hc19_05b.txt
@@ -0,0 +1,7 @@
+NEC LCD Technologies,Ltd. WQVGA TFT LCD panel
+
+Required properties:
+- compatible: should be "nec,nl4827hc19_05b"
+
+This binding is compatible with the simple-panel binding, which is specified
+in simple-panel.txt in this directory.
diff --git a/Documentation/devicetree/bindings/vendor-prefixes.txt 
b/Documentation/devicetree/bindings/vendor-prefixes.txt
index 8033919..9f22b3e 100644
--- a/Documentation/devicetree/bindings/vendor-prefixes.txt
+++ b/Documentation/devicetree/bindings/vendor-prefixes.txt
@@ -131,6 +131,7 @@ mundoreader Mundo Reader S.L.
 murata Murata Manufacturing Co., Ltd.
 mxicy  Macronix International Co., Ltd.
 national   National Semiconductor
+necNEC LCD Technologies, Ltd.
 neonodeNeonode Inc.
 netgearNETGEAR
 netlogic   Broadcom Corporation (formerly NetLogic Microsystems)
diff --git a/MAINTAINERS b/MAINTAINERS
index b25b948..e191ded 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -3410,6 +3410,7 @@ M:Alison Wang 
 L: dri-devel at lists.freedesktop.org
 S: Supported
 F: drivers/gpu/drm/fsl-dcu/
+F:  Documentation/devicetree/bindings/panel/nec,nl4827hc19_05b.txt

 DRM DRIVERS FOR NVIDIA TEGRA
 M: Thierry Reding 
diff --git a/drivers/gpu/drm/panel/panel-simple.c 
b/drivers/gpu/drm/panel/panel-simple.c
index f94201b..eee95f4 100644
--- a/drivers/gpu/drm/panel/panel-simple.c
+++ b/drivers/gpu/drm/panel/panel-simple.c
@@ -1036,6 +1036,29 @@ static const struct panel_desc shelly_sca07010_bfn_lnn = 
{
.bus_format = MEDIA_BUS_FMT_RGB666_1X18,
 };

+static const struct drm_display_mode nec_nl4827hc19_05b_mode = {
+   .clock = 10870,
+   .hdisplay = 480,
+   .hsync_start = 480 + 2,
+   .hsync_end = 480 + 2 + 41,
+   .htotal = 480 + 2 + 41 + 2,
+   .vdisplay = 272,
+   .vsync_start = 272 + 2,
+   .vsync_end = 272 + 2 + 4,
+   .vtotal = 272 + 2 + 4 + 2,
+   .vrefresh = 74,
+};
+
+static const struct panel_desc nec_nl4827hc19_05b = {
+   .modes = _nl4827hc19_05b_mode,
+   .num_modes = 1,
+   .size = {
+   .width = 480,
+   .height = 272,
+   },
+   .bus_format = MEDIA_BUS_FMT_RGB888_1X24
+};
+
 static const struct of_device_id platform_of_match[] = {
{
.compatible = "ampire,am800480r3tmqwa1h",
@@ -1125,6 +1148,9 @@ static const struct of_device_id platform_of_match[] = {
.compatible = "shelly,sca07010-bfn-lnn",
.data = _sca07010_bfn_lnn,
}, {
+   .compatible = "nec,nl4827hc19_05b",
+   .data = _nl4827hc19_05b,
+   }, {
/* sentinel */
}
 };
-- 
2.1.0.27.g96db324



[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 list

[PATCH v6 4/4] arm/dts/ls1021a: Add a TFT LCD panel dts node

2015-07-10 Thread Jianwei Wang
Add a TFT LCD panel node. the TFT LCD panel is
WQVGA "480x272", and the bpp is 24.

Signed-off-by: Alison Wang 
Signed-off-by: Xiubo Li 
Signed-off-by: Jianwei Wang 
---
 arch/arm/boot/dts/ls1021a-twr.dts | 11 +++
 1 file changed, 11 insertions(+)

diff --git a/arch/arm/boot/dts/ls1021a-twr.dts 
b/arch/arm/boot/dts/ls1021a-twr.dts
index a2c591e..f6ad7ba 100644
--- a/arch/arm/boot/dts/ls1021a-twr.dts
+++ b/arch/arm/boot/dts/ls1021a-twr.dts
@@ -56,6 +56,17 @@
enet0_sgmii_phy = _phy2;
enet1_sgmii_phy = _phy0;
};
+
+   panel: panel {
+   compatible = "nec,nl4827hc19_05b";
+   };
+
+};
+
+ {
+   panel = <>;
+   status = "okay";
+
 };

  {
-- 
2.1.0.27.g96db324



[PATCH v6 3/4] arm/dts/ls1021a: Add DCU dts node

2015-07-10 Thread Jianwei Wang
Add DCU node, DCU is a display controller of Freescale
named 2D-ACE.

Signed-off-by: Alison Wang 
Signed-off-by: Xiubo Li 
Signed-off-by: Jianwei Wang 
---
 .../devicetree/bindings/drm/fsl-dcu/fsl,dcu.txt| 49 ++
 MAINTAINERS|  1 +
 arch/arm/boot/dts/ls1021a.dtsi | 10 +
 3 files changed, 60 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/drm/fsl-dcu/fsl,dcu.txt

diff --git a/Documentation/devicetree/bindings/drm/fsl-dcu/fsl,dcu.txt 
b/Documentation/devicetree/bindings/drm/fsl-dcu/fsl,dcu.txt
new file mode 100644
index 000..d65631d
--- /dev/null
+++ b/Documentation/devicetree/bindings/drm/fsl-dcu/fsl,dcu.txt
@@ -0,0 +1,49 @@
+Device Tree bindings for Freescale DCU DRM Driver
+
+Required properties:
+- compatible:   Should be one of
+   * "fsl,ls1021a-dcu".
+   * "fsl,vf610-dcu".
+- reg:  Address and length of the register set for dcu.
+- clocks:   From common clock binding: handle to dcu clock.
+- clock-names:  From common clock binding: Shall be "dcu".
+- display:  The phandle to display node.
+
+Required properties:
+- bits-per-pixel:   <16> for RGB565,
+   <24> for RGB888,
+   <32> for RGB.
+
+Required timing node for dispplay sub-node:
+- display-timings:  Refer to binding doc display-timing.txt for details.
+
+Examples:
+dcu: dcu at 2ce {
+   compatible = "fsl,ls1021a-dcu";
+   reg = <0x0 0x2ce 0x0 0x1>;
+   clocks = <_clk 0>;
+   clock-names = "dcu";
+   big-endian;
+   display = <>;
+
+   display: display at 0 {
+   bits-per-pixel = <24>;
+
+   display-timings {
+   native-mode = <>;
+   timing0: nl4827hc19 {
+   clock-frequency = <1087>;
+   hactive = <480>;
+   vactive = <272>;
+   hback-porch = <2>;
+   hfront-porch = <2>;
+   vback-porch = <1>;
+   vfront-porch = <1>;
+   hsync-len = <41>;
+   vsync-len = <2>;
+   hsync-active = <1>;
+   vsync-active = <1>;
+   };
+   };
+   };
+};
diff --git a/MAINTAINERS b/MAINTAINERS
index 9047c2b..b8d6ef5 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -3410,6 +3410,7 @@ M:Alison Wang 
 L: dri-devel at lists.freedesktop.org
 S: Supported
 F: drivers/gpu/drm/fsl-dcu/
+F: Documentation/devicetree/bindings/drm/fsl-dcu/
 F: Documentation/devicetree/bindings/panel/nec,nl4827hc19_05b.txt

 DRM DRIVERS FOR NVIDIA TEGRA
diff --git a/arch/arm/boot/dts/ls1021a.dtsi b/arch/arm/boot/dts/ls1021a.dtsi
index c70bb27..6d6e3e2 100644
--- a/arch/arm/boot/dts/ls1021a.dtsi
+++ b/arch/arm/boot/dts/ls1021a.dtsi
@@ -383,6 +383,16 @@
 <_clk 1>;
};

+   dcu: dcu at 2ce {
+   compatible = "fsl,ls1021a-dcu";
+   reg = <0x0 0x2ce 0x0 0x1>;
+   interrupts = ;
+   clocks = <_clk 0>;
+   clock-names = "dcu";
+   big-endian;
+   status = "disabled";
+   };
+
mdio0: mdio at 2d24000 {
compatible = "gianfar";
device_type = "mdio";
-- 
2.1.0.27.g96db324



[PATCH v6 2/4] drm/panel: simple: Add support for NEC NL4827HC19-05B 480x272 panel

2015-07-10 Thread Jianwei Wang
This adds support for the  NEC NL4827HC19-05B 480x272 panel to
the DRM simple panel driver.

Signed-off-by: Jianwei Wang 
---
 .../bindings/panel/nec,nl4827hc19_05b.txt  |  8 +++
 .../devicetree/bindings/vendor-prefixes.txt|  1 +
 MAINTAINERS|  1 +
 drivers/gpu/drm/panel/panel-simple.c   | 26 ++
 4 files changed, 36 insertions(+)
 create mode 100644 
Documentation/devicetree/bindings/panel/nec,nl4827hc19_05b.txt

diff --git a/Documentation/devicetree/bindings/panel/nec,nl4827hc19_05b.txt 
b/Documentation/devicetree/bindings/panel/nec,nl4827hc19_05b.txt
new file mode 100644
index 000..6f6dbdd
--- /dev/null
+++ b/Documentation/devicetree/bindings/panel/nec,nl4827hc19_05b.txt
@@ -0,0 +1,7 @@
+NEC LCD Technologies,Ltd. WQVGA TFT LCD panel
+
+Required properties:
+- compatible: should be "nec,nl4827hc19_05b"
+
+This binding is compatible with the simple-panel binding, which is specified
+in simple-panel.txt in this directory.
diff --git a/Documentation/devicetree/bindings/vendor-prefixes.txt 
b/Documentation/devicetree/bindings/vendor-prefixes.txt
index 8033919..9f22b3e 100644
--- a/Documentation/devicetree/bindings/vendor-prefixes.txt
+++ b/Documentation/devicetree/bindings/vendor-prefixes.txt
@@ -131,6 +131,7 @@ mundoreader Mundo Reader S.L.
 murata Murata Manufacturing Co., Ltd.
 mxicy  Macronix International Co., Ltd.
 national   National Semiconductor
+necNEC LCD Technologies, Ltd.
 neonodeNeonode Inc.
 netgearNETGEAR
 netlogic   Broadcom Corporation (formerly NetLogic Microsystems)
diff --git a/MAINTAINERS b/MAINTAINERS
index b25b948..9047c2b 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -3410,6 +3410,7 @@ M:Alison Wang 
 L: dri-devel at lists.freedesktop.org
 S: Supported
 F: drivers/gpu/drm/fsl-dcu/
+F: Documentation/devicetree/bindings/panel/nec,nl4827hc19_05b.txt

 DRM DRIVERS FOR NVIDIA TEGRA
 M: Thierry Reding 
diff --git a/drivers/gpu/drm/panel/panel-simple.c 
b/drivers/gpu/drm/panel/panel-simple.c
index f94201b..eee95f4 100644
--- a/drivers/gpu/drm/panel/panel-simple.c
+++ b/drivers/gpu/drm/panel/panel-simple.c
@@ -1036,6 +1036,29 @@ static const struct panel_desc shelly_sca07010_bfn_lnn = 
{
.bus_format = MEDIA_BUS_FMT_RGB666_1X18,
 };

+static const struct drm_display_mode nec_nl4827hc19_05b_mode = {
+   .clock = 10870,
+   .hdisplay = 480,
+   .hsync_start = 480 + 2,
+   .hsync_end = 480 + 2 + 41,
+   .htotal = 480 + 2 + 41 + 2,
+   .vdisplay = 272,
+   .vsync_start = 272 + 2,
+   .vsync_end = 272 + 2 + 4,
+   .vtotal = 272 + 2 + 4 + 2,
+   .vrefresh = 74,
+};
+
+static const struct panel_desc nec_nl4827hc19_05b = {
+   .modes = _nl4827hc19_05b_mode,
+   .num_modes = 1,
+   .size = {
+   .width = 480,
+   .height = 272,
+   },
+   .bus_format = MEDIA_BUS_FMT_RGB888_1X24
+};
+
 static const struct of_device_id platform_of_match[] = {
{
.compatible = "ampire,am800480r3tmqwa1h",
@@ -1125,6 +1148,9 @@ static const struct of_device_id platform_of_match[] = {
.compatible = "shelly,sca07010-bfn-lnn",
.data = _sca07010_bfn_lnn,
}, {
+   .compatible = "nec,nl4827hc19_05b",
+   .data = _nl4827hc19_05b,
+   }, {
/* sentinel */
}
 };
--
2.1.0.27.g96db324



[PATCH v6 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 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 | 200 +
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_connector.h |  31 ++
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_crtc.c  | 172 +++
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_crtc.h  |  22 ++
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c   | 379 
 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, 1365 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: Supported
+F: drivers/gpu/drm/fsl-dcu/
+
 DRM DRIVERS FOR NVIDIA TEGRA
 M: Thierry Reding 
 M: Terje Bergström 
diff --git a/drivers/gpu/drm/K

[PATCH v5 3/3] arm/dts/ls1021a: Add a TFT LCD panel dts node for DCU

2015-04-17 Thread Jianwei Wang
From: Jianwei Wang <b52...@freescale.com>

Add a required display-timings node for the TFT LCD panel
the TFT LCD panel is WQVGA "480x272", and the bpp is 24.

Signed-off-by: Alison Wang 
Signed-off-by: Xiubo Li 
Signed-off-by: Jianwei Wang 
---
 arch/arm/boot/dts/ls1021a-twr.dts | 26 ++
 1 file changed, 26 insertions(+)

diff --git a/arch/arm/boot/dts/ls1021a-twr.dts 
b/arch/arm/boot/dts/ls1021a-twr.dts
index a2c591e..4780b11 100644
--- a/arch/arm/boot/dts/ls1021a-twr.dts
+++ b/arch/arm/boot/dts/ls1021a-twr.dts
@@ -58,6 +58,32 @@
};
 };

+ {
+   display = <>;
+   status = "okay";
+
+   display: display at 0 {
+   bits-per-pixel = <24>;
+
+   display-timings {
+   native-mode = <>;
+   timing0: nl4827hc19 {
+   clock-frequency = <1087>;
+   hactive = <480>;
+   vactive = <272>;
+   hback-porch = <2>;
+   hfront-porch = <2>;
+   vback-porch = <2>;
+   vfront-porch = <2>;
+   hsync-len = <41>;
+   vsync-len = <4>;
+   hsync-active = <1>;
+   vsync-active = <1>;
+   };
+   };
+   };
+};
+
  {
bus-num = <0>;
status = "okay";
-- 
2.1.0.27.g96db324



[PATCH v5 2/3] arm/dts/ls1021a: Add DCU dts node

2015-04-17 Thread Jianwei Wang
From: Jianwei Wang <b52...@freescale.com>

Add DCU node, DCU is a display controller of Freescale
named 2D-ACE.

Signed-off-by: Alison Wang 
Signed-off-by: Xiubo Li 
Signed-off-by: Jianwei Wang 
---
 arch/arm/boot/dts/ls1021a.dtsi | 10 ++
 1 file changed, 10 insertions(+)

diff --git a/arch/arm/boot/dts/ls1021a.dtsi b/arch/arm/boot/dts/ls1021a.dtsi
index c70bb27..6d6e3e2 100644
--- a/arch/arm/boot/dts/ls1021a.dtsi
+++ b/arch/arm/boot/dts/ls1021a.dtsi
@@ -383,6 +383,16 @@
 <_clk 1>;
};

+   dcu: dcu at 2ce {
+   compatible = "fsl,ls1021a-dcu";
+   reg = <0x0 0x2ce 0x0 0x1>;
+   interrupts = ;
+   clocks = <_clk 0>;
+   clock-names = "dcu";
+   big-endian;
+   status = "disabled";
+   };
+
mdio0: mdio at 2d24000 {
compatible = "gianfar";
device_type = "mdio";
-- 
2.1.0.27.g96db324



[PATCH v5 1/3] drm/layerscape: Add Freescale DCU DRM driver

2015-04-17 Thread Jianwei Wang
From: Jianwei Wang <b52...@freescale.com>

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 V5

- Update commit message
- Add layer registers initialization
- Remove unused functions
- Rename driver folder
- 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
- Set the unique name of the DRM device
- Implement irq handle function for vblank interrupt

Changed in v2: 
- Add atomic support
- Modify bindings file
- Rename node for compatibility
- Move platform related code out for compatibility

 .../devicetree/bindings/drm/fsl-dcu/fsl,dcu.txt|  50 +++
 MAINTAINERS|   8 +
 drivers/gpu/drm/Kconfig|   2 +
 drivers/gpu/drm/Makefile   |   1 +
 drivers/gpu/drm/fsl-dcu/Kconfig|  17 +
 drivers/gpu/drm/fsl-dcu/Makefile   |   7 +
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_connector.c| 194 +++
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_connector.h|  30 ++
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_crtc.c | 172 ++
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_crtc.h |  22 ++
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c  | 373 +
 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| 192 +++
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_plane.h|  23 ++
 17 files changed, 1399 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/drm/fsl-dcu/fsl,dcu.txt
 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/Documentation/devicetree/bindings/drm/fsl-dcu/fsl,dcu.txt 
b/Documentation/devicetree/bindings/drm/fsl-dcu/fsl,dcu.txt
new file mode 100644
index 000..bdc7d5b
--- /dev/null
+++ b/Documentation/devicetree/bindings/drm/fsl-dcu/fsl,dcu.txt
@@ -0,0 +1,49 @@
+Device Tree bindings for Freescale DCU DRM Driver
+
+Required properties:
+- compatible:   Should be one of
+   * "fsl,ls1021a-dcu".
+   * "fsl,vf610-dcu".
+- reg:  Address and length of the register set for dcu.
+- clocks:   From common clock binding: hand

[PATCH v4 4/4] arm/dts/ls1021a: Add a TFT LCD panel dts node for DCU

2015-04-03 Thread Jianwei Wang
Add a required display-timings node for the TFT LCD panel
the TFT LCD panel is WQVGA "480x272", and the bpp is 24.

Signed-off-by: Alison Wang 
Signed-off-by: Xiubo Li 
Signed-off-by: Jianwei Wang 
---
 arch/arm/boot/dts/ls1021a-twr.dts | 26 ++
 1 file changed, 26 insertions(+)

diff --git a/arch/arm/boot/dts/ls1021a-twr.dts 
b/arch/arm/boot/dts/ls1021a-twr.dts
index a2c591e..4780b11 100644
--- a/arch/arm/boot/dts/ls1021a-twr.dts
+++ b/arch/arm/boot/dts/ls1021a-twr.dts
@@ -58,6 +58,32 @@
};
 };

+ {
+   display = <>;
+   status = "okay";
+
+   display: display at 0 {
+   bits-per-pixel = <24>;
+
+   display-timings {
+   native-mode = <>;
+   timing0: nl4827hc19 {
+   clock-frequency = <1087>;
+   hactive = <480>;
+   vactive = <272>;
+   hback-porch = <2>;
+   hfront-porch = <2>;
+   vback-porch = <2>;
+   vfront-porch = <2>;
+   hsync-len = <41>;
+   vsync-len = <4>;
+   hsync-active = <1>;
+   vsync-active = <1>;
+   };
+   };
+   };
+};
+
  {
bus-num = <0>;
status = "okay";
-- 
2.1.0.27.g96db324



[PATCH v4 3/4] arm/dts/ls1021a: Add DCU dts node

2015-04-03 Thread Jianwei Wang
Add DCU node, DCU is a display controller of Freescale
named 2D-ACE.

Signed-off-by: Alison Wang 
Signed-off-by: Xiubo Li 
Signed-off-by: Jianwei Wang 
---
 arch/arm/boot/dts/ls1021a.dtsi | 10 ++
 1 file changed, 10 insertions(+)

diff --git a/arch/arm/boot/dts/ls1021a.dtsi b/arch/arm/boot/dts/ls1021a.dtsi
index c70bb27..6d6e3e2 100644
--- a/arch/arm/boot/dts/ls1021a.dtsi
+++ b/arch/arm/boot/dts/ls1021a.dtsi
@@ -383,6 +383,16 @@
 <_clk 1>;
};

+   dcu: dcu at 2ce {
+   compatible = "fsl,ls1021a-dcu";
+   reg = <0x0 0x2ce 0x0 0x1>;
+   interrupts = ;
+   clocks = <_clk 0>;
+   clock-names = "dcu";
+   big-endian;
+   status = "disabled";
+   };
+
mdio0: mdio at 2d24000 {
compatible = "gianfar";
device_type = "mdio";
-- 
2.1.0.27.g96db324



[PATCH v4 2/4] arm/layerscape/ls1021a: DCU pixel clock control

2015-04-03 Thread Jianwei Wang
Enable DCU pixel clock when platform devices initinalizing and
provide enable and disable pixel clock functions for drm driver

Signed-off-by: Alison Wang 
Signed-off-by: Xiubo Li 
Signed-off-by: Jianwei Wang 
---
 arch/arm/mach-imx/mach-ls1021a.c | 36 
 include/linux/fsl/dcu.h  | 22 ++
 2 files changed, 58 insertions(+)
 create mode 100644 include/linux/fsl/dcu.h

diff --git a/arch/arm/mach-imx/mach-ls1021a.c b/arch/arm/mach-imx/mach-ls1021a.c
index b89c858..4fb346d 100644
--- a/arch/arm/mach-imx/mach-ls1021a.c
+++ b/arch/arm/mach-imx/mach-ls1021a.c
@@ -8,9 +8,44 @@
  */

 #include 
+#include 
+#include 
+#include 
+#include 

 #include "common.h"

+void dcu_pixclk_disable(void)
+{
+   struct regmap *scfg_regmap;
+
+   scfg_regmap = syscon_regmap_lookup_by_compatible("fsl,ls1021a-scfg");
+   if (IS_ERR(scfg_regmap)) {
+   pr_err("No syscfg phandle specified\n");
+   return;
+   }
+
+   regmap_write(scfg_regmap, SCFG_PIXCLKCR, PXCK_DISABLE);
+}
+
+void dcu_pixclk_enable(void)
+{
+   struct regmap *scfg_regmap;
+
+   scfg_regmap = syscon_regmap_lookup_by_compatible("fsl,ls1021a-scfg");
+   if (IS_ERR(scfg_regmap)) {
+   pr_err("No syscfg phandle specified\n");
+   return;
+   }
+
+   regmap_write(scfg_regmap, SCFG_PIXCLKCR, PXCK_ENABLE);
+}
+
+static void __init ls1021a_init_machine(void)
+{
+   of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
+   dcu_pixclk_enable();
+}
 static const char * const ls1021a_dt_compat[] __initconst = {
"fsl,ls1021a",
NULL,
@@ -18,5 +53,6 @@ static const char * const ls1021a_dt_compat[] __initconst = {

 DT_MACHINE_START(LS1021A, "Freescale LS1021A")
.smp= smp_ops(ls1021a_smp_ops),
+   .init_machine   = ls1021a_init_machine,
.dt_compat  = ls1021a_dt_compat,
 MACHINE_END
diff --git a/include/linux/fsl/dcu.h b/include/linux/fsl/dcu.h
new file mode 100644
index 000..1873057
--- /dev/null
+++ b/include/linux/fsl/dcu.h
@@ -0,0 +1,22 @@
+/*
+ * Copyright 2015 Freescale Semiconductor, Inc.
+ *
+ * Freescale DCU drm device driver
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ */
+
+#ifndef __FSL_DCU_H__
+#define __FSL_DCU_H__
+
+#define SCFG_PIXCLKCR  0x28
+#define PXCK_ENABLEBIT(31)
+#define PXCK_DISABLE   0
+
+void dcu_pixclk_enable(void);
+void dcu_pixclk_disable(void);
+
+#endif /* __FSL_DCU_H__ */
-- 
2.1.0.27.g96db324


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

2015-04-03 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 direct colors with an alpha
channel.
(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 
---
 .../devicetree/bindings/drm/fsl/fsl,dcu.txt|  50 
 drivers/gpu/drm/Kconfig|   2 +
 drivers/gpu/drm/Makefile   |   1 +
 drivers/gpu/drm/fsl/Kconfig|  17 ++
 drivers/gpu/drm/fsl/Makefile   |   7 +
 drivers/gpu/drm/fsl/fsl_dcu_drm_connector.c| 194 
 drivers/gpu/drm/fsl/fsl_dcu_drm_connector.h|  30 ++
 drivers/gpu/drm/fsl/fsl_dcu_drm_crtc.c | 165 +++
 drivers/gpu/drm/fsl/fsl_dcu_drm_crtc.h |  26 ++
 drivers/gpu/drm/fsl/fsl_dcu_drm_drv.c  | 329 +
 drivers/gpu/drm/fsl/fsl_dcu_drm_drv.h  | 210 +
 drivers/gpu/drm/fsl/fsl_dcu_drm_fbdev.c|  26 ++
 drivers/gpu/drm/fsl/fsl_dcu_drm_kms.c  |  42 +++
 drivers/gpu/drm/fsl/fsl_dcu_drm_kms.h  |  17 ++
 drivers/gpu/drm/fsl/fsl_dcu_drm_plane.c| 192 
 drivers/gpu/drm/fsl/fsl_dcu_drm_plane.h|  23 ++
 16 files changed, 1331 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/drm/fsl/fsl,dcu.txt
 create mode 100644 drivers/gpu/drm/fsl/Kconfig
 create mode 100644 drivers/gpu/drm/fsl/Makefile
 create mode 100644 drivers/gpu/drm/fsl/fsl_dcu_drm_connector.c
 create mode 100644 drivers/gpu/drm/fsl/fsl_dcu_drm_connector.h
 create mode 100644 drivers/gpu/drm/fsl/fsl_dcu_drm_crtc.c
 create mode 100644 drivers/gpu/drm/fsl/fsl_dcu_drm_crtc.h
 create mode 100644 drivers/gpu/drm/fsl/fsl_dcu_drm_drv.c
 create mode 100644 drivers/gpu/drm/fsl/fsl_dcu_drm_drv.h
 create mode 100644 drivers/gpu/drm/fsl/fsl_dcu_drm_fbdev.c
 create mode 100644 drivers/gpu/drm/fsl/fsl_dcu_drm_kms.c
 create mode 100644 drivers/gpu/drm/fsl/fsl_dcu_drm_kms.h
 create mode 100644 drivers/gpu/drm/fsl/fsl_dcu_drm_plane.c
 create mode 100644 drivers/gpu/drm/fsl/fsl_dcu_drm_plane.h

diff --git a/Documentation/devicetree/bindings/drm/fsl/fsl,dcu.txt 
b/Documentation/devicetree/bindings/drm/fsl/fsl,dcu.txt
new file mode 100644
index 000..bdc7d5b
--- /dev/null
+++ b/Documentation/devicetree/bindings/drm/fsl/fsl,dcu.txt
@@ -0,0 +1,49 @@
+Device Tree bindings for Freescale DCU DRM Driver
+
+Required properties:
+- compatible:   Should be one of
+   * "fsl,ls1021a-dcu".
+   * "fsl,vf610-dcu".
+- reg:  Address and length of the register set for dcu.
+- clocks:   From common clock binding: handle to dcu clock.
+- clock-names:  From common clock binding: Shall be "dcu".
+- display:  The phandle to display node.
+
+Required properties:
+- bits-per-pixel:   <16> for RGB565,
+   <24> for RGB888,
+   <32> for RGB.
+
+Required timing node for dispplay sub-node:
+- display-timings:  Refer to binding doc display-timing.txt for details.
+
+Examples:
+dcu: dcu at 2ce {
+   compatible = "fsl,ls1021a-dcu";
+   reg = <0x0 0x2ce 0x0 0x1>;
+   clocks = <_clk 0>;
+   clock-names = "dcu";
+   big-endian;
+   display = <>;
+
+   display: display at 0 {
+   bits-per-pixel = <24>;
+
+   display-timings {
+   native-mode = <>;
+   timing0: nl4827hc19 {
+   clock-frequency = <1087>;
+ 

[PATCH v4 0/4] drm/layerscape: Add Freescale DCU DRM driver

2015-04-03 Thread Jianwei Wang
@Daniel,
Do you have any other comments for this driver?

@Stefan,
Please help test this driver on vybrid if possible, I have test it on vybrid 
twr board.

If anyone has any objections, please let me know.

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
- Set the unique name of the DRM device
- Implement irq handle function for vblank interrupt

Changed in v2:
- Add atomic support
- Modify bindings file
- Rename node for compatibility
- Move platform related code out for compatibility

Added in v1:
- Add support for DCU display controller on the Freescale LS102x SoCs.
- Create a primary plane, a fb created for fbdev, a crtc, a connector for TFT 
LCD panel, an encoder.


 .../devicetree/bindings/drm/fsl/fsl,dcu.txt|  50 
 drivers/gpu/drm/Kconfig|   2 +
 drivers/gpu/drm/Makefile   |   1 +
 drivers/gpu/drm/fsl/Kconfig|  17 ++
 drivers/gpu/drm/fsl/Makefile   |   7 +
 drivers/gpu/drm/fsl/fsl_dcu_drm_connector.c| 194 
 drivers/gpu/drm/fsl/fsl_dcu_drm_connector.h|  30 ++
 drivers/gpu/drm/fsl/fsl_dcu_drm_crtc.c | 165 +++
 drivers/gpu/drm/fsl/fsl_dcu_drm_crtc.h |  26 ++
 drivers/gpu/drm/fsl/fsl_dcu_drm_drv.c  | 329 +
 drivers/gpu/drm/fsl/fsl_dcu_drm_drv.h  | 210 +
 drivers/gpu/drm/fsl/fsl_dcu_drm_fbdev.c|  26 ++
 drivers/gpu/drm/fsl/fsl_dcu_drm_kms.c  |  42 +++
 drivers/gpu/drm/fsl/fsl_dcu_drm_kms.h  |  17 ++
 drivers/gpu/drm/fsl/fsl_dcu_drm_plane.c| 192 
 drivers/gpu/drm/fsl/fsl_dcu_drm_plane.h|  23 ++
 16 files changed, 1331 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/drm/fsl/fsl,dcu.txt
 create mode 100644 drivers/gpu/drm/fsl/Kconfig
 create mode 100644 drivers/gpu/drm/fsl/Makefile
 create mode 100644 drivers/gpu/drm/fsl/fsl_dcu_drm_connector.c
 create mode 100644 drivers/gpu/drm/fsl/fsl_dcu_drm_connector.h
 create mode 100644 drivers/gpu/drm/fsl/fsl_dcu_drm_crtc.c
 create mode 100644 drivers/gpu/drm/fsl/fsl_dcu_drm_crtc.h
 create mode 100644 drivers/gpu/drm/fsl/fsl_dcu_drm_drv.c
 create mode 100644 drivers/gpu/drm/fsl/fsl_dcu_drm_drv.h
 create mode 100644 drivers/gpu/drm/fsl/fsl_dcu_drm_fbdev.c
 create mode 100644 drivers/gpu/drm/fsl/fsl_dcu_drm_kms.c
 create mode 100644 drivers/gpu/drm/fsl/fsl_dcu_drm_kms.h
 create mode 100644 drivers/gpu/drm/fsl/fsl_dcu_drm_plane.c
 create mode 100644 drivers/gpu/drm/fsl/fsl_dcu_drm_plane.h



[PATCH v3 4/4] arm/dts/ls1021a: Add a TFT LCD panel dts node for DCU

2015-03-26 Thread Jianwei Wang
Add a required display-timings node for the TFT LCD panel
the TFT LCD panel is WQVGA "480x272", and the bpp is 24.

Signed-off-by: Alison Wang 
Signed-off-by: Xiubo Li 
Signed-off-by: Jianwei Wang 
---
 arch/arm/boot/dts/ls1021a-twr.dts | 26 ++
 1 file changed, 26 insertions(+)

diff --git a/arch/arm/boot/dts/ls1021a-twr.dts 
b/arch/arm/boot/dts/ls1021a-twr.dts
index a2c591e..4780b11 100644
--- a/arch/arm/boot/dts/ls1021a-twr.dts
+++ b/arch/arm/boot/dts/ls1021a-twr.dts
@@ -58,6 +58,32 @@
};
 };

+ {
+   display = <>;
+   status = "okay";
+
+   display: display at 0 {
+   bits-per-pixel = <24>;
+
+   display-timings {
+   native-mode = <>;
+   timing0: nl4827hc19 {
+   clock-frequency = <1087>;
+   hactive = <480>;
+   vactive = <272>;
+   hback-porch = <2>;
+   hfront-porch = <2>;
+   vback-porch = <2>;
+   vfront-porch = <2>;
+   hsync-len = <41>;
+   vsync-len = <4>;
+   hsync-active = <1>;
+   vsync-active = <1>;
+   };
+   };
+   };
+};
+
  {
bus-num = <0>;
status = "okay";
-- 
2.1.0.27.g96db324



[PATCH v3 3/4] arm/dts/ls1021a: Add DCU dts node

2015-03-26 Thread Jianwei Wang
Add DCU node, DCU is a display controller of Freescale
named 2D-ACE.

Signed-off-by: Alison Wang 
Signed-off-by: Xiubo Li 
Signed-off-by: Jianwei Wang 
---
 arch/arm/boot/dts/ls1021a.dtsi | 10 ++
 1 file changed, 10 insertions(+)

diff --git a/arch/arm/boot/dts/ls1021a.dtsi b/arch/arm/boot/dts/ls1021a.dtsi
index c70bb27..6d6e3e2 100644
--- a/arch/arm/boot/dts/ls1021a.dtsi
+++ b/arch/arm/boot/dts/ls1021a.dtsi
@@ -383,6 +383,16 @@
 <_clk 1>;
};

+   dcu: dcu at 2ce {
+   compatible = "fsl,ls1021a-dcu";
+   reg = <0x0 0x2ce 0x0 0x1>;
+   interrupts = ;
+   clocks = <_clk 0>;
+   clock-names = "dcu";
+   big-endian;
+   status = "disabled";
+   };
+
mdio0: mdio at 2d24000 {
compatible = "gianfar";
device_type = "mdio";
-- 
2.1.0.27.g96db324



[PATCH v3 2/4] arm/layerscape/ls1021a: DCU pixel clock control

2015-03-26 Thread Jianwei Wang
Enable DCU pixel clock when platform devices initinalizing and
provide enable and disable pixel clock functions for drm driver

Signed-off-by: Alison Wang 
Signed-off-by: Xiubo Li 
Signed-off-by: Jianwei Wang 
---
 arch/arm/mach-imx/mach-ls1021a.c | 36 
 include/linux/fsl/dcu.h  | 22 ++
 2 files changed, 58 insertions(+)
 create mode 100644 include/linux/fsl/dcu.h

diff --git a/arch/arm/mach-imx/mach-ls1021a.c b/arch/arm/mach-imx/mach-ls1021a.c
index b89c858..4fb346d 100644
--- a/arch/arm/mach-imx/mach-ls1021a.c
+++ b/arch/arm/mach-imx/mach-ls1021a.c
@@ -8,9 +8,44 @@
  */

 #include 
+#include 
+#include 
+#include 
+#include 

 #include "common.h"

+void dcu_pixclk_disable(void)
+{
+   struct regmap *scfg_regmap;
+
+   scfg_regmap = syscon_regmap_lookup_by_compatible("fsl,ls1021a-scfg");
+   if (IS_ERR(scfg_regmap)) {
+   pr_err("No syscfg phandle specified\n");
+   return;
+   }
+
+   regmap_write(scfg_regmap, SCFG_PIXCLKCR, PXCK_DISABLE);
+}
+
+void dcu_pixclk_enable(void)
+{
+   struct regmap *scfg_regmap;
+
+   scfg_regmap = syscon_regmap_lookup_by_compatible("fsl,ls1021a-scfg");
+   if (IS_ERR(scfg_regmap)) {
+   pr_err("No syscfg phandle specified\n");
+   return;
+   }
+
+   regmap_write(scfg_regmap, SCFG_PIXCLKCR, PXCK_ENABLE);
+}
+
+static void __init ls1021a_init_machine(void)
+{
+   of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
+   dcu_pixclk_enable();
+}
 static const char * const ls1021a_dt_compat[] __initconst = {
"fsl,ls1021a",
NULL,
@@ -18,5 +53,6 @@ static const char * const ls1021a_dt_compat[] __initconst = {

 DT_MACHINE_START(LS1021A, "Freescale LS1021A")
.smp= smp_ops(ls1021a_smp_ops),
+   .init_machine   = ls1021a_init_machine,
.dt_compat  = ls1021a_dt_compat,
 MACHINE_END
diff --git a/include/linux/fsl/dcu.h b/include/linux/fsl/dcu.h
new file mode 100644
index 000..1873057
--- /dev/null
+++ b/include/linux/fsl/dcu.h
@@ -0,0 +1,22 @@
+/*
+ * Copyright 2015 Freescale Semiconductor, Inc.
+ *
+ * Freescale DCU drm device driver
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ */
+
+#ifndef __FSL_DCU_H__
+#define __FSL_DCU_H__
+
+#define SCFG_PIXCLKCR  0x28
+#define PXCK_ENABLEBIT(31)
+#define PXCK_DISABLE   0
+
+void dcu_pixclk_enable(void);
+void dcu_pixclk_disable(void);
+
+#endif /* __FSL_DCU_H__ */
-- 
2.1.0.27.g96db324



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

2015-03-26 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 direct colors with an alpha channel.
(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 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
- Set the unique name of the DRM device
- Implement irq handle function for vblank interrupt

Changed in v2: 
- Add atomic support
- Modify bindings file
- Rename node for compatibility
- Move platform related code out for compatibility

 .../devicetree/bindings/drm/fsl/fsl,dcu.txt|  50 
 drivers/gpu/drm/Kconfig|   2 +
 drivers/gpu/drm/Makefile   |   1 +
 drivers/gpu/drm/fsl/Kconfig|  17 ++
 drivers/gpu/drm/fsl/Makefile   |   8 +
 drivers/gpu/drm/fsl/fsl_dcu_drm_connector.c| 193 
 drivers/gpu/drm/fsl/fsl_dcu_drm_connector.h|  30 ++
 drivers/gpu/drm/fsl/fsl_dcu_drm_crtc.c | 165 ++
 drivers/gpu/drm/fsl/fsl_dcu_drm_crtc.h |  26 ++
 drivers/gpu/drm/fsl/fsl_dcu_drm_drv.c  | 331 +
 drivers/gpu/drm/fsl/fsl_dcu_drm_drv.h  | 210 +
 drivers/gpu/drm/fsl/fsl_dcu_drm_fbdev.c|  26 ++
 drivers/gpu/drm/fsl/fsl_dcu_drm_kms.c  |  42 +++
 drivers/gpu/drm/fsl/fsl_dcu_drm_kms.h  |  17 ++
 drivers/gpu/drm/fsl/fsl_dcu_drm_plane.c| 192 
 drivers/gpu/drm/fsl/fsl_dcu_drm_plane.h|  23 ++
 16 files changed, 1333 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/drm/fsl/fsl,dcu.txt
 create mode 100644 drivers/gpu/drm/fsl/Kconfig
 create mode 100644 drivers/gpu/drm/fsl/Makefile
 create mode 100644 drivers/gpu/drm/fsl/fsl_dcu_drm_connector.c
 create mode 100644 drivers/gpu/drm/fsl/fsl_dcu_drm_connector.h
 create mode 100644 drivers/gpu/drm/fsl/fsl_dcu_drm_crtc.c
 create mode 100644 drivers/gpu/drm/fsl/fsl_dcu_drm_crtc.h
 create mode 100644 drivers/gpu/drm/fsl/fsl_dcu_drm_drv.c
 create mode 100644 drivers/gpu/drm/fsl/fsl_dcu_drm_drv.h
 create mode 100644 drivers/gpu/drm/fsl/fsl_dcu_drm_fbdev.c
 create mode 100644 drivers/gpu/drm/fsl/fsl_dcu_drm_kms.c
 create mode 100644 drivers/gpu/drm/fsl/fsl_dcu_drm_kms.h
 create mode 100644 drivers/gpu/drm/fsl/fsl_dcu_drm_plane.c
 create mode 100644 drivers/gpu/drm/fsl/fsl_dcu_drm_plane.h

diff --git a/Documentation/devicetree/bindings/drm/fsl/fsl,dcu.txt 
b/Documentation/devicetree/bindings/drm/fsl/fsl,dcu.txt
new file mode 100644
index 000..bdc7d5b
--- /dev/null
+++ b/Documentation/devicetree/bindings/drm/fsl/fsl,dcu.txt
@@ -0,0 +1,50 @@
+Device Tree bindings for Freescale DCU DRM Driver
+
+Required properties:
+- compatible:   Should be one of
+   * "fsl,ls1021a-dcu".
+   * "fsl,vf610-dcu".
+- reg:  Address and length of the register set for dcu.
+- clocks:   From common clock binding: handle to dcu clock.
+- clock-names:  From common clock binding: Shall be "dcu".
+- display:  The phandle to display node.
+
+Required properties:
+- bits-per-pixel:   <16> for RGB565,
+   <24> for RGB888,
+   <32> for RGB.
+
+Required timing node for dispplay sub-node:
+- display-timings:  Refer to binding doc display-timing.txt for details.
+
+Examples:
+dcu: dcu at 2ce {
+   compatible = "fsl,ls1021a-dcu";
+   reg = <0x0 0x2ce 0x0 0x1

[PATCH 3/3] arm/dts/ls1021a: Add a TFT LCD panel dts node for DCU

2015-03-13 Thread Jianwei Wang
Add a required display-timings node for the TFT LCD panel
the TFT LCD panel is WQVGA "480x272", and the bpp is 24.

Signed-off-by: Alison Wang 
Signed-off-by: Xiubo Li 
Signed-off-by: Jianwei Wang 
---
 arch/arm/boot/dts/ls1021a-twr.dts | 26 ++
 1 file changed, 26 insertions(+)

diff --git a/arch/arm/boot/dts/ls1021a-twr.dts 
b/arch/arm/boot/dts/ls1021a-twr.dts
index a2c591e..4780b11 100644
--- a/arch/arm/boot/dts/ls1021a-twr.dts
+++ b/arch/arm/boot/dts/ls1021a-twr.dts
@@ -58,6 +58,32 @@
};
 };

+ {
+   display = <>;
+   status = "okay";
+
+   display: display at 0 {
+   bits-per-pixel = <24>;
+
+   display-timings {
+   native-mode = <>;
+   timing0: nl4827hc19 {
+   clock-frequency = <1087>;
+   hactive = <480>;
+   vactive = <272>;
+   hback-porch = <2>;
+   hfront-porch = <2>;
+   vback-porch = <2>;
+   vfront-porch = <2>;
+   hsync-len = <41>;
+   vsync-len = <4>;
+   hsync-active = <1>;
+   vsync-active = <1>;
+   };
+   };
+   };
+};
+
  {
bus-num = <0>;
status = "okay";
-- 
2.1.0.27.g96db324



[PATCH 2/3] arm/dts/ls1021a: Add DCU dts node

2015-03-13 Thread Jianwei Wang
Add DCU node, DCU is a display controller of Freescale
named 2D-ACE.

Signed-off-by: Alison Wang 
Signed-off-by: Xiubo Li 
Signed-off-by: Jianwei Wang 
---
 arch/arm/boot/dts/ls1021a.dtsi | 10 ++
 1 file changed, 10 insertions(+)

diff --git a/arch/arm/boot/dts/ls1021a.dtsi b/arch/arm/boot/dts/ls1021a.dtsi
index c70bb27..ea83bdc 100644
--- a/arch/arm/boot/dts/ls1021a.dtsi
+++ b/arch/arm/boot/dts/ls1021a.dtsi
@@ -383,6 +383,16 @@
 <_clk 1>;
};

+   dcu: dcu at 2ce {
+   compatible = "fsl,dcu";
+   reg = <0x0 0x2ce 0x0 0x1>;
+   interrupts = ;
+   clocks = <_clk 0>;
+   clock-names = "dcu";
+   big-endian;
+   status = "disabled";
+   };
+
mdio0: mdio at 2d24000 {
compatible = "gianfar";
device_type = "mdio";
-- 
2.1.0.27.g96db324



[PATCH 1/3] drm/layerscape: Add fsl dcu DRM driver

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

2D-ACE is a Freescale display controller. It provide an hardware
cursor.

This is a simplified version, only a primary plane, a fb created for
fbdev, a crtc, a connector for TFT LCD panel, an encoder, and the
encoder is not in use.

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

Changed in v2: 
- Add atomic support
- Modify bindings file
- Rename node for compatibility
- Move platform related code out for compatibility

Added in v1: 
- Add support for DCU display controller on the Freescale LS102x SoCs.
- Create a primary plane, a fb created for fbdev, a crtc, a connector
for TFT LCD panel, an encoder.

 arch/arm/mach-imx/mach-ls1021a.c|  36 
 drivers/gpu/drm/Kconfig |   2 +
 drivers/gpu/drm/Makefile|   1 +
 drivers/gpu/drm/fsl/Kconfig |  17 ++
 drivers/gpu/drm/fsl/Makefile|   8 +
 drivers/gpu/drm/fsl/fsl_dcu_drm_connector.c | 203 
 drivers/gpu/drm/fsl/fsl_dcu_drm_connector.h |  28 +++
 drivers/gpu/drm/fsl/fsl_dcu_drm_crtc.c  | 164 
 drivers/gpu/drm/fsl/fsl_dcu_drm_crtc.h  |  26 +++
 drivers/gpu/drm/fsl/fsl_dcu_drm_drv.c   | 288 
 drivers/gpu/drm/fsl/fsl_dcu_drm_drv.h   | 168 
 drivers/gpu/drm/fsl/fsl_dcu_drm_fbdev.c |  26 +++
 drivers/gpu/drm/fsl/fsl_dcu_drm_kms.c   |  42 
 drivers/gpu/drm/fsl/fsl_dcu_drm_kms.h   |  17 ++
 drivers/gpu/drm/fsl/fsl_dcu_drm_plane.c | 187 ++
 drivers/gpu/drm/fsl/fsl_dcu_drm_plane.h |  23 +++
 include/linux/fsl/dcu.h |  22 +++
 17 files changed, 1258 insertions(+)
 create mode 100644 drivers/gpu/drm/fsl/Kconfig
 create mode 100644 drivers/gpu/drm/fsl/Makefile
 create mode 100644 drivers/gpu/drm/fsl/fsl_dcu_drm_connector.c
 create mode 100644 drivers/gpu/drm/fsl/fsl_dcu_drm_connector.h
 create mode 100644 drivers/gpu/drm/fsl/fsl_dcu_drm_crtc.c
 create mode 100644 drivers/gpu/drm/fsl/fsl_dcu_drm_crtc.h
 create mode 100644 drivers/gpu/drm/fsl/fsl_dcu_drm_drv.c
 create mode 100644 drivers/gpu/drm/fsl/fsl_dcu_drm_drv.h
 create mode 100644 drivers/gpu/drm/fsl/fsl_dcu_drm_fbdev.c
 create mode 100644 drivers/gpu/drm/fsl/fsl_dcu_drm_kms.c
 create mode 100644 drivers/gpu/drm/fsl/fsl_dcu_drm_kms.h
 create mode 100644 drivers/gpu/drm/fsl/fsl_dcu_drm_plane.c
 create mode 100644 drivers/gpu/drm/fsl/fsl_dcu_drm_plane.h
 create mode 100644 include/linux/fsl/dcu.h

diff --git a/arch/arm/mach-imx/mach-ls1021a.c b/arch/arm/mach-imx/mach-ls1021a.c
index b89c858..4fb346d 100644
--- a/arch/arm/mach-imx/mach-ls1021a.c
+++ b/arch/arm/mach-imx/mach-ls1021a.c
@@ -8,9 +8,44 @@
  */

 #include 
+#include 
+#include 
+#include 
+#include 

 #include "common.h"

+void dcu_pixclk_disable(void)
+{
+   struct regmap *scfg_regmap;
+
+   scfg_regmap = syscon_regmap_lookup_by_compatible("fsl,ls1021a-scfg");
+   if (IS_ERR(scfg_regmap)) {
+   pr_err("No syscfg phandle specified\n");
+   return;
+   }
+
+   regmap_write(scfg_regmap, SCFG_PIXCLKCR, PXCK_DISABLE);
+}
+
+void dcu_pixclk_enable(void)
+{
+   struct regmap *scfg_regmap;
+
+   scfg_regmap = syscon_regmap_lookup_by_compatible("fsl,ls1021a-scfg");
+   if (IS_ERR(scfg_regmap)) {
+   pr_err("No syscfg phandle specified\n");
+   return;
+   }
+
+   regmap_write(scfg_regmap, SCFG_PIXCLKCR, PXCK_ENABLE);
+}
+
+static void __init ls1021a_init_machine(void)
+{
+   of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
+   dcu_pixclk_enable();
+}
 static const char * const ls1021a_dt_compat[] __initconst = {
"fsl,ls1021a",
NULL,
@@ -18,5 +53,6 @@ static const char * const ls1021a_dt_compat[] __initconst = {

 DT_MACHINE_START(LS1021A, "Freescale LS1021A")
.smp= smp_ops(ls1021a_smp_ops),
+   .init_machine   = ls1021a_init_machine,
.dt_compat  = ls1021a_dt_compat,
 MACHINE_END
diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig
index 151a050..a6957aa 100644
--- a/drivers/gpu/drm/Kconfig
+++ b/drivers/gpu/drm/Kconfig
@@ -199,6 +199,8 @@ source "drivers/gpu/drm/bochs/Kconfig"

 source "drivers/gpu/drm/msm/Kconfig"

+source "drivers/gpu/drm/fsl/Kconfig"
+
 source "drivers/gpu/drm/tegra/Kconfig"

 source "drivers/gpu/drm/panel/Kconfig"
diff --git a/drivers/gpu/drm/Makefile b/drivers/gpu/drm/Makefile
index 2c239b9..ab5b9ef 100644
--- a/drivers/gpu/drm/Makefile
+++ b/drivers/gpu/drm/Makefile
@@ -56,6 +56,7 @@ obj-$(CONFIG_DRM_UDL) += udl/
 obj-$(CONFIG_DRM_AST) += ast/
 obj-$(CONFIG_DRM_ARMADA) += armada/
 obj-$(CONFIG_DRM_ATMEL_HLCDC)  += atmel-hlcdc/
+obj-$(CONFIG_DRM_FSL_DCU) += fsl/
 obj-

[PATCH 3/3] arm/dts/ls1021a: Add a TFT LCD panel dts node for DCU

2015-02-13 Thread Jianwei Wang
Add a required display-timings node for the TFT LCD panel.
the TFT LCD panel is WQVGA "480x272", and the bpp is 24.

Signed-off-by: Alison Wang 
Signed-off-by: Xiubo Li 
Signed-off-by: Jianwei Wang 
---
 arch/arm/boot/dts/ls1021a-twr.dts | 26 ++
 1 file changed, 26 insertions(+)

diff --git a/arch/arm/boot/dts/ls1021a-twr.dts 
b/arch/arm/boot/dts/ls1021a-twr.dts
index a2c591e..3602286 100644
--- a/arch/arm/boot/dts/ls1021a-twr.dts
+++ b/arch/arm/boot/dts/ls1021a-twr.dts
@@ -58,6 +58,32 @@
};
 };

+ {
+   display = <>;
+   status = "okay";
+
+   display: display at 0 {
+   bits-per-pixel = <24>;
+
+   display-timings {
+   native-mode = <>;
+   timing0: nl4827hc19 {
+   clock-frequency = <1087>;
+   hactive = <480>;
+   vactive = <272>;
+   hback-porch = <2>;
+   hfront-porch = <2>;
+   vback-porch = <2>;
+   vfront-porch = <2>;
+   hsync-len = <41>;
+   vsync-len = <4>;
+   hsync-active = <1>;
+   vsync-active = <1>;
+   };
+   };
+   };
+};
+
  {
bus-num = <0>;
status = "okay";
-- 
2.1.0.27.g96db324



[PATCH 2/3] arm/dts/ls1021a: Add DCU dts node

2015-02-13 Thread Jianwei Wang
Add DCU node, DCU is a display controller of Freescale
named 2D-ACE.

Signed-off-by: Alison Wang 
Signed-off-by: Xiubo Li 
Signed-off-by: Jianwei Wang 
---
 arch/arm/boot/dts/ls1021a.dtsi | 11 +++
 1 file changed, 11 insertions(+)

diff --git a/arch/arm/boot/dts/ls1021a.dtsi b/arch/arm/boot/dts/ls1021a.dtsi
index c70bb27..28c37f1 100644
--- a/arch/arm/boot/dts/ls1021a.dtsi
+++ b/arch/arm/boot/dts/ls1021a.dtsi
@@ -383,6 +383,17 @@
 <_clk 1>;
};

+   dcfb: dcfb at 2ce {
+   compatible = "fsl,ls1021a-dcfb";
+   reg = <0x0 0x2ce 0x0 0x1>;
+   interrupts = ;
+   clocks = <_clk 0>;
+   clock-names = "dcfb";
+   scfg-controller = <>;
+   big-endian;
+   status = "disabled";
+   };
+
mdio0: mdio at 2d24000 {
compatible = "gianfar";
device_type = "mdio";
-- 
2.1.0.27.g96db324



[PATCH 1/3] drm/layerscape: Add fsl dcu DRM driver

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

2D-ACE is a Freescale display controller. It supports at most four
plane and provide an hardware cursor.

This is a simplified version, only a primary plane, a fb created for
fbdev, a crtc, a connector for TFT LCD panel, an encoder, and the
encoder is not in use. Now this drver support fbdev only.

Signed-off-by: Alison Wang 
Signed-off-by: Xiubo Li 
Signed-off-by: Jianwei Wang 
---
 .../devicetree/bindings/video/fsl,dcfb.txt |  50 +++
 drivers/gpu/drm/Kconfig|   2 +
 drivers/gpu/drm/Makefile   |   1 +
 drivers/gpu/drm/fsl/Kconfig|  17 +
 drivers/gpu/drm/fsl/Makefile   |   7 +
 drivers/gpu/drm/fsl/fsl_dcu_drm_crtc.c | 412 +
 drivers/gpu/drm/fsl/fsl_dcu_drm_crtc.h |  40 ++
 drivers/gpu/drm/fsl/fsl_dcu_drm_drv.c  | 323 
 drivers/gpu/drm/fsl/fsl_dcu_drm_drv.h  | 167 +
 drivers/gpu/drm/fsl/fsl_dcu_drm_fbdev.c|  43 +++
 drivers/gpu/drm/fsl/fsl_dcu_drm_kms.c  |  45 +++
 drivers/gpu/drm/fsl/fsl_dcu_drm_kms.h  |  22 ++
 drivers/gpu/drm/fsl/fsl_dcu_drm_plane.c| 124 +++
 drivers/gpu/drm/fsl/fsl_dcu_drm_plane.h|  28 ++
 14 files changed, 1281 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/video/fsl,dcfb.txt
 create mode 100644 drivers/gpu/drm/fsl/Kconfig
 create mode 100644 drivers/gpu/drm/fsl/Makefile
 create mode 100644 drivers/gpu/drm/fsl/fsl_dcu_drm_crtc.c
 create mode 100644 drivers/gpu/drm/fsl/fsl_dcu_drm_crtc.h
 create mode 100644 drivers/gpu/drm/fsl/fsl_dcu_drm_drv.c
 create mode 100644 drivers/gpu/drm/fsl/fsl_dcu_drm_drv.h
 create mode 100644 drivers/gpu/drm/fsl/fsl_dcu_drm_fbdev.c
 create mode 100644 drivers/gpu/drm/fsl/fsl_dcu_drm_kms.c
 create mode 100644 drivers/gpu/drm/fsl/fsl_dcu_drm_kms.h
 create mode 100644 drivers/gpu/drm/fsl/fsl_dcu_drm_plane.c
 create mode 100644 drivers/gpu/drm/fsl/fsl_dcu_drm_plane.h

diff --git a/Documentation/devicetree/bindings/video/fsl,dcfb.txt 
b/Documentation/devicetree/bindings/video/fsl,dcfb.txt
new file mode 100644
index 000..de7da97
--- /dev/null
+++ b/Documentation/devicetree/bindings/video/fsl,dcfb.txt
@@ -0,0 +1,50 @@
+* Freescale Simple Display Controller FB Driver
+
+Required properties:
+- compatible:  Should be one of "fsl,ls1021a-dcfb".
+- reg: Address and length of the register set for dcfb.
+- clocks:  From common clock binding: handle to dcfb clock.
+- clock-names: From common clock binding: Shall be "dcfb".
+- display: The phandle to display node.
+
+Optional properties:
+- scfg-controller: The phandle of scfg node.
+
+Required properties:
+- bits-per-pixel:  <16> for RGB565,
+   <24> for RGB888,
+   <32> for RGB.
+
+Required timing node for dispplay sub-node:
+- display-timings: Refer to binding doc display-timing.txt for details.
+
+Examples:
+dcfb: dcfb at 2ce {
+   compatible = "fsl,ls1021a-dcfb";
+   reg = <0x0 0x2ce 0x0 0x1>;
+   clocks = <_clk 0>;
+   clock-names = "dcfb";
+   scfg-controller = <>;
+   display = <>;
+
+   display: display at 0 {
+   bits-per-pixel = <24>;
+
+   display-timings {
+   native-mode = <>;
+   timing0: nl4827hc19 {
+   clock-frequency = <1087>;
+   hactive = <480>;
+   vactive = <272>;
+   hback-porch = <2>;
+   hfront-porch = <2>;
+   vback-porch = <1>;
+   vfront-porch = <1>;
+   hsync-len = <41>;
+   vsync-len = <2>;
+   hsync-active = <1>;
+   vsync-active = <1>;
+   };
+   };
+   };
+};
diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig
index 151a050..a6957aa 100644
--- a/drivers/gpu/drm/Kconfig
+++ b/drivers/gpu/drm/Kconfig
@@ -199,6 +199,8 @@ source "drivers/gpu/drm/bochs/Kconfig"

 source "drivers/gpu/drm/msm/Kconfig"

+source "drivers/gpu/drm/fsl/Kconfig"
+
 source "drivers/gpu/drm/tegra/Kconfig"

 source "drivers/gpu/drm/panel/Kconfig"
diff --git a/drivers/gpu/drm/Makefile b/drivers/gpu/drm/Makefile
index 2c239b9..ab5b9ef 100644
--- a/drivers/gpu/drm/Makefile
+++ b/drivers/gpu/drm/Makefile
@@ -56,6 +56,7 @@ obj-$(CONFIG_DRM_UDL) += udl/
 obj-$