diff options
Diffstat (limited to 'drivers/media/platform/s5p-mfc/s5p_mfc_dec.c')
| -rw-r--r-- | drivers/media/platform/s5p-mfc/s5p_mfc_dec.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_dec.c b/drivers/media/platform/s5p-mfc/s5p_mfc_dec.c index 4d93835dec9d..9103258b7df3 100644 --- a/drivers/media/platform/s5p-mfc/s5p_mfc_dec.c +++ b/drivers/media/platform/s5p-mfc/s5p_mfc_dec.c | |||
| @@ -436,6 +436,7 @@ static int vidioc_s_fmt(struct file *file, void *priv, struct v4l2_format *f) | |||
| 436 | struct s5p_mfc_ctx *ctx = fh_to_ctx(priv); | 436 | struct s5p_mfc_ctx *ctx = fh_to_ctx(priv); |
| 437 | int ret = 0; | 437 | int ret = 0; |
| 438 | struct v4l2_pix_format_mplane *pix_mp; | 438 | struct v4l2_pix_format_mplane *pix_mp; |
| 439 | struct s5p_mfc_buf_size *buf_size = dev->variant->buf_size; | ||
| 439 | 440 | ||
| 440 | mfc_debug_enter(); | 441 | mfc_debug_enter(); |
| 441 | ret = vidioc_try_fmt(file, priv, f); | 442 | ret = vidioc_try_fmt(file, priv, f); |
| @@ -459,11 +460,13 @@ static int vidioc_s_fmt(struct file *file, void *priv, struct v4l2_format *f) | |||
| 459 | mfc_debug(2, "The codec number is: %d\n", ctx->codec_mode); | 460 | mfc_debug(2, "The codec number is: %d\n", ctx->codec_mode); |
| 460 | pix_mp->height = 0; | 461 | pix_mp->height = 0; |
| 461 | pix_mp->width = 0; | 462 | pix_mp->width = 0; |
| 462 | if (pix_mp->plane_fmt[0].sizeimage) | 463 | if (pix_mp->plane_fmt[0].sizeimage == 0) |
| 463 | ctx->dec_src_buf_size = pix_mp->plane_fmt[0].sizeimage; | ||
| 464 | else | ||
| 465 | pix_mp->plane_fmt[0].sizeimage = ctx->dec_src_buf_size = | 464 | pix_mp->plane_fmt[0].sizeimage = ctx->dec_src_buf_size = |
| 466 | DEF_CPB_SIZE; | 465 | DEF_CPB_SIZE; |
| 466 | else if (pix_mp->plane_fmt[0].sizeimage > buf_size->cpb) | ||
| 467 | ctx->dec_src_buf_size = buf_size->cpb; | ||
| 468 | else | ||
| 469 | ctx->dec_src_buf_size = pix_mp->plane_fmt[0].sizeimage; | ||
| 467 | pix_mp->plane_fmt[0].bytesperline = 0; | 470 | pix_mp->plane_fmt[0].bytesperline = 0; |
| 468 | ctx->state = MFCINST_INIT; | 471 | ctx->state = MFCINST_INIT; |
| 469 | ret = 0; | 472 | ret = 0; |
