From: Alex Hung <alex.hung@amd.com>
To: <igt-dev@lists.freedesktop.org>
Cc: <rodrigo.siqueira@amd.com>, <harry.wentland@amd.com>,
<hersenxs.wu@amd.com>, Alex Hung <alex.hung@amd.com>,
Hersen Wu <Hersenxs.Wu@amd.com>
Subject: [PATCH 3/3][V2] tests/amdgpu/amd_dp_dsc: Check connector's dsc capability
Date: Wed, 27 Mar 2024 10:27:37 -0600 [thread overview]
Message-ID: <20240327162737.1082932-3-alex.hung@amd.com> (raw)
In-Reply-To: <20240327162737.1082932-1-alex.hung@amd.com>
test_init() only sets data->mode when an output is DSC capable. As a
result, it is necessary to check it before running each subtest.
Reviewed-by: Hersen Wu <Hersenxs.Wu@amd.com>
Signed-off-by: Alex Hung <alex.hung@amd.com>
---
V2: Limit lines to 100
tests/amdgpu/amd_dp_dsc.c | 26 +++++++++++++++++++-------
1 file changed, 19 insertions(+), 7 deletions(-)
diff --git a/tests/amdgpu/amd_dp_dsc.c b/tests/amdgpu/amd_dp_dsc.c
index 900182443..13c4452da 100644
--- a/tests/amdgpu/amd_dp_dsc.c
+++ b/tests/amdgpu/amd_dp_dsc.c
@@ -99,6 +99,15 @@ static void test_init(data_t *data)
igt_display_reset(display);
}
+static bool is_dsc_capable(drmModeModeInfo *mode)
+{
+ /* mode is not set in test_init() if it is dsc capable */
+ if (mode->hdisplay == 0 || mode->vdisplay == 0)
+ return false;
+
+ return true;
+}
+
static void test_dsc_enable(data_t *data)
{
bool dsc_on, dsc_after, dsc_before;
@@ -113,7 +122,7 @@ static void test_dsc_enable(data_t *data)
for_each_pipe(&data->display, i) {
/* Setup the output */
output = data->output[i];
- if (!output || !igt_output_is_connected(output))
+ if (!output || !igt_output_is_connected(output) || !is_dsc_capable(&data->mode[i]))
continue;
igt_create_pattern_fb(data->fd,
@@ -259,7 +268,7 @@ static void test_dsc_slice_dimensions_change(data_t *data)
for_each_pipe(&data->display, i) {
/* Setup the output */
output = data->output[i];
- if (!output || !igt_output_is_connected(output))
+ if (!output || !igt_output_is_connected(output) || !is_dsc_capable(&data->mode[i]))
continue;
igt_create_pattern_fb(data->fd,
@@ -349,7 +358,7 @@ static void test_dsc_link_settings(data_t *data)
/* Setup all outputs */
for_each_pipe(&data->display, i) {
output = data->output[i];
- if (!output || !igt_output_is_connected(output))
+ if (!output || !igt_output_is_connected(output) || !is_dsc_capable(&data->mode[i]))
continue;
igt_create_pattern_fb(data->fd,
@@ -366,7 +375,7 @@ static void test_dsc_link_settings(data_t *data)
/* Collect reference CRCs */
for_each_pipe(&data->display, i) {
output = data->output[i];
- if (!output || !igt_output_is_connected(output))
+ if (!output || !igt_output_is_connected(output) || !is_dsc_capable(&data->mode[i]))
continue;
igt_pipe_crc_collect_crc(data->pipe_crc[i], &ref_crc[i]);
@@ -377,7 +386,8 @@ static void test_dsc_link_settings(data_t *data)
/* Write new link_settings */
for_each_pipe(&data->display, i) {
output = data->output[i];
- if (!output || !igt_output_is_connected(output))
+ if (!output || !igt_output_is_connected(output) ||
+ !is_dsc_capable(&data->mode[i]))
continue;
/* Write lower link settings */
@@ -395,7 +405,8 @@ static void test_dsc_link_settings(data_t *data)
for_each_pipe(&data->display, i) {
output = data->output[i];
- if (!output || !igt_output_is_connected(output))
+ if (!output || !igt_output_is_connected(output) ||
+ !is_dsc_capable(&data->mode[i]))
continue;
/* Verify lower link settings */
@@ -425,8 +436,9 @@ static void test_dsc_link_settings(data_t *data)
/* Cleanup all fbs */
for_each_pipe(&data->display, i) {
output = data->output[i];
- if (!output || !igt_output_is_connected(output))
+ if (!output || !igt_output_is_connected(output) || !is_dsc_capable(&data->mode[i]))
continue;
+
igt_remove_fb(data->fd, &ref_fb[i]);
}
--
2.34.1
next prev parent reply other threads:[~2024-03-27 16:28 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-27 16:27 [PATCH 1/3][V2] tests/amdgpu/amd_dp_dsc: Correct code style problems Alex Hung
2024-03-27 16:27 ` [PATCH 2/3][V2] lib/amd: Return false if dp_fec or dp_dsc is not supported Alex Hung
2024-03-27 16:27 ` Alex Hung [this message]
2024-03-27 20:30 ` ✓ CI.xeBAT: success for series starting with [1/3,V2] tests/amdgpu/amd_dp_dsc: Correct code style problems 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=20240327162737.1082932-3-alex.hung@amd.com \
--to=alex.hung@amd.com \
--cc=harry.wentland@amd.com \
--cc=hersenxs.wu@amd.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=rodrigo.siqueira@amd.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