Commit 53d35dc6 authored by Andrey Grodzovsky's avatar Andrey Grodzovsky Committed by Alex Deucher

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: default avatarAndrey Grodzovsky <Andrey.Grodzovsky@amd.com>
Acked-by: default avatarHarry Wentland <Harry.Wentland@amd.com>
Reviewed-by: default avatarAndrey Grodzovsky <Andrey.Grodzovsky@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 0e19401f
...@@ -2392,7 +2392,7 @@ void amdgpu_dm_atomic_commit_tail( ...@@ -2392,7 +2392,7 @@ void amdgpu_dm_atomic_commit_tail(
} }
/* DC is optimized not to do anything if 'streams' didn't change. */ /* 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) { list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) {
struct amdgpu_crtc *acrtc = to_amdgpu_crtc(crtc); struct amdgpu_crtc *acrtc = to_amdgpu_crtc(crtc);
...@@ -2858,6 +2858,8 @@ int amdgpu_dm_atomic_check(struct drm_device *dev, ...@@ -2858,6 +2858,8 @@ int amdgpu_dm_atomic_check(struct drm_device *dev,
ret = drm_atomic_add_affected_planes(state, crtc); ret = drm_atomic_add_affected_planes(state, crtc);
if (ret) if (ret)
return ret; return ret;
ret = -EINVAL;
} }
for (i = 0; i < set_count; i++) { for (i = 0; i < set_count; i++) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment