From patchwork Mon Feb 7 16:34:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 540585 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 A97DCC433FE for ; Mon, 7 Feb 2022 16:56:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1354096AbiBGQzn (ORCPT ); Mon, 7 Feb 2022 11:55:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49492 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1391395AbiBGQq1 (ORCPT ); Mon, 7 Feb 2022 11:46:27 -0500 Received: from wnew4-smtp.messagingengine.com (wnew4-smtp.messagingengine.com [64.147.123.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A2F54C03FEC2 for ; Mon, 7 Feb 2022 08:46:12 -0800 (PST) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailnew.west.internal (Postfix) with ESMTP id DC7942B00104; Mon, 7 Feb 2022 11:35:29 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Mon, 07 Feb 2022 11:35:31 -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=KkWATsWD3yxx4KnUgpTvJTkg+itLze ChvgKpxGcaR3U=; b=FdKZbNacRrKJxZkJ//+nVJpMR+O52n2YC6TbQalo02S65i 6iqAZwMUZX6EERRWeamp0qNENw0bP8tOvvEvtnGJnbZfDlMUFoPJs2gLamNgiHOt 42ZJMjQv2QPfRAYfOJKZ5lTbDkWeUAM2FdPyekXMFyNGJaryIaETJ4qwEp4bl2pN OCQPxMb0zw1sNkVhWn5gVUc9UvhMmeOARmUlgokKAa69zGV+vuw38yU1SuKDmqOH nT91NhRl7Ky1fBI4Yko354vj9kawrWHWTwBP8BIhky88OpKx69d/WKYB3jJ66deX M5MOKMvSAsLTAOH3JDZ9OTFgvb52HomlTWGK0/8Q== 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=KkWATs WD3yxx4KnUgpTvJTkg+itLzeChvgKpxGcaR3U=; b=I7NyxhFonpeRLYTU5bM2TG ApiYJZ07jz9EocpBNCUFMyMXmrlz8Bl3egfNrpXuVCVKHDfyAatleoC4k7axfiSu NdD77bg90IONRzJErZuFoSzVG8nD+VTD/ZgCWVUmP3IRi94OdnA5wWx+UDF5ucst 8LHuMuSnKa5zVb28ERSAMriR1MxtEANZSo5aB1IAqTRrPjVsHxtKnOco0dWBsI/6 L3zMt6yX11fVmjQYFbF5EzBlw+w4rGI+4OqI654B8Gx+8VnTZNGkgu/wtCofqYlM +UOvkNnsEJZIfgBhiCDIL0WrrQL4pH1wcvZHgK8oKvwyNT4e9+A+6SBto71LP7lw == X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrheehgdekjecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomhepofgrgihimhgv ucftihhprghrugcuoehmrgigihhmvgestggvrhhnohdrthgvtghhqeenucggtffrrghtth gvrhhnpedvkeelveefffekjefhffeuleetleefudeifeehuddugffghffhffehveevheeh vdenucevlhhushhtvghrufhiiigvpedunecurfgrrhgrmhepmhgrihhlfhhrohhmpehmrg igihhmvgestggvrhhnohdrthgvtghh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 7 Feb 2022 11:35:28 -0500 (EST) From: Maxime Ripard To: Daniel Vetter , David Airlie Cc: dri-devel@lists.freedesktop.org, Maarten Lankhorst , Thomas Zimmermann , Maxime Ripard , Dave Stevenson , Phil Elwell , Tim Gover , Dom Cobley , freedreno@lists.freedesktop.org, linux-arm-msm@vger.kernel.org, Abhinav Kumar , Rob Clark , Sean Paul Subject: [PATCH 04/23] drm/msm/mdp5: Fix zpos initial value mismatch Date: Mon, 7 Feb 2022 17:34:56 +0100 Message-Id: <20220207163515.1038648-5-maxime@cerno.tech> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220207163515.1038648-1-maxime@cerno.tech> References: <20220207163515.1038648-1-maxime@cerno.tech> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org While the mdp5_plane_install_properties() function calls drm_plane_create_zpos_property() with an initial value of 1, mdp5_plane_reset() will force it to another value depending on the plane type. Fix the discrepancy by setting the initial zpos value to the same value in the drm_plane_create_zpos_property() call. Cc: freedreno@lists.freedesktop.org Cc: linux-arm-msm@vger.kernel.org Cc: Abhinav Kumar Cc: Rob Clark Cc: Sean Paul Signed-off-by: Maxime Ripard --- drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c b/drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c index c6b69afcbac8..d60982f4bd11 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 From patchwork Mon Feb 7 16:35:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 540843 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 6966CC433EF for ; Mon, 7 Feb 2022 16:57:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236871AbiBGQ4f (ORCPT ); Mon, 7 Feb 2022 11:56:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45306 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1382242AbiBGQlM (ORCPT ); Mon, 7 Feb 2022 11:41:12 -0500 X-Greylist: delayed 341 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Mon, 07 Feb 2022 08:41:12 PST Received: from wnew4-smtp.messagingengine.com (wnew4-smtp.messagingengine.com [64.147.123.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8177EC0401D1 for ; Mon, 7 Feb 2022 08:41:12 -0800 (PST) Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailnew.west.internal (Postfix) with ESMTP id 717792B00148; Mon, 7 Feb 2022 11:35:53 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Mon, 07 Feb 2022 11:35:54 -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=h2ceKRgcNJg3I9h78SEL5uVotb13Hm XB1sRGJfgewsU=; b=RRqfvT62jhE7IARUqT9OOKlyjPnYIx2UzzE5ozH3WAJd7V 6UHX4CfG/mzMKcuQ8CYsC4IDKsw9VBY1ZnqwoAQ2eO7eKmmCiWpusP7jzObiY26C z5t5Iug5VrnH2crVXsF2N+fQ1zpO5UB66cxNImYEzVqKu1ZE/wH8tH+Apz45dQZg fIQenvm24i3DW9SQPHHDr9nM6sBE3mtvHu6kbd+dggUIJW7SGUhjEb98dmu0SABI qbtLmUDHnV7wLAFDMPmtV2aTk4aBmyu0OWY5+ZrZ5266DRPXVZ4sitnOS40Y0Bqc bk9D09JVNGSuX+xIxe9IXtdHsmLHpYFT4lmhbwDw== 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=h2ceKR gcNJg3I9h78SEL5uVotb13HmXB1sRGJfgewsU=; b=GWdP74ITXaareVs/S1JaSx jakNh1O9IyTkhXzox4tG9R1AHCXUVSpoVrwaXSWUbjyJOKq8FqIwqXfJK4Z1oCGt Bjvb1xqavWQ6/R6YUmVlr5xJmEDAKOfXv+kGqCnIZs76u/RBzYkt/ghnepdUPCBw PpkMx8huyzJr0A50Lqjc9vB5vISz0D4egcrLGEBmijfjPKuVlW96GyWeOxo9A+I2 Xu69Tc+Fe/SjDioN5H+SGY0JxQ4L5QhivW/qIrEDK5yUKFwQ2gtIFFF4WISkmdq8 FsPZdOMLRJTzwjeZck4/3wq7TjbLnCvJWd7Kxw92uH23DrNAQAP4rw1g2q0ydJ+Q == X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrheehgdekjecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomhepofgrgihimhgv ucftihhprghrugcuoehmrgigihhmvgestggvrhhnohdrthgvtghhqeenucggtffrrghtth gvrhhnpedvkeelveefffekjefhffeuleetleefudeifeehuddugffghffhffehveevheeh vdenucevlhhushhtvghrufhiiigvpedunecurfgrrhgrmhepmhgrihhlfhhrohhmpehmrg igihhmvgestggvrhhnohdrthgvtghh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 7 Feb 2022 11:35:52 -0500 (EST) From: Maxime Ripard To: Daniel Vetter , David Airlie Cc: dri-devel@lists.freedesktop.org, Maarten Lankhorst , Thomas Zimmermann , Maxime Ripard , Dave Stevenson , Phil Elwell , Tim Gover , Dom Cobley , freedreno@lists.freedesktop.org, linux-arm-msm@vger.kernel.org, Abhinav Kumar , Rob Clark , Sean Paul Subject: [PATCH 12/23] drm/msm/mdp5: Remove redundant zpos initialisation Date: Mon, 7 Feb 2022 17:35:04 +0100 Message-Id: <20220207163515.1038648-13-maxime@cerno.tech> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220207163515.1038648-1-maxime@cerno.tech> References: <20220207163515.1038648-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 Signed-off-by: Maxime Ripard --- drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c b/drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c index d60982f4bd11..5d8ac84c510b 100644 --- a/drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c +++ b/drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c @@ -98,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); }