aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/msm/mdp/mdp5/mdp5_ctl.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/msm/mdp/mdp5/mdp5_ctl.c')
-rw-r--r--drivers/gpu/drm/msm/mdp/mdp5/mdp5_ctl.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_ctl.c b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_ctl.c
index d021edc3b307..8b93f7e13200 100644
--- a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_ctl.c
+++ b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_ctl.c
@@ -326,6 +326,8 @@ static u32 mdp_ctl_blend_mask(enum mdp5_pipe pipe,
326 case SSPP_DMA1: return MDP5_CTL_LAYER_REG_DMA1(stage); 326 case SSPP_DMA1: return MDP5_CTL_LAYER_REG_DMA1(stage);
327 case SSPP_VIG3: return MDP5_CTL_LAYER_REG_VIG3(stage); 327 case SSPP_VIG3: return MDP5_CTL_LAYER_REG_VIG3(stage);
328 case SSPP_RGB3: return MDP5_CTL_LAYER_REG_RGB3(stage); 328 case SSPP_RGB3: return MDP5_CTL_LAYER_REG_RGB3(stage);
329 case SSPP_CURSOR0:
330 case SSPP_CURSOR1:
329 default: return 0; 331 default: return 0;
330 } 332 }
331} 333}
@@ -333,7 +335,7 @@ static u32 mdp_ctl_blend_mask(enum mdp5_pipe pipe,
333static u32 mdp_ctl_blend_ext_mask(enum mdp5_pipe pipe, 335static u32 mdp_ctl_blend_ext_mask(enum mdp5_pipe pipe,
334 enum mdp_mixer_stage_id stage) 336 enum mdp_mixer_stage_id stage)
335{ 337{
336 if (stage < STAGE6) 338 if (stage < STAGE6 && (pipe != SSPP_CURSOR0 && pipe != SSPP_CURSOR1))
337 return 0; 339 return 0;
338 340
339 switch (pipe) { 341 switch (pipe) {
@@ -347,12 +349,14 @@ static u32 mdp_ctl_blend_ext_mask(enum mdp5_pipe pipe,
347 case SSPP_DMA1: return MDP5_CTL_LAYER_EXT_REG_DMA1_BIT3; 349 case SSPP_DMA1: return MDP5_CTL_LAYER_EXT_REG_DMA1_BIT3;
348 case SSPP_VIG3: return MDP5_CTL_LAYER_EXT_REG_VIG3_BIT3; 350 case SSPP_VIG3: return MDP5_CTL_LAYER_EXT_REG_VIG3_BIT3;
349 case SSPP_RGB3: return MDP5_CTL_LAYER_EXT_REG_RGB3_BIT3; 351 case SSPP_RGB3: return MDP5_CTL_LAYER_EXT_REG_RGB3_BIT3;
352 case SSPP_CURSOR0: return MDP5_CTL_LAYER_EXT_REG_CURSOR0(stage);
353 case SSPP_CURSOR1: return MDP5_CTL_LAYER_EXT_REG_CURSOR1(stage);
350 default: return 0; 354 default: return 0;
351 } 355 }
352} 356}
353 357
354int mdp5_ctl_blend(struct mdp5_ctl *ctl, u8 *stage, u32 stage_cnt, 358int mdp5_ctl_blend(struct mdp5_ctl *ctl, enum mdp5_pipe *stage, u32 stage_cnt,
355 u32 ctl_blend_op_flags) 359 u32 ctl_blend_op_flags)
356{ 360{
357 unsigned long flags; 361 unsigned long flags;
358 u32 blend_cfg = 0, blend_ext_cfg = 0; 362 u32 blend_cfg = 0, blend_ext_cfg = 0;
@@ -365,7 +369,7 @@ int mdp5_ctl_blend(struct mdp5_ctl *ctl, u8 *stage, u32 stage_cnt,
365 start_stage = STAGE_BASE; 369 start_stage = STAGE_BASE;
366 } 370 }
367 371
368 for (i = start_stage; i < start_stage + stage_cnt; i++) { 372 for (i = start_stage; stage_cnt && i <= STAGE_MAX; i++) {
369 blend_cfg |= mdp_ctl_blend_mask(stage[i], i); 373 blend_cfg |= mdp_ctl_blend_mask(stage[i], i);
370 blend_ext_cfg |= mdp_ctl_blend_ext_mask(stage[i], i); 374 blend_ext_cfg |= mdp_ctl_blend_ext_mask(stage[i], i);
371 } 375 }
@@ -422,6 +426,8 @@ u32 mdp_ctl_flush_mask_pipe(enum mdp5_pipe pipe)
422 case SSPP_DMA1: return MDP5_CTL_FLUSH_DMA1; 426 case SSPP_DMA1: return MDP5_CTL_FLUSH_DMA1;
423 case SSPP_VIG3: return MDP5_CTL_FLUSH_VIG3; 427 case SSPP_VIG3: return MDP5_CTL_FLUSH_VIG3;
424 case SSPP_RGB3: return MDP5_CTL_FLUSH_RGB3; 428 case SSPP_RGB3: return MDP5_CTL_FLUSH_RGB3;
429 case SSPP_CURSOR0: return MDP5_CTL_FLUSH_CURSOR_0;
430 case SSPP_CURSOR1: return MDP5_CTL_FLUSH_CURSOR_1;
425 default: return 0; 431 default: return 0;
426 } 432 }
427} 433}