drm/msm/mdp5: use drm_plane_state for storing alpha value
authorDmitry Baryshkov <dmitry.baryshkov@linaro.org>
Tue, 25 May 2021 13:13:11 +0000 (16:13 +0300)
committerRob Clark <robdclark@chromium.org>
Wed, 23 Jun 2021 14:33:56 +0000 (07:33 -0700)
Use drm_plane_state's 'alpha' field rather than adding extra 'alpha'
field to mdp5_plane_state.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Link: https://lore.kernel.org/r/20210525131316.3117809-3-dmitry.baryshkov@linaro.org
Signed-off-by: Rob Clark <robdclark@chromium.org>
drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c
drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.h
drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c

index f5d71b274079300d2d0d28270e41160b9d2014ae..b98d5abafd1fbc527fe79dd789f1c052bb907584 100644 (file)
@@ -291,8 +291,8 @@ static void blend_setup(struct drm_crtc *crtc)
                plane = pstates[i]->base.plane;
                blend_op = MDP5_LM_BLEND_OP_MODE_FG_ALPHA(FG_CONST) |
                        MDP5_LM_BLEND_OP_MODE_BG_ALPHA(BG_CONST);
-               fg_alpha = pstates[i]->alpha;
-               bg_alpha = 0xFF - pstates[i]->alpha;
+               fg_alpha = pstates[i]->base.alpha >> 8;
+               bg_alpha = 0xFF - fg_alpha;
 
                if (!format->alpha_enable && bg_alpha_enabled)
                        mixer_op_mode = 0;
index 1288667425932b7ad38c531501667ae26206598a..d7e04e99fb4eb41316f82721c95ac0a3fb5317f4 100644 (file)
@@ -101,7 +101,6 @@ struct mdp5_plane_state {
        /* aligned with property */
        uint8_t premultiplied;
        uint8_t zpos;
-       uint8_t alpha;
 
        /* assigned by crtc blender */
        enum mdp_mixer_stage_id stage;
index 8c29026d770d29dbf15aeb085ed5fda633f7ca3c..0fd1d10352aa94b54d4b7af974608c092681b87d 100644 (file)
@@ -168,7 +168,7 @@ mdp5_plane_atomic_print_state(struct drm_printer *p,
                                              "(null)");
        drm_printf(p, "\tpremultiplied=%u\n", pstate->premultiplied);
        drm_printf(p, "\tzpos=%u\n", pstate->zpos);
-       drm_printf(p, "\talpha=%u\n", pstate->alpha);
+       drm_printf(p, "\talpha=%u\n", pstate->base.alpha);
        drm_printf(p, "\tstage=%s\n", stage2name(pstate->stage));
 }
 
@@ -183,7 +183,6 @@ static void mdp5_plane_reset(struct drm_plane *plane)
        mdp5_state = kzalloc(sizeof(*mdp5_state), GFP_KERNEL);
 
        /* assign default blend parameters */
-       mdp5_state->alpha = 255;
        mdp5_state->premultiplied = 0;
 
        if (plane->type == DRM_PLANE_TYPE_PRIMARY)