media: vicodec: fix initial stateless sizeimage value
authorHans Verkuil <hverkuil-cisco@xs4all.nl>
Thu, 6 Jun 2019 09:23:42 +0000 (05:23 -0400)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Tue, 11 Jun 2019 15:29:03 +0000 (11:29 -0400)
The initial sizeimage value was wrong for the stateless decoder.

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
drivers/media/platform/vicodec/vicodec-core.c

index b23d57f..7a70828 100644 (file)
@@ -1799,8 +1799,10 @@ static int vicodec_open(struct file *file)
        raw_size = 1280 * 720 * info->sizeimage_mult / info->sizeimage_div;
        comp_size = 1280 * 720 * pixfmt_fwht.sizeimage_mult /
                                 pixfmt_fwht.sizeimage_div;
-       if (ctx->is_enc || ctx->is_stateless)
+       if (ctx->is_enc)
                ctx->q_data[V4L2_M2M_SRC].sizeimage = raw_size;
+       else if (ctx->is_stateless)
+               ctx->q_data[V4L2_M2M_SRC].sizeimage = comp_size;
        else
                ctx->q_data[V4L2_M2M_SRC].sizeimage =
                        comp_size + sizeof(struct fwht_cframe_hdr);