Loading drivers/media/platform/msm/vidc/msm_vidc_clocks.c +23 −11 Original line number Original line Diff line number Diff line Loading @@ -100,6 +100,19 @@ int msm_vidc_get_mbs_per_frame(struct msm_vidc_inst *inst) return NUM_MBS_PER_FRAME(height, width); return NUM_MBS_PER_FRAME(height, width); } } static int msm_vidc_get_fps(struct msm_vidc_inst *inst) { int fps; if ((inst->clk_data.operating_rate >> 16) > inst->prop.fps) fps = (inst->clk_data.operating_rate >> 16) ? (inst->clk_data.operating_rate >> 16) : 1; else fps = inst->prop.fps; return fps; } void update_recon_stats(struct msm_vidc_inst *inst, void update_recon_stats(struct msm_vidc_inst *inst, struct recon_stats_type *recon_stats) struct recon_stats_type *recon_stats) { { Loading Loading @@ -284,12 +297,7 @@ int msm_comm_vote_bus(struct msm_vidc_core *core) msm_comm_g_ctrl_for_id(inst, msm_comm_g_ctrl_for_id(inst, V4L2_CID_MPEG_VIDC_VIDEO_NUM_B_FRAMES) != 0; V4L2_CID_MPEG_VIDC_VIDEO_NUM_B_FRAMES) != 0; if (inst->clk_data.operating_rate) vote_data[i].fps = msm_vidc_get_fps(inst); vote_data[i].fps = (inst->clk_data.operating_rate >> 16) ? inst->clk_data.operating_rate >> 16 : 1; else vote_data[i].fps = inst->prop.fps; vote_data[i].power_mode = 0; vote_data[i].power_mode = 0; if (msm_vidc_clock_voting || is_turbo || if (msm_vidc_clock_voting || is_turbo || Loading Loading @@ -609,7 +617,7 @@ static unsigned long msm_vidc_calc_freq_ar50(struct msm_vidc_inst *inst, struct msm_vidc_core *core = NULL; struct msm_vidc_core *core = NULL; int i = 0; int i = 0; struct allowed_clock_rates_table *allowed_clks_tbl = NULL; struct allowed_clock_rates_table *allowed_clks_tbl = NULL; u64 rate = 0; u64 rate = 0, fps; struct clock_data *dcvs = NULL; struct clock_data *dcvs = NULL; core = inst->core; core = inst->core; Loading @@ -618,6 +626,8 @@ static unsigned long msm_vidc_calc_freq_ar50(struct msm_vidc_inst *inst, mbs_per_second = msm_comm_get_inst_load_per_core(inst, mbs_per_second = msm_comm_get_inst_load_per_core(inst, LOAD_CALC_NO_QUIRKS); LOAD_CALC_NO_QUIRKS); fps = msm_vidc_get_fps(inst); /* /* * Calculate vpp, vsp cycles separately for encoder and decoder. * Calculate vpp, vsp cycles separately for encoder and decoder. * Even though, most part is common now, in future it may change * Even though, most part is common now, in future it may change Loading @@ -640,7 +650,7 @@ static unsigned long msm_vidc_calc_freq_ar50(struct msm_vidc_inst *inst, vsp_cycles = mbs_per_second * inst->clk_data.entry->vsp_cycles; vsp_cycles = mbs_per_second * inst->clk_data.entry->vsp_cycles; /* 10 / 7 is overhead factor */ /* 10 / 7 is overhead factor */ vsp_cycles += ((inst->prop.fps * filled_len * 8) * 10) / 7; vsp_cycles += ((fps * filled_len * 8) * 10) / 7; } else { } else { dprintk(VIDC_ERR, "Unknown session type = %s\n", __func__); dprintk(VIDC_ERR, "Unknown session type = %s\n", __func__); Loading Loading @@ -681,7 +691,7 @@ static unsigned long msm_vidc_calc_freq(struct msm_vidc_inst *inst, struct msm_vidc_core *core = NULL; struct msm_vidc_core *core = NULL; int i = 0; int i = 0; struct allowed_clock_rates_table *allowed_clks_tbl = NULL; struct allowed_clock_rates_table *allowed_clks_tbl = NULL; u64 rate = 0; u64 rate = 0, fps; struct clock_data *dcvs = NULL; struct clock_data *dcvs = NULL; u32 operating_rate, vsp_factor_num = 10, vsp_factor_den = 7; u32 operating_rate, vsp_factor_num = 10, vsp_factor_den = 7; Loading @@ -691,6 +701,8 @@ static unsigned long msm_vidc_calc_freq(struct msm_vidc_inst *inst, mbs_per_second = msm_comm_get_inst_load_per_core(inst, mbs_per_second = msm_comm_get_inst_load_per_core(inst, LOAD_CALC_NO_QUIRKS); LOAD_CALC_NO_QUIRKS); fps = msm_vidc_get_fps(inst); /* /* * Calculate vpp, vsp cycles separately for encoder and decoder. * Calculate vpp, vsp cycles separately for encoder and decoder. * Even though, most part is common now, in future it may change * Even though, most part is common now, in future it may change Loading Loading @@ -726,7 +738,7 @@ static unsigned long msm_vidc_calc_freq(struct msm_vidc_inst *inst, vsp_cycles = mbs_per_second * inst->clk_data.entry->vsp_cycles; vsp_cycles = mbs_per_second * inst->clk_data.entry->vsp_cycles; /* 10 / 7 is overhead factor */ /* 10 / 7 is overhead factor */ vsp_cycles += ((inst->prop.fps * filled_len * 8) * 10) / 7; vsp_cycles += ((fps * filled_len * 8) * 10) / 7; } else { } else { dprintk(VIDC_ERR, "Unknown session type = %s\n", __func__); dprintk(VIDC_ERR, "Unknown session type = %s\n", __func__); Loading Loading @@ -1373,7 +1385,7 @@ static inline int msm_vidc_power_save_mode_enable(struct msm_vidc_inst *inst, } } mbs_per_frame = msm_vidc_get_mbs_per_frame(inst); mbs_per_frame = msm_vidc_get_mbs_per_frame(inst); if (mbs_per_frame > inst->core->resources.max_hq_mbs_per_frame || if (mbs_per_frame > inst->core->resources.max_hq_mbs_per_frame || inst->prop.fps > inst->core->resources.max_hq_fps) { msm_vidc_get_fps(inst) > inst->core->resources.max_hq_fps) { enable = true; enable = true; } } Loading drivers/media/platform/msm/vidc/msm_vidc_common.c +5 −10 Original line number Original line Diff line number Diff line Loading @@ -733,18 +733,13 @@ static int msm_comm_get_mbs_per_sec(struct msm_vidc_inst *inst) capture_port_mbs = NUM_MBS_PER_FRAME(inst->prop.width[CAPTURE_PORT], capture_port_mbs = NUM_MBS_PER_FRAME(inst->prop.width[CAPTURE_PORT], inst->prop.height[CAPTURE_PORT]); inst->prop.height[CAPTURE_PORT]); if (inst->clk_data.operating_rate) { if ((inst->clk_data.operating_rate >> 16) > inst->prop.fps) fps = (inst->clk_data.operating_rate >> 16) ? fps = (inst->clk_data.operating_rate >> 16) ? inst->clk_data.operating_rate >> 16 : 1; inst->clk_data.operating_rate >> 16 : 1; /* else * Check if operating rate is less than fps. fps = inst->prop.fps; * If Yes, then use fps to scale clocks */ fps = fps > inst->prop.fps ? fps : inst->prop.fps; return max(output_port_mbs, capture_port_mbs) * fps; return max(output_port_mbs, capture_port_mbs) * fps; } else { return max(output_port_mbs, capture_port_mbs) * inst->prop.fps; } } } int msm_comm_get_inst_load(struct msm_vidc_inst *inst, int msm_comm_get_inst_load(struct msm_vidc_inst *inst, Loading Loading
drivers/media/platform/msm/vidc/msm_vidc_clocks.c +23 −11 Original line number Original line Diff line number Diff line Loading @@ -100,6 +100,19 @@ int msm_vidc_get_mbs_per_frame(struct msm_vidc_inst *inst) return NUM_MBS_PER_FRAME(height, width); return NUM_MBS_PER_FRAME(height, width); } } static int msm_vidc_get_fps(struct msm_vidc_inst *inst) { int fps; if ((inst->clk_data.operating_rate >> 16) > inst->prop.fps) fps = (inst->clk_data.operating_rate >> 16) ? (inst->clk_data.operating_rate >> 16) : 1; else fps = inst->prop.fps; return fps; } void update_recon_stats(struct msm_vidc_inst *inst, void update_recon_stats(struct msm_vidc_inst *inst, struct recon_stats_type *recon_stats) struct recon_stats_type *recon_stats) { { Loading Loading @@ -284,12 +297,7 @@ int msm_comm_vote_bus(struct msm_vidc_core *core) msm_comm_g_ctrl_for_id(inst, msm_comm_g_ctrl_for_id(inst, V4L2_CID_MPEG_VIDC_VIDEO_NUM_B_FRAMES) != 0; V4L2_CID_MPEG_VIDC_VIDEO_NUM_B_FRAMES) != 0; if (inst->clk_data.operating_rate) vote_data[i].fps = msm_vidc_get_fps(inst); vote_data[i].fps = (inst->clk_data.operating_rate >> 16) ? inst->clk_data.operating_rate >> 16 : 1; else vote_data[i].fps = inst->prop.fps; vote_data[i].power_mode = 0; vote_data[i].power_mode = 0; if (msm_vidc_clock_voting || is_turbo || if (msm_vidc_clock_voting || is_turbo || Loading Loading @@ -609,7 +617,7 @@ static unsigned long msm_vidc_calc_freq_ar50(struct msm_vidc_inst *inst, struct msm_vidc_core *core = NULL; struct msm_vidc_core *core = NULL; int i = 0; int i = 0; struct allowed_clock_rates_table *allowed_clks_tbl = NULL; struct allowed_clock_rates_table *allowed_clks_tbl = NULL; u64 rate = 0; u64 rate = 0, fps; struct clock_data *dcvs = NULL; struct clock_data *dcvs = NULL; core = inst->core; core = inst->core; Loading @@ -618,6 +626,8 @@ static unsigned long msm_vidc_calc_freq_ar50(struct msm_vidc_inst *inst, mbs_per_second = msm_comm_get_inst_load_per_core(inst, mbs_per_second = msm_comm_get_inst_load_per_core(inst, LOAD_CALC_NO_QUIRKS); LOAD_CALC_NO_QUIRKS); fps = msm_vidc_get_fps(inst); /* /* * Calculate vpp, vsp cycles separately for encoder and decoder. * Calculate vpp, vsp cycles separately for encoder and decoder. * Even though, most part is common now, in future it may change * Even though, most part is common now, in future it may change Loading @@ -640,7 +650,7 @@ static unsigned long msm_vidc_calc_freq_ar50(struct msm_vidc_inst *inst, vsp_cycles = mbs_per_second * inst->clk_data.entry->vsp_cycles; vsp_cycles = mbs_per_second * inst->clk_data.entry->vsp_cycles; /* 10 / 7 is overhead factor */ /* 10 / 7 is overhead factor */ vsp_cycles += ((inst->prop.fps * filled_len * 8) * 10) / 7; vsp_cycles += ((fps * filled_len * 8) * 10) / 7; } else { } else { dprintk(VIDC_ERR, "Unknown session type = %s\n", __func__); dprintk(VIDC_ERR, "Unknown session type = %s\n", __func__); Loading Loading @@ -681,7 +691,7 @@ static unsigned long msm_vidc_calc_freq(struct msm_vidc_inst *inst, struct msm_vidc_core *core = NULL; struct msm_vidc_core *core = NULL; int i = 0; int i = 0; struct allowed_clock_rates_table *allowed_clks_tbl = NULL; struct allowed_clock_rates_table *allowed_clks_tbl = NULL; u64 rate = 0; u64 rate = 0, fps; struct clock_data *dcvs = NULL; struct clock_data *dcvs = NULL; u32 operating_rate, vsp_factor_num = 10, vsp_factor_den = 7; u32 operating_rate, vsp_factor_num = 10, vsp_factor_den = 7; Loading @@ -691,6 +701,8 @@ static unsigned long msm_vidc_calc_freq(struct msm_vidc_inst *inst, mbs_per_second = msm_comm_get_inst_load_per_core(inst, mbs_per_second = msm_comm_get_inst_load_per_core(inst, LOAD_CALC_NO_QUIRKS); LOAD_CALC_NO_QUIRKS); fps = msm_vidc_get_fps(inst); /* /* * Calculate vpp, vsp cycles separately for encoder and decoder. * Calculate vpp, vsp cycles separately for encoder and decoder. * Even though, most part is common now, in future it may change * Even though, most part is common now, in future it may change Loading Loading @@ -726,7 +738,7 @@ static unsigned long msm_vidc_calc_freq(struct msm_vidc_inst *inst, vsp_cycles = mbs_per_second * inst->clk_data.entry->vsp_cycles; vsp_cycles = mbs_per_second * inst->clk_data.entry->vsp_cycles; /* 10 / 7 is overhead factor */ /* 10 / 7 is overhead factor */ vsp_cycles += ((inst->prop.fps * filled_len * 8) * 10) / 7; vsp_cycles += ((fps * filled_len * 8) * 10) / 7; } else { } else { dprintk(VIDC_ERR, "Unknown session type = %s\n", __func__); dprintk(VIDC_ERR, "Unknown session type = %s\n", __func__); Loading Loading @@ -1373,7 +1385,7 @@ static inline int msm_vidc_power_save_mode_enable(struct msm_vidc_inst *inst, } } mbs_per_frame = msm_vidc_get_mbs_per_frame(inst); mbs_per_frame = msm_vidc_get_mbs_per_frame(inst); if (mbs_per_frame > inst->core->resources.max_hq_mbs_per_frame || if (mbs_per_frame > inst->core->resources.max_hq_mbs_per_frame || inst->prop.fps > inst->core->resources.max_hq_fps) { msm_vidc_get_fps(inst) > inst->core->resources.max_hq_fps) { enable = true; enable = true; } } Loading
drivers/media/platform/msm/vidc/msm_vidc_common.c +5 −10 Original line number Original line Diff line number Diff line Loading @@ -733,18 +733,13 @@ static int msm_comm_get_mbs_per_sec(struct msm_vidc_inst *inst) capture_port_mbs = NUM_MBS_PER_FRAME(inst->prop.width[CAPTURE_PORT], capture_port_mbs = NUM_MBS_PER_FRAME(inst->prop.width[CAPTURE_PORT], inst->prop.height[CAPTURE_PORT]); inst->prop.height[CAPTURE_PORT]); if (inst->clk_data.operating_rate) { if ((inst->clk_data.operating_rate >> 16) > inst->prop.fps) fps = (inst->clk_data.operating_rate >> 16) ? fps = (inst->clk_data.operating_rate >> 16) ? inst->clk_data.operating_rate >> 16 : 1; inst->clk_data.operating_rate >> 16 : 1; /* else * Check if operating rate is less than fps. fps = inst->prop.fps; * If Yes, then use fps to scale clocks */ fps = fps > inst->prop.fps ? fps : inst->prop.fps; return max(output_port_mbs, capture_port_mbs) * fps; return max(output_port_mbs, capture_port_mbs) * fps; } else { return max(output_port_mbs, capture_port_mbs) * inst->prop.fps; } } } int msm_comm_get_inst_load(struct msm_vidc_inst *inst, int msm_comm_get_inst_load(struct msm_vidc_inst *inst, Loading