dec->immediate_display = 0;
dec->is_dts_mode = 0;
dec->err_reuse_flag = 0;
+ dec->dec_only_release_flag = 0;
dec->is_dynamic_dpb = 1;
dec->dynamic_used = 0;
int is_dpb_full;
unsigned int err_reuse_flag;
+ unsigned int dec_only_release_flag;
/* for debugging about black bar detection */
void *frame_vaddr[3][30];
dec->dynamic_used = 0;
dec->err_reuse_flag = 0;
+ dec->dec_only_release_flag = 0;
s5p_mfc_cleanup_queue(&ctx->buf_queue_lock, &ctx->dst_buf_queue);
released_flag &= ~(1 << i);
/* Not reused buffer should be released when there is a display frame */
- dec->dynamic_used |= released_flag;
+ dec->dec_only_release_flag |= released_flag;
+ for (i = 0; i < MFC_MAX_DPBS; i++)
+ if (released_flag & (1 << i))
+ clear_bit(i, &dec->available_dpb);
}
static void mfc_handle_frame_input(struct s5p_mfc_ctx *ctx, unsigned int err)
released_flag &= ~(1 << i);
/* Not reused buffer should be released when there is a display frame */
- dec->dynamic_used |= released_flag;
+ dec->dec_only_release_flag |= released_flag;
+ for (i = 0; i < MFC_MAX_DPBS; i++)
+ if (released_flag & (1 << i))
+ clear_bit(i, &dec->available_dpb);
}
static void mfc_nal_q_handle_ref_frame(struct s5p_mfc_ctx *ctx, DecoderOutputStr *pOutStr)
}
refBuf = &dec->ref_info[index];
+ if (dec->dec_only_release_flag) {
+ for (t = 0; t < MFC_MAX_DPBS; t++) {
+ if (dec->dec_only_release_flag & (1 << t)) {
+ mfc_debug(2, "Release FD[%d] = %03d (already released in dec only)\n",
+ t, dec->assigned_fd[t]);
+ refBuf->dpb[ncount].fd[0] = dec->assigned_fd[t];
+ ncount++;
+ dec->dec_only_release_flag &= ~(1 << t);
+ }
+ }
+ }
+
if (released_flag) {
for (t = 0; t < MFC_MAX_DPBS; t++) {
if (released_flag & (1 << t)) {