Merge "video: driver: operating rate changes for latency improvements"
Цей коміт міститься в:

зафіксовано
Gerrit - the friendly Code Review server

коміт
8c6659988d
@@ -537,19 +537,11 @@ static struct msm_platform_inst_capability instance_cap_data_pineapple[] = {
|
||||
CAP_FLAG_INPUT_PORT | CAP_FLAG_DYNAMIC_ALLOWED},
|
||||
|
||||
{OPERATING_RATE, ENC, CODECS_ALL,
|
||||
(MINIMUM_FPS << 16), (MAXIMUM_FPS << 16),
|
||||
(MINIMUM_FPS << 16), INT_MAX,
|
||||
1, (DEFAULT_FPS << 16)},
|
||||
|
||||
{OPERATING_RATE, DEC, CODECS_ALL,
|
||||
(MINIMUM_FPS << 16), (MAXIMUM_DEC_FPS << 16),
|
||||
1, (DEFAULT_FPS << 16),
|
||||
V4L2_CID_MPEG_VIDC_OPERATING_RATE,
|
||||
0,
|
||||
CAP_FLAG_OUTPUT_PORT |
|
||||
CAP_FLAG_INPUT_PORT | CAP_FLAG_DYNAMIC_ALLOWED},
|
||||
|
||||
{OPERATING_RATE, DEC, VP9,
|
||||
(MINIMUM_FPS << 16), (MAXIMUM_OVERRIDE_VP9_FPS << 16),
|
||||
(MINIMUM_FPS << 16), INT_MAX,
|
||||
1, (DEFAULT_FPS << 16),
|
||||
V4L2_CID_MPEG_VIDC_OPERATING_RATE,
|
||||
0,
|
||||
|
@@ -452,18 +452,22 @@ static u64 msm_vidc_calc_freq_iris33_new(struct msm_vidc_inst *inst, u32 data_si
|
||||
|
||||
freq = (u64)codec_output.hw_min_freq * 1000000; /* Convert to Hz */
|
||||
|
||||
i_vpr_p(inst, "%s: filled len %d, required freq %llu, vpp %u, vsp %u, tensilica %u, hw_freq %u, fps %u, mbpf %u\n",
|
||||
i_vpr_p(inst,
|
||||
"%s: filled len %d, required freq %llu, vpp %u, vsp %u, tensilica %u, hw_freq %u, fps %u, mbpf %u\n",
|
||||
__func__, data_size, freq, codec_output.vpp_min_freq,
|
||||
codec_output.vsp_min_freq, codec_output.tensilica_min_freq,
|
||||
codec_output.hw_min_freq, fps, mbpf);
|
||||
|
||||
if (inst->codec == MSM_VIDC_AV1 || (inst->iframe && is_hevc_10bit_decode_session(inst)) ||
|
||||
(!is_realtime_session(inst))) {
|
||||
if (!is_realtime_session(inst) ||
|
||||
inst->codec == MSM_VIDC_AV1 ||
|
||||
is_lowlatency_session(inst) ||
|
||||
(inst->iframe && is_hevc_10bit_decode_session(inst))) {
|
||||
/*
|
||||
* TURBO is only allowed for:
|
||||
* 1. AV1 decoding session
|
||||
* 2. 10-bit I-Frame decoding session
|
||||
* 3. NRT decoding/encoding session
|
||||
* - NRT decoding/encoding session
|
||||
* - AV1 decoding session
|
||||
* - Low latency session
|
||||
* - 10-bit I-Frame decoding session
|
||||
* limit to NOM for all other cases
|
||||
*/
|
||||
} else {
|
||||
|
@@ -567,7 +567,6 @@ int msm_vidc_update_debug_str(struct msm_vidc_inst *inst);
|
||||
void msm_vidc_allow_dcvs(struct msm_vidc_inst *inst);
|
||||
bool msm_vidc_allow_decode_batch(struct msm_vidc_inst *inst);
|
||||
int msm_vidc_check_session_supported(struct msm_vidc_inst *inst);
|
||||
bool msm_vidc_ignore_session_load(struct msm_vidc_inst *inst);
|
||||
int msm_vidc_check_core_mbps(struct msm_vidc_inst *inst);
|
||||
int msm_vidc_check_core_mbpf(struct msm_vidc_inst *inst);
|
||||
int msm_vidc_check_scaling_supported(struct msm_vidc_inst *inst);
|
||||
|
@@ -251,7 +251,6 @@ static inline int __bpp(enum msm_vidc_colorformat_type f)
|
||||
}
|
||||
|
||||
u64 msm_vidc_max_freq(struct msm_vidc_inst* inst);
|
||||
int msm_vidc_get_inst_load(struct msm_vidc_inst *inst);
|
||||
int msm_vidc_scale_power(struct msm_vidc_inst *inst, bool scale_buses);
|
||||
void msm_vidc_power_data_reset(struct msm_vidc_inst *inst);
|
||||
|
||||
|
@@ -5408,7 +5408,37 @@ static int msm_vidc_print_insts_info(struct msm_vidc_core *core)
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool msm_vidc_ignore_session_load(struct msm_vidc_inst *inst) {
|
||||
static int msm_vidc_get_inst_load(struct msm_vidc_inst *inst)
|
||||
{
|
||||
u32 mbpf, fps;
|
||||
u32 input_rate, timestamp_rate, operating_rate;
|
||||
|
||||
if (!inst) {
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
/*
|
||||
* Encoder: consider frame rate
|
||||
* Decoder: consider max(frame rate, operating rate,
|
||||
* timestamp rate, input queue rate)
|
||||
*/
|
||||
mbpf = msm_vidc_get_mbs_per_frame(inst);
|
||||
fps = msm_vidc_get_frame_rate(inst);
|
||||
|
||||
if (is_decode_session(inst)) {
|
||||
input_rate = msm_vidc_get_input_rate(inst);
|
||||
timestamp_rate = msm_vidc_get_timestamp_rate(inst);
|
||||
operating_rate = msm_vidc_get_operating_rate(inst);
|
||||
fps = max(fps, operating_rate);
|
||||
fps = max(fps, input_rate);
|
||||
fps = max(fps, timestamp_rate);
|
||||
}
|
||||
|
||||
return mbpf * fps;
|
||||
}
|
||||
|
||||
static bool msm_vidc_ignore_session_load(struct msm_vidc_inst *inst) {
|
||||
|
||||
if (!inst) {
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
@@ -5416,7 +5446,7 @@ bool msm_vidc_ignore_session_load(struct msm_vidc_inst *inst) {
|
||||
}
|
||||
|
||||
if (!is_realtime_session(inst) || is_thumbnail_session(inst) ||
|
||||
is_image_session(inst))
|
||||
is_image_session(inst) || is_session_error(inst))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
@@ -5424,8 +5454,7 @@ bool msm_vidc_ignore_session_load(struct msm_vidc_inst *inst) {
|
||||
|
||||
int msm_vidc_check_core_mbps(struct msm_vidc_inst *inst)
|
||||
{
|
||||
u32 mbps = 0, total_mbps = 0, enc_mbps = 0;
|
||||
u32 critical_mbps = 0;
|
||||
u64 mbps = 0, total_mbps = 0, enc_mbps = 0, critical_mbps = 0;
|
||||
struct msm_vidc_core *core;
|
||||
struct msm_vidc_inst *instance;
|
||||
|
||||
@@ -5438,9 +5467,9 @@ int msm_vidc_check_core_mbps(struct msm_vidc_inst *inst)
|
||||
/* skip mbps check for non-realtime, thumnail, image sessions */
|
||||
if (msm_vidc_ignore_session_load(inst)) {
|
||||
i_vpr_h(inst,
|
||||
"%s: skip mbps check due to NRT %d, TH %d, IMG %d\n", __func__,
|
||||
!is_realtime_session(inst), is_thumbnail_session(inst),
|
||||
is_image_session(inst));
|
||||
"%s: skip mbps check due to NRT %d, TH %d, IMG %d, error session %d\n",
|
||||
__func__, !is_realtime_session(inst), is_thumbnail_session(inst),
|
||||
is_image_session(inst), is_session_error(inst));
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -5459,11 +5488,8 @@ int msm_vidc_check_core_mbps(struct msm_vidc_inst *inst)
|
||||
|
||||
core_lock(core, __func__);
|
||||
list_for_each_entry(instance, &core->instances, list) {
|
||||
/* ignore invalid/error session */
|
||||
if (is_session_error(instance))
|
||||
continue;
|
||||
|
||||
/* ignore thumbnail, image, and non realtime sessions */
|
||||
/* ignore thumbnail, image, non realtime, error sessions */
|
||||
if (msm_vidc_ignore_session_load(instance))
|
||||
continue;
|
||||
|
||||
@@ -5498,6 +5524,10 @@ int msm_vidc_check_core_mbps(struct msm_vidc_inst *inst)
|
||||
core_unlock(core, __func__);
|
||||
}
|
||||
} else if (is_decode_session(inst)){
|
||||
/*
|
||||
* if total_mbps is greater than max_mbps then allow this
|
||||
* decoder by reducing its piority (moving it to NRT)
|
||||
*/
|
||||
if (total_mbps > core->capabilities[MAX_MBPS].value) {
|
||||
inst->adjust_priority = RT_DEC_DOWN_PRORITY_OFFSET;
|
||||
i_vpr_h(inst, "%s: pending adjust priority by %d\n",
|
||||
|
@@ -112,36 +112,6 @@ u64 msm_vidc_max_freq(struct msm_vidc_inst *inst)
|
||||
return freq;
|
||||
}
|
||||
|
||||
int msm_vidc_get_inst_load(struct msm_vidc_inst *inst)
|
||||
{
|
||||
u32 mbpf, fps;
|
||||
u32 frame_rate, operating_rate, input_rate, timestamp_rate;
|
||||
|
||||
if (!inst) {
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
/* return zero load for thumbnail and NRT session */
|
||||
if (is_thumbnail_session(inst) || !is_realtime_session(inst))
|
||||
return 0;
|
||||
|
||||
/* calculate load for RT session */
|
||||
mbpf = msm_vidc_get_mbs_per_frame(inst);
|
||||
frame_rate = msm_vidc_get_frame_rate(inst);
|
||||
operating_rate = msm_vidc_get_operating_rate(inst);
|
||||
fps = max(frame_rate, operating_rate);
|
||||
|
||||
if (is_decode_session(inst)) {
|
||||
input_rate = msm_vidc_get_input_rate(inst);
|
||||
timestamp_rate = msm_vidc_get_timestamp_rate(inst);
|
||||
fps = max(fps, input_rate);
|
||||
fps = max(fps, timestamp_rate);
|
||||
}
|
||||
|
||||
return mbpf * fps;
|
||||
}
|
||||
|
||||
static int fill_dynamic_stats(struct msm_vidc_inst *inst,
|
||||
struct vidc_bus_vote_data *vote_data)
|
||||
{
|
||||
|
Посилання в новій задачі
Заблокувати користувача