drm/rockchip: vop: fix vop dynamic debug crash

If the old plane state is invalid, no printing should be performed,
otherwise panic will occur.

Fixes: 2e409456c1 ("drm/rockchip: add dynamic debug for vop")
Change-Id: I0687f9231c49bc068322f555f95af96a214b049d
Signed-off-by: Chaoyi Chen <chaoyi.chen@rock-chips.com>
This commit is contained in:
Chaoyi Chen
2023-12-08 11:30:25 +08:00
committed by Tao Huang
parent 923f3eaa06
commit 69e02ae984

View File

@@ -1879,12 +1879,12 @@ static void vop_plane_atomic_disable(struct drm_plane *plane,
to_vop_plane_state(plane->state);
#endif
rockchip_drm_dbg(vop->dev, VOP_DEBUG_PLANE, "disable win%d-area%d by %s\n",
win->win_id, win->area_id, current->comm);
if (!old_state->crtc)
return;
rockchip_drm_dbg(vop->dev, VOP_DEBUG_PLANE, "disable win%d-area%d by %s\n",
win->win_id, win->area_id, current->comm);
spin_lock(&vop->reg_lock);
vop_win_disable(vop, win);