Skip to content

Poll for the display driver at 100ms instead of 500ms - #1948

Open
robcodedev wants to merge 1 commit into
OnionUI:v4.5-devfrom
robcodedev:shorter-display-poll-interval
Open

robcodedev wants to merge 1 commit into
OnionUI:v4.5-devfrom
robcodedev:shorter-display-poll-interval

Conversation

@robcodedev

Copy link
Copy Markdown

Problem

get_screen_resolution polls /proc/mi_modules/fb/mi_fb0 every 500ms until the display driver publishes its timing. Once the driver is up, the coarse interval can add almost another half second before runtime notices.

Change

Poll every 100ms with the same 5 second ceiling - 10 × 500ms and 50 × 100ms are identical, so the timeout path and /tmp/get_screen_resolution_failed behave exactly as before. Detection now lands within 100ms of the driver coming up.

The per-attempt log line becomes a poll count on success. At this interval it would otherwise fire up to 50 times per boot, and log() spawns date and tee each time. The grep gains 2> /dev/null for the same reason - the file does not exist until the driver creates it, so every failed attempt wrote an error.

Independent of the framebuffer work in #1940, it touches only the polling loop.

Testing

  • repeated cold boots on Miyoo Flip, Miyoo Mini v4 and Miyoo Mini Plus
  • poll count from the runtime log across those boots

get_screen_resolution polls /proc/mi_modules/fb/mi_fb0 every 500ms
until the driver publishes its timing. Once it is up, the coarse
interval can add almost another half second before runtime notices.

Poll every 100ms with the same 5 second ceiling, so detection lands
within 100ms of the driver coming up.

Log the poll count on success rather than each failed attempt. At this
interval a per-attempt line would spawn date and tee up to 50 times
per boot. Silence the grep too, since the file does not exist until
the driver creates it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant