From patchwork Sat Aug 4 16:15:27 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: 10555805 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 A4196157D for ; Sat, 4 Aug 2018 16:16:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 933A929C0C for ; Sat, 4 Aug 2018 16:16:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 868DD29CF5; Sat, 4 Aug 2018 16:16:32 +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 30B7C29C0C for ; Sat, 4 Aug 2018 16:16:32 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 923AF6E158; Sat, 4 Aug 2018 16:16:22 +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-ve1eur01on0040.outbound.protection.outlook.com [104.47.1.40]) by gabe.freedesktop.org (Postfix) with ESMTPS id A73EB6E158 for ; Sat, 4 Aug 2018 16:16:20 +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:17 +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 07/10] drm: rcar-du: Use __drm_atomic_helper_plane_reset instead of copying the logic Date: Sat, 4 Aug 2018 17:15:27 +0100 Message-Id: <20180804161530.12275-8-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: f17cab18-3357-4ede-9934-08d5fa259c42 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:zI9yEoXyk9H814Z6zLD0lE6Zdi45K+UY3rRoygPEebR+ZKX4nSJRyeq8KBo76U6uoHddt4T89c34Kgj4PwvHt8KS7jiEXwG79SpUx673Kyt5UmK4dGamFgPoAisIf44RVjzcYsbocxeKVQvcy/n6ONTJPc9IVf20zFriaW84r6tMybzOXR+4u6smupEzYYgrO9cdbbjxs8Yw5F/MkrVsYVmIOPNWjzX1UC2D48IyaT6iNf5y8GiByIrbuht+mpHl; 25:+1a0jkdWllcxAwlYSeaPwYFke5vc8uyR8YEH7d/X7+jVrsD5YE+NZRpi652sJBpAK0KraO1a+avZGFX4zoorj/qlhxVGWZeKkITky4PQPSiVT6xYhGqqxt0Js5B/TLK2nhzA3s5HCl9P2X4xhjfppO0ab7qIBGEu0pDeh4IgN4HXav/m21IWPnZSIHihFEfvLM7EXe+SidAfJniPvKZUaG+fwsOHOFNIoFjpH/p3HrPCuTk3uQKbf58HjNZI2h9ufX/1eWDmF4gFhTmgr4yrZBj1FsIY52sPiFwB9JaXws3NwabKL6sYd3Ksg463lz/SGpmQxhZ35ZyO8dvH3Ubrhw==; 31:AkObh9ODrXy9QbpDcZBBp2816i1pF8+NrgSBNQGCH4UsnagD5IKFRaSs1XmUPZsY1Xr+dB2lDL2bh5o2yFWlpTkSQGH0QrIv/wMUh8WfXoRPVGHcmTBJUq3dkHbZJa8WWc6vzW60f0DuPcshztusCSmF816pTjCFMC4YhQFgBwaDpkgGJ+A1mlon2+RTteNm6R+UuVdG31EIpRyW7LVqJ85RBhynzjbILuYAE9ERou8= X-MS-TrafficTypeDiagnostic: AM5PR0802MB2547: NoDisclaimer: True X-Microsoft-Exchange-Diagnostics: 1; AM5PR0802MB2547; 20:8JaHyV5EWp/JVJ+PbkURAHPNzqev8pPqGJUXHoAAo+DYMasHtN2nX7z1ZX5XbWhmE3PPFxrZ0XYscTJWkTxtNGZFmOTXiEWQCfFtwTDERbZErv5SrqjiaXOuZvXKr14y0GQoB8986bChUhe7eil6Ot9sgw3zSSrNplVWwY4Qb8yAUgMS7wPhZ3rggduzScDFS+PYTf1SDTU9datKgoLQRcpODXKGC399CuR/bFwTyMNkdH9bgHDGBO01fmQOHUi+wS8wtqsG1NNL9RvApvRcqJTBrDoqsdk/e2k79a8E6kcxZTKiFC7IyDwdx5qVM2b3SP3ukGsoILofqQmHbAV6+A==; 4:nZRFZQt1bhxqOw3p9eCjovtzeclPKZomVJe0oF53zjKLpJK23vUZtVb8USag7NOllrgJYtTspzszpM7phr+htcx4UM18/X9pZcX5pshDs+2kk1LKl5YwIyN58DMQFWoutoo/IfslxFZouJsrWP/4ZXriItegtMFzC9I0mdHHRkxu4PdUhujhVE5CKvEbDdlyjal3yyQOVBDHg2Y7510JiUUN/F6M9XldxXesm+KjUNLfkIkJxa+hlxCjt8faEePlQ+FtnRHDPoyBj6VBJdQ99TN06TpcHP7Dx2QydQMWB6ZTptz/6tQa71PkIi0EjVim 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:toc5HTA2bQWT3I4pUqCthTePXAgUS+XSTK75hcN?= D/Wo7UGqyBnuNGhJwJKbAKynTdXY8dflvPLfnrGxJ3QpjkTAsyRbz2kkmPw6LXJr8LFtLpJ2sJD+8Yh45uwWqkem0JpITi15ybRkba4nJ0iSSNnrzg/KWf6q4tkTP0jKUcBuYMvilRpsVdx8zE7NmzI1Ql/EQUmWTxlSLx6nRqTRubwjJLqcI6CdIAw32lzOxlZLCtoaASPc97OZE+iVcevvgZ9dIEqBqVtabir6jqPXtYmMTFDzb/Duw+ssb2TLzSyGJz4DK4mphuY7OShDT6nSTFaJQjQsxV/SmBhGBHXkGa2L0DIrZPKOT+zWQckXlOV1ytgRn6Sm6DtfNSP+oR/2+EaBP5sV7eQMi/zrTbI7krafT7LeIcjxpdLQQcmpGvqfWStAtJC/iYXmRmmtcKogmLI/MeRbAn5D79Bu4a9FUfeDwuK3A4YY9K211Uw6DV08VzE0IOla0Rls/XPce2WHwkgfLZ2BLIO5CUlt6FipU1VvEE/8xC/r/SDanWH810roxEZEAeRC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MELoNL/7SL0= X-Microsoft-Exchange-Diagnostics: 1; AM5PR0802MB2547; 6:cm77NvycnZwKOOQv5S39VLFLqeCkIVjTd1nlGTAChcqK4pOipocH9i/Dt3Nc3HHIsOG3lQYjqECwm9ZpCOz+khEN/u3CiXodGDCyKLn1UvD+jZAP66x9ZrtFPMvucwHnvUY5Q96OLtSXFhxgP5S1pJPmlWm6iDNB1grJWrrKwwTywmcgl7NTxpRlx7YA9yZZULgyLpOg0TbmTxZKymcA/8UAnBEv8Op5yfRAu6hn5SK0BupN6IJcXVYHEey4sZj/PIUJPeR49EzrsLPbsmgYtdv8rh/kzzxP3Nlw9BEIJsieS6w8U7j4rWT0O4sM6+H8fv53vY4KIF79VtpWCWdKgYiTSf9fIMFq0UUqVj5zGLYYuJaC9bxXbunajE0YS/g1r3wMufVDXceSGN+GEFPoDdRcvI2pXQgNHzwJE7hUPZyPmcwg0ouMeFVGrjyd9GfqwBCGZeWSNoMJz2W98utHTA==; 5:V69ZJGMBmhUMbbEndmZtlFkG5aFsCT5po46ALp+vvs+EOiHSCPI77lXHfbc4BdeaaGMPjl/0kgjNIbN0XFPWUPZ3rwe0+8NPqWAy8KdOFg+Vt6kQ8W14oWK+lLqDIYEC8eVqi9iSFbCRYg8uyQLRUEcQuVjt83aG5GpPz0X1HAM=; 7:zn/4x7AbebwOSZ6+gfSUFqo1t2MnKoSBPBJj45a3VBs7OmFyn5LEAamtByrt4XzNaBTztDEC0ZdHClOYDhUzfL6NefNIKdz9IgDV7ebdwASKS/Wf/2kJ9LLKDuu2S1/9NZjYaY5rA61uhotbmxJj17WfxEZEF8HloTSJ7WKmJkOYQ4scReFMQpn/ckUv3LsGeUol0R5B+ur8dQlg3g+4lxS+Y2Ew5Bf1dWB2hxrpgYbz8yNXcH6Al0t3Z/Z/xFyb SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Aug 2018 16:16:17.2697 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f17cab18-3357-4ede-9934-08d5fa259c42 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. Reviewed-by: Laurent Pinchart Signed-off-by: Alexandru Gheorghe --- drivers/gpu/drm/rcar-du/rcar_du_plane.c | 6 ++---- drivers/gpu/drm/rcar-du/rcar_du_vsp.c | 5 +---- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/rcar-du/rcar_du_plane.c b/drivers/gpu/drm/rcar-du/rcar_du_plane.c index c20f7ed48c8d..8861e715c248 100644 --- a/drivers/gpu/drm/rcar-du/rcar_du_plane.c +++ b/drivers/gpu/drm/rcar-du/rcar_du_plane.c @@ -690,14 +690,12 @@ static void rcar_du_plane_reset(struct drm_plane *plane) if (state == NULL) return; + __drm_atomic_helper_plane_reset(plane, &state->state); + state->hwindex = -1; state->source = RCAR_DU_PLANE_MEMORY; state->colorkey = RCAR_DU_COLORKEY_NONE; state->state.zpos = plane->type == DRM_PLANE_TYPE_PRIMARY ? 0 : 1; - - plane->state = &state->state; - plane->state->alpha = DRM_BLEND_ALPHA_OPAQUE; - plane->state->plane = plane; } static int rcar_du_plane_atomic_set_property(struct drm_plane *plane, diff --git a/drivers/gpu/drm/rcar-du/rcar_du_vsp.c b/drivers/gpu/drm/rcar-du/rcar_du_vsp.c index 72eebeda518e..45eb777a16a4 100644 --- a/drivers/gpu/drm/rcar-du/rcar_du_vsp.c +++ b/drivers/gpu/drm/rcar-du/rcar_du_vsp.c @@ -346,11 +346,8 @@ static void rcar_du_vsp_plane_reset(struct drm_plane *plane) if (state == NULL) return; - state->state.alpha = DRM_BLEND_ALPHA_OPAQUE; + __drm_atomic_helper_plane_reset(plane, &state->state); state->state.zpos = plane->type == DRM_PLANE_TYPE_PRIMARY ? 0 : 1; - - plane->state = &state->state; - plane->state->plane = plane; } static const struct drm_plane_funcs rcar_du_vsp_plane_funcs = {