Repository navigation
Conversation
…counts it On a DIRECT panel the last area of a frame now always ends in one present: show() when flush_rect could not sync the area, otherwise the panel's frame_done() (displaydev's frame-rate hook, a no-op unless measure_fps is on). presents counts both, so it is a frame count on every direct panel; before, a panel whose flush_rect synced (the P4's DSI panel) never counted one.
This was referenced Oct 7, 2026
Contributor
Author
|
Closing in favour of the move: display_driver now lives in PyDevices/pydevices lib/, and the file that lands there is this PR's version, frame hook and all (PyDevices/pydevices#129). The tests here moved with it, to pydevices' tests/test_lvgl_display_driver.py. Removal from this repo is #25. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On a direct-framebuffer panel,
display_drivernow reports each frame once, whichever way the frame was presented.presentscounts it either way._flush_cb_directhands every dirty area to the panel'sflush_rect. On a frame's last area it used to callshow()and count a present only whenflush_rectcould not sync the area. A panel whoseflush_rectdoes sync, like the P4's DSI panel through mipidsi'srefresh_rect, never counted a present, sopresentsstayed at 0 there. Now the last area ends inshow()whenflush_rectdidn't sync, or in the panel'sframe_done()when it did, andpresents += 1in both cases.frame_done()is the hook added to displaydev'sDisplayDriverfor its new frame-rate meter (PyDevices/pydevices#129). It does nothing unlessmeasure_fpsis on. A displaydev without it is fine too: the call is skipped bygetattr.I made the change here and not only in lvgl-micropython's vendored copy, which is where the brief put it. This is the canonical copy, so a sync would have overwritten an edit made only there, and lvgl-python, which gives CPython its
display_driverand runs CastDisplay, would never have got it. The lvgl-micropython PR carries the identical file.Measured (desktop, real LVGL, FBDisplay in DIRECT mode, two labels redrawn every 40 ms)
refresh_rect(P4's branch)refresh_rectWith the old
display_driver, therefresh_rectpanel reads frames 0 and presents 0 against 249 flushes.tests/test_display_driver_direct_frames.pyruns the real_flush_cb_directagainst stand-in panels. Against the old code it fails the synced and no-frame_donecases.After this merges, lvgl-micropython and lvgl-python need their usual sync.