drm/msm/mdp5: Prepare CRTC/LM for empty stages
authorArchit Taneja <architt@codeaurora.org>
Mon, 12 Dec 2016 09:47:56 +0000 (15:17 +0530)
committerRob Clark <robdclark@gmail.com>
Mon, 6 Feb 2017 16:28:44 +0000 (11:28 -0500)
Use SSPP_NONE in mdp5_plane_pipe() if there is now hwpipe allocated for
the drm_plane. Returning '0' means we are returning VIG0 pipe.

Also, use the mdp5_pipe enum to pass around the stage array. Initialize
the stage to SSPP_NONE by default.

We do the above because 1) Cursor plane has to be staged at the topmost
blender of the LM, which can result in empty stages in between 2) In
the future, when we support multiple LMs per CRTC. We could have stages
which don't have any pipe assigned to them.

Signed-off-by: Archit Taneja <architt@codeaurora.org>
Signed-off-by: Rob Clark <robdclark@gmail.com>
drivers/gpu/drm/msm/mdp/mdp5/mdp5_crtc.c
drivers/gpu/drm/msm/mdp/mdp5/mdp5_ctl.c
drivers/gpu/drm/msm/mdp/mdp5/mdp5_ctl.h
drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c

index 1ce8a01a5a28d8b302d18d08815df16fe7b6ad20..7a47209b0c6f122b87792c64408b0c0dc50c4625 100644 (file)
@@ -195,7 +195,7 @@ static void blend_setup(struct drm_crtc *crtc)
        uint32_t lm = mdp5_crtc->lm;
        uint32_t blend_op, fg_alpha, bg_alpha, ctl_blend_flags = 0;
        unsigned long flags;
-       uint8_t stage[STAGE_MAX + 1];
+       enum mdp5_pipe stage[STAGE_MAX + 1] = { SSPP_NONE };
        int i, plane_cnt = 0;
 #define blender(stage) ((stage) - STAGE0)
 
index d021edc3b307e3f5b37fdd3523a72fa8dec48ae9..ab339ce7425a755abbf9830eb9665a375ba3b78d 100644 (file)
@@ -351,8 +351,8 @@ static u32 mdp_ctl_blend_ext_mask(enum mdp5_pipe pipe,
        }
 }
 
-int mdp5_ctl_blend(struct mdp5_ctl *ctl, u8 *stage, u32 stage_cnt,
-       u32 ctl_blend_op_flags)
+int mdp5_ctl_blend(struct mdp5_ctl *ctl, enum mdp5_pipe *stage, u32 stage_cnt,
+                  u32 ctl_blend_op_flags)
 {
        unsigned long flags;
        u32 blend_cfg = 0, blend_ext_cfg = 0;
index 96148c6f863c8fe9e45d862eaa068fac0bb0dd0a..fda00d33e4dbc6bf1349e34ee20c4fe2caf6c9c6 100644 (file)
@@ -56,8 +56,8 @@ int mdp5_ctl_pair(struct mdp5_ctl *ctlx, struct mdp5_ctl *ctly, bool enable);
  * (call mdp5_ctl_commit() with mdp_ctl_flush_mask_ctl() mask)
  */
 #define MDP5_CTL_BLEND_OP_FLAG_BORDER_OUT      BIT(0)
-int mdp5_ctl_blend(struct mdp5_ctl *ctl, u8 *stage, u32 stage_cnt,
-       u32 ctl_blend_op_flags);
+int mdp5_ctl_blend(struct mdp5_ctl *ctl, enum mdp5_pipe *stage, u32 stage_cnt,
+                  u32 ctl_blend_op_flags);
 
 /**
  * mdp_ctl_flush_mask...() - Register FLUSH masks
index b9fb111d34280169bdca69b1db0bbead6d7a6454..eb8dc7c36419abdbc158fa43325e56cb32de9d02 100644 (file)
@@ -823,7 +823,7 @@ enum mdp5_pipe mdp5_plane_pipe(struct drm_plane *plane)
        struct mdp5_plane_state *pstate = to_mdp5_plane_state(plane->state);
 
        if (WARN_ON(!pstate->hwpipe))
-               return 0;
+               return SSPP_NONE;
 
        return pstate->hwpipe->pipe;
 }