mirror of
https://github.com/espressif/esp-idf.git
synced 2026-10-01 18:50:34 +03:00
fix(dma2d): add a dequeue mechanism for dma2d driver
JPEG driver should be able to either dequeue a pending transaction from a 2D-DMA pool or force end a processing transaction.
This commit is contained in:
@@ -334,7 +334,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
|
||||
|
||||
Reference in New Issue
Block a user