public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Lucas De Marchi <lucas.demarchi@intel.com>
To: igt-dev@lists.freedesktop.org
Subject: [igt-dev] [PATCH 10/10] tests/kms_plane_multiple/tgl: Set highest mode for PCU messaging test
Date: Mon, 15 Jul 2019 14:51:36 -0700	[thread overview]
Message-ID: <20190715215136.21744-11-lucas.demarchi@intel.com> (raw)
In-Reply-To: <20190715215136.21744-1-lucas.demarchi@intel.com>

From: Karthik B S <karthik.b.s@intel.com>

Set the highest mode allows for the stress test for PCU messaging, as
the BW requirement is the highest in this case.

Cc: Mika Kahola <mika.kahola@intel.com>
Signed-off-by: Karthik B S <karthik.b.s@intel.com>
Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
---
 tests/kms_plane_multiple.c | 68 ++++++++++++++++++++++++++++++++------
 1 file changed, 58 insertions(+), 10 deletions(-)

diff --git a/tests/kms_plane_multiple.c b/tests/kms_plane_multiple.c
index 2c726fda..1bf44005 100644
--- a/tests/kms_plane_multiple.c
+++ b/tests/kms_plane_multiple.c
@@ -285,16 +285,45 @@ prepare_planes(data_t *data, enum pipe pipe_id, color_t *color,
 	free((void*)suffle);
 }
 
-/*
- * Multiple plane position test.
- *   - We start by grabbing a reference CRC of a full blue fb being scanned
- *     out on the primary plane
- *   - Then we scannout number of planes:
- *      * the primary plane uses a blue fb with a black rectangle holes
- *      * planes, on top of the primary plane, with a blue fb that is set-up
- *        to cover the black rectangles of the primary plane
- *     The resulting CRC should be identical to the reference CRC
- */
+static drmModeModeInfo
+get_highest_mode(int drmfd, int connector_id)
+{
+	drmModeRes *mode_resources = drmModeGetResources(drmfd);
+	drmModeModeInfo highestmode;
+	drmModeConnector *connector;
+	int i;
+	bool highestmodefound = false;
+
+	igt_require(mode_resources);
+
+	for (i = 0; i < mode_resources->count_connectors; i++) {
+		connector = drmModeGetConnectorCurrent(drmfd,
+						mode_resources->connectors[i]);
+		if (!connector) {
+			igt_warn("could not get connector %i: %s\n",
+				mode_resources->connectors[i], strerror(errno));
+			continue;
+		}
+
+		if (connector->connector_id != connector_id)
+			continue;
+
+		if (!connector->count_modes)
+			continue;
+
+		/* First mode has the highest pixel rate */
+		highestmodefound = true;
+		highestmode = connector->modes[0];
+		break;
+	}
+
+	if (connector)
+		drmModeFreeConnector(connector);
+	drmModeFreeResources(mode_resources);
+
+	igt_require(highestmodefound);
+	return highestmode;
+}
 
 static void
 prepare_planes2(data_t *data, enum pipe pipe_id, color_t *color,
@@ -366,11 +395,22 @@ prepare_planes2(data_t *data, enum pipe pipe_id, color_t *color,
 	}
 }
 
+/*
+ * Multiple plane position test.
+ *   - We start by grabbing a reference CRC of a full blue fb being scanned
+ *     out on the primary plane
+ *   - Then we scannout number of planes:
+ *      * the primary plane uses a blue fb with a black rectangle holes
+ *      * planes, on top of the primary plane, with a blue fb that is set-up
+ *        to cover the black rectangles of the primary plane
+ *     The resulting CRC should be identical to the reference CRC
+ */
 static void
 test_plane_position_with_output(data_t *data, enum pipe pipe,
 				igt_output_t *output, int n_planes,
 				uint64_t tiling)
 {
+	drmModeModeInfo mode_highres;
 	color_t blue  = { 0.0f, 0.0f, 1.0f };
 	igt_crc_t crc;
 	igt_plane_t *plane;
@@ -392,6 +432,11 @@ test_plane_position_with_output(data_t *data, enum pipe pipe,
 	test_init(data, pipe, n_planes);
 
 	if (data->flag == TEST_PCU_ALGO) {
+		mode_highres = get_highest_mode(data->drm_fd, output->id);
+
+		/* switch to highest resolution */
+		igt_output_override_mode(output, &mode_highres);
+
 		for (i = BW_PRIMARY_LOW; i < BW_INVALID; i++) {
 			if (i == BW_PRIMARY_LOW || i == BW_PRIMARY_LOW2)
 				get_reference_crc(data, output, pipe, &blue,
@@ -429,6 +474,9 @@ test_plane_position_with_output(data_t *data, enum pipe pipe,
 
 			igt_assert_crc_equal(&data->ref_crc, &crc);
 		}
+
+		/* switch back to default mode */
+		igt_output_override_mode(output, NULL);
 	} else {
 		i = 0;
 		get_reference_crc(data, output, pipe, &blue, tiling, FULL_SCREEN);
-- 
2.21.0

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

  parent reply	other threads:[~2019-07-15 21:51 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-15 21:51 [igt-dev] [PATCH 00/10] Add support for Tiger Lake Lucas De Marchi
2019-07-15 21:51 ` [igt-dev] [PATCH 01/10] lib: sync i915_pciids.h with kernel Lucas De Marchi
2019-07-19  6:20   ` Arkadiusz Hiler
2019-07-15 21:51 ` [igt-dev] [PATCH 02/10] lib/tgl: Add Tigerlake platform definition Lucas De Marchi
2019-07-19  6:21   ` Arkadiusz Hiler
2019-07-15 21:51 ` [igt-dev] [PATCH 03/10] gem_ctx_isolation.c/tgl - Gen12 enabling for context isolation test Lucas De Marchi
2019-07-15 21:51 ` [igt-dev] [PATCH 04/10] lib/tgl: Add TGL PCI IDs to match table Lucas De Marchi
2019-07-19  6:21   ` Arkadiusz Hiler
2019-07-15 21:51 ` [igt-dev] [PATCH 05/10] lib/instdone.c/tgl: Add Gen12 support Lucas De Marchi
2019-07-15 21:51 ` [igt-dev] [PATCH 06/10] lib/gpgpu_fill/tgl: Implement gpgpu_fillfunc for TGL Lucas De Marchi
2019-07-15 21:51 ` [igt-dev] [PATCH 07/10] lib/media_fill/tgl: Implement media_fillfunc " Lucas De Marchi
2019-07-15 21:51 ` [igt-dev] [PATCH 08/10] tests/fb/tgl: Yf tiling does not exist on gen-12 Lucas De Marchi
2019-07-19 12:27   ` Ville Syrjälä
2019-07-15 21:51 ` [igt-dev] [PATCH 09/10] tests/kms_plane_multiple/tgl: PCU messaging test Lucas De Marchi
2019-07-19 12:54   ` Ville Syrjälä
2019-07-22  8:37     ` B S, Karthik
2019-07-22 16:46       ` Lucas De Marchi
2019-07-23  2:44         ` B S, Karthik
2019-08-02 10:43   ` Kahola, Mika
2019-07-15 21:51 ` Lucas De Marchi [this message]
2019-08-02 10:44   ` [igt-dev] [PATCH 10/10] tests/kms_plane_multiple/tgl: Set highest mode for " Kahola, Mika
2019-07-15 22:42 ` [igt-dev] ✗ Fi.CI.BAT: failure for Add support for Tiger Lake 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=20190715215136.21744-11-lucas.demarchi@intel.com \
    --to=lucas.demarchi@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