LVGL GPU Fallback: Prove Unsupported Draw Operations Still Render Correctly
Prove fallback with three pieces of evidence: the operation is declined by the accelerated draw unit, a supported alternative actually executes it, and the resulting pixels satisfy the reference. An enabled software renderer alone proves none of those things. Keep unsupported-by-every-unit cases in the test plan so missing pixels cannot masquerade as successful completion.
Applicability: the concrete example is LVGL v9.3.0’s STM32 DMA2D draw unit together with the software draw unit. DMA2D is a 2D accelerator; this is not a capability claim for every GPU or STM32 device. Pin the actual board integration, compiler, configuration and target format. All scenes and instrumentation below are proposed qualification work, not executed tests or performance measurements.

1. Turn the backend name into an operation matrix
Start with the exact DMA2D evaluator, not a product brochure. Its fill path requires zero radius, no gradient and a supported target format. Its image path has additional gates, including normal blending, no bitmap mask, no rotation or skew, unit scale, a variable image source and supported source/target formats. Other task types are not claimed there.
Choose ARGB8888 source and target for the initial fixture. Keep image recolor disabled, clipping radius zero, tiling disabled and supplementary draw data absent. Record these assumptions next to the matrix; “image supported” is too broad to survive a later styling change.
| Isolated operation | DMA2D evaluation | Qualification target |
|---|---|---|
| Solid rectangular fill, radius zero | Eligible under stated conditions | Observe DMA2D execution and pixels |
| Same fill with rounded corners | Declines | Observe supported software rendering |
| Untransformed variable ARGB8888 image | Eligible under stated conditions | Observe accelerated image path |
| Same image with nonzero rotation | Declines | Qualify software transform path |
| Image task with nonzero skew | Declines | Neither-unit negative control |
The final row is intentional. The v9.3.0 software evaluator also rejects image/layer skew. Software has other exclusions, including certain masked formats and proprietary formats. A declined accelerated operation does not imply that a universal software implementation exists.
2. Freeze a usable fallback configuration
Save the effective build configuration rather than only the template. For this fixture, enable the software renderer, ARGB8888 support and its complex drawing support, alongside the target’s validated DMA2D integration. The tagged configuration template distinguishes simple rendering from complex features such as rounded corners.
List every compiled draw unit. Additional accelerators change selection, so a trace from a three-backend build cannot establish behavior for the intended two-backend product. Also retain asset hashes, decoded formats, target stride and relevant renderer options. A later resource conversion can change eligibility without changing the widget creation code.
Use a software-only build as a reference for operations it supports. Keep the same scene geometry, assets, color formats and input sequence. This baseline is a comparison tool, not an infallible oracle: independently check a solid region, a transparent region and the intended clipping boundary.
3. Trace selection after evaluation
The draw pipeline separates creation, evaluation and execution. In the tagged core implementation, the ordinary draw-task-added event is sent before draw units evaluate the task. Reading a preferred unit in that callback therefore does not establish the final selection.
For a development build, record a compact task identifier, operation, relevant descriptor fields and preferred unit after evaluation. Add a second record at actual backend dispatch and a third at completion. Copy needed values into a bounded trace rather than retaining a task pointer after LVGL has released it. Treat this as version-specific internal instrumentation and keep it out of ordinary application logic.
Capture unclaimed-task warnings too. On the ordinary top-level task-finalization path, v9.3.0 warns and marks an unclaimed task READY. That state is not evidence that any pixels were drawn. Nested task creation has a separate branch, so do not generalize the top-level control flow into an undocumented guarantee about every possible task.
4. Combine the paths in one reference scene
A hypothetical fixture contains a solid background rectangle, a rounded translucent card and a small rotated image overlapping both. First test each operation independently. Then combine them so incorrect ordering becomes visible at the intersections. Use asymmetric artwork and different corner colors; a symmetric icon can conceal rotation or clipping mistakes.
Place a parent clipping boundary through part of the scene. Compare interior, edge and outside-clip samples. Add a second case where only the image changes, followed by a full redraw. This distinguishes a repeatable drawing discrepancy from stale pixels left by an incomplete update.
For every supported case, preserve the software reference image, mixed-backend image, difference map and actual route trace. Decide acceptable differences before reviewing results. Integer rounding and antialiasing can require bounded tolerances, but missing shapes, wrong ordering and writes outside the intended clip are separate failures, not noise to average away.
5. Make absence and failure visible
Use the skew task only in an isolated diagnostic scene. Confirm that the fixture detects the absence of a claimed renderer and fails its coverage assertion. If the UI construction does not generate the expected descriptor, report that mismatch instead of claiming that skew fallback was tested.
Keep capability rejection separate from a hardware fault after dispatch. This matrix addresses whether a draw unit accepts an operation. It does not establish automatic CPU replay after a DMA2D transfer error, timeout or invalid memory access. Hardware recovery needs its own port-specific design and evidence.
If a supported operation appears correct but the route trace is missing, mark the case inconclusive. If software alone is wrong, repair that reference path first. If only the mixed scene fails, investigate dependency ordering and shared-surface integration using the captured identifiers before changing visual features.
6. Release a coverage record
The useful deliverable is a versioned matrix with source eligibility, observed executing unit, pixel verdict and unresolved cases. Include the negative control and effective configuration. Rerun it when a style adds a mask, transform or blend mode, or when a renderer or asset converter changes. Only after coverage is established should frame-time comparisons influence backend selection.