From patchwork Sat Aug 4 16:15:28 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: 10555811 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 33D7113BB for ; Sat, 4 Aug 2018 16:16:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 232F529C0C for ; Sat, 4 Aug 2018 16:16:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 16FF129CF5; Sat, 4 Aug 2018 16:16:40 +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 BD97029C0C for ; Sat, 4 Aug 2018 16:16:39 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id DE96E6E15A; Sat, 4 Aug 2018 16:16:24 +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-ve1eur01on0056.outbound.protection.outlook.com [104.47.1.56]) by gabe.freedesktop.org (Postfix) with ESMTPS id E3DF06E15A for ; Sat, 4 Aug 2018 16:16:22 +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:19 +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 08/10] drm/sun4i: Use __drm_atomic_helper_plane_reset instead of copying the logic Date: Sat, 4 Aug 2018 17:15:28 +0100 Message-Id: <20180804161530.12275-9-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: e1f841eb-7b53-419c-3f9d-08d5fa259d9f 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:bF8TIiolSsmSkKT7Mal6skJ6aAEA6LO9ZUaFaHzwZZ+YzaKaVeDJBZZtPH+rn1e5xyRlMivYf6B/DfsHyi7ZXAwl9FWSbSxQKTmhxHo28SGFT6zjWN1oUaBGNa4FF4V1NnUv2255EYVSzDgBZn/+0tjepgPv+DqhvpbelWrjyIjgGoWP+W0glTP7wY8hHOU5yfoKvC8X8KYvSbhTIIsPSbKfGSzgVfKE5AAI3oYRskREWPzUc2FODF3dlT6btH+g; 25:W+FUo0ZHyZmrL0VUhczodbxTkCrTbqbSFeGBk9FUrh/WG9cf5WIpqdgWH1bcRVU8B11b86N50Bj7B1eTG3GlvTKOXD24U1DtjJG1aDsscfKURaItiS3bRvXhp+OKRJu8LMc9Yasjvi9cf5YHffNGLZ2fqttYMhbjdL0PiKIC65naRUmBts4FSLZnTUz4dYmhRr5t7ANl7O4rlY2OyKhIWrphWTYfbPjTE6DbDP7Vu88lkN5L/JoAiTYEg9NpK25f0MH0ICZWbNoJD34PVyb9O1wRizJYTewb6BxHKQ/Km9o2HIEXBte0Cs42gk0TZLoW+eJF+1AGEBBZIS1e5FTFNg==; 31:FRGv5oHLt2Sph17BnfRIox9+IHqJmYatdnbPT7RHkhMaB37hpzRL8H+C1bx6Cxfud5pvtrBp0mnF1LP3owOz4WPPHfpcRVCcyGyjwKbzZK9o+2XOznIjbzkVqd9Y0nH6eVVXacnIXxTzHwd0wkp6hjnvfqoqWUzoW4m/O59B+z9fXVBOawVReOoK8raYDcPGT3pA/m+gxMbziwgWCTOD7IAJOgmkjtyME8+M08A5G9g= X-MS-TrafficTypeDiagnostic: AM5PR0802MB2547: NoDisclaimer: True X-Microsoft-Exchange-Diagnostics: 1; AM5PR0802MB2547; 20:10efULiSGspk0BVqvtfVSSDAO94oJvkZhZiQkKbstqV6qj9d/aHXTJAkjgJqNPlakX0C7jOjm7ob7cQih4AF2jUFvpVn3PpNJJW+Z0UhHejZ5JHBGZ3BKVxRxEkOf0ZOR1NXpURhp3hI4HPKF/fCnTmpLe/stc2uY51rBOOJIGuMrgVAf0FmVEo+7G0cipwEF92iMfPWcO1p+k9mbwLBpWO8MmvxEUCipHBCBNOEOMtzloojMvgYU1C3GPfSCB773d+wIM+AurANvvXcxtGdV8CGm3DJV7tlWP9617y5iuimhDAIYvnF1vbBIYyM6/Q2/85y0yhExTSmYb8l5P8xRg==; 4:qQ6JXowYC3WK2Sz2QpS0v5AOz434Zz1GFJYfczhq02ipd8lQ8WP5ayy+Yw5ETudAX3u5SALBGvG4umnvL90OGvoooaTjdnQPPFKFZZ64E0vHNg4V+VYJ+RwZBSFIwFcUtPHB3WUYdYlsPLeWSoUuch3Yhqbi2Vb50FMURI2GahyPXAHowYvHkj5DRP+BZiVSsfbVsbiZr54x7lRTTlpRC65aX9045bKa4wHreFw+DstnH1DmDhoZgaLM/36p67Pgo/KTiAAzTskItR6Jgk64rSLKliyX9A/xl7xje8e8XCNkpwm+3cKIBqYDLPa2A8gK 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)(47776003)(52116002)(97736004)(7696005)(305945005)(25786009)(16526019)(186003)(105586002)(6116002)(3846002)(956004)(106356001)(7416002)(5660300001)(446003)(1076002)(11346002)(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: =?us-ascii?Q?1; AM5PR0802MB2547; 23:aTESOSKS+oPd2RX9IDi0dk8pBCqsRK7fNyuZb+R?= pl/WHeOJHox2R/nRBKAcDPf1OA7yJkPuoBKtpzUd864riVlC2qOp44grQOZJeu0frWqX9M40ZfEsKdR83n7SosbKSI8OSqhLhcXyCvzx40aoWKH7w3hT2t4zaFP2GOt/Dvmeo9b8oryZJcteH0vYu1kBLgfUriyecR3yr5D4OK/OlPgPv+1JwF3AmDmlox/V1xwkpGpyP1onBPS7U8AZhSqpUtW6Nd0fqS0SjZ8Bd+H8ebgJ0P5cU/YMoydpgOLRIwvet7y/SP2TH8JEf9vBIMYfy1PqrIiYU1/sUfOhaJT8pFKxAjBh5JnM4WAlkT8oSd0XurCbyF1bC7VCFRLooz+1XPSnM7zkoLER68mgjD0YNsVBriCiAyFhUT+r/PqwrZ+rJENWZeG9gfpyMcNFSJhl1Cs9v0D5WXZngl/ZOP0KqRVZY0fhbYSbPElIvsaOIZvYpzsnNrOlmeqj/dB+7qios0bec6x6PSupWM4C5+OD/gRy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RTzRxu+2q9kWYHlisL32MC0ZcUbln3xpOeFXfWVlHFtsZBpajjiCY0cZODIm6b27Fo= X-Microsoft-Exchange-Diagnostics: 1; AM5PR0802MB2547; 6:ls1qnt7cST0a2PEbILjAQxN+eKjXRnPSIjinrXkH2F79TbdkeEktextUD/4I+D8ZLcl1VyIM+sgW1U7zeb+C6kFOliIlPOattzfBRSnHz6YK5E/h2WNHv3hUYkmAGxC0J89F4p/3/ObEila/3ZjWCuHRev8CliEiSCYOM6Wpn713GLzLqfxjcCbeMl1/A+bXocCxJ2FXjZvdXp/Loa4s+l5FsYslqA6BwcFZn4bdE79wwJco2pGhr3J0xN+toQKKhCtksvACtaEj74biFMHRpHE8696dvk/vlaDCGJQHTRbNcZqoMfeXrDi3NlcfsWUrndQFCayCcmrP03iFH7HnACGGba6ndaPmcqnjNzES1kQKL5rf/YZmVlbtKblwJG9zc7ZmpFYhbpxVtTjMML4lX7iUC5wv/2wcHh1oWs3Xr/9OJd3R0BXvmVGgPyo9XHSuIPa1Lx9d2CQmGyP6/MfQyQ==; 5:2WxKyfUOrnn6Ma82opHJPXRvcGuw3DyHiLKB9NwejMNeZErZA1egk02b1/NDDeaaQuxKdo6xZcAxKBN22/GKyXtmcoBtL1F5KDYQVyRKkboCVnzEebbxYjs1xs5GSmix85Gc9yjWR71fwx+MHS/28G3xvtTxLxP+oyYKfBp12qs=; 7:0mky6FrG1VS4sD9T2ugvK5yndAVp8NeUlV2UjF8NDqKmpNmsCR27Ix3HyBofQS8qxKk3H9BWz5Df9LETrsg+YrniqaIfG0rJxwVfP5I30tmf2AVhRKwtdTxQrPbixrWLu5r46lrdfN8KPyjDAdmIUSRsHDWDrrj/JSrFSAhBGtkI51uh10IyKyer7sK3kdl7WP93q3/0GzEhpljWJZpYgoNjUzkfrrZpIipGF+L+icG9pUFwe+yjmg2Yro79YZHH SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Aug 2018 16:16:19.6066 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e1f841eb-7b53-419c-3f9d-08d5fa259d9f 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. Acked-by: Maxime Ripard Signed-off-by: Alexandru Gheorghe --- 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; } }