From patchwork Sat Aug 4 16:15:26 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: 10555801 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 4EB2E157D for ; Sat, 4 Aug 2018 16:16:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3E01129C0C for ; Sat, 4 Aug 2018 16:16:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 31EB729CF5; Sat, 4 Aug 2018 16:16:27 +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 DB84B29C0C for ; Sat, 4 Aug 2018 16:16:26 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id BC9996E153; Sat, 4 Aug 2018 16:16:19 +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-ve1eur01on0079.outbound.protection.outlook.com [104.47.1.79]) by gabe.freedesktop.org (Postfix) with ESMTPS id 335D36E153 for ; Sat, 4 Aug 2018 16:16:18 +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:14 +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 06/10] drm/imx: Use __drm_atomic_helper_plane_reset instead of copying the logic Date: Sat, 4 Aug 2018 17:15:26 +0100 Message-Id: <20180804161530.12275-7-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: 7eca791e-ecec-43c1-40ac-08d5fa259ac7 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:YborpWm/oVqE/K9kJi4XnPTfD64r4LsLPFs8TJVtgMhtqYJ1P1DV1TEyXeSPTK1bQINbNT1xHgbUJPoB2xgInizOkH0T0YbSIyW+bMSNh5/EHDTVLL2/a29SKxDIYdHtYsAOYhPG5Kt//kKnfCmRQJ44Su04wUuv91E/SNJ8CerAJJECIDOELzYeTIE8i3R1iWAgUabE6WepL3lBiLGxBNqYATdZ0SMvMykXpadHimpB2l+CFY5VvjCYp+WQoxp3; 25:o9mtUN1YjVh4uu8vXj0wP5GaOOk+G0Z2ap4CWYW30Ln8bmFvdhtejSw2CZi6MDgnMwCPWJ4gS1i4W6U/tCwfoiKOoba7qRFK1QdqpzV8IewsqaBz8LmBGMp3WM3SwVEdLOng9ekh6/t184iAP1Pp0sIp0DcWHD1LhkD78FIxbWV7oosltcHnnVYe/9l96ijJa7yA7kTCPa2JgbbMmU7mZwniFfpKxdToJVhJPzHeylmVt6RT8LEXDADh8JBbntO4rcQ8l+DmdUSFXUDUV7g2Mkn+hQx20uSezYKH+aQBtJrrtMlVcCRKPbLSAJgimoL7N9SsoSO5bqISqKygMdeYPg==; 31:67taDI/hj96U6xhqW/L9cr3bJQ2ELdS3BayOceisyVg9JyB3+haSqQY4A9JdZbVn6cQvKTUXFog1VwglhcWK7vlG4d+Ibq/gy6K7Oy5/kkoypjxsyXx9irEfXaxv06OWI3iWjeHZ5sBjJfCOFSS1ajG5J5nbp5Gb1ie37T4+0LabzmyiedtoybiYjITozdrXC7rSDrDcIWbGPxpZFFkV31pAZl4p9b4NZGDmsF/jKzI= X-MS-TrafficTypeDiagnostic: AM5PR0802MB2547: NoDisclaimer: True X-Microsoft-Exchange-Diagnostics: 1; AM5PR0802MB2547; 20:a97Z4QYvXxC+div8FK9L86nfxgtMPqWPhm/zpjdn05MDgrvNBxCQCPIWVU32WZMdwidq12M1iWrRVyUlCrhWbl2kGd772J8nGLDtmm/s6/MsAlrEsRQC/N2Av8fgRYfwVM2ofSVnhDQiFwkUZLNFbmVnL3Rys0i1P5qHvbBzHnmqLp/Ino+0gzC4gumr8h/cCC2AmO1Dzqlaj9RyCCjTFwvYSdqsTn0gdXnP7GTCwM3l2xX/2KPUzxHWOSidpziz+ZIjiF82kia1613RHNRJ0hehXRM/Y3Mhgq3N9AKaaQN1gNh+vs3jVyFNcsGEcCbBrHnhaSyq1Y5UTmf2XWmxmQ==; 4:St1MecEhBan/+vW1reDW+/kjQf/rNu7/4b9aQtS+h+/fK9R4WMceBVIroCLOKeGaLRGbzFsO3YLq2+0Fxl6PYPSVTJ5YO3D0zF5DcVDEZYDLe+mSFM1/xvXZSLtggywBLGMqgx7rC0uaXm1TkDjVGRARohU9rF3uZ9e8Ap3cKCiJ3XqWUMept9N/INW/LdGvNdDDa5RntYpG7QXi/xReo6sTzIdvxW2ltbVV2uSfT3yMHbWOKwRGV48cKtWCYAWS/GvIDiRtJGtnTVpeFqDf2eLiU34Dop3OLlrTz4CcIc12ckSQND7T8PTDVRtLT1vk 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:nGvG89itY2vv0romFS7t8f0iQtJOTZOWtHqXqGG?= p8N8903QgGTK4pJ6+0erFcfh+k1iAosG1QubDCPfpwwvB+CS3ge8/NouJQfweFtd3j3AqJUhrb3kQxk1/1exwn/9eGrOW+DB+fG+OLhr7i/arGz0cYzeWeUAhKVHDC/FR1tthwBworsbGLaDAIRbWOE6Dvt7+LVZ1BQ5g0MORpVb+xllCdWCC+lhQ8XpwcZqH3hB49mQk6VrpzbkCnCfw030yc1OpygqnzPZARbYEnIfIZVjbSgLqfI8D6ZCWu13g3jvDcEZsTJBw1kDGQDPvMem71E8Bez4pvN1ygKr2b+k1lMHfvo2bNcLXzA3d1AMwQJ3PDtw/nQ29cexo82epZyUJEbny+6z9FVaClc7VYBU6jjnDryRQK5cTtgTRdWQpGiXdVtDNr3NlNG3gzOmfeUw+4Idc2Pp0ruafmC6B9X+DTSeVOMx7Y4OYw1HT7ZWqAmhUsCQrTatLmbqe8F7zknz3A+L4Ls1cBzB4Nkh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rossTenant-OriginalArrivalTime: 04 Aug 2018 16:16:14.8376 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7eca791e-ecec-43c1-40ac-08d5fa259ac7 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. Signed-off-by: Alexandru Gheorghe Acked-by: Philipp Zabel --- drivers/gpu/drm/imx/ipuv3-plane.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/imx/ipuv3-plane.c b/drivers/gpu/drm/imx/ipuv3-plane.c index 203f247d4854..1bd4de03ce9e 100644 --- a/drivers/gpu/drm/imx/ipuv3-plane.c +++ b/drivers/gpu/drm/imx/ipuv3-plane.c @@ -281,16 +281,14 @@ static void ipu_plane_state_reset(struct drm_plane *plane) ipu_state = to_ipu_plane_state(plane->state); __drm_atomic_helper_plane_destroy_state(plane->state); kfree(ipu_state); + plane->state = NULL; } ipu_state = kzalloc(sizeof(*ipu_state), GFP_KERNEL); - if (ipu_state) { - ipu_state->base.plane = plane; - ipu_state->base.rotation = DRM_MODE_ROTATE_0; - } + if (ipu_state) + __drm_atomic_helper_plane_reset(plane, &ipu_state->base); - plane->state = &ipu_state->base; } static struct drm_plane_state *