From 78ccd163cc788f1ad00a153e4235d8ab9e14633d Mon Sep 17 00:00:00 2001 From: Song Ruo Jing Date: Wed, 24 Jun 2026 22:04:01 +0800 Subject: [PATCH] fix(dma2d): fix non-usable DMA2D_CSC_TX_SCRAMBLE option --- components/esp_hal_dma/esp32p4/include/hal/dma2d_ll.h | 2 +- components/esp_hal_dma/esp32s31/include/hal/dma2d_ll.h | 2 +- components/esp_hal_dma/include/hal/dma2d_types.h | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/components/esp_hal_dma/esp32p4/include/hal/dma2d_ll.h b/components/esp_hal_dma/esp32p4/include/hal/dma2d_ll.h index a67130314c5..2aa06f37305 100644 --- a/components/esp_hal_dma/esp32p4/include/hal/dma2d_ll.h +++ b/components/esp_hal_dma/esp32p4/include/hal/dma2d_ll.h @@ -1054,7 +1054,7 @@ static inline void dma2d_ll_tx_configure_color_space_conv(dma2d_dev_t *dev, uint input_sel = 7; break; case DMA2D_CSC_TX_SCRAMBLE: - input_sel = 3; // Other 3-byte/pixel input path + input_sel = 3; // only 3 bytes/pixel format is supported for scrambling proc_en = false; output_sel = 2; break; diff --git a/components/esp_hal_dma/esp32s31/include/hal/dma2d_ll.h b/components/esp_hal_dma/esp32s31/include/hal/dma2d_ll.h index 9e8921d447f..661d0b4a82a 100644 --- a/components/esp_hal_dma/esp32s31/include/hal/dma2d_ll.h +++ b/components/esp_hal_dma/esp32s31/include/hal/dma2d_ll.h @@ -1031,7 +1031,7 @@ static inline void dma2d_ll_tx_configure_color_space_conv(dma2d_dev_t *dev, uint input_sel = 7; break; case DMA2D_CSC_TX_SCRAMBLE: - input_sel = 3; // Other 3-byte/pixel input path + input_sel = 3; // only 3 bytes/pixel format is supported for scrambling proc_en = false; output_sel = 2; break; diff --git a/components/esp_hal_dma/include/hal/dma2d_types.h b/components/esp_hal_dma/include/hal/dma2d_types.h index 28c1d6fa6a3..3c1d85644b2 100644 --- a/components/esp_hal_dma/include/hal/dma2d_types.h +++ b/components/esp_hal_dma/include/hal/dma2d_types.h @@ -133,6 +133,7 @@ typedef enum { * @brief Enumeration of 2D-DMA pixel bytes scamble order in color space conversion * * Assuming the original pixel byte order (from MSB to LSB) is 2-1-0 . + * This scramble only fits 3 bytes/pixel format. For non-3 bytes/pixel format, the pixels will be messed up if scrambling is used. */ typedef enum { DMA2D_SCRAMBLE_ORDER_BYTE2_1_0, /*!< 2D-DMA pixel data scrambled as BYTE2-1-0 (no scramble) */