From 73fa002b9bf59493c297a59da6533fee89ead0f9 Mon Sep 17 00:00:00 2001 From: Shi Zhongbo Date: Mon, 18 Nov 2019 10:41:24 +0800 Subject: [PATCH] msm: venc: set perf mode for HEIC buffers 1. Set perf mode for image session buffers so that they will be processed quickly. 2. Set max frequency for any turbo sessions. Change-Id: Icf9b0af5cffcd395356783a9ff7a9421a309f52c Signed-off-by: Shi Zhongbo --- msm/vidc/msm_vidc.c | 6 ++++++ msm/vidc/msm_vidc_clocks.c | 8 +++----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/msm/vidc/msm_vidc.c b/msm/vidc/msm_vidc.c index 85f76f3f683f..beda8bbe46bf 100644 --- a/msm/vidc/msm_vidc.c +++ b/msm/vidc/msm_vidc.c @@ -370,6 +370,12 @@ int msm_vidc_qbuf(void *instance, struct media_device *mdev, msm_comm_store_input_tag(&inst->etb_data, b->index, client_data->id, 0, inst->sid); } + /* + * set perf mode for image session buffers so that + * they will be processed quickly + */ + if (is_grid_session(inst) && b->type == INPUT_MPLANE) + b->flags |= V4L2_BUF_FLAG_PERF_MODE; q = msm_comm_get_vb2q(inst, b->type); if (!q) { diff --git a/msm/vidc/msm_vidc_clocks.c b/msm/vidc/msm_vidc_clocks.c index d975672d9159..d3d45e319b3c 100644 --- a/msm/vidc/msm_vidc_clocks.c +++ b/msm/vidc/msm_vidc_clocks.c @@ -851,11 +851,8 @@ int msm_comm_scale_clocks(struct msm_vidc_inst *inst) if (temp->vvb.vb2_buf.type == INPUT_MPLANE) { filled_len = max(filled_len, temp->vvb.vb2_buf.planes[0].bytesused); - if (inst->session_type == MSM_VIDC_ENCODER && - (temp->vvb.flags & - V4L2_BUF_FLAG_PERF_MODE)) { + if (temp->vvb.flags & V4L2_BUF_FLAG_PERF_MODE) is_turbo = true; - } device_addr = temp->smem[0].device_addr; } } @@ -866,7 +863,8 @@ int msm_comm_scale_clocks(struct msm_vidc_inst *inst) return 0; } - if (inst->clk_data.buffer_counter < DCVS_FTB_WINDOW || is_turbo) { + if (inst->clk_data.buffer_counter < DCVS_FTB_WINDOW || is_turbo || + is_turbo_session(inst)) { inst->clk_data.min_freq = msm_vidc_max_freq(inst->core, inst->sid); inst->clk_data.dcvs_flags = 0;