DOOM renders at 320x200, but our panel is 1024x600, so every frame has to be scaled up. Doing that on the CPU was the whole bottleneck: about 24 ms per frame just for the scale-and-blit, which capped us around 20 FPS.
The ESP32-P4 has a 2D Pixel-Processing Accelerator (PPA), so we handed the job to it. The PPA scales the 320x200 frame straight into the back framebuffer of the MIPI-DSI panel, and because that buffer is one the display driver already owns, presenting it is a zero-copy page-flip at the next frame boundary — no extra copy. Scale + flip dropped from ~24 ms to about 9 ms, and the frame rate settled at a steady 30 FPS. Above that, DOOM's own renderer and its 35 Hz game tick are the ceiling, which is fine.
One fun bug: the PPA quantizes its scale factor to 1/16 steps, so 3.2x becomes 3.1875x = 1020 px wide — it never writes the last 4 columns. With double buffering those stale columns held different leftover boot-pattern data in each buffer, so the right edge flickered every time we page-flipped. Fix: clear both framebuffers to black once at startup; the PPA never touches that strip again, leaving an invisible 4 px black edge.
Andrea Ricci
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.