diff options
author | panpan liu <panpan1.liu@samsung.com> | 2014-07-14 14:42:27 +0800 |
---|---|---|
committer | Chanho Park <chanho61.park@samsung.com> | 2014-08-07 15:18:00 +0900 |
commit | 9a5a07c741b00481a48fa10559755e2f007e9d81 (patch) | |
tree | 49d9cda06d7a135e0ddd37a15018f00c5ad8f945 | |
parent | 0061e87dbd33a176afd0d8408749dde6ad598dd4 (diff) | |
download | linux-3.10-9a5a07c741b00481a48fa10559755e2f007e9d81.tar.gz linux-3.10-9a5a07c741b00481a48fa10559755e2f007e9d81.tar.bz2 linux-3.10-9a5a07c741b00481a48fa10559755e2f007e9d81.zip |
s5p-mfc: limit the size of the CPB
The CPB size is limited by the hardware. Add this limit to the s_fmt.
Change-Id: I4ffe90ac8b4de7aed8f396b3072d5db6ead9741c
Signed-off-by: panpan liu <panpan1.liu@samsung.com>
-rwxr-xr-x | 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 223064a3d0a..2dd5385a493 100755 --- a/drivers/media/platform/s5p-mfc/s5p_mfc_dec.c +++ b/drivers/media/platform/s5p-mfc/s5p_mfc_dec.c @@ -413,6 +413,7 @@ static int vidioc_s_fmt(struct file *file, void *priv, struct v4l2_format *f) int ret = 0; struct s5p_mfc_fmt *fmt; struct v4l2_pix_format_mplane *pix_mp; + struct s5p_mfc_buf_size *buf_size = dev->variant->buf_size; mfc_debug_enter(); ret = vidioc_try_fmt(file, priv, f); @@ -466,11 +467,13 @@ static int vidioc_s_fmt(struct file *file, void *priv, struct v4l2_format *f) mfc_debug(2, "The codec number is: %d\n", ctx->codec_mode); pix_mp->height = 0; pix_mp->width = 0; - if (pix_mp->plane_fmt[0].sizeimage) - ctx->dec_src_buf_size = pix_mp->plane_fmt[0].sizeimage; - else + if (pix_mp->plane_fmt[0].sizeimage == 0) pix_mp->plane_fmt[0].sizeimage = ctx->dec_src_buf_size = DEF_CPB_SIZE; + else if (pix_mp->plane_fmt[0].sizeimage > buf_size->cpb) + ctx->dec_src_buf_size = buf_size->cpb; + else + ctx->dec_src_buf_size = pix_mp->plane_fmt[0].sizeimage; pix_mp->plane_fmt[0].bytesperline = 0; ctx->state = MFCINST_INIT; out: |