Merge branch 'bugfix/dma2d_dequeue_mechanism_v5.5' into 'release/v5.5'

fix(dma2d): add a dequeue mechanism for dma2d driver (v5.5)

See merge request espressif/esp-idf!50515
This commit is contained in:
morris
2026-07-18 15:55:39 +08:00
7 changed files with 173 additions and 35 deletions
+8 -1
View File
@@ -343,7 +343,14 @@ esp_err_t jpeg_decoder_process(jpeg_decoder_handle_t decoder_engine, const jpeg_
return ESP_OK;
err1:
dma2d_force_end(decoder_engine->trans_desc, &need_yield);
// The transaction may still be pending in the pool queue (never picked up), so try to dequeue it first.
// Dequeuing is atomic against the pick that turns a pending transaction into an in-flight one, so if the
// transaction is no longer in the queue, it is already in-flight and we force end it instead.
if (dma2d_dequeue(decoder_engine->dma2d_group_handle, decoder_engine->trans_desc) != ESP_OK) {
if (dma2d_force_end(decoder_engine->trans_desc, &need_yield) != ESP_OK) {
ESP_LOGE(TAG, "failed to end the transaction, it is neither pending nor in-flight");
}
}
err2:
xSemaphoreGive(decoder_engine->codec_base->codec_mutex);
if (decoder_engine->codec_base->pm_lock) {
+8 -1
View File
@@ -326,7 +326,14 @@ esp_err_t jpeg_encoder_process(jpeg_encoder_handle_t encoder_engine, const jpeg_
return ESP_OK;
err1:
dma2d_force_end(encoder_engine->trans_desc, &need_yield);
// The transaction may still be pending in the pool queue (never picked up), so try to dequeue it first.
// Dequeuing is atomic against the pick that turns a pending transaction into an in-flight one, so if the
// transaction is no longer in the queue, it is already in-flight and we force end it instead.
if (dma2d_dequeue(encoder_engine->dma2d_group_handle, encoder_engine->trans_desc) != ESP_OK) {
if (dma2d_force_end(encoder_engine->trans_desc, &need_yield) != ESP_OK) {
ESP_LOGE(TAG, "failed to end the transaction, it is neither pending nor in-flight");
}
}
err2:
xSemaphoreGive(encoder_engine->codec_base->codec_mutex);
if (encoder_engine->codec_base->pm_lock) {