msm: mdss: fix vbif nrt selection for ot limits
Current code selects the vbif nrt to program the ot limits based on the chipset version only. This is wrong for the real time clients and the writeback read; those clients should select vbif rt. This change corrects this behavior and selects the corret vbif according to the client. Change-Id: Ie2b640878767d425e430e33942fd17a80b3bf3f1 Signed-off-by: Ingrid Gallardo <ingridg@codeaurora.org>
This commit is contained in:
parent
ce7b8b7d16
commit
a0e2f0755d
5 changed files with 20 additions and 18 deletions
|
@ -333,7 +333,7 @@ Optional properties:
|
|||
defined should match the number of offsets
|
||||
defined in property: qcom,mdss-pipe-dma-off
|
||||
- qcom,mdss-default-ot-wr-limit: This integer value indicates maximum number of pending
|
||||
writes that can be allowed from non real time client.
|
||||
writes that can be allowed on each WR xin.
|
||||
This value can be used to reduce the pending writes
|
||||
limit and can be tuned to match performance
|
||||
requirements depending upon system state.
|
||||
|
@ -343,7 +343,7 @@ Optional properties:
|
|||
operations in the platforms that require these
|
||||
limits.
|
||||
- qcom,mdss-default-ot-rd-limit: This integer value indicates the default number of pending
|
||||
reads that can be allowed for the real time clients.
|
||||
reads that can be allowed on each RD xin.
|
||||
Some platforms require a dynamic ot limiting in
|
||||
some cases. Setting this default ot read limit
|
||||
will enable this dynamic limiting for the read
|
||||
|
|
|
@ -59,7 +59,9 @@
|
|||
|
||||
#define AXI_HALT_TIMEOUT_US 0x4000
|
||||
#define AUTOSUSPEND_TIMEOUT_MS 200
|
||||
#define DEFAULT_MDP_PIPE_WIDTH 2048
|
||||
#define DEFAULT_MDP_PIPE_WIDTH 2048
|
||||
#define RES_1080p (1080*1920)
|
||||
#define RES_UHD (3840*2160)
|
||||
|
||||
struct mdss_data_type *mdss_res;
|
||||
|
||||
|
@ -3187,9 +3189,9 @@ static void apply_dynamic_ot_limit(u32 *ot_lim,
|
|||
|
||||
if ((params->is_rot && params->is_yuv) ||
|
||||
params->is_wb) {
|
||||
if (res <= 1080 * 1920) {
|
||||
if (res <= RES_1080p) {
|
||||
*ot_lim = 2;
|
||||
} else if (res <= 3840 * 2160) {
|
||||
} else if (res <= RES_UHD) {
|
||||
if (params->is_rot && params->is_yuv)
|
||||
*ot_lim = 8;
|
||||
else
|
||||
|
@ -3222,7 +3224,7 @@ static u32 get_ot_limit(u32 reg_off, u32 bit_off,
|
|||
/* Modify the limits if the target and the use case requires it */
|
||||
apply_dynamic_ot_limit(&ot_lim, params);
|
||||
|
||||
is_vbif_nrt = mdss_mdp_is_vbif_nrt(mdata->mdp_rev);
|
||||
is_vbif_nrt = params->is_vbif_nrt;
|
||||
val = MDSS_VBIF_READ(mdata, reg_off, is_vbif_nrt);
|
||||
val &= (0xFF << bit_off);
|
||||
val = val >> bit_off;
|
||||
|
@ -3242,7 +3244,7 @@ void mdss_mdp_set_ot_limit(struct mdss_mdp_set_ot_params *params)
|
|||
u32 reg_off_vbif_lim_conf = (params->xin_id / 4) * 4 +
|
||||
params->reg_off_vbif_lim_conf;
|
||||
u32 bit_off_vbif_lim_conf = (params->xin_id % 4) * 8;
|
||||
bool is_vbif_nrt = mdss_mdp_is_vbif_nrt(mdata->mdp_rev);
|
||||
bool is_vbif_nrt = params->is_vbif_nrt;
|
||||
u32 reg_val;
|
||||
bool forced_on;
|
||||
|
||||
|
|
|
@ -609,6 +609,7 @@ struct mdss_mdp_set_ot_params {
|
|||
bool is_rot;
|
||||
bool is_wb;
|
||||
bool is_yuv;
|
||||
bool is_vbif_nrt;
|
||||
u32 reg_off_vbif_lim_conf;
|
||||
u32 reg_off_mdp_clk_ctrl;
|
||||
u32 bit_off_mdp_clk_ctrl;
|
||||
|
@ -718,12 +719,6 @@ static inline int mdss_mdp_pipe_is_sw_reset_available(
|
|||
}
|
||||
}
|
||||
|
||||
static inline bool mdss_mdp_is_vbif_nrt(u32 mdp_rev)
|
||||
{
|
||||
return IS_MDSS_MAJOR_MINOR_SAME(mdp_rev,
|
||||
MDSS_MDP_HW_REV_107);
|
||||
}
|
||||
|
||||
static inline bool is_dynamic_ot_limit_required(u32 mdp_rev)
|
||||
{
|
||||
return mdp_rev == MDSS_MDP_HW_REV_105 ||
|
||||
|
|
|
@ -37,7 +37,6 @@ struct mdss_mdp_writeback_ctx {
|
|||
char __iomem *base;
|
||||
u8 ref_cnt;
|
||||
u8 type;
|
||||
bool is_vbif_nrt;
|
||||
struct completion wb_comp;
|
||||
int comp_cnt;
|
||||
|
||||
|
@ -697,6 +696,7 @@ static int mdss_mdp_wb_wait4comp(struct mdss_mdp_ctl *ctl, void *arg)
|
|||
static void mdss_mdp_set_ot_limit_wb(struct mdss_mdp_writeback_ctx *ctx)
|
||||
{
|
||||
struct mdss_mdp_set_ot_params ot_params;
|
||||
struct mdss_data_type *mdata = mdss_mdp_get_mdata();
|
||||
|
||||
ot_params.xin_id = ctx->xin_id;
|
||||
ot_params.num = ctx->wb_num;
|
||||
|
@ -706,9 +706,9 @@ static void mdss_mdp_set_ot_limit_wb(struct mdss_mdp_writeback_ctx *ctx)
|
|||
ot_params.reg_off_mdp_clk_ctrl = ctx->clk_ctrl.reg_off;
|
||||
ot_params.bit_off_mdp_clk_ctrl = ctx->clk_ctrl.bit_off;
|
||||
ot_params.is_rot = (ctx->type == MDSS_MDP_WRITEBACK_TYPE_ROTATOR);
|
||||
ot_params.is_wb = (ctx->type == MDSS_MDP_WRITEBACK_TYPE_WFD) ||
|
||||
(ctx->type == MDSS_MDP_WRITEBACK_TYPE_LINE);
|
||||
ot_params.is_wb = true;
|
||||
ot_params.is_yuv = ctx->dst_fmt->is_yuv;
|
||||
ot_params.is_vbif_nrt = mdss_mdp_is_nrt_vbif_base_defined(mdata);
|
||||
|
||||
mdss_mdp_set_ot_limit(&ot_params);
|
||||
|
||||
|
@ -849,8 +849,6 @@ int mdss_mdp_writeback_start(struct mdss_mdp_ctl *ctl)
|
|||
ctl->ops.add_vsync_handler = mdss_mdp_wb_add_vsync_handler;
|
||||
ctl->ops.remove_vsync_handler = mdss_mdp_wb_remove_vsync_handler;
|
||||
|
||||
ctx->is_vbif_nrt = mdss_mdp_is_vbif_nrt(ctl->mdata->mdp_rev);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -1878,6 +1878,13 @@ static void mdss_mdp_set_ot_limit_pipe(struct mdss_mdp_pipe *pipe)
|
|||
ot_params.is_wb = ctl->intf_num == MDSS_MDP_NO_INTF;
|
||||
ot_params.is_yuv = pipe->src_fmt->is_yuv;
|
||||
|
||||
/* rotator read uses nrt vbif */
|
||||
if (mdss_mdp_is_nrt_vbif_base_defined(ctl->mdata) &&
|
||||
pipe->mixer_left->rotator_mode)
|
||||
ot_params.is_vbif_nrt = true;
|
||||
else
|
||||
ot_params.is_vbif_nrt = false;
|
||||
|
||||
mdss_mdp_set_ot_limit(&ot_params);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue