tests/pm_rc6_residency: Measure the sleep duration

The code is confused about the units of CODE_TIME. The comment
says 50 microsseconds, but the actual code makes it 50
milliseconds. Avoid the whole mess by measuring the sleep
duration ourselves. Since the time measurement is taken around
the whole operation it obviously includes a bit of extra, but
at least it's much less than the fixed 50 ms.

For instance on one VLV board I now get something like this:
- Residency in rc6 or deeper state: 3002 ms (ratio to expected duration: 0.98)
+ Residency in rc6 or deeper state: 3001 ms (sleep duration 3003 ms) (ratio to expected duration: 1.00)
so the reported ratio is now much closer to reality.

Reviewed-by: Imre Deak <imre.deak@intel.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
This commit is contained in:
Ville Syrjälä
2015-07-21 14:05:24 +03:00
parent 571942f0c4
commit 983dfe5b68
2 changed files with 26 additions and 10 deletions
+1
View File
@@ -85,6 +85,7 @@ gem_userptr_blits_LDADD = $(LDADD) -lpthread
gem_wait_LDADD = $(LDADD) -lrt
kms_flip_LDADD = $(LDADD) -lrt -lpthread
pm_rc6_residency_LDADD = $(LDADD) -lrt
prime_nv_test_CFLAGS = $(AM_CFLAGS) $(DRM_NOUVEAU_CFLAGS)
prime_nv_test_LDADD = $(LDADD) $(DRM_NOUVEAU_LIBS)