Skip to content

Commit 21ab7e8

Browse files
lumagrobclark
authored andcommitted
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>
1 parent 9074b67 commit 21ab7e8

3 files changed

Lines changed: 3 additions & 5 deletions

File tree

drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -291,8 +291,8 @@ static void blend_setup(struct drm_crtc *crtc)
291291
plane = pstates[i]->base.plane;
292292
blend_op = MDP5_LM_BLEND_OP_MODE_FG_ALPHA(FG_CONST) |
293293
MDP5_LM_BLEND_OP_MODE_BG_ALPHA(BG_CONST);
294-
fg_alpha = pstates[i]->alpha;
295-
bg_alpha = 0xFF - pstates[i]->alpha;
294+
fg_alpha = pstates[i]->base.alpha >> 8;
295+
bg_alpha = 0xFF - fg_alpha;
296296

297297
if (!format->alpha_enable && bg_alpha_enabled)
298298
mixer_op_mode = 0;

drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,6 @@ struct mdp5_plane_state {
101101
/* aligned with property */
102102
uint8_t premultiplied;
103103
uint8_t zpos;
104-
uint8_t alpha;
105104

106105
/* assigned by crtc blender */
107106
enum mdp_mixer_stage_id stage;

drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ mdp5_plane_atomic_print_state(struct drm_printer *p,
168168
"(null)");
169169
drm_printf(p, "\tpremultiplied=%u\n", pstate->premultiplied);
170170
drm_printf(p, "\tzpos=%u\n", pstate->zpos);
171-
drm_printf(p, "\talpha=%u\n", pstate->alpha);
171+
drm_printf(p, "\talpha=%u\n", pstate->base.alpha);
172172
drm_printf(p, "\tstage=%s\n", stage2name(pstate->stage));
173173
}
174174

@@ -183,7 +183,6 @@ static void mdp5_plane_reset(struct drm_plane *plane)
183183
mdp5_state = kzalloc(sizeof(*mdp5_state), GFP_KERNEL);
184184

185185
/* assign default blend parameters */
186-
mdp5_state->alpha = 255;
187186
mdp5_state->premultiplied = 0;
188187

189188
if (plane->type == DRM_PLANE_TYPE_PRIMARY)

0 commit comments

Comments
 (0)