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>
This commit is contained in:
Родитель
21ab7e8dc9
Коммит
a4fdc26029
|
@ -301,7 +301,8 @@ static void blend_setup(struct drm_crtc *crtc)
|
||||||
|
|
||||||
DBG("Stage %d fg_alpha %x bg_alpha %x", i, fg_alpha, bg_alpha);
|
DBG("Stage %d fg_alpha %x bg_alpha %x", i, fg_alpha, bg_alpha);
|
||||||
|
|
||||||
if (format->alpha_enable && pstates[i]->premultiplied) {
|
if (format->alpha_enable &&
|
||||||
|
pstates[i]->base.pixel_blend_mode == DRM_MODE_BLEND_PREMULTI) {
|
||||||
blend_op = MDP5_LM_BLEND_OP_MODE_FG_ALPHA(FG_CONST) |
|
blend_op = MDP5_LM_BLEND_OP_MODE_FG_ALPHA(FG_CONST) |
|
||||||
MDP5_LM_BLEND_OP_MODE_BG_ALPHA(FG_PIXEL);
|
MDP5_LM_BLEND_OP_MODE_BG_ALPHA(FG_PIXEL);
|
||||||
if (fg_alpha != 0xff) {
|
if (fg_alpha != 0xff) {
|
||||||
|
@ -312,7 +313,8 @@ static void blend_setup(struct drm_crtc *crtc)
|
||||||
} else {
|
} else {
|
||||||
blend_op |= MDP5_LM_BLEND_OP_MODE_BG_INV_ALPHA;
|
blend_op |= MDP5_LM_BLEND_OP_MODE_BG_INV_ALPHA;
|
||||||
}
|
}
|
||||||
} else if (format->alpha_enable) {
|
} else if (format->alpha_enable &&
|
||||||
|
pstates[i]->base.pixel_blend_mode == DRM_MODE_BLEND_COVERAGE) {
|
||||||
blend_op = MDP5_LM_BLEND_OP_MODE_FG_ALPHA(FG_PIXEL) |
|
blend_op = MDP5_LM_BLEND_OP_MODE_FG_ALPHA(FG_PIXEL) |
|
||||||
MDP5_LM_BLEND_OP_MODE_BG_ALPHA(FG_PIXEL);
|
MDP5_LM_BLEND_OP_MODE_BG_ALPHA(FG_PIXEL);
|
||||||
if (fg_alpha != 0xff) {
|
if (fg_alpha != 0xff) {
|
||||||
|
|
|
@ -99,7 +99,6 @@ struct mdp5_plane_state {
|
||||||
struct mdp5_hw_pipe *r_hwpipe; /* right hwpipe */
|
struct mdp5_hw_pipe *r_hwpipe; /* right hwpipe */
|
||||||
|
|
||||||
/* aligned with property */
|
/* aligned with property */
|
||||||
uint8_t premultiplied;
|
|
||||||
uint8_t zpos;
|
uint8_t zpos;
|
||||||
|
|
||||||
/* assigned by crtc blender */
|
/* assigned by crtc blender */
|
||||||
|
|
|
@ -166,7 +166,7 @@ mdp5_plane_atomic_print_state(struct drm_printer *p,
|
||||||
drm_printf(p, "\tright-hwpipe=%s\n",
|
drm_printf(p, "\tright-hwpipe=%s\n",
|
||||||
pstate->r_hwpipe ? pstate->r_hwpipe->name :
|
pstate->r_hwpipe ? pstate->r_hwpipe->name :
|
||||||
"(null)");
|
"(null)");
|
||||||
drm_printf(p, "\tpremultiplied=%u\n", pstate->premultiplied);
|
drm_printf(p, "\tblend_mode=%u\n", pstate->base.pixel_blend_mode);
|
||||||
drm_printf(p, "\tzpos=%u\n", pstate->zpos);
|
drm_printf(p, "\tzpos=%u\n", pstate->zpos);
|
||||||
drm_printf(p, "\talpha=%u\n", pstate->base.alpha);
|
drm_printf(p, "\talpha=%u\n", pstate->base.alpha);
|
||||||
drm_printf(p, "\tstage=%s\n", stage2name(pstate->stage));
|
drm_printf(p, "\tstage=%s\n", stage2name(pstate->stage));
|
||||||
|
@ -182,9 +182,6 @@ static void mdp5_plane_reset(struct drm_plane *plane)
|
||||||
kfree(to_mdp5_plane_state(plane->state));
|
kfree(to_mdp5_plane_state(plane->state));
|
||||||
mdp5_state = kzalloc(sizeof(*mdp5_state), GFP_KERNEL);
|
mdp5_state = kzalloc(sizeof(*mdp5_state), GFP_KERNEL);
|
||||||
|
|
||||||
/* assign default blend parameters */
|
|
||||||
mdp5_state->premultiplied = 0;
|
|
||||||
|
|
||||||
if (plane->type == DRM_PLANE_TYPE_PRIMARY)
|
if (plane->type == DRM_PLANE_TYPE_PRIMARY)
|
||||||
mdp5_state->zpos = STAGE_BASE;
|
mdp5_state->zpos = STAGE_BASE;
|
||||||
else
|
else
|
||||||
|
|
Загрузка…
Ссылка в новой задаче