From patchwork Fri Jul 28 09:06:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 127480 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:918b:0:b0:3e4:2afc:c1 with SMTP id s11csp316520vqg; Fri, 28 Jul 2023 02:50:55 -0700 (PDT) X-Google-Smtp-Source: APBJJlEqHs8/Edq9kkd5QviYgSkw8ef+BUY1rg0JhzVX1NNZ6D7ZX8MOPHcNxjv8qjb+HQu48lKO X-Received: by 2002:a17:902:b714:b0:1bb:2020:be0d with SMTP id d20-20020a170902b71400b001bb2020be0dmr1155348pls.14.1690537855628; Fri, 28 Jul 2023 02:50:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690537855; cv=none; d=google.com; s=arc-20160816; b=SI7D/0dVTe+3QHFzV0FuKK12iul3JkyveNdnwefk/0WxVl6AMA52sGhyaxtRP+cXHV OkIEOPPX7y2m9iaMK9oP/yhbg31rUXhXWVm5guZLZbKRFg+mIWuBB3KdrbAgJynzQhiB KT0mXwoNsObsobzbhiIdQimmysWhKEvFMkK4u9w9gLYZQDuHBVllRMsjXMc9LrL3Ibii 5dVlZUaIgQvjQ22fUe9+GFlQVOEdDaR0+EqO5pz6OeOVkK4RnzGRTQxLfnK7fC3gnjos Y0Y7DIFvALtFc2nMXQq4z5S1kcW9pm88n/hiEbSoIhFJVzRi/wAJWi1GykbeIw2JFmyd 3oFA== 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=REs++npfS5/tggbeCsBvEz9dxpXXRM6NMtfy+oIEw9U=; fh=r3YnEVRF2ge3yIgpTE2H86lvFoURZyw1nrIW71mPVsw=; b=EsRiByOx7SLVah+wW4tIcG+w8OAclxFrStPm9hZWXcxM3gwVUpPKfXdE9MOS2DJo44 NiAtD3xzuTiViLQ76s3B3fR5JeUfygbLlgeBH7Z/c5ZW4TSsJW1+yuFqKBCDwUvrKyzh ejY0czjClIgSU1Beko0/D8My0rERUaPJvTU+yHn4FJ8SzVuxgpCrU4bdQuJiEC7B5p7o 2DJla5dwLrzoG4GJxfzrQpN3AlBDKeMST+NBjQ9+Iaq9sCLgz873+tVYZhxCBKMbPURd WBxYBPEGtHeRoTIjgSPZztDV24S1khw1i80RUJkOv60Bzq8BHZDClQe/oVPgxsrCDUTe WDeA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=NvZe7XxA; 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 o12-20020a170902d4cc00b001b8609ddd28si2974168plg.362.2023.07.28.02.50.41; Fri, 28 Jul 2023 02:50:55 -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=NvZe7XxA; 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 S235129AbjG1JI3 (ORCPT + 99 others); Fri, 28 Jul 2023 05:08:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57728 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235284AbjG1JHb (ORCPT ); Fri, 28 Jul 2023 05:07:31 -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 BB69E449F; Fri, 28 Jul 2023 02:06:55 -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 A366962065; Fri, 28 Jul 2023 09:06:54 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B09DBC433C7; Fri, 28 Jul 2023 09:06:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1690535214; bh=gKdr5wVwnd5iV/T89XpwfyfOVoDtad9S9jijN97ZC8k=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=NvZe7XxAeMFcwVssgJ6Po1uWqAX+sCgVKij7qFhyIci/SGs3vgp2Q/BBOKi3Z0ZPe NkgrnodZv5N0SBw8D7CAAzyPAHPP88HjYKeXBFavyf7p73bCBtOf7E7Ug9hvCB03DR 09ogUjHXuauDqtkIDqVxy3o1vkhX+Fg8BWAlawzxbByn4BspGM3VeceaBf+JFmfJD6 bQBmClPX88tkzD98Qw6jWrzTlQXV2p+N6NwnFujlwsliJGQ5Nb6pYzZymcIBR9ZPqx RB5trmT8o6wLu9h21Dx8XOp14gwDK0ZZx7EKbgu6NIzJXpkCrJVoeVAhGuhxsrbvLc qIBALymEZ1nsw== From: Maxime Ripard Date: Fri, 28 Jul 2023 11:06:24 +0200 Subject: [PATCH v3 11/11] drm/vc4: tests: pv-muxing: Document test scenario MIME-Version: 1.0 Message-Id: <20230728-kms-kunit-actions-rework-v3-11-952565ccccfe@kernel.org> References: <20230728-kms-kunit-actions-rework-v3-0-952565ccccfe@kernel.org> In-Reply-To: <20230728-kms-kunit-actions-rework-v3-0-952565ccccfe@kernel.org> To: David Airlie , Daniel Vetter , Maarten Lankhorst , Thomas Zimmermann , Emma Anholt Cc: =?utf-8?q?Ma=C3=ADra_Canal?= , Javier Martinez Canillas , dri-devel@lists.freedesktop.org, David Gow , linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com, linux-kernel@vger.kernel.org, Maxime Ripard , Brendan Higgins X-Mailer: b4 0.12.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=2113; i=mripard@kernel.org; h=from:subject:message-id; bh=gKdr5wVwnd5iV/T89XpwfyfOVoDtad9S9jijN97ZC8k=; b=owGbwMvMwCX2+D1vfrpE4FHG02pJDCmHW7k4XCezyX63vvt+s8yL0lWbVvzor5xkd3rR+y22+ b9YIk3tO0pZGMS4GGTFFFlihM2XxJ2a9bqTjW8ezBxWJpAhDFycAjCRVV4M/xMMTAy0V6zyXh2u lv1N3fX8svR6Ye164d+s73TV2FW3vWBkOBb/NFzo31S1xf+vlFx9EODwu2Zio2P+vlalVS9OTPo qzAQA X-Developer-Key: i=mripard@kernel.org; a=openpgp; fpr=BE5675C37E818C8B5764241C254BCFC56BF6CE8D X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, 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: 1772657422879098329 X-GMAIL-MSGID: 1772657422879098329 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. Reviewed-by: Javier Martinez Canillas Reviewed-by: MaĆ­ra Canal Signed-off-by: Maxime Ripard --- 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) {