tests/kms_psr_sink_crc: Create test to test PSR by checking panel CRC.
PATCH 1/2 tests/kms_psr_sink_crc: Create test to test PSR by checking panel CRC.
v2: Wait psr enable with timeout and more subtest added.
v3: Add wait for v_blank leeting test more reliable and preparing to
add Baytrail per-pipe tests.
v4: Call busy_ioctl on mmap_gtt to match the real usage and remove the need
of inactivate on set_domain, what was semantically wrong.
v5: Adding more test cases to cover mmap_gtt with and without followed by
busy ioctl and also without busy and waiting 10 seconds between set_domain and actual write.
--- tests/Android.mk | 1 + tests/Makefile.sources | 1 + tests/kms_psr_sink_crc.c | 535 +++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 537 insertions(+) create mode 100644 tests/kms_psr_sink_crc.c
tests/Android.mk +1 -0
@@ -95,6 +95,7 @@ skip_tests_list := \ kms_cursor_crc \ kms_flip \ kms_pipe_crc_basic \ + kms_psr_sink_crc \ kms_fbc_crc \ kms_render \ kms_setmode \
tests/Makefile.sources +1 -0
@@ -58,6 +58,7 @@ TESTS_progs_M = \ kms_fbc_crc \ kms_flip \ kms_pipe_crc_basic \ + kms_psr_sink_crc \ kms_render \ kms_setmode \ kms_sink_crc_basic \
tests/kms_psr_sink_crc.c new file +535 -0
535 lines not on this page · raw message
Signature · 1 line
1.8.1.2
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 2/2 test/pm_psr: Add Baytrail simple pm_psr test.
Different from core PSR implementation (i.e. Haswell and Broadwell) Baytrail PSR can be enabled even when source is ok because it provides way to inactivate PSR whenever any screen updated is done. Baytrail also doesn't provide any kind of Performance Counters.
--- tests/pm_psr.c | 114 ++++++++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 97 insertions(+), 17 deletions(-)
tests/pm_psr.c +97 -17
@@ -30,21 +30,23 @@#include <string.h> #include <unistd.h> #include "drmtest.h" +#include "igt_debugfs.h" -#define SLEEP_DURATION 5000 // in milliseconds +typedef struct { +int drm_fd; +igt_debugfs_t debugfs; +int devid; +}data_t ; -static int get_perf (const char *path) +static int get_perf (data_t *data) {int ret, perf;bool sink, source, enabled;FILE *file;char str[4 ]; - file =fopen (path,"r" ); -if (file ==NULL ) { -fprintf (stderr,"Couldn't open %s (%d)\n" , path, errno); -abort (); - } + file =igt_debugfs_fopen (&data->debugfs,"i915_edp_psr_status" ,"r" ); +igt_require (file); ret =fscanf (file,"Sink_Support: %s\n" , str);if (ret ==0 )
@@ -78,23 +80,101 @@ static int get_perf(const char *path)return perf; } -igt_simple_main +static bool psr_supported (data_t *data) { -int ret, perf1, perf2; -int device =drm_get_card (); -char *path; +int ret; +FILE *file; +char str[4 ]; +bool sink, source; -igt_skip_on_simulation (); + file =igt_debugfs_fopen (&data->debugfs,"i915_edp_psr_status" ,"r" ); +igt_require (file); + + ret =fscanf (file,"Sink_Support: %s\n" , str); +if (ret ==0 ) +igt_skip ("i915_edp_psr_status format not supported by this test case\n" ); + sink =strcmp (str,"yes" ) ==0 ; + + ret =fscanf (file,"Source_OK: %s\n" , str); +igt_assert (ret !=0 ); + source =strcmp (str,"yes" ) ==0 ; + +fclose (file); +return sink && source; +} + +static bool psr_enabled (data_t *data) +{ +int ret; +FILE *file; +char str[4 ]; + + file =igt_debugfs_fopen (&data->debugfs,"i915_edp_psr_status" ,"r" ); +igt_require (file); + + ret =fscanf (file,"Sink_Support: %s\n" , str); +igt_assert (ret !=0 ); + + ret =fscanf (file,"Source_OK: %s\n" , str); +igt_assert (ret !=0 ); + + ret =fscanf (file,"Enabled: %s\n" , str); +igt_assert (ret !=0 ); + +fclose (file); +return strcmp (str,"yes" ) ==0 ; +} + +static bool wait_psr_entry (data_t *data,int timeout) +{ +while (timeout--) { +if (psr_enabled (data)) +return true; +sleep (1 ); + } +return false; +} + +/* Baytrail doesn't provide a performance counter for PSR */ +/* PSR on Baytrail can be disabled/inactive even when source is ok. */ +static void vlv_test (data_t *data) +{ +if (!psr_supported (data)) +igt_skip ("This platform or current configuration don't support PSR.\n" ); - ret =asprintf (&path,"/sys/kernel/debug/dri/%d/i915_edp_psr_status" , device); -igt_assert (ret !=-1 ); +if (!wait_psr_entry (data,10 )) { +fprintf (stderr," Unable to enter PSR state.\n It can either be disabled by kernel parameter or it simply failed.\n Make sure there is no screen update happening on eDP, not even a small blinking cursor.\n" ); +igt_fail (1 ); + } +} - perf1 =get_perf (path); -sleep (SLEEP_DURATION /1000 ); - perf2 =get_perf (path); +/* Haswell and Broadwell */ +static void core_test (data_t *data) +{ +int perf1, perf2; + + perf1 =get_perf (data); +sleep (5 ); + perf2 =get_perf (data);if (perf1 == perf2) {fprintf (stderr,"Unable to enter PSR state again\n" );igt_fail (1 ); } } + +igt_simple_main +{ +data_t data = {}; + +igt_skip_on_simulation (); + + data.drm_fd =drm_open_any (); + data.devid =intel_get_drm_devid (data.drm_fd); +igt_debugfs_init (&data.debugfs); + +if (IS_HASWELL (data.devid) ||IS_BROADWELL (data.devid)) +core_test (&data); +else if (IS_VALLEYVIEW (data.devid)) +vlv_test (&data); +}
Signature · 1 line
1.8.1.2