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

drm/amd/display: Add margin on DRR vblank start for subvp

[Description]
- Add margin for HUBP "jitter" for SubVp + DRR case
- Also do a min transition even if MPO is added on a
non SubVP pipe (i.e. added on DRR pipe for SubVP + DRR)

Reviewed-by: Jun Lei <Jun.Lei@amd.com>
Acked-by: Brian Chang <Brian.Chang@amd.com>
Signed-off-by: Alvin Lee <Alvin.Lee2@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Alvin Lee and committed by
Alex Deucher
ae7169a9 2aae5944

+24 -3
+17 -1
drivers/gpu/drm/amd/display/dc/core/dc.c
··· 3740 3740 3741 3741 struct dc_stream_status *cur_stream_status = stream_get_status(dc->current_state, stream); 3742 3742 bool force_minimal_pipe_splitting = false; 3743 + bool subvp_active = false; 3744 + uint32_t i; 3743 3745 3744 3746 *is_plane_addition = false; 3745 3747 ··· 3773 3771 } 3774 3772 } 3775 3773 3774 + for (i = 0; i < dc->res_pool->pipe_count; i++) { 3775 + struct pipe_ctx *pipe = &dc->current_state->res_ctx.pipe_ctx[i]; 3776 + 3777 + if (pipe->stream && pipe->stream->mall_stream_config.type != SUBVP_NONE) { 3778 + subvp_active = true; 3779 + break; 3780 + } 3781 + } 3782 + 3776 3783 /* For SubVP when adding or removing planes we need to add a minimal transition 3777 3784 * (even when disabling all planes). Whenever disabling a phantom pipe, we 3778 3785 * must use the minimal transition path to disable the pipe correctly. 3786 + * 3787 + * We want to use the minimal transition whenever subvp is active, not only if 3788 + * a plane is being added / removed from a subvp stream (MPO plane can be added 3789 + * to a DRR pipe of SubVP + DRR config, in which case we still want to run through 3790 + * a min transition to disable subvp. 3779 3791 */ 3780 - if (cur_stream_status && stream->mall_stream_config.type == SUBVP_MAIN) { 3792 + if (cur_stream_status && subvp_active) { 3781 3793 /* determine if minimal transition is required due to SubVP*/ 3782 3794 if (cur_stream_status->plane_count > surface_count) { 3783 3795 force_minimal_pipe_splitting = true;
+1
drivers/gpu/drm/amd/display/dc/dc.h
··· 267 267 uint16_t subvp_pstate_allow_width_us; 268 268 uint16_t subvp_vertical_int_margin_us; 269 269 bool seamless_odm; 270 + uint8_t subvp_drr_vblank_start_margin_us; 270 271 }; 271 272 272 273 struct dc_bug_wa {
+1
drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c
··· 493 493 494 494 pipe_data->pipe_config.vblank_data.drr_info.min_vtotal_supported = min_vtotal_supported; 495 495 pipe_data->pipe_config.vblank_data.drr_info.max_vtotal_supported = max_vtotal_supported; 496 + pipe_data->pipe_config.vblank_data.drr_info.drr_vblank_start_margin = dc->caps.subvp_drr_vblank_start_margin_us; 496 497 } 497 498 498 499 /**
+1 -1
drivers/gpu/drm/amd/display/dc/dc_stream.h
··· 144 144 unsigned int cust_pattern_size; 145 145 }; 146 146 147 - #define SUBVP_DRR_MARGIN_US 500 // 500us for DRR margin (SubVP + DRR) 147 + #define SUBVP_DRR_MARGIN_US 600 // 600us for DRR margin (SubVP + DRR) 148 148 149 149 enum mall_stream_type { 150 150 SUBVP_NONE, // subvp not in use
+1
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource.c
··· 2124 2124 dc->caps.subvp_swath_height_margin_lines = 16; 2125 2125 dc->caps.subvp_pstate_allow_width_us = 20; 2126 2126 dc->caps.subvp_vertical_int_margin_us = 30; 2127 + dc->caps.subvp_drr_vblank_start_margin_us = 100; // 100us margin 2127 2128 2128 2129 dc->caps.max_slave_planes = 2; 2129 2130 dc->caps.max_slave_yuv_planes = 2;
+1
drivers/gpu/drm/amd/display/dc/dcn321/dcn321_resource.c
··· 1711 1711 dc->caps.subvp_swath_height_margin_lines = 16; 1712 1712 dc->caps.subvp_pstate_allow_width_us = 20; 1713 1713 dc->caps.subvp_vertical_int_margin_us = 30; 1714 + dc->caps.subvp_drr_vblank_start_margin_us = 100; // 100us margin 1714 1715 dc->caps.max_slave_planes = 1; 1715 1716 dc->caps.max_slave_yuv_planes = 1; 1716 1717 dc->caps.max_slave_rgb_planes = 1;
+2 -1
drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h
··· 1029 1029 uint16_t vtotal; 1030 1030 uint16_t htotal; 1031 1031 uint8_t vblank_pipe_index; 1032 - uint8_t padding[2]; 1032 + uint8_t padding[1]; 1033 1033 struct { 1034 1034 uint8_t drr_in_use; 1035 1035 uint8_t drr_window_size_ms; // Indicates largest VMIN/VMAX adjustment per frame 1036 1036 uint16_t min_vtotal_supported; // Min VTOTAL that supports switching in VBLANK 1037 1037 uint16_t max_vtotal_supported; // Max VTOTAL that can support SubVP static scheduling 1038 1038 uint8_t use_ramping; // Use ramping or not 1039 + uint8_t drr_vblank_start_margin; 1039 1040 } drr_info; // DRR considered as part of SubVP + VBLANK case 1040 1041 } vblank_data; 1041 1042 } pipe_config;