Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Ville Syrjala <ville.syrjala@linux.intel.com>
To: igt-dev@lists.freedesktop.org
Subject: [PATCH i-g-t v2 10/15] tests/kms_big_fb: Replace 'bpp' with 'name'
Date: Fri, 22 Dec 2023 16:31:54 +0200	[thread overview]
Message-ID: <20231222143159.24662-11-ville.syrjala@linux.intel.com> (raw)
In-Reply-To: <20231222143159.24662-1-ville.syrjala@linux.intel.com>

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

Instead of storing the bpp in the formats[] array let's instead
store a string represtantion. I want to add planar YCbCr tests
to the mix, and so a simple bpp value will no logner cut it.

A bunch of stuff is using the numerical bpp value for some things,
but we can replace those with igt_drm_format_to_bpp().

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 tests/intel/kms_big_fb.c | 30 ++++++++++++++++--------------
 1 file changed, 16 insertions(+), 14 deletions(-)

diff --git a/tests/intel/kms_big_fb.c b/tests/intel/kms_big_fb.c
index 1e6e01500be5..2b6fadeaa7a6 100644
--- a/tests/intel/kms_big_fb.c
+++ b/tests/intel/kms_big_fb.c
@@ -963,12 +963,12 @@ static const struct {
 
 static const struct {
 	uint32_t format;
-	uint8_t bpp;
+	const char *name;
 } formats[] = {
-	{ DRM_FORMAT_C8, 8, },
-	{ DRM_FORMAT_RGB565, 16, },
-	{ DRM_FORMAT_XRGB8888, 32, },
-	{ DRM_FORMAT_XBGR16161616F, 64, },
+	{ DRM_FORMAT_C8, "8bpp", },
+	{ DRM_FORMAT_RGB565, "16bpp", },
+	{ DRM_FORMAT_XRGB8888, "32bpp", },
+	{ DRM_FORMAT_XBGR16161616F, "64bpp", },
 };
 
 static const igt_rotation_t rotations[] = {
@@ -1091,8 +1091,8 @@ igt_main
 				igt_describe("Sanity check if scanout of big framebuffers works "
 					     "correctly for given combination of modifier formats "
 					     "and rotation");
-				igt_subtest_f("%s-%dbpp-rotate-%s%s", modifiers[i].name,
-					      formats[j].bpp,
+				igt_subtest_f("%s-%s-rotate-%s%s", modifiers[i].name,
+					      formats[j].name,
 					      igt_plane_rotation_name(data.rotation),
 					      rotation_flip_str(data.rotation))
 					test_scanout(&data);
@@ -1111,13 +1111,15 @@ igt_main
 		set_max_hw_stride(&data);
 
 		for (int j = 0; j < ARRAY_SIZE(formats); j++) {
+			int bpp = igt_drm_format_to_bpp(formats[j].format);
+
 			/*
 			 * try only those formats which can show full length.
 			 * Here 32K is used to have CI test results consistent
 			 * for all platforms, 32K is smallest number possbily
 			 * coming to data.hw_stride from above set_max_hw_stride()
 			 */
-			if (32768 / (formats[j].bpp >> 3) > 8192)
+			if (32768 / (bpp >> 3) > 8192)
 				continue;
 
 			data.format = formats[j].format;
@@ -1132,23 +1134,23 @@ igt_main
 					continue;
 
 				igt_describe("test maximum hardware supported stride length for given bpp and modifiers.");
-				igt_subtest_f("%s-max-hw-stride-%dbpp-rotate-%s%s",
-					      modifiers[i].name, formats[j].bpp,
+				igt_subtest_f("%s-max-hw-stride-%s-rotate-%s%s",
+					      modifiers[i].name, formats[j].name,
 					      igt_plane_rotation_name(data.rotation),
 					      rotation_flip_str(data.rotation)) {
 					igt_require(intel_display_ver(intel_get_drm_devid(data.drm_fd)) >= 5);
-					data.max_hw_fb_width = min(data.hw_stride / (formats[j].bpp >> 3), data.max_fb_width);
+					data.max_hw_fb_width = min(data.hw_stride / (bpp >> 3), data.max_fb_width);
 					test_scanout(&data);
 				}
 
 				data.async_flip_test = true;
 				igt_describe("test async flip on maximum hardware supported stride length for given bpp and modifiers.");
-				igt_subtest_f("%s-max-hw-stride-%dbpp-rotate-%s%s-async-flip",
-					      modifiers[i].name, formats[j].bpp,
+				igt_subtest_f("%s-max-hw-stride-%s-rotate-%s%s-async-flip",
+					      modifiers[i].name, formats[j].name,
 					      igt_plane_rotation_name(data.rotation),
 					      rotation_flip_str(data.rotation)) {
 					igt_require(has_async_flip(&data));
-					data.max_hw_fb_width = min(data.hw_stride / (formats[j].bpp >> 3), data.max_fb_width);
+					data.max_hw_fb_width = min(data.hw_stride / (bpp >> 3), data.max_fb_width);
 					test_scanout(&data);
 				}
 				data.async_flip_test = false;
-- 
2.41.0

  parent reply	other threads:[~2023-12-22 14:32 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-22 14:31 [PATCH i-g-t v2 00/15] tests/kms_big_fb: Test planar formats, and CCS Ville Syrjala
2023-12-22 14:31 ` [PATCH i-g-t v2 01/15] lib/rendercopy: Add deltas to all surface relocs Ville Syrjala
2023-12-22 14:31 ` [PATCH i-g-t v2 02/15] tests/kms_big_fb: Use igt_fb_create_intel_buf() Ville Syrjala
2023-12-22 14:31 ` [PATCH i-g-t v2 03/15] lib/igt_fb: Expose igt_fb_is_ccs_modifier() Ville Syrjala
2023-12-22 14:31 ` [PATCH i-g-t v2 04/15] tests/kms_big_fb: Fix async Ville Syrjala
2023-12-22 14:31 ` [PATCH i-g-t v2 05/15] tests/kms_big_fb: Test async flips + linear on tgl+ Ville Syrjala
2023-12-22 14:31 ` [PATCH i-g-t v2 06/15] tests/kms_big_fb: Determine the max fb size the same way always Ville Syrjala
2023-12-22 14:31 ` [PATCH i-g-t v2 07/15] tests/kms_frontbuffer_tracking: Use igt_create_fb() Ville Syrjala
2023-12-22 14:31 ` [PATCH i-g-t v2 08/15] lib/igt_fb: Make igt_calc_fb_size() somewhat usable Ville Syrjala
2023-12-22 14:31 ` [PATCH i-g-t v2 09/15] tests/kms_big_fb: Nuke fliptab[] Ville Syrjala
2023-12-22 14:31 ` Ville Syrjala [this message]
2023-12-22 14:31 ` [PATCH i-g-t v2 11/15] tests/kms_big_fb: Test planar YCbCr formats Ville Syrjala
2023-12-22 14:31 ` [PATCH i-g-t v2 12/15] tests/kms_big_fb: Also test some CCS modifiers Ville Syrjala
2023-12-22 14:31 ` [PATCH i-g-t v2 13/15] lib/rendercopy: Always setup clear color for TGL Ville Syrjala
2023-12-22 14:31 ` [PATCH i-g-t v2 14/15] tests/kms_big_fb: Enable CCS testing " Ville Syrjala
2023-12-22 14:31 ` [PATCH i-g-t v2 15/15] lib/rendercopy: Enable clear color consistently Ville Syrjala

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231222143159.24662-11-ville.syrjala@linux.intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox