diff options
-rw-r--r-- | drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c index aad105ba735f..91305eb7d312 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c | |||
@@ -1052,6 +1052,17 @@ static void vop_crtc_destroy(struct drm_crtc *crtc) | |||
1052 | drm_crtc_cleanup(crtc); | 1052 | drm_crtc_cleanup(crtc); |
1053 | } | 1053 | } |
1054 | 1054 | ||
1055 | static void vop_crtc_reset(struct drm_crtc *crtc) | ||
1056 | { | ||
1057 | if (crtc->state) | ||
1058 | __drm_atomic_helper_crtc_destroy_state(crtc->state); | ||
1059 | kfree(crtc->state); | ||
1060 | |||
1061 | crtc->state = kzalloc(sizeof(struct rockchip_crtc_state), GFP_KERNEL); | ||
1062 | if (crtc->state) | ||
1063 | crtc->state->crtc = crtc; | ||
1064 | } | ||
1065 | |||
1055 | static struct drm_crtc_state *vop_crtc_duplicate_state(struct drm_crtc *crtc) | 1066 | static struct drm_crtc_state *vop_crtc_duplicate_state(struct drm_crtc *crtc) |
1056 | { | 1067 | { |
1057 | struct rockchip_crtc_state *rockchip_state; | 1068 | struct rockchip_crtc_state *rockchip_state; |
@@ -1077,7 +1088,7 @@ static const struct drm_crtc_funcs vop_crtc_funcs = { | |||
1077 | .set_config = drm_atomic_helper_set_config, | 1088 | .set_config = drm_atomic_helper_set_config, |
1078 | .page_flip = drm_atomic_helper_page_flip, | 1089 | .page_flip = drm_atomic_helper_page_flip, |
1079 | .destroy = vop_crtc_destroy, | 1090 | .destroy = vop_crtc_destroy, |
1080 | .reset = drm_atomic_helper_crtc_reset, | 1091 | .reset = vop_crtc_reset, |
1081 | .atomic_duplicate_state = vop_crtc_duplicate_state, | 1092 | .atomic_duplicate_state = vop_crtc_duplicate_state, |
1082 | .atomic_destroy_state = vop_crtc_destroy_state, | 1093 | .atomic_destroy_state = vop_crtc_destroy_state, |
1083 | }; | 1094 | }; |