mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 02:50:49 +09:00
drm/rockchip: vop2: Support vop splice mode in color key setup
When splice mode enabled, setup color key on both left and right win. Without this patch, kernel will panic when display more than 4k resolution content: [ 29.233947][ T393] Unable to handle kernel NULL pointer dereference at virtual address 00000000000000f8 [ 29.234836][ T393] Mem abort info: [ 29.235155][ T393] ESR = 0x0000000096000005 [ 29.235557][ T393] EC = 0x25: DABT (current EL), IL = 32 bits [ 29.236090][ T393] SET = 0, FnV = 0 [ 29.236431][ T393] EA = 0, S1PTW = 0 [ 29.236784][ T393] FSC = 0x05: level 1 translation fault [ 29.237280][ T393] Data abort info: [ 29.237607][ T393] ISV = 0, ISS = 0x00000005 [ 29.238019][ T393] CM = 0, WnR = 0 [ 29.238356][ T393] user pgtable: 4k pages, 39-bit VAs, pgdp=0000000108580000 [ 29.239031][ T393] [00000000000000f8] pgd=0000000000000000, p4d=0000000000000000, pud=0000000000000000 [ 29.239877][ T393] Internal error: Oops: 0000000096000005 [#1] PREEMPT SMP [ 29.240495][ T393] Modules linked in: bcmdhd(O) [ 29.240921][ T393] CPU: 7 PID: 393 Comm: drm-compositor Tainted: G O 6.1.57 #361 [ 29.241714][ T393] Hardware name: Rockchip RK3588 EVB1 LP4 V10 Board (DT) [ 29.242327][ T393] pstate: 60400009 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--) [ 29.243014][ T393] pc : vop2_win_atomic_update+0x44c8/0x5cec [ 29.243537][ T393] lr : vop2_win_atomic_update+0x35f0/0x5cec [ 29.244051][ T393] sp : ffffffc00de6b7c0 [ 29.244413][ T393] x29: ffffffc00de6b8d0 x28: ffffffc0095d01f8 x27: ffffff81013fc060 [ 29.245116][ T393] x26: 00000000000010e0 x25: 0000000000000f00 x24: 00000000000003c0 [ 29.245817][ T393] x23: 0000000000000000 x22: ffffff815ba59600 x21: ffffff81013fbab8 [ 29.246516][ T393] x20: ffffff817ed99400 x19: ffffff81013f0040 x18: ffffffc00dcfd080 [ 29.247201][ T393] x17: 0000000000000001 x16: 000000000000000a x15: 0000000000000001 [ 29.247888][ T393] x14: 00000000000000c0 x13: 0000000000000019 x12: 0000000000001a30 [ 29.248574][ T393] x11: ffffffc00cfa8000 x10: 0000000000000001 x9 : 0000000000000000 [ 29.249261][ T393] x8 : ffffff81013f0040 x7 : 00000000000003c0 x6 : 0000000000000438 [ 29.249946][ T393] x5 : 00000000000003c0 x4 : ffffffc009bc5728 x3 : 0000000000000f00 [ 29.250633][ T393] x2 : ffffff81013fc034 x1 : 0000000000000001 x0 : 0000000000003ff4 [ 29.251321][ T393] Call trace: [ 29.251600][ T393] vop2_win_atomic_update+0x44c8/0x5cec [ 29.252077][ T393] vop2_plane_atomic_update+0x2b8/0x31c [ 29.252559][ T393] drm_atomic_helper_commit_planes+0xb4/0x1e0 [ 29.253083][ T393] rockchip_drm_atomic_helper_commit_tail_rpm+0x1b4/0x2c4 [ 29.253696][ T393] commit_tail+0xa4/0x154 [ 29.254065][ T393] drm_atomic_helper_commit+0x1c4/0x1e4 [ 29.254545][ T393] drm_atomic_commit+0xa4/0xd0 [ 29.254957][ T393] drm_mode_atomic_ioctl+0x5e4/0x754 [ 29.255414][ T393] drm_ioctl_kernel+0x80/0xf8 [ 29.255816][ T393] drm_ioctl+0x2d4/0x554 [ 29.256183][ T393] __arm64_sys_ioctl+0x90/0xc8 [ 29.256596][ T393] invoke_syscall+0x40/0x104 [ 29.256989][ T393] el0_svc_common+0xbc/0x168 [ 29.257380][ T393] do_el0_svc+0x1c/0x28 [ 29.257738][ T393] el0_svc+0x1c/0x68 [ 29.258075][ T393] el0t_64_sync_handler+0x68/0xb4 [ 29.258510][ T393] el0t_64_sync+0x164/0x168 Signed-off-by: Chaoyi Chen <chaoyi.chen@rock-chips.com> Change-Id: I1929270e920d469e6c12dca1301ac4fcc5e82fdc
This commit is contained in:
@@ -5540,10 +5540,11 @@ static void vop2_plane_atomic_disable(struct drm_plane *plane, struct drm_atomic
|
||||
*/
|
||||
static void vop2_plane_setup_color_key(struct drm_plane *plane)
|
||||
{
|
||||
struct drm_plane_state *pstate = plane->state;
|
||||
struct vop2_plane_state *vpstate = to_vop2_plane_state(pstate);
|
||||
struct drm_framebuffer *fb = pstate->fb;
|
||||
struct drm_plane_state *pstate;
|
||||
struct vop2_plane_state *vpstate;
|
||||
struct drm_framebuffer *fb;
|
||||
struct vop2_win *win = to_vop2_win(plane);
|
||||
struct vop2_win *left_win = NULL;
|
||||
struct vop2 *vop2 = win->vop2;
|
||||
uint32_t color_key_en = 0;
|
||||
uint32_t color_key;
|
||||
@@ -5551,8 +5552,22 @@ static void vop2_plane_setup_color_key(struct drm_plane *plane)
|
||||
uint32_t g = 0;
|
||||
uint32_t b = 0;
|
||||
|
||||
if (win->splice_mode_right) {
|
||||
pstate = win->left_win->base.state;
|
||||
left_win = win->left_win;
|
||||
} else {
|
||||
pstate = plane->state;
|
||||
}
|
||||
|
||||
vpstate = to_vop2_plane_state(pstate);
|
||||
if (!vpstate)
|
||||
return;
|
||||
fb = pstate->fb;
|
||||
|
||||
if (!(vpstate->color_key & VOP_COLOR_KEY_MASK) || fb->format->is_yuv) {
|
||||
VOP_WIN_SET(vop2, win, color_key_en, 0);
|
||||
if (left_win)
|
||||
VOP_WIN_SET(vop2, left_win, color_key_en, 0);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -5586,6 +5601,10 @@ static void vop2_plane_setup_color_key(struct drm_plane *plane)
|
||||
color_key = (r << 20) | (g << 10) | b;
|
||||
VOP_WIN_SET(vop2, win, color_key_en, color_key_en);
|
||||
VOP_WIN_SET(vop2, win, color_key, color_key);
|
||||
if (left_win) {
|
||||
VOP_WIN_SET(vop2, left_win, color_key_en, color_key_en);
|
||||
VOP_WIN_SET(vop2, left_win, color_key, color_key);
|
||||
}
|
||||
}
|
||||
|
||||
static void vop2_calc_drm_rect_for_splice(struct vop2_plane_state *vpstate,
|
||||
|
||||
Reference in New Issue
Block a user