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 8C938606A31C for ; Sun, 29 Nov 2026 18:09:18 +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=tPK4pRnn Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 392C110E0C6; Sun, 29 Nov 2026 18:09:13 +0000 (UTC) Received: from mail-ot1-f47.google.com (mail-ot1-f47.google.com [209.85.210.47]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4E69010E0C6 for ; Sun, 29 Nov 2026 18:07:16 +0000 (UTC) Received: by mail-ot1-f47.google.com with SMTP id 46e09a7af769-862a5b64755so5427063a34.2 for ; Sun, 29 Nov 2026 10:07:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1795975635; x=1796580435; 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=F7IFdMInpbigWJITDDNJxK3fEvX6j+2SOuXgrLyv/aY=; b=tPK4pRnnorzCACcvHguXs2mseypweYUp/6iEMn1iLJMYeKKH3B3V1q3rK38LonjaG0 eMH2ardP4yFT0xShC8reXxQ64fSKHW00JRAgLNUfZjhyxqdNqSfFfHUEBnskIyCCTBxP wCGGvafbWQ4wiferZaSqBVBDTX0bq2UfYCCa8WOF3o8TYG8aRExlCeRq4rHmo8dCKUCj ChE15z5zdL6n5NotjoiQG4DkIg4L1X22s5PUrt6eskIC7tjKi5ft1IlQjy7EiJQJswlX TYuZzb8x3erYYe/N98g/GE9rgfPoa2SxTK4vpSISsxzIU9cDLZuM8ubh4OBzDCLLnnk5 I0hg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1795975635; x=1796580435; 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=F7IFdMInpbigWJITDDNJxK3fEvX6j+2SOuXgrLyv/aY=; b=kfzEPuGpV+tIN+goMWGludZXeJzy1xSqgvUKHSka7c9VOlAVVFK6z5hIocGirIBc88 TACdYkLur82F6JExLsOdoSEbPuoQlyLEE23CnF1Tm4pF27jcKjvl9pQJYalqG7fO198a LB1mq2VWn0BRIYy4bFuS4Fm1fPeVb3p+/b63jcf5zdjZI/02adidxvNKHVHn3/idP2M4 UlKqRxQWq5IxUEBVbpc9g364VoHfWXiP6HCYudGsanOU3XT0RgnX/35r1pV0a9o6217X xCghV2iF+tuxDdzfbcRRdF5MCEIHgz97wWafPqjsjA0VaLkP86eRwRgse+1mBYc1mhNx 9YBQ== X-Gm-Message-State: APuU4Z9aVk2Ssvf8PY3zb9syTpH2ifZkA7dUrElmJBseRGc1nd43dKCe IZy0lisEL+v74I+N+azNRkv5/lnAiwIzIbwTT9NGqvTJqNflM9NB7ciyXhPQjESi X-Gm-Gg: AZFdTZcPWv2as+z1wP5nsLKs5bb2WEPkOL8Qd1lxhZVqxrTIbsY3ZM2cLbqAQLFOwQN uKiGPLqfvIpNc9GBFFBuNHN8sxf/Sr3V/mVO6dyOsyBIygbGBk7URch9SwwBjWMQ71Vp7kUzgBM RF/TNWBHaz1UxKZrTdDlhfBK//SZF0fkgcUKeqKw0tq6Aa8asMcZsjl7YHr0hPvbXzu4KP7KKJ/ L8mNbc3H9VSm3PEaQxbD/20QuVC/+9mP/ThRvvEwilShSiBMHCECkyN9sX0UfSC5QMsbFfCLh2X AZonuJWxYQ8kNQ7+ab4yFjgRHFrHJ015Dv4VNtztPUHFGcK4FkqilS81ZRDIs4HzlxLuqfB0qTK Jq49Xj8e0Xhb7CHcjl9ywYQ4Ym98HbvqPN99XOkd4IP1JAjGxRpfBj2Y+PoYCT6tZtBRQ0Fbbh4 Ii7vydPiEX/jmnFWTHbFPXo5lrb5bAN2XhrsgpPn63yGJDBXRDJg38PLtYPbm6/5U2EHJJDoXdk bpCXwjEDIyK/42j9ppn7HSKMz1B/izkR4kqRbIR43s0xNm7jZocmsUazISqedzXuUJ79pDEKahn URwl6er1LWoZJAU2Nn7c5nNwwcLkb8JLefp+i2q/qp5ygtvP5n/QNZdL/iScL+HaNv9y7jUQVv1 NkDDOtvEEnw== X-Received: by 2002:a05:6808:23ca:b0:4b5:5bfd:518f with SMTP id 5614622812f47-57a08917887mr37498024b6e.21.1795975635309; Sun, 29 Nov 2026 10:07:15 -0800 (PST) Received: from localhost.localdomain ([72.12.197.23]) by smtp.gmail.com with ESMTPSA id 5614622812f47-57a34250ef2sm24226176b6e.3.2026.11.29.10.07.14 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 29 Nov 2026 10:07:15 -0800 (PST) From: Aditya Tipre To: igt-dev@lists.freedesktop.org Cc: dri-devel@lists.freedesktop.org, louis.chauvet@bootlin.com, sowmiya.s@intel.com, kamil.konieczny@linux.intel.com, karthik.b.s@intel.com, swati2.sharma@intel.com, tipreaditya@gmail.com Subject: [PATCH i-g-t v4 2/2] tests/kms_writeback: Check CRC capture survives writeback Date: Sun, 29 Nov 2026 13:07:00 -0500 Message-ID: <20261129180700.89278-3-tipreaditya@gmail.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20261129180700.89278-1-tipreaditya@gmail.com> References: <20261129180700.89278-1-tipreaditya@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=unavailable 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 The existing writeback tests validate captured framebuffer contents, but do not keep pipe CRC capture active across writeback completion. This misses the VKMS bug where writeback cleanup disables the composer while CRC capture still needs it, leaving subsequent CRC reads waiting for samples that never arrive. Add a VKMS-only writeback-preserves-crc subtest. Complete the initial modeset before starting capture and establish reference CRCs for separate red and blue input framebuffers. Keep capture open across four alternating writebacks, wait for each output fence, and compare three fresh CRC samples with the corresponding reference after each writeback. Do not allow modesets once capture starts, since they may disrupt CRC generation. Clear the pending out-fence request left by the configuration probe before the initial modeset so the subtest also works when run independently. Use the final fixture to close capture, disable the output, and remove the two new framebuffers so subtest failure or skip also cleans them up. Check output fence status in the shared wait helper so a signalled error fence cannot be treated as a successful writeback. On ARM64 QEMU with one and two CPUs, the new subtest fails with a CRC read timeout on the unmodified kernel and passes with the VKMS composer-user lifetime fix, both independently and in the full writeback suite. Signed-off-by: Aditya Tipre --- tests/kms_writeback.c | 67 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) diff --git a/tests/kms_writeback.c b/tests/kms_writeback.c index 550d603..e277752 100644 --- a/tests/kms_writeback.c +++ b/tests/kms_writeback.c @@ -64,6 +64,10 @@ * * SUBTEST: writeback-pixel-formats * Description: Check the writeback format + * + * SUBTEST: writeback-preserves-crc + * Description: CRC capture remains active across completed writebacks + * Driver requirement: vkms */ IGT_TEST_DESCRIPTION( @@ -321,6 +325,7 @@ static void get_and_wait_out_fence(igt_output_t *output) ret = sync_fence_wait(output->writeback_out_fence_fd, 1000); igt_assert_f(ret == 0, "sync_fence_wait failed: %s\n", strerror(-ret)); + igt_assert_eq(sync_fence_status(output->writeback_out_fence_fd), 1); close(output->writeback_out_fence_fd); output->writeback_out_fence_fd = -1; } @@ -541,6 +546,8 @@ int igt_main_args("b:c:f:dl", long_options, help_str, opt_handler, NULL) igt_output_t *output; igt_plane_t *plane; igt_fb_t input_fb, input_fb_10bit; + static igt_pipe_crc_t *pipe_crc; + static igt_fb_t crc_blue_fb, crc_output_fb; drmModeModeInfo mode; unsigned int fb_id; int ret; @@ -713,8 +720,68 @@ int igt_main_args("b:c:f:dl", long_options, help_str, opt_handler, NULL) igt_remove_fb(display.drm_fd, &output_fb); } + igt_describe("CRC capture remains active across completed writebacks"); + igt_subtest("writeback-preserves-crc") { + igt_fb_t *colors[] = { &input_fb, &crc_blue_fb }; + igt_crc_t reference[2], crc; + int i, j; + + igt_skip_on(data.dump_check || data.list_modes); + igt_require(is_vkms_device(display.drm_fd)); + igt_require(data.supported_colors & XRGB8888); + igt_require_pipe_crc(display.drm_fd); + + igt_create_color_fb(display.drm_fd, mode.hdisplay, mode.vdisplay, + DRM_FORMAT_XRGB8888, DRM_FORMAT_MOD_LINEAR, + 0.0, 0.0, 1.0, &crc_blue_fb); + igt_create_fb(display.drm_fd, mode.hdisplay, mode.vdisplay, + DRM_FORMAT_XRGB8888, DRM_FORMAT_MOD_LINEAR, + &crc_output_fb); + fill_fb(&input_fb, 0x00ff0000); + igt_plane_set_fb(plane, &input_fb); + igt_output_set_writeback_fb(output, NULL); + /* Discard the out-fence request left by the configuration probe. */ + igt_output_set_prop_value(output, IGT_CONNECTOR_WRITEBACK_OUT_FENCE_PTR, + to_user_pointer(NULL)); + igt_display_commit_atomic(&display, DRM_MODE_ATOMIC_ALLOW_MODESET, NULL); + + /* Finish the modeset before starting continuous CRC capture. */ + pipe_crc = igt_pipe_crc_new(display.drm_fd, output->config.crtc_index, + IGT_PIPE_CRC_SOURCE_AUTO); + igt_pipe_crc_start(pipe_crc); + + /* + * Establish both references before writeback can affect capture. + * Do not allow modesets below: they may disrupt continuous CRC + * generation. + */ + for (i = 0; i < ARRAY_SIZE(colors); i++) { + igt_plane_set_fb(plane, colors[i]); + igt_display_commit_atomic(&display, 0, NULL); + igt_pipe_crc_get_current(display.drm_fd, pipe_crc, &reference[i]); + } + + for (i = 0; i < 4; i++) { + int color = i % ARRAY_SIZE(colors); + + igt_plane_set_fb(plane, colors[color]); + igt_output_set_writeback_fb(output, &crc_output_fb); + igt_display_commit_atomic(&display, 0, NULL); + get_and_wait_out_fence(output); + + /* Require fresh frames without stopping or restarting capture. */ + for (j = 0; j < 3; j++) { + igt_pipe_crc_get_current(display.drm_fd, pipe_crc, &crc); + igt_assert_crc_equal(&reference[color], &crc); + } + } + } + igt_fixture() { + igt_pipe_crc_free(pipe_crc); cleanup_writeback(&display, output); + igt_remove_fb(display.drm_fd, &crc_blue_fb); + igt_remove_fb(display.drm_fd, &crc_output_fb); igt_remove_fb(display.drm_fd, &input_fb); if (data.supported_colors & XRGB2101010) -- 2.50.1 (Apple Git-155)