if (ctx->state == MFCINST_GOT_INST ||
ctx->state == MFCINST_RES_CHANGE_FLUSH ||
ctx->state == MFCINST_RES_CHANGE_END) {
- /* If the MFC is parsing the header,
- * so wait until it is finished */
- if (mfc_wait_for_done_ctx(ctx,
- MFC_REG_R2H_CMD_SEQ_DONE_RET)) {
- mfc_err_dev("header parsing failed\n");
- return -EAGAIN;
+ /* If there is no source buffer to parsing, we can't SEQ_START */
+ if ((ctx->wait_state == WAIT_DECODING) &&
+ mfc_is_queue_count_same(&ctx->buf_queue_lock, &ctx->src_buf_queue, 0)) {
+ mfc_err_dev("There is no source buffer to parsing, keep previous resolution\n");
+ return -EAGAIN;
+ }
+ /* If the MFC is parsing the header, so wait until it is finished */
+ if (mfc_wait_for_done_ctx(ctx, MFC_REG_R2H_CMD_SEQ_DONE_RET)) {
+ mfc_err_dev("header parsing failed\n");
+ return -EAGAIN;
}
}
}
}
+ if (ctx->wait_state == WAIT_DECODING) {
+ ctx->wait_state = WAIT_DPB_FLUSH;
+ mfc_debug(2, "wait DPB flush for decoding(INIT_BUFFER)\n");
+ }
+
mfc_debug_leave();
return 0;
index++;
}
- if (ctx->wait_state == WAIT_INITBUF_DONE ||
- ctx->wait_state == WAIT_DECODING) {
+ if (ctx->wait_state == WAIT_DPB_FLUSH) {
ctx->wait_state = WAIT_NONE;
- mfc_debug(2, "Decoding can be started now\n");
+ mfc_debug(2, "Decoding(INIT_BUFFER) can be started now\n");
}
}
mfc_change_state(ctx, MFCINST_RUNNING);
if (ctx->type == MFCINST_DECODER) {
- if (ctx->wait_state == WAIT_DECODING) {
- ctx->wait_state = WAIT_INITBUF_DONE;
- mfc_debug(2, "INIT_BUFFER has done, but can't start decoding\n");
- }
if (ctx->is_dpb_realloc)
ctx->is_dpb_realloc = 0;
}