From patchwork Thu Jul 26 16:17:46 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: 10546109 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 40330139A for ; Thu, 26 Jul 2018 16:18:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2417D2B886 for ; Thu, 26 Jul 2018 16:18:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 156F82B891; Thu, 26 Jul 2018 16:18:29 +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=-5.2 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id AEC112B886 for ; Thu, 26 Jul 2018 16:18:28 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A43556E7BE; Thu, 26 Jul 2018 16:18:27 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from EUR02-HE1-obe.outbound.protection.outlook.com (mail-eopbgr10057.outbound.protection.outlook.com [40.107.1.57]) by gabe.freedesktop.org (Postfix) with ESMTPS id 05D266E7BE for ; Thu, 26 Jul 2018 16:18:26 +0000 (UTC) Received: from e114479-lin.cambridge.arm.com (217.140.96.140) by DB6PR0802MB2552.eurprd08.prod.outlook.com (2603:10a6:4:a1::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.973.20; Thu, 26 Jul 2018 16:18:21 +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 Subject: [PATCH v2 00/10] Add helper for plane reset Date: Thu, 26 Jul 2018 17:17:46 +0100 Message-Id: <20180726161756.1794-1-alexandru-cosmin.gheorghe@arm.com> X-Mailer: git-send-email 2.18.0 MIME-Version: 1.0 X-Originating-IP: [217.140.96.140] X-ClientProxiedBy: AM0PR07CA0031.eurprd07.prod.outlook.com (2603:10a6:208:ac::44) To DB6PR0802MB2552.eurprd08.prod.outlook.com (2603:10a6:4:a1::22) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: be9ef9a3-a348-447e-3a31-08d5f31368ad X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989117)(5600073)(711020)(4618075)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(2017052603328)(7153060)(7193020); SRVR:DB6PR0802MB2552; X-Microsoft-Exchange-Diagnostics: 1; DB6PR0802MB2552; 3:g9q7RFon1vt0/ZflPbdyPrmpztIjEmHGyyh0cvAAXTPqsW/AYA9WT3YyFikelwLNPYsHlorcdxOFKNDiNwcXnr638/dWFT2ckT3L4TQ1wxI5Rgw22k6bdbXg8AWMP50LN8Q4m0RQI2QwwHWJ1qUqzN/IN3Ta2Xai384xhjVYKBxkk5umndj6h+yojOHjTecd+dH6gQnnc/rMGzKPLJvY6p/o3E8t+I7GnEOGg6eNsr+n3f1RokD3wjdJadsLHDSu; 25:Lj7ZHUKjwFHob0hL139yCodEEBTmio43Sf1YQDRD46nzPliJLnucmdqCNrSWdmQDEkmXaKE/NiAO4HMZ3w+VkiV0DArlBPzxSv5yhl4Fgtu8xnj6lNRNATWBip/o6mIMre2xu9h8ccKc87KMdc4lQKKmWkz2hSrDE75gmmeZZnVZge2Mtz2qzwapK5UpG5Ey7D2i2qV6a+nfEHhAPJUsVXTfIS1xjOG5i3/AbFfYO/x+W/h53LLgGa8g7BcCnk6/PgV8kPBKY7n0Ao60tFed/2GtIF/850foFn+xOIB3998XMV4AyOu2QZm+GyoWgMpYMbvyquWpbONqrAUFhq22Gg==; 31:QlmR8Qza5Qo7ez9CZObkodWYWHLrR6BW8ZxzUkOvH9gV00gXaCtdlqXucUDVP7YtpeKJvbEQhZo7wVo7wmvi94IFVVgX/Us0MEiSBaX8KPS2IrBDtbATmU7fP79qDiCtNAUoBqLmwdkwpXxzzaMU8pi6TwnXE6XzY6BJyfYpZ4IanYNoYePDwrIMga0oM585bWjSQz8Bt79AT5G3qXt4FNGy5iIhu17bsJ3/Op/xObM= X-MS-TrafficTypeDiagnostic: DB6PR0802MB2552: NoDisclaimer: True X-Microsoft-Exchange-Diagnostics: 1; DB6PR0802MB2552; 20:kN4ixP8HNpd7QhegBxzZ+cQi6Qk46sRigxcLgt2nm1jhR8YW9IZpn3jkLTwZkZGdbgIjCPONO8vZYv0jTGj58yOztsbCe3lvz6lRQT6rQL/VUHFPdJxtmmLKRY5YsRDfz1tr0waRIDm5QVszG96ta+Ckq0Kos4Wa3Wp04Z8kbklBogSET1ZBn2cu7leJJ1GTFaqq8EB9QeiECuetWbBHSJG3RvhnPH5Nw5m6i4Mltro2E+fzsCTUZwBM2dCs5R3A86En8d5oxNM9iTJLtgs0ixosxiToGGy85Orwe0u3IQ/yZqDArxCimavdVAL+lDmVxpV2dIottHjnR1ypYduXLQ==; 4:5OIqTFmJAAjF249Yz7lJelApn1jwZArcOJLN6w1Qm8m2Eevx+bAoAgNHuM7sGkbOrfaswNzZTk9bxaNFs9uUa00pjsz1kR/4cmkvvl3PTraNqhSVKCfHVHCwsqMQecz2SrReidq3fmpYwt7I3L2EtiGJgHT8ud2v7Of6JmpEoYXSqVvU8WoYwBPctYA+WIuMHCYPo5i6dl84ZVxFmKxWjOyWvA9VUxnYWeq8ZpD+lqPuBq2r5AYHnDtdZHCH8zbi3Pz/1jrXQ4LVPw34D9L8R/T162tI0Wz7aEIFi3q8K8rsu1GFInE2XJHG8AIYlzuH 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)(10201501046)(93006095)(93001095)(3231311)(944501410)(52105095)(3002001)(6055026)(149027)(150027)(6041310)(20161123558120)(20161123562045)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011)(7699016); SRVR:DB6PR0802MB2552; BCL:0; PCL:0; RULEID:; SRVR:DB6PR0802MB2552; X-Forefront-PRVS: 07459438AA X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(39860400002)(136003)(346002)(396003)(376002)(366004)(189003)(199004)(105586002)(305945005)(36756003)(8676002)(478600001)(476003)(2616005)(81156014)(81166006)(486006)(97736004)(50226002)(16586007)(68736007)(316002)(72206003)(956004)(25786009)(7736002)(66066001)(106356001)(47776003)(6486002)(52116002)(2906002)(86362001)(1076002)(50466002)(7406005)(7696005)(3846002)(51416003)(6666003)(48376002)(53936002)(6116002)(386003)(26005)(8936002)(5660300001)(4326008)(16526019)(7416002)(186003)(921003)(1121003); DIR:OUT; SFP:1101; SCL:1; SRVR:DB6PR0802MB2552; 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: =?us-ascii?Q?1; DB6PR0802MB2552; 23:xYrnGrtHzxHhYnE2LnZJajnIIzUssciJBzzBaQu?= 2hke+nMcvZE0AXsyIC9rBEjvrpJJBPRxehJdqWdkXHITSUcbCKHzZRtiZu7U1IkwyYO9qILK28/uyM2efTTHmMiFODUnqnNl4QMCBKQIzE2NIThck+vkBa2NJmLqi3gpqZ5x+JCZ5eo4BdtYy6ObOU66SuQyaDBtDWiE7rcIbAuUc2lQZhv5nvDkzAGCoLDLLxOb9lmaUGP3pqiQwTuBly8toGBtl/yheoGBPhaBdnoblf7NCnTmYGPoeIwDDpt1hdcRcvmeAd4HtT9YEk0KtuqvIAPdmJ9E1+qCo0xKgcObVdeq14E7XDbrb9FskNJFghGzn3IhT10mqDOdtNKdM+83LA/+8aQei417MLcJ7xU1YwjwFKDdCVyPU991YVpNTra3WR59S+gebkXGMS6OHd2D9/HqeRAcNJ8tukR1myrfeS+TZT5uJQGHjhHoa+RDoWBL8DiWQ2gaELEFw57Rsn/RtKsf7dS9Uth9S5iWjLYuvpXt4rLYJ14kW5Jj2vAETiF1m3UKH6LVdPe0g08W3cPLAgQoJEId63a8VOS/bzhL1VDwL1Wgzu/jEEQZGzfwb2lbcNBPwlTexGgAvZxZQk2uPr9eAUVUsroQBHXZ9G905LsHzMKr8cx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1dc6/n9TuFv5EZV1Op3B6W7q/KVbztXLCWXQPdwCe/gSSJiCeteVKlS7DKwzd6f5aUiB+Q8JzsPAIz7FRgRQaATUZKVHpcpu4rssaLAfT6cO1NJHkiYZKBCv502SI2UANw62txDkJjW4Kk6AblSbv9y17Z0vepSOd9TRV64k7KGOeFugmUbuS+xuAB2OnmGVSTI2545t3pwUYvKrnPJxTjAHwiZ9gxmj4apA8WWzNB4lbq/oE2/h4JFJOrKw06fS62HSzGgP04ETe4fHqiU00mAFRwJWyiWtvTpO+tqBqvWLM1aS0nctE8sWabkKOjSShPm/adWMj9WCHuYQgboQ==; 5:++mUVAL1uVuPvsmgi2GfMehv2zbdRWKAzi69IIPPeXwImtKliOC0SM9jrnbAYypVGFNgsCowkoB/Wyt0jCtUBOh0uiDbe461WN7nzqvjspJczUFygRTYHJQrrVgEn2YTeT0QqpO+9pBplpSk3IEhXUlLdZWIFhqBrdzWYybLnYY=; 7:X4V2gE2ABQzcQk2nKJnweOM5osWqGhBfnaIe6XukGg5zYz7xZpOcofrscu9xH7S43/TU0tX5EB37XsyEk5PRICKfsjpYqB9KGWaMpNktg9Hfi9ANh2WhyPdwcsUlK4pbvOZTQ8hZ41uwZiIQrsg2lCgO6leqGe4tWHDnYvSb9Dh6tqkfzlrQgyYhYIzGW1YJ/S3v1kJLvB8sADhfrvqtvnBtDn2PXUTqrPZgQTQ81wGiHajIoT14g0H3CTw/Jkit SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jul 2018 16:18:21.4652 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: be9ef9a3-a348-447e-3a31-08d5f31368ad X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0802MB2552 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: nd@arm.com, Alexandru Gheorghe Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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 | 31 +++++++++++++------ 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 | 4 +-- drivers/gpu/drm/rcar-du/rcar_du_vsp.c | 4 +-- 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, 38 insertions(+), 45 deletions(-)