diff options
author | Paulo Zanoni <paulo.r.zanoni@intel.com> | 2015-06-02 12:03:45 -0300 |
---|---|---|
committer | Paulo Zanoni <paulo.r.zanoni@intel.com> | 2015-06-11 10:42:47 -0300 |
commit | 75b286e821bd5cf056c5a786f347943360486143 (patch) | |
tree | d5268740334b46dd0d212eb6a4d97a397a0b6ed3 /tests/kms_psr_sink_crc.c | |
parent | a4dbdeffc2995a0b84efb3bdfc9e460b731d7af5 (diff) |
tests/kms_psr_sink_crc: test even if PSR is disabled by default
Use the igt_set_module_param_int() call to enable it, then restore the
previous value after we are done testing.
With this, we can change the psr_enabled() function to psr_possible():
the only requirement should be that we have a PSR capable sink. The
test should now be able to make "Source_OK" and "Enabled" become true
whenever it wants.
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Diffstat (limited to 'tests/kms_psr_sink_crc.c')
-rw-r--r-- | tests/kms_psr_sink_crc.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/tests/kms_psr_sink_crc.c b/tests/kms_psr_sink_crc.c index 099391b4..1823a684 100644 --- a/tests/kms_psr_sink_crc.c +++ b/tests/kms_psr_sink_crc.c @@ -203,7 +203,7 @@ static void fill_render(data_t *data, uint32_t handle, unsigned char color) gem_bo_busy(data->drm_fd, handle); } -static bool psr_enabled(data_t *data) +static bool psr_possible(data_t *data) { FILE *file; char buf[4096]; @@ -229,14 +229,6 @@ static bool psr_enabled(data_t *data) igt_require_f(ret == 1 && strcmp(buf, "yes") == 0, "Sink_Support: %s\n", buf); - ret = fscanf(file, "Source_OK: %s\n", buf); - igt_require_f(ret == 1 && strcmp(buf, "yes") == 0, - "Source_OK: %s\n", buf); - - ret = fscanf(file, "Enabled: %s\n", buf); - igt_require_f(ret == 1 && strcmp(buf, "yes") == 0, - "Enabled: %s\n", buf); - fclose(file); return true; } @@ -570,7 +562,9 @@ int main(int argc, char *argv[]) kmstest_set_vt_graphics_mode(); data.devid = intel_get_drm_devid(data.drm_fd); - igt_skip_on(!psr_enabled(&data)); + igt_set_module_param_int("enable_psr", 1); + + igt_skip_on(!psr_possible(&data)); data.bufmgr = drm_intel_bufmgr_gem_init(data.drm_fd, 4096); igt_assert(data.bufmgr); |