From: Karthik B S <karthik.b.s@intel.com>
To: igt-dev@lists.freedesktop.org
Cc: lucas.demarchi@intel.com
Subject: [igt-dev] [PATCH i-g-t v2 2/2] tests/kms_plane_multiple: Set highest mode for PCU messaging test.
Date: Mon, 5 Aug 2019 12:24:54 +0530 [thread overview]
Message-ID: <20190805065454.32591-3-karthik.b.s@intel.com> (raw)
In-Reply-To: <20190805065454.32591-1-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.
v2: Rebase.
Signed-off-by: Karthik B S <karthik.b.s@intel.com>
Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
Reviewed-by: Mika Kahola <mika.kahola@intel.com>
---
tests/kms_plane_multiple.c | 51 ++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 51 insertions(+)
diff --git a/tests/kms_plane_multiple.c b/tests/kms_plane_multiple.c
index bed337c..fcf66ac 100644
--- a/tests/kms_plane_multiple.c
+++ b/tests/kms_plane_multiple.c
@@ -355,6 +355,48 @@ prepare_planes2(data_t *data, enum pipe pipe_id, color_t *color,
}
}
+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;
+}
+
/*
* Multiple plane position test.
* - We start by grabbing a reference CRC of a full blue fb being scanned
@@ -371,6 +413,7 @@ 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;
@@ -412,6 +455,11 @@ test_plane_position_with_output(data_t *data, enum pipe pipe,
info, opt.seed);
if (data->flag == TEST_BANDWIDTH) {
+ 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 +477,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,
--
2.7.4
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
next prev parent reply other threads:[~2019-08-05 7:10 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-05 6:54 [igt-dev] [PATCH i-g-t v2 0/2] PCU messaging test Karthik B S
2019-08-05 6:54 ` [igt-dev] [PATCH i-g-t v2 1/2] tests/kms_plane_multiple: " Karthik B S
2019-09-25 13:55 ` Ville Syrjälä
2019-09-27 2:55 ` B S, Karthik
2019-08-05 6:54 ` Karthik B S [this message]
2019-08-05 8:57 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2019-08-05 11:07 ` [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=20190805065454.32591-3-karthik.b.s@intel.com \
--to=karthik.b.s@intel.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=lucas.demarchi@intel.com \
/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