drm/amd/display: ASSERT on dc_create_state failing.
authorLeo (Sunpeng) Li <sunpeng.li@amd.com>
Fri, 6 Oct 2017 19:11:41 +0000 (15:11 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Sat, 21 Oct 2017 20:50:16 +0000 (16:50 -0400)
dc_create_state() returns NULL on allocation failure. Raise warning when
that happens.

Signed-off-by: Leo (Sunpeng) Li <sunpeng.li@amd.com>
Reviewed-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c

index fad40da8422eca591da903aa9a313e44f1ab8f3b..e439363ed54b4900f24dccdf072fff7ecb313658 100644 (file)
@@ -702,6 +702,7 @@ int amdgpu_dm_display_resume(struct amdgpu_device *adev)
        dc_release_state(cached_state->context);
 
        cached_state->context = dc_create_state();
+       ASSERT(cached_state->context);
        dc_resource_state_copy_construct_current(adev->dm.dc, cached_state->context);
 
        for_each_new_crtc_in_state(adev->dm.cached_state, crtc, new_crtc_state, i) {