From patchwork Wed Mar 20 13:06:43 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrzej Hajda X-Patchwork-Id: 10861561 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 29CBB1575 for ; Wed, 20 Mar 2019 13:07:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0E98829BEB for ; Wed, 20 Mar 2019 13:07:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 09E7729BE8; Wed, 20 Mar 2019 13:07:17 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E487728BCD for ; Wed, 20 Mar 2019 13:07:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726644AbfCTNHP (ORCPT ); Wed, 20 Mar 2019 09:07:15 -0400 Received: from mailout1.w1.samsung.com ([210.118.77.11]:55134 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726506AbfCTNHP (ORCPT ); Wed, 20 Mar 2019 09:07:15 -0400 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20190320130712euoutp017f596bf3d7e1a71962336f61438e9272~NrJwYBISh0192401924euoutp01a; Wed, 20 Mar 2019 13:07:12 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20190320130712euoutp017f596bf3d7e1a71962336f61438e9272~NrJwYBISh0192401924euoutp01a DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1553087232; bh=9ge11nRfGevkAU5h++3Syo0yzMjdUbxDEun5aZxcc3E=; h=From:To:Cc:Subject:Date:References:From; b=s3wDNNXcabGssIwW9CZe1UjdLzFHqwh5BK+pKG5PBa/uXYElZMeJ0IcbrvwQMjF6d AcaFR2HGwzT/h9ALofrblIHn1GBQBvUSQzfB/uKTGRWQzdruWGA8u9WhG3cA2DDuM8 lSWCgoCiKuMSpvI9CHQULnpkneC6hq9L/37Ogfm8= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20190320130712eucas1p20f03a823780731b775b9797197275d77~NrJwAvLIA1665816658eucas1p2K; Wed, 20 Mar 2019 13:07:12 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id 29.91.04294.00B329C5; Wed, 20 Mar 2019 13:07:12 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20190320130711eucas1p2b9f18d009647652b4bb912fdd40c9f74~NrJvX-jPc0212202122eucas1p2T; Wed, 20 Mar 2019 13:07:11 +0000 (GMT) X-AuditID: cbfec7f4-84fff700000010c6-a6-5c923b00fc0d Received: from eusync1.samsung.com ( [203.254.199.211]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 41.AF.04284.FFA329C5; Wed, 20 Mar 2019 13:07:11 +0000 (GMT) Received: from AMDC3748.DIGITAL.local ([106.120.43.17]) by eusync1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0POO004P71RZN460@eusync1.samsung.com>; Wed, 20 Mar 2019 13:07:11 +0000 (GMT) From: Andrzej Hajda To: Inki Dae Cc: Andrzej Hajda , Bartlomiej Zolnierkiewicz , Marek Szyprowski , dri-devel@lists.freedesktop.org, linux-samsung-soc@vger.kernel.org, Krzysztof Kozlowski Subject: [PATCH v2 RESEND 00/24] drm/exynos: add support for GSCALER planes on Exynos5433 Date: Wed, 20 Mar 2019 14:06:43 +0100 Message-id: <20190320130707.25161-1-a.hajda@samsung.com> X-Mailer: git-send-email 2.17.1 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFuplkeLIzCtJLcpLzFFi42LZduzneV0G60kxBj9XiVjcWneO1WLjjPWs Fle+vmezmHR/AovF+fMb2C1mnN/HZLH2yF12B3aPTas62Tzudx9n8ujbsorR4/MmuQCWKC6b lNSczLLUIn27BK6MjbfmMhVsVKrYuvE5SwPjHJkuRk4OCQETif9Xl7N3MXJxCAmsYJRoPbWG CcL5zCjRs/gwC0zV9s0v2CASyxgl+g6+hnL+M0qcOrCeGaSKTUBT4u/mm2wgtoiAssSqfe1g c5kFfjNKTF++jR0kISwQLbHgaA9YA4uAqsT+Yz1gDbwCFhJLrk5ihlgnL7F6wwFmkGYJgZes ElNanzNCJFwkmmcsZIKwZSQ6Ow5C2fUS91e0QDV0MEps3bATapK1xOHjF1lBbGYBPolJ26YD xTmA4rwSHW1CECUeEkuOXgE7TkggVuLjyQlMExjFFzAyrGIUTy0tzk1PLTbKSy3XK07MLS7N S9dLzs/dxAiMpNP/jn/ZwbjrT9IhRgEORiUe3gvPJ8QIsSaWFVfmHmKU4GBWEuGNUJoUI8Sb klhZlVqUH19UmpNafIhRmoNFSZy3muFBtJBAemJJanZqakFqEUyWiYNTqoFR2tXzbpa/ocxL 1Y1S8c+qdy0Wbot8/s64523wudjF7ezfZ/70vTNnQYXFknqJZ4e1l2ycsFlZNSbstaOLf++2 l95329+9Dpm+pPNV0hy2dHlu9SLDU/P++7TU/m5Ycfbf+j0ul11Sev9FyJfLpgpMOWxqr9pp oqDRsOGH/FeGxS8CY/49nrROiaU4I9FQi7moOBEA/O5YhqACAAA= X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrNJMWRmVeSWpSXmKPExsVy+t/xy7r/rSbFGMyfZGxxa905VouNM9az Wlz5+p7NYtL9CSwW589vYLeYcX4fk8XaI3fZHdg9Nq3qZPO4332cyaNvyypGj8+b5AJYorhs UlJzMstSi/TtErgyNt6ay1SwUali68bnLA2Mc2S6GDk5JARMJLZvfsHWxcjFISSwhFHi+qw9 LBBOI5PEziNnWEGq2AQ0Jf5uvskGYosIKEus2tfODlLELPCbUeLzjK/MIAlhgWiJHdPXMYHY LAKqEvuP9YA18ApYSCy5OokZYp28xOoNB5gnMHItYGRYxSiSWlqcm55bbKhXnJhbXJqXrpec n7uJERgE24793LyD8dLG4EOMAhyMSjy8FU8nxAixJpYVV+YeYpTgYFYS4Y1QmhQjxJuSWFmV WpQfX1Sak1p8iFGag0VJnPe8QWWUkEB6YklqdmpqQWoRTJaJg1OqgXHC+0NTVji/6Thr3fV/ mvSXnUtOi6u7ckQ/2P3/Qu/egCTVR+0lfkkHBVfl+v3coZTRVrrXZGMjb3RDabHRyWvmp+a9 PM7QVdu22HEtS+XexeWPdx17smrrQkm3akfX6zIX22Zfe/9k9pdfX0zfTOB8Ert+etJ/80uX vG6xtH8RZqxumzHb7ku9EktxRqKhFnNRcSIA8rd9zP4BAAA= X-CMS-MailID: 20190320130711eucas1p2b9f18d009647652b4bb912fdd40c9f74 CMS-TYPE: 201P X-CMS-RootMailID: 20190320130711eucas1p2b9f18d009647652b4bb912fdd40c9f74 References: Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Hi Inki, GSCALERs in Exynos SoCs support conversion between wide range of image formats, plus scaling and rotation. Driver already supports mem2mem mode - via ExynosDRM IPP framework. This patchset adds support for mem to display mode - framebuffers can be converted, scaled and send directly to Display Controller. From DRM framework's point of view every GSCALER exposes drm_plane which can be connected to display controller (display panel or TV). The feature is not well documented so the development was quite difficult - a process of trial and error, vendor code analysis, guessing from datasheets. Hopefully most of the issues were solved. I have developed and tested it on TM2 device with panel and TV paths. The patchset contains three parts: 1. Preparatory patches - mostly cleanup and refactoring of drm_crtc and drm_plane related structures, to allow usage of planes which are not physically bound to crtcs (01-13). 2. Adding local path support to GSCALER and DECON (14-20). 3. Few fixes of bugs existing already in the code but discovered due to added local path support (21-23). The patchset is based on exynos_drm_next plus my patchset adding zpos to DECON and FIMD - 'drm/exynos: add support for dynamic zpos in DECON and FIMD' - it is required to allow set z-pos position of GSCALER planes. To simplify tests I have also created branch containing all required patches: Repo: https://git.tizen.org/cgit/platform/kernel/linux-exynos Branch: sandbox/ahajda/dev/exynos-drm-local-path This is v2 version of the patchset. In this version I have moved code setting cursor plane in crtc to separate patch together with code disabling fast cursor updates - hardware does not support it. To keep bisectability DTS patches should be applied before subsequent ones. Regards Andrzej Andrzej Hajda (24): drm/exynos: remove exynos_drm_plane.h header drm/exynos: remove spare macro drm/exynos: drop exynos_drm_plane_config structure drm/exynos: add exynos_drm_crtc_init function drm/exynos/decon5433: embed exynos_drm_crtc directly into context drm/exynos/decon7: embed exynos_drm_crtc directly into context drm/exynos/fimd: embed exynos_drm_crtc directly into context drm/exynos/mixer: embed exynos_drm_crtc directly into context drm/exynos/vidi: embed exynos_drm_crtc directly into context drm/exynos: remove standalone exynos_drm_crtc leftovers drm/exynos/vidi: remove encoder_to_vidi helper drm/exynos: unify plane type assignment drm/exynos: set primary plane in exynos_drm_crtc_init drm/exynos: set cursor plane in exynos_drm_crtc_init drm/exynos: add plane update/disable callbacks for planes drm/exynos: add GSCALER plane capability drm/exynos/gscaler: fix id assignement arm64: dts: exynos: configure GSCALER related clocks arm64: dts: exynos: add DSD/GSD clocks to DECONs and GSCALERs drm/exynos/gscaler: add local path support drm/exynos/decon5433: add local path support drm/exynos/decon5433: wait for finish previous update drm/exynos/gscaler: change supported color format BGRX8888 to XBGR8888 drm/exynos/gscaler: fix handling YVU420 pixel format .../dts/exynos/exynos5433-tm2-common.dtsi | 6 + arch/arm64/boot/dts/exynos/exynos5433-tm2.dts | 6 +- arch/arm64/boot/dts/exynos/exynos5433.dtsi | 25 +- drivers/gpu/drm/exynos/exynos5433_drm_decon.c | 162 ++++++++----- drivers/gpu/drm/exynos/exynos7_drm_decon.c | 66 +++-- drivers/gpu/drm/exynos/exynos_drm_crtc.c | 46 ++-- drivers/gpu/drm/exynos/exynos_drm_crtc.h | 7 +- drivers/gpu/drm/exynos/exynos_drm_drv.c | 1 - drivers/gpu/drm/exynos/exynos_drm_drv.h | 50 ++-- drivers/gpu/drm/exynos/exynos_drm_fb.c | 10 +- drivers/gpu/drm/exynos/exynos_drm_fimd.c | 85 +++---- drivers/gpu/drm/exynos/exynos_drm_gsc.c | 229 ++++++++++++++---- drivers/gpu/drm/exynos/exynos_drm_plane.c | 84 ++++--- drivers/gpu/drm/exynos/exynos_drm_plane.h | 14 -- drivers/gpu/drm/exynos/exynos_drm_vidi.c | 48 ++-- drivers/gpu/drm/exynos/exynos_mixer.c | 95 +++----- drivers/gpu/drm/exynos/regs-decon5433.h | 6 + drivers/gpu/drm/exynos/regs-gsc.h | 6 + 18 files changed, 538 insertions(+), 408 deletions(-) delete mode 100644 drivers/gpu/drm/exynos/exynos_drm_plane.h