diff options
Diffstat (limited to 'drivers/staging/media/hantro/hantro_v4l2.c')
-rw-r--r-- | drivers/staging/media/hantro/hantro_v4l2.c | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/drivers/staging/media/hantro/hantro_v4l2.c b/drivers/staging/media/hantro/hantro_v4l2.c index c319f0e5fe60..e595905b3bd7 100644 --- a/drivers/staging/media/hantro/hantro_v4l2.c +++ b/drivers/staging/media/hantro/hantro_v4l2.c @@ -149,20 +149,6 @@ static int vidioc_enum_fmt(struct file *file, void *priv, bool skip_mode_none; /* - * The HEVC decoder on the G2 core needs a little quirk to offer NV12 - * only on the capture side. Once the post-processor logic is used, - * we will be able to expose NV12_4L4 and NV12 as the other cases, - * and therefore remove this quirk. - */ - if (capture && ctx->vpu_src_fmt->fourcc == V4L2_PIX_FMT_HEVC_SLICE) { - if (f->index == 0) { - f->pixelformat = V4L2_PIX_FMT_NV12; - return 0; - } - return -EINVAL; - } - - /* * When dealing with an encoder: * - on the capture side we want to filter out all MODE_NONE formats. * - on the output side we want to filter out all formats that are @@ -302,6 +288,11 @@ static int hantro_try_fmt(const struct hantro_ctx *ctx, pix_mp->plane_fmt[0].sizeimage += hantro_vp9_mv_size(pix_mp->width, pix_mp->height); + else if (ctx->vpu_src_fmt->fourcc == V4L2_PIX_FMT_HEVC_SLICE && + !hantro_needs_postproc(ctx, fmt)) + pix_mp->plane_fmt[0].sizeimage += + hantro_hevc_mv_size(pix_mp->width, + pix_mp->height); } else if (!pix_mp->plane_fmt[0].sizeimage) { /* * For coded formats the application can specify |