[igt-dev] [PATCH i-g-t] tests/amdgpu/amd_psr: print DSC status
Hamza Mahfooz
hamza.mahfooz at amd.com
Mon Nov 28 21:53:25 UTC 2022
Since we now support DSC/PSR-SU interoperability, it useful to have this
information at our disposal when we are validating PSR-SU visual
confirm. So, print the current DSC status in test_init() if the relevant
connector has DSC support.
Signed-off-by: Hamza Mahfooz <hamza.mahfooz at amd.com>
---
lib/igt_amd.c | 2 +-
lib/igt_amd.h | 1 +
tests/amdgpu/amd_psr.c | 7 +++++++
3 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/lib/igt_amd.c b/lib/igt_amd.c
index bef9c193..2e028968 100644
--- a/lib/igt_amd.c
+++ b/lib/igt_amd.c
@@ -320,7 +320,7 @@ static bool igt_amd_output_has_debugfs(int drm_fd, char *connector_name, const c
* @drm_fd: DRM file descriptor
* @connector_name: The connector's name, on which we're reading the status
*/
-static bool igt_amd_output_has_dsc(int drm_fd, char *connector_name)
+bool igt_amd_output_has_dsc(int drm_fd, char *connector_name)
{
return igt_amd_output_has_debugfs(drm_fd, connector_name, DEBUGFS_DSC_CLOCK_EN);
}
diff --git a/lib/igt_amd.h b/lib/igt_amd.h
index 428bfe6f..c6d3bdd8 100644
--- a/lib/igt_amd.h
+++ b/lib/igt_amd.h
@@ -149,6 +149,7 @@ bool igt_amd_is_tiled(uint64_t modifier);
/* IGT DSC helper functions */
bool is_dp_dsc_supported(int drm_fd, char *connector_name);
bool is_dp_fec_supported(int drm_fd, char *connector_name);
+bool igt_amd_output_has_dsc(int drm_fd, char *connector_name);
void igt_amd_require_dsc(igt_display_t *display, int drm_fd);
int igt_amd_read_dsc_clock_status(int drm_fd, char *connector_name);
void igt_amd_write_dsc_clock_en(int drm_fd, char *connector_name, int dsc_force);
diff --git a/tests/amdgpu/amd_psr.c b/tests/amdgpu/amd_psr.c
index 966a0dcc..3c3113ab 100644
--- a/tests/amdgpu/amd_psr.c
+++ b/tests/amdgpu/amd_psr.c
@@ -165,6 +165,7 @@ static void update_color_strip(igt_fb_t *fb, pos_t *old, pos_t *new, double r, d
/* Common test setup. */
static void test_init(data_t *data)
{
+ bool dsc_on;
igt_display_t *display = &data->display;
/* It doesn't matter which pipe we choose on amdpgu. */
@@ -202,6 +203,12 @@ static void test_init(data_t *data)
data->pfb_w = data->w / 2;
data->pfb_h = data->h / 2;
+ if (igt_amd_output_has_dsc(data->fd, data->output->name)) {
+ dsc_on = igt_amd_read_dsc_clock_status(data->fd,
+ data->output->name);
+ igt_info("DSC status: %s\n", dsc_on ? "enabled" : "disabled");
+ }
+
if (opt.visual_confirm) {
/**
* if visual confirm option is enabled, we'd trigger a full modeset before test run
--
2.38.1
More information about the igt-dev
mailing list