drm/rockchip: vop2: Fix the mixer alpha setup for layer 0
authorAndy Yan <andy.yan@rock-chips.com>
Mon, 9 Dec 2024 12:29:16 +0000 (20:29 +0800)
committerHeiko Stuebner <heiko@sntech.de>
Tue, 10 Dec 2024 23:07:33 +0000 (00:07 +0100)
The alpha setup should start from the second layer, the current calculation
starts incorrectly from the first layer, a negative offset will be obtained
in the following formula:

offset = (mixer_id + zpos - 1) * 0x10

Fixes: 604be85547ce ("drm/rockchip: Add VOP2 driver")
Tested-by: Derek Foreman <derek.foreman@collabora.com>
Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20241209122943.2781431-7-andyshrk@163.com
drivers/gpu/drm/rockchip/rockchip_drm_vop2.c

index 07455dff42c96b0d231f8868156b0a33edc06a57..2d5e2e298b866a7e48363dac7f0d1ad230f98a89 100644 (file)
@@ -2425,6 +2425,12 @@ static void vop2_setup_alpha(struct vop2_video_port *vp)
                struct vop2_win *win = to_vop2_win(plane);
                int zpos = plane->state->normalized_zpos;
 
+               /*
+                * Need to configure alpha from second layer.
+                */
+               if (zpos == 0)
+                       continue;
+
                if (plane->state->pixel_blend_mode == DRM_MODE_BLEND_PREMULTI)
                        premulti_en = 1;
                else