diff options
Diffstat (limited to 'drivers/media/platform/coda/coda-common.c')
-rw-r--r-- | drivers/media/platform/coda/coda-common.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/drivers/media/platform/coda/coda-common.c b/drivers/media/platform/coda/coda-common.c index b265edd8d277..267fda760b38 100644 --- a/drivers/media/platform/coda/coda-common.c +++ b/drivers/media/platform/coda/coda-common.c | |||
@@ -888,14 +888,14 @@ static void coda_pic_run_work(struct work_struct *work) | |||
888 | static int coda_job_ready(void *m2m_priv) | 888 | static int coda_job_ready(void *m2m_priv) |
889 | { | 889 | { |
890 | struct coda_ctx *ctx = m2m_priv; | 890 | struct coda_ctx *ctx = m2m_priv; |
891 | int src_bufs = v4l2_m2m_num_src_bufs_ready(ctx->fh.m2m_ctx); | ||
891 | 892 | ||
892 | /* | 893 | /* |
893 | * For both 'P' and 'key' frame cases 1 picture | 894 | * For both 'P' and 'key' frame cases 1 picture |
894 | * and 1 frame are needed. In the decoder case, | 895 | * and 1 frame are needed. In the decoder case, |
895 | * the compressed frame can be in the bitstream. | 896 | * the compressed frame can be in the bitstream. |
896 | */ | 897 | */ |
897 | if (!v4l2_m2m_num_src_bufs_ready(ctx->fh.m2m_ctx) && | 898 | if (!src_bufs && ctx->inst_type != CODA_INST_DECODER) { |
898 | ctx->inst_type != CODA_INST_DECODER) { | ||
899 | v4l2_dbg(1, coda_debug, &ctx->dev->v4l2_dev, | 899 | v4l2_dbg(1, coda_debug, &ctx->dev->v4l2_dev, |
900 | "not ready: not enough video buffers.\n"); | 900 | "not ready: not enough video buffers.\n"); |
901 | return 0; | 901 | return 0; |
@@ -911,9 +911,8 @@ static int coda_job_ready(void *m2m_priv) | |||
911 | struct list_head *meta; | 911 | struct list_head *meta; |
912 | bool stream_end; | 912 | bool stream_end; |
913 | int num_metas; | 913 | int num_metas; |
914 | int src_bufs; | ||
915 | 914 | ||
916 | if (ctx->hold && !v4l2_m2m_num_src_bufs_ready(ctx->fh.m2m_ctx)) { | 915 | if (ctx->hold && !src_bufs) { |
917 | v4l2_dbg(1, coda_debug, &ctx->dev->v4l2_dev, | 916 | v4l2_dbg(1, coda_debug, &ctx->dev->v4l2_dev, |
918 | "%d: not ready: on hold for more buffers.\n", | 917 | "%d: not ready: on hold for more buffers.\n", |
919 | ctx->idx); | 918 | ctx->idx); |
@@ -927,8 +926,6 @@ static int coda_job_ready(void *m2m_priv) | |||
927 | list_for_each(meta, &ctx->buffer_meta_list) | 926 | list_for_each(meta, &ctx->buffer_meta_list) |
928 | num_metas++; | 927 | num_metas++; |
929 | 928 | ||
930 | src_bufs = v4l2_m2m_num_src_bufs_ready(ctx->fh.m2m_ctx); | ||
931 | |||
932 | if (!stream_end && (num_metas + src_bufs) < 2) { | 929 | if (!stream_end && (num_metas + src_bufs) < 2) { |
933 | v4l2_dbg(1, coda_debug, &ctx->dev->v4l2_dev, | 930 | v4l2_dbg(1, coda_debug, &ctx->dev->v4l2_dev, |
934 | "%d: not ready: need 2 buffers available (%d, %d)\n", | 931 | "%d: not ready: need 2 buffers available (%d, %d)\n", |
@@ -937,8 +934,8 @@ static int coda_job_ready(void *m2m_priv) | |||
937 | } | 934 | } |
938 | 935 | ||
939 | 936 | ||
940 | if (!v4l2_m2m_num_src_bufs_ready(ctx->fh.m2m_ctx) && | 937 | if (!src_bufs && !stream_end && |
941 | !stream_end && (coda_get_bitstream_payload(ctx) < 512)) { | 938 | (coda_get_bitstream_payload(ctx) < 512)) { |
942 | v4l2_dbg(1, coda_debug, &ctx->dev->v4l2_dev, | 939 | v4l2_dbg(1, coda_debug, &ctx->dev->v4l2_dev, |
943 | "%d: not ready: not enough bitstream data (%d).\n", | 940 | "%d: not ready: not enough bitstream data (%d).\n", |
944 | ctx->idx, coda_get_bitstream_payload(ctx)); | 941 | ctx->idx, coda_get_bitstream_payload(ctx)); |