msm: vidc: always use HQ for HEIC and lossless encoder

Always use HQ mode for HEIC and lossless encoder.
Refine FW version retrieve to support version
string start with lower case v.

Change-Id: I092956b34250da55a4cfc2c7b88815c05a64375f
Signed-off-by: Qiwei Liu <qiweil@codeaurora.org>
This commit is contained in:
Qiwei Liu 2020-09-18 22:25:35 +08:00
commit 3486a7e10a
2 changed files with 8 additions and 4 deletions

View file

@ -3993,16 +3993,17 @@ static int venus_hfi_get_fw_info(void *dev, struct hal_fw_info *fw_info)
smem_table_ptr + smem_image_index_venus,
VENUS_VERSION_LENGTH);
while (version[i++] != 'V' && i < VENUS_VERSION_LENGTH)
while (version[i] != 'V' && version[i] != 'v' &&
++i < VENUS_VERSION_LENGTH)
;
if (i == VENUS_VERSION_LENGTH - 1) {
if (i >= VENUS_VERSION_LENGTH - 1) {
d_vpr_e("Venus version string is not proper\n");
fw_info->version[0] = '\0';
goto fail_version_string;
}
for (i--; i < VENUS_VERSION_LENGTH && j < VENUS_VERSION_LENGTH - 1; i++)
for (; i < VENUS_VERSION_LENGTH && j < VENUS_VERSION_LENGTH - 1; i++)
fw_info->version[j++] = version[i];
fw_info->version[j] = '\0';

View file

@ -1462,7 +1462,10 @@ int msm_vidc_decide_core_and_power_mode_iris2(struct msm_vidc_inst *inst)
max_hq_mbpf = inst->core->resources.max_hq_mbs_per_frame;
max_hq_mbps = inst->core->resources.max_hq_mbs_per_sec;
if (mbpf <= max_hq_mbpf && mbps <= max_hq_mbps)
/* Power saving always disabled for CQ and LOSSLESS RC modes. */
if (inst->rc_type == V4L2_MPEG_VIDEO_BITRATE_MODE_CQ ||
inst->rc_type == RATE_CONTROL_LOSSLESS ||
(mbpf <= max_hq_mbpf && mbps <= max_hq_mbps))
enable = false;
rc = msm_vidc_power_save_mode_enable(inst, enable);