From patchwork Mon Jul 10 07:47:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 117688 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp4857962vqx; Mon, 10 Jul 2023 01:00:47 -0700 (PDT) X-Google-Smtp-Source: APBJJlEAIozxakvetU0mkvas/V4wWyVv9YZJN6ZNXngEFrMOoONiumFxbZ+U9FCDyRSLuXcPI4UJ X-Received: by 2002:a37:b486:0:b0:767:3e13:6017 with SMTP id d128-20020a37b486000000b007673e136017mr10392651qkf.30.1688976047163; Mon, 10 Jul 2023 01:00:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688976047; cv=none; d=google.com; s=arc-20160816; b=iiquDqa6irfkeeFaG/KffkthRlYTzbMdJFfkdNNZnerWaZ4BhkWiS0Pjwwmc+n84dP IhfKlvMIHPIQ6J30QR4R0S+9S/iL0MdeFT5PlZx03R75Hr6jlpxDUyGTafrNMYr7J5nA BueNHbAUAtdUakGvExSyySnzN9L1x0qUVzc52EhxFKnsUiJvvlLBa6wg11KgOvy+CgcV +/Pnu7trvswYJvgT4YJzTADlgNsl8M3GNEz0FYwqnbD905VBIEIqR9/AiG6v+m4sMDng eLcB9oTizWuk9z92gAopzvBmQvMCVQja74oiLVwBnuStlx7qnXjzc5C3PdnE26pDJENJ 71hQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=Wzk69cPpzHH3OyErLzTff+54nkAMGxLe9ludJoOqMPA=; fh=hv+BGfRnZKm/Mx7Um70Asy2r1y7Zqr2lNnN/bFBL5yk=; b=WG4X5MA2PzDls7T+TAEMDA7c4tGpHLr4Nuj7126QIX2qTuCRc/AmqGNbAx4K1TQbm0 wtHf1plFpSpGc+4sc5zBaU1awt9CMf+G2FpNToQ5RPr/mm4kGRieaPAYxCEE6327LLhx pyXCuZMPvPK+TF2Tt+elgjS0EL/Iio7dy3Io0fyCD9f37loIhC2kMxKZUeIJIObkpn1N LwV2YDcXP3djRM2/7yAXr6tAfEamFljMS5oe5VA6PQ0TIiOaBoxYzUGIwZTX1kPic9Id fH15Lun6BY6aO2Ii2Rg4TS7/q6kAklNNCwF6h0I3KuemR/YVWFlQ6EpTi0EkiuWi3wCV ltzQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="aPZ/SRyb"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id mj13-20020a17090b368d00b00263aff4cd15si6498723pjb.106.2023.07.10.01.00.34; Mon, 10 Jul 2023 01:00:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="aPZ/SRyb"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232063AbjGJHtN (ORCPT + 99 others); Mon, 10 Jul 2023 03:49:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50724 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231656AbjGJHsP (ORCPT ); Mon, 10 Jul 2023 03:48:15 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 57AED115 for ; Mon, 10 Jul 2023 00:48:14 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id DE59560EB9 for ; Mon, 10 Jul 2023 07:48:13 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id F130EC433C8; Mon, 10 Jul 2023 07:48:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1688975293; bh=16TekcNJuTfVyllw7nW85RcUQBjN4RlFG7QvXpxKfus=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=aPZ/SRybsonfjxn87sVXsQVAfm8/hSViEfIkh2um+Bu/KDfax48CyrSZgSh9NB+gp QLyUg2fsUPjEUwIZkiBuZHgsAKUHhVGdeYeilhiCH4e29ZizFPYcc+B1SH8k+EaSVz HIvjRTVca/pGZ2F9ulezJVqBti6JkxQKRBTd0wzr7jBcyJ62EK08B3qbJ4m4UloL2f p5AjMfOJbpGPdDCLMUiaJyY5YqZCHvb2l/9y5Ncd4/ht0A1k2lxAHCTzCPk5uG4q+N MdzGp3efocrXoBis6u0dIIDqBOccwJN+PLxwcD2ysVIEW3veHml8BG50wCUjRG+61Z PC0YCMDOPe54g== From: Maxime Ripard Date: Mon, 10 Jul 2023 09:47:42 +0200 Subject: [PATCH 11/11] drm/vc4: tests: pv-muxing: Document test scenario MIME-Version: 1.0 Message-Id: <20230710-kms-kunit-actions-rework-v1-11-722c58d72c72@kernel.org> References: <20230710-kms-kunit-actions-rework-v1-0-722c58d72c72@kernel.org> In-Reply-To: <20230710-kms-kunit-actions-rework-v1-0-722c58d72c72@kernel.org> To: David Airlie , Daniel Vetter , Maarten Lankhorst , Thomas Zimmermann , Emma Anholt Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Maxime Ripard X-Mailer: b4 0.13-dev-099c9 X-Developer-Signature: v=1; a=openpgp-sha256; l=2002; i=mripard@kernel.org; h=from:subject:message-id; bh=16TekcNJuTfVyllw7nW85RcUQBjN4RlFG7QvXpxKfus=; b=owGbwMvMwCX2+D1vfrpE4FHG02pJDCmrt8/Yo2+y5cu1UPXXup3+aVuktpco688961VxVGVn1f3q JxslO0pZGMS4GGTFFFlihM2XxJ2a9bqTjW8ezBxWJpAhDFycAjCRCGNGhoXMwuy3I97lPVRwyNRNar 14/8GelZnuk5je5E5+d8ju2gJGhg7damVj7auJfyVOvd39vHFfQn53ycu4uHqV24/zXT4wcAAA X-Developer-Key: i=mripard@kernel.org; a=openpgp; fpr=BE5675C37E818C8B5764241C254BCFC56BF6CE8D X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1771019747651183683 X-GMAIL-MSGID: 1771019747651183683 We've had a couple of tests that weren't really obvious, nor did they document what they were supposed to test. Document that to make it hopefully more obvious. Signed-off-by: Maxime Ripard Reviewed-by: Javier Martinez Canillas --- drivers/gpu/drm/vc4/tests/vc4_test_pv_muxing.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/drivers/gpu/drm/vc4/tests/vc4_test_pv_muxing.c b/drivers/gpu/drm/vc4/tests/vc4_test_pv_muxing.c index 5f9f5626329d..61622e951031 100644 --- a/drivers/gpu/drm/vc4/tests/vc4_test_pv_muxing.c +++ b/drivers/gpu/drm/vc4/tests/vc4_test_pv_muxing.c @@ -845,6 +845,13 @@ static void drm_test_vc5_pv_muxing_bugs_subsequent_crtc_enable(struct kunit *tes KUNIT_EXPECT_NE(test, hdmi0_channel, hdmi1_channel); } +/* + * This test makes sure that we never change the FIFO of an active HVS + * channel if we disable a FIFO with a lower index. + * + * Doing so would result in a FIFO stall and would disrupt an output + * supposed to be unaffected by the commit. + */ static void drm_test_vc5_pv_muxing_bugs_stable_fifo(struct kunit *test) { struct drm_modeset_acquire_ctx *ctx; @@ -924,6 +931,21 @@ static void drm_test_vc5_pv_muxing_bugs_stable_fifo(struct kunit *test) } } +/* + * Test that if we affect a single output, only the CRTC state of that + * output will be pulled in the global atomic state. + * + * This is relevant for two things: + * + * - If we don't have that state at all, we are unlikely to affect the + * FIFO muxing. This is somewhat redundant with + * drm_test_vc5_pv_muxing_bugs_stable_fifo() + * + * - KMS waits for page flips to occur on all the CRTC found in the + * CRTC state. Since the CRTC is unaffected, we would over-wait, but + * most importantly run into corner cases like waiting on an + * inactive CRTC that never completes. + */ static void drm_test_vc5_pv_muxing_bugs_subsequent_crtc_enable_too_many_crtc_state(struct kunit *test) {