From patchwork Wed May 9 08:59:21 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 135225 Delivered-To: patch@linaro.org Received: by 10.46.151.6 with SMTP id r6csp5380946lji; Wed, 9 May 2018 01:59:46 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpwS6d1AP3pgCi+sB/jNYIJTfFlzFwzlgi14FeYS/pvNng1984M5HTyrbEvaLhCvZyTioth X-Received: by 2002:a17:902:9686:: with SMTP id n6-v6mr43591800plp.136.1525856386567; Wed, 09 May 2018 01:59:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525856386; cv=none; d=google.com; s=arc-20160816; b=BzirL9xUsy5EOWOqn08lWqujnqWVRmwcdlg6KyvGN+Gl/032sPLixT67Jbi6KA4CLT rebw9FmH44B6L1fr7SyLLtSjqYc8ZlKr+1hhEjDuBUesg0y2MTZyy/vqZydd6daJEOFl pubb9l0CKbswkh1s+GzcRdc/qPtJpiSVr1fpOGEcLB3DLTl/g9WoZt9fKz8vtmrAfQ6H a8ojBvyTZfOkuB+8bBTn3QrSM5KVcBuG8ZtRoJsLUfPZRN3i/1zWkmx3FAPYv+/PrQpH 6s40jFEvgWpD7TP5oQoBqCsz92l3GH3C9mUtFSBai2ImsgJT3yCKNngQupZ1aKkSIDfI 0guQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:references:cms-type:message-id:date:subject:to :from:dkim-signature:dkim-filter:delivered-to :arc-authentication-results; bh=GqjV+pJgyTrnGU+n3L96P4L5/ZvuiahWEp8/brqJ8rw=; b=a1OvXbf7EyAQ65InAW7IyVMYs0GGrAIJ5lSAzkWIW+GA9E6skOA8a+OiIzEwngAc8J fWQ4WPG9KN9xV7QJraKOFPWh1wMC7bsK4tYpRshD2sYIYXvAjwhW4WNI0LUP3PYdSkhX ZKJUtA5eJ8Sy0avFHeDijs015ZWuVmUS+iYvkFaw2fQSViTpME1fx+H9lrk0DggbQI9b vklDep1zHQhXqEPrKR19BJsvKZFHfbvvBKDENY5JYPRmy9dyFKZdnsuUd5Dm7Wh3vlEB IGFYYe+urkQWhFMsq1kKowvHwVbHlNo33ku2ltdbhhN3NjiOq20DuX/fTIIXBb7et9k2 fO2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@samsung.com header.s=mail20170921 header.b=Vjwji8+l; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTPS id e6-v6si20761643pgt.208.2018.05.09.01.59.46 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 09 May 2018 01:59:46 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) client-ip=131.252.210.177; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@samsung.com header.s=mail20170921 header.b=Vjwji8+l; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1E3646ECC6; Wed, 9 May 2018 08:59:45 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) by gabe.freedesktop.org (Postfix) with ESMTPS id 951356ECBC for ; Wed, 9 May 2018 08:59:43 +0000 (UTC) Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20180509085940euoutp02f7d02ebd35c99f81f6471997aec14110~s7ktBScan1456714567euoutp02f; Wed, 9 May 2018 08:59:40 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20180509085940euoutp02f7d02ebd35c99f81f6471997aec14110~s7ktBScan1456714567euoutp02f DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1525856380; bh=h1HszbOmg3YQCdyY8BENpG5AEF705c2C4N0Q7dxK1U0=; h=From:To:Cc:Subject:Date:References:From; b=Vjwji8+l2sqmZShNnqZ77l5gzYxLmUpgn0npVtNe0UdEqo9hK7JssNhkRLZGSE5I0 j4G4pRGmGmGnbbKUEc5vhCJhyZ32tG7HdpubHyat00tiEN+c1WmIrunwiiizDF/x9+ QUFNPQnSpNrRtk/0CmhJ66KHn9ozXF96ilCQ7b10= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20180509085939eucas1p259ba39ef8cbb88cd6784bcd6667549c0~s7kr-RxUO2744627446eucas1p2f; Wed, 9 May 2018 08:59:39 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id 55.A6.17380.B78B2FA5; Wed, 9 May 2018 09:59:39 +0100 (BST) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20180509085938eucas1p1f7ef77cee4a4cee77ef553308b06c073~s7krMsm4a0777407774eucas1p1v; Wed, 9 May 2018 08:59:38 +0000 (GMT) X-AuditID: cbfec7f4-6f9ff700000043e4-d6-5af2b87b3bd4 Received: from eusync3.samsung.com ( [203.254.199.213]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 41.09.04178.A78B2FA5; Wed, 9 May 2018 09:59:38 +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 <0P8G00CYVEBAZM70@eusync3.samsung.com>; Wed, 09 May 2018 09:59:38 +0100 (BST) From: Marek Szyprowski To: dri-devel@lists.freedesktop.org, linux-samsung-soc@vger.kernel.org Subject: [PATCH v7 0/7] Exynos DRM: rewrite IPP subsystem and userspace API Date: Wed, 09 May 2018 10:59:21 +0200 Message-id: <20180509085928.2023-1-m.szyprowski@samsung.com> X-Mailer: git-send-email 2.17.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrAIsWRmVeSWpSXmKPExsWy7djP87rVOz5FGdxeLGBxa905VotZL9tZ LDbOWM9qceXrezaL98u72Cwm3Z/AYnH+/AZ2ixnn9zFZrD1yl93i8Jt2VosZk1+yWbSt/sDq wOOxaVUnm8f97uNMHv+OsXv0bVnF6PF5k1wAaxSXTUpqTmZZapG+XQJXxs+L01kLPjhVXHuU 2sA437yLkZNDQsBE4tWOuUwgtpDACkaJVQ1mXYxcQPZnRonLR3cywRSdXNHHApFYxijx/MoN NgingUni7rF/jCBVbAKGEl1vu9hAbBEBN4mmwzNZQYqYBXYxS7yY/JodJCEs4C0xb/ZhMJtF QFWicd8ssBW8AjYS/1a/YYdYJy/xbPo8dpBmCYEJbBKdUxrZIBIuEpc/T2KEsIUlXh3fAtUg I9HZcRDq1nqJvu9HmCCaexgl9rZMhUpYSxw+fpEVxGYW4JOYtG06cxcjB1CcV6KjTQiixEPi 7NoGVgjbUeLx3yuMkICJlfj4bAHbBEbJBYwMqxjFU0uLc9NTi43yUsv1ihNzi0vz0vWS83M3 MQLj9fS/4192MO76k3SIUYCDUYmHV2Lnxygh1sSy4srcQ4wSHMxKIryyxp+ihHhTEiurUovy 44tKc1KLDzFKc7AoifPGadRFCQmkJ5akZqemFqQWwWSZODilGhg3TW75GXF2Fusxt4r7d4JX BH/60tmfWWRU01S7c+EvQ43MU3UeZn8nnHn33iaBsereOQf3DyeTcvaYFDRM9WnPXjzDq75c T2mDd/G2Iwvnh4Z9atW7t2A9o4rRUfvtjv8Wb7TpcLH1P35gUrxA1qX9AsdW+1xWictKOMco did4daGCy+UpCjxKLMUZiYZazEXFiQBXEiU+0wIAAA== X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmpjluLIzCtJLcpLzFFi42I5/e/4Vd2qHZ+iDPp6dCxurTvHajHrZTuL xcYZ61ktrnx9z2bxfnkXm8Wk+xNYLM6f38BuMeP8PiaLtUfuslscftPOajFj8ks2i7bVH1gd eDw2repk87jffZzJ498xdo++LasYPT5vkgtgjeKySUnNySxLLdK3S+DK+HlxOmvBB6eKa49S Gxjnm3cxcnJICJhInFzRx9LFyMUhJLCEUeLYul42CKeJSWLHoRWsIFVsAoYSXW+72EBsEQE3 iabDM8HizAL7mCU2tnmD2MIC3hLzZh9mB7FZBFQlGvfNYgKxeQVsJP6tfsMOsU1e4tn0eewT GLkWMDKsYhRJLS3OTc8tNtQrTswtLs1L10vOz93ECAydbcd+bt7BeGlj8CFGAQ5GJR7egt0f o4RYE8uKK3MPMUpwMCuJ8Moaf4oS4k1JrKxKLcqPLyrNSS0+xCjNwaIkznveoDJKSCA9sSQ1 OzW1ILUIJsvEwSnVwDit/oewqcesr5E5b6b5hj90slh+K636W+sHs3Rm4UvhV6fVFy7ra5ps lbG0rWj6S+8707uPXtD8m9nFc37X+7dPdoptiGmw5Dmx8wVve1CUd/Xp3iTBfbvepv2ZeudL hzHzcp7/8spJJ6+2C/xXVI/bau2jpJRw9FJHn9TVJfL/57rqP2k3ZlJiKc5INNRiLipOBAD+ z4h4GQIAAA== X-CMS-MailID: 20180509085938eucas1p1f7ef77cee4a4cee77ef553308b06c073 X-Msg-Generator: CA CMS-TYPE: 201P X-CMS-RootMailID: 20180509085938eucas1p1f7ef77cee4a4cee77ef553308b06c073 X-RootMTR: 20180509085938eucas1p1f7ef77cee4a4cee77ef553308b06c073 References: X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Bartlomiej Zolnierkiewicz , Seung-Woo Kim , Krzysztof Kozlowski , Tobias Jakobi , Sylwester Nawrocki , Andrzej Pietrasiewicz , Hoegeun Kwon , Marek Szyprowski MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Dear all, This patchset performs complete rewrite of Exynos DRM IPP subsystem and its userspace API. Original, obsoleted Exynos DRM IPP (v1) framework and API has been already removed by commit 8ded59413ccc ("drm/exynos: ipp: Remove Exynos DRM IPP subsystem"). Rationale for that step has been provided in the mentioned patch commit message. Basically that API was broken by design, useless, and without any real users in userspace. However the hardware capability to perform memory-to-memory image processing is still very needed feature for Exynos DRM clients, so a replacement API - IPP v2 has been designed. V2 IPP userspace API is based on stateless approach, which much better fits to memory-to-memory image processing model. It also provides support for all image formats, which are both already defined in DRM API and supported by the existing IPP hardware modules. The new code of the IPP driver core and device drivers are significantly smaller and easier to understand. Also a new driver for Exynos Scaler hardware module available in Exynos5420 and newer SoCs has been added on top of the provided changes. Patches were tested on Exynos4412 based Odroid U3, Exynos5422 Odroid XU3 and Exynos5433 TM2 boards, on top of Linux next-20180501 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 Support for the Exynos DRM IPP v2 API has been also added to Tizen project (to its graphics middleware library for Exynos SoC platform, libtdm-exynos) where it finally got extensive tests and provided its usefulness on Exynos-based devices (Odroid XU3/XU4 and TM2): https://git.tizen.org/cgit/platform/adaptation/samsung_exynos/libtdm-exynos/log/?h=tizen&qt=grep&q=ipp https://git.tizen.org/cgit/platform/adaptation/samsung_exynos/libtdm-exynos/commit/?h=tizen&id=b59be207365d10efd489e6f71c8a045b558c44fe https://git.tizen.org/cgit/platform/kernel/linux-exynos/log/?h=tizen&qt=grep&q=ipp Best regards Marek Szyprowski Samsung R&D Institute Poland Changelog: v7: - rebased onto linux next-20180501 - dropped Exynos DRM IPPv1 removal patch, which has been merged separately as commit 8ded59413ccc ("drm/exynos: ipp: Remove Exynos DRM IPP subsystem") - bumped Exynos DRM driver version to v1.1 to let userspace easily notice that new API is available - fixed some corner cases of operation in 90/270 rotation modes - restored tiled formats support in Exynos FIMC IPP driver - relaxed some limits for Exynos5433 GScaler driver, as hardware seems to work fine with such values v6: - fixed most checkpatch.pl warnings, only some debug messages exceeds 80 characters line boundary to avoid breaking strings v5: https://www.spinics.net/lists/linux-samsung-soc/msg61171.html - fixed and reworked items pointed by Inki Dae: * formats and limits arrays are no longer NULL terminated, all functions accessing them require explicit array size argument * fixed return value for functions in GScaler, FIMC and Rotator drivers * simplified exynos_drm_ipp_task_set() function (removed temporary buffer) * reworked FIMC driver sharing with V4L2 subsystem, now user can specify mask of devices assigned to DRM driver (defaults to fimc.2 and fimc.3) * removed drivers specific task check (not used anymore) - fixed issue pointed by Arnd Bergmann and Tobias Jakobi: * removed usage of timeval structures - removed more dead-code from GScaler and FIMC drivers - fixed IOMMU page fault caused by FIMC operation in 90 degree rotation mode - added Ack from Rob Herring for Scaler driver - generated patches with -B/40% to make Rotator, GScaler and FIMC patches easier to read (forced complete rewrite) v4: https://www.spinics.net/lists/linux-samsung-soc/msg61066.html - 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 (4): 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: fimc: Convert driver to IPP v2 core API .../bindings/gpu/samsung-scaler.txt | 27 + arch/arm/boot/dts/exynos5420.dtsi | 36 + arch/arm64/boot/dts/exynos/exynos5433.dtsi | 46 + drivers/gpu/drm/exynos/Kconfig | 16 +- drivers/gpu/drm/exynos/Makefile | 2 + drivers/gpu/drm/exynos/exynos_drm_drv.c | 35 +- drivers/gpu/drm/exynos/exynos_drm_drv.h | 10 + drivers/gpu/drm/exynos/exynos_drm_fimc.c | 3214 ++++++++--------- drivers/gpu/drm/exynos/exynos_drm_fimc.h | 23 - drivers/gpu/drm/exynos/exynos_drm_gsc.c | 3201 +++++++--------- drivers/gpu/drm/exynos/exynos_drm_gsc.h | 24 - drivers/gpu/drm/exynos/exynos_drm_ipp.c | 916 +++++ drivers/gpu/drm/exynos/exynos_drm_ipp.h | 175 + drivers/gpu/drm/exynos/exynos_drm_rotator.c | 1274 +++---- drivers/gpu/drm/exynos/exynos_drm_scaler.c | 694 ++++ drivers/gpu/drm/exynos/regs-scaler.h | 426 +++ include/uapi/drm/exynos_drm.h | 240 ++ 17 files changed, 5877 insertions(+), 4482 deletions(-) create mode 100644 Documentation/devicetree/bindings/gpu/samsung-scaler.txt rewrite drivers/gpu/drm/exynos/exynos_drm_fimc.c (47%) delete mode 100644 drivers/gpu/drm/exynos/exynos_drm_fimc.h rewrite drivers/gpu/drm/exynos/exynos_drm_gsc.c (44%) delete mode 100644 drivers/gpu/drm/exynos/exynos_drm_gsc.h create mode 100644 drivers/gpu/drm/exynos/exynos_drm_ipp.c create mode 100644 drivers/gpu/drm/exynos/exynos_drm_ipp.h rewrite drivers/gpu/drm/exynos/exynos_drm_rotator.c (72%) create mode 100644 drivers/gpu/drm/exynos/exynos_drm_scaler.c create mode 100644 drivers/gpu/drm/exynos/regs-scaler.h