Merge "video: driver: Enable CR and CF"
Этот коммит содержится в:

коммит произвёл
Gerrit - the friendly Code Review server

Коммит
74f2907a9f
@@ -729,6 +729,8 @@ struct msm_vidc_power {
|
||||
u32 ddr_bw;
|
||||
u32 sys_cache_bw;
|
||||
u32 dcvs_flags;
|
||||
u32 fw_cr;
|
||||
u32 fw_cf;
|
||||
};
|
||||
|
||||
struct msm_vidc_alloc {
|
||||
|
@@ -53,11 +53,16 @@ u32 msm_vdec_subscribe_for_psc_vp9[] = {
|
||||
HFI_PROP_LEVEL,
|
||||
};
|
||||
|
||||
u32 msm_vdec_subscribe_for_properties[] = {
|
||||
u32 msm_vdec_input_subscribe_for_properties[] = {
|
||||
HFI_PROP_NO_OUTPUT,
|
||||
HFI_PROP_CABAC_SESSION,
|
||||
};
|
||||
|
||||
u32 msm_vdec_output_subscribe_for_properties[] = {
|
||||
HFI_PROP_WORST_COMPRESSION_RATIO,
|
||||
HFI_PROP_WORST_COMPLEXITY_FACTOR,
|
||||
};
|
||||
|
||||
static int msm_vdec_codec_change(struct msm_vidc_inst *inst, u32 v4l2_codec)
|
||||
{
|
||||
int rc = 0;
|
||||
@@ -1105,6 +1110,7 @@ static int msm_vdec_subscribe_property(struct msm_vidc_inst *inst,
|
||||
struct msm_vidc_core *core;
|
||||
u32 payload[32] = {0};
|
||||
u32 i;
|
||||
u32 payload_size = 0;
|
||||
|
||||
if (!inst || !inst->core) {
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
@@ -1114,16 +1120,30 @@ static int msm_vdec_subscribe_property(struct msm_vidc_inst *inst,
|
||||
i_vpr_h(inst, "%s()\n", __func__);
|
||||
|
||||
payload[0] = HFI_MODE_PROPERTY;
|
||||
for (i = 0; i < ARRAY_SIZE(msm_vdec_subscribe_for_properties); i++)
|
||||
payload[i + 1] = msm_vdec_subscribe_for_properties[i];
|
||||
|
||||
if (port == INPUT_PORT) {
|
||||
for (i = 0; i < ARRAY_SIZE(msm_vdec_input_subscribe_for_properties); i++)
|
||||
payload[i + 1] = msm_vdec_input_subscribe_for_properties[i];
|
||||
payload_size = (ARRAY_SIZE(msm_vdec_input_subscribe_for_properties) + 1) *
|
||||
sizeof(u32);
|
||||
}
|
||||
else if (port == OUTPUT_PORT) {
|
||||
for (i = 0; i < ARRAY_SIZE(msm_vdec_output_subscribe_for_properties); i++)
|
||||
payload[i + 1] = msm_vdec_output_subscribe_for_properties[i];
|
||||
payload_size = (ARRAY_SIZE(msm_vdec_output_subscribe_for_properties) + 1) *
|
||||
sizeof(u32);
|
||||
}
|
||||
else {
|
||||
i_vpr_e(inst, "%s: invalid port: %d\n", __func__, port);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
rc = venus_hfi_session_command(inst,
|
||||
HFI_CMD_SUBSCRIBE_MODE,
|
||||
port,
|
||||
HFI_PAYLOAD_U32_ARRAY,
|
||||
&payload[0],
|
||||
(ARRAY_SIZE(msm_vdec_subscribe_for_properties) + 1) *
|
||||
sizeof(u32));
|
||||
payload_size);
|
||||
|
||||
return rc;
|
||||
}
|
||||
@@ -1765,6 +1785,10 @@ int msm_vdec_streamon_output(struct msm_vidc_inst *inst)
|
||||
inst->opsc_properties_set = true;
|
||||
}
|
||||
|
||||
rc = msm_vdec_subscribe_property(inst, OUTPUT_PORT);
|
||||
if (rc)
|
||||
return rc;
|
||||
|
||||
rc = msm_vdec_subscribe_metadata(inst, OUTPUT_PORT);
|
||||
if (rc)
|
||||
goto error;
|
||||
|
@@ -39,6 +39,7 @@ u32 msm_venc_input_subscribe_for_properties[] = {
|
||||
u32 msm_venc_output_subscribe_for_properties[] = {
|
||||
HFI_PROP_PICTURE_TYPE,
|
||||
HFI_PROP_BUFFER_MARK,
|
||||
HFI_PROP_WORST_COMPRESSION_RATIO,
|
||||
};
|
||||
|
||||
static int msm_venc_codec_change(struct msm_vidc_inst *inst, u32 v4l2_codec)
|
||||
|
@@ -14,6 +14,7 @@
|
||||
#include "msm_vidc_buffer.h"
|
||||
#include "venus_hfi.h"
|
||||
|
||||
/* Q16 Format */
|
||||
#define MSM_VIDC_MIN_UBWC_COMPLEXITY_FACTOR (1 << 16)
|
||||
#define MSM_VIDC_MAX_UBWC_COMPLEXITY_FACTOR (4 << 16)
|
||||
#define MSM_VIDC_MIN_UBWC_COMPRESSION_RATIO (1 << 16)
|
||||
@@ -123,17 +124,12 @@ static int fill_dynamic_stats(struct msm_vidc_inst *inst,
|
||||
u32 min_input_cr = MSM_VIDC_MAX_UBWC_COMPRESSION_RATIO;
|
||||
u32 min_cr = MSM_VIDC_MAX_UBWC_COMPRESSION_RATIO;
|
||||
|
||||
/* TODO: get ubwc stats from firmware
|
||||
if (inst->core->resources.ubwc_stats_in_fbd == 1) {
|
||||
mutex_lock(&inst->ubwc_stats_lock);
|
||||
if (inst->ubwc_stats.is_valid == 1) {
|
||||
min_cr = inst->ubwc_stats.worst_cr;
|
||||
max_cf = inst->ubwc_stats.worst_cf;
|
||||
min_input_cr = inst->ubwc_stats.worst_cr;
|
||||
}
|
||||
mutex_unlock(&inst->ubwc_stats_lock);
|
||||
}
|
||||
*/
|
||||
/* TODO: get ubwc stats from firmware */
|
||||
min_cr = inst->power.fw_cr;
|
||||
max_cf = inst->power.fw_cf;
|
||||
max_cf = max_cf / ((msm_vidc_get_mbs_per_frame(inst)) / (32 * 8) * 3) / 2;
|
||||
// Todo: min_input_cr = 0;
|
||||
|
||||
/* Sanitize CF values from HW */
|
||||
max_cf = min_t(u32, max_cf, MSM_VIDC_MAX_UBWC_COMPLEXITY_FACTOR);
|
||||
min_cf = max_t(u32, min_cf, MSM_VIDC_MIN_UBWC_COMPLEXITY_FACTOR);
|
||||
@@ -605,7 +601,8 @@ void msm_vidc_power_data_reset(struct msm_vidc_inst *inst)
|
||||
msm_vidc_dcvs_data_reset(inst);
|
||||
|
||||
inst->power.buffer_counter = 0;
|
||||
//inst->ubwc_stats.is_valid = 0; TODO: fix it
|
||||
inst->power.fw_cr = 0;
|
||||
inst->power.fw_cf = INT_MAX;
|
||||
|
||||
rc = msm_vidc_scale_power(inst, true);
|
||||
if (rc)
|
||||
|
@@ -1171,6 +1171,12 @@ static int handle_session_property(struct msm_vidc_inst *inst,
|
||||
}
|
||||
inst->hfi_frame_info.no_output = 1;
|
||||
break;
|
||||
case HFI_PROP_WORST_COMPRESSION_RATIO:
|
||||
inst->power.fw_cr = payload_ptr[0];
|
||||
break;
|
||||
case HFI_PROP_WORST_COMPLEXITY_FACTOR:
|
||||
inst->power.fw_cf = payload_ptr[0];
|
||||
break;
|
||||
default:
|
||||
i_vpr_e(inst, "%s: invalid port settings property %#x\n",
|
||||
__func__, pkt->type);
|
||||
|
Ссылка в новой задаче
Block a user