From patchwork Fri Sep 29 07:32:45 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 114493 Delivered-To: patch@linaro.org Received: by 10.140.104.133 with SMTP id a5csp485781qgf; Fri, 29 Sep 2017 00:33:06 -0700 (PDT) X-Google-Smtp-Source: AOwi7QAq7rnbFuLKegcxSoLTEtcnsCiIkbkuXpJ+Brj7qtEt3LvB7o3LJRq+yq2Ue+ZmF3dxuWVO X-Received: by 10.99.149.73 with SMTP id t9mr1240709pgn.174.1506670386854; Fri, 29 Sep 2017 00:33:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1506670386; cv=none; d=google.com; s=arc-20160816; b=Pw0lqaPEB65U4pCARo6ewa/0F5HYZ0kQL1LRZff5A3VG64nWg5AzBadox3sScVRW9l +VCl5Wl4jXYyEFU5wDO6vsIbcvTiXwKBVVUrqTVC8AJUGPGPhNZaxIjtg+yuVaAmXMJj tKoS2KPqvJ/89TarD46mpEqVKFXBhOs0K/+Pt4Qd6BidFWr9cC0VsbF7LU141hGcf2lU 6BbP2iIt1zrjbrojGpl5DdTWpiKLuQmskq1NOjJ9apQ2N3OIP25uB8Wya16CIT3RVM7M 7cKKEqkOBhQWH5TC35Qw6ohf/DJ6dodpZqDNf8V4l2vjEKfKiIoj0ErQs5jNFqwvMCBY 4fjA== 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=5d+LDp5ulB6y5BrK+EsB1ABTngOp2tpCZPi0+cilf+s=; b=C82q7eLubpuKmav/2+dSHbMVwgnDfcIDwp4VJo+RMyq39I29mVmzvMWFuDr7oOTfXz Mo9CRxQWRgC/yeqhP44K7TwOuQLi1TI+RJGIiErwAuRp3Sqrhx1N7zYZJUAQEN+El4nz gFgzTm74HVe9s3xT+tykmR76LL7p/4UOYEfN6jEV9jzpy33kVffRCN5OHwhDOLwBnsYC L+asEvAK2w0MD6mJsqMnq13vOqsVisiWwlShzfsC7ZrVyh9y1KKhY0qAm1/RF1UG2NYb KqlOETezBDDeg7jipIXhvhPmAK5O1S700xl/+VQCRB2XfV8RFniThuq0YEAzFXSPGJg1 VX+Q== 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 b7si2886643pge.599.2017.09.29.00.33.06; Fri, 29 Sep 2017 00:33:06 -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 S1750977AbdI2HdF (ORCPT + 4 others); Fri, 29 Sep 2017 03:33:05 -0400 Received: from mailout1.w1.samsung.com ([210.118.77.11]:58916 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750847AbdI2HdE (ORCPT ); Fri, 29 Sep 2017 03:33:04 -0400 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20170929073301euoutp01ef8dc986005e415cebfb3358ae1dbbce~oxLq3cFca1560415604euoutp01Y; Fri, 29 Sep 2017 07:33:01 +0000 (GMT) Received: from eusmges2.samsung.com (unknown [203.254.199.241]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20170929073300eucas1p1cf636de1aac4779b119e7f3c1596a0fb~oxLqGkcXv2684426844eucas1p1Q; Fri, 29 Sep 2017 07:33:00 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges2.samsung.com (EUCPMTA) with SMTP id 47.CF.12907.C27FDC95; Fri, 29 Sep 2017 08:33:00 +0100 (BST) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20170929073300eucas1p29f75848701e8181d1482ce4e202c4b6e~oxLpeNeiL2264922649eucas1p2x; Fri, 29 Sep 2017 07:33:00 +0000 (GMT) X-AuditID: cbfec7f1-f793a6d00000326b-ad-59cdf72c6f3f Received: from eusync1.samsung.com ( [203.254.199.211]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id E5.C0.20118.C27FDC95; Fri, 29 Sep 2017 08:33:00 +0100 (BST) Received: from AMDC2765.digital.local ([106.116.147.25]) by eusync1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0OX1004HN6AWR260@eusync1.samsung.com>; Fri, 29 Sep 2017 08:33:00 +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 Subject: [PATCH v2 0/9] Exynos DRM: rewrite IPP subsystem and userspace API Date: Fri, 29 Sep 2017 09:32:45 +0200 Message-id: <1506670374-15689-1-git-send-email-m.szyprowski@samsung.com> X-Mailer: git-send-email 1.9.1 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrKIsWRmVeSWpSXmKPExsWy7djP87o6389GGtyfLGdxa905VotZL9tZ LDbOWM9qceXrezaLSfcnsFicP7+B3WLG+X1MFmuP3GW3O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sUUE3CSaDs9kBSliFpjMLLF+5VdmkISwgLfE+xkLwIpYBFQl1v79zwpi8wp4SEw9c5UJYp2c xMljk1knMHIvYGRYxSiSWlqcm55bbKRXnJhbXJqXrpecn7uJERhM24793LKDsetd8CFGAQ5G JR7eG3JnI4VYE8uKK3MPMUpwMCuJ8M7/BhTiTUmsrEotyo8vKs1JLT7EKM3BoiTO27tndaSQ QHpiSWp2ampBahFMlomDU6qBkSG2/bHie0edi89W15Q7XHK5eWe3kdxJ465PUQ1P2qfmxwow uDKbMkyTeOaxd4loWUb/jqKa7G3CZomLMyX/vZE5o/X1ebumpf/az2/T5js0JUeWm60Udsz8 u8GA7Z/xtx3eT2eXm+w34a060vHASrrWJE1CKGtm2TSfQ/rJd87bs2U4pd5UYinOSDTUYi4q TgQA+WWyCyICAAA= X-CMS-MailID: 20170929073300eucas1p29f75848701e8181d1482ce4e202c4b6e 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: 20170929073300eucas1p29f75848701e8181d1482ce4e202c4b6e X-RootMTR: 20170929073300eucas1p29f75848701e8181d1482ce4e202c4b6e 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 and Exynos5422 Odroid XU3 boards, on top of Linux next-20170928 kernel. Best regards Marek Szyprowski Samsung R&D Institute Poland Changelog: v2: - 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 drivers: clk: samsung: Fix m2m scaler clock on Exynos542x ARM: 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 | 25 + arch/arm/boot/dts/exynos5420.dtsi | 35 + drivers/clk/samsung/clk-exynos5420.c | 2 +- drivers/gpu/drm/exynos/Kconfig | 18 +- 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 | 893 +++----- drivers/gpu/drm/exynos/exynos_drm_fimc.h | 23 - drivers/gpu/drm/exynos/exynos_drm_gsc.c | 853 ++------ 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 | 735 ++----- drivers/gpu/drm/exynos/exynos_drm_rotator.h | 19 - drivers/gpu/drm/exynos/exynos_drm_scaler.c | 675 ++++++ drivers/gpu/drm/exynos/regs-scaler.h | 426 ++++ include/uapi/drm/exynos_drm.h | 326 +-- 18 files changed, 2818 insertions(+), 3875 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 -- 1.9.1 -- 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