aboutsummaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/amd/display/dc/core
diff options
context:
space:
mode:
authorGravatar Dillon Varone <dillon.varone@amd.com> 2023-12-13 16:39:22 -0500
committerGravatar Alex Deucher <alexander.deucher@amd.com> 2023-12-19 14:59:03 -0500
commit08daec77fddf23cd246a0662c6dc0d60229caaee (patch)
treebfdee856dafb60686e06283fd01bf37d8909529f /drivers/gpu/drm/amd/display/dc/core
parentdrm/amd/display: Create dc_state after resource initialization (diff)
downloadlinux-08daec77fddf23cd246a0662c6dc0d60229caaee.tar.gz
linux-08daec77fddf23cd246a0662c6dc0d60229caaee.tar.bz2
linux-08daec77fddf23cd246a0662c6dc0d60229caaee.zip
drm/amd/display: Deep copy dml2_context when copying dc_state
[WHY&HOW] dml2_context should be deep copied from src to dst dc_state. Reviewed-by: George Shen <george.shen@amd.com> Acked-by: Wayne Lin <wayne.lin@amd.com> Signed-off-by: Dillon Varone <dillon.varone@amd.com> Tested-by: Daniel Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/display/dc/core')
-rw-r--r--drivers/gpu/drm/amd/display/dc/core/dc_state.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_state.c b/drivers/gpu/drm/amd/display/dc/core/dc_state.c
index 66a70a60c479..dd52cab7ecdf 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc_state.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc_state.c
@@ -212,10 +212,14 @@ struct dc_state *dc_state_create(struct dc *dc)
void dc_state_copy(struct dc_state *dst_state, struct dc_state *src_state)
{
struct kref refcount = dst_state->refcount;
+#ifdef CONFIG_DRM_AMD_DC_FP
+ struct dml2_context *dst_dml2 = dst_state->bw_ctx.dml2;
+#endif
dc_state_copy_internal(dst_state, src_state);
#ifdef CONFIG_DRM_AMD_DC_FP
+ dst_state->bw_ctx.dml2 = dst_dml2;
if (src_state->bw_ctx.dml2)
dml2_copy(dst_state->bw_ctx.dml2, src_state->bw_ctx.dml2);
#endif