Skip to content

feat(render): Add RGB565 raster path and ESP32-P4 PPA backend#160

Open
HalfSweet wants to merge 8 commits into
pocket-stack:mainfrom
HalfSweet:feat/esp32p4-ppa-rgb565
Open

feat(render): Add RGB565 raster path and ESP32-P4 PPA backend#160
HalfSweet wants to merge 8 commits into
pocket-stack:mainfrom
HalfSweet:feat/esp32p4-ppa-rgb565

Conversation

@HalfSweet

@HalfSweet HalfSweet commented Jul 23, 2026

Copy link
Copy Markdown

Summary

  • add opaque PSP PSM5650 texture support and a native RGB565 raster target
  • add an ESP32-P4 DrawList backend backed by PPA FILL, A8 BLEND, and SRM
  • preserve DrawList ordering with an RGB565 software fallback for unsupported operations
  • add a reusable ESP-IDF adapter, component smoke application, documentation, and CI
  • keep the complete rendering path in RGB565 without a full-frame RGB888 or ARGB8888 intermediate

Implementation

The new pocketjs-esp32p4-ppa backend interprets DrawLists directly into an RGB565 destination.

Hardware-compatible operations are routed to:

  • PPA FILL for opaque rectangles
  • PPA BLEND for translucent rectangles, antialiased glyphs, and white-alpha textures
  • PPA SRM for compatible opaque PSM5650 textures, including exact scaling, quarter-turn rotation, and mirroring

Unsupported gradients, triangles, texture formats, transforms, and sampling cases fall back to the native RGB565 software rasterizer in DrawList order.

The reusable ESP-IDF adapter:

  • registers separate FILL, BLEND, and SRM clients
  • uses blocking transactions so subsequent PPA and CPU operations observe completed pixels
  • expands RGB565 FILL colors through fill_argb_color
  • rejects overlapping SRM input/output buffers
  • accepts only scale factors represented exactly in the PPA's 1/16 increments
  • leaves display initialization, presentation buffers, and panel-specific behavior in the product BSP

Linear alpha-texture classification and edge sampling are shared with the core rasterizer. Colored transparent textures using linear filtering correctly fall back to software rendering.

Compatibility

  • ESP-IDF release/v6.0: supported and used as the CI baseline
  • ESP-IDF release/v6.1: supported and locally build-tested
  • versions older than v6.0 have not been tested
  • target: ESP32-P4

Hardware status

In the M5Stack Tab5 hardware integration build, the average frame rate reached 19.8 FPS during extended operation. The test was conducted at a CPU frequency of 360 MHz and a resolution of 1280 × 720.

@HalfSweet HalfSweet changed the title feat: Add esp32p4 PPA support feat(render): Add RGB565 raster path and ESP32-P4 PPA backend Jul 23, 2026
@HalfSweet
HalfSweet marked this pull request as ready for review July 23, 2026 09:53
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