From patchwork Mon Mar 25 07:13:25 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrzej Hajda X-Patchwork-Id: 10868019 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 07F3D17EE for ; Mon, 25 Mar 2019 07:13:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E45142924E for ; Mon, 25 Mar 2019 07:13:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D8DAB2924F; Mon, 25 Mar 2019 07:13:57 +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 2497429246 for ; Mon, 25 Mar 2019 07:13:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729774AbfCYHN4 (ORCPT ); Mon, 25 Mar 2019 03:13:56 -0400 Received: from mailout1.w1.samsung.com ([210.118.77.11]:41892 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729720AbfCYHN4 (ORCPT ); Mon, 25 Mar 2019 03:13:56 -0400 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20190325071354euoutp01ea873b569e1b5eb8355338dbe4d87202~PIjtPsYkD0750607506euoutp01R; Mon, 25 Mar 2019 07:13:54 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20190325071354euoutp01ea873b569e1b5eb8355338dbe4d87202~PIjtPsYkD0750607506euoutp01R DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1553498034; bh=WyG/nfCXK0iOVixi8+dC+pBGTW7jqHuIew4ghXrqVuI=; h=From:To:Cc:Subject:Date:References:From; b=R+xMXmbUv5jm3Qx/2YH+DYco0ts0SUgOAKfiV0MmdHF9epfOiPjQHmUFH9MeZcBSw AC51jBt8ddWK7AxAi2G81EppeKQEH8dA6SczVhPMyuRfe7xwP88aDlqxTo+ddidtZ2 PptgrQy8W+a81SBKPdGdNNsQbaxpbR3gHQjlupx0= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20190325071354eucas1p18b0bf4e0563c80af47083eb92df720d9~PIjs2GpGH2082720827eucas1p1U; Mon, 25 Mar 2019 07:13:54 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id DD.5E.04298.1BF789C5; Mon, 25 Mar 2019 07:13:53 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20190325071353eucas1p185d973e14dac923aab381083b2b67445~PIjsO0z852091220912eucas1p1R; Mon, 25 Mar 2019 07:13:53 +0000 (GMT) X-AuditID: cbfec7f2-f2dff700000010ca-ae-5c987fb128a5 Received: from eusync3.samsung.com ( [203.254.199.213]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 00.69.04146.1BF789C5; Mon, 25 Mar 2019 07:13:53 +0000 (GMT) Received: from AMDC3748.DIGITAL.local ([106.120.51.74]) by eusync3.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0POW003QHUR43P00@eusync3.samsung.com>; Mon, 25 Mar 2019 07:13:53 +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 v3 RESEND 00/24] drm/exynos: add support for GSCALER planes on Exynos5433 Date: Mon, 25 Mar 2019 08:13:25 +0100 Message-id: <20190325071349.22600-1-a.hajda@samsung.com> X-Mailer: git-send-email 2.17.1 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFupikeLIzCtJLcpLzFFi42LZduzned2N9TNiDF60m1ncWneO1WLjjPWs Fle+vmezmHR/AovF+fMb2C1mnN/HZLH2yF12B3aPTas62Tzudx9n8ujbsorR4/MmuQCWKC6b lNSczLLUIn27BK6MqXMOMhZcVqlY/uw0SwNjp1wXIyeHhICJRMu+qaxdjFwcQgIrGCUmTtrI AuF8ZpR493QfE0zV36OtzCC2kMAyRomjHyohiv4zSuza+ZMdJMEmoCnxd/NNNhBbREBZYtW+ dnaQImaB34wS05dvAysSFoiWmNmxGsxmEVCV+PjmICOIzStgIbH+3Gx2iG3yEqs3HGAGaZYQ eMkq8WDDM6CpHECOi8SfKxwQNTISnR0Hoa6rl7i/ogWqvoNRYuuGncwQCWuJw8cvsoLYzAJ8 EpO2TWeGmMMr0dEmBFHiITHnchMrSFhIIFaipSluAqP4AkaGVYziqaXFuempxYZ5qeV6xYm5 xaV56XrJ+bmbGIExdPrf8U87GL9eSjrEKMDBqMTD+2Ln9Bgh1sSy4srcQ4wSHMxKIrxPRGfE CPGmJFZWpRblxxeV5qQWH2KU5mBREuetZngQLSSQnliSmp2aWpBaBJNl4uCUamCsvFSyNC7n bKLhh97AB5euxenm/9w/e0nD0edqBztk13vF71zmH9B0fuqfp7H8wlpbTUoD91pcnnB61pnf Tq/O2i2PauQx+bPZX+9Rfd/c9j/xR8TlTb1OTDOYeOMIR/2y+fujjsten+XX9Ov6hPfrL7+e vmtF6apFUp/5H/yOu+9q2MBTunlqsxJLcUaioRZzUXEiAIr3q4mdAgAA X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrNJMWRmVeSWpSXmKPExsVy+t/xq7ob62fEGBy5wm9xa905VouNM9az Wlz5+p7NYtL9CSwW589vYLeYcX4fk8XaI3fZHdg9Nq3qZPO4332cyaNvyypGj8+b5AJYorhs UlJzMstSi/TtErgyps45yFhwWaVi+bPTLA2MnXJdjJwcEgImEn+PtjJ3MXJxCAksYZTYtnka C4TTyCSxr+MGM0gVm4CmxN/NN9lAbBEBZYlV+9rZQYqYBX4zSnye8RWsSFggWmLC7lWsIDaL gKrExzcHGUFsXgELifXnZrNDrJOXWL3hAPMERq4FjAyrGEVSS4tz03OLDfWKE3OLS/PS9ZLz czcxAoNg27Gfm3cwXtoYfIhRgINRiYfXYc/0GCHWxLLiytxDjBIczEoivE9EZ8QI8aYkVlal FuXHF5XmpBYfYpTmYFES5z1vUBklJJCeWJKanZpakFoEk2Xi4JRqYKz8LSvxwcplo6R28ZSi wO1qIdZLPniJmdttL/694Xffwh2XtmXrv3v29Wr6FA6eg4+nuRxavVTA/q2TycFK1uLyw/wu Ej+T7beWnLJNnSv09wijmaf6wnc/5qtdjnL5de7plAfLdNkP8blOWFgtufGw2+F1IkazU37r 7F37SnHKJ+EGJ5XtxT+VWIozEg21mIuKEwEjm6Ag/gEAAA== X-CMS-MailID: 20190325071353eucas1p185d973e14dac923aab381083b2b67445 CMS-TYPE: 201P X-CMS-RootMailID: 20190325071353eucas1p185d973e14dac923aab381083b2b67445 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. It is rebased on today's exynos-drm-next. Please be aware that DTS patches has been already applied to samsung-soc tree, I left them here to simplify testing on exynos-drm-next, which is not in sync with samsung-soc, for this reason I have moved them on the beginning of the patchset. Regards Andrzej Andrzej Hajda (24): arm64: dts: exynos: configure GSCALER related clocks arm64: dts: exynos: add DSD/GSD clocks to DECONs and GSCALERs 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 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