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/db.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'py/tests/db.py') diff --git a/py/tests/db.py b/py/tests/db.py index 660364d..f7b13eb 100755 --- a/py/tests/db.py +++ b/py/tests/db.py @@ -52,9 +52,9 @@ class FlipHandler(): if card.has_atomic: ctx = pykms.AtomicReq(card) ctx.add(crtc.primary_plane, "FB_ID", fb.id) - ctx.commit(self) + ctx.commit() else: - crtc.page_flip(fb, self) + crtc.page_flip(fb) if len(sys.argv) > 1: conn_name = sys.argv[1] @@ -77,7 +77,7 @@ def readdrm(fileobj, mask): #print("EVENT"); for ev in card.read_events(): if ev.type == pykms.DrmEventType.FLIP_COMPLETE: - ev.data.handle_page_flip(ev.seq, ev.time) + fliphandler.handle_page_flip(ev.seq, ev.time) def readkey(fileobj, mask): -- cgit v1.2.3