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 8FC15C433F5 for ; Mon, 21 Feb 2022 13:42:28 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 02F5A10E3C9; Mon, 21 Feb 2022 13:42:27 +0000 (UTC) Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) by gabe.freedesktop.org (Postfix) with ESMTPS id F204410E392 for ; Mon, 21 Feb 2022 13:42:13 +0000 (UTC) Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 5D8435C0216; Mon, 21 Feb 2022 08:42:13 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Mon, 21 Feb 2022 08:42:13 -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=dTwPvpWInF8D8+c0xpipAxXhExRLVv ohe2k1eFtk04I=; b=WldALEki+nyUtEQehNNwxvKCcBuk2+tmxuwPkkJD/1WC16 gls953DvuifV1pRM3Cn+e+OjUwdYsbFO5sH9PzvdFELmZeDOL2bVctbNlHE2k4Zy VGL6XQ1LGx7Oq4YaHG74HHycx2vRrhaMTub4JV120tuANd0fnLTb5AcIgdZa+qWY PgSDkDT26H7xF4LcAMDR0xPg+Kkc+9NkOLWYZ0f4F89qBSa+SoQA7yksESV6t+l3 utygMSFrTb3T+w9mCOYB7lzhPnYI6LW3zW1kWqZXWctv4VBrWH207ItfUCzgFptq dq4ojxUBlQ5eEQ72bZKgMzWwk4frXGJUrnWXeixw== 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=dTwPvp WInF8D8+c0xpipAxXhExRLVvohe2k1eFtk04I=; b=BIkOHROlQSLwIFNOmb1eGY lw1B7Rk4qiFGczq1hOgccv/Hsi5X49iegnZIJhyLPiDx5m/9z/TQ8Wv+zCdSGvBt v0H+I7X6/aLXl4+rD4/peGQ0gJs6IFuWRmq9jIUFdA0T9QYXSG+bpBxUKaY0Lt1O o877Qt0dNvSlCdFsjTQ/rQ18FWTSZq3hUHyGiQkQuFvm1v4TNk/9uyDtWeKVNE9O hAa5+n6Bii2oO//B2+5s5PIYHOW4aGUpcZgTssTUP8o+U8NUB0FvnvMvNxPEXxrY CnTLuuf7mHzORxt4PiIU6zByd+oPcYzfg2M3KtX8MVZjjODcmeCm1GungNeBSEeA == X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrkeeigdehgecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomhepofgrgihimhgv ucftihhprghrugcuoehmrgigihhmvgestggvrhhnohdrthgvtghhqeenucggtffrrghtth gvrhhnpedvkeelveefffekjefhffeuleetleefudeifeehuddugffghffhffehveevheeh vdenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehmrg igihhmvgestggvrhhnohdrthgvtghh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 21 Feb 2022 08:42:12 -0500 (EST) From: Maxime Ripard To: Daniel Vetter , David Airlie Subject: [PATCH 6/8] drm/vc4: hvs: Ignore atomic_flush if we're disabled Date: Mon, 21 Feb 2022 14:41:53 +0100 Message-Id: <20220221134155.125447-7-maxime@cerno.tech> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220221134155.125447-1-maxime@cerno.tech> References: <20220221134155.125447-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: Dom Cobley , Tim Gover , Dave Stevenson , dri-devel@lists.freedesktop.org, Maxime Ripard , Thomas Zimmermann , Phil Elwell 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. Signed-off-by: Maxime Ripard --- drivers/gpu/drm/vc4/vc4_hvs.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/drm/vc4/vc4_hvs.c b/drivers/gpu/drm/vc4/vc4_hvs.c index 2d540fc11357..5db125dc2358 100644 --- a/drivers/gpu/drm/vc4/vc4_hvs.c +++ b/drivers/gpu/drm/vc4/vc4_hvs.c @@ -472,6 +472,9 @@ void vc4_hvs_atomic_flush(struct drm_crtc *crtc, u32 __iomem *dlist_start = vc4->hvs->dlist + vc4_state->mm.start; u32 __iomem *dlist_next = dlist_start; + if (vc4_state->assigned_channel == VC4_HVS_CHANNEL_DISABLED) + return; + if (debug_dump_regs) { DRM_INFO("CRTC %d HVS before:\n", drm_crtc_index(crtc)); vc4_hvs_dump_state(dev); -- 2.35.1