Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6F663D2592C for ; Tue, 27 Jan 2026 04:12:26 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2084B10E272; Tue, 27 Jan 2026 04:12:26 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="InpzXCt5"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.13]) by gabe.freedesktop.org (Postfix) with ESMTPS id C702010E24C for ; Tue, 27 Jan 2026 04:12:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1769487143; x=1801023143; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=LC4yuioMcc0WazJ2Jx2I88mkeYBD1fUTlIkDTI+ZmTs=; b=InpzXCt5X2ECuMj0eb3WZtlhDOQ1c6MFPxAc6e0Moq28UOB2C+6rWb5i ga/PUVCFiZ2kOv2JALUB0xA0fdEF6R5PA4KUvgWV0nSxNvt41U79bJObU d386RqbMR9BYwq1J9vY/E4AQa+JiPPloiLtB9Bg0u7TGjwie4jxGmg/eL /fGSiLMbyIkEV7tG+L+YH1sPI1O9H/XwjK3XXUzh7KFTtuaQfot5IXV9/ RPGxAln2N1Gm2nIogr9JSrwjfbDlCG41/hANyV0ufHw/US87VcoN3gc+D qeEbW3rfxvVjUNa9SIGhO3DArp+4IAVYQMO+D5Sl3TiyWLJtb9ygfdp9j Q==; X-CSE-ConnectionGUID: L6dJ8HAnRFazYG/BXboPAQ== X-CSE-MsgGUID: fgRzLp1CSAimic5JD77WMQ== X-IronPort-AV: E=McAfee;i="6800,10657,11683"; a="81783921" X-IronPort-AV: E=Sophos;i="6.21,256,1763452800"; d="scan'208";a="81783921" Received: from fmviesa004.fm.intel.com ([10.60.135.144]) by orvoesa105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Jan 2026 20:12:23 -0800 X-CSE-ConnectionGUID: XnjibqtxT96diHJkZqNw9w== X-CSE-MsgGUID: DlfZ/PSdSkuQb/eD0VGaXg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.21,256,1763452800"; d="scan'208";a="212724514" Received: from sowmi-x299-aorus-gaming-3-pro.iind.intel.com ([10.223.74.56]) by fmviesa004-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Jan 2026 20:12:22 -0800 From: Sowmiya S To: igt-dev@lists.freedesktop.org Cc: swati2.sharma@intel.com, suraj.kandpal@intel.com, Sowmiya S Subject: [PATCH i-g-t v7 6/9] tests/kms_writeback: Refactor writeback-fb-id subtest Date: Tue, 27 Jan 2026 10:02:30 +0530 Message-ID: <20260127043233.254107-7-sowmiya.s@intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260127043233.254107-1-sowmiya.s@intel.com> References: <20260127043233.254107-1-sowmiya.s@intel.com> 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-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: igt-dev-bounces@lists.freedesktop.org Sender: "igt-dev" Remove individual tests for each format for the test writeback-fb-id and introduce dynamic subtest generation based on the formats supported. Framebuffer creation was now part of the subtest level based on format. v4: squashed the FB creation function with this commit (Suraj) v5: -Update dynamic subtest documentation (Suraj) -Rename input_fb to in_fb -Set plane to in_fb and remove unused input_fb as an arg to writeback-fb-id function. v6: -Remove in_fb inside subtest and reuse input_fb from fixture (Suraj) v7: -Join nested if conditions (Suraj) Signed-off-by: Sowmiya S --- tests/kms_writeback.c | 56 ++++++++++++++++++------------------------- 1 file changed, 23 insertions(+), 33 deletions(-) diff --git a/tests/kms_writeback.c b/tests/kms_writeback.c index 63917bf4f..58118b8da 100644 --- a/tests/kms_writeback.c +++ b/tests/kms_writeback.c @@ -51,9 +51,6 @@ * SUBTEST: writeback-check-output * Description: Check writeback output with CRC validation * - * SUBTEST: writeback-fb-id-XRGB2101010 - * Description: Validate WRITEBACK_FB_ID with valid and invalid options - * * SUBTEST: writeback-fb-id * Description: Validate WRITEBACK_FB_ID with valid and invalid options * @@ -700,37 +697,30 @@ int igt_main_args("b:c:f:dl", long_options, help_str, opt_handler, NULL) } igt_describe("Validate WRITEBACK_FB_ID with valid and invalid options"); - igt_subtest("writeback-fb-id") { - igt_fb_t output_fb; - - igt_skip_on(data.dump_check || data.list_modes); - igt_skip_on_f(!(data.supported_colors & XRGB8888),"DRM_FORMAT_XRGB8888 is unsupported\n"); - fb_id = igt_create_fb(display.drm_fd, mode.hdisplay, mode.vdisplay, - DRM_FORMAT_XRGB8888, - DRM_FORMAT_MOD_LINEAR, - &output_fb); - igt_require(fb_id > 0); - - writeback_fb_id(output, &input_fb, &output_fb); - - igt_remove_fb(display.drm_fd, &output_fb); - } + igt_subtest_with_dynamic_f("writeback-fb-id") { + for (int i = 0; i < ARRAY_SIZE(fourcc); i++) { + uint32_t test_format = fourcc[i]; + int bpc = igt_drm_format_get_bpc(test_format); - igt_describe("Validate XRGB2101010 WRITEBACK_FB_ID with valid and invalid options"); - igt_subtest("writeback-fb-id-XRGB2101010") { - igt_fb_t output_fb; - - igt_skip_on(data.dump_check || data.list_modes); - igt_skip_on_f(!(data.supported_colors & XRGB2101010), "DRM_FORMAT_XRGB2101010 is unsupported\n"); - fb_id = igt_create_fb(display.drm_fd, mode.hdisplay, mode.vdisplay, - DRM_FORMAT_XRGB2101010, - DRM_FORMAT_MOD_LINEAR, - &output_fb); - igt_require(fb_id > 0); - - writeback_fb_id(output, &input_fb_10bit, &output_fb); - - igt_remove_fb(display.drm_fd, &output_fb); + if (is_intel_device(display.drm_fd) && + (!strstr(igt_format_str(test_format), "BGR"))) + continue; + igt_dynamic_f("writeback-fb-id-%s", igt_format_str(test_format)) { + igt_fb_t output_fb; + + fb_id = igt_create_fb(display.drm_fd, mode.hdisplay, mode.vdisplay, + get_default_fb_format(&display, bpc), + igt_fb_mod_to_tiling(0), + &output_fb); + + igt_skip_on(data.dump_check || data.list_modes); + igt_skip_on_f(!(data.supported_colors & (1 << i)), + "DRM_FORMAT_%s is not supported\n", + igt_format_str(test_format)); + writeback_fb_id(output, &input_fb, &output_fb); + igt_remove_fb(display.drm_fd, &output_fb); + } + } } igt_describe("Check writeback output with CRC validation"); -- 2.43.0