[PATCH i-g-t 2/2] tests/intel/kms_psr2_sf: extend tests for panel replay sf
Kunal Joshi
kunal1.joshi at intel.com
Sun Jan 21 12:57:44 UTC 2024
Signed-off-by: Kunal Joshi <kunal1.joshi at intel.com>
---
tests/intel/kms_psr2_sf.c | 119 ++++++++++++++++++++++----------------
1 file changed, 69 insertions(+), 50 deletions(-)
diff --git a/tests/intel/kms_psr2_sf.c b/tests/intel/kms_psr2_sf.c
index c826cd7c3..8f34f46b9 100644
--- a/tests/intel/kms_psr2_sf.c
+++ b/tests/intel/kms_psr2_sf.c
@@ -979,6 +979,21 @@ pipe_output_combo_valid(igt_display_t *display,
return ret;
}
+static const char *get_psr_mode_for_output(data_t *data, igt_output_t *output)
+{
+ const char *psr_mode = NULL;
+
+ if (psr_sink_support(data->drm_fd, data->debugfs_fd, PR_MODE_SEL_FETCH,
+ output))
+ psr_mode = "pr-";
+ else if (psr_sink_support(data->drm_fd, data->debugfs_fd, PSR_MODE_2,
+ output))
+ psr_mode = "psr2-";
+ else
+ igt_assert_f(false, "PR/PSR2 selective fetch not supported\n");
+ return psr_mode;
+}
+
igt_main
{
data_t data = {};
@@ -1001,11 +1016,6 @@ igt_main
data.debugfs_fd = igt_debugfs_dir(data.drm_fd);
kmstest_set_vt_graphics_mode();
- igt_require_f(psr_sink_support(data.drm_fd,
- data.debugfs_fd, PSR_MODE_2,
- NULL),
- "Sink does not support PSR2\n");
-
display_init(&data);
if ((intel_display_ver(intel_get_drm_devid(data.drm_fd)) >= 20) &&
@@ -1013,10 +1023,6 @@ igt_main
data.fbc_flag = true;
}
- /* Test if PSR2 can be enabled */
- igt_require_f(psr_enable(data.drm_fd,
- data.debugfs_fd, PSR_MODE_2_SEL_FETCH),
- "Error enabling PSR2\n");
data.damage_area_count = MAX_DAMAGE_AREAS;
data.primary_format = DRM_FORMAT_XRGB8888;
@@ -1055,7 +1061,7 @@ igt_main
/* Verify primary plane selective fetch */
igt_describe("Test that selective fetch works on primary plane");
igt_subtest_with_dynamic_f("%sprimary-%s-sf-dmg-area", append_fbc_subtest[y],
- op_str(data.op)) {
+ op_str(data.op)) {
for (i = 0; i < n_pipes; i++) {
if (!pipe_output_combo_valid(&data.display, pipes[i], outputs[i]))
continue;
@@ -1063,9 +1069,10 @@ igt_main
for (j = FEATURE_NONE; j < FEATURE_COUNT; j++) {
if (j != FEATURE_NONE && !(coexist_features[i] & j))
continue;
- igt_dynamic_f("pipe-%s-%s%s", kmstest_pipe_name(pipes[i]),
- igt_output_name(outputs[i]),
- coexist_feature_str(j)) {
+ igt_dynamic_f("%spipe-%s-%s%s", kmstest_pipe_name(pipes[i]),
+ get_psr_mode_for_output(&data, outputs[i]),
+ igt_output_name(outputs[i]),
+ coexist_feature_str(j)) {
data.pipe = pipes[i];
data.output = outputs[i];
data.test_plane_id = DRM_PLANE_TYPE_PRIMARY;
@@ -1096,10 +1103,11 @@ igt_main
for (j = FEATURE_NONE; j < FEATURE_COUNT; j++) {
if (j != FEATURE_NONE && !(coexist_features[i] & j))
continue;
- igt_dynamic_f("pipe-%s-%s%s",
- kmstest_pipe_name(pipes[i]),
- igt_output_name(outputs[i]),
- coexist_feature_str(j)) {
+ igt_dynamic_f("%spipe-%s-%s%s",
+ get_psr_mode_for_output(&data, outputs[i]),
+ kmstest_pipe_name(pipes[i]),
+ igt_output_name(outputs[i]),
+ coexist_feature_str(j)) {
data.pipe = pipes[i];
data.output = outputs[i];
data.test_plane_id = DRM_PLANE_TYPE_PRIMARY;
@@ -1128,9 +1136,10 @@ igt_main
for (j = FEATURE_NONE; j < FEATURE_COUNT; j++) {
if (j != FEATURE_NONE && !(coexist_features[i] & j))
continue;
- igt_dynamic_f("pipe-%s-%s%s", kmstest_pipe_name(pipes[i]),
- igt_output_name(outputs[i]),
- coexist_feature_str(j)) {
+ igt_dynamic_f("%spipe-%s-%s%s", kmstest_pipe_name(pipes[i]),
+ get_psr_mode_for_output(&data, outputs[i]),
+ igt_output_name(outputs[i]),
+ coexist_feature_str(j)) {
data.pipe = pipes[i];
data.output = outputs[i];
data.test_plane_id = DRM_PLANE_TYPE_OVERLAY;
@@ -1158,9 +1167,10 @@ igt_main
for (j = FEATURE_NONE; j < FEATURE_COUNT; j++) {
if (j != FEATURE_NONE && !(coexist_features[i] & j))
continue;
- igt_dynamic_f("pipe-%s-%s%s", kmstest_pipe_name(pipes[i]),
- igt_output_name(outputs[i]),
- coexist_feature_str(j)) {
+ igt_dynamic_f("%spipe-%s-%s%s", kmstest_pipe_name(pipes[i]),
+ get_psr_mode_for_output(&data, outputs[i]),
+ igt_output_name(outputs[i]),
+ coexist_feature_str(j)) {
data.pipe = pipes[i];
data.output = outputs[i];
data.test_plane_id = DRM_PLANE_TYPE_CURSOR;
@@ -1184,9 +1194,10 @@ igt_main
for (j = FEATURE_NONE; j < FEATURE_COUNT; j++) {
if (j != FEATURE_NONE && !(coexist_features[i] & j))
continue;
- igt_dynamic_f("pipe-%s-%s%s", kmstest_pipe_name(pipes[i]),
- igt_output_name(outputs[i]),
- coexist_feature_str(j)) {
+ igt_dynamic_f("%spipe-%s-%s%s", kmstest_pipe_name(pipes[i]),
+ get_psr_mode_for_output(&data, outputs[i]),
+ igt_output_name(outputs[i]),
+ coexist_feature_str(j)) {
data.pipe = pipes[i];
data.output = outputs[i];
data.test_plane_id = DRM_PLANE_TYPE_CURSOR;
@@ -1211,9 +1222,10 @@ igt_main
for (j = FEATURE_NONE; j < FEATURE_COUNT; j++) {
if (j != FEATURE_NONE && !(coexist_features[i] & j))
continue;
- igt_dynamic_f("pipe-%s-%s%s", kmstest_pipe_name(pipes[i]),
- igt_output_name(outputs[i]),
- coexist_feature_str(j)) {
+ igt_dynamic_f("%spipe-%s-%s%s", kmstest_pipe_name(pipes[i]),
+ get_psr_mode_for_output(&data, outputs[i]),
+ igt_output_name(outputs[i]),
+ coexist_feature_str(j)) {
data.pipe = pipes[i];
data.output = outputs[i];
data.test_plane_id = DRM_PLANE_TYPE_CURSOR;
@@ -1238,9 +1250,10 @@ igt_main
for (j = FEATURE_NONE; j < FEATURE_COUNT; j++) {
if (j != FEATURE_NONE && !(coexist_features[i] & j))
continue;
- igt_dynamic_f("pipe-%s-%s%s", kmstest_pipe_name(pipes[i]),
- igt_output_name(outputs[i]),
- coexist_feature_str(j)) {
+ igt_dynamic_f("%spipe-%s-%s%s", kmstest_pipe_name(pipes[i]),
+ get_psr_mode_for_output(&data, outputs[i]),
+ igt_output_name(outputs[i]),
+ coexist_feature_str(j)) {
data.pipe = pipes[i];
data.output = outputs[i];
data.test_plane_id = DRM_PLANE_TYPE_CURSOR;
@@ -1266,9 +1279,10 @@ igt_main
for (j = FEATURE_NONE; j < FEATURE_COUNT; j++) {
if (j != FEATURE_NONE && !(coexist_features[i] & j))
continue;
- igt_dynamic_f("pipe-%s-%s%s", kmstest_pipe_name(pipes[i]),
- igt_output_name(outputs[i]),
- coexist_feature_str(j)) {
+ igt_dynamic_f("%spipe-%s-%s%s", kmstest_pipe_name(pipes[i]),
+ get_psr_mode_for_output(&data, outputs[i]),
+ igt_output_name(outputs[i]),
+ coexist_feature_str(j)) {
data.pipe = pipes[i];
data.output = outputs[i];
data.test_plane_id = DRM_PLANE_TYPE_OVERLAY;
@@ -1295,9 +1309,10 @@ igt_main
for (j = FEATURE_NONE; j < FEATURE_COUNT; j++) {
if (j != FEATURE_NONE && !(coexist_features[i] & j))
continue;
- igt_dynamic_f("pipe-%s-%s%s", kmstest_pipe_name(pipes[i]),
- igt_output_name(outputs[i]),
- coexist_feature_str(j)) {
+ igt_dynamic_f("%spipe-%s-%s%s", kmstest_pipe_name(pipes[i]),
+ get_psr_mode_for_output(&data, outputs[i]),
+ igt_output_name(outputs[i]),
+ coexist_feature_str(j)) {
data.pipe = pipes[i];
data.output = outputs[i];
data.test_plane_id = DRM_PLANE_TYPE_OVERLAY;
@@ -1322,9 +1337,10 @@ igt_main
for (j = FEATURE_NONE; j < FEATURE_COUNT; j++) {
if (j != FEATURE_NONE && !(coexist_features[i] & j))
continue;
- igt_dynamic_f("pipe-%s-%s%s", kmstest_pipe_name(pipes[i]),
- igt_output_name(outputs[i]),
- coexist_feature_str(j)) {
+ igt_dynamic_f("%spipe-%s-%s%s", kmstest_pipe_name(pipes[i]),
+ get_psr_mode_for_output(&data, outputs[i]),
+ igt_output_name(outputs[i]),
+ coexist_feature_str(j)) {
data.pipe = pipes[i];
data.output = outputs[i];
data.test_plane_id = DRM_PLANE_TYPE_OVERLAY;
@@ -1349,9 +1365,10 @@ igt_main
for (j = FEATURE_NONE; j < FEATURE_COUNT; j++) {
if (j != FEATURE_NONE && !(coexist_features[i] & j))
continue;
- igt_dynamic_f("pipe-%s-%s%s", kmstest_pipe_name(pipes[i]),
- igt_output_name(outputs[i]),
- coexist_feature_str(j)) {
+ igt_dynamic_f("%spipe-%s-%s%s", kmstest_pipe_name(pipes[i]),
+ get_psr_mode_for_output(&data, outputs[i]),
+ igt_output_name(outputs[i]),
+ coexist_feature_str(j)) {
data.pipe = pipes[i];
data.output = outputs[i];
data.test_plane_id = DRM_PLANE_TYPE_OVERLAY;
@@ -1377,9 +1394,10 @@ igt_main
for (j = FEATURE_NONE; j < FEATURE_COUNT; j++) {
if (j != FEATURE_NONE && !(coexist_features[i] & j))
continue;
- igt_dynamic_f("pipe-%s-%s%s", kmstest_pipe_name(pipes[i]),
- igt_output_name(outputs[i]),
- coexist_feature_str(j)) {
+ igt_dynamic_f("%spipe-%s-%s%s", kmstest_pipe_name(pipes[i]),
+ get_psr_mode_for_output(&data, outputs[i]),
+ igt_output_name(outputs[i]),
+ coexist_feature_str(j)) {
data.pipe = pipes[i];
data.output = outputs[i];
for (k = 1; k <= MAX_DAMAGE_AREAS; k++) {
@@ -1410,9 +1428,10 @@ igt_main
for (j = FEATURE_NONE; j < FEATURE_COUNT; j++) {
if (j != FEATURE_NONE && !(coexist_features[i] & j))
continue;
- igt_dynamic_f("pipe-%s-%s%s", kmstest_pipe_name(pipes[i]),
- igt_output_name(outputs[i]),
- coexist_feature_str(j)) {
+ igt_dynamic_f("%spipe-%s-%s%s", kmstest_pipe_name(pipes[i]),
+ get_psr_mode_for_output(&data, outputs[i]),
+ igt_output_name(outputs[i]),
+ coexist_feature_str(j)) {
data.pipe = pipes[i];
data.output = outputs[i];
data.damage_area_count = 1;
--
2.25.1
More information about the igt-dev
mailing list