From patchwork Wed Dec 7 11:53:19 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 13067039 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 35A7BC352A1 for ; Wed, 7 Dec 2022 11:55:46 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id CB7F810E39A; Wed, 7 Dec 2022 11:55:32 +0000 (UTC) Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) by gabe.freedesktop.org (Postfix) with ESMTPS id A416810E38E for ; Wed, 7 Dec 2022 11:55:27 +0000 (UTC) Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 08FCF5C01F3; Wed, 7 Dec 2022 06:55:27 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Wed, 07 Dec 2022 06:55:27 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cerno.tech; h=cc :cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm2; t=1670414127; x= 1670500527; bh=ZWVkqHVOQFKLI4IZL/T9xqCrBqZyvRPBzXa9RyXGtbE=; b=Y rtiQCdRCy+089coWBgM8ErPg628haYCSwYGtT4MbZBb9yB804A3zp7ULk+flRhIC PDN/9jsLMatTEGB0nblBnnSzJ9NsM7eFmHIrZ6VYj+uhIH2ksq0zRYGZnemQWNPX fzGsQlvIFj7yr8ldD9UipfJreeKDG37vQPiH3/iigLAqnsfvPP/vHq9qjMhVIs42 se7jIfoWzFNXPv7L7kCTvrzagtwOG/geMKUZnUBYN6Ef6ON7nlr7jaOud+n/ad9x QgP6l50ARM7N2O5u+xfQAgiOWrlfMVUuUgXDXOqNepjXraI8kPMgagXADwE4lC7A QRXME2T54VsoiO1Q0mgWg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id: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=fm1; t=1670414127; x= 1670500527; bh=ZWVkqHVOQFKLI4IZL/T9xqCrBqZyvRPBzXa9RyXGtbE=; b=O i+2n8NryPCdFR3EygG7iyKn158U6xyvRwL4tLh4LO5BJ805Ips+Y9F1ZpXtJGCbN u9XLe+kq0ayUY7ewAaGAydqsvi93myl/aE7kPpdI8C7UjX30TE6leRjq+17uZtZ8 QpjkVgufPIyIm8YLE5MJyX83LsvskGVOU8CvqIoTZ3yYQqMZeggvk2bjfHJSSFTX PeTFzP6rgzjGsDQx+1L7cFwybB48cIKVUXETYSZczZkfflWcv7JYfgmXlvaLjre0 uxxAgwD4mus0UxMYY84AozDBSV9Kb89Uc8tbeT5iCf1XTA+Oll5M96dr5J+xX/2z HbpvPnKbtisdJ8QLONnFw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrudekgdefgecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhfffugggtgffkfhgjvfevofesthejredtredtjeenucfhrhhomhepofgrgihi mhgvucftihhprghrugcuoehmrgigihhmvgestggvrhhnohdrthgvtghhqeenucggtffrrg htthgvrhhnpeevvdelieejgedvkeffheekheeilefhgefgffehteekueelvddtueffheet ledtffenucevlhhushhtvghrufhiiigvpedvnecurfgrrhgrmhepmhgrihhlfhhrohhmpe hmrgigihhmvgestggvrhhnohdrthgvtghh X-ME-Proxy: Feedback-ID: i8771445c:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 7 Dec 2022 06:55:26 -0500 (EST) From: Maxime Ripard Date: Wed, 07 Dec 2022 12:53:19 +0100 Subject: [PATCH 08/15] drm/vc4: hvs: Ignore atomic_flush if we're disabled MIME-Version: 1.0 Message-Id: <20221207-rpi-hvs-crtc-misc-v1-8-1f8e0770798b@cerno.tech> References: <20221207-rpi-hvs-crtc-misc-v1-0-1f8e0770798b@cerno.tech> In-Reply-To: <20221207-rpi-hvs-crtc-misc-v1-0-1f8e0770798b@cerno.tech> To: Emma Anholt , Maxime Ripard , David Airlie , Daniel Vetter , Eric Anholt X-Mailer: b4 0.11.0-dev-8c583 X-Developer-Signature: v=1; a=openpgp-sha256; l=835; i=maxime@cerno.tech; h=from:subject:message-id; bh=pe2k0BPbXfvS6CAIBcCwRojjO6EKVGqS5JbuGrVO1bk=; b=owGbwMvMwCX2+D1vfrpE4FHG02pJDMkT6lb+n1NfmPCRocrEi/Mb+8oQE42VCou9k5bMFMpoYsg/ LtnaUcrCIMbFICumyBIjbL4k7tSs151sfPNg5rAygQxh4OIUgIls4Wf4n/u1PvWO6ZnrtvrZgSs5tg WoNtS1efDtm/pjYmb7ySZGS4Z/OpN0PtyddOFGduO5CsGLzlPezA+0dNvZrLfqY9nfpVd/cQEA X-Developer-Key: i=maxime@cerno.tech; a=openpgp; fpr=BE5675C37E818C8B5764241C254BCFC56BF6CE8D 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: Maxime Ripard , Mateusz Kwiatkowski , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Dave Stevenson 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 Reviewed-by: Dave Stevenson --- 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 3582ede1a0aa..5fadbf219542 100644 --- a/drivers/gpu/drm/vc4/vc4_hvs.c +++ b/drivers/gpu/drm/vc4/vc4_hvs.c @@ -579,6 +579,9 @@ void vc4_hvs_atomic_flush(struct drm_crtc *crtc, return; } + 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(hvs);