From patchwork Mon Feb 21 09:59:08 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 12753404 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id ED39DC433F5 for ; Mon, 21 Feb 2022 10:38:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1355253AbiBUKit (ORCPT ); Mon, 21 Feb 2022 05:38:49 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:35368 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1354962AbiBUKif (ORCPT ); Mon, 21 Feb 2022 05:38:35 -0500 Received: from new2-smtp.messagingengine.com (new2-smtp.messagingengine.com [66.111.4.224]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E337F46172 for ; Mon, 21 Feb 2022 02:00:22 -0800 (PST) Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailnew.nyi.internal (Postfix) with ESMTP id BE27B58025D; Mon, 21 Feb 2022 04:59:49 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Mon, 21 Feb 2022 04:59:49 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cerno.tech; h=cc :cc:content-transfer-encoding:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm2; bh=IFVgN74my049bXBhIl0zeRDWJiwGrn qHIa/jttdk6C8=; b=mjP/vzgr7CkR825BFfYTstyO3TNWupa759b0oxo9ddH1+S 8Hi3LX4JzduGBi6Ej2f7ilLpCIv/K3jZX2VJpH43sfHqHYdBQ1RqMzw9r2aASeFn CFYAQ3f6hNSpTr8IvwcO2lNfE6+Y4ZegoFikCopYoPbAkTg0c+55JyA041Qc+C+B I5LPCV3yPlyIAx7qTNb2ZElBXECgfSEcwt/ZYhM4pqV+3LO5MG/lGdB0KbjSDgh7 cyRRZ7sDqI5p58ELfyUj2N7lmYGFuj0zSt4/JoywS/jf3z9Z2VKkZnzJiEbZIEQz 16pcvLfO1rfDVcfJHTYkS/Y8LdP6oa19f5Blfcuw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=IFVgN7 4my049bXBhIl0zeRDWJiwGrnqHIa/jttdk6C8=; b=HlkaHMw5S+3ZAiomMF1kss XXNYo0UhUcdR/p8BeUvRbw5Zubkikn+MZQBRr6/xKEd8T4XFJ6UAVqxaUiTNJzR1 gaboinynA8fFNDRJv+7ORd0RoNkvkXtsnp28EgD9WAsoOFcJmq938vP6E1xylwR2 rWNcqRy0v6VSNJ/EOZF543F3bC/Ygn948QgTMUOHKYntvYiWRfk95RwzIeoTSEtB OhQsdSs5A4R3R5OTlUsXRrDhIaro8hl/RwVefxD3diYSZRVn/UFk4S2cUpKmwf62 LSzBdN0Xt1gg3lWYkcq80mLVny+kzR+PLbeYv8hdbnuyjgD9jEJAb/bCRg04rTBA == X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrkeeigddutdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomhepofgrgihimhgv ucftihhprghrugcuoehmrgigihhmvgestggvrhhnohdrthgvtghhqeenucggtffrrghtth gvrhhnpedvkeelveefffekjefhffeuleetleefudeifeehuddugffghffhffehveevheeh vdenucevlhhushhtvghrufhiiigvpedvnecurfgrrhgrmhepmhgrihhlfhhrohhmpehmrg igihhmvgestggvrhhnohdrthgvtghh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 21 Feb 2022 04:59:49 -0500 (EST) From: Maxime Ripard To: Daniel Vetter , David Airlie Cc: Dave Stevenson , Phil Elwell , Tim Gover , Dom Cobley , dri-devel@lists.freedesktop.org, Maarten Lankhorst , Thomas Zimmermann , Maxime Ripard , freedreno@lists.freedesktop.org, linux-arm-msm@vger.kernel.org, Abhinav Kumar , Rob Clark , Sean Paul , Dmitry Baryshkov Subject: [PATCH v2 12/22] drm/msm/mdp5: Remove redundant zpos initialisation Date: Mon, 21 Feb 2022 10:59:08 +0100 Message-Id: <20220221095918.18763-13-maxime@cerno.tech> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220221095918.18763-1-maxime@cerno.tech> References: <20220221095918.18763-1-maxime@cerno.tech> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org The mdp KMS driver will call drm_plane_create_zpos_property() with an init value depending on the plane purpose. Since the initial value wasn't carried over in the state, the driver had to set it again in mdp5_plane_reset(). However, the helpers have been adjusted to set it properly at reset, so this is not needed anymore. Cc: freedreno@lists.freedesktop.org Cc: linux-arm-msm@vger.kernel.org Cc: Abhinav Kumar Cc: Rob Clark Cc: Sean Paul Reviewed-by: Dmitry Baryshkov Signed-off-by: Maxime Ripard --- drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c b/drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c index c6b69afcbac8..5d8ac84c510b 100644 --- a/drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c +++ b/drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c @@ -48,6 +48,8 @@ static void mdp5_plane_destroy(struct drm_plane *plane) static void mdp5_plane_install_properties(struct drm_plane *plane, struct drm_mode_object *obj) { + unsigned int zpos; + drm_plane_create_rotation_property(plane, DRM_MODE_ROTATE_0, DRM_MODE_ROTATE_0 | @@ -59,7 +61,12 @@ static void mdp5_plane_install_properties(struct drm_plane *plane, BIT(DRM_MODE_BLEND_PIXEL_NONE) | BIT(DRM_MODE_BLEND_PREMULTI) | BIT(DRM_MODE_BLEND_COVERAGE)); - drm_plane_create_zpos_property(plane, 1, 1, 255); + + if (plane->type == DRM_PLANE_TYPE_PRIMARY) + zpos = STAGE_BASE; + else + zpos = STAGE0 + drm_plane_index(plane); + drm_plane_create_zpos_property(plane, zpos, 1, 255); } static void @@ -91,13 +98,6 @@ static void mdp5_plane_reset(struct drm_plane *plane) kfree(to_mdp5_plane_state(plane->state)); mdp5_state = kzalloc(sizeof(*mdp5_state), GFP_KERNEL); - - if (plane->type == DRM_PLANE_TYPE_PRIMARY) - mdp5_state->base.zpos = STAGE_BASE; - else - mdp5_state->base.zpos = STAGE0 + drm_plane_index(plane); - mdp5_state->base.normalized_zpos = mdp5_state->base.zpos; - __drm_atomic_helper_plane_reset(plane, &mdp5_state->base); }