]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/blobdiff - drivers/gpu/drm/arm/malidp_crtc.c
Merge tag 'perf-urgent-for-mingo-5.3-20190723' of git://git.kernel.org/pub/scm/linux...
[mirror_ubuntu-focal-kernel.git] / drivers / gpu / drm / arm / malidp_crtc.c
index eb33a811fd4af60c879d7aead9f98cc21c9ea1f4..db4451260fff320b62635a7ae56d9f3cd4f739ed 100644 (file)
@@ -459,23 +459,6 @@ static struct drm_crtc_state *malidp_crtc_duplicate_state(struct drm_crtc *crtc)
        return &state->base;
 }
 
-static void malidp_crtc_reset(struct drm_crtc *crtc)
-{
-       struct malidp_crtc_state *state = NULL;
-
-       if (crtc->state) {
-               state = to_malidp_crtc_state(crtc->state);
-               __drm_atomic_helper_crtc_destroy_state(crtc->state);
-       }
-
-       kfree(state);
-       state = kzalloc(sizeof(*state), GFP_KERNEL);
-       if (state) {
-               crtc->state = &state->base;
-               crtc->state->crtc = crtc;
-       }
-}
-
 static void malidp_crtc_destroy_state(struct drm_crtc *crtc,
                                      struct drm_crtc_state *state)
 {
@@ -489,6 +472,17 @@ static void malidp_crtc_destroy_state(struct drm_crtc *crtc,
        kfree(mali_state);
 }
 
+static void malidp_crtc_reset(struct drm_crtc *crtc)
+{
+       struct malidp_crtc_state *state =
+               kzalloc(sizeof(*state), GFP_KERNEL);
+
+       if (crtc->state)
+               malidp_crtc_destroy_state(crtc, crtc->state);
+
+       __drm_atomic_helper_crtc_reset(crtc, &state->base);
+}
+
 static int malidp_crtc_enable_vblank(struct drm_crtc *crtc)
 {
        struct malidp_drm *malidp = crtc_to_malidp_device(crtc);