From 4f287b68adf643c37a56a725c97d7a3bcedcc991 Mon Sep 17 00:00:00 2001 From: Priyanka Gujjula Date: Fri, 24 Jul 2020 12:48:34 +0530 Subject: [PATCH] msm: vidc: disable DCVS for camera encode batching Disable DCVS for encode usecases if the control V4L2_CID_MPEG_VIDC_SUPERFRAME is enabled. Change-Id: I72a4bebbd79c42988867572d69f6833629054cba --- msm/vidc/msm_vidc_clocks.c | 3 ++- msm/vidc/msm_vidc_common.h | 11 +++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/msm/vidc/msm_vidc_clocks.c b/msm/vidc/msm_vidc_clocks.c index c2db722ec8fd..59dfd21a88dc 100644 --- a/msm/vidc/msm_vidc_clocks.c +++ b/msm/vidc/msm_vidc_clocks.c @@ -999,7 +999,8 @@ int msm_dcvs_try_enable(struct msm_vidc_inst *inst) inst->clk_data.low_latency_mode || inst->batch.enable || is_turbo_session(inst) || - inst->rc_type == V4L2_MPEG_VIDEO_BITRATE_MODE_CQ); + inst->rc_type == V4L2_MPEG_VIDEO_BITRATE_MODE_CQ || + is_encode_batching(inst)); s_vpr_hp(inst->sid, "DCVS %s: %pK\n", inst->clk_data.dcvs_mode ? "enabled" : "disabled", inst); diff --git a/msm/vidc/msm_vidc_common.h b/msm/vidc/msm_vidc_common.h index 98287b8570e7..f9fe8cbb098c 100644 --- a/msm/vidc/msm_vidc_common.h +++ b/msm/vidc/msm_vidc_common.h @@ -153,6 +153,17 @@ static inline bool is_encode_session(struct msm_vidc_inst *inst) return inst->session_type == MSM_VIDC_ENCODER; } +static inline bool is_encode_batching(struct msm_vidc_inst *inst) +{ + struct v4l2_ctrl *ctrl; + + if (inst->session_type != MSM_VIDC_ENCODER) + return false; + + ctrl = get_ctrl(inst, V4L2_CID_MPEG_VIDC_SUPERFRAME); + return !!ctrl->val; +} + static inline bool is_primary_output_mode(struct msm_vidc_inst *inst) { return inst->stream_output_mode == HAL_VIDEO_DECODER_PRIMARY;