From patchwork Thu Jul 26 16:17:55 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: 10546145 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 0371B112E for ; Thu, 26 Jul 2018 16:19:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E5BF22B418 for ; Thu, 26 Jul 2018 16:19:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D8DC12B88E; Thu, 26 Jul 2018 16:19:08 +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 900742B418 for ; Thu, 26 Jul 2018 16:19:08 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 12E976E7D5; Thu, 26 Jul 2018 16:18:57 +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-eopbgr10042.outbound.protection.outlook.com [40.107.1.42]) by gabe.freedesktop.org (Postfix) with ESMTPS id 900166E7D1 for ; Thu, 26 Jul 2018 16:18:53 +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:49 +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 09/10] drm/vc4: Use __drm_atomic_helper_plane_reset instead of copying the logic Date: Thu, 26 Jul 2018 17:17:55 +0100 Message-Id: <20180726161756.1794-10-alexandru-cosmin.gheorghe@arm.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180726161756.1794-1-alexandru-cosmin.gheorghe@arm.com> References: <20180726161756.1794-1-alexandru-cosmin.gheorghe@arm.com> 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: 129eb402-936d-4610-362d-08d5f313799c 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:IjxoInD4c00EpmB0iBcmZcdIQInsh+VyAE5doCbml1IEAdm0dbyamNwBQ0iwZJ9tdB+Vis1lE8MHtdC7nCSTUZ9JasDi1gPv3HGAOjOzO4CK0bUWEejG9M/hzFxI8tQfZfeygfN84+bBDorYawfh6P8IQdA7vAlKFuTAEpmaSOndQ/a+vq0brZ3EhpqPqINnZT9orFal9E3KIPk2aKfi6UTywx5ER7RCPN6AIFkvl91H2/S9eF2YKFid7sKi0u/D; 25:yVKNlrHzQX84vf/cXeWciF7HcwsLua8BdUhUrxZRDXFmndt0mpjm3LKYyyxyedWLHgc+k94h+7wk4W81SiEgPYr43sszr+WTKQmZzbfavDbN1y016YoCtNqjxJsE6UdoqaWqCDtsDw7DvXm96LlTw6e1V53lXfBwXigUTqxK/pCv4ha9bZXDQdKoPYf9XiVtu0YaqvldIHq0QbeDme3vm1r5AunJOV1DHChGuiA1z3cB3R3a+oXbWoBJtqEwy4VVc14gzMoFGaAXypLgKWwVOF9PU8EZCEzKekjYdw4Eoyro5uf2Lb/Ow9yaucvqAMbtCKNzdnXLmZTMIi3eJle1wQ==; 31:GgSCOG9aRdanTOadKG3YiD9NkcncLYyFG+BXSqf2XurE0jxBQcoOQlgLcg/rf6U+N6iUfBVztcEWzkvOArBurhzMRgOdVBdA5ZdbLvY1QJxfkTeNl7gbeQfD0vJjkB/l2pzc1gD2KfXjycLIb92RkUqMR9apMSbvcVD1G1pgWCd/QR9KEoj3Jos5c86rLjJ0dCAG1rrGsA84AfYjCY3JYlq26/lWpfz8AaiqJU6GMHM= X-MS-TrafficTypeDiagnostic: DB6PR0802MB2552: NoDisclaimer: True X-Microsoft-Exchange-Diagnostics: 1; DB6PR0802MB2552; 20:sb3+ehAP1T8n6y/yJcfAt5Fyq9bS4Z11t2+D6QJKlu135RIoogTDtJQ38BCinlK0wt5jfGIpfROzeqnPhCVfjcOumwL3djbhcXNFdcIoWA+faQc+h+OtjoZ9JgbrgqrPHZ7vt35g1BMGJzgziyxXUUOxtFlGVEg5P70t7KcLDRQgZ4vj1JFT+GNeM6xsu61uu0+XaiGjxmPkISszuzyoxvH2FbEdJsJrWIVCv98Z/VFM3I2byHBAHl4aSOWiJ86zjy1OpbbMjudAI9D632YnLbH3sehOqI3qCKoqiGmuwqTpdg9tPUWinGa/ZCSIXyummk6IEVScw9vaTxs+AiXFvQ==; 4:Y8aoap9lZyMGPYA5ytbntxy3az64iDf4AdYq+FqazxPgKx7ZgDz3b6M11jYN0OHyPaMZYLBt2CTjpZk1wl0eppIMZ7Oy33wBkttTmcYNexkR8vYuXw1ZoYDpRWY8tqWr225726NOk+Q4zsFFtVlOS/J676DKnV6dXY2vEWeMA/R5aLm/NhJ4W0nJ2Ea6YRbwjajHWlwZ3BMR6gm+Dkj0vnlbuL8dnQOMPE3Kthner1Eu2ivb3XVpVEDrF0qa08cTsp9Q/7XxplBYQRmNZzHqgkR7lip5lnHHfJuvpFy/PQLBpxeWWU0+iyOUx5p0o440 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)(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)(1496009)(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)(446003)(1076002)(575784001)(50466002)(7406005)(11346002)(7696005)(3846002)(51416003)(6666003)(48376002)(53936002)(6116002)(386003)(26005)(8936002)(5660300001)(4326008)(76176011)(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:86OSP8mYMBnIvkbHRsTft1Gqw7MqgfR7yng7GLq?= RouGMcqSF++6Yhd9r4zzr/QbTw0JtZFpe0rawyEr6UrdacPfVpWtTWwna7YfvCgWwDiJUn+aYebXltvLc0zMXDzPOOGgG7/7I0Xq6wOGSP0k1hYhaNyBBEz9Yb73dIekKtA8nZX0S8g5ei7kTVhRzx6AMGPCZQR1qpzs4E6aUElYN7rutzd7ttVIruuG2MCcFEQY3JxdGP4um90sf2Oj7fkWw5b3KmOhhJsusy4Q9BcLVV4jbSbCggiq+LEZBIkrlxOXN3GQSiSFqofP/8rGxFtzvF1ToyYmHehhL8WH83AbXJuUZtstF9v7CVsGj9LHwaInYzrctsNqVr9uDpAtR9E6sP2UoLIasHrGgJ9WvqMYkXQeOLF4iKot/wvNEZdh4wjnGw85tacfy88x4I6myCF0kDXWeIPfBqBZGiIlBJBAGf7gdAvi575Zbj6QdZGYRJKBYbfqCyog2D/T7m2FVMQmprbTlfz16loFelQYEADJBhADTGcv7zSQjT4XfC7B+R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ArrivalTime: 26 Jul 2018 16:18:49.5687 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 129eb402-936d-4610-362d-08d5f313799c 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 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 --- 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)