All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ville Syrjala <ville.syrjala@linux.intel.com>
To: igt-dev@lists.freedesktop.org
Subject: [igt-dev] [PATCH i-g-t 02/11] tests/kms_rotation_crc: Use igt_plane_has_rotation()
Date: Thu,  2 Sep 2021 19:44:59 +0300	[thread overview]
Message-ID: <20210902164508.20104-3-ville.syrjala@linux.intel.com> (raw)
In-Reply-To: <20210902164508.20104-1-ville.syrjala@linux.intel.com>

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

Use igt_plane_has_rotation() instead of these annoying
hand rolled gen checks.

Also fix up the bogus CHV checks to match reality. Since
the test doesn't probe the final configuration with a
TEST_ONLY atomic commit we must still manually filter
out any case that would pass the basic rotation check but
fail later.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 tests/kms_rotation_crc.c | 35 ++++++++++++-----------------------
 1 file changed, 12 insertions(+), 23 deletions(-)

diff --git a/tests/kms_rotation_crc.c b/tests/kms_rotation_crc.c
index 2c66cd7c4e31..2101003d6b71 100644
--- a/tests/kms_rotation_crc.c
+++ b/tests/kms_rotation_crc.c
@@ -493,9 +493,6 @@ static void test_plane_rotation(data_t *data, int plane_type, bool test_bad_form
 		for (c = 0; c < num_rectangle_types; c++)
 			data->crc_rect[data->output_crc_in_use][c].valid = false;
 
-		if (is_i915_device(data->gfx_fd) && IS_CHERRYVIEW(data->devid) && pipe != PIPE_B)
-			continue;
-
 		/* restricting the execution to 2 pipes to reduce execution time*/
 		if (pipe_count == 2 * connected_outputs && !data->extended)
 			break;
@@ -505,6 +502,11 @@ static void test_plane_rotation(data_t *data, int plane_type, bool test_bad_form
 
 		plane = igt_output_get_plane_type(output, plane_type);
 		igt_require(igt_plane_has_prop(plane, IGT_PLANE_ROTATION));
+		igt_require(igt_plane_has_rotation(plane, data->rotation));
+		/* CHV can't rotate and reflect simultaneously */
+		igt_require(!is_i915_device(data->gfx_fd) ||
+			    !IS_CHERRYVIEW(data->devid) ||
+			    data->rotation != (IGT_ROTATION_180 | IGT_REFLECT_X));
 
 		prepare_crtc(data, output, pipe, plane, true);
 
@@ -738,13 +740,14 @@ static void test_multi_plane_rotation(data_t *data, enum pipe pipe)
 						     && intel_display_ver(data->devid) < 11)
 							continue;
 
-						if (igt_rotation_90_or_270(planeconfigs[i].rotation)
-						    && intel_display_ver(data->devid) >= 13)
+						if (!igt_plane_has_rotation(p[0].plane,
+									    planeconfigs[i].rotation))
 							continue;
 
-						if (igt_rotation_90_or_270(planeconfigs[j].rotation)
-						    && intel_display_ver(data->devid) >= 13)
+						if (!igt_plane_has_rotation(p[1].plane,
+									    planeconfigs[j].rotation))
 							continue;
+
 						/*
 						 * if using packed formats crc's will be
 						 * same and can store them so there's
@@ -892,6 +895,7 @@ static void test_plane_rotation_exhaust_fences(data_t *data,
 	int i;
 
 	igt_require(igt_plane_has_prop(plane, IGT_PLANE_ROTATION));
+	igt_require(igt_plane_has_rotation(plane, IGT_ROTATION_0 | IGT_ROTATION_90));
 	igt_require(gem_available_fences(display->drm_fd) > 0);
 
 	prepare_crtc(data, output, pipe, plane, false);
@@ -1048,10 +1052,7 @@ igt_main_args("", long_opts, help_str, opt_handler, &data)
 		igt_subtest_f("%s-rotation-%s",
 			      plane_test_str(subtest->plane),
 			      rot_test_str(subtest->rot)) {
-			if (is_i915_device(data.gfx_fd)) {
-				igt_require(!igt_rotation_90_or_270(subtest->rot) ||
-					    (gen >= 9 && gen < 13));
-			} else if (is_amdgpu_device(data.gfx_fd)) {
+			if (is_amdgpu_device(data.gfx_fd)) {
 				data.override_fmt = DRM_FORMAT_XRGB8888;
 				if (igt_rotation_90_or_270(subtest->rot))
 					data.override_tiling = AMD_FMT_MOD |
@@ -1067,7 +1068,6 @@ igt_main_args("", long_opts, help_str, opt_handler, &data)
 
 	igt_describe("Rotation test with 90 degree for a plane of gen9+ with given position");
 	igt_subtest_f("sprite-rotation-90-pos-100-0") {
-		igt_require(gen >=9 && gen < 13);
 		data.rotation = IGT_ROTATION_90;
 		data.pos_x = 100,
 		data.pos_y = 0;
@@ -1082,7 +1082,6 @@ igt_main_args("", long_opts, help_str, opt_handler, &data)
 		  * so apart from this, any other gen11+ pixel format
 		  * can be used which doesn't support 90/270 degree
 		  * rotation */
-		igt_require(gen >=9 && gen < 13);
 		data.rotation = IGT_ROTATION_90;
 		data.override_fmt = gen < 11 ? DRM_FORMAT_RGB565 : DRM_FORMAT_Y212;
 		test_plane_rotation(&data, DRM_PLANE_TYPE_PRIMARY, true);
@@ -1091,7 +1090,6 @@ igt_main_args("", long_opts, help_str, opt_handler, &data)
 
 	igt_describe("Checking unsupported tiling for gen9+ with 90 degree of rotation");
 	igt_subtest_f("bad-tiling") {
-		igt_require(gen >=9 && gen < 13);
 		data.rotation = IGT_ROTATION_90;
 		data.override_tiling = I915_FORMAT_MOD_X_TILED;
 		test_plane_rotation(&data, DRM_PLANE_TYPE_PRIMARY, true);
@@ -1103,12 +1101,7 @@ igt_main_args("", long_opts, help_str, opt_handler, &data)
 		igt_subtest_f("primary-%s-reflect-x-%s",
 			      tiling_test_str(reflect_x->tiling),
 			      rot_test_str(reflect_x->rot)) {
-			igt_require(gen >= 10 ||
-				    (IS_CHERRYVIEW(data.devid) && reflect_x->rot == IGT_ROTATION_0
-				     && reflect_x->tiling == I915_FORMAT_MOD_X_TILED));
 			data.rotation = (IGT_REFLECT_X | reflect_x->rot);
-			igt_require(!(gen >= 13 &&
-				      igt_rotation_90_or_270(data.rotation)));
 			data.override_tiling = reflect_x->tiling;
 			test_plane_rotation(&data, DRM_PLANE_TYPE_PRIMARY, false);
 		}
@@ -1116,7 +1109,6 @@ igt_main_args("", long_opts, help_str, opt_handler, &data)
 
 	igt_describe("Rotation test on both planes by making them fully visible");
 	igt_subtest_f("multiplane-rotation") {
-		igt_require(gen >= 9);
 		cleanup_crtc(&data);
 		data.planepos[0].origo = p_top | p_left;
 		data.planepos[0].x = .2f;
@@ -1130,7 +1122,6 @@ igt_main_args("", long_opts, help_str, opt_handler, &data)
 	igt_describe("Rotation test on both planes by cropping left/top corner of primary plane and"
 			"right/top corner of sprite plane");
 	igt_subtest_f("multiplane-rotation-cropping-top") {
-		igt_require(gen >= 9);
 		cleanup_crtc(&data);
 		data.planepos[0].origo = p_top | p_left;
 		data.planepos[0].x = -.05f;
@@ -1144,7 +1135,6 @@ igt_main_args("", long_opts, help_str, opt_handler, &data)
 	igt_describe("Rotation test on both planes by cropping left/bottom corner of primary plane"
 			"and right/bottom corner of sprite plane");
 	igt_subtest_f("multiplane-rotation-cropping-bottom") {
-		igt_require(gen >= 9);
 		cleanup_crtc(&data);
 		data.planepos[0].origo = p_bottom | p_left;
 		data.planepos[0].x = -.05f;
@@ -1164,7 +1154,6 @@ igt_main_args("", long_opts, help_str, opt_handler, &data)
 		enum pipe pipe;
 		igt_output_t *output;
 
-		igt_require(gen >= 9 && gen < 13);
 		igt_display_require_output(&data.display);
 
 		for_each_pipe_with_valid_output(&data.display, pipe, output) {
-- 
2.31.1

  parent reply	other threads:[~2021-09-02 16:48 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-02 16:44 [igt-dev] [PATCH i-g-t 00/11] kms: Clean up the supported rotations mess Ville Syrjala
2021-09-02 16:44 ` [igt-dev] [PATCH i-g-t 01/11] lib/kms: Add igt_plane_has_rotation() Ville Syrjala
2021-09-02 16:44 ` Ville Syrjala [this message]
2021-09-09 14:59   ` [igt-dev] [PATCH i-g-t v2 02/12] tests/kms_rotation_crc: Use igt_plane_has_rotation() Ville Syrjala
2021-09-02 16:45 ` [igt-dev] [PATCH i-g-t 03/11] tests/kms_plane_scaling: " Ville Syrjala
2021-09-02 16:45 ` [igt-dev] [PATCH i-g-t 04/11] tests/kms_big_fb: " Ville Syrjala
2021-09-02 16:45 ` [igt-dev] [PATCH i-g-t 05/11] tests/kms_big_fb: Use igt_has_drm_cap() Ville Syrjala
2021-09-02 16:45 ` [igt-dev] [PATCH i-g-t 06/11] tests/kms_big_fb: Move batch creation into lower level functions Ville Syrjala
2021-09-02 16:45 ` [igt-dev] [PATCH i-g-t 07/11] tests/kms_big_fb: Move format/modifier checks lower Ville Syrjala
2021-09-02 16:45 ` [igt-dev] [PATCH i-g-t 08/11] tests/kms_big_fb: Nuke the stride/format overrides Ville Syrjala
2021-09-02 16:45 ` [igt-dev] [PATCH i-g-t 09/11] tests/kms_big_fb: Check whether the rotation is supposed in the async flip test Ville Syrjala
2021-09-02 16:45 ` [igt-dev] [PATCH i-g-t 10/11] tests/kms_plane: Abstract single vs. multiple crsc better Ville Syrjala
2021-09-02 16:45 ` [igt-dev] [PATCH i-g-t 11/11] tests/kms_plane: Use single colors during extended test Ville Syrjala
2021-09-02 17:48 ` [igt-dev] ✓ Fi.CI.BAT: success for kms: Clean up the supported rotations mess Patchwork
2021-09-02 21:43 ` [igt-dev] ✗ Fi.CI.IGT: failure " 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=20210902164508.20104-3-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 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.