From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mark yao Subject: Re: [PATCH v5 1/3] drm/layerscape: Add Freescale DCU DRM driver Date: Wed, 01 Jul 2015 09:59:21 +0800 Message-ID: <55934979.4060500@rock-chips.com> References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1582138107==" Return-path: Received: from regular2.263xmail.com (regular2.263xmail.com [211.157.152.3]) by gabe.freedesktop.org (Postfix) with ESMTPS id 6D7F26E0BD for ; Tue, 30 Jun 2015 19:10:04 -0700 (PDT) Received: from regular1.263xmail.com (unknown [192.168.165.182]) by regular2.263xmail.com (Postfix) with ESMTP id E07E61EA20 for ; Wed, 1 Jul 2015 10:00:11 +0800 (CST) In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: "Wang J.W." Cc: linux-kernel , dri-devel , b52261@freescale.com, stefan@agner.ch, daniel.vetter@intel.com, "linux-arm-kernel@lists.infradead.org" List-Id: dri-devel@lists.freedesktop.org This is a multi-part message in MIME format. --===============1582138107== Content-Type: multipart/alternative; boundary="------------040301050004050000030809" This is a multi-part message in MIME format. --------------040301050004050000030809 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable On 2015=E5=B9=B406=E6=9C=8830=E6=97=A5 18:01, Wang J.W. wrote: > From: Jianwei Wang > > This patch add support for Two Dimensional Animation and Compositing En= gine (2D-ACE) on the Freescale SoCs. > > 2D-ACE is a Freescale display controller. 2D-ACE describes the function= ality of the module extremely well its name is a value that cannot be use= d as a token in programming languages. > Instead the valid token "DCU" is used to tag the register names and fun= ction names. > > The Display Controller Unit (DCU) module is a system master that fetche= s graphics stored in internal or external memory and displays them on a T= FT 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, w= hich 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 siz= e of panel. > (4) Each graphic layer can be placed with one pixel resolution in eithe= r axis. > (5) Each graphic layer support RGB565 and RGB888 direct colors without = alpha channel and BGRA8888 BGRA4444 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 c= reated 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 adjustme= nt. > > 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 10064= 4 drivers/gpu/drm/fsl-dcu/Makefile create mode 100644 drivers/gpu/drm/fs= l-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 0000000..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: 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 RGB8888. > + > +Required timing node for dispplay sub-node: > +- display-timings: Refer to binding doc display-timing.txt for de= tails. > + > +Examples: > +dcu: dcu@2ce0000 { > + compatible =3D "fsl,ls1021a-dcu"; > + reg =3D <0x0 0x2ce0000 0x0 0x10000>; > + clocks =3D <&platform_clk 0>; > + clock-names =3D "dcu"; > + big-endian; > + display =3D <&display>; > + > + display: display@0 { > + bits-per-pixel =3D <24>; > + > + display-timings { > + native-mode =3D <&timing0>; > + timing0: nl4827hc19 { > + clock-frequency =3D <10870000>; > + hactive =3D <480>; > + vactive =3D <272>; > + hback-porch =3D <2>; > + hfront-porch =3D <2>; > + vback-porch =3D <1>; > + vfront-porch =3D <1>; > + hsync-len =3D <41>; > + vsync-len =3D <2>; > + hsync-active =3D <1>; > + vsync-active =3D <1>; > + }; > + }; > + }; > +}; > diff --git a/MAINTAINERS b/MAINTAINERS > index 885be14..a6cff2f4 100644 > --- a/MAINTAINERS > +++ b/MAINTAINERS > @@ -3398,6 +3398,14 @@ S: Maintained > F: drivers/gpu/drm/imx/ > F: Documentation/devicetree/bindings/drm/imx/ > =20 > +DRM DRIVERS FOR FREESCALE DCU > +M: Jianwei Wang > +M: Alison Wang > +L: dri-devel@lists.freedesktop.org > +S: Supported > +F: drivers/gpu/drm/fsl-dcu/ > +F: Documentation/devicetree/bindings/drm/fsl-dcu/ > + > DRM DRIVERS FOR NVIDIA TEGRA > M: Thierry Reding > M: Terje Bergstr=C3=B6m > diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig index 15= 1a050..e64cf18 100644 > --- a/drivers/gpu/drm/Kconfig > +++ b/drivers/gpu/drm/Kconfig > @@ -199,6 +199,8 @@ source "drivers/gpu/drm/bochs/Kconfig" > =20 > source "drivers/gpu/drm/msm/Kconfig" > =20 > +source "drivers/gpu/drm/fsl-dcu/Kconfig" > + > source "drivers/gpu/drm/tegra/Kconfig" > =20 > source "drivers/gpu/drm/panel/Kconfig" > diff --git a/drivers/gpu/drm/Makefile b/drivers/gpu/drm/Makefile index = 2c239b9..398eccf 100644 > --- a/drivers/gpu/drm/Makefile > +++ b/drivers/gpu/drm/Makefile > @@ -56,6 +56,7 @@ obj-$(CONFIG_DRM_UDL) +=3D udl/ > obj-$(CONFIG_DRM_AST) +=3D ast/ > obj-$(CONFIG_DRM_ARMADA) +=3D armada/ > obj-$(CONFIG_DRM_ATMEL_HLCDC) +=3D atmel-hlcdc/ > +obj-$(CONFIG_DRM_FSL_DCU) +=3D fsl-dcu/ > obj-$(CONFIG_DRM_RCAR_DU) +=3D rcar-du/ > obj-$(CONFIG_DRM_SHMOBILE) +=3Dshmobile/ > obj-$(CONFIG_DRM_OMAP) +=3D omapdrm/ > diff --git a/drivers/gpu/drm/fsl-dcu/Kconfig b/drivers/gpu/drm/fsl-dcu/= Kconfig new file mode 100644 index 0000000..e4f8df0 > --- /dev/null > +++ b/drivers/gpu/drm/fsl-dcu/Kconfig > @@ -0,0 +1,17 @@ > +config DRM_FSL_DCU > + tristate "DRM Support for Freescale DCU" > + depends on DRM && OF && ARM > + select DRM_KMS_HELPER > + select DRM_KMS_CMA_HELPER > + select VIDEOMODE_HELPERS > + select BACKLIGHT_CLASS_DEVICE > + select BACKLIGHT_LCD_SUPPORT > + select REGMAP_MMIO > + select DRM_KMS_FB_HELPER > + select FB_SYS_FILLRECT > + select FB_SYS_COPYAREA > + select FB_SYS_IMAGEBLIT > + select FB_SYS_FOPS > + help > + Choose this option if you have an Freescale DCU chipset. > + If M is selected the module will be called fsl-dcu-drm. > diff --git a/drivers/gpu/drm/fsl-dcu/Makefile b/drivers/gpu/drm/fsl-dcu= /Makefile > new file mode 100644 > index 0000000..336b4a6 > --- /dev/null > +++ b/drivers/gpu/drm/fsl-dcu/Makefile > @@ -0,0 +1,7 @@ > +fsl-dcu-drm-y :=3D fsl_dcu_drm_drv.o \ > + fsl_dcu_drm_kms.o \ > + fsl_dcu_drm_connector.o \ > + fsl_dcu_drm_plane.o \ > + fsl_dcu_drm_crtc.o \ > + fsl_dcu_drm_fbdev.o > +obj-$(CONFIG_DRM_FSL_DCU) +=3D fsl-dcu-drm.o > diff --git a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_connector.c b/drivers/= gpu/drm/fsl-dcu/fsl_dcu_drm_connector.c > new file mode 100644 > index 0000000..799682d > --- /dev/null > +++ b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_connector.c > @@ -0,0 +1,194 @@ > +/* > + * Copyright 2015 Freescale Semiconductor, Inc. > + * > + * Freescale DCU drm device driver > + * > + * This program is free software; you can redistribute it and/or modif= y > + * it under the terms of the GNU General Public License as published b= y > + * the Free Software Foundation; either version 2 of the License, or > + * (at your option) any later version. > + */ > + > +#include > + > +#include > +#include > +#include