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>
This commit is contained in:
Paulo Zanoni 2015-06-02 12:03:45 -03:00
parent a4dbdeffc2
commit 75b286e821

View File

@ -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);