Display Presentation
ESP-GSP delegates framebuffer ownership, tearing control, rotation and panel
transfers to the esp_display_present dependency. Applications provide
one display target configuration and normally leave the presentation mode on
ESP_DISPLAY_PRESENT_MODE_AUTO.
Panel classes
Section titled “Panel classes”The location of frame memory determines the presentation strategy:
| Panel class | Frame memory | AUTO behavior |
|---|---|---|
| RGB / MIPI-DSI | Host framebuffer continuously scanned by the panel | Triple-buffered partial rendering; three framebuffers are required |
| SPI / QSPI with TE | GRAM inside the panel | Dirty-area transfers synchronized to the TE signal |
| SPI / QSPI without TE | GRAM inside the panel | Free-running dirty-area transfers |
The application should describe the hardware accurately and let the presenter select the strategy. Do not infer the panel interface from the SoC: one SoC can be used with several display interfaces.
Recommended configuration
Section titled “Recommended configuration”Initialize the target structure supplied by the BSP or board layer:
esp_display_present_target_config_t display;ESP_ERROR_CHECK(board_display_init(&display));
esp_gsp_esp_lcd_config_t lcd = ESP_GSP_ESP_LCD_CONFIG_INIT();lcd.display = display;lcd.touch = touch; /* optional */For RGB and MIPI-DSI targets, the current esp_display_present AUTO mode requires
three framebuffers; it does not automatically fall back when fewer are available.
A two-buffer board must explicitly select a compatible two-buffer mode, such as
ESP_DISPLAY_PRESENT_MODE_DOUBLE_PARTIAL or unrotated DOUBLE_DIRECT, and
provide the matching framebuffer count.
For SPI and QSPI targets, provide TE configuration only when the signal is wired and usable. A zeroed TE configuration means that TE synchronization is disabled; GPIO 0 remains valid when TE is explicitly enabled.
Memory-constrained GRAM panels
Section titled “Memory-constrained GRAM panels”Partition rendering modes share one draw-buffer pool configured through
target.drawbuf. target.drawbuf.lines controls the height of each
presenter-owned draw stripe. Zero selects a stripe height derived from a
32 KiB default. Free-running GRAM defaults to two draw buffers. TE-synchronized
and framebuffer-repair paths can also select two on multicore targets when
their memory checks allow it, otherwise one; their automatic second buffer is
optional if allocation fails. Set buffers = 1 to require a single draw buffer. Set
lines explicitly when the product needs a different memory bound, and use
target.drawbuf.in_psram only when the panel transfer path can consume that
memory. Values greater than the logical height and buffer counts greater
than two are rejected.
Host-scanned RGB and MIPI-DSI panels use framebuffers; target.drawbuf
applies only to their optional repair-path partition buffer.
Rotation
Section titled “Rotation”The scene remains in logical coordinates. The presenter maps logical damage
and pixels to the physical panel according to the configured rotation.
Applications must compile a scene resolution matching the logical orientation;
90° and 270° therefore use transposed width and height for non-square panels.
The bundle RGB565 or RGB888 pixel format must also match the display
target; rotation does not convert between pixel formats.
The current presenter rejects logical rotation on free-running GRAM output
and on DOUBLE_DIRECT. Use a compatible TE-composition or framebuffer
full/partial mode when presenter rotation is required. This is separate from
rotation already configured in the panel driver by the BSP.
Transitions
Section titled “Transitions”Scene transitions normally use retained snapshots. When memory is constrained,
set ESP_GSP_FIELD_ENABLE_TRANSITION_SNAPSHOTS to zero with
esp_gsp_config_set() to request the lower-memory path. Supported slide and
fade-through-black transitions then render visible partitions directly when
the display contract permits it. A requested cross-fade cannot run without
both scene snapshots and uses the zero-snapshot fade-through-black fallback
instead.
Rendering and SDK integration
Section titled “Rendering and SDK integration”Rendering optimizations apply automatically, including native RGB888 image opacity. Evaluate frame production and display submission separately when comparing performance; no additional application API is required.
When the presenter leases a DIRECT framebuffer in PSRAM, ESP32-P4 and ESP32-S31 draw eligible layered RGB565 and RGB888 regions in horizontal bands. P4 sizes the bands for its L2 cache. S31 uses up to 24 KiB of the existing framebuffer per band and needs no scratch allocation. Simple backgrounds and scenes with custom drawing, masks or warps use the ordinary DIRECT path. Panel-IO displays with onboard GRAM use the PARTITION contract and its draw buffers, including on chips with PSRAM.
For an ESP32-S3 product that draws layered RGB565 images into a PSRAM DIRECT
framebuffer, enable CONFIG_ESP_GSP_S3_DIRECT_SCRATCH to stage complex regions
in internal RAM. Each frame borrows up to 16 KiB when needed and releases it
after rendering. If internal RAM is scarce, the renderer draws directly into
the framebuffer. Partitioned displays continue to use their draw buffers. If a
product uses both modes, compare frame times in both modes on the final firmware
with the option on and off.
When ESP32-S31 executes instructions from PSRAM, the acceleration fence is placed in internal instruction memory to reduce cache contention. Its small internal-memory cost depends on link alignment; selection and synchronization of hardware acceleration are unchanged. For source builds with compile-time LTO enabled, this placement is skipped to avoid disabling the component’s LTO. Prebuilt consumers can still use it.
For P4 prebuilt builds, configure the ESP-IDF silicon revision to match the
board. CONFIG_ESP32P4_SELECTS_REV_LESS_V3 selects the pre-v3 library;
other P4 builds select the v3-or-later library. Reconfigure and rebuild after
changing the revision. The DMA2D adapter is compiled with the consuming ESP-IDF
SDK so its driver configuration uses that SDK’s structure layout.
Ownership boundary
Section titled “Ownership boundary”The application and BSP own hardware description and product policy. ESP-GSP owns logical scene damage, command replay, transitions, and frame planning. The presenter owns:
- target classification and AUTO selection;
- framebuffer discovery and coherence;
- physical transforms and cache synchronization;
- TE, DMA/PPA transfers and completion fences;
- callback-safe stop and deletion.
Application and framework code should not register panel callbacks or repair framebuffers independently of the presenter. Custom board integration should provide one accurate display target instead of depending on internal renderer, backend, or platform source layout.