From 0b570a88eb70d67aed2112c40c4225b35a992dea Mon Sep 17 00:00:00 2001 From: Santhosh Behara <santhoshbehara@codeaurora.org> Date: Mon, 18 Sep 2017 14:13:00 +0530 Subject: [PATCH] msm: vidc: Increase minimum input buffer count for VP9 decode Increase minimum input buffer count for VP9 decode to 6,as for some vp9 clips which have superframes with more than 4 subframes require more than 4 reference buffers to decode. Bug: 65175134 Change-Id: I561f4c3ad4c4a94c36293c26aab3a9c9423e9268 Signed-off-by: Deepak Kushwah <dkushwah@codeaurora.org> Signed-off-by: Santhosh Behara <santhoshbehara@codeaurora.org> --- drivers/media/platform/msm/vidc/msm_vdec.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/drivers/media/platform/msm/vidc/msm_vdec.c b/drivers/media/platform/msm/vidc/msm_vdec.c index 5e3dd274eedf..d66e438ff2fa 100644 --- a/drivers/media/platform/msm/vidc/msm_vdec.c +++ b/drivers/media/platform/msm/vidc/msm_vdec.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2012-2016, The Linux Foundation. All rights reserved. +/* Copyright (c) 2012-2018, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and @@ -21,6 +21,7 @@ #define MSM_VDEC_DVC_NAME "msm_vdec_8974" #define MIN_NUM_OUTPUT_BUFFERS 4 +#define MIN_NUM_OUTPUT_BUFFERS_VP9 6 #define MIN_NUM_CAPTURE_BUFFERS 6 #define MIN_NUM_THUMBNAIL_MODE_CAPTURE_BUFFERS 1 #define MAX_NUM_OUTPUT_BUFFERS VB2_MAX_FRAME @@ -1621,6 +1622,17 @@ static int msm_vdec_queue_setup(struct vb2_queue *q, if (*num_buffers < MIN_NUM_OUTPUT_BUFFERS || *num_buffers > MAX_NUM_OUTPUT_BUFFERS) *num_buffers = MIN_NUM_OUTPUT_BUFFERS; + /* + * Increase input buffer count to 6 as for some + * vp9 clips which have superframes with more + * than 4 subframes requires more than 4 + * reference frames to decode. + */ + if (inst->fmts[OUTPUT_PORT]->fourcc == + V4L2_PIX_FMT_VP9 && + *num_buffers < MIN_NUM_OUTPUT_BUFFERS_VP9) + *num_buffers = MIN_NUM_OUTPUT_BUFFERS_VP9; + for (i = 0; i < *num_planes; i++) { sizes[i] = get_frame_size(inst, inst->fmts[OUTPUT_PORT], q->type, i); -- GitLab