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.

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>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
Andrey Grodzovsky 2017-03-16 15:51:00 -04:00 committed by Alex Deucher
parent 0e19401f95
commit 53d35dc60d
1 changed files with 3 additions and 1 deletions

View File

@ -2392,7 +2392,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);
@ -2858,6 +2858,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++) {