From patchwork Sat Aug 4 16:15:23 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: 10555791 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 4755A157D for ; Sat, 4 Aug 2018 16:16:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3866929C0C for ; Sat, 4 Aug 2018 16:16:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2B46829CF5; Sat, 4 Aug 2018 16:16:13 +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 CF9E529C0C for ; Sat, 4 Aug 2018 16:16:12 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id BD8946E132; Sat, 4 Aug 2018 16:16:11 +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-ve1eur01on0614.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe1f::614]) by gabe.freedesktop.org (Postfix) with ESMTPS id 7E4346E131 for ; Sat, 4 Aug 2018 16:16:09 +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:05 +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 03/10] drm: mali-dp: Use __drm_atomic_helper_plane_reset instead of copying the logic Date: Sat, 4 Aug 2018 17:15:23 +0100 Message-Id: <20180804161530.12275-4-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: c98e269c-b1ec-4d92-2939-08d5fa259582 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:RnqN0oBK28mo+OoQ9Gq2h+4G2rwL+1JiBCUmYNouv4alrYDuV6koW9g5ZSrDDjjIC3BFQf/xTRuEsztO2gOvu7ADdxdKdOhVRlTNe9sWjl0H6LpoIGpUpii5/HwQZvtEJ9BuOUpiIYZkk8j66a2xEPmLjox8yO2dichDakQ/1lyDuQvK4LLsSFB/0CUaiUUXmqAmC4IwcOK/JiO2L9FYziveW6fogBzv3lDslddnTLS+7HajB3MzQ/Wbjh5cDiFx; 25:LFUZnUheBYs3WWR8W15mJzPUQKi5RruE8egHHjKcMaP2XatM6UuqrvjQpwlWkY9bfEskNpPxGTWzCTsOFJ/lhG5CeReQ2yaC71nvqmKWOLbbnByXzVCAvKaEUO6Wr2yuNo4ifk/c3sTqMRlsyRvaOx9zGmo4t9/EsOATynMRtc7Ch8MQvNQ2xDhcxvjp3lCP0k3yODsjsJmnzD2iz6s8s2dqZRo1fek/Za2PBrKkjecm5w2FTd8KjxBLlxpWC4/QX48ZtUixoeA40GCCO8lHK4MIE+e7PYfr49yuHUm5+Uy4nX4caJ2Y0jK7u3SAnz99E3FHnh3ugd6dScWehHO0gg==; 31:jELvGuWB7qdLmZOxA9b+iy15bbo+KniLGs0BKdbW+TKVS1Q6hW91G9QWa4tf33h9whV/KdD+u7fxGgoMQXOLj6XcObyL+8q6mXH+tJXUi/MVemZhY4Ch1UhDjE4L8APPidrMRHgEI0n4SOVDuosSKTBT8Wo4P2V0QaxdDWQH2xiBJvibj0JMYc1VBiu8x4LIEuUx9GUtLNXhzcVXshEaTA3rSx1IU2+KbtU1WbKP2oo= X-MS-TrafficTypeDiagnostic: AM5PR0802MB2547: NoDisclaimer: True X-Microsoft-Exchange-Diagnostics: 1; AM5PR0802MB2547; 20:BFfRuZAPsVNTVWwB+nl/f47s8nsN4dF3IqzTnD2sPm9SmSdlrwnFsOxq8QJqGJqrWrKU1kOXjfyxu62/WEWRWp22RUYp8WbUKmH+XKjD9S6BoaiWTJBx+Zv5t3TZAYrlElR7bfrR87hE9mo0w8VvUaDD/ovvEZhl3QgfevqnMMSDkbnduBvOnmliV5/4BOyzcRPmVwpO5s6TpQ5WiPXwBCwZCiBl5bJ0lpVbZwGvpAd2iTL4A1AqRemKErNA2IidZqDbV/dWMV7iznE9ujSmvanLtLrr2kxkug0C3ptjSHN7ycVZDeKKib0+TqdJyl+q57ingoLDmUsf6oej+MFddw==; 4:gfn+qRhK+pV68MIiLp0ABBd024A0WyxGYbFCjG4rsERkCtllLes7zi3CwwNgR8yPZiDayKkj5X6F/8R+1XEgK8NS3OjQJTPMKSveJW/BEFNVZGZlrOAgtmu+1PNXfH+aYLJ7ZvyNh9HgV0zBCKxk+CpnE7W8s6auJfmePyNMUDiPOj6v83+bTOtdb/t6gkrdcEocjdMDkNlkTqRl0Z0NPK5GmriPxbbu9KqevgxCqNXoas4c4mOaeWuFkzX9nsCxmENfHiCx69UlddJEcxoUCYRerlcx9q8jgN8enXC2m3QZhzWedIUrAYQ41s1HoMoV 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)(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:JpMt27/+eloKjJcv4AdnLKjckLYNMPbtf3zoqKN?= 6YNFrEKR10nunI1jOW7K4PPaQBYdzdxX97Bn67yr7ArUsQNOYoo3J0PwhvDH1OyX+X+veWQ6+yxVX/xKwP3vxbhz6huStIOrioEJuGTfVFdoiXg8+JfagxVm3l7rHMUzgZMLNxovW8R5KFRFR/ykirFiUbnb3IfxJDFT/v+QQca299oHSQLcAKKQ+9cvM601PB0eueGt/Hbj/FqDXZmbthguKxGk0zBlMqtQZyB/i8odZVTZlMllmlqmsrF/WL2dfzPN36U7OshvJpe6GaYw4N+Mq8m0M+JI7guQIac9SMKl+3frOsw6C4kNZPNRU3z818lIygUBs0VntSXaa98USeWapfNgKrQrzAOj+WfndsIBUP3D4YrujRqyyh67+FodBowJyXhXCXqs0JHA6Lg9x5Msdx/0bwJDLHe5INgcrVJeRIWOBHcQlD7EvqpEqyLIS3Vj6zMMbYscX8fXI3rXiJUUXiaQQ5bk+6Sv7ZZ5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MJqRrGGl6xapWljDxtZWe9qH3JKogFr+lLdVUM= X-Microsoft-Exchange-Diagnostics: 1; AM5PR0802MB2547; 6:RqnIBf17iKW8PvGOrgGiT30zxCMbV+2LZhaxaTsZHTPo9xeoS3DwpzG3Du16jHK7JhGZDN2idt4SfQ+Vx7prMHDSdz3UOtU/t9aDkwpQ+khaXkafbeZBjPIPQv1qQWLLsADDSO+OotHpOEmvhcrReF732n+g8/WTSFvvdZk8l+YjxIZ2+umEAI0Lq+Nc+EBURaJ+sXtKZed/e9HMqi+z7TjDcMWQHNsFtn2zfZBtD2XKYXKLFt8UW/Gu7x+wcrW6orMV0WtR+1aAY93C8V0uFuuw0bPUv8q8HKVJHPyueLEhbdKFw8XQIdn5ppQzFNQiqjSMc6fxbWAg9dwVK1nL25mbkrGsdZfjtSVODdZdlimuFQPrVL46d5rR/SqfeUvqeshwZKXB4rrDDyxgGWss0lFEy6LY1fJPca4dZqfDC9DxDbwhGy79H1hXq8Mv5vYWCvFMUgnSm4efs8JdkuHfzQ==; 5:jfTF3rNPgMi0HcUV/u6RhKYyVDCdS/TxUNN/0Zh2b8CAVYhqfi7p8HLs3wsNsChXzJiofwtzOJL7OUyKo8E8r+n3qieJFG21xfEWYhiJhiYS+7oIJtN5ZSW4HZvWYRfBgj5rNo/qNzuCiNCIsmO129jW8+mEZ+HeYSZaiX/gi+Q=; 7:U9t6NaJRHVXJad4TPwogbLBHWNEXilUGZgNvN8NxTpFF3FNZvQ9r6NtnG6GOA4vyJIH25YxdheNQVnzgIKsi+oSaFwcZZKYgEjqgFsoZRvIGGqrwDExHUl9Di+hWaoBOiGKSucsALcN1il0dWZvm6C1bkKqCaefWIc2zALsEKHCuzooojWyfRumPCsBuNiCS/aSgoom/0ItSmHbZws5t8gHQKWdXMoIYikJGUZ4HWEpdntLJ3afBlbygYDstgdyW SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Aug 2018 16:16:05.9902 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c98e269c-b1ec-4d92-2939-08d5fa259582 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. Reviewed-by: Ayan Kumar halder Acked-by: Liviu Dudau Signed-off-by: Alexandru Gheorghe --- drivers/gpu/drm/arm/malidp_planes.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/arm/malidp_planes.c b/drivers/gpu/drm/arm/malidp_planes.c index 29409a65d864..49c37f6dd63e 100644 --- a/drivers/gpu/drm/arm/malidp_planes.c +++ b/drivers/gpu/drm/arm/malidp_planes.c @@ -78,11 +78,8 @@ static void malidp_plane_reset(struct drm_plane *plane) kfree(state); plane->state = NULL; state = kzalloc(sizeof(*state), GFP_KERNEL); - if (state) { - state->base.plane = plane; - state->base.rotation = DRM_MODE_ROTATE_0; - plane->state = &state->base; - } + if (state) + __drm_atomic_helper_plane_reset(plane, &state->base); } static struct