Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm/rockchip: vop2: Add missing call to crtc reset helper

Add missing call to crtc reset helper to properly vblank reset.

Also move vop2_crtc_reset and call vop2_crtc_destroy_state to simplify
and remove duplicated code.

Fixes: 604be85547ce ("drm/rockchip: Add VOP2 driver")
Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20230621223311.2239547-6-jonas@kwiboo.se

authored by

Jonas Karlman and committed by
Heiko Stuebner
4d49d87b 342f7e49

+14 -17
+14 -17
drivers/gpu/drm/rockchip/rockchip_drm_vop2.c
··· 2079 2079 .atomic_disable = vop2_crtc_atomic_disable, 2080 2080 }; 2081 2081 2082 - static void vop2_crtc_reset(struct drm_crtc *crtc) 2083 - { 2084 - struct rockchip_crtc_state *vcstate = to_rockchip_crtc_state(crtc->state); 2085 - 2086 - if (crtc->state) { 2087 - __drm_atomic_helper_crtc_destroy_state(crtc->state); 2088 - kfree(vcstate); 2089 - } 2090 - 2091 - vcstate = kzalloc(sizeof(*vcstate), GFP_KERNEL); 2092 - if (!vcstate) 2093 - return; 2094 - 2095 - crtc->state = &vcstate->base; 2096 - crtc->state->crtc = crtc; 2097 - } 2098 - 2099 2082 static struct drm_crtc_state *vop2_crtc_duplicate_state(struct drm_crtc *crtc) 2100 2083 { 2101 2084 struct rockchip_crtc_state *vcstate; ··· 2103 2120 2104 2121 __drm_atomic_helper_crtc_destroy_state(&vcstate->base); 2105 2122 kfree(vcstate); 2123 + } 2124 + 2125 + static void vop2_crtc_reset(struct drm_crtc *crtc) 2126 + { 2127 + struct rockchip_crtc_state *vcstate = 2128 + kzalloc(sizeof(*vcstate), GFP_KERNEL); 2129 + 2130 + if (crtc->state) 2131 + vop2_crtc_destroy_state(crtc, crtc->state); 2132 + 2133 + if (vcstate) 2134 + __drm_atomic_helper_crtc_reset(crtc, &vcstate->base); 2135 + else 2136 + __drm_atomic_helper_crtc_reset(crtc, NULL); 2106 2137 } 2107 2138 2108 2139 static const struct drm_crtc_funcs vop2_crtc_funcs = {