[PATCH 093/120] drm/amd/display: Add surface to dm_plane_state if fb reserve fails

Harry Wentland harry.wentland at amd.com
Wed Aug 9 15:02:19 UTC 2017


From: Jerry Zuo <Jerry.Zuo at amd.com>

Change-Id: I115094eb751990d99116f150811b6071f5f5bbc7
Signed-off-by: Jerry Zuo <Jerry.Zuo at amd.com>
Reviewed-by: Harry Wentland <Harry.Wentland at amd.com>
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 11 +++++------
 1 file changed, 5 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 0ea07b975624..d271ccee3e09 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -4865,6 +4865,11 @@ int amdgpu_dm_atomic_check(struct drm_device *dev,
 
 				dc_plane_state = dc_create_plane_state(dc);
 
+				if (dm_plane_state->dc_state)
+					dc_plane_state_release(dm_plane_state->dc_state);
+
+				dm_plane_state->dc_state = dc_plane_state;
+
 				ret = fill_plane_attributes(
 					plane_crtc->dev->dev_private,
 					dc_plane_state,
@@ -4874,12 +4879,6 @@ int amdgpu_dm_atomic_check(struct drm_device *dev,
 				if (ret)
 					goto fail;
 
-
-				if (dm_plane_state->dc_state)
-					dc_plane_state_release(dm_plane_state->dc_state);
-
-				dm_plane_state->dc_state = dc_plane_state;
-
 				add_val_sets_plane(set,
 						     set_count,
 						     new_acrtc_state->stream,
-- 
2.11.0



More information about the amd-gfx mailing list