NuttX RTOS for PinePhone: Framebuffer
lupyuen.github.io
lupyuen.github.io
// Copy the Entire Framebuffer to itself,
// to fix the missing pixels.
// Not sure why this works.
That has big lack of proper cache flushing energy. ARM-A device support tends to be where you need to get really intentional about managing your memory hierarchy. Smaller cores tend to have simple enough (or no) caches that they don't tend to get in your way much except for knife edge bugs. Bigger systems like x86 just tend to push the cache coherency out even to IO devices. ARM-A class SoCs are that sweet spot of a ton of caches between the CPU and main memory, but simple enough peripherals and fabric that only the CPU cores are coherent.Or to say it differently: 1440x720x32bpp is about 4MiB of memory which needs to be read and then written again, per frame. With 60FPS that is 8MiB*60FPS = 480MiB/s of data you shovel around for no reason. Add that loop overhead from this 1/4th of a pixel per loop routine and your awesome fast modern chip is being kept busy with garbage, eating your battery while doing so.
Now you want to avoid updating the whole screen all the time, but there is obviously a more fundamental issue and this should be fixed properly instead of keeping the CPU busy with nonsense. Also keep in mind that this also may lock or delay other data transfers in the system, depending on the system + bus arbitration settings etc.
The internet tells me the phone has a A53 which should be ARMv8, so probably a loop of DC CIVAC (Data Cache Clean and Invalidate by Virtual Address to Coherency) instructions over the framebuffer. Though the buffer might be large enough to not even fit in the cache, so it might be more efficient to just flush the entire cache.
AIUI they're planning to provide user-installable images by next release (2023-02).
It was gonna be 2022-11, but they chose to delay so that end users only see it polished. It is possible to try it by building it yourself, and it's pretty cool.
0. (grep for Pine) https://genodians.org/
NuttX and Zephyr both support a large number of SoCs and boards [3][4], and they each have a single git repo with a configuration system that lets you build different boards from that single repo. In terms of practical ease of use for hobby and commercial projects, I would say these projects are both far ahead of Genode if your hardware is not supported by Genode and is supported by either NuttX or Zephyr.
[1] https://genode.org/documentation/platforms/index
[2] https://github.com/orgs/genodelabs/repositories
[3] NuttX supported platforms: https://nuttx.apache.org/docs/latest/platforms/index.html
[4] Zephyr supported platforms: https://docs.zephyrproject.org/3.2.0/boards/index.html
I completely agree, yet in this case what is meant is pretty clear: Pinephone support.
And Genode is far ahead in Pinephone support.
I used his guides when developing for the PineTime and everything worked perfectly. I would have been completely lost without his information.
Thank you Lup!
How did it come about? Was it developed from scratch or released from an existing project?
It's also growing in popularity now– I would say it hasn't reached mainstream popularity yet. :)
[1] NuttX supported platforms: https://nuttx.apache.org/docs/latest/platforms/index.html
[2] Zephyr supported platforms: https://docs.zephyrproject.org/3.2.0/boards/index.html