Merge branch 'bugfix/dma2d_dequeue_mechanism_v6.1' into 'release/v6.1'

fix(dma2d): add a dequeue mechanism for dma2d driver (v6.1)

See merge request espressif/esp-idf!50512
This commit is contained in:
morris
2026-07-30 10:19:09 +08:00
8 changed files with 174 additions and 36 deletions
+8 -1
View File
@@ -346,7 +346,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 CONFIG_PM_ENABLE