drm/rockchip: disabled the plane alpha if it's bottom layer
authorMark Yao <mark.yao@rock-chips.com>
Tue, 21 Jun 2016 06:31:09 +0000 (14:31 +0800)
committerHuang, Tao <huangtao@rock-chips.com>
Fri, 1 Jul 2016 11:29:33 +0000 (19:29 +0800)
HardWare limited, the bottom layer not support per-pixel alpha,

Change-Id: I174da1d3d3cfff8d0b6cd6dfab4873438895e56d
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
drivers/gpu/drm/rockchip/rockchip_drm_vop.c

index 15c907ab3821391d1880a2c446d99f116145a93f..b6eb2b0163acbc36adad755a682ada0356325018 100644 (file)
@@ -709,6 +709,7 @@ static void vop_plane_atomic_update(struct drm_plane *plane,
        struct drm_crtc *crtc = state->crtc;
        struct vop_win *win = to_vop_win(plane);
        struct vop_plane_state *vop_plane_state = to_vop_plane_state(state);
+       struct rockchip_crtc_state *s = to_rockchip_crtc_state(crtc->state);
        struct vop *vop = to_vop(state->crtc);
        struct drm_framebuffer *fb = state->fb;
        unsigned int actual_w, actual_h;
@@ -787,7 +788,8 @@ static void vop_plane_atomic_update(struct drm_plane *plane,
        rb_swap = has_rb_swapped(fb->pixel_format);
        VOP_WIN_SET(vop, win, rb_swap, rb_swap);
 
-       if (is_alpha_support(fb->pixel_format)) {
+       if (is_alpha_support(fb->pixel_format) &&
+           (s->dsp_layer_sel & 0x3) != win->win_id) {
                VOP_WIN_SET(vop, win, dst_alpha_ctl,
                            DST_FACTOR_M0(ALPHA_SRC_INVERSE));
                val = SRC_ALPHA_EN(1) | SRC_COLOR_M0(ALPHA_SRC_PRE_MUL) |