Skip to content

Commit f7d0157

Browse files
charliu-AMDENGalexdeucher
authored andcommitted
drm/amd/display: avoid crash and add z8_marks related in dml
[why] add dml1 used calculate_wm_and_dlg function pointer check to prevent crash. add z8 watermarks to struct for later asic use Reviewed-by: Alvin Lee <alvin.lee2@amd.com> Acked-by: Stylon Wang <stylon.wang@amd.com> Signed-off-by: Charlene Liu <charlene.liu@amd.com> Tested-by: Daniel Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
1 parent 53f3288 commit f7d0157

4 files changed

Lines changed: 8 additions & 5 deletions

File tree

drivers/gpu/drm/amd/display/dc/dcn30/dcn30_resource.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2063,7 +2063,8 @@ bool dcn30_validate_bandwidth(struct dc *dc,
20632063
}
20642064

20652065
DC_FP_START();
2066-
dc->res_pool->funcs->calculate_wm_and_dlg(dc, context, pipes, pipe_cnt, vlevel);
2066+
if (dc->res_pool->funcs->calculate_wm_and_dlg)
2067+
dc->res_pool->funcs->calculate_wm_and_dlg(dc, context, pipes, pipe_cnt, vlevel);
20672068
DC_FP_END();
20682069

20692070
BW_VAL_TRACE_END_WATERMARKS();

drivers/gpu/drm/amd/display/dc/dcn31/dcn31_resource.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1781,8 +1781,8 @@ bool dcn31_validate_bandwidth(struct dc *dc,
17811781
BW_VAL_TRACE_SKIP(fast);
17821782
goto validate_out;
17831783
}
1784-
1785-
dc->res_pool->funcs->calculate_wm_and_dlg(dc, context, pipes, pipe_cnt, vlevel);
1784+
if (dc->res_pool->funcs->calculate_wm_and_dlg)
1785+
dc->res_pool->funcs->calculate_wm_and_dlg(dc, context, pipes, pipe_cnt, vlevel);
17861786

17871787
BW_VAL_TRACE_END_WATERMARKS();
17881788

drivers/gpu/drm/amd/display/dc/dcn314/dcn314_resource.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1740,8 +1740,8 @@ bool dcn314_validate_bandwidth(struct dc *dc,
17401740
BW_VAL_TRACE_SKIP(fast);
17411741
goto validate_out;
17421742
}
1743-
1744-
dc->res_pool->funcs->calculate_wm_and_dlg(dc, context, pipes, pipe_cnt, vlevel);
1743+
if (dc->res_pool->funcs->calculate_wm_and_dlg)
1744+
dc->res_pool->funcs->calculate_wm_and_dlg(dc, context, pipes, pipe_cnt, vlevel);
17451745

17461746
BW_VAL_TRACE_END_WATERMARKS();
17471747

drivers/gpu/drm/amd/display/dc/inc/hw/dchubbub.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ struct dcn_hubbub_wm_set {
4949
uint32_t dram_clk_change;
5050
uint32_t usr_retrain;
5151
uint32_t fclk_pstate_change;
52+
uint32_t sr_enter_exit_Z8;
53+
uint32_t sr_enter_Z8;
5254
};
5355

5456
struct dcn_hubbub_wm {

0 commit comments

Comments
 (0)