mirror of
https://github.com/followmsi/android_kernel_google_msm.git
synced 2024-11-06 23:17:41 +00:00
msm:vidc: provide support to raise afab and ebi1 clks to turbo mode.
This change provides support to raise the clks to turbo mode for mpeg4 clips with high number of slices. The firmware performance degrades if the number of slices is more than 10. Without this fix, we see lot of frame drops happening, causing a freeze effect. Change-Id: Ia897854ef6d30bb97cd37810b22eb1ab5ad818fb CRs-Fixed: 358615 Signed-off-by: Arun Menon <menon@codeaurora.org>
This commit is contained in:
parent
9607bc6227
commit
3658e5175d
12 changed files with 133 additions and 1 deletions
|
@ -1061,6 +1061,59 @@ static struct msm_bus_vectors vidc_vdec_1080p_vectors[] = {
|
|||
},
|
||||
};
|
||||
|
||||
static struct msm_bus_vectors vidc_venc_1080p_turbo_vectors[] = {
|
||||
{
|
||||
.src = MSM_BUS_MASTER_VIDEO_ENC,
|
||||
.dst = MSM_BUS_SLAVE_EBI_CH0,
|
||||
.ab = 222298112,
|
||||
.ib = 3522000000U,
|
||||
},
|
||||
{
|
||||
.src = MSM_BUS_MASTER_VIDEO_DEC,
|
||||
.dst = MSM_BUS_SLAVE_EBI_CH0,
|
||||
.ab = 330301440,
|
||||
.ib = 3522000000U,
|
||||
},
|
||||
{
|
||||
.src = MSM_BUS_MASTER_AMPSS_M0,
|
||||
.dst = MSM_BUS_SLAVE_EBI_CH0,
|
||||
.ab = 2500000,
|
||||
.ib = 700000000,
|
||||
},
|
||||
{
|
||||
.src = MSM_BUS_MASTER_AMPSS_M0,
|
||||
.dst = MSM_BUS_SLAVE_EBI_CH0,
|
||||
.ab = 2500000,
|
||||
.ib = 10000000,
|
||||
},
|
||||
};
|
||||
static struct msm_bus_vectors vidc_vdec_1080p_turbo_vectors[] = {
|
||||
{
|
||||
.src = MSM_BUS_MASTER_VIDEO_ENC,
|
||||
.dst = MSM_BUS_SLAVE_EBI_CH0,
|
||||
.ab = 222298112,
|
||||
.ib = 3522000000U,
|
||||
},
|
||||
{
|
||||
.src = MSM_BUS_MASTER_VIDEO_DEC,
|
||||
.dst = MSM_BUS_SLAVE_EBI_CH0,
|
||||
.ab = 330301440,
|
||||
.ib = 3522000000U,
|
||||
},
|
||||
{
|
||||
.src = MSM_BUS_MASTER_AMPSS_M0,
|
||||
.dst = MSM_BUS_SLAVE_EBI_CH0,
|
||||
.ab = 2500000,
|
||||
.ib = 700000000,
|
||||
},
|
||||
{
|
||||
.src = MSM_BUS_MASTER_AMPSS_M0,
|
||||
.dst = MSM_BUS_SLAVE_EBI_CH0,
|
||||
.ab = 2500000,
|
||||
.ib = 10000000,
|
||||
},
|
||||
};
|
||||
|
||||
static struct msm_bus_paths vidc_bus_client_config[] = {
|
||||
{
|
||||
ARRAY_SIZE(vidc_init_vectors),
|
||||
|
@ -1090,6 +1143,14 @@ static struct msm_bus_paths vidc_bus_client_config[] = {
|
|||
ARRAY_SIZE(vidc_vdec_1080p_vectors),
|
||||
vidc_vdec_1080p_vectors,
|
||||
},
|
||||
{
|
||||
ARRAY_SIZE(vidc_venc_1080p_turbo_vectors),
|
||||
vidc_venc_1080p_turbo_vectors,
|
||||
},
|
||||
{
|
||||
ARRAY_SIZE(vidc_vdec_1080p_turbo_vectors),
|
||||
vidc_vdec_1080p_turbo_vectors,
|
||||
},
|
||||
};
|
||||
|
||||
static struct msm_bus_scale_pdata vidc_bus_client_data = {
|
||||
|
|
|
@ -294,6 +294,11 @@ static u32 ddl_set_dec_property(struct ddl_client_context *ddl,
|
|||
}
|
||||
}
|
||||
break;
|
||||
case VCD_I_SET_TURBO_CLK:
|
||||
{
|
||||
vcd_status = VCD_S_SUCCESS;
|
||||
}
|
||||
break;
|
||||
case VCD_I_BUFFER_FORMAT:
|
||||
{
|
||||
struct vcd_property_buffer_format *tile =
|
||||
|
|
|
@ -536,6 +536,9 @@ int res_trk_update_bus_perf_level(struct vcd_dev_ctxt *dev_ctxt, u32 perf_level)
|
|||
u32 bus_clk_index, client_type = 0;
|
||||
int rc = 0;
|
||||
|
||||
if (dev_ctxt->turbo_mode_set)
|
||||
return rc;
|
||||
|
||||
cctxt_itr = dev_ctxt->cctxt_list_head;
|
||||
while (cctxt_itr) {
|
||||
if (cctxt_itr->decoding)
|
||||
|
@ -565,6 +568,9 @@ int res_trk_update_bus_perf_level(struct vcd_dev_ctxt *dev_ctxt, u32 perf_level)
|
|||
bus_clk_index = 2;
|
||||
}
|
||||
|
||||
if (bus_clk_index == 3)
|
||||
dev_ctxt->turbo_mode_set = 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(),context.pcl = %x", __func__, resource_context.pcl);
|
||||
|
|
|
@ -75,4 +75,8 @@ struct res_trk_context {
|
|||
#define VCDRES_MSG_ERROR(xx_fmt...) printk(KERN_ERR "\n err: " xx_fmt)
|
||||
#define VCDRES_MSG_FATAL(xx_fmt...) printk(KERN_ERR "\n<FATAL> " xx_fmt)
|
||||
|
||||
#ifdef CONFIG_MSM_BUS_SCALING
|
||||
int res_trk_update_bus_perf_level(struct vcd_dev_ctxt *dev_ctxt,
|
||||
u32 perf_level);
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
@ -636,6 +636,26 @@ static u32 vid_dec_set_frame_resolution(struct video_client_ctx *client_ctx,
|
|||
return true;
|
||||
}
|
||||
|
||||
static u32 vid_dec_set_turbo_clk(struct video_client_ctx *client_ctx)
|
||||
{
|
||||
struct vcd_property_hdr vcd_property_hdr;
|
||||
u32 vcd_status = VCD_ERR_FAIL;
|
||||
u32 dummy = 0;
|
||||
|
||||
if (!client_ctx)
|
||||
return false;
|
||||
vcd_property_hdr.prop_id = VCD_I_SET_TURBO_CLK;
|
||||
vcd_property_hdr.sz = sizeof(struct vcd_property_frame_size);
|
||||
|
||||
vcd_status = vcd_set_property(client_ctx->vcd_handle,
|
||||
&vcd_property_hdr, &dummy);
|
||||
|
||||
if (vcd_status)
|
||||
return false;
|
||||
else
|
||||
return true;
|
||||
}
|
||||
|
||||
static u32 vid_dec_get_frame_resolution(struct video_client_ctx *client_ctx,
|
||||
struct vdec_picsize *video_resoultion)
|
||||
{
|
||||
|
@ -1682,6 +1702,11 @@ static long vid_dec_ioctl(struct file *file,
|
|||
}
|
||||
break;
|
||||
}
|
||||
case VDEC_IOCTL_SET_PERF_CLK:
|
||||
{
|
||||
vid_dec_set_turbo_clk(client_ctx);
|
||||
break;
|
||||
}
|
||||
case VDEC_IOCTL_FILL_OUTPUT_BUFFER:
|
||||
{
|
||||
struct vdec_fillbuffer_cmd fill_buffer_cmd;
|
||||
|
|
|
@ -397,4 +397,5 @@ u32 vcd_set_num_slices(struct vcd_clnt_ctxt *cctxt);
|
|||
|
||||
u32 vcd_update_decoder_perf_level(struct vcd_dev_ctxt *dev_ctxt, u32 perf_lvl);
|
||||
|
||||
u32 vcd_set_perf_turbo_level(struct vcd_clnt_ctxt *cctxt);
|
||||
#endif
|
||||
|
|
|
@ -541,6 +541,12 @@ static u32 vcd_set_property_cmn
|
|||
}
|
||||
break;
|
||||
}
|
||||
case VCD_I_SET_TURBO_CLK:
|
||||
{
|
||||
if (cctxt->sched_clnt_hdl)
|
||||
rc = vcd_set_perf_turbo_level(cctxt);
|
||||
break;
|
||||
}
|
||||
case VCD_I_INTRA_PERIOD:
|
||||
{
|
||||
struct vcd_property_i_period *iperiod =
|
||||
|
|
|
@ -146,7 +146,7 @@ struct vcd_dev_ctxt {
|
|||
u32 reqd_perf_lvl;
|
||||
u32 curr_perf_lvl;
|
||||
u32 set_perf_lvl_pending;
|
||||
|
||||
u32 turbo_mode_set;
|
||||
};
|
||||
|
||||
struct vcd_clnt_status {
|
||||
|
|
|
@ -219,6 +219,7 @@ u32 vcd_init_device_context(struct vcd_drv_ctxt *drv_ctxt,
|
|||
VCD_DEVICE_STATE_INITING,
|
||||
ev_code);
|
||||
}
|
||||
dev_ctxt->turbo_mode_set = 0;
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
#include "vcd_power_sm.h"
|
||||
#include "vcd_core.h"
|
||||
#include "vcd.h"
|
||||
#include "vcd_res_tracker.h"
|
||||
|
||||
u32 vcd_power_event(
|
||||
struct vcd_dev_ctxt *dev_ctxt,
|
||||
|
@ -297,6 +298,24 @@ u32 vcd_set_perf_level(struct vcd_dev_ctxt *dev_ctxt, u32 perf_lvl)
|
|||
return rc;
|
||||
}
|
||||
|
||||
u32 vcd_set_perf_turbo_level(struct vcd_clnt_ctxt *cctxt)
|
||||
{
|
||||
u32 rc = VCD_S_SUCCESS;
|
||||
#ifdef CONFIG_MSM_BUS_SCALING
|
||||
struct vcd_dev_ctxt *dev_ctxt = cctxt->dev_ctxt;
|
||||
pr_err("\n Setting Turbo mode !!");
|
||||
|
||||
if (res_trk_update_bus_perf_level(dev_ctxt,
|
||||
RESTRK_1080P_TURBO_PERF_LEVEL) < 0) {
|
||||
pr_err("\n %s(): update buf perf level failed\n",
|
||||
__func__);
|
||||
return false;
|
||||
}
|
||||
dev_ctxt->curr_perf_lvl = RESTRK_1080P_TURBO_PERF_LEVEL;
|
||||
#endif
|
||||
return rc;
|
||||
}
|
||||
|
||||
u32 vcd_update_decoder_perf_level(struct vcd_dev_ctxt *dev_ctxt, u32 perf_lvl)
|
||||
{
|
||||
u32 rc = VCD_S_SUCCESS;
|
||||
|
|
|
@ -207,6 +207,9 @@ struct vdec_ioctl_msg {
|
|||
#define VDEC_IOCTL_GET_DISABLE_DMX_SUPPORT \
|
||||
_IOR(VDEC_IOCTL_MAGIC, 37, struct vdec_ioctl_msg)
|
||||
|
||||
#define VDEC_IOCTL_SET_PERF_CLK \
|
||||
_IOR(VDEC_IOCTL_MAGIC, 38, struct vdec_ioctl_msg)
|
||||
|
||||
enum vdec_picture {
|
||||
PICTURE_TYPE_I,
|
||||
PICTURE_TYPE_P,
|
||||
|
|
|
@ -54,6 +54,7 @@
|
|||
#define VCD_REQ_PERF_LEVEL (VCD_START_BASE + 0x26)
|
||||
#define VCD_I_SLICE_DELIVERY_MODE (VCD_START_BASE + 0x27)
|
||||
#define VCD_I_VOP_TIMING_CONSTANT_DELTA (VCD_START_BASE + 0x28)
|
||||
#define VCD_I_SET_TURBO_CLK (VCD_START_BASE + 0x29)
|
||||
|
||||
#define VCD_START_REQ (VCD_START_BASE + 0x1000)
|
||||
#define VCD_I_REQ_IFRAME (VCD_START_REQ + 0x1)
|
||||
|
|
Loading…
Reference in a new issue