From patchwork Mon Oct 23 07:54:19 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 116642 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp4357720qgn; Mon, 23 Oct 2017 00:54:55 -0700 (PDT) X-Google-Smtp-Source: ABhQp+TrzvQKkS+m9rV2QNghpBVZJ8Tdw8MgQx3wuc0mANI7Ebafiq1kbrFbJs73uGzNJNgBpKRC X-Received: by 10.99.101.70 with SMTP id z67mr10787850pgb.178.1508745295460; Mon, 23 Oct 2017 00:54:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1508745295; cv=none; d=google.com; s=arc-20160816; b=f7slE5rWjyER2F5LoAcnFZRxZjr/M2xkNMZQHwNWqhQUgWeGW7P22yQtXNA8H/Rvu4 l8ZuhWGbicaMmhPG8tn4/B2K/1fsg1ZCFqyQbWIfIm1US85o3oavFPC/Nh04/bZwYF/F Z0kH7VaR6mfNMxdI6Gn3OVaWtUunCeUYDyYE57gf291TRpQVIZYWn5XPxpaio8j/cFq5 f/B3GtuKCrAQndrHS+VsFRTOVF6d9bvEiq7K5qmEZ9snDKDSppmImyRbs0LSvjK3J7AR z78m65FH7Cu8NMe6ANo0jHYcjdoZ5WhTTenCS4TQS56pd0QMdQ/AqoBW9VOOAlg8MQnH RzTA== 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:dkim-signature:dkim-filter :arc-authentication-results; bh=6LgQAlavZ/KocNfkb+CsHHf9P921PMgI6TB4tOZN95Q=; b=tcwKtliP8n15ZaJVCKgGT+jLIiUaf/H7MDZq4+UXHMxQJAks53Eez10xdpzZACRv/6 99UqA7ZvWW/OeYCUEBK6qIIUg2WdDJ2JnQbnKxZJWAGTW35+i6kkoWC3YgjXxOY7JkCm RU/frTgQndiHSB+ASv8aOmcMrM8qIbPpVmokOTumjNn2XC2LodfjQdRdJXkERSIN1PBU hWS9j7TfbIBfr9x5qUwAEl1MFeRmsHGV1rpmtqQOLgV3+whPvF2XH7GwCbjCcGVV1ndc h1ZUUPI/4hSfXqwuA2p1ei8cR9e4EWXdc3KMlAJ2g2kJtKKCrLygPVnz1JNbKNmxHZWa FDGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@samsung.com header.s=mail20170921 header.b=YhS/SpJA; 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 r10si4527109pgq.332.2017.10.23.00.54.55; Mon, 23 Oct 2017 00:54:55 -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; dkim=neutral (body hash did not verify) header.i=@samsung.com header.s=mail20170921 header.b=YhS/SpJA; 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 S1751345AbdJWHyx (ORCPT + 4 others); Mon, 23 Oct 2017 03:54:53 -0400 Received: from mailout2.w1.samsung.com ([210.118.77.12]:47261 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751275AbdJWHyv (ORCPT ); Mon, 23 Oct 2017 03:54:51 -0400 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20171023075449euoutp02098327f2dbd9c2b69c023a0ca13d522e~wI9jbgnON0308503085euoutp02D; Mon, 23 Oct 2017 07:54:49 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20171023075449euoutp02098327f2dbd9c2b69c023a0ca13d522e~wI9jbgnON0308503085euoutp02D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1508745289; bh=HJ+2mP8fIdKnjbBNXCgsK1ncLyfI+64WvRZxP92sFYA=; h=From:To:Cc:Subject:Date:References:From; b=YhS/SpJAuUOtroXmZPsIk04qSKnrZaV00uFqHIR6T8GwUPar5RWGmL4jkZLsBUt+C jt+QEZz5iJn1AGMOZAYotw8yjGz4GI18rM5uYZhVXebpfptk2CupvTCSIJDxQ0w/zk 6fj//uJyhpQTmtKO6f7a28TypNtsUvwOECL1Lglk= Received: from eusmges4.samsung.com (unknown [203.254.199.244]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20171023075448eucas1p12eff761d529ad6a8f436ad1cbc21d2b5~wI9i8ZUqu0572405724eucas1p1V; Mon, 23 Oct 2017 07:54:48 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges4.samsung.com (EUCPMTA) with SMTP id B7.1A.12944.840ADE95; Mon, 23 Oct 2017 08:54:48 +0100 (BST) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20171023075448eucas1p25e25bb36d36139e3917211ab8ac999ec~wI9iGFSaj2986529865eucas1p2M; Mon, 23 Oct 2017 07:54:48 +0000 (GMT) X-AuditID: cbfec7f4-f79ab6d000003290-8e-59eda048e9ea Received: from eusync3.samsung.com ( [203.254.199.213]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id D2.D3.18832.740ADE95; Mon, 23 Oct 2017 08:54:48 +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 <0OY900M2KNB49IB0@eusync3.samsung.com>; Mon, 23 Oct 2017 08:54:47 +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 v4 0/9] Exynos DRM: rewrite IPP subsystem and userspace API Date: Mon, 23 Oct 2017 09:54:19 +0200 Message-id: <20171023075428.7003-1-m.szyprowski@samsung.com> X-Mailer: git-send-email 2.14.2 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrOIsWRmVeSWpSXmKPExsWy7djP87oeC95GGjT90rS4te4cq8Wsl+0s FhtnrGe1uPL1PZvF++VdbBaT7k9gsTh/fgO7xYzz+5gs1h65y25x+E07q8WMyS/ZLNpWf2B1 4PHYtKqTzeN+93Emj3/H2D36tqxi9Pi8SS6ANYrLJiU1J7MstUjfLoEr4/G+NawFu40rtn99 y9LAuEuzi5GTQ0LARGL1xyNMELaYxIV769m6GLk4hASWMkpMftPIBpIQEvjMKPHoe3kXIwdY w497thA1yxgltn2/yQThNDBJfFxzGayBTcBQouttF5gtIuAm0XR4JitIEbPALmaJF5Nfs4NM Ehbwlvg/OQWkhkVAVWLh/mnsIDavgI3Exab5jBAXyUu8X3CfEaRXQmAGm8SRR8tZIBIuErd+ 32aHsIUlXh3fAmXLSHR2HIR6p59RoqlVG8KewShx7i0vhG0tcfj4RVYQm1mAT2LStunMEJ/x SnS0CUGUeEhcO/YQ6gZHiT9/p7NDAiJWounPcdYJjFILGBlWMYqklhbnpqcWm+gVJ+YWl+al 6yXn525iBEbv6X/Hv+xgXHzM6hCjAAejEg9vhPHbSCHWxLLiytxDjBIczEoivHMsgEK8KYmV ValF+fFFpTmpxYcYpTlYlMR5baPaIoUE0hNLUrNTUwtSi2CyTBycUg2Mcx/1fRS7HPOy6D/n tHN35nybfSvQpXbC0btLDsSnJ4ucPF756ZTHecmuJaGvOJIOX9HyYP7z2eLB9Ikis5VfW+zf fC788tKE7EM1j4wv2hnvlZrSNn2V3o/32zNbjhxR5nd+fCue40xIVZ/KbGGF16n3rc86764/ 2Wl0Ky7w3fy13UX55V+XsyuxFGckGmoxFxUnAgAuP+SB2gIAAA== X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprALMWRmVeSWpSXmKPExsVy+t/xq7oeC95GGlxxt7i17hyrxayX7SwW G2esZ7W48vU9m8X75V1sFpPuT2CxOH9+A7vFjPP7mCzWHrnLbnH4TTurxYzJL9ks2lZ/YHXg 8di0qpPN4373cSaPf8fYPfq2rGL0+LxJLoA1issmJTUnsyy1SN8ugSvj8b41rAW7jSu2f33L 0sC4S7OLkYNDQsBE4sc92y5GTiBTTOLCvfVsXYxcHEICSxglXk7uZYdwmpgkZk3fxA5SxSZg KNH1tosNxBYRcJNoOjyTFcRmFtjHLLGxzRtkqLCAt8T/ySkgYRYBVYmF+6eBtfIK2EhcbJrP CLFMXuL9gvuMExi5FzAyrGIUSS0tzk3PLTbUK07MLS7NS9dLzs/dxAgMp23Hfm7ewXhpY/Ah RgEORiUe3gjjt5FCrIllxZW5hxglOJiVRHjnWACFeFMSK6tSi/Lji0pzUosPMUpzsCiJ8/bu WR0pJJCeWJKanZpakFoEk2Xi4JRqYCwRvxR7/9V/tuCV7Jf+3uTf6vS++8mkyWLpdRaJyl8/ zI71uMP6KyJm9b6+aSVHF5q3Ovv6vyjoboxxiZ6b77lQIugva1FPld3i2ztNEtUbbtncu5m8 LPZsytnOfdVvbhT8ap7hXlsv0NpweK2eWvC91VL3vaxne5jF/n+z+46eZqRh84xlekosxRmJ hlrMRcWJAGPMu4IjAgAA X-CMS-MailID: 20171023075448eucas1p25e25bb36d36139e3917211ab8ac999ec X-Msg-Generator: CA CMS-TYPE: 201P X-CMS-RootMailID: 20171023075448eucas1p25e25bb36d36139e3917211ab8ac999ec X-RootMTR: 20171023075448eucas1p25e25bb36d36139e3917211ab8ac999ec 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. A simple userspace test tool has been sent together with v1 of this patchset: https://www.spinics.net/lists/linux-samsung-soc/msg60498.html Tobias Jakobi has added support for this new API to his fork of libdrm and mpv video player: https://github.com/tobiasjakobi/libdrm/tree/ippv2 https://github.com/tobiasjakobi/mpv Best regards Marek Szyprowski Samsung R&D Institute Poland Changelog: v4: - fixed Exynos GSC limits (alignment) and operation in 90 degree rotation mode - fixed some style issues in Scaler driver (thanks to Andrzej) - fixed copy/paste typos in commit messages - improved debug messages, especially if provided parameters exceeds hardwave limits v3: https://www.spinics.net/lists/linux-samsung-soc/msg60981.html - 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 | 27 + 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 | 1001 +++------ drivers/gpu/drm/exynos/exynos_drm_gsc.h | 24 - drivers/gpu/drm/exynos/exynos_drm_ipp.c | 2253 ++++++-------------- 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 | 716 +++++++ drivers/gpu/drm/exynos/regs-scaler.h | 426 ++++ include/uapi/drm/exynos_drm.h | 326 +-- 18 files changed, 3078 insertions(+), 3900 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