Skip to content

Commit a4fdc26

Browse files
lumagrobclark
authored andcommitted
drm/msm/mdp5: use drm_plane_state for pixel blend mode
Use drm_plane_state's 'pixel_blend_mode' field rather than using 'premultiplied' field to mdp5_plane_state. Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Link: https://lore.kernel.org/r/20210525131316.3117809-4-dmitry.baryshkov@linaro.org Signed-off-by: Rob Clark <robdclark@chromium.org>
1 parent 21ab7e8 commit a4fdc26

3 files changed

Lines changed: 5 additions & 7 deletions

File tree

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,8 @@ static void blend_setup(struct drm_crtc *crtc)
301301

302302
DBG("Stage %d fg_alpha %x bg_alpha %x", i, fg_alpha, bg_alpha);
303303

304-
if (format->alpha_enable && pstates[i]->premultiplied) {
304+
if (format->alpha_enable &&
305+
pstates[i]->base.pixel_blend_mode == DRM_MODE_BLEND_PREMULTI) {
305306
blend_op = MDP5_LM_BLEND_OP_MODE_FG_ALPHA(FG_CONST) |
306307
MDP5_LM_BLEND_OP_MODE_BG_ALPHA(FG_PIXEL);
307308
if (fg_alpha != 0xff) {
@@ -312,7 +313,8 @@ static void blend_setup(struct drm_crtc *crtc)
312313
} else {
313314
blend_op |= MDP5_LM_BLEND_OP_MODE_BG_INV_ALPHA;
314315
}
315-
} else if (format->alpha_enable) {
316+
} else if (format->alpha_enable &&
317+
pstates[i]->base.pixel_blend_mode == DRM_MODE_BLEND_COVERAGE) {
316318
blend_op = MDP5_LM_BLEND_OP_MODE_FG_ALPHA(FG_PIXEL) |
317319
MDP5_LM_BLEND_OP_MODE_BG_ALPHA(FG_PIXEL);
318320
if (fg_alpha != 0xff) {

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,6 @@ struct mdp5_plane_state {
9999
struct mdp5_hw_pipe *r_hwpipe; /* right hwpipe */
100100

101101
/* aligned with property */
102-
uint8_t premultiplied;
103102
uint8_t zpos;
104103

105104
/* assigned by crtc blender */

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

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ mdp5_plane_atomic_print_state(struct drm_printer *p,
166166
drm_printf(p, "\tright-hwpipe=%s\n",
167167
pstate->r_hwpipe ? pstate->r_hwpipe->name :
168168
"(null)");
169-
drm_printf(p, "\tpremultiplied=%u\n", pstate->premultiplied);
169+
drm_printf(p, "\tblend_mode=%u\n", pstate->base.pixel_blend_mode);
170170
drm_printf(p, "\tzpos=%u\n", pstate->zpos);
171171
drm_printf(p, "\talpha=%u\n", pstate->base.alpha);
172172
drm_printf(p, "\tstage=%s\n", stage2name(pstate->stage));
@@ -182,9 +182,6 @@ static void mdp5_plane_reset(struct drm_plane *plane)
182182
kfree(to_mdp5_plane_state(plane->state));
183183
mdp5_state = kzalloc(sizeof(*mdp5_state), GFP_KERNEL);
184184

185-
/* assign default blend parameters */
186-
mdp5_state->premultiplied = 0;
187-
188185
if (plane->type == DRM_PLANE_TYPE_PRIMARY)
189186
mdp5_state->zpos = STAGE_BASE;
190187
else

0 commit comments

Comments
 (0)