hc
2024-01-03 2f7c68cb55ecb7331f2381deb497c27155f32faf
kernel/drivers/media/platform/s5p-mfc/s5p_mfc_enc.c
....@@ -1218,6 +1218,7 @@
12181218 unsigned long mb_y_addr, mb_c_addr;
12191219 int slice_type;
12201220 unsigned int strm_size;
1221
+ bool src_ready;
12211222
12221223 slice_type = s5p_mfc_hw_call(dev->mfc_ops, get_enc_slice_type, dev);
12231224 strm_size = s5p_mfc_hw_call(dev->mfc_ops, get_enc_strm_size, dev);
....@@ -1257,7 +1258,8 @@
12571258 }
12581259 }
12591260 }
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)) {
12611263 mb_entry = list_entry(ctx->src_queue.next, struct s5p_mfc_buf,
12621264 list);
12631265 if (mb_entry->flags & MFC_BUF_FLAG_USED) {
....@@ -1288,7 +1290,13 @@
12881290 vb2_set_plane_payload(&mb_entry->b->vb2_buf, 0, strm_size);
12891291 vb2_buffer_done(&mb_entry->b->vb2_buf, VB2_BUF_STATE_DONE);
12901292 }
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)
12921300 clear_work_bit(ctx);
12931301
12941302 return 0;