From patchwork Fri Apr 10 06:37:21 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hyungwon Hwang X-Patchwork-Id: 6192071 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id BF766BF4A6 for ; Fri, 10 Apr 2015 06:37:34 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id BAD802037A for ; Fri, 10 Apr 2015 06:37:32 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 399072035E for ; Fri, 10 Apr 2015 06:37:30 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7C8CA6E042; Thu, 9 Apr 2015 23:37:29 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mailout4.samsung.com (mailout4.samsung.com [203.254.224.34]) by gabe.freedesktop.org (Postfix) with ESMTP id 6B4F16E042 for ; Thu, 9 Apr 2015 23:37:27 -0700 (PDT) Received: from epcpsbgr4.samsung.com (u144.gpu120.samsung.co.kr [203.254.230.144]) by mailout4.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0NMK007TWVQEN690@mailout4.samsung.com> for dri-devel@lists.freedesktop.org; Fri, 10 Apr 2015 15:37:26 +0900 (KST) Received: from epcpsbgm1.samsung.com ( [172.20.52.116]) by epcpsbgr4.samsung.com (EPCPMTA) with SMTP id 69.35.20564.5AF67255; Fri, 10 Apr 2015 15:37:26 +0900 (KST) X-AuditID: cbfee690-f796f6d000005054-2a-55276fa5a400 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id EB.1F.25346.5AF67255; Fri, 10 Apr 2015 15:37:25 +0900 (KST) Received: from localhost.localdomain ([10.252.82.145]) by mmp1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0NMK00J4RVQA7KL0@mmp1.samsung.com>; Fri, 10 Apr 2015 15:37:25 +0900 (KST) From: Hyungwon Hwang To: dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, inki.dae@samsung.com, daniel@fooishbar.org Subject: [PATCH v6] drm/exynos: add Exynos5433 decon driver Date: Fri, 10 Apr 2015 15:37:21 +0900 Message-id: <1428647841-22136-1-git-send-email-human.hwang@samsung.com> X-Mailer: git-send-email 1.9.1 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrCLMWRmVeSWpSXmKPExsWyRsSkRHdZvnqowc6PHBbXvzxntbjSOp3V Yv6Rc6wW18/bWVz5+p7NYumMPlaLSfcnsFi8uHeRxWLG5JdsFic75jA6cHm8+LqN2WPnrLvs Hve7jzN59G1ZxejxeZNcAGsUl01Kak5mWWqRvl0CV8bcrkbWgp93GCt2v9vC2MB4dCtjFyMn h4SAicS3y9PYIWwxiQv31rN1MXJxCAksZZQ4//ANC0zRp6u9LBCJRYwSq5+dZgJJCAn8YJRY dEACxGYT0JNYcO0H2CQRgVyJ/hcvmEAamAWWMUrcvn0ZrEFYwFpiSuszMJtFQFXi3dxZzCA2 r4C7xPHXn1khtslJnDw2mRWkWUJgOrtE8/v/rBANAhLfJh8COoMDKCErsekAM0S9pMTBFTdY JjAKLmBkWMUomlqQXFCclF5kolecmFtcmpeul5yfu4kRGNin/z2bsIPx3gHrQ4wCHIxKPLwN seqhQqyJZcWVuYcYTYE2TGSWEk3OB8ZPXkm8obGZkYWpiamxkbmlmZI472upn8FCAumJJanZ qakFqUXxRaU5qcWHGJk4OKUaGDu81q7pO3i2v/tn+JGkieHcSzN7G7euPaq/wbKxMPixtU6u VVDEC2MJ2/0Nv4WPyGctmOB+tth3XiDr1edGG1/PVD8S8zdrffPLadGuNpyH+XP0jN+EXf4U k1jgtFLo7sPf63g+HZi9MqErK/OoROjivDf+flf07wT8ClR5+lPRm+vTrYvftymxFGckGmox FxUnAgC1dmwhZwIAAA== X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprHIsWRmVeSWpSXmKPExsVy+t9jAd2l+eqhBgdmG1tc//Kc1eJK63RW i/lHzrFaXD9vZ3Hl63s2i6Uz+lgtJt2fwGLx4t5FFosZk1+yWZzsmMPowOXx4us2Zo+ds+6y e9zvPs7k0bdlFaPH501yAaxRDYw2GamJKalFCql5yfkpmXnptkrewfHO8aZmBoa6hpYW5koK eYm5qbZKLj4Bum6ZOUBXKSmUJeaUAoUCEouLlfTtME0IDXHTtYBpjND1DQmC6zEyQAMJaxgz 5nY1shb8vMNYsfvdFsYGxqNbGbsYOTkkBEwkPl3tZYGwxSQu3FvP1sXIxSEksIhRYvWz00wg CSGBH4wSiw5IgNhsAnoSC679YAexRQRyJfpfvGACaWAWWMYocfv2ZbAGYQFriSmtz8BsFgFV iXdzZzGD2LwC7hLHX39mhdgmJ3Hy2GTWCYzcCxgZVjGKphYkFxQnpeca6hUn5haX5qXrJefn bmIEx80zqR2MKxssDjEKcDAq8fDeiFcPFWJNLCuuzD3EKMHBrCTCWxkLFOJNSaysSi3Kjy8q zUktPsRoCrR9IrOUaHI+MKbzSuINjU3MjCyNzA0tjIzNlcR55+jKhQoJpCeWpGanphakFsH0 MXFwSjUwRlwI63A906T3NM3y1SQx/efe/AK68u1K25Ju3tIzKvEImftvsWlHwuJlfVc6+05k 7MieUVVn+kjniOfbD56bvTcdcH3O9SpU843H4o5DUdGexi4SGo8YD98W9tcz+H3QTOyS0CR3 ncU7nkZ6O9p/yJp4WOB43spJPey6BwyMTTtvbbvLWHZViaU4I9FQi7moOBEAKBSSArECAAA= DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected Cc: sw0312.kim@samsung.com, varkabhadram@gmail.com, dh09.lee@samsung.com, cw00.choi@samsung.com, Hyungwon Hwang X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00,FUZZY_XPILL, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Joonyoung Shim DECON(Display and Enhancement Controller) is new IP replacing FIMD in Exynos5433. This patch adds Exynos5433 decon driver. Signed-off-by: Joonyoung Shim Signed-off-by: Hyungwon Hwang --- Changes for v2: - change file names and variable names of decon to represnt exynos5433 instead of exynos to distinguish them from exynos7 decon Changes for v3: - fail fast when the proper image format is not set - remove unnecessary checking code - add and modify the function to make DPMS work well Changes for v4: - rebased to exynos-drm-next with the clean-up patchset by Gustavo Padovan. Changes for v5: - None Changes for v6: - None .../devicetree/bindings/video/exynos5433-decon.txt | 65 +++ drivers/gpu/drm/exynos/Kconfig | 6 + drivers/gpu/drm/exynos/Makefile | 1 + drivers/gpu/drm/exynos/exynos5433_drm_decon.c | 611 +++++++++++++++++++++ drivers/gpu/drm/exynos/exynos_drm_drv.c | 3 + drivers/gpu/drm/exynos/exynos_drm_drv.h | 1 + include/video/exynos5433_decon.h | 163 ++++++ 7 files changed, 850 insertions(+) create mode 100644 Documentation/devicetree/bindings/video/exynos5433-decon.txt create mode 100644 drivers/gpu/drm/exynos/exynos5433_drm_decon.c create mode 100644 include/video/exynos5433_decon.h -- 1.9.1 diff --git a/Documentation/devicetree/bindings/video/exynos5433-decon.txt b/Documentation/devicetree/bindings/video/exynos5433-decon.txt new file mode 100644 index 0000000..377afbf --- /dev/null +++ b/Documentation/devicetree/bindings/video/exynos5433-decon.txt @@ -0,0 +1,65 @@ +Device-Tree bindings for Samsung Exynos SoC display controller (DECON) + +DECON (Display and Enhancement Controller) is the Display Controller for the +Exynos 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,exynos5433-decon"; +- reg: physical base address and length of the DECON registers set. +- interrupts: should contain a list of all DECON IP block interrupts in the + order: VSYNC, LCD_SYSTEM. The interrupt specifier format + depends on the interrupt controller used. +- interrupt-names: should contain the interrupt names: "vsync", "lcd_sys" + in the same order as they were listed in the interrupts + property. +- clocks: must include clock specifiers corresponding to entries in the + clock-names property. +- clock-names: list of clock names sorted in the same order as the clocks + property. Must contain "aclk_decon", "aclk_smmu_decon0x", + "aclk_xiu_decon0x", "pclk_smmu_decon0x", clk_decon_vclk", + "sclk_decon_eclk" +- ports: contains a port which is connected to mic node. address-cells and + size-cells must 1 and 0, respectively. +- port: contains an endpoint node which is connected to the endpoint in the mic + node. The reg value muset be 0. +- i80-if-timings: specify whether the panel which is connected to decon uses + i80 lcd interface or mipi video interface. This node contains + no timing information as that of fimd does. Because there is + no register in decon to specify i80 interface timing value, + it is not needed, but make it remain to use same kind of node + in fimd and exynos7 decon. + +Example: +SoC specific DT entry: +decon: decon@13800000 { + compatible = "samsung,exynos5433-decon"; + reg = <0x13800000 0x2104>; + clocks = <&cmu_disp CLK_ACLK_DECON>, <&cmu_disp CLK_ACLK_SMMU_DECON0X>, + <&cmu_disp CLK_ACLK_XIU_DECON0X>, + <&cmu_disp CLK_PCLK_SMMU_DECON0X>, + <&cmu_disp CLK_SCLK_DECON_VCLK>, + <&cmu_disp CLK_SCLK_DECON_ECLK>; + clock-names = "aclk_decon", "aclk_smmu_decon0x", "aclk_xiu_decon0x", + "pclk_smmu_decon0x", "sclk_decon_vclk", "sclk_decon_eclk"; + interrupt-names = "vsync", "lcd_sys"; + interrupts = <0 202 0>, <0 203 0>; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + decon_to_mic: endpoint { + remote-endpoint = <&mic_to_decon>; + }; + }; + }; +}; + +Board specific DT entry: +&decon { + i80-if-timings { + }; +}; diff --git a/drivers/gpu/drm/exynos/Kconfig b/drivers/gpu/drm/exynos/Kconfig index 0a67803..dd6ae21 100644 --- a/drivers/gpu/drm/exynos/Kconfig +++ b/drivers/gpu/drm/exynos/Kconfig @@ -24,6 +24,12 @@ config DRM_EXYNOS_FIMD help Choose this option if you want to use Exynos FIMD for DRM. +config DRM_EXYNOS5433_DECON + bool "Exynos5433 DRM DECON" + depends on DRM_EXYNOS + help + Choose this option if you want to use Exynos5433 DECON for DRM. + config DRM_EXYNOS7_DECON bool "Exynos DRM DECON" depends on DRM_EXYNOS diff --git a/drivers/gpu/drm/exynos/Makefile b/drivers/gpu/drm/exynos/Makefile index cc90679..fbd084d 100644 --- a/drivers/gpu/drm/exynos/Makefile +++ b/drivers/gpu/drm/exynos/Makefile @@ -10,6 +10,7 @@ exynosdrm-y := exynos_drm_drv.o exynos_drm_encoder.o \ exynosdrm-$(CONFIG_DRM_EXYNOS_IOMMU) += exynos_drm_iommu.o exynosdrm-$(CONFIG_DRM_EXYNOS_FIMD) += exynos_drm_fimd.o +exynosdrm-$(CONFIG_DRM_EXYNOS5433_DECON) += exynos5433_drm_decon.o exynosdrm-$(CONFIG_DRM_EXYNOS7_DECON) += exynos7_drm_decon.o exynosdrm-$(CONFIG_DRM_EXYNOS_DPI) += exynos_drm_dpi.o exynosdrm-$(CONFIG_DRM_EXYNOS_DSI) += exynos_drm_dsi.o diff --git a/drivers/gpu/drm/exynos/exynos5433_drm_decon.c b/drivers/gpu/drm/exynos/exynos5433_drm_decon.c new file mode 100644 index 0000000..02cade4 --- /dev/null +++ b/drivers/gpu/drm/exynos/exynos5433_drm_decon.c @@ -0,0 +1,611 @@ +/* drivers/gpu/drm/exynos5433_drm_decon.c + * + * Copyright (C) 2015 Samsung Electronics Co.Ltd + * Authors: + * Joonyoung Shim + * Hyungwon Hwang + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundationr + */ + +#include +#include +#include +#include + +#include