summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: d66d3d3)
raw | patch | inline | side by side (parent: d66d3d3)
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | |
Mon, 2 Jan 2017 14:42:11 +0000 (16:42 +0200) | ||
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | |
Tue, 3 Jan 2017 08:46:42 +0000 (10:46 +0200) |
Print both the number of vsyncs (as reported by the driver in flip
events) and the number of flip events. This is useful to debug frame
rate related issues.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
events) and the number of flip events. This is useful to debug frame
rate related issues.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
py/tests/db.py | patch | blob | history |
diff --git a/py/tests/db.py b/py/tests/db.py
index 20f42360b992932ada039b60c26a369447846fe4..f0a962d72216ebb61960766ea4e1a0dbc2160ddc 100755 (executable)
--- a/py/tests/db.py
+++ b/py/tests/db.py
self.front_buf = 0
self.fb1 = pykms.DumbFramebuffer(card, mode.hdisplay, mode.vdisplay, "XR24");
self.fb2 = pykms.DumbFramebuffer(card, mode.hdisplay, mode.vdisplay, "XR24");
+ self.flips = 0
+ self.frames = 0
+ self.time = 0
def handle_page_flip(self, frame, time):
+ self.flips += 1
+ if self.time == 0:
+ self.frames = frame
+ self.time = time
+
+ time_delta = time - self.time
+ if time_delta >= 5:
+ frame_delta = frame - self.frames
+ print("Frame rate: %f (%u/%u frames in %f s)" %
+ (frame_delta / time_delta, self.flips, frame_delta, time_delta))
+
+ self.flips = 0
+ self.frames = frame
+ self.time = time
+
if self.front_buf == 0:
fb = self.fb2
else: