Skip to content

Commit 91ae0e1

Browse files
Tiffany Linmchehab
authored andcommitted
[media] vcodec:mediatek: Fix visible_height larger than coded_height issue in s_fmt_out
The original code add extra 32 line to visible_height. It is incorrect, 32 line should be add to coded_height. The purpose is that user space could calcuate real buffer size needed by using coded_width * coded_height. But this method will make v4l2-compliance test fail, since g_fmt != s_fmt(g_fmt) So remove extend visible_height or coded_height, user space should just use sizeimage to get real buffer size needed Signed-off-by: Tiffany Lin <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
1 parent ad34f54 commit 91ae0e1

File tree

1 file changed

+0
-10
lines changed

1 file changed

+0
-10
lines changed

drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.c

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -487,7 +487,6 @@ static int vidioc_venc_s_fmt_out(struct file *file, void *priv,
487487
struct mtk_q_data *q_data;
488488
int ret, i;
489489
struct mtk_video_fmt *fmt;
490-
unsigned int pitch_w_div16;
491490
struct v4l2_pix_format_mplane *pix_fmt_mp = &f->fmt.pix_mp;
492491

493492
vq = v4l2_m2m_get_vq(ctx->m2m_ctx, f->type);
@@ -530,15 +529,6 @@ static int vidioc_venc_s_fmt_out(struct file *file, void *priv,
530529
q_data->coded_width = f->fmt.pix_mp.width;
531530
q_data->coded_height = f->fmt.pix_mp.height;
532531

533-
pitch_w_div16 = DIV_ROUND_UP(q_data->visible_width, 16);
534-
if (pitch_w_div16 % 8 != 0) {
535-
/* Adjust returned width/height, so application could correctly
536-
* allocate hw required memory
537-
*/
538-
q_data->visible_height += 32;
539-
vidioc_try_fmt(f, q_data->fmt);
540-
}
541-
542532
q_data->field = f->fmt.pix_mp.field;
543533
ctx->colorspace = f->fmt.pix_mp.colorspace;
544534
ctx->ycbcr_enc = f->fmt.pix_mp.ycbcr_enc;

0 commit comments

Comments
 (0)