From patchwork Sat Aug 4 16:15:29 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: 10555815 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 30F43157D for ; Sat, 4 Aug 2018 16:16:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2046D29C0C for ; Sat, 4 Aug 2018 16:16:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 143C629CF5; Sat, 4 Aug 2018 16:16:45 +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 BE82629C0C for ; Sat, 4 Aug 2018 16:16:44 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6AAAE6E15F; Sat, 4 Aug 2018 16:16:26 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-ve1eur01on0070.outbound.protection.outlook.com [104.47.1.70]) by gabe.freedesktop.org (Postfix) with ESMTPS id 3EFF66E15F for ; Sat, 4 Aug 2018 16:16:25 +0000 (UTC) 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:16: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 v3 09/10] drm/vc4: Use __drm_atomic_helper_plane_reset instead of copying the logic Date: Sat, 4 Aug 2018 17:15:29 +0100 Message-Id: <20180804161530.12275-10-alexandru-cosmin.gheorghe@arm.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180804161530.12275-1-alexandru-cosmin.gheorghe@arm.com> References: <20180804161530.12275-1-alexandru-cosmin.gheorghe@arm.com> 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: 7b89b1f3-3e0c-45e4-edc2-08d5fa259ef7 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:Ky8nNtoOTbOtpSPraWE0sfLkOcAP5k2nqUPnhzEHdbC75f0X+ykh8egVOS8qvhFrZPBBJsdbsTPJoTfwGm5e2Rp4C/1nhD8GdP+JJoYZtYmvoG3XQxAB6cXCdXOgnKTfLEym5Dp5+9ks2D2ZFutnaShOVbKC3J/xBqNUCYvOP/FPyrCgcqTbpBrXsx3DWrwhx868vf9d9Bljv4eEJ6z8hfdG/+sLI6B7BeQxIGX4JgV5MHmgohr0mtOTC+XApbtl; 25:KBlFIOpnsx4WBYWxdvv0BfJqEc1DrXjAS5Ql6t4VeIQNomXEgyGGev7CaS6++O74XKu0mn6+G4D1iiL4Q+kQSF9qtutWfpprAJTjyqXp6Oal5LA/LWiRJ/estVCFQqusXRe8Yg9nJNwt0gz3sMWSMFDGpfv6ilNnVRLxMlhByng5o6brWHD2VV75Be9lVBthsDNY52mbLlSlJOySXoCTwSjlE2kB6XOuaHXS24i3FPx/4B7wH3r6vr6VDKtcSf8Qp/LJcuue6t2YjecK/WE/NhPmdWq925B1aT7idz0/aCggrvQmhY6+nYF1q8/Ky+++VcHR4kaOzDz+4N20vSLdDQ==; 31:uwVq5dZNNFt7zHNE+8cdKatCyGjk09rADFOAOeOG0BN1rlgCZH9OQy4j5oG3HOgxRQvld44iHoUznPq4PKMiVRfy8nXUTVAyeOM4OwPEgbNfrbFOhyoICmqxrat3Gi3dZEeEGYHc4OBAcMbseeO/CiZIvJb4wvMZ7aSha3uTUpt6Kqdq+E1AHKygr/zJF1simKjnHOe2oohSYmM/FjSjBZImOKvPM7fgNrXh44BcmzY= X-MS-TrafficTypeDiagnostic: AM5PR0802MB2547: NoDisclaimer: True X-Microsoft-Exchange-Diagnostics: 1; AM5PR0802MB2547; 20:m+NzMDUkrMI5FzGxtoR8tihMkPt61WhOiRZu294sJ/d/bQKAW+P4sOWWXKOPtqjXfDpvXUAh/U38I0FG6WRMyCoedoB07quxKWTgu93XycWQQnPUO3FETZMJfaR5/6O3FyD0WWO5/yKVa1/czSCP/j0ot0YIvBmTPnnnRjcF/qRv9/5mwyvN85VvBBeAEx/j4Gob3sS49vzxDmFNK3Uj31D/eEC2I2dgyiO1hHInCOeJFjYg2hIRr4LouMnySgdL8tXs8mKGqi4Jv2WRv0hBOf+hA2BjKCmee3SYvlP9nG6j2GIY3ZiKB9kaugxcRWqZ4NX10PZHiSPywep7lmvi/Q==; 4:b998UBF6zTWMMcNoxpQcpd5prTnaeHN0h7wxGnouZw5Ef/2BVsK51/zoavIqcQLHxkPN1uE1Mg0ePhrUIIR7Irn5gMx2h/3A1YXMQE2MtEHWzLvsfUWA7mOx3BmRcU5zzLOyGY9QVsUZEfB/yf9FEJMXVduJcQxZmxRr+4myHspXD3RMhU9OqwUX152VB0/0/hBMonfWX0/kpkd/yCDkggWw3gZRB7taU0uFQ5404EwVfIPZRrJFgrWoLmC0hlqbLfxDMYuMwP4P3aV+oIAJaLftr45PhEl3p89jFkWEhvbZbuFdUslC1TY/90Jm35cL X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(180628864354917); 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)(1496009)(346002)(366004)(396003)(376002)(136003)(39860400002)(189003)(199004)(51416003)(86362001)(76176011)(7736002)(4326008)(66066001)(575784001)(47776003)(52116002)(97736004)(7696005)(305945005)(25786009)(16526019)(186003)(105586002)(6116002)(3846002)(956004)(106356001)(7416002)(5660300001)(446003)(1076002)(11346002)(26005)(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: =?us-ascii?Q?1; AM5PR0802MB2547; 23:umRSz7LxIlWOB7wgncQc6/l6VcQug6q7VCenYge?= njwxtORnfZD+6a+bCGw0ogsAK6rMbN97GV0TUBuP2Ho/sMn46Qv91CaCOVGeTFLQF3YYdzcjgaBPrLXuvH8wbk5KERwt5wNqo6a4ntzShMNOjPVEmf0Nf2GwKyBbFC9g1cv/l0Zt+7w5uU1g4wlorHdKPOI5JuYE8SNQv4t44rjTDyNtdUcmBXlxwA9gHyy5/tLWfVaD1EyXXUi+ABpPXlaiVuFUI9DhTnMEu3G1lmmvYNM9IzvJaAZeCg3MOrQ27WeEK3IvaTfjqAG1bymUUjfZxoao+0P6UyzRut+qPr8k4dNlAFK/tWSnz7CzOY+QPSI91rHAs3heQL9Uy4+hXqy8gk8Jm6PCGN3R2Ynlr1YfDVW7CyoHN7uHyGsu3PbH8JwBt2zmmnKeBY1hzSBZbf7O0J7Vuw10VaSAZK/hrCmSscwzZE3C++ppjrxOyPJNGyQjJyd1AhnITS2R4w2ud7wUXTtOj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2FicAZWd8IbzusiKqAGB/rBrdsMDy2XboG6i/q9Vii2FLvD7kzW/EzYRxk5GspayD9/k4ZWKs= X-Microsoft-Exchange-Diagnostics: 1; AM5PR0802MB2547; 6:qTW98Z21u3oDWVlMuaaKtzsbiM+4hyt0PZg8acfDULVWW5aXGbiXgm2iyNmPQMAC2au4lBHpBJ4SCafPCxsCLuNseCYNDqS/PPJcrX0s/7F7XZ+8runkKhWk7RM3yyqkEqJ5e1rcYc8VUW8q3UfDrF0GRKcx2ANH++ZKazF89sKQbh+wwGd1RqAQS8kqf12RJqBnxpZAub4MQ42YjbwUkDeSnnyPfrLLhBRKKTcXTkefhCFVmlNbXIvGx27rytOhTbMsyMBBXiKoxp+QN8wGMa9i8pwCvmG2WWhkZSiLsaeyLUkmwkRojS134G1PIUoo4d582mzFvpp4PhWU7jVfePeEillnKRql1zzsvOz3LyGA9NEfZtNclSNRtK8rtFEDJLISebc/h0DwzXW67MA/TTorB+6AeU3pS4vHKC8pZs9nXadxB9BdkcxEds1WoYsEHdSWi94Z+EIHxqm0ke+lZw==; 5:dWR1nwAltWD0r8ym9NHXxcXUxdofOHAmXKbKIyJ38zjctRYHtVYb4PiN8BvtFAMRo2iAR5HWK9KA057UWBkaYEhAYbx/60AIBPh3aCA/TW3tuFhupTGMaAPtq2g1V+3cPI+GPl3wfrbujwP893ZiZnkufS5odTCfjPGLqjxn0TU=; 7:DOfPTaxR5RF54YXrc9SiUjRnUi3bWAeodJQlm3bPduakh47K1kCI1zk8n0HWxToX1T2af1ceu37rnJGCPqDNN0G4Qij8YISXzbm4SpP50ZkZlrrwK9WK2GF74zqvNfcK1T6iTUEhfcjuARpCB92RokxvlT6j+1UyFOEqXaosdyRvnS5FL9QCL6fBzi52relCvW4j+qgSF55iwR1nJXVZ5kBRdzItcWs9Ovbh3VIHuP3UQ/87367hNRzrZty1wuKu SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Aug 2018 16:16:21.8625 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7b89b1f3-3e0c-45e4-edc2-08d5fa259ef7 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR0802MB2547 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 A new helper function(__drm_atomic_helper_plane_reset) has been added for linking a plane with its state and resetting the core properties(alpha, rotation, etc.) to their default values. Use that instead of duplicating the logic. __drm_atomic_helper_plane_reset initializes the alpha property to its max value, which is defined by the drm core as DRM_BLEND_ALPHA_OPAQUE, so nothing changes regarding the alpha value. Signed-off-by: Alexandru Gheorghe Acked-by: Eric Anholt --- drivers/gpu/drm/vc4/vc4_plane.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/gpu/drm/vc4/vc4_plane.c b/drivers/gpu/drm/vc4/vc4_plane.c index 9d7a36f148cf..688ad9bb0f08 100644 --- a/drivers/gpu/drm/vc4/vc4_plane.c +++ b/drivers/gpu/drm/vc4/vc4_plane.c @@ -200,9 +200,7 @@ static void vc4_plane_reset(struct drm_plane *plane) if (!vc4_state) return; - plane->state = &vc4_state->base; - plane->state->alpha = DRM_BLEND_ALPHA_OPAQUE; - vc4_state->base.plane = plane; + __drm_atomic_helper_plane_reset(plane, &vc4_state->base); } static void vc4_dlist_write(struct vc4_plane_state *vc4_state, u32 val)