drm/amd/display: Destroy DC context while keeping DML and DML2
authorMario Limonciello <mario.limonciello@amd.com>
Fri, 6 Oct 2023 18:50:25 +0000 (13:50 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 13 Oct 2023 15:01:24 +0000 (11:01 -0400)
commit06ad7e16425619a4a77154c2e85bededb3e04a4f
treecc30491ef5978a2ea8463f89a68d6058620786f8
parentf7fbf79fb5682db0865754765f10584245d291e8
drm/amd/display: Destroy DC context while keeping DML and DML2

If there is memory pressure at suspend time then dynamically
allocating a large structure as part of DC suspend code will
fail.

Instead re-use the same structures and clear all members except
those that should be maintained.

Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2362
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/core/dc.c
drivers/gpu/drm/amd/display/dc/core/dc_resource.c