From patchwork Thu Jul 26 16:17:54 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: 10546137 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 0502C139A for ; Thu, 26 Jul 2018 16:19:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E4FA92B418 for ; Thu, 26 Jul 2018 16:19:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D79B32B88E; Thu, 26 Jul 2018 16:19:02 +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 89CBD2B418 for ; Thu, 26 Jul 2018 16:19:02 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id DBAA56E7D1; Thu, 26 Jul 2018 16:18:56 +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-he1eur02on0602.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe05::602]) by gabe.freedesktop.org (Postfix) with ESMTPS id 7279D6E7CC for ; Thu, 26 Jul 2018 16:18:49 +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:47 +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 08/10] drm/sun4i: Use __drm_atomic_helper_plane_reset instead of copying the logic Date: Thu, 26 Jul 2018 17:17:54 +0100 Message-Id: <20180726161756.1794-9-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: d1504a7a-cd7b-4f74-6be6-08d5f31377ff 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:5kPqF3/FL8o/oq27YkFHknOHcCKv2Cl3TFpk895kEr0SzUqVswqwS5mj3/THTtznv538VKdVz/m/F2CB/yO5V+2c6bte6pWWXuXqH05+HDqwBIRStxD+2vASTSNTZ9Hfapnr36BpyW6+ww+F4GRqttI0Alw6ll+wXQMe3NvszfBUEu3pMTzL6bPkn+IDeMeqNcxfsRIrU5acBMuwC48g/gDRcdLmuTi8V8roVzuAjynSxm5lDoru6CLwmE3NVTO4; 25:M05R+fhH4D3+sVtBsQLSMiUic8M4kZmlk9rq2sBNjA4PNB5wtXgTerHvztslySDJP30kOWbbdu6h1IXe7O1/vEw0QSDV8LPY4Xt6njPAV6DvjBrWBJDgfnMaFQ7xyDZHIgG8bLOMJtcSgadYPYmS4JdPUE/GlolPIRovcQTgkRrIPbMTJoMFa00JcjGiD1EBJSqJgP6oMjXvEEFHkcw73STKCt5JzsWG8rQrNvHQrNGb2jIzaqViEOg3tCcGMkXnlw+ZIbbRrhNgU1DVeE02kJQX0HYzPSrMhoNEoUwgBUeeJFxef1MNjiXHylIvIee8InN4T8dB3aCkAJH2HckYWw==; 31:gieygxOSlyHaneZpjEfofPUCcAlf8rHGg8cKs29MwfMWTyWRjz2XsrfuBIlSRXbmtrppWU+Zv0z34tm/b13Q8FhGJ6XkTZZO7KMXFhMKPglji94NFOyQdwI1/9O60kfi/XkLcpl2U4MBW1fmm9wBqsE3MlHA1IBJN+6OLrEqCsnXB5h/mALHe/e0HVMUhGJhDphaHuxEiFenluvbYKil3pIxlc1U/+2iprg3VMwVM/M= X-MS-TrafficTypeDiagnostic: DB6PR0802MB2552: NoDisclaimer: True X-Microsoft-Exchange-Diagnostics: 1; DB6PR0802MB2552; 20:jIxPrfkvre2mxu8kdAocxguIfSMpf8U2RtL/Og+FjvE+8NAVFeTP2xtQX3Fi3fZgBtwJppkOlTwJa7EUHeVU+NVruRwsjsLOZrtRIwKGu36Yh2vEXXr4kSwsNObsnPJHvnxaPOC6VwzXzsqCWAaV7Ql/oQiVXpiUS54HdHZAfawC771oo3r/8r0s4STXa5HGWWeDtsFjvcua7BqbjSJ3TGoF/qY2HIG9sq+uMjMpPdossLM5/xfmey31GtpSMt6ZliFUasRO8Esvxehi+Om5gaTPozzWECFmsEFKnP+UgjFy4nmbig0SkdQkM8XcCmgpa3Ao5/cXFyxkTGNL0cZTHQ==; 4:C4juNiYhk/0k8vPHrBWeFoX1+mjYh8bbBopgglt5hKGrubI7hBXmx3euKTrCNLh1OroCqkFfaK4C6DeDjZvxVdGmopCdasMsB4Q3Q370KU+N+UfVQEGZVdI+4qay9N0NFBMj9DfFh3S/hIaHEWiZLNyUCz+MguUUdgboRp8BUpUOzPhOJaJelZmqx6mWT0f9ePOArLcETpHA34lkTuMOwNPYdWpvFDugg6paEZiWMIVeNyfmcXdi/9VLFacQaduF1N7Z7QaKnXBj3elULiqADF+fCD/sG/z8KoXNY/7/RxsI3kmG34EydeRDeBGdhgCj 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)(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:hV/rbKFGMehySohUoCIuedzuDgwHcXxsl79ag5+?= j48HAivutH3mAU0XoVBa4EQw4EMF75Cq3ngDSRcQT2vQWVpgNZI70JybjIErnKChjAdfq2pRJj2dCiFaodytKW3LID3zOUUCASezEe+fyl8stcPdq7LYsIyy0HsASCm+Ks1BBe/VvuRKwxSYCZ0Z/jVxAP4Uk4U8GCmQ4684HH9zWDcMSnKOzWep0LxVsDapP/Zub4nm2gp/01uRlKAHEwT2qScWmc06izeI6Bpxw/AStSTAP8Eut1u1UcfIvLmAMETokDdKkNpe3dS+HQqkne0xDjjmkirLfuRCiu04aP5UVLXbHtypUPyNLklcJfMEd4s44Z2pRiO13wqbleSxoxZ+y8REvZ54l3QvpiNVztjq4DYIZoHhhEsNrQv1FcXIEOuRfJncqLqgYF7Fkg0wqEeRWdT0wQP2AdECmRXUIOTEi0pA1xE1jQvoV2lrcEQoPmJGu3lPxFe9eCEkHr7VC5oIKbgcF2KNgnGHKjFmztdO2LzttbDjFsv/bn4uebrA3W0k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ugC6JkkJ1yWH9c= X-Microsoft-Exchange-Diagnostics: 1; DB6PR0802MB2552; 6:JLA2b0usQBhNUn802bUJRfDbo/ZngG7zq2olTWqzdjIwwqg+H/7rfPIJrFGRUGouevA8gczEhuCxZVsshpKL1BucATDfwKSai9DC5WK5QIPMwCvJyeZxD4d4MMfrrXFY+rns4j1rk9rJTWPkbUgDathUGD8iK7pAB9LOPvt1vdude9N1BfNpWTnFNoLuWodJYXJXC/xj4dkZ79mQkszKtZmBKYTIiBTEtBvi3jl15K5eIP5C5NcUnHtEvXnpxsDOrZzUSUYHhgIPpJVn1iYd4clQPmOeU8IfUg8gOAFS1/+M57cJ0Dd9RYmO4rmjkto4w/e6V+ucclh8/u32uezO9OwC83MEkIORhIQ13FNhO5YmBp8HEK9mLe/BEC8fW10eYPhxFciQq1yDcWSaSDMYq17gOPQ/BypnhVcQA/JH03VKWAo2m9BcTavJ2kkBZw+euwIrZDKl1z5LdRUJ3u155Q==; 5:lv9cpWLhBTLOFhaJd7SwAmYGctxwV6345SxXZMdZ4lixcWRZsGqi8TLVhwGErIYgnG8YnDhmSiqmuP0ychiBiVMo98D8jpGRl6wjkp2aFVNTWGx+nfNzrw7MELd84PUwksmBLqAJYZuXkAPrq0RO0n1kmO8TeDlebkZD8HFbvCM=; 7:AF8/YHfbvhn7g896E6VmORJ5epV0o397Wm+0LgiHR9S0Ivdo+4d88zWryf7aCap2ax77QX9DaijenN1+kxUWIAgP0MYlFHCGtapoADqgCrXcRaslu8nWZp+RAgtZmhO1UjbsOVdVwxyJXI7qjK28/9ZON/Y6Gyu0RZ65W9ieJ+aWx1McOtUSzFp24Wu6zVgZfpGZRgVN1tiq95HuO50r6EJNZmTeb0fC8KGT//9wIHwHdvvm/0xepMfwtPDnXR9b SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jul 2018 16:18:47.1697 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d1504a7a-cd7b-4f74-6be6-08d5f31377ff 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 Acked-by: Maxime Ripard --- drivers/gpu/drm/sun4i/sun4i_layer.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/gpu/drm/sun4i/sun4i_layer.c b/drivers/gpu/drm/sun4i/sun4i_layer.c index 750ad24de1d7..78f77af8805a 100644 --- a/drivers/gpu/drm/sun4i/sun4i_layer.c +++ b/drivers/gpu/drm/sun4i/sun4i_layer.c @@ -35,9 +35,7 @@ static void sun4i_backend_layer_reset(struct drm_plane *plane) state = kzalloc(sizeof(*state), GFP_KERNEL); if (state) { - plane->state = &state->state; - plane->state->plane = plane; - plane->state->alpha = DRM_BLEND_ALPHA_OPAQUE; + __drm_atomic_helper_plane_reset(plane, &state->state); plane->state->zpos = layer->id; } }