From 95de32aa7fbb1a2da547418b296f649ee4be1feb Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Tue, 5 Sep 2017 11:01:17 +0300 Subject: py: drop the fancy event handling Unfortunately the nice event handler added previously doesn't work: we may get multiple page-flip events, which would lead to unref'ing the passed python object multiple times, leading to memory corruption. I guess it's only possible to pass a plain int as user data to commit() and page_flip(). --- py/tests/sync.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'py/tests/sync.py') diff --git a/py/tests/sync.py b/py/tests/sync.py index 4616ee8..e394c8d 100755 --- a/py/tests/sync.py +++ b/py/tests/sync.py @@ -148,7 +148,7 @@ class FlipHandler(): fence = self.timeline.create_fence(2 * self.flips - 1) req = pykms.AtomicReq(self.crtc.card) req.add(self.crtc.primary_plane, { 'FB_ID': fb.id, 'IN_FENCE_FD': fence.fd }) - req.commit(self) + req.commit() del fence # Arm a timer to signal the fence in 0.5s. @@ -207,7 +207,7 @@ def main(argv): def readdrm(fileobj, mask): for ev in card.read_events(): if ev.type == pykms.DrmEventType.FLIP_COMPLETE: - ev.data.handle_page_flip(ev.seq, ev.time) + flip_handler.handle_page_flip(ev.seq, ev.time) def readkey(fileobj, mask): sys.stdin.readline() -- cgit v1.2.3