Loading drivers/media/platform/msm/vidc/governors/msm_vidc_dyn_gov.c +2 −4 Original line number Diff line number Diff line Loading @@ -446,8 +446,7 @@ static unsigned long __calculate_decoder(struct vidc_bus_vote_data *d, bitrate = (d->bitrate + 1000000 - 1) / 1000000; bins_to_bit_factor = d->work_mode == VIDC_WORK_MODE_1 ? FP_INT(0) : FP_INT(4); bins_to_bit_factor = FP_INT(4); vsp_write_factor = bins_to_bit_factor; vsp_read_factor = bins_to_bit_factor + FP_INT(2); Loading Loading @@ -684,8 +683,7 @@ static unsigned long __calculate_encoder(struct vidc_bus_vote_data *d, work_mode_1 = d->work_mode == VIDC_WORK_MODE_1; low_power = d->power_mode == VIDC_POWER_LOW; bins_to_bit_factor = work_mode_1 ? FP_INT(0) : FP_INT(4); bins_to_bit_factor = FP_INT(4); if (d->use_sys_cache) { llc_ref_chroma_cache_enabled = true; Loading drivers/media/platform/msm/vidc/msm_vidc_clocks.c +22 −13 Original line number Diff line number Diff line Loading @@ -551,6 +551,7 @@ static unsigned long msm_vidc_calc_freq_ar50(struct msm_vidc_inst *inst, { unsigned long freq = 0; unsigned long vpp_cycles = 0, vsp_cycles = 0; unsigned long fw_cycles = 0, fw_vpp_cycles = 0; u32 vpp_cycles_per_mb; u32 mbs_per_second; struct msm_vidc_core *core = NULL; Loading @@ -573,12 +574,17 @@ static unsigned long msm_vidc_calc_freq_ar50(struct msm_vidc_inst *inst, * between them. */ fw_cycles = fps * inst->core->resources.fw_cycles; fw_vpp_cycles = fps * inst->core->resources.fw_vpp_cycles; if (inst->session_type == MSM_VIDC_ENCODER) { vpp_cycles_per_mb = inst->flags & VIDC_LOW_POWER ? inst->clk_data.entry->low_power_cycles : inst->clk_data.entry->vpp_cycles; vpp_cycles = mbs_per_second * vpp_cycles_per_mb; /* 21 / 20 is minimum overhead factor */ vpp_cycles += max(vpp_cycles / 20, fw_vpp_cycles); vsp_cycles = mbs_per_second * inst->clk_data.entry->vsp_cycles; Loading @@ -586,6 +592,8 @@ static unsigned long msm_vidc_calc_freq_ar50(struct msm_vidc_inst *inst, vsp_cycles += (inst->clk_data.bitrate * 10) / 7; } else if (inst->session_type == MSM_VIDC_DECODER) { vpp_cycles = mbs_per_second * inst->clk_data.entry->vpp_cycles; /* 21 / 20 is minimum overhead factor */ vpp_cycles += max(vpp_cycles / 20, fw_vpp_cycles); vsp_cycles = mbs_per_second * inst->clk_data.entry->vsp_cycles; /* 10 / 7 is overhead factor */ Loading @@ -597,6 +605,7 @@ static unsigned long msm_vidc_calc_freq_ar50(struct msm_vidc_inst *inst, } freq = max(vpp_cycles, vsp_cycles); freq = max(freq, fw_cycles); dprintk(VIDC_DBG, "Update DCVS Load\n"); allowed_clks_tbl = core->resources.allowed_clks_tbl; Loading Loading @@ -624,7 +633,8 @@ static unsigned long msm_vidc_calc_freq(struct msm_vidc_inst *inst, u32 filled_len) { unsigned long freq = 0; unsigned long vpp_cycles = 0, vsp_cycles = 0, fw_cycles = 0; unsigned long vpp_cycles = 0, vsp_cycles = 0; unsigned long fw_cycles = 0, fw_vpp_cycles = 0; u32 vpp_cycles_per_mb; u32 mbs_per_second; struct msm_vidc_core *core = NULL; Loading @@ -648,15 +658,18 @@ static unsigned long msm_vidc_calc_freq(struct msm_vidc_inst *inst, * between them. */ fw_cycles = fps * inst->core->resources.fw_cycles; fw_vpp_cycles = fps * inst->core->resources.fw_vpp_cycles; if (inst->session_type == MSM_VIDC_ENCODER) { vpp_cycles_per_mb = inst->flags & VIDC_LOW_POWER ? inst->clk_data.entry->low_power_cycles : inst->clk_data.entry->vpp_cycles; vpp_cycles = mbs_per_second * vpp_cycles_per_mb; /* 21 / 20 is overhead factor */ vpp_cycles = (vpp_cycles * 21)/ (inst->clk_data.work_route * 20); vpp_cycles = mbs_per_second * vpp_cycles_per_mb / inst->clk_data.work_route; /* 21 / 20 is minimum overhead factor */ vpp_cycles += max(vpp_cycles / 20, fw_vpp_cycles); vsp_cycles = mbs_per_second * inst->clk_data.entry->vsp_cycles; Loading @@ -669,21 +682,17 @@ static unsigned long msm_vidc_calc_freq(struct msm_vidc_inst *inst, vsp_cycles += ((u64)inst->clk_data.bitrate * vsp_factor_num) / vsp_factor_den; fw_cycles = fps * inst->core->resources.fw_cycles; } else if (inst->session_type == MSM_VIDC_DECODER) { vpp_cycles = mbs_per_second * inst->clk_data.entry->vpp_cycles; /* 21 / 20 is overhead factor */ vpp_cycles = (vpp_cycles * 21)/ (inst->clk_data.work_route * 20); vpp_cycles = mbs_per_second * inst->clk_data.entry->vpp_cycles / inst->clk_data.work_route; /* 21 / 20 is minimum overhead factor */ vpp_cycles += max(vpp_cycles / 20, fw_vpp_cycles); vsp_cycles = mbs_per_second * inst->clk_data.entry->vsp_cycles; /* vsp perf is about 0.5 bits/cycle */ vsp_cycles += ((fps * filled_len * 8) * 10) / 5; fw_cycles = fps * inst->core->resources.fw_cycles; } else { dprintk(VIDC_ERR, "Unknown session type = %s\n", __func__); return msm_vidc_max_freq(inst->core); Loading drivers/media/platform/msm/vidc/msm_vidc_platform.c +18 −2 Original line number Diff line number Diff line Loading @@ -195,6 +195,10 @@ static struct msm_vidc_common_data sm6150_common_data[] = { .key = "qcom,fw-cycles", .value = 733003, }, { .key = "qcom,fw-vpp-cycles", .value = 225975, }, }; static struct msm_vidc_common_data sm8150_common_data[] = { Loading Loading @@ -274,6 +278,10 @@ static struct msm_vidc_common_data sm8150_common_data[] = { .key = "qcom,fw-cycles", .value = 760000, }, { .key = "qcom,fw-vpp-cycles", .value = 166667, }, }; static struct msm_vidc_common_data sdmmagpie_common_data_v0[] = { Loading Loading @@ -346,7 +354,11 @@ static struct msm_vidc_common_data sdmmagpie_common_data_v0[] = { }, { .key = "qcom,fw-cycles", .value = 733003, .value = 760000, }, { .key = "qcom,fw-vpp-cycles", .value = 166667, }, }; Loading Loading @@ -420,7 +432,11 @@ static struct msm_vidc_common_data sdmmagpie_common_data_v1[] = { }, { .key = "qcom,fw-cycles", .value = 733003, .value = 760000, }, { .key = "qcom,fw-vpp-cycles", .value = 166667, }, }; Loading drivers/media/platform/msm/vidc/msm_vidc_res_parse.c +2 −0 Original line number Diff line number Diff line Loading @@ -801,6 +801,8 @@ int read_platform_resources_from_drv_data( "qcom,dcvs"); res->fw_cycles = find_key_value(platform_data, "qcom,fw-cycles"); res->fw_vpp_cycles = find_key_value(platform_data, "qcom,fw-vpp-cycles"); res->csc_coeff_data = &platform_data->csc_data; Loading drivers/media/platform/msm/vidc/msm_vidc_resources.h +1 −0 Original line number Diff line number Diff line Loading @@ -201,6 +201,7 @@ struct msm_vidc_platform_resources { struct msm_vidc_mem_cdsp mem_cdsp; uint32_t vpu_ver; uint32_t fw_cycles; uint32_t fw_vpp_cycles; uint32_t clk_freq_threshold; struct cx_ipeak_client *cx_ipeak_context; }; Loading Loading
drivers/media/platform/msm/vidc/governors/msm_vidc_dyn_gov.c +2 −4 Original line number Diff line number Diff line Loading @@ -446,8 +446,7 @@ static unsigned long __calculate_decoder(struct vidc_bus_vote_data *d, bitrate = (d->bitrate + 1000000 - 1) / 1000000; bins_to_bit_factor = d->work_mode == VIDC_WORK_MODE_1 ? FP_INT(0) : FP_INT(4); bins_to_bit_factor = FP_INT(4); vsp_write_factor = bins_to_bit_factor; vsp_read_factor = bins_to_bit_factor + FP_INT(2); Loading Loading @@ -684,8 +683,7 @@ static unsigned long __calculate_encoder(struct vidc_bus_vote_data *d, work_mode_1 = d->work_mode == VIDC_WORK_MODE_1; low_power = d->power_mode == VIDC_POWER_LOW; bins_to_bit_factor = work_mode_1 ? FP_INT(0) : FP_INT(4); bins_to_bit_factor = FP_INT(4); if (d->use_sys_cache) { llc_ref_chroma_cache_enabled = true; Loading
drivers/media/platform/msm/vidc/msm_vidc_clocks.c +22 −13 Original line number Diff line number Diff line Loading @@ -551,6 +551,7 @@ static unsigned long msm_vidc_calc_freq_ar50(struct msm_vidc_inst *inst, { unsigned long freq = 0; unsigned long vpp_cycles = 0, vsp_cycles = 0; unsigned long fw_cycles = 0, fw_vpp_cycles = 0; u32 vpp_cycles_per_mb; u32 mbs_per_second; struct msm_vidc_core *core = NULL; Loading @@ -573,12 +574,17 @@ static unsigned long msm_vidc_calc_freq_ar50(struct msm_vidc_inst *inst, * between them. */ fw_cycles = fps * inst->core->resources.fw_cycles; fw_vpp_cycles = fps * inst->core->resources.fw_vpp_cycles; if (inst->session_type == MSM_VIDC_ENCODER) { vpp_cycles_per_mb = inst->flags & VIDC_LOW_POWER ? inst->clk_data.entry->low_power_cycles : inst->clk_data.entry->vpp_cycles; vpp_cycles = mbs_per_second * vpp_cycles_per_mb; /* 21 / 20 is minimum overhead factor */ vpp_cycles += max(vpp_cycles / 20, fw_vpp_cycles); vsp_cycles = mbs_per_second * inst->clk_data.entry->vsp_cycles; Loading @@ -586,6 +592,8 @@ static unsigned long msm_vidc_calc_freq_ar50(struct msm_vidc_inst *inst, vsp_cycles += (inst->clk_data.bitrate * 10) / 7; } else if (inst->session_type == MSM_VIDC_DECODER) { vpp_cycles = mbs_per_second * inst->clk_data.entry->vpp_cycles; /* 21 / 20 is minimum overhead factor */ vpp_cycles += max(vpp_cycles / 20, fw_vpp_cycles); vsp_cycles = mbs_per_second * inst->clk_data.entry->vsp_cycles; /* 10 / 7 is overhead factor */ Loading @@ -597,6 +605,7 @@ static unsigned long msm_vidc_calc_freq_ar50(struct msm_vidc_inst *inst, } freq = max(vpp_cycles, vsp_cycles); freq = max(freq, fw_cycles); dprintk(VIDC_DBG, "Update DCVS Load\n"); allowed_clks_tbl = core->resources.allowed_clks_tbl; Loading Loading @@ -624,7 +633,8 @@ static unsigned long msm_vidc_calc_freq(struct msm_vidc_inst *inst, u32 filled_len) { unsigned long freq = 0; unsigned long vpp_cycles = 0, vsp_cycles = 0, fw_cycles = 0; unsigned long vpp_cycles = 0, vsp_cycles = 0; unsigned long fw_cycles = 0, fw_vpp_cycles = 0; u32 vpp_cycles_per_mb; u32 mbs_per_second; struct msm_vidc_core *core = NULL; Loading @@ -648,15 +658,18 @@ static unsigned long msm_vidc_calc_freq(struct msm_vidc_inst *inst, * between them. */ fw_cycles = fps * inst->core->resources.fw_cycles; fw_vpp_cycles = fps * inst->core->resources.fw_vpp_cycles; if (inst->session_type == MSM_VIDC_ENCODER) { vpp_cycles_per_mb = inst->flags & VIDC_LOW_POWER ? inst->clk_data.entry->low_power_cycles : inst->clk_data.entry->vpp_cycles; vpp_cycles = mbs_per_second * vpp_cycles_per_mb; /* 21 / 20 is overhead factor */ vpp_cycles = (vpp_cycles * 21)/ (inst->clk_data.work_route * 20); vpp_cycles = mbs_per_second * vpp_cycles_per_mb / inst->clk_data.work_route; /* 21 / 20 is minimum overhead factor */ vpp_cycles += max(vpp_cycles / 20, fw_vpp_cycles); vsp_cycles = mbs_per_second * inst->clk_data.entry->vsp_cycles; Loading @@ -669,21 +682,17 @@ static unsigned long msm_vidc_calc_freq(struct msm_vidc_inst *inst, vsp_cycles += ((u64)inst->clk_data.bitrate * vsp_factor_num) / vsp_factor_den; fw_cycles = fps * inst->core->resources.fw_cycles; } else if (inst->session_type == MSM_VIDC_DECODER) { vpp_cycles = mbs_per_second * inst->clk_data.entry->vpp_cycles; /* 21 / 20 is overhead factor */ vpp_cycles = (vpp_cycles * 21)/ (inst->clk_data.work_route * 20); vpp_cycles = mbs_per_second * inst->clk_data.entry->vpp_cycles / inst->clk_data.work_route; /* 21 / 20 is minimum overhead factor */ vpp_cycles += max(vpp_cycles / 20, fw_vpp_cycles); vsp_cycles = mbs_per_second * inst->clk_data.entry->vsp_cycles; /* vsp perf is about 0.5 bits/cycle */ vsp_cycles += ((fps * filled_len * 8) * 10) / 5; fw_cycles = fps * inst->core->resources.fw_cycles; } else { dprintk(VIDC_ERR, "Unknown session type = %s\n", __func__); return msm_vidc_max_freq(inst->core); Loading
drivers/media/platform/msm/vidc/msm_vidc_platform.c +18 −2 Original line number Diff line number Diff line Loading @@ -195,6 +195,10 @@ static struct msm_vidc_common_data sm6150_common_data[] = { .key = "qcom,fw-cycles", .value = 733003, }, { .key = "qcom,fw-vpp-cycles", .value = 225975, }, }; static struct msm_vidc_common_data sm8150_common_data[] = { Loading Loading @@ -274,6 +278,10 @@ static struct msm_vidc_common_data sm8150_common_data[] = { .key = "qcom,fw-cycles", .value = 760000, }, { .key = "qcom,fw-vpp-cycles", .value = 166667, }, }; static struct msm_vidc_common_data sdmmagpie_common_data_v0[] = { Loading Loading @@ -346,7 +354,11 @@ static struct msm_vidc_common_data sdmmagpie_common_data_v0[] = { }, { .key = "qcom,fw-cycles", .value = 733003, .value = 760000, }, { .key = "qcom,fw-vpp-cycles", .value = 166667, }, }; Loading Loading @@ -420,7 +432,11 @@ static struct msm_vidc_common_data sdmmagpie_common_data_v1[] = { }, { .key = "qcom,fw-cycles", .value = 733003, .value = 760000, }, { .key = "qcom,fw-vpp-cycles", .value = 166667, }, }; Loading
drivers/media/platform/msm/vidc/msm_vidc_res_parse.c +2 −0 Original line number Diff line number Diff line Loading @@ -801,6 +801,8 @@ int read_platform_resources_from_drv_data( "qcom,dcvs"); res->fw_cycles = find_key_value(platform_data, "qcom,fw-cycles"); res->fw_vpp_cycles = find_key_value(platform_data, "qcom,fw-vpp-cycles"); res->csc_coeff_data = &platform_data->csc_data; Loading
drivers/media/platform/msm/vidc/msm_vidc_resources.h +1 −0 Original line number Diff line number Diff line Loading @@ -201,6 +201,7 @@ struct msm_vidc_platform_resources { struct msm_vidc_mem_cdsp mem_cdsp; uint32_t vpu_ver; uint32_t fw_cycles; uint32_t fw_vpp_cycles; uint32_t clk_freq_threshold; struct cx_ipeak_client *cx_ipeak_context; }; Loading