diff options
author | Dmitry Baryshkov <dmitry.baryshkov@linaro.org> | 2021-05-25 16:13:11 +0300 |
---|---|---|
committer | Rob Clark <robdclark@chromium.org> | 2021-06-23 07:33:56 -0700 |
commit | 21ab7e8dc9cf15290cb51317b8fb63cf2ff617ed (patch) | |
tree | 72e765377bb7e38170e5fe671b9ac75441d10c2e | |
parent | 9074b67b83bd007ea731095c498671769b68a30e (diff) |
drm/msm/mdp5: use drm_plane_state for storing alpha value
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>
-rw-r--r-- | drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c | 4 | ||||
-rw-r--r-- | drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.h | 1 | ||||
-rw-r--r-- | drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c | 3 |
3 files changed, 3 insertions, 5 deletions
diff --git a/drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c b/drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c index f5d71b274079..b98d5abafd1f 100644 --- a/drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c +++ b/drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c @@ -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; diff --git a/drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.h b/drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.h index 128866742593..d7e04e99fb4e 100644 --- a/drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.h +++ b/drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.h @@ -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; diff --git a/drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c b/drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c index 8c29026d770d..0fd1d10352aa 100644 --- a/drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c +++ b/drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c @@ -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) |