.. | .. |
---|
1218 | 1218 | unsigned long mb_y_addr, mb_c_addr; |
---|
1219 | 1219 | int slice_type; |
---|
1220 | 1220 | unsigned int strm_size; |
---|
| 1221 | + bool src_ready; |
---|
1221 | 1222 | |
---|
1222 | 1223 | slice_type = s5p_mfc_hw_call(dev->mfc_ops, get_enc_slice_type, dev); |
---|
1223 | 1224 | strm_size = s5p_mfc_hw_call(dev->mfc_ops, get_enc_strm_size, dev); |
---|
.. | .. |
---|
1257 | 1258 | } |
---|
1258 | 1259 | } |
---|
1259 | 1260 | } |
---|
1260 | | - if ((ctx->src_queue_cnt > 0) && (ctx->state == MFCINST_RUNNING)) { |
---|
| 1261 | + if (ctx->src_queue_cnt > 0 && (ctx->state == MFCINST_RUNNING || |
---|
| 1262 | + ctx->state == MFCINST_FINISHING)) { |
---|
1261 | 1263 | mb_entry = list_entry(ctx->src_queue.next, struct s5p_mfc_buf, |
---|
1262 | 1264 | list); |
---|
1263 | 1265 | if (mb_entry->flags & MFC_BUF_FLAG_USED) { |
---|
.. | .. |
---|
1288 | 1290 | vb2_set_plane_payload(&mb_entry->b->vb2_buf, 0, strm_size); |
---|
1289 | 1291 | vb2_buffer_done(&mb_entry->b->vb2_buf, VB2_BUF_STATE_DONE); |
---|
1290 | 1292 | } |
---|
1291 | | - if ((ctx->src_queue_cnt == 0) || (ctx->dst_queue_cnt == 0)) |
---|
| 1293 | + |
---|
| 1294 | + src_ready = true; |
---|
| 1295 | + if (ctx->state == MFCINST_RUNNING && ctx->src_queue_cnt == 0) |
---|
| 1296 | + src_ready = false; |
---|
| 1297 | + if (ctx->state == MFCINST_FINISHING && ctx->ref_queue_cnt == 0) |
---|
| 1298 | + src_ready = false; |
---|
| 1299 | + if (!src_ready || ctx->dst_queue_cnt == 0) |
---|
1292 | 1300 | clear_work_bit(ctx); |
---|
1293 | 1301 | |
---|
1294 | 1302 | return 0; |
---|