From a9462fd9bffc3057dce66002e65979440fdcdabf Mon Sep 17 00:00:00 2001 From: Brad Barnett <127794626+bdbarnett@users.noreply.github.com> Date: Wed, 7 Oct 2026 12:46:43 -0500 Subject: [PATCH] display_driver: a direct panel reports each frame once, and presents counts it The same change as lvgl-bindings' python/display_driver.py (its PR displaydev-fps), carried here so the frozen copy has it before the next sync; the sync after that PR merges brings an identical file and moves LVGL_BINDINGS_COMMIT. --- lib/display_driver.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/lib/display_driver.py b/lib/display_driver.py index 72f23c8..5a2db7e 100644 --- a/lib/display_driver.py +++ b/lib/display_driver.py @@ -1660,9 +1660,18 @@ def _flush_cb_direct(self, disp_drv, area, color_p): ) except Exception: synced = False - if last and not synced: + if last: + # The frame is out: by show() when flush_rect could not sync it, + # otherwise flush_rect already did and frame_done() says so (a + # no-op unless the panel's measure_fps is on). Either way it is + # one present, however many areas it took. try: - panel.show() + if synced: + frame_done = getattr(panel, "frame_done", None) + if frame_done is not None: + frame_done() + else: + panel.show() self.presents += 1 except Exception: pass