[04/17] drm/amd: Convert to using __drm_atomic_helper_crtc_reset() for reset.
diff mbox series

Message ID 20190301125627.7285-5-maarten.lankhorst@linux.intel.com
State New
Headers show
Series
  • drm: Start subclassing crtc_state.
Related show

Commit Message

Maarten Lankhorst March 1, 2019, 12:56 p.m. UTC
Convert amd to using __drm_atomic_helper_crtc_reset(), instead of
writing its own version.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Harry Wentland <harry.wentland@amd.com>
Cc: Leo Li <sunpeng.li@amd.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: "Christian K├Ânig" <christian.koenig@amd.com>
Cc: "David (ChunMing) Zhou" <David1.Zhou@amd.com>
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

Patch
diff mbox series

diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
index 0642dfe22582..975ed22e39d2 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -3072,18 +3072,12 @@  static void dm_crtc_destroy_state(struct drm_crtc *crtc,
 
 static void dm_crtc_reset_state(struct drm_crtc *crtc)
 {
-	struct dm_crtc_state *state;
+	struct dm_crtc_state *state = kzalloc(sizeof(*state), GFP_KERNEL);
 
 	if (crtc->state)
 		dm_crtc_destroy_state(crtc, crtc->state);
 
-	state = kzalloc(sizeof(*state), GFP_KERNEL);
-	if (WARN_ON(!state))
-		return;
-
-	crtc->state = &state->base;
-	crtc->state->crtc = crtc;
-
+	__drm_atomic_helper_crtc_reset(crtc, &state->base);
 }
 
 static struct drm_crtc_state *