diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_common.h b/drivers/media/platform/s5p-mfc/s5p_mfc_common.h index e64dc6e3c75e..a209a7a52907 100644 --- a/drivers/media/platform/s5p-mfc/s5p_mfc_common.h +++ b/drivers/media/platform/s5p-mfc/s5p_mfc_common.h @@ -641,6 +641,8 @@ struct s5p_mfc_ctx { size_t me_buffer_size; size_t tmv_buffer_size; + enum v4l2_field field; + enum v4l2_mpeg_mfc51_video_force_frame_type force_frame_type; struct list_head ref_queue; diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_dec.c b/drivers/media/platform/s5p-mfc/s5p_mfc_dec.c index f17062f9070b..d470f0f7b1a0 100644 --- a/drivers/media/platform/s5p-mfc/s5p_mfc_dec.c +++ b/drivers/media/platform/s5p-mfc/s5p_mfc_dec.c @@ -345,7 +345,7 @@ static int vidioc_g_fmt(struct file *file, void *priv, struct v4l2_format *f) rectangle. */ pix_mp->width = ctx->buf_width; pix_mp->height = ctx->buf_height; - pix_mp->field = V4L2_FIELD_NONE; + pix_mp->field = ctx->field; pix_mp->num_planes = 2; /* Set pixelformat to the format in which MFC outputs the decoded frame */ @@ -380,6 +380,9 @@ static int vidioc_try_fmt(struct file *file, void *priv, struct v4l2_format *f) struct s5p_mfc_dev *dev = video_drvdata(file); struct s5p_mfc_fmt *fmt; + if (f->fmt.pix.field == V4L2_FIELD_ANY) + f->fmt.pix.field = V4L2_FIELD_NONE; + mfc_debug(2, "Type is %d\n", f->type); if (f->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) { fmt = find_format(f, MFC_FMT_DEC); @@ -436,6 +439,7 @@ static int vidioc_s_fmt(struct file *file, void *priv, struct v4l2_format *f) goto out; } else if (f->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) { /* src_fmt is validated by call to vidioc_try_fmt */ + ctx->field = f->fmt.pix.field; ctx->src_fmt = find_format(f, MFC_FMT_DEC); ctx->codec_mode = ctx->src_fmt->codec_mode; mfc_debug(2, "The codec number is: %d\n", ctx->codec_mode);