mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-13 08:07:32 -04:00
Merge "msm: vidc: Add bw for cbcr dbp read and write"
This commit is contained in:
commit
4f7323e6d7
6 changed files with 30 additions and 42 deletions
2
msm/vidc/msm_vidc.c
Executable file → Normal file
2
msm/vidc/msm_vidc.c
Executable file → Normal file
|
|
@ -1525,7 +1525,7 @@ void *msm_vidc_open(int core_id, int session_type)
|
|||
INIT_MSM_VIDC_LIST(&inst->outputbufs);
|
||||
INIT_MSM_VIDC_LIST(&inst->registeredbufs);
|
||||
INIT_MSM_VIDC_LIST(&inst->cvpbufs);
|
||||
INIT_MSM_VIDC_LIST(&inst->reconbufs);
|
||||
INIT_MSM_VIDC_LIST(&inst->refbufs);
|
||||
INIT_MSM_VIDC_LIST(&inst->eosbufs);
|
||||
INIT_MSM_VIDC_LIST(&inst->etb_data);
|
||||
INIT_MSM_VIDC_LIST(&inst->fbd_data);
|
||||
|
|
|
|||
|
|
@ -226,7 +226,6 @@ struct vidc_bus_vote_data {
|
|||
int input_cr;
|
||||
u32 ddr_bw;
|
||||
u32 sys_cache_bw;
|
||||
bool use_dpb_read;
|
||||
unsigned int lcu_size;
|
||||
unsigned int fps;
|
||||
enum msm_vidc_power_mode power_mode;
|
||||
|
|
|
|||
|
|
@ -171,11 +171,13 @@ static unsigned long __calculate_decoder(struct vidc_bus_vote_data *d,
|
|||
ddr.dpb_read = fp_div(fp_mult(ddr.dpb_read,
|
||||
fp_mult(dpb_factor, motion_vector_complexity)),
|
||||
dpb_read_compression_factor);
|
||||
ddr.dpb_read += fp_div(ddr.dpb_read, FP_INT(2));
|
||||
|
||||
ddr.dpb_write = dpb_bpp == 8 ? y_bw_no_ubwc_8bpp : y_bw_no_ubwc_10bpp;
|
||||
ddr.dpb_write = fp_div(fp_mult(ddr.dpb_write,
|
||||
fp_mult(dpb_factor, dpb_write_factor)),
|
||||
dpb_write_compression_factor);
|
||||
ddr.dpb_write += fp_div(ddr.dpb_write, FP_INT(2));
|
||||
|
||||
dpb_total = ddr.dpb_read + ddr.dpb_write;
|
||||
|
||||
|
|
|
|||
35
msm/vidc/msm_vidc_clocks.c
Executable file → Normal file
35
msm/vidc/msm_vidc_clocks.c
Executable file → Normal file
|
|
@ -14,7 +14,7 @@
|
|||
#define MSM_VIDC_MAX_UBWC_COMPLEXITY_FACTOR (4 << 16)
|
||||
|
||||
#define MSM_VIDC_MIN_UBWC_COMPRESSION_RATIO (1 << 16)
|
||||
#define MSM_VIDC_MAX_UBWC_COMPRESSION_RATIO (5 << 16)
|
||||
#define MSM_VIDC_MAX_UBWC_COMPRESSION_RATIO (3 << 16)
|
||||
|
||||
static int msm_vidc_decide_work_mode_ar50(struct msm_vidc_inst *inst);
|
||||
static unsigned long msm_vidc_calc_freq_ar50(struct msm_vidc_inst *inst,
|
||||
|
|
@ -160,16 +160,16 @@ void update_recon_stats(struct msm_vidc_inst *inst,
|
|||
CF = recon_stats->complexity_number / frame_size;
|
||||
else
|
||||
CF = MSM_VIDC_MAX_UBWC_COMPLEXITY_FACTOR;
|
||||
|
||||
mutex_lock(&inst->reconbufs.lock);
|
||||
list_for_each_entry(binfo, &inst->reconbufs.list, list) {
|
||||
mutex_lock(&inst->refbufs.lock);
|
||||
list_for_each_entry(binfo, &inst->refbufs.list, list) {
|
||||
if (binfo->buffer_index ==
|
||||
recon_stats->buffer_index) {
|
||||
binfo->CR = CR;
|
||||
binfo->CF = CF;
|
||||
break;
|
||||
}
|
||||
}
|
||||
mutex_unlock(&inst->reconbufs.lock);
|
||||
mutex_unlock(&inst->refbufs.lock);
|
||||
}
|
||||
|
||||
static int fill_dynamic_stats(struct msm_vidc_inst *inst,
|
||||
|
|
@ -177,13 +177,15 @@ static int fill_dynamic_stats(struct msm_vidc_inst *inst,
|
|||
{
|
||||
struct recon_buf *binfo, *nextb;
|
||||
struct vidc_input_cr_data *temp, *next;
|
||||
u32 min_cf = MSM_VIDC_MAX_UBWC_COMPLEXITY_FACTOR, max_cf = 0;
|
||||
u32 min_input_cr = MSM_VIDC_MAX_UBWC_COMPRESSION_RATIO,
|
||||
max_input_cr = 0;
|
||||
u32 min_cr = MSM_VIDC_MAX_UBWC_COMPRESSION_RATIO, max_cr = 0;
|
||||
u32 max_cr = MSM_VIDC_MIN_UBWC_COMPRESSION_RATIO;
|
||||
u32 max_cf = MSM_VIDC_MIN_UBWC_COMPLEXITY_FACTOR;
|
||||
u32 max_input_cr = MSM_VIDC_MIN_UBWC_COMPRESSION_RATIO;
|
||||
u32 min_cf = MSM_VIDC_MAX_UBWC_COMPLEXITY_FACTOR;
|
||||
u32 min_input_cr = MSM_VIDC_MAX_UBWC_COMPRESSION_RATIO;
|
||||
u32 min_cr = MSM_VIDC_MAX_UBWC_COMPRESSION_RATIO;
|
||||
|
||||
mutex_lock(&inst->reconbufs.lock);
|
||||
list_for_each_entry_safe(binfo, nextb, &inst->reconbufs.list, list) {
|
||||
mutex_lock(&inst->refbufs.lock);
|
||||
list_for_each_entry_safe(binfo, nextb, &inst->refbufs.list, list) {
|
||||
if (binfo->CR) {
|
||||
min_cr = min(min_cr, binfo->CR);
|
||||
max_cr = max(max_cr, binfo->CR);
|
||||
|
|
@ -193,7 +195,7 @@ static int fill_dynamic_stats(struct msm_vidc_inst *inst,
|
|||
max_cf = max(max_cf, binfo->CF);
|
||||
}
|
||||
}
|
||||
mutex_unlock(&inst->reconbufs.lock);
|
||||
mutex_unlock(&inst->refbufs.lock);
|
||||
|
||||
mutex_lock(&inst->input_crs.lock);
|
||||
list_for_each_entry_safe(temp, next, &inst->input_crs.list, list) {
|
||||
|
|
@ -215,15 +217,6 @@ static int fill_dynamic_stats(struct msm_vidc_inst *inst,
|
|||
vote_data->compression_ratio = min_cr;
|
||||
vote_data->complexity_factor = max_cf;
|
||||
vote_data->input_cr = min_input_cr;
|
||||
vote_data->use_dpb_read = false;
|
||||
|
||||
/* Check if driver can vote for lower bus BW */
|
||||
if (inst->clk_data.load < inst->clk_data.load_norm) {
|
||||
vote_data->compression_ratio = max_cr;
|
||||
vote_data->complexity_factor = min_cf;
|
||||
vote_data->input_cr = max_input_cr;
|
||||
vote_data->use_dpb_read = true;
|
||||
}
|
||||
|
||||
dprintk(VIDC_PERF,
|
||||
"Input CR = %d Recon CR = %d Complexity Factor = %d\n",
|
||||
|
|
|
|||
|
|
@ -4899,13 +4899,13 @@ int msm_comm_release_recon_buffers(struct msm_vidc_inst *inst)
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
mutex_lock(&inst->reconbufs.lock);
|
||||
list_for_each_entry_safe(buf, next, &inst->reconbufs.list, list) {
|
||||
mutex_lock(&inst->refbufs.lock);
|
||||
list_for_each_entry_safe(buf, next, &inst->refbufs.list, list) {
|
||||
list_del(&buf->list);
|
||||
kfree(buf);
|
||||
}
|
||||
INIT_LIST_HEAD(&inst->reconbufs.list);
|
||||
mutex_unlock(&inst->reconbufs.lock);
|
||||
INIT_LIST_HEAD(&inst->refbufs.list);
|
||||
mutex_unlock(&inst->refbufs.lock);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -5057,32 +5057,26 @@ error:
|
|||
int msm_comm_set_recon_buffers(struct msm_vidc_inst *inst)
|
||||
{
|
||||
int rc = 0;
|
||||
unsigned int i = 0;
|
||||
struct hal_buffer_requirements *internal_buf;
|
||||
unsigned int i = 0, bufcount = 0;
|
||||
struct recon_buf *binfo;
|
||||
struct msm_vidc_list *buf_list = &inst->reconbufs;
|
||||
struct msm_vidc_list *buf_list = &inst->refbufs;
|
||||
|
||||
if (!inst) {
|
||||
dprintk(VIDC_ERR, "%s invalid parameters\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (inst->session_type != MSM_VIDC_ENCODER) {
|
||||
dprintk(VIDC_HIGH, "Recon buffs not req for decoder/cvp\n");
|
||||
if (inst->session_type != MSM_VIDC_ENCODER &&
|
||||
inst->session_type != MSM_VIDC_DECODER) {
|
||||
dprintk(VIDC_HIGH, "Recon buffs not req for cvp\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
internal_buf = get_buff_req_buffer(inst,
|
||||
HAL_BUFFER_INTERNAL_RECON);
|
||||
if (!internal_buf || !internal_buf->buffer_count_actual) {
|
||||
dprintk(VIDC_HIGH, "Inst : %pK Recon buffers not required\n",
|
||||
inst);
|
||||
return 0;
|
||||
}
|
||||
bufcount = inst->fmts[OUTPUT_PORT].count_actual;
|
||||
|
||||
msm_comm_release_recon_buffers(inst);
|
||||
|
||||
for (i = 0; i < internal_buf->buffer_count_actual; i++) {
|
||||
for (i = 0; i < bufcount; i++) {
|
||||
binfo = kzalloc(sizeof(*binfo), GFP_KERNEL);
|
||||
if (!binfo) {
|
||||
dprintk(VIDC_ERR, "Out of memory\n");
|
||||
|
|
|
|||
|
|
@ -470,7 +470,7 @@ struct msm_vidc_inst {
|
|||
struct msm_vidc_list persistbufs;
|
||||
struct msm_vidc_list pending_getpropq;
|
||||
struct msm_vidc_list outputbufs;
|
||||
struct msm_vidc_list reconbufs;
|
||||
struct msm_vidc_list refbufs;
|
||||
struct msm_vidc_list eosbufs;
|
||||
struct msm_vidc_list registeredbufs;
|
||||
struct msm_vidc_list cvpbufs;
|
||||
|
|
|
|||
Loading…
Reference in a new issue