From patchwork Sat Aug 4 16:15:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandru-Cosmin Gheorghe X-Patchwork-Id: 10555777 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 A54EB13BB for ; Sat, 4 Aug 2018 16:15:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 868E229C0C for ; Sat, 4 Aug 2018 16:15:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7812B29CF5; Sat, 4 Aug 2018 16:15:54 +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=-2.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,T_DKIM_INVALID 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 2EF7129C0C for ; Sat, 4 Aug 2018 16:15:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728054AbeHDSRB (ORCPT ); Sat, 4 Aug 2018 14:17:01 -0400 Received: from mail-ve1eur01on0069.outbound.protection.outlook.com ([104.47.1.69]:27618 "EHLO EUR01-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727803AbeHDSRB (ORCPT ); Sat, 4 Aug 2018 14:17:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector1-arm-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ovKi6yzzjWdYQuJD3ulG/AWfztpdicVnS9mfVb1ZPK0=; b=LEkrqCVpAoagOIjjE2zWmu4RNeGIQ6Lde38nd5+/9aYQnMp1IohUVKHLjDmtOLXX6Kva5zKA9uBFGxeTxvORnvYVFYYvWGn8WNUYCZkWvDdQKm5qJBashwHMsLzJ1DC8D41whHONwkwZBVKsUcHAn7XkbXhyuCfUKR72yPGgSaY= Received: from e114479-lin.cambridge.arm.com (217.140.106.49) by AM5PR0802MB2547.eurprd08.prod.outlook.com (2603:10a6:203:a0::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1017.14; Sat, 4 Aug 2018 16:15:46 +0000 From: Alexandru Gheorghe To: seanpaul@chromium.org, airlied@linux.ie, dri-devel@lists.freedesktop.org, liviu.dudau@arm.com, brian.starkey@arm.com, malidp@foss.arm.com, ville.syrjala@linux.intel.com, daniel@ffwll.ch, gustavo@padovan.org, maarten.lankhorst@linux.intel.com, alexander.deucher@amd.com, christian.koenig@amd.com, David1.Zhou@amd.com, harry.wentland@amd.com, andrey.grodzovsky@amd.com, Tony.Cheng@amd.com, sunpeng.li@amd.com, shirish.s@amd.com, boris.brezillon@bootlin.com, nicolas.ferre@microchip.com, alexandre.belloni@bootlin.com, inki.dae@samsung.com, jy0922.shim@samsung.com, sw0312.kim@samsung.com, kyungmin.park@samsung.com, kgene@kernel.org, krzk@kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, p.zabel@pengutronix.de, laurent.pinchart@ideasonboard.com, maxime.ripard@bootlin.com, wens@csie.org, eric@anholt.net, linux-graphics-maintainer@vmware.com, syeh@vmware.com, thellstrom@vmware.com Cc: nd@arm.com, Alexandru Gheorghe Subject: [PATCH v3 00/10] Add helper for plane reset Date: Sat, 4 Aug 2018 17:15:20 +0100 Message-Id: <20180804161530.12275-1-alexandru-cosmin.gheorghe@arm.com> X-Mailer: git-send-email 2.18.0 MIME-Version: 1.0 X-Originating-IP: [217.140.106.49] X-ClientProxiedBy: DB6P189CA0005.EURP189.PROD.OUTLOOK.COM (2603:10a6:6:2e::18) To AM5PR0802MB2547.eurprd08.prod.outlook.com (2603:10a6:203:a0::23) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e5784ce0-de6f-41ac-3f1d-08d5fa2589bb X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989117)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020);SRVR:AM5PR0802MB2547; X-Microsoft-Exchange-Diagnostics: 1;AM5PR0802MB2547;3:f4vKwzKE7c87TY/OfrTBXuqnsCcHONQeDVzmskp2tlDuHEz5ppFaudlvmzsLYmVKg8xV76EpbOWt2XWKjgSV091uUj2Int936WXAU6uWFsBuU3Bp9wd431qHzF0iPq6E8TD0FZWolSYFGrZUi/3kHmM9T3SYgdI/kSKoyjNB5lBDEafytHP/0+i8k448GW3IVA1mJZSLoJLye7N1Fhk286Pk6zq+yX7okJ08uqynPiL/JlgHvY3MOi4xwhYK1SSD;25:FG/UYuuEbLplCLDdb9hYfa4/n2NRMl8Q3vfwSYtmh6ZbCAJMXP8LFL8um4Afv+rFJBm0b1oGgNLt8b2yEmiloTXC98+G4syVzV/V0l/uqvQXQG8ZpttA8AHxDCeuamqsc52Tjg14V0PQD9ffziht5UBm8xluLjuCvTvm36j5us7hdbmg+v+hj0Cqln3IuqT0l0huiJGtYEqNmn1ABeogx4ZQmaecxkAB2HXGvc3FNPfG2Y8I5mN1S2+zvcwqBREFSgVKaM/x6dHcnJnhiurpqlOSwz4DrYmAmVerROL0q9uQIHVrCYx1G4SAE9L5qbVYKPqcQFsrsshLSLoThdfHJw==;31:t8arIQwpdHiJVePsX4QhLSIdCjh7uyrolebD/ttQrjWjBIv5OHGcjdwYzS2VOfIoHhIEM2E+8Yxwh6SsRa8wTsalRgPNEm3ptH9fuePFYrpauNWWgi4g77wdxzMcSjS0Jf3p3cmCh3gN3uwBHJ3wdveaLaH2kgtgX2m87ciAAC0ECyAlJyuIm3vb0S9c4H3lwRYElAjUuDN06xDCiYitU6LjqFtqJ1e26VtSp+tnqwg= X-MS-TrafficTypeDiagnostic: AM5PR0802MB2547: Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Alexandru-Cosmin.Gheorghe@arm.com; NoDisclaimer: True X-Microsoft-Exchange-Diagnostics: 1;AM5PR0802MB2547;20:0pybnQnwzaosA/0u75ifSODqK5i6xyG6MRyhwO8DXzq53+IG/it7DahDw1hKxkoCjTzJlWpoaRILtlSBwAc6f4Ph0HMsJS5q9Hiwl09gOdgwzhxJHpqd9mMggVMP3AqvQL8E/olSuH6kqohp9+WFFLYgwL/CtvZCoqoQpP4bX5tZDEKFlj59bfhQ9IjgEZGb5/P3LBiKWn/CFKdeXE+2QmFn9qHlwDMsyDHbv+GUfMXdlgGNfEG+03KlegK6W/m2xW8zb28L64657TWhEAcFEoA1zo0MvR7zimTPiBu07w6EjQMIsZXOxPo5YCZAddotN+WrLWmfDh5Yc4BVHbHnkA==;4:E2wax9hVpdE1siS/CrlyatEqpD3VqpnFNNU9nQbx0l2WahhL4SfKYBvz9H5uHdp6EUielVyI0e6alGKS4Aro6gMqe/Wv2nAUEI/ZhsuZpCFGRWEq5ZelnySmoa+ZHlHZjmxLcKB6FZ/nRIfPhSL5i+qdvQbreAnRjYtOtAFsEf9/8GNf24y+ELgzC9HGKnYF4vRdSIm563u2vVIow3IB5mtgOPP1mtbMqzceAiduks7YZmzPwyzibfLPDIdsvw55yX0E3c/eg/tp+txXXlDisNVArctT9aCkEIYvSZfje480Js+XYajyzziW81PKj0n6 X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(190756311086443); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3231311)(944501410)(52105095)(10201501046)(93006095)(93001095)(3002001)(6055026)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123564045)(20161123562045)(20161123558120)(6072148)(201708071742011)(7699016);SRVR:AM5PR0802MB2547;BCL:0;PCL:0;RULEID:;SRVR:AM5PR0802MB2547; X-Forefront-PRVS: 0754F7E325 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(346002)(366004)(396003)(376002)(136003)(39860400002)(189003)(199004)(51416003)(86362001)(7736002)(4326008)(66066001)(47776003)(52116002)(97736004)(7696005)(305945005)(25786009)(16526019)(186003)(105586002)(6116002)(3846002)(956004)(106356001)(7416002)(5660300001)(1076002)(26005)(6666003)(2616005)(7406005)(478600001)(53936002)(72206003)(68736007)(486006)(8936002)(36756003)(50226002)(316002)(50466002)(81166006)(476003)(16586007)(81156014)(48376002)(386003)(2906002)(8676002)(6486002)(921003)(1121003);DIR:OUT;SFP:1101;SCL:1;SRVR:AM5PR0802MB2547;H:e114479-lin.cambridge.arm.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; Received-SPF: None (protection.outlook.com: arm.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: 1;AM5PR0802MB2547;23:F8LefIqRQ+iDP1tlfur7d9Wdxf6fzGLpoayQ+FTzOXum3RmelvkPDLilMc7FVaMcx0LiwKNd7sYPPItqcVbBL9PfTfK6IRyIhqUt8IIGxgrAaKWfQupF/t73ZpHpZqBNln7Oh2xKsjlCvNak3BEwiqxI9SB1CA8RojpiWxi7VPXpI7rTW4ZU73aziXYmHnJH8g2mGRyz8FcGKpR3rKzQgj1mTNaMMyBw0l4t0742J7JZzj0zpOhbfrigxVGyD7Vf16ZLzJy5CavHvuCormE2uRtSjMCRWJumFtLhI4GtrutinPvSFIFTf5nscl+kJfeA27x44jO6gKuSuQM+1DZRRn9cCMqiTQeiATId7lj0ErNt/9i3kIUggARIFsuyvCapD9Q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99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Aug 2018 16:15:46.2347 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e5784ce0-de6f-41ac-3f1d-08d5fa2589bb X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR0802MB2547 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 No significant change since v2, fixed a spelling mistake and added/removed some newlines in 01 and 07 patches. I plan to apply the first patch of the series and the patches for the drivers maintained through drm-misc(that go Reviewed/Ack) in drm-misc-next on Monday. For the other drivers please let me know if you want me to push them in drm-misc-next as well. Changes since v1: - Make __drm_atomic_helper_plane_reset consistent with the other helpers and require that both plane and state not be NULL, suggested by Boris Brezillon and Philipp Zabel. Drivers already check for that. - Add a proper commit message for driver changes. Drivers that subclass drm_plane need to copy the logic for linking the drm_plane with its state and to initialize core properties to their default values. E.g (alpha and rotation) Having a helper to reset the plane_state makes sense because of multiple reasons: 1. Eliminate code duplication. 2. Add a single place for initializing core properties to their default values, no need for driver to do it if what the helper sets makes sense for them. 3. No need to debug the driver when you enable a core property and observe it doesn't have a proper default value. Tested with mali-dp the other drivers are just built-tested. Alexandru Gheorghe (10): drm/atomic: Add __drm_atomic_helper_plane_reset drm/amd/display: Use __drm_atomic_helper_plane_reset instead of copying the logic drm: mali-dp: Use __drm_atomic_helper_plane_reset instead of copying the logic drm: atmel-hlcdc: Use __drm_atomic_helper_plane_reset instead of copying the logic drm/exynos: Use __drm_atomic_helper_plane_reset instead of copying the logic drm/imx: Use __drm_atomic_helper_plane_reset instead of copying the logic drm: rcar-du: Use __drm_atomic_helper_plane_reset instead of copying the logic drm/sun4i: Use __drm_atomic_helper_plane_reset instead of copying the logic drm/vc4: Use __drm_atomic_helper_plane_reset instead of copying the logic drm/vmwgfx: Use __drm_atomic_helper_plane_reset instead of copying the logic .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 7 ++-- drivers/gpu/drm/arm/malidp_planes.c | 7 ++-- .../gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c | 5 +-- drivers/gpu/drm/drm_atomic_helper.c | 33 ++++++++++++++----- drivers/gpu/drm/exynos/exynos_drm_plane.c | 3 +- drivers/gpu/drm/imx/ipuv3-plane.c | 8 ++--- drivers/gpu/drm/rcar-du/rcar_du_plane.c | 6 ++-- drivers/gpu/drm/rcar-du/rcar_du_vsp.c | 5 +-- drivers/gpu/drm/sun4i/sun4i_layer.c | 4 +-- drivers/gpu/drm/vc4/vc4_plane.c | 4 +-- drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 4 +-- include/drm/drm_atomic_helper.h | 2 ++ 12 files changed, 41 insertions(+), 47 deletions(-)