aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArchit Taneja <architt@codeaurora.org>2017-03-23 06:28:16 -0400
committerRob Clark <robdclark@gmail.com>2017-04-08 06:59:36 -0400
commit0d1d3e44653ff5e806b4007d0d952491d745cbbf (patch)
treed1c287d6558c9842f6038abbe4b33b6eb8163760
parent8480adacfd58c79d884aa17af77a7fa7efae7257 (diff)
drm/msm/mdp5: Reset CTL blend registers before configuring them
Assigning LMs dynamically to CRTCs results in REG_MDP5_CTL_LAYER_REGs and REG_MDP5_CTL_LAYER_EXT_REGs maintaining old values for a LM that isn't used by our CTL instance anymore. Clear the ctl's CTL_LAYER_REG and CTL_LAYER_EXT_REGs for all LM instances. The ones that need to be configured are configured later in this func. Signed-off-by: Archit Taneja <architt@codeaurora.org> Signed-off-by: Rob Clark <robdclark@gmail.com>
-rw-r--r--drivers/gpu/drm/msm/mdp/mdp5/mdp5_ctl.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_ctl.c b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_ctl.c
index 15d78b218935..fddde84afdc3 100644
--- a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_ctl.c
+++ b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_ctl.c
@@ -355,6 +355,22 @@ static u32 mdp_ctl_blend_ext_mask(enum mdp5_pipe pipe,
355 } 355 }
356} 356}
357 357
358static void mdp5_ctl_reset_blend_regs(struct mdp5_ctl *ctl)
359{
360 unsigned long flags;
361 struct mdp5_ctl_manager *ctl_mgr = ctl->ctlm;
362 int i;
363
364 spin_lock_irqsave(&ctl->hw_lock, flags);
365
366 for (i = 0; i < ctl_mgr->nlm; i++) {
367 ctl_write(ctl, REG_MDP5_CTL_LAYER_REG(ctl->id, i), 0x0);
368 ctl_write(ctl, REG_MDP5_CTL_LAYER_EXT_REG(ctl->id, i), 0x0);
369 }
370
371 spin_unlock_irqrestore(&ctl->hw_lock, flags);
372}
373
358#define PIPE_LEFT 0 374#define PIPE_LEFT 0
359#define PIPE_RIGHT 1 375#define PIPE_RIGHT 1
360int mdp5_ctl_blend(struct mdp5_ctl *ctl, struct mdp5_pipeline *pipeline, 376int mdp5_ctl_blend(struct mdp5_ctl *ctl, struct mdp5_pipeline *pipeline,
@@ -369,6 +385,8 @@ int mdp5_ctl_blend(struct mdp5_ctl *ctl, struct mdp5_pipeline *pipeline,
369 u32 r_blend_cfg = 0, r_blend_ext_cfg = 0; 385 u32 r_blend_cfg = 0, r_blend_ext_cfg = 0;
370 int i, start_stage; 386 int i, start_stage;
371 387
388 mdp5_ctl_reset_blend_regs(ctl);
389
372 if (ctl_blend_op_flags & MDP5_CTL_BLEND_OP_FLAG_BORDER_OUT) { 390 if (ctl_blend_op_flags & MDP5_CTL_BLEND_OP_FLAG_BORDER_OUT) {
373 start_stage = STAGE0; 391 start_stage = STAGE0;
374 blend_cfg |= MDP5_CTL_LAYER_REG_BORDER_COLOR; 392 blend_cfg |= MDP5_CTL_LAYER_REG_BORDER_COLOR;