From ac0a8d068a9401824d445698b3f28fd1ab7f1ad1 Mon Sep 17 00:00:00 2001 From: Xiaojie Yuan Date: Tue, 12 Dec 2017 11:53:08 +0800 Subject: [PATCH 2851/4131] drm/amdkcl: [4.10] free atomic state on successful atomic commit prior to 4.10 DRM core, refcount for atomic state hasn't been introduced. driver takes ownership of atomic state on successful atomic commit, so it's driver's responsiblity to free it. v2: remove drm_atomic_state_free() after resume helper Change-Id: I69f15a9e8d8123a5c2a39f8bed165e87648809e1 Signed-off-by: Xiaojie Yuan Reviewed-by: Harry Wentland --- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) 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 fdcdb00..56def60 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -751,14 +751,9 @@ int amdgpu_dm_display_resume(struct amdgpu_device *adev) ret = drm_atomic_helper_resume(ddev, adev->dm.cached_state); - -#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0) -#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0) && !defined(OS_NAME_RHEL_7_4) - drm_atomic_state_free(adev->dm.cached_state); -#else +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 10, 0) && LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)) || defined(OS_NAME_RHEL_7_4) drm_atomic_state_put(adev->dm.cached_state); #endif -#endif adev->dm.cached_state = NULL; amdgpu_dm_irq_resume_late(adev); @@ -4469,6 +4464,8 @@ static int amdgpu_dm_atomic_commit(struct drm_device *dev, drm_atomic_helper_cleanup_planes(dev, state); } + drm_atomic_state_free(state); + return ret; #endif } -- 2.7.4