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 D1495606A33E for ; Mon, 30 Nov 2026 11:53:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=ZOL5XVXS Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 738E010EF25; Mon, 30 Nov 2026 11:53:05 +0000 (UTC) Received: from mail-pj1-f52.google.com (mail-pj1-f52.google.com [209.85.216.52]) by gabe.freedesktop.org (Postfix) with ESMTPS id BA45010E786 for ; Mon, 30 Nov 2026 11:51:07 +0000 (UTC) Received: by mail-pj1-f52.google.com with SMTP id 98e67ed59e1d1-3b413d04c93so5844768a91.1 for ; Mon, 30 Nov 2026 03:51:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796039467; x=1796644267; darn=lists.freedesktop.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=HAUITK3Jw5tMhW8LrvdhRL1Kr8E2RoTQGlhMfrdedlg=; b=ZOL5XVXSfDTCa2b9U5vAmIB6XIR1T++MTHrkD9tzRo7+KzlW040mS5uDOT+6pp/1ao 8l67djCztiHcxsjbWAylHAc2N3X1fPwex2/ws2lvtoYw5LcsZC1XFq0yICRsXFmH3DSl SicNowHYeHHat1/nTedLor9JfFg82Dn2qAh5thZklKTubEnk0300Tbl/x26i+5j2CuOe 5wnrXDLWBgrWEymRbnOkESxS43fsG5v5Ts4ibQwM7yc11mP5PDROCuHtI1I5uitmYHvg q/q7OHqXRrK27KdSz+EMODx+NFQzsWD1q2uyWjLyv/T6UlLOS8MWQRSYMs1B+hNtJtQH 64eg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796039467; x=1796644267; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=HAUITK3Jw5tMhW8LrvdhRL1Kr8E2RoTQGlhMfrdedlg=; b=MKXbdm0oPKXD0GvK90lkXIbBeKotagJl2kLojznxWrF8EkzShKHfuFHSENPfyKHBcA Qqdbn+bP9xxaGyFq/smoK/JwX3KTUaTWdk1v5hjclqs11fBis3X71LHwyAHclYRAGzZs U7OMCB2cLuNfh9noZK2gaOD0UyrlUcd5KnqoDJUlvpCff3il6zmPegGsxI040yM6ZfqD y0HjgQbZn0XS/ESnVc+YTfcg5ikSNW60mAYgfoCev3uOTi3sVqWNq7EioOOWSVDF5NC+ AXht2JZ0maSjxK8COc1nz8wScnW161nGmrgyFBO8CeSLLAztqSWJ9qKwgKJx2Hf1lhw6 W+fA== X-Gm-Message-State: APuU4Z9bQk+11NZdSdzEKZpHvYvWfI1OE5fjPrx3H6ZqUDrBKBqJec+0 OjYKtMRih/AUIgntfIwosoYlGh7ttep6OE9kHD2r78UZcT0linFm2WVxrjwSQB/D X-Gm-Gg: AZFdTZcjafmQ9sRQCXpCO6kP5tN+U3/S5OC6Wa3HlyH81+1OZZZZAEJFqhd5lhAURbj GrmcrTpoZp/CDR5wQJ6g1Qm6YjSs1vSHM0uhQ2W/fcXpmyOomfSZjGJPTi4MqzdjyXGh3IG+1FN gwLQnog0Xrtew9qDeU84h7PI88FnLupo2w7iRqN+SGVTAmjP2AohNX71wI03JN2Uv7Bt8Qm2kfk Hl1eBeVOr5DlocyfqJOKcOZJe516rURmwmGayQoulAP0XmVkSUUFtboKh0+1+fh23zZbuqZIoaS aS2kyS6yBgWpkYVN5w8ltO5aPhSur7CLrXQzxN8eodD7aBNuR/V9YuR+jHjhSUPclcemStJYQhD Lo+MOfbeQ5wivB+/w22T+bXKBLBJnLW1zYTpO7rxFUPfrkfdSiSx+ANZ0judmQdofvmSJbpeCAD 2g0cidiDDqSJGSaCd3LaeipuYOvr6WcsaN33rL+5tHeeAa/EScfLm8oA1JdzV0A6ibQPUPaAa7k O/GSr9hsL871U+j/vs6cUna+z4gcUS9FWLJEj88fFv0yWJy5MaUNfY2lLw9k+qH5V3dh7ptTzPI juT6UBEYB2ghbNU5f/ECdCKjfzzAHKLrPMLiCFA7Y9yOJpDCPPUbEhkdHWI+4EiyNoQa8lL+Ba3 O1pSHIyy3eq7fDiON0A/HWep5K2eN X-Received: by 2002:a17:90b:4fd1:b0:3b3:fc1f:a5ba with SMTP id 98e67ed59e1d1-3b41cafdc52mr32038418a91.44.1796039466986; Mon, 30 Nov 2026 03:51:06 -0800 (PST) Received: from DESKTOP-TPPBPA1 (36-226-254-86.dynamic-ip.hinet.net. [36.226.254.86]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-3b405ffa98esm54920972a91.17.2026.11.30.03.51.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Nov 2026 03:51:06 -0800 (PST) From: Lin Tzu Yang To: igt-dev@lists.freedesktop.org Cc: kamil.konieczny@linux.intel.com, jani.nikula@intel.com Subject: [PATCH i-g-t v2] tests/kms_vblank: Query the pipe under test in the invalid subtest Date: Mon, 30 Nov 2026 19:51:04 +0800 Message-ID: <20261130115104.842861-1-rongh7426@gmail.com> X-Mailer: git-send-email 2.51.1.windows.1 In-Reply-To: <20261126030034.641144-1-rongh7426@gmail.com> References: <20261126030034.641144-1-rongh7426@gmail.com> X-Archived-By: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: igt-dev@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development mailing list for IGT GPU Tools List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "igt-dev" X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT 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 invalid_subtest() sets up data->crtc but builds its vblank requests without the pipe flag, so every request goes to CRTC 0. The other subtests add igt_crtc_get_vbl_flag(data->crtc). That breaks on hardware where the output under test can't be driven by CRTC 0. On a Raspberry Pi 5 (vc4), HDMI-A-1 only works with pipe C, so CRTC 0 is off and the first, valid query already fails: Starting dynamic subtest: pipe-C-HDMI-A-1 (kms_vblank) CRITICAL: Failed assertion: wait_vblank(fd, &vbl) == 0 (kms_vblank) CRITICAL: Last errno: 22, Invalid argument Subtest invalid: FAIL The invalid-flag checks after it have the same problem: with CRTC 0 off, an -EINVAL can't tell a rejected flag from a CRTC that isn't running. Add the pipe flag to the valid query and to the invalid-flag checks. The final check, which asks for an out-of-range pipe on purpose, is left as is. Tested on a Raspberry Pi 5 (Raspberry Pi OS kernel 6.18.39): the invalid subtest fails before and passes after. Reviewed-by: Jani Nikula Signed-off-by: Lin Tzu Yang --- v2: - Move the note about AI use below the --- line (Kamil). - Use my full name in the author and Signed-off-by (Kamil). - Add Jani's Reviewed-by. This change was written with the help of an AI coding assistant (Claude); the test runs were done on real hardware. tests/kms_vblank.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/kms_vblank.c b/tests/kms_vblank.c index 47b733a..018bc6f 100644 --- a/tests/kms_vblank.c +++ b/tests/kms_vblank.c @@ -582,12 +582,14 @@ static void invalid_subtest(data_t *data, int fd) union drm_wait_vblank vbl; unsigned long valid_flags; igt_output_t *output = data->output; + uint32_t crtc_flag; prepare_crtc(data, fd, output); + crtc_flag = igt_crtc_get_vbl_flag(data->crtc); /* First check all is well with a simple query */ memset(&vbl, 0, sizeof(vbl)); - vbl.request.type = _DRM_VBLANK_RELATIVE; + vbl.request.type = _DRM_VBLANK_RELATIVE | crtc_flag; igt_assert_eq(wait_vblank(fd, &vbl), 0); valid_flags = (_DRM_VBLANK_TYPES_MASK | @@ -596,7 +598,7 @@ static void invalid_subtest(data_t *data, int fd) /* pick some interesting invalid permutations */ memset(&vbl, 0, sizeof(vbl)); - vbl.request.type = _DRM_VBLANK_RELATIVE | ~valid_flags; + vbl.request.type = _DRM_VBLANK_RELATIVE | crtc_flag | ~valid_flags; igt_assert_eq(wait_vblank(fd, &vbl), -EINVAL); for (int bit = 0; bit < 32; bit++) { int err; @@ -605,7 +607,7 @@ static void invalid_subtest(data_t *data, int fd) continue; memset(&vbl, 0, sizeof(vbl)); - vbl.request.type = _DRM_VBLANK_RELATIVE | (1 << bit); + vbl.request.type = _DRM_VBLANK_RELATIVE | crtc_flag | (1 << bit); err = wait_vblank(fd, &vbl); igt_assert_f(err == -EINVAL, "vblank wait with invalid request.type bit %d [0x%08x] did not report -EINVAL, got %d\n", -- 2.51.1.windows.1