summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrey Grodzovsky <Andrey.Grodzovsky@amd.com>2017-03-16 15:51:00 -0400
committerHarry Wentland <harry.wentland@amd.com>2017-03-28 19:21:44 -0400
commit88b530a05c6329c1907d89f17666b02246eeca00 (patch)
tree322354a0b44fb3308a05e40add830e0f77069dea
parent23e735441d36518443a91c8331629c4841515c90 (diff)
drm/amd/display: Fix the NULL pointer. (v2)
ret value in amdgpu_dm_atomic_check was not rest to EINVAL after drm_atomic_add_affected_planes and by this making any subsequent validation failure pass when returning to atomic_check. v2: Add WARN_ON print for dc_commit_streams in amdgpu_dm_atomic_commit_tail since this should never fail. Change-Id: Ib12655cf88aa3e56c3f1f11456cc6ca11daaa26a Signed-off-by: Andrey Grodzovsky <Andrey.Grodzovsky@amd.com> Acked-by: Harry Wentland <Harry.Wentland@amd.com> Reviewed-by: Andrey Grodzovsky <Andrey.Grodzovsky@amd.com>
-rw-r--r--drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_types.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_types.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_types.c
index 7661242b281c..c80c775b5cbc 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_types.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_types.c
@@ -2602,7 +2602,7 @@ void amdgpu_dm_atomic_commit_tail(
}
/* DC is optimized not to do anything if 'streams' didn't change. */
- dc_commit_streams(dm->dc, commit_streams, commit_streams_count);
+ WARN_ON(!dc_commit_streams(dm->dc, commit_streams, commit_streams_count));
list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) {
struct amdgpu_crtc *acrtc = to_amdgpu_crtc(crtc);
@@ -3068,6 +3068,8 @@ int amdgpu_dm_atomic_check(struct drm_device *dev,
ret = drm_atomic_add_affected_planes(state, crtc);
if (ret)
return ret;
+
+ ret = -EINVAL;
}
for (i = 0; i < set_count; i++) {