vidc: Turbo mode for multiple instances

If macroblock count per second goes beyond 1080p 30fps,
then bump the clock to turbo on supported platforms.

CRs-fixed: 455464
Change-Id: I48c34c9b6987706ea3e6b412b57791e2ae07ba52
Signed-off-by: Maheshwar Ajja <majja@codeaurora.org>
This commit is contained in:
Maheshwar Ajja 2012-10-03 16:39:50 -04:00 committed by Iliyan Malchev
parent ccb7895e9d
commit 7ccb844344
3 changed files with 3 additions and 23 deletions

View file

@ -544,7 +544,6 @@ int res_trk_update_bus_perf_level(struct vcd_dev_ctxt *dev_ctxt, u32 perf_level)
u32 enc_perf_level = 0, dec_perf_level = 0; u32 enc_perf_level = 0, dec_perf_level = 0;
u32 bus_clk_index, client_type = 0; u32 bus_clk_index, client_type = 0;
int rc = 0; int rc = 0;
bool turbo_enabled = false;
bool turbo_supported = bool turbo_supported =
!resource_context.vidc_platform_data->disable_turbo; !resource_context.vidc_platform_data->disable_turbo;
@ -554,9 +553,6 @@ int res_trk_update_bus_perf_level(struct vcd_dev_ctxt *dev_ctxt, u32 perf_level)
dec_perf_level += cctxt_itr->reqd_perf_lvl; dec_perf_level += cctxt_itr->reqd_perf_lvl;
else else
enc_perf_level += cctxt_itr->reqd_perf_lvl; enc_perf_level += cctxt_itr->reqd_perf_lvl;
if (cctxt_itr->is_turbo_enabled)
turbo_enabled = true;
cctxt_itr = cctxt_itr->next; cctxt_itr = cctxt_itr->next;
} }
@ -573,18 +569,8 @@ int res_trk_update_bus_perf_level(struct vcd_dev_ctxt *dev_ctxt, u32 perf_level)
if (dev_ctxt->reqd_perf_lvl + dev_ctxt->curr_perf_lvl == 0) if (dev_ctxt->reqd_perf_lvl + dev_ctxt->curr_perf_lvl == 0)
bus_clk_index = 2; bus_clk_index = 2;
else if ((!turbo_supported || !turbo_enabled) && bus_clk_index == 3) { else if (!turbo_supported && bus_clk_index == 3)
if (!turbo_supported)
VCDRES_MSG_MED("Warning: Turbo mode not supported "\
" falling back to 1080p bus\n");
bus_clk_index = 2; bus_clk_index = 2;
}
if (bus_clk_index == 3)
dev_ctxt->turbo_mode_set = true;
else
dev_ctxt->turbo_mode_set = false;
bus_clk_index = (bus_clk_index << 1) + (client_type + 1); bus_clk_index = (bus_clk_index << 1) + (client_type + 1);
VCDRES_MSG_LOW("%s(), bus_clk_index = %d", __func__, bus_clk_index); VCDRES_MSG_LOW("%s(), bus_clk_index = %d", __func__, bus_clk_index);
VCDRES_MSG_LOW("%s(),context.pcl = %x", __func__, resource_context.pcl); VCDRES_MSG_LOW("%s(),context.pcl = %x", __func__, resource_context.pcl);
@ -640,11 +626,8 @@ u32 res_trk_set_perf_level(u32 req_perf_lvl, u32 *pn_set_perf_lvl,
*pn_set_perf_lvl = RESTRK_1080P_TURBO_PERF_LEVEL; *pn_set_perf_lvl = RESTRK_1080P_TURBO_PERF_LEVEL;
} }
if ((!turbo_supported || !dev_ctxt->turbo_mode_set) && if (!turbo_supported &&
*pn_set_perf_lvl == RESTRK_1080P_TURBO_PERF_LEVEL) { *pn_set_perf_lvl == RESTRK_1080P_TURBO_PERF_LEVEL) {
if (!turbo_supported)
VCDRES_MSG_ERROR("Warning: Turbo mode not supported "\
" falling back to 1080p clocks\n");
vidc_freq = vidc_clk_table[2]; vidc_freq = vidc_clk_table[2];
*pn_set_perf_lvl = RESTRK_1080P_MAX_PERF_LEVEL; *pn_set_perf_lvl = RESTRK_1080P_MAX_PERF_LEVEL;
} }

View file

@ -1,4 +1,4 @@
/* Copyright (c) 2010-2012, The Linux Foundation. All rights reserved. /* Copyright (c) 2010-2013, The Linux Foundation. All rights reserved.
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and * it under the terms of the GNU General Public License version 2 and
@ -147,7 +147,6 @@ struct vcd_dev_ctxt {
u32 reqd_perf_lvl; u32 reqd_perf_lvl;
u32 curr_perf_lvl; u32 curr_perf_lvl;
u32 set_perf_lvl_pending; u32 set_perf_lvl_pending;
bool turbo_mode_set;
}; };
struct vcd_clnt_status { struct vcd_clnt_status {

View file

@ -220,8 +220,6 @@ u32 vcd_init_device_context(struct vcd_drv_ctxt *drv_ctxt,
VCD_DEVICE_STATE_INITING, VCD_DEVICE_STATE_INITING,
ev_code); ev_code);
} }
dev_ctxt->turbo_mode_set = 0;
return rc; return rc;
} }