42 Commits
Author SHA1 Message Date
Song Ruo Jing 421cdd4d15 Merge branch 'feature/ppa_clut_support' into 'master'
feat(ppa): add color look-up table support for blend

Closes IDF-15914

See merge request espressif/esp-idf!52800
2026-09-30 20:47:24 +08:00
Song Ruo Jing 7621362746 fix(ppa): fix unused variable warnings when compiling with NDEBUG 2026-09-29 14:19:40 +08:00
Song Ruo Jing 76b4cf1336 feat(ppa): add color look-up table support for blend 2026-09-28 20:08:42 +08:00
Song Ruo Jing 54a57a7351 fix(ppa): a blocking operation should not invoke on_trans_done callback
Otherwise, potential use-after-free of client and user_data in
on_trans_done callback if the client is freed
2026-09-28 16:15:00 +08:00
Song Ruo Jing e87e0b31d9 fix(ppa): fix some minor races in ppa_core.c 2026-09-28 16:15:00 +08:00
Song Ruo Jing 7339ee882f fix(ppa): make trans_elm recycle process safer 2026-09-28 16:15:00 +08:00
Matt Sephton c1cec26bbd fix(ppa): decide engine idleness under the engine spinlock
Merges https://github.com/espressif/esp-idf/pull/19047

The engine's "idle" state was a binary semaphore that the completion ISR
gave only AFTER leaving the engine spinlock, while ppa_do_operation
inserted its transaction under that spinlock and then tried the semaphore
with a zero timeout. On the ISR's own core the two cannot interleave. When
the submitting task runs on the OTHER core it can insert between the
ISR's "queue empty" decision and its give, find the semaphore still taken,
assume the ISR will chain-start the transaction, and be left at the head of
an idle engine's queue. It only starts when a later submission's completion
picks it up; a lone last submission never completes and a caller waiting on
its done callback blocks forever.

Seen on ESP32-P4 with the PPA/2D-DMA interrupt on core 0 and SRM
transactions submitted from a core-1 task: ~130 stranded transactions per
20000 when single transactions are submitted at their own duration, none
when the submitter is on core 0; none after this change.

Replace the semaphore with a `busy` flag that both sides read and write
only under the engine spinlock: the submitter inserts and, if the engine
is idle, marks it busy and starts the transaction itself; the ISR clears
the flag in the same critical section in which it finds the queue empty.
Blocking mode also clears a stale give on the recycled per-transaction
semaphore (the ISR gives it unconditionally, non-blocking callers never
take it), which made a blocking operation return before its transaction
had finished.
2026-09-28 16:15:00 +08:00
Song Ruo Jing 2ac73eb1fa fix(ppa): add check for SRM scaled block size to be not odd for YUV cm 2026-09-08 18:08:03 +08:00
Song Ruo Jing 469aa16c35 fix(ppa): fix for SRM operation potential block if do 90/270 degree rotation
Closes https://github.com/espressif/esp-idf/pull/18768
Closes https://github.com/espressif/esp-idf/issues/19023
2026-09-08 18:08:03 +08:00
morris c96d9d0380 fix(driver): allocate driver objects containing atomic variables from internal SRAM
Objects with atomic members must not be allocated to PSRAM, otherwise
the ordering guarantee of atomic accesses is weakened due to a hardware
behavior on ESP32 chips. Explicitly request MALLOC_CAP_INTERNAL |
MALLOC_CAP_8BIT for:

- i2c master bus object (atomic status/trans_idx)
- i3c master bus object (atomic fsm)
- ISP processor and AE/AF/AWB/HIST controllers (atomic fsm)
- JPEG decoder/encoder dma2d transaction descriptors (atomic started)
- PPA transaction storage embedding dma2d_trans_t
- dma2d m2m test transaction embedding dma2d_trans_t
2026-08-31 13:48:44 +08:00
Chen Jichang 2b8029c775 feat(mspi): split dma and mspi alignment 2026-08-17 16:49:27 +08:00
Song Ruo Jing 58cb111de1 fix(ppa): add checks for input to avoid any OOB access 2026-07-13 17:36:22 +08:00
Song Ruo Jing 14d8570163 feat(ppa): add sleep retention support for DMA2D and PPA 2026-06-15 15:45:07 +08:00
Song Ruo Jing 9922d70cb5 fix(ppa): fix hang if blend operation on a YUV format input background image
Closes https://github.com/espressif/esp-idf/issues/18687
2026-06-10 20:36:07 +08:00
Song Ruo Jing 6441c76ef4 feat(ppa): add support for ESP32S31 2026-04-24 11:47:41 +08:00
Song Ruo Jing 9362907287 feat(dma2d,ppa): Support flash encryption for DMA2D and PPA 2026-02-26 16:39:40 +08:00
Song Ruo Jing fe8ace8bef refactor(ppa): use fourcc for dma2d and ppa color formats 2025-12-01 19:21:49 +08:00
Song Ruo Jing 672005c642 fix(ppa): fix potential SRM operation stuck on DMA issue
Apply a workaound to bypass macro block order function in PPA SRM
when specific conditions are met to avoid SRM operation getting stuck
2025-11-25 15:19:41 +08:00
Song Ruo Jing d33e8a48ad fix(ppa): YUV444 cannot be a PPA SRM output color mode 2025-11-25 10:53:15 +08:00
Song Ruo Jing 6776f65fc9 feat(ppa): ESP32P4 ECO5 PPA related updates
PPA SRM engine added YUV422 and GRAY8 color mode support
PPA SRM engine macro block size increased to 32x32
PPA Blending engine added YUV420, YUV422 and GRAY8 color mode support
2025-10-15 16:49:22 +08:00
Marius Vikhammer 484d2c5c2f fix(system): fixed issues with unused variable warnings when compiling with NDEBUG 2025-09-19 15:42:07 +08:00
morris 7af3bddbca fix(drivers): some false reports from coverity 2025-05-20 16:52:32 +08:00
Song Ruo Jing 8038037b07 fix(ppa): fix ppa srm potentially get blocked when scaling to YUV420
YUV420 requires scale_x_frag, scale_y_frag be even
2025-02-27 21:12:45 +08:00
Alexey Lapshin 888b5f7e8d feat(newlib): add picolibc support 2024-12-02 21:35:56 +07:00
Song Ruo Jing ea0383805f fix(ppa): fix a few minor issues for ppa srm and blend driver
1. The smallest scale size can be 1/16, not 1/15
2. Fix potential heap corruption if scale to a smaller size (OOB)
3. Fix mismatching writeback and invalidate data size if in_bg/fg_buffer and out_buffer
are the same one and L2 cacheline size is larger than L1 cacheline size
2024-10-21 14:51:07 +08:00
Song Ruo Jing 64c06cb327 fix(ppa): fix insufficient writeback/invalidate data length 2024-07-09 16:06:42 +08:00
Song Ruo Jing b7e595d211 fix(ppa): fix mismatching writeback and invalidate data size on the same buffer 2024-05-28 16:59:13 +08:00
Song Ruo Jing ea7d496e58 feat(ppa): add PPA driver support for ESP32P4
Remove L4/L8, YUV422 in PPA driver
Clean up
2024-05-24 14:23:54 +08:00
Song Ruo Jing d956ba2a6c feat(ppa): add PPA driver support for ESP32P4
Add burst_length option to client
Change uint32_t to color_pixel_rgb888_data_t
Descriptor always malloc with MALLOC_CAP_INTERNAL | MALLOC_CAP_8BIT
Add dscr-port mode block size configuration as a separate API in 2D-DMA driver
Do writeback only on an extended window, instead of entire picture
2024-05-24 14:23:14 +08:00
Song Ruo Jing 8464fac845 feat(ppa): add PPA driver support for ESP32P4
Remove the check for in_accepting_trans_state
Add color_pixel_xxxx_data_t structures to color_types.h
Fix PM lock protection (Tested, now works well)
* CPU_MAX, PM lock and semaphore order
* Remove ppa_driver PM lock
Modify concurrency (queue, trans recycle, semaphore, ...)
Add programming guide
Add test apps
2024-05-23 16:40:56 +08:00
Song Ruo Jing 916c0ef8d1 feat(ppa): add PPA driver support for ESP32P4
Fix pm_lock assert and assign to NULL
Alpha value union
Tested with CONFIG_PM_ENABLE
2024-05-23 16:40:56 +08:00
Song Ruo Jing 01bc7dcc56 feat(ppa): add PPA driver support for ESP32P4
Separate callback registration to individual API
Fix YUV420 output
Separate source files into operations
2024-05-23 16:40:56 +08:00
Song Ruo Jing fd1a718f62 feat(ppa): add PPA driver support for ESP32P4
Modified API operation configuration structure
Rename invoker to client
Support YUV420 color mode for SRM
Move PPA srm/blending engine reset ahead of any 2D-DMA channel configurations
2024-05-23 16:40:56 +08:00
Song Ruo Jing 346bc077c5 feat(ppa): add PPA driver support for ESP32P4
Added doxygen
Refactored driver to malloc trans_elm memory when registering the client
Cleaned up driver
Added API check
One client now only responsible for one operation
2024-05-23 16:40:56 +08:00
Song Ruo Jing 95ee1595f9 feat(ppa): add PPA driver support for ESP32P4
Add out_buffer_size field to all oper_config_t
Add strict check for out buffer addr and size alignment
2024-05-23 16:40:55 +08:00
Song Ruo Jing 963c893cc7 feat(ppa): add PPA driver support for ESP32P4
Fix bugs found in AE lvgl demo examples

Add color keying feature to blending
2024-05-23 16:40:55 +08:00
Song Ruo Jing a86e03cba3 feat(ppa): add PPA driver support for ESP32P4
Renamed SR to SRM
2024-05-23 16:40:55 +08:00
Song Ruo Jing 368ef8b472 feat(ppa): add PPA driver support for ESP32P4
Improved/Refactored on the APIs
2024-05-23 16:40:55 +08:00
Song Ruo Jing 776c3ef392 feat(ppa): add PPA driver support for ESP32P4
Add fill operation
Split ppa_do_operation, pre-process some trans config
2024-05-23 16:40:55 +08:00
Song Ruo Jing fd19979d88 feat(ppa): add PPA driver support for ESP32P4
cleaned up a bit, unify to some static functions
2024-05-23 16:40:55 +08:00
Song Ruo Jing 715004f07e feat(ppa): add PPA driver support for ESP32P4
Add invoker concept
Add blend operation
2024-05-23 16:40:55 +08:00
Song Ruo Jing 36732fbcb4 feat(ppa): add PPA driver support for ESP32P4 2024-05-23 16:40:55 +08:00