drm/rockchip: vop2: fix NULL point when dump regs or active_regs

when vp0 is disabled, the vop2->vps[0].rockchip_crtc.crtc.state is NULL.

Signed-off-by: Sandy Huang <hjc@rock-chips.com>
Change-Id: I93b3ea4f3ddc6076f2105ebcabf7317627b602a3
This commit is contained in:
Sandy Huang
2023-11-02 09:55:51 +08:00
parent 4334bb68c1
commit fb2ea0c6bc

View File

@@ -6326,7 +6326,8 @@ static void vop2_crtc_regs_dump(struct drm_crtc *crtc, struct seq_file *s)
/* only need to dump once at first active crtc for vop2 */
for (i = 0; i < vop2_data->nr_vps; i++) {
if (vop2->vps[i].rockchip_crtc.crtc.state->active) {
if (vop2->vps[i].rockchip_crtc.crtc.state &&
vop2->vps[i].rockchip_crtc.crtc.state->active) {
first_active_crtc = &vop2->vps[i].rockchip_crtc.crtc;
break;
}
@@ -6369,7 +6370,8 @@ static void vop2_crtc_active_regs_dump(struct drm_crtc *crtc, struct seq_file *s
/* only need to dump once at first active crtc for vop2 */
for (i = 0; i < vop2_data->nr_vps; i++) {
if (vop2->vps[i].rockchip_crtc.crtc.state->active) {
if (vop2->vps[i].rockchip_crtc.crtc.state &&
vop2->vps[i].rockchip_crtc.crtc.state->active) {
first_active_crtc = &vop2->vps[i].rockchip_crtc.crtc;
break;
}