aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKiran AVND <avnd.kiran@samsung.com>2014-10-21 07:07:04 -0400
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2014-10-28 13:50:35 -0400
commit16258649bf8d7d4379050a51f3cee414e0f8aa8f (patch)
tree907955606cb8a9a2b892fbf328bb433abe3eb0c7
parentb16e64482dd2346f7fc68ec4150bb1ddf1f988e6 (diff)
[media] s5p-mfc: flush dpbs when resolution changes
While resolution change is detected by MFC, we flush out older dpbs, send the resolution change event to application, and then accept further queuing of new src buffers. Sometimes, we error out during dpb flush because of lack of src buffers. Since we have not started decoding new resolution yet, it is simpler to push zero-size buffer until we flush out all dpbs. This is already been done while handling EOS command, and this patch extends the same logic to resolution change as well. Signed-off-by: Kiran AVND <avnd.kiran@samsung.com> Signed-off-by: Arun Kumar K <arun.kk@samsung.com> Signed-off-by: Kamil Debski <k.debski@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
-rw-r--r--drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c20
1 files changed, 2 insertions, 18 deletions
diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c b/drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c
index 8798b14bacce..7b1cf736843c 100644
--- a/drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c
+++ b/drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c
@@ -1532,27 +1532,11 @@ static inline int s5p_mfc_get_new_ctx(struct s5p_mfc_dev *dev)
1532static inline void s5p_mfc_run_dec_last_frames(struct s5p_mfc_ctx *ctx) 1532static inline void s5p_mfc_run_dec_last_frames(struct s5p_mfc_ctx *ctx)
1533{ 1533{
1534 struct s5p_mfc_dev *dev = ctx->dev; 1534 struct s5p_mfc_dev *dev = ctx->dev;
1535 struct s5p_mfc_buf *temp_vb;
1536 unsigned long flags;
1537
1538 spin_lock_irqsave(&dev->irqlock, flags);
1539
1540 /* Frames are being decoded */
1541 if (list_empty(&ctx->src_queue)) {
1542 mfc_debug(2, "No src buffers.\n");
1543 spin_unlock_irqrestore(&dev->irqlock, flags);
1544 return;
1545 }
1546 /* Get the next source buffer */
1547 temp_vb = list_entry(ctx->src_queue.next, struct s5p_mfc_buf, list);
1548 temp_vb->flags |= MFC_BUF_FLAG_USED;
1549 s5p_mfc_set_dec_stream_buffer_v6(ctx,
1550 vb2_dma_contig_plane_dma_addr(temp_vb->b, 0), 0, 0);
1551 spin_unlock_irqrestore(&dev->irqlock, flags);
1552 1535
1536 s5p_mfc_set_dec_stream_buffer_v6(ctx, 0, 0, 0);
1553 dev->curr_ctx = ctx->num; 1537 dev->curr_ctx = ctx->num;
1554 s5p_mfc_clean_ctx_int_flags(ctx); 1538 s5p_mfc_clean_ctx_int_flags(ctx);
1555 s5p_mfc_decode_one_frame_v6(ctx, 1); 1539 s5p_mfc_decode_one_frame_v6(ctx, MFC_DEC_LAST_FRAME);
1556} 1540}
1557 1541
1558static inline int s5p_mfc_run_dec_frame(struct s5p_mfc_ctx *ctx) 1542static inline int s5p_mfc_run_dec_frame(struct s5p_mfc_ctx *ctx)