From patchwork Tue Oct 17 11:07:43 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 116062 Delivered-To: patch@linaro.org Received: by 10.140.22.163 with SMTP id 32csp4747993qgn; Tue, 17 Oct 2017 04:08:16 -0700 (PDT) X-Google-Smtp-Source: AOwi7QBIrxPwKd9fbd+hCC/T3atmx7W/Xfp6oH+f8+tOUoVJOh0IAM3sNFf0bUt5+iZtK0wyOJrJ X-Received: by 10.99.129.199 with SMTP id t190mr10708163pgd.227.1508238496598; Tue, 17 Oct 2017 04:08:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1508238496; cv=none; d=google.com; s=arc-20160816; b=LDSDTee2lXGer3tgJQZTlav4YIV+w4nw0xx/vicKbr4RQqmu23bauYxVXAnbfWFJA+ PNWfU2rIpT2w8osF5NxrcAEU8GjcLOzbQEygv1yCQLDpWBCyvaCKiWpmNORup5ILqkb+ z3nKtAW9xv/rvi+dvMM9pHmW4rYiuEQtn5TsSLQLe36ZBATdJIpEOrijHZyZcLjeA+Bw ZZbpjTn4ySvi6wxRFwbmJwGc6T8Je4cj1284HjJkMcmycDeYDXmUij70dYI/PWBP9fjg UegM4y8lxeO4LXoeJt5Cs5QyBQmlFX8FvjlFZnWn6pK+ayFxyA/tnIE4le0NNviahVEK R8Kw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:cms-type:message-id:date :subject:cc:to:from:arc-authentication-results; bh=qC/rs6TgRXh58xsuwPk4PCJoTnoHVV/hRTBl393YqdA=; b=aKkf+lWmnLvDlywTgq2q6DBGipiv5E6VGNu1D2aAXexZsvVeo/RK7OZYp8jueGDF57 ZQI4ygKeKrbpp4soTsFgRN1sboh22MdxCMKN9WgQlPcX8EP0NAMkhUlj0w33UIulmkjh /QWwb0lHsthzzjzzBMALdFH/+/v1QEx79VoSgdr5GBKl3iV9aDqyR99ocYeqG2BFGzpE 8CCiReDAxm2MnkilZ50bWfxci2w9lRaVVRw83Ved/YSY+gRb2bGTj3cRg1nVQYLCoxKw hViC/WeRxSub3uRMMF+6VpvhRPWuyfj06lWwFjMCc/yr3ugX/induAdchsM8rPAbZTaS tKVg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-samsung-soc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-samsung-soc-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j6si5974285pll.26.2017.10.17.04.08.16; Tue, 17 Oct 2017 04:08:16 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-samsung-soc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-samsung-soc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-samsung-soc-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758948AbdJQLIP (ORCPT + 4 others); Tue, 17 Oct 2017 07:08:15 -0400 Received: from mailout2.w1.samsung.com ([210.118.77.12]:57938 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756066AbdJQLIO (ORCPT ); Tue, 17 Oct 2017 07:08:14 -0400 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20171017110812euoutp02e038e1dee868c8be092a9d6ba1ee301c~uVur3KDVm1221312213euoutp021; Tue, 17 Oct 2017 11:08:12 +0000 (GMT) Received: from eusmges1.samsung.com (unknown [203.254.199.239]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20171017110811eucas1p2e87e47f90bd5242bfe25c8882dd8af89~uVurK3-xi3249432494eucas1p22; Tue, 17 Oct 2017 11:08:11 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges1.samsung.com (EUCPMTA) with SMTP id CA.2D.12576.B94E5E95; Tue, 17 Oct 2017 12:08:11 +0100 (BST) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20171017110810eucas1p13e4fd9a96b7866324da0f49a356db558~uVuqbK8R92762627626eucas1p1d; Tue, 17 Oct 2017 11:08:10 +0000 (GMT) X-AuditID: cbfec7ef-f79ee6d000003120-c5-59e5e49b13c9 Received: from eusync3.samsung.com ( [203.254.199.213]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id B6.F8.20118.A94E5E95; Tue, 17 Oct 2017 12:08:10 +0100 (BST) Received: from AMDC2765.digital.local ([106.116.147.25]) by eusync3.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0OXY00HTLS9D1IC0@eusync3.samsung.com>; Tue, 17 Oct 2017 12:08:10 +0100 (BST) From: Marek Szyprowski To: dri-devel@lists.freedesktop.org, linux-samsung-soc@vger.kernel.org Cc: Marek Szyprowski , Inki Dae , Seung-Woo Kim , Andrzej Hajda , Bartlomiej Zolnierkiewicz , Tobias Jakobi , Krzysztof Kozlowski , Sylwester Nawrocki , Andrzej Pietrasiewicz , Hoegeun Kwon Subject: [PATCH v3 0/9] Exynos DRM: rewrite IPP subsystem and userspace API Date: Tue, 17 Oct 2017 13:07:43 +0200 Message-id: <20171017110752.25096-1-m.szyprowski@samsung.com> X-Mailer: git-send-email 2.14.2 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrFIsWRmVeSWpSXmKPExsWy7djPc7qznzyNNPh/Vszi1rpzrBazXraz WGycsZ7V4srX92wW75d3sVlMuj+BxeL8+Q3sFjPO72OyWHvkLrvF4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FE 19susA4RATeJpsMzWUFsZoF9zBIb27xBbGEBb4nzfafA4iwCqhLPT78Hq+cVsJXoXrOfHWKb vMT7BfcZJzByL2BkWMUoklpanJueW2ykV5yYW1yal66XnJ+7iREYVNuO/dyyg7HrXfAhRgEO RiUe3oxDTyKFWBPLiitzDzFKcDArifDuuvU0Uog3JbGyKrUoP76oNCe1+BCjNAeLkjhv757V kUIC6YklqdmpqQWpRTBZJg5OqQbGHSVzHz84dmZer6r4jOn2U6YdWRI7rXJijpKN9n/9I2rR zMcOpvn3qP3cYiSZUsMrFNO2/XHU/EVP1rS4NdaHL5Qr5Apt+GXz+PwE+VvKKaEN/B0LtnIW q3/WNVx4esqKD3F2pzq57A+1Hrq+OmZ++IUWVt+11+fe+Hd8ZRuf5Lkt6jfmXSquVWIpzkg0 1GIuKk4EAAEBRZ0mAgAA X-CMS-MailID: 20171017110810eucas1p13e4fd9a96b7866324da0f49a356db558 X-Msg-Generator: CA X-Sender-IP: 182.198.249.180 X-Local-Sender: =?utf-8?q?Marek_Szyprowski=1BSRPOL-Kernel_=28TP=29=1B?= =?utf-8?b?7IK87ISx7KCE7J6QG1NlbmlvciBTb2Z0d2FyZSBFbmdpbmVlcg==?= X-Global-Sender: =?utf-8?q?Marek_Szyprowski=1BSRPOL-Kernel_=28TP=29=1BSam?= =?utf-8?q?sung_Electronics=1BSenior_Software_Engineer?= X-Sender-Code: =?utf-8?q?C10=1BEHQ=1BC10CD02CD027392?= CMS-TYPE: 201P X-CMS-RootMailID: 20171017110810eucas1p13e4fd9a96b7866324da0f49a356db558 X-RootMTR: 20171017110810eucas1p13e4fd9a96b7866324da0f49a356db558 References: Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org Dear all, This patchset performs complete rewrite of Exynos DRM IPP subsystem and its userspace API. Why such rewrite is needed? Exynos DRM IPP API is over-engineered in general, but not really extensible on the other side. It is also buggy, with significant design flaws: - Userspace API covers memory-2-memory picture operations together with CRTC writeback and duplicating features, which belongs to video plane. - Lack of support of the all required image formats (for example NV12 Samsung-tiled cannot be used due to lack of pixel format modifier support). - Userspace API designed only to mimic hardware behaviour, not easy to understand. - Lack of proper input validation in the core, drivers also didn't do that correctly, so it was possible to set incorrect parameters and easil trigger IOMMU fault or memory trash. - Drivers were partially disfunctional or supported only a subset of modes. Due to the above limitations and issues the Exynos DRM IPP API was not used by any of the open-source projects. I assume that it is safe to remove this broken API without any damage to open-source community. All remaining users (mainly Tizen project related) will be updated to the new version. This patchset changes Exynos DRM IPP subsystem to something useful. The userspace API is much simpler, state-less and easy to understand. Also the code of the core and driver is significantly smaller and easier to understand. Patches were tested on Exynos4412 based Odroid U3, Exynos5422 Odroid XU3 and Exynos5433 TM2 boards, on top of Linux next-20171016 kernel. Best regards Marek Szyprowski Samsung R&D Institute Poland Changelog: v3: - fixed minor issues and added features pointed by other developers: * fixed missing ipp_unregister (Hoegeun) * added missing limits to FIMC and GSC driver (Hoegeun) * added more specific compatible strings to GSC driver (Hoegeun) * added Exynos5433 support to GSC driver (Hoegeun) * added autosuspend runtime PM to all IPP drivers (Tobias) - added Exynos5433 support to Scaler driver (thanks to Andrzej) - dropped Exynos5420 clk patch, which has been alredy merged v2: https://www.spinics.net/lists/dri-devel/msg153418.html - fixed minor issues pointed by other developers: * fixed possible null pointer dereferrence (Tobias) * changed limits_size to limits_count (Tobias) * renamed struct exynos_drm_ipp_format to drm_exynos_ipp_format (Andrzej) * added proper return value from exynos_drm_ipp_get_res_ioctl when no IPP driver is present (Andrzej) * properly aligned all uapi structures to be 32/64 bit safe (Emil) * properly initialize all strucutres - added new Exynos Scaler driver from Andrzej Pietrasiewicz v1: https://www.spinics.net/lists/linux-samsung-soc/msg60492.html - initial version of IPP v2 My previous works in this area: "[RFC v2 0/2] Exynos DRM: add Picture Processor extension" https://www.spinics.net/lists/dri-devel/msg140669.html - removed usage of DRM objects and properties - replaced them with simple list of parameters with predefined IDs "[RFC 0/4] Exynos DRM: add Picture Processor extension" https://www.spinics.net/lists/linux-samsung-soc/msg59323.html - moved this feature from DRM core to Exynos DRM driver - changed name from framebuffer processor to picture processor - simplified code to cover only things needed by Exynos drivers - implemented simple fifo task scheduler - cleaned up rotator driver conversion (removed IPP remainings) "[RFC 0/2] New feature: Framebuffer processors" https://www.spinics.net/lists/linux-samsung-soc/msg54810.html - generic approach implemented in DRM core, rejected Patch summary: Andrzej Pietrasiewicz (3): drm/exynos: Add driver for Exynos Scaler module ARM: dts: exynos: Add mem-2-mem Scaler devices ARM64: dts: exynos: Add mem-2-mem Scaler devices Marek Szyprowski (6): drm/exynos: ipp: Remove Exynos DRM IPP subsystem drm/exynos: ipp: Add IPP v2 framework drm/exynos: rotator: Convert driver to IPP v2 core API drm/exynos: gsc: Convert driver to IPP v2 core API drm/exynos: Add generic support for devices shared with V4L2 subsystem drm/exynos: fimc: Convert driver to IPP v2 core API .../devicetree/bindings/gpu/samsung-scaler.txt | 26 + arch/arm/boot/dts/exynos5420.dtsi | 35 + arch/arm64/boot/dts/exynos/exynos5433.dtsi | 42 + drivers/gpu/drm/exynos/Kconfig | 17 +- drivers/gpu/drm/exynos/Makefile | 1 + drivers/gpu/drm/exynos/exynos_drm_drv.c | 36 +- drivers/gpu/drm/exynos/exynos_drm_drv.h | 5 +- drivers/gpu/drm/exynos/exynos_drm_fimc.c | 930 +++----- drivers/gpu/drm/exynos/exynos_drm_fimc.h | 23 - drivers/gpu/drm/exynos/exynos_drm_gsc.c | 995 +++------ drivers/gpu/drm/exynos/exynos_drm_gsc.h | 24 - drivers/gpu/drm/exynos/exynos_drm_ipp.c | 2240 ++++++-------------- drivers/gpu/drm/exynos/exynos_drm_ipp.h | 357 ++-- drivers/gpu/drm/exynos/exynos_drm_rotator.c | 740 ++----- drivers/gpu/drm/exynos/exynos_drm_rotator.h | 19 - drivers/gpu/drm/exynos/exynos_drm_scaler.c | 717 +++++++ drivers/gpu/drm/exynos/regs-scaler.h | 426 ++++ include/uapi/drm/exynos_drm.h | 326 +-- 18 files changed, 3057 insertions(+), 3902 deletions(-) create mode 100644 Documentation/devicetree/bindings/gpu/samsung-scaler.txt delete mode 100644 drivers/gpu/drm/exynos/exynos_drm_fimc.h delete mode 100644 drivers/gpu/drm/exynos/exynos_drm_gsc.h delete mode 100644 drivers/gpu/drm/exynos/exynos_drm_rotator.h create mode 100644 drivers/gpu/drm/exynos/exynos_drm_scaler.c create mode 100644 drivers/gpu/drm/exynos/regs-scaler.h -- 2.14.2 -- To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Acked-by: Rob Herring