From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D7BED606A33E for ; Wed, 2 Dec 2026 02:30:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=jCLRN2G1 Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 40B9E10EAB5; Wed, 2 Dec 2026 02:30:52 +0000 (UTC) Received: from sea.source.kernel.org (sea.source.kernel.org [172.234.252.31]) by gabe.freedesktop.org (Postfix) with ESMTPS id F185810EB27 for ; Wed, 2 Dec 2026 02:30:45 +0000 (UTC) Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by sea.source.kernel.org (Postfix) with ESMTP id A068043544; Wed, 2 Dec 2026 02:30:45 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 70F701F00896; Wed, 2 Dec 2026 02:30:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796178645; bh=sxquClo17QUQcHsabXoMazsBo80hhBvEmZzzRPsVvKQ=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=jCLRN2G1j4hIpHOMBw1wEsYw8vDwMfAO7uoFfXUinFsZobTijo3JUh9KTwEpB+EmN WKItY2Cd0/QihZLuKrWR5N7wDgiQ+clKw+5SuVd7RaavYuFeLgq4VbyZ1zyHcJMgVQ niUh7lbpPu4aKVCzMJWL7IzLABgCN9Bcv4EeBxJwaajJDi2zEEkugDB8vIz5JZAtup HQLFzO3SCaM3/2fARTNp6z07f+RvIr6KYSfI4Fa5Sl3NqxslbrXfP+08YAMpMNTKWA 2gRQna+wE90uASt7QbEog5p4aQRy/Z7g4H3INIVX2Hu79juybMhTPwkxy1maTLLEC2 yTzb1Bng9HwFA== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH v2 22/25] drm/tests: hdmi: Verify SCDC resync on hotplug To: "Cristian Ciocaltea" Cc: dri-devel@lists.freedesktop.org In-Reply-To: <20261202-drm-conn-hdmi-cleanup-v2-22-ba7d32550ea4@collabora.com> References: <20261202-drm-conn-hdmi-cleanup-v2-0-ba7d32550ea4@collabora.com> <20261202-drm-conn-hdmi-cleanup-v2-22-ba7d32550ea4@collabora.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Wed, 02 Dec 2026 02:30:45 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: sashiko-reviews@lists.linux.dev Sender: "dri-devel" X-Spam-Status: No, score=-10.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 X-Archived-By: Thank you for your contribution! Sashiko AI review found 1 potential issue to consider: - [Medium] drm/tests: hdmi: missing scrambler enable in sync_scdc_test_init() -- commit 35a0d07086a97dfb477b4d0b35e08c73a5a0c8b1 Author: Cristian Ciocaltea drm/tests: hdmi: Verify SCDC resync on hotplug This commit adds KUnit tests for SCDC scrambling resynchronization across drm_connector_hdmi_sync_scdc(), drm_atomic_helper_connector_hdmi_hotplug(), and drm_atomic_helper_connector_hdmi_force_ctx(). > diff --git a/drivers/gpu/drm/tests/drm_hdmi_state_helper_test.c b/drivers= /gpu/drm/tests/drm_hdmi_state_helper_test.c > index 44204fcd4e169..e7b603b7f06c2 100644 > --- a/drivers/gpu/drm/tests/drm_hdmi_state_helper_test.c > +++ b/drivers/gpu/drm/tests/drm_hdmi_state_helper_test.c [ ... ] > @@ -315,6 +316,8 @@ static void test_encoder_atomic_enable(struct drm_enc= oder *encoder, > encoder_to_priv(encoder); > int ret; > =20 > + priv->encoder_enable_count++; > + > ret =3D drm_atomic_helper_connector_hdmi_update_infoframes(&priv->conne= ctor, state); > if (ret) > priv->hdmi_update_failures++; > @@ -4790,12 +4793,321 @@ static struct kunit_suite drm_atomic_helper_conn= ector_hdmi_scrambling_test_suite [ ... ] > +static struct drm_atomic_helper_connector_hdmi_priv * > +sync_scdc_test_init(struct kunit *test, > + const struct drm_connector_hdmi_funcs *hdmi_funcs, > + u8 vic, struct drm_modeset_acquire_ctx *ctx) > +{ > + struct drm_atomic_helper_connector_hdmi_priv *priv; > + struct drm_display_mode *mode; > + int ret; > + > + priv =3D drm_kunit_helper_connector_hdmi_init_with_scdc(test, hdmi_func= s, > + test_edid_hdmi_4k_rgb_yuv420_dc_max_600mhz); > + KUNIT_ASSERT_NOT_NULL(test, priv); > + > + drm_encoder_helper_add(&priv->encoder, &test_encoder_helper_funcs); > + > + mode =3D drm_kunit_display_mode_from_cea_vic(test, &priv->drm, vic); > + KUNIT_ASSERT_NOT_NULL(test, mode); > + > + drm_modeset_acquire_init(ctx, 0); > + > +retry_conn_enable: > + ret =3D drm_kunit_helper_enable_crtc_connector(test, &priv->drm, > + priv->crtc, > + &priv->connector, > + mode, ctx); > + if (ret =3D=3D -EDEADLK) { > + ret =3D drm_modeset_backoff(ctx); > + if (!ret) > + goto retry_conn_enable; > + } > + KUNIT_ASSERT_EQ(test, ret, 0); > + KUNIT_ASSERT_EQ(test, priv->encoder_enable_count, 1); > + > + return priv; > +} [Severity: Medium] Does sync_scdc_test_init() leave priv->connector.hdmi.scrambler_enabled set to false? drm_kunit_helper_enable_crtc_connector() computes connector.state->hdmi.scrambler_needed during atomic check, but neither test_encoder_atomic_enable() nor sync_scdc_test_init() calls drm_connector_hdmi_enable_scrambling() or sets hdmi.scrambler_enabled. Because drm_connector_hdmi_sync_scdc() checks hdmi->scrambler_enabled at entry: drivers/gpu/drm/display/drm_hdmi_helper.c:drm_connector_hdmi_sync_scdc() { ... if (!drm_connector_hdmi_scrambler_supported(connector) || !READ_ONCE(hdmi->scrambler_enabled)) return 0; ... } every call to drm_connector_hdmi_sync_scdc() in this suite returns 0 before reading SCDC_TMDS_CONFIG or resetting the CRTC, causing the test cases expecting a CRTC reset or DDC error (-EIO) to fail their KUnit assertions. Note that if drm_connector_hdmi_enable_scrambling() is called during pipeline enable, it will also set SCDC_SCRAMBLING_ENABLE in priv->scdc_regs[SCDC_TMDS_CONFIG], so drm_test_hdmi_sync_scdc_force_ctx() will need to clear priv->scdc_regs[SCDC_TMDS_CONFIG] before calling drm_atomic_helper_connector_hdmi_force_ctx() to trigger a CRTC reset. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261202-drm-conn-h= dmi-cleanup-v2-0-ba7d32550ea4@collabora.com?part=3D22