Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/amd/display: Update HPO I/O When Handling Link Retrain Automation Request

[WHY]
Previous multi-display HPO fix moved where HPO I/O enable/disable is performed.
The codepath now taken to enable/disable HPO I/O is not used for compliance
test automation, meaning that if a compliance box being driven at a DP1 rate
requests retrain at UHBR, HPO I/O will remain off if it was previously off.

[HOW]
Explicitly update HPO I/O after allocating encoders for test request.

Reviewed-by: Charlene Liu <charlene.liu@amd.com>
Reviewed-by: Wenjing Liu <wenjing.liu@amd.com>
Signed-off-by: Michael Strauss <michael.strauss@amd.com>
Signed-off-by: Roman Li <roman.li@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Michael Strauss and committed by
Alex Deucher
9de60462 18ac82c2

+31 -17
+13
drivers/gpu/drm/amd/display/dc/core/dc_resource.c
··· 5303 5303 } 5304 5304 return det_segments; 5305 5305 } 5306 + 5307 + bool resource_is_hpo_acquired(struct dc_state *context) 5308 + { 5309 + int i; 5310 + 5311 + for (i = 0; i < MAX_HPO_DP2_ENCODERS; i++) { 5312 + if (context->res_ctx.is_hpo_dp_stream_enc_acquired[i]) { 5313 + return true; 5314 + } 5315 + } 5316 + 5317 + return false; 5318 + }
+4 -17
drivers/gpu/drm/amd/display/dc/hwss/dce110/dce110_hwseq.c
··· 2350 2350 } 2351 2351 } 2352 2352 2353 - static bool dce110_is_hpo_enabled(struct dc_state *context) 2354 - { 2355 - int i; 2356 - 2357 - for (i = 0; i < MAX_HPO_DP2_ENCODERS; i++) { 2358 - if (context->res_ctx.is_hpo_dp_stream_enc_acquired[i]) { 2359 - return true; 2360 - } 2361 - } 2362 - 2363 - return false; 2364 - } 2365 - 2366 2353 enum dc_status dce110_apply_ctx_to_hw( 2367 2354 struct dc *dc, 2368 2355 struct dc_state *context) ··· 2358 2371 struct dc_bios *dcb = dc->ctx->dc_bios; 2359 2372 enum dc_status status; 2360 2373 int i; 2361 - bool was_hpo_enabled = dce110_is_hpo_enabled(dc->current_state); 2362 - bool is_hpo_enabled = dce110_is_hpo_enabled(context); 2374 + bool was_hpo_acquired = resource_is_hpo_acquired(dc->current_state); 2375 + bool is_hpo_acquired = resource_is_hpo_acquired(context); 2363 2376 2364 2377 /* reset syncd pipes from disabled pipes */ 2365 2378 if (dc->config.use_pipe_ctx_sync_logic) ··· 2402 2415 2403 2416 dce110_setup_audio_dto(dc, context); 2404 2417 2405 - if (dc->hwseq->funcs.setup_hpo_hw_control && was_hpo_enabled != is_hpo_enabled) { 2406 - dc->hwseq->funcs.setup_hpo_hw_control(dc->hwseq, is_hpo_enabled); 2418 + if (dc->hwseq->funcs.setup_hpo_hw_control && was_hpo_acquired != is_hpo_acquired) { 2419 + dc->hwseq->funcs.setup_hpo_hw_control(dc->hwseq, is_hpo_acquired); 2407 2420 } 2408 2421 2409 2422 for (i = 0; i < dc->res_pool->pipe_count; i++) {
+1
drivers/gpu/drm/amd/display/dc/hwss/dcn31/dcn31_init.c
··· 111 111 .optimize_pwr_state = dcn21_optimize_pwr_state, 112 112 .exit_optimized_pwr_state = dcn21_exit_optimized_pwr_state, 113 113 .update_visual_confirm_color = dcn10_update_visual_confirm_color, 114 + .setup_hpo_hw_control = dcn31_setup_hpo_hw_control, 114 115 }; 115 116 116 117 static const struct hwseq_private_funcs dcn31_private_funcs = {
+1
drivers/gpu/drm/amd/display/dc/hwss/dcn314/dcn314_init.c
··· 114 114 .exit_optimized_pwr_state = dcn21_exit_optimized_pwr_state, 115 115 .update_visual_confirm_color = dcn10_update_visual_confirm_color, 116 116 .calculate_pix_rate_divider = dcn314_calculate_pix_rate_divider, 117 + .setup_hpo_hw_control = dcn31_setup_hpo_hw_control, 117 118 }; 118 119 119 120 static const struct hwseq_private_funcs dcn314_private_funcs = {
+1
drivers/gpu/drm/amd/display/dc/hwss/dcn351/dcn351_init.c
··· 123 123 .set_long_vtotal = dcn35_set_long_vblank, 124 124 .calculate_pix_rate_divider = dcn32_calculate_pix_rate_divider, 125 125 .program_outstanding_updates = dcn32_program_outstanding_updates, 126 + .setup_hpo_hw_control = dcn35_setup_hpo_hw_control, 126 127 }; 127 128 128 129 static const struct hwseq_private_funcs dcn351_private_funcs = {
+1
drivers/gpu/drm/amd/display/dc/hwss/hw_sequencer.h
··· 461 461 void (*set_long_vtotal)(struct pipe_ctx **pipe_ctx, int num_pipes, uint32_t v_total_min, uint32_t v_total_max); 462 462 void (*program_outstanding_updates)(struct dc *dc, 463 463 struct dc_state *context); 464 + void (*setup_hpo_hw_control)(const struct dce_hwseq *hws, bool enable); 464 465 }; 465 466 466 467 void color_space_to_black_color(
+2
drivers/gpu/drm/amd/display/dc/inc/resource.h
··· 644 644 *Calculate total DET allocated for all pipes for a given OTG_MASTER pipe 645 645 */ 646 646 int resource_calculate_det_for_stream(struct dc_state *state, struct pipe_ctx *otg_master); 647 + 648 + bool resource_is_hpo_acquired(struct dc_state *context); 647 649 #endif /* DRIVERS_GPU_DRM_AMD_DC_DEV_DC_INC_RESOURCE_H_ */