From mboxrd@z Thu Jan 1 00:00:00 1970 From: Inki Dae Subject: Re: [RFC PATCH] drm/exynos: Add DECON driver Date: Mon, 03 Nov 2014 19:01:30 +0900 Message-ID: <5457527A.7070007@samsung.com> References: <1412945316-26877-1-git-send-email-ajaykumar.rs@samsung.com> <5447C5AB.9090900@samsung.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Return-path: Received: from mailout2.samsung.com ([203.254.224.25]:58605 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750826AbaKCKBe convert rfc822-to-8bit (ORCPT ); Mon, 3 Nov 2014 05:01:34 -0500 In-reply-to: Sender: linux-samsung-soc-owner@vger.kernel.org List-Id: linux-samsung-soc@vger.kernel.org To: Ajay kumar Cc: Ajay Kumar , "dri-devel@lists.freedesktop.org" , "linux-samsung-soc@vger.kernel.org" , "devicetree@vger.kernel.org" , Joonyoung Shim , Kukjin Kim , Sean Paul , Jingoo Han , Prashanth G , "cpgs ." Hi, =46ortunately, I could get the user manual for Exynos7420. Below are my comments. Thanks, Inki Dae On 2014=EB=85=84 10=EC=9B=94 23=EC=9D=BC 01:34, Ajay kumar wrote: > On Wed, Oct 22, 2014 at 8:26 PM, Inki Dae wrot= e: >> >> Thanks for contribution. >> >> It seems reasonable that you separate device drivers into FIMD and D= ECON >> because many registers of them have many different offsets and field= s. >> However, there may be a good solution that we can combine common set= s of >> these drivers later. > Yes, this is the main reason behind sending this as RFC patch. > I want to know what's the best way to do this. > FIMD, 5433 DECON and Exynos7 DECON - all are different. > Also, in Exynos7 DECON-INT is same as DECON-EXT(Mixer). > So, even I am not sure how the driver layouts should be! Please, make sure Exynos SoC name, Exynos7410 or Exynos7420. In my understanding, Exynos7 doesn't mean one real SoC. >=20 >> Below are my comments. >> >> Thanks, >> Inki Dae >> >> On 2014=EB=85=84 10=EC=9B=94 10=EC=9D=BC 21:48, Ajay Kumar wrote: >>> This series is based on exynos-drm-next branch of Inki Dae's tree a= t: >>> git://git.kernel.org/pub/scm/linux/kernel/git/daeinki/drm-exynos.gi= t >>> >>> DECON(Display and Enhancement Controller) is the new IP >>> in exynos7 SOC for generating video signals using pixel data. >> >> DECON was used since Exynos5430. And is Exynos5433 different from >> Exynos7? If so, could I get the Exynos7 user manual (TRM) for review= ? > Yes, Exynos5433 DECON is very much different than Exynos7 DECON. Do not use Exynos7 word and use Exynos7410 or Exynos7420 instead. > I will see how manual can be arranged. >=20 >>> >>> DECON driver can be used to drive 2 different interfaces on Exynos7= : >>> DECON-INT(video controller) and DECON-EXT(Mixer for HDMI) >>> >>> The existing FIMD driver code was used as a template to create >>> DECON driver. Only DECON-INT is supported as of now, and >>> DECON-EXT support will be added later. >>> >>> Signed-off-by: Akshu Agrawal >>> Signed-off-by: Ajay Kumar >>> --- >>> .../devicetree/bindings/video/exynos-decon.txt | 68 ++ >>> drivers/gpu/drm/exynos/Kconfig | 11 +- >>> drivers/gpu/drm/exynos/Makefile | 1 + >>> drivers/gpu/drm/exynos/exynos_drm_decon.c | 1086 >> ++++++++++++++++++++ >>> drivers/gpu/drm/exynos/exynos_drm_drv.c | 17 +- >>> drivers/gpu/drm/exynos/exynos_drm_drv.h | 11 + >>> include/video/samsung_decon.h | 346 +++++++ >>> 7 files changed, 1537 insertions(+), 3 deletions(-) >>> create mode 100644 >> Documentation/devicetree/bindings/video/exynos-decon.txt >>> create mode 100644 drivers/gpu/drm/exynos/exynos_drm_decon.c >>> create mode 100644 include/video/samsung_decon.h >>> >>> diff --git a/Documentation/devicetree/bindings/video/exynos-decon.t= xt >> b/Documentation/devicetree/bindings/video/exynos-decon.txt >>> new file mode 100644 >>> index 0000000..e865650 >>> --- /dev/null >>> +++ b/Documentation/devicetree/bindings/video/exynos-decon.txt >>> @@ -0,0 +1,68 @@ >>> +Device-Tree bindings for Samsung Exynos7 SoC display controller (D= ECON) >>> + >>> +DECON (Display and Enhancement Controller) is the Display Controll= er >> for the >>> +Exynos7 series of SoCs which transfers the image data from a video= memory >>> +buffer to an external LCD interface. >>> + >>> +Required properties: >>> +- compatible: value should be "samsung,exynos7-decon"; >> >> If exynos5433 was just renamed to exynos7 then, it should be one of = the >> following: >> (a) "samsung,exynos5430-decon" for Display and enhancement c= ontroller >> IP for Exynos5430 >> (b) "samsung,exynos7" for Display and enhancement controller= IP for Exynos7 >> >> Or, >> (a) "samsung,exynos5430-decon" for Display and enhancement c= ontroller >> IP for Exynos5430 >> >> (b) "samsung,exynos5433-decon" for Display and enhancement c= ontroller >> IP for Exynos5433 >> (c) "samsung,exynos7" for Display and enhancement controller= IP for Exynos7 > Eventually, we will end up here. >=20 >> >>> + >>> +- reg: physical base address and length of the DECON registers set= =2E >>> + >>> +- interrupt-parent: should be the phandle of the decon controller'= s >>> + parent interrupt controller. >>> + >>> +- interrupts: should contain a list of all DECON IP block interrup= ts >> in the >>> + order: FIFO Level, VSYNC, LCD_SYSTEM. The interrupt = specifier >>> + format depends on the interrupt controller used. >>> + >>> +- interrupt-names: should contain the interrupt names: "fifo", "vs= ync", >>> + "lcd_sys", in the same order as they were listed in the inter= rupts >>> + property. >>> + >>> +- pinctrl-0: pin control group to be used for this controller. >>> + >>> +- pinctrl-names: must contain a "default" entry. >>> + >>> +- clocks: must include clock specifiers corresponding to entries i= n the >>> + clock-names property. >>> + >>> +- clock-names: list of clock names sorted in the same order as the= clocks >>> + property. Must contain "pclk_decon0", "aclk_decon0"= , >>> + "decon0_eclk", "decon0_vclk", "sclk_dsd", aclk_lh_disp= 0", >>> + "aclk_disp", "aclk_lh_disp1". >> >> Should DECON driver really control above all clocks? I think it's en= ough >> that DECON driver controls only lcd and bus clocks, and others could= be >> configured by boot-loader or by calling clk_set_rate. > Yes, even I am not sure of the clocks. I have copied these clocks fro= m intrnal > android code. >>> + >>> +Optional Properties: >>> +- samsung,power-domain: a phandle to DECON power domain node. >> >> You are missing many properties, >> samsung,invert-vden >> samsung,invert-vclk > These are not present in Exynos7 DECON! What does the CRCCTRL register mean? That definitely indicates above properties. >=20 >> display-timings >> ... >> refer to below document, >> Documentation/devicetree/bindings/video/samsung-fimd.txt >> >>> + >>> +Example: >>> + >>> +SoC specific DT entry: >>> + >>> + decon@13930000 { In case of Exynos7420, the base address of the DECON controller is 0x13950000. Does 0x1393000 mean the one for Exynos7410? >>> + compatible =3D "samsung,exynos7-decon"; Therefore, it should be "samsung,exynos7410-decon" or "samsung,exynos7420-decon" >>> + interrupt-parent =3D <&combiner>; >>> + reg =3D <0x13930000 0x1000>; >>> + interrupt-names =3D "lcd_sys", "vsync", "fifo"; >>> + interrupts =3D <0 188 0>, <0 189 0>, <0 190 0>; >>> + clocks =3D <&clock_disp PCLK_DECON_INT>, >>> + <&clock_disp ACLK_DECON_INT>, >>> + <&clock_disp SCLK_DECON_INT_ECLK>, >>> + <&clock_disp SCLK_DECON_INT_EXTCLKPLL>, >>> + <&clock_disp SCLK_DSD>, >>> + <&clock_bus0 ACLK_LH_DISP0>, >>> + <&clock_disp ACLK_CP_DISP>, >>> + <&clock_bus0 ACLK_LH_DISP1>; >>> + clock-names =3D "pclk_decon0", "aclk_decon0", "decon0= _eclk", >>> + "decon0_vclk", "sclk_dsd", "aclk_lh_d= isp0", >>> + "aclk_disp", "aclk_lh_disp1"; >>> + status =3D "disabled"; >>> + }; >>> + >>> +Board specific DT entry: >>> + >>> + decon@13930000 { >>> + pinctrl-0 =3D <&lcd_clk &pwm1_out>; >>> + pinctrl-names =3D "default"; >>> + status =3D "okay"; >>> + }; >>> diff --git a/drivers/gpu/drm/exynos/Kconfig >> b/drivers/gpu/drm/exynos/Kconfig >>> index fd1c070..89275ea 100644 >>> --- a/drivers/gpu/drm/exynos/Kconfig >>> +++ b/drivers/gpu/drm/exynos/Kconfig >>> @@ -31,6 +31,13 @@ config DRM_EXYNOS_FIMD >>> help >>> Choose this option if you want to use Exynos FIMD for DRM. >>> >>> +config DRM_EXYNOS_DECON >>> + bool "Exynos DRM DECON" >>> + depends on DRM_EXYNOS >>> + select FB_MODE_HELPERS >>> + help >>> + Choose this option if you want to use Exynos DECON for DRM. >>> + >>> config DRM_EXYNOS_DPI >>> bool "EXYNOS DRM parallel output support" >>> depends on DRM_EXYNOS_FIMD >>> @@ -41,7 +48,7 @@ config DRM_EXYNOS_DPI >>> >>> config DRM_EXYNOS_DSI >>> bool "EXYNOS DRM MIPI-DSI driver support" >>> - depends on DRM_EXYNOS_FIMD >>> + depends on (DRM_EXYNOS_FIMD || DRM_EXYNOS_DECON) >>> select DRM_MIPI_DSI >>> select DRM_PANEL >>> default n >>> @@ -50,7 +57,7 @@ config DRM_EXYNOS_DSI >>> >>> config DRM_EXYNOS_DP >>> bool "EXYNOS DRM DP driver support" >>> - depends on DRM_EXYNOS_FIMD && ARCH_EXYNOS && (DRM_PTN3460=3Dn= || >> DRM_PTN3460=3Dy || DRM_PTN3460=3DDRM_EXYNOS) >>> + depends on (DRM_EXYNOS_FIMD || DRM_EXYNOS_DECON) && ARCH_EXYN= OS && >> (DRM_PTN3460=3Dn || DRM_PTN3460=3Dy || DRM_PTN3460=3DDRM_EXYNOS) >>> default DRM_EXYNOS >>> select DRM_PANEL >>> help >>> diff --git a/drivers/gpu/drm/exynos/Makefile >> b/drivers/gpu/drm/exynos/Makefile >>> index 33ae365..c3282ac 100644 >>> --- a/drivers/gpu/drm/exynos/Makefile >>> +++ b/drivers/gpu/drm/exynos/Makefile >>> @@ -11,6 +11,7 @@ exynosdrm-y :=3D exynos_drm_drv.o exynos_drm_enco= der.o \ >>> exynosdrm-$(CONFIG_DRM_EXYNOS_IOMMU) +=3D exynos_drm_iommu.o >>> exynosdrm-$(CONFIG_DRM_EXYNOS_DMABUF) +=3D exynos_drm_dmabuf.o >>> exynosdrm-$(CONFIG_DRM_EXYNOS_FIMD) +=3D exynos_drm_fimd.o >>> +exynosdrm-$(CONFIG_DRM_EXYNOS_DECON) +=3D exynos_drm_decon.o >>> exynosdrm-$(CONFIG_DRM_EXYNOS_DPI) +=3D exynos_drm_dpi.o >>> exynosdrm-$(CONFIG_DRM_EXYNOS_DSI) +=3D exynos_drm_dsi.o >>> exynosdrm-$(CONFIG_DRM_EXYNOS_DP) +=3D exynos_dp_core.o exynos_= dp_reg.o >>> diff --git a/drivers/gpu/drm/exynos/exynos_drm_decon.c >> b/drivers/gpu/drm/exynos/exynos_drm_decon.c >>> new file mode 100644 >>> index 0000000..5ac4557 >>> --- /dev/null >>> +++ b/drivers/gpu/drm/exynos/exynos_drm_decon.c >>> @@ -0,0 +1,1086 @@ >>> +/* exynos_drm_decon.c >>> + * >>> + * Copyright (C) 2014 Samsung Electronics Co.Ltd >>> + * Authors: >>> + * Akshu Agarwal >>> + * Ajay Kumar >>> + * >>> + * This program is free software; you can redistribute it and/or >> modify it >>> + * under the terms of the GNU General Public License as publish= ed >> 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