summaryrefslogtreecommitdiff
path: root/tests/kms_dp_dsc.c
diff options
context:
space:
mode:
authorDhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>2019-03-21 16:18:22 -0700
committerDhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>2019-03-25 11:10:39 -0700
commit9136a1f435c18a130cdea418ea22775d4fe7c784 (patch)
treebb5ff6fa0c6f00bb055dc0c4094ed74ecceccc33 /tests/kms_dp_dsc.c
parent3d325bb211d8cd84c6862c9945185a937395cb44 (diff)
tests/kms_dp_dsc: Disable DSC even if enabling failed
The test leaves the debugfs flag enabled if the driver failed to enable DSC. And as it turns out, the feature gets enabled only after the test completes and consequently affects PSR2 tests that follow. Let's make sure the test cleans up correctly, even though the DSC test itself needs to be fixed. Also included some formatting fixes within the function. Cc: José Roberto de Souza <jose.souza@intel.com> Signed-off-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com> Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Diffstat (limited to 'tests/kms_dp_dsc.c')
-rw-r--r--tests/kms_dp_dsc.c23
1 files changed, 16 insertions, 7 deletions
diff --git a/tests/kms_dp_dsc.c b/tests/kms_dp_dsc.c
index 9792be33..da93cd74 100644
--- a/tests/kms_dp_dsc.c
+++ b/tests/kms_dp_dsc.c
@@ -157,14 +157,16 @@ static void update_display(data_t *data, enum dsc_test_type test_type)
if (data->connector->connector_type == DRM_MODE_CONNECTOR_DisplayPort &&
data->pipe == PIPE_A) {
- igt_debug ("DSC not supported on Pipe A on external DP\n");
+ igt_debug("DSC not supported on Pipe A on external DP\n");
return;
}
if (test_type == test_basic_dsc_enable) {
- igt_debug ("DSC is supported on %s\n",
- data->conn_name);
+ bool enabled;
+
+ igt_debug("DSC is supported on %s\n", data->conn_name);
force_dp_dsc_enable(data);
+
igt_create_pattern_fb(data->drm_fd, data->mode->hdisplay,
data->mode->vdisplay,
DRM_FORMAT_XRGB8888,
@@ -174,13 +176,20 @@ static void update_display(data_t *data, enum dsc_test_type test_type)
DRM_PLANE_TYPE_PRIMARY);
igt_plane_set_fb(primary, &data->fb_test_pattern);
igt_display_commit(&data->display);
- /* Until we have CRC check support, manually check if RGB test pattern has no corruption */
- manual ("RGB test pattern without corruption");
- igt_assert_f(is_dp_dsc_enabled(data),
+
+ /*
+ * Until we have CRC check support, manually check if RGB test
+ * pattern has no corruption.
+ */
+ manual("RGB test pattern without corruption");
+
+ enabled = is_dp_dsc_enabled(data);
+ clear_dp_dsc_enable(data);
+
+ igt_assert_f(enabled,
"Default DSC enable failed on Connector: %s Pipe: %s",
data->conn_name,
kmstest_pipe_name(data->pipe));
- clear_dp_dsc_enable(data);
} else {
igt_assert(!"Unknown test type\n");
}