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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D9C75C433F5 for ; Thu, 31 Mar 2022 14:38:16 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id CA74B10F116; Thu, 31 Mar 2022 14:38:15 +0000 (UTC) Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) by gabe.freedesktop.org (Postfix) with ESMTPS id 987D210EFB7 for ; Thu, 31 Mar 2022 14:38:01 +0000 (UTC) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id CD5445C0076; Thu, 31 Mar 2022 10:38:00 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Thu, 31 Mar 2022 10:38:00 -0400 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=fm3; bh=AP2OymA55nN3Qv9e8GGaULiAE+rOC/ nw0TizDO81Grk=; b=hMryHQJz9NLGfmyGesOhkMYeCrZMRIDWPAaPP5JpRg1MWP aiUZXUNjan8Aj7VJrpeFMQSZv+GtIe6ot222DI9i/KTrzw6+6qmp3Jve9CrnGpZ7 18YNMOWslyUvIspzHW5HCppdb2LjhIRtGZ/+4ZnquMeLFTECGq0b35dC17oARjwE Ocbhto2T2en0LJs4fBdMpPAF+uLvwN06VfjCxYI7j+R+u6N7orw2fi8ZV6yTRdkD o1EJ4sMk7LZJ2pSFADQjKIf6nuPprx07/EmoZe7RlLSAU1MFC5GXp0l7VGRi0w1+ j1jVemM7CnSnX30IYmkiMsE3xtrro36eoYdnbMGw== 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=fm3; bh=AP2Oym A55nN3Qv9e8GGaULiAE+rOC/nw0TizDO81Grk=; b=HjgmDS/sFbrR1zPTIA2M6r kS0qGeJrp2TEpEr7Ecnn0mEeAoqIP/mhew5fsgHL/a26QqU8orRDEZRUItzP+L/D X/c/qC3eHNy90KM2RLlNKx/LL75d4gQFELmjmMS3nM4GwCfzaBpASKKvrotjwM23 mq/fG12uEz3REAeIU32/SAMgklm7o62pmYiJlOIjLQZkSaEZrvLHjnnxaeoaGzT9 jSzFzHnHz1sKfutMAsaon2MAdD2V/0qxx0p55x9K6FGSIRtWHJ30u58scYAq/SHw l4Q8hlU4Mmbm4g5ebqQddTdH9L3ovmIH5ZMJr69v6YIzt+h4wNK/52JyacfKpWwg == X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrudeigedgkedtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpeforgigihhm vgcutfhiphgrrhguuceomhgrgihimhgvsegtvghrnhhordhtvggthheqnecuggftrfgrth htvghrnhepvdekleevfeffkeejhfffueelteelfeduieefheduudfggffhhfffheevveeh hedvnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepmh grgihimhgvsegtvghrnhhordhtvggthh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 31 Mar 2022 10:38:00 -0400 (EDT) From: Maxime Ripard To: dri-devel@lists.freedesktop.org Subject: [PATCH v2 6/7] drm/vc4: kms: Ignore atomic_flush if we're disabled Date: Thu, 31 Mar 2022 16:37:43 +0200 Message-Id: <20220331143744.777652-7-maxime@cerno.tech> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220331143744.777652-1-maxime@cerno.tech> References: <20220331143744.777652-1-maxime@cerno.tech> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Airlie , Daniel Vetter , Maxime Ripard , Thomas Zimmermann Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" atomic_flush will be called for each CRTC even if they aren't enabled. The whole code we have there will thus run without a properly affected channel, which can then result in all sorts of weird behaviour. Fortunately, the DRM_PLANE_COMMIT_ACTIVE_ONLY flag will skip the CRTC atomic_begin and atomic_flush, and the planes atomic_update, if they aren't enabled. Our plane atomic_update is a nop, and atomic_begin will copy the current HVS channel to the vc4_crtc structure for the interrupt handler to consume, but the handler won't run if the CRTC is disabled. So in the end, it will only skip our CRTC atomic_flush, which is what we want. Signed-off-by: Maxime Ripard --- drivers/gpu/drm/vc4/vc4_kms.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/vc4/vc4_kms.c b/drivers/gpu/drm/vc4/vc4_kms.c index 992d6a240002..928657c736b7 100644 --- a/drivers/gpu/drm/vc4/vc4_kms.c +++ b/drivers/gpu/drm/vc4/vc4_kms.c @@ -401,7 +401,8 @@ static void vc4_atomic_commit_tail(struct drm_atomic_state *state) else vc4_hvs_pv_muxing_commit(vc4, state); - drm_atomic_helper_commit_planes(dev, state, 0); + drm_atomic_helper_commit_planes(dev, state, + DRM_PLANE_COMMIT_ACTIVE_ONLY); drm_atomic_helper_commit_modeset_enables(dev, state); -- 2.35.1