From patchwork Thu Jul 26 16:17:53 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: 10546149 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 B1919112E for ; Thu, 26 Jul 2018 16:19:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A10722B418 for ; Thu, 26 Jul 2018 16:19:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 94AE42B88E; Thu, 26 Jul 2018 16:19:15 +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 9662B2B418 for ; Thu, 26 Jul 2018 16:19:14 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id ABA0E6E7C1; Thu, 26 Jul 2018 16:19:03 +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 948586E7CC for ; Thu, 26 Jul 2018 16:18:48 +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:44 +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 07/10] drm: rcar-du: Use __drm_atomic_helper_plane_reset instead of copying the logic Date: Thu, 26 Jul 2018 17:17:53 +0100 Message-Id: <20180726161756.1794-8-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: 1070793d-6b85-414d-5ddd-08d5f3137686 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:cG5vC9ZuqlyhWGKNFM7/mwHkBKAdIfTsWG1Z4G/o/W7xAiQREx+WrNnNTHVeSyM1iVVzOt/4KE889NCaLmeCkvxG6GOuRA2mDzG15TeOwElvLYiXKWGKiy4Kvtu5XBijr6MtUJoXDJbrSF7aaRqxOorrB5Gz1dWbKturpw/qcnlirWk+MKRVnTnuxku5b3Iwg7tcz5164f3jsRNQabBRl4Co9eooqUrgi74a1Xp9MtYlLCvIX775w1+6HuIWMclE; 25:t2kKBM+JPEt1HuhwPIe9UfmLxkvhCDaDQ09GdnkN3mYMdkkgWiuPpbDEYoZ2zbGLpTMW3mFCMh6/sh7BljntAxVX3EIBMA2oKosjO2fQMk7paOQsH3RHTLfnwkByE2RryHzXo92vZGMdbt41TwbuLizc2/LIer0a2T7aTRKW7P8QhfjA8+qHSiwHCgtmaZuVv+Y2WQmdrdrfdtEYiJ+a8E0EFKalKJpeT1vLUPMFe7+GxQR95DZw6a+v3lFB5gC0GdsLiQUW9ZhUVK3F2Zz4JWhbWTLadKyviyyj/87pY9dMCartF2ZD7ket1izGN+tRCEetZx+3v/KAWiVjy85/Xw==; 31:RNwaoXbl3OiDXxvIz7ilny4CGc8Pc/l63ou0Hmi4kTQpmCpGyca68XCPVYrOx3lpm7m0WcUgeVwhhFl7DLofJYn3GlbdvL9/wOzWq5yfQEO9RR16LIm7NEIqO04K7gGia/uQ2LquNUymMzQwkOPWbZE7sJGqd5NwiStnUagn2UegCrzItZ6ZkPAQkxnv5yBWU7hOPNTz/IgtMsuuF9+41Ed3iXhfHnMAL7g6G8UfZsk= X-MS-TrafficTypeDiagnostic: DB6PR0802MB2552: NoDisclaimer: True X-Microsoft-Exchange-Diagnostics: 1; DB6PR0802MB2552; 20:vbMqarHJXnVmsYQh/2vANLlST/hCe8BSYTZieRrv4xFlZg6pePEIPMpnc1C9m4ok4fdJL006TxFMSv+dW+oC3X1V0LGiDxRTz4dG8crRxwDExykNRmGTpyDqMSvoAGrnaQiqNrSPcndKUo+w9ETaUYQPfR+O9WcqqB9vbwH+h2aGnesdv8Kpc/V/qJfm6vNxK9+tEtxoJikZIBk9/pHZWwUmjl0lq+lQObWNO8ScCL+G6XQ8hJiMfJVo702rdZy0/Pmz9Jp0Xt2oswSTxftzywub/0Kib+LqFoKvHVhjBsF49o3pqwtDUrU9f+/MKLKJX3ZPf1xE3jJaWJSlNl9V0g==; 4:BctgCZwE6uENyQs5m0kIgnzxvFJuCjd0pW7X/stDlTUUhj+zvRN3NPLwi6qz8NyzP/vQLR9m3kMmfjZTnfJqDXP8ZWJ4xz3kH9SpVXiv0JdDS8flIKDhMH4FJfMLYgm+hf1Uekedh5rAfs4tfKW6OjYMW2lG2pDrZ+tIxv+gB1ioU0lvM55J6ej1xwWQStn8tUHMndrFWRhOF926/FfMEQvlwLZrMFfrsUhWaGS61i91FoQp7gOjKg9kfZJe5+7IOvRrVuiBBfuxSegPcYphuspBlXwNTlTM7knQGo4fNeyuccqgvTqkbCe0TK+0o/Kn 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)(575784001)(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:nzkiZMgnSPlqQUmBVHJG/V7jjo5StY4yr1p0SyV?= F60NebJLA/xlabW8cr6pKSFePH/trg/XpPqS53zvA/lDhSX87bDqj24t33+WltVzM045ub+CI9SN92wbCCO6/SjAKiXrVvq+XjjR+24hJ6DKXkYKgHnh9vjBkUsPIqVanV4fOkZDwggELBg50lOV///vyjtTexu2+Wxg16Lfn3e80iUynQSmrPSjZUurJZSIPYQQeRduHoiRmY5gppUcDPBMBILc3BIcGG1J9hesOtmMkI64s8qLVUp2aO5WjzPhcxycjMbzA9iwjp9JNJdRNg/btmlojvcvJsfut6F2PiU/9wQkIourS+09a+hX0d5FJK7Q7CNUoajalAZ+wlX6YqP+dU35/LSyxX2oNJpfy1y5rEEl92gtuCqwZksWBsKvEZYzc+e4PZqoO2nLSchLJaT9HrMdL2KXQ9mtC1LA2IwA7Q+BaFiCeIvJii35Yc/0Hwg9zkP8EQKLj0KH6siN6r0xQzyQOmayH7yyLBptXLndjo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riginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jul 2018 16:18:44.7056 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1070793d-6b85-414d-5ddd-08d5f3137686 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 Reviewed-by: Laurent Pinchart --- drivers/gpu/drm/rcar-du/rcar_du_plane.c | 4 +--- drivers/gpu/drm/rcar-du/rcar_du_vsp.c | 4 +--- 2 files changed, 2 insertions(+), 6 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..19a9d5f6db1c 100644 --- a/drivers/gpu/drm/rcar-du/rcar_du_plane.c +++ b/drivers/gpu/drm/rcar-du/rcar_du_plane.c @@ -689,15 +689,13 @@ static void rcar_du_plane_reset(struct drm_plane *plane) state = kzalloc(sizeof(*state), GFP_KERNEL); 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..0a0aa490f805 100644 --- a/drivers/gpu/drm/rcar-du/rcar_du_vsp.c +++ b/drivers/gpu/drm/rcar-du/rcar_du_vsp.c @@ -346,11 +346,9 @@ 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 = {