All of lore.kernel.org
 help / color / mirror / Atom feed
From: Imre Deak <imre.deak@intel.com>
To: igt-dev@lists.freedesktop.org
Subject: [igt-dev] [PATCH i-g-t 2/6] tests/kms_ccs: Use test pattern when possible
Date: Fri, 27 Aug 2021 17:57:52 +0300	[thread overview]
Message-ID: <20210827145756.3342904-3-imre.deak@intel.com> (raw)
In-Reply-To: <20210827145756.3342904-1-imre.deak@intel.com>

A CRC match against a test pattern reference image gives a better
guarantee than against a solid filled image, so use a test pattern
instead.

The sprite tests compare a single solid filled reference plane against
two overlapped solid filled planes for some reason, so for these subtests
and the fast clear subtest still keep the solid filled pattern.

Signed-off-by: Imre Deak <imre.deak@intel.com>
---
 tests/kms_ccs.c | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/tests/kms_ccs.c b/tests/kms_ccs.c
index f376f1c80..5bc50b4bb 100644
--- a/tests/kms_ccs.c
+++ b/tests/kms_ccs.c
@@ -329,15 +329,21 @@ static void generate_fb(data_t *data, struct igt_fb *fb,
 		srand(data->seed);
 		fill_fb_random(data->drm_fd, fb);
 	} else if (!(data->flags & TEST_BAD_PIXEL_FORMAT)) {
+		bool do_fast_clear = is_ccs_cc_modifier(data->ccs_modifier);
+		bool do_solid_fill = do_fast_clear || data->plane;
 		int c = !!data->plane;
 
-		if (is_ccs_cc_modifier(modifier)) {
+		if (do_fast_clear && (fb_flags & FB_COMPRESSED)) {
 			fast_clear_fb(data->drm_fd, fb, cc_color);
 		} else {
 			cr = igt_get_cairo_ctx(data->drm_fd, fb);
-			igt_paint_color(cr, 0, 0, width, height,
-					colors[c].r, colors[c].g, colors[c].b);
-					igt_put_cairo_ctx(cr);
+
+			if (do_solid_fill)
+				igt_paint_color(cr, 0, 0, width, height,
+						colors[c].r, colors[c].g, colors[c].b);
+			else
+				igt_paint_test_pattern(cr, width, height);
+			igt_put_cairo_ctx(cr);
 		}
 	}
 
-- 
2.27.0

  parent reply	other threads:[~2021-08-27 14:58 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-27 14:57 [igt-dev] [PATCH i-g-t 0/6] lib/igt_fb: Remove stride, offset restrictions on CCS FBs Imre Deak
2021-08-27 14:57 ` [igt-dev] [PATCH i-g-t 1/6] tests/kms_ccs: Make sure to free GEM and FB objects Imre Deak
2021-08-31 17:47   ` Juha-Pekka Heikkila
2021-08-31 18:54     ` Imre Deak
2021-08-27 14:57 ` Imre Deak [this message]
2021-08-31 17:48   ` [igt-dev] [PATCH i-g-t 2/6] tests/kms_ccs: Use test pattern when possible Juha-Pekka Heikkila
2021-08-31 18:51     ` Juha-Pekka Heikkila
2021-08-27 14:57 ` [igt-dev] [PATCH i-g-t 3/6] tests/kms_ccs: Fix small aux stride subtest Imre Deak
2021-08-31 17:48   ` Juha-Pekka Heikkila
2021-08-27 14:57 ` [igt-dev] [PATCH i-g-t 4/6] tests/kms_ccs: Test bad params for all CCS planes Imre Deak
2021-08-31 17:49   ` Juha-Pekka Heikkila
2021-08-27 14:57 ` [igt-dev] [PATCH i-g-t 5/6] lib/igt_fb: Add support for remapping CCS FBs Imre Deak
2021-08-31 17:49   ` Juha-Pekka Heikkila
2021-08-27 14:57 ` [igt-dev] [PATCH i-g-t 6/6] for-ci: Check for ccs remap support Imre Deak
2021-08-31 17:52   ` Juha-Pekka Heikkila
2021-08-31 19:08     ` Imre Deak
2021-09-14  7:46   ` Zbigniew Kempczyński
2021-09-14  8:40     ` Imre Deak
2021-08-27 16:05 ` [igt-dev] ✓ Fi.CI.BAT: success for lib/igt_fb: Remove stride, offset restrictions on CCS FBs Patchwork
2021-08-27 19:08 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork

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=20210827145756.3342904-3-imre.deak@intel.com \
    --to=imre.deak@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.