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

Configure Feed

Select the types of activity you want to include in your feed.

drm/amd/display: Fix DSC force enable on SST

[why]
Previously when force enabling DSC on SST display we unknowingly
supressed lane count, which caused DSC to be enabled automatically.

[how]
By adding an additional flag to force enable DSC in dc_dsc.c DSC can
always be enabled with debugfs dsc_clock_en forced to 1

Cc: stable@vger.kernel.org
Signed-off-by: Eryk Brol <eryk.brol@amd.com>
Signed-off-by: Mikita Lipski <mikita.lipski@amd.com>
Reviewed-by: Wenjing Liu <Wenjing.Liu@amd.com>
Acked-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Eryk Brol and committed by
Alex Deucher
bcc6aa61 4bb23a54

+21 -1
+3
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
··· 4646 4646 4647 4647 #if defined(CONFIG_DRM_AMD_DC_DCN) 4648 4648 if (dsc_caps.is_dsc_supported) { 4649 + /* Set DSC policy according to dsc_clock_en */ 4650 + dc_dsc_policy_set_enable_dsc_when_not_needed(aconnector->dsc_settings.dsc_clock_en); 4651 + 4649 4652 if (dc_dsc_compute_config(aconnector->dc_link->ctx->dc->res_pool->dscs[0], 4650 4653 &dsc_caps, 4651 4654 aconnector->dc_link->ctx->dc->debug.dsc_min_slice_height_override,
+3
drivers/gpu/drm/amd/display/dc/dc_dsc.h
··· 51 51 int min_slice_height; // Must not be less than 8 52 52 uint32_t max_target_bpp; 53 53 uint32_t min_target_bpp; 54 + bool enable_dsc_when_not_needed; 54 55 }; 55 56 56 57 bool dc_dsc_parse_dsc_dpcd(const struct dc *dc, ··· 80 79 struct dc_dsc_policy *policy); 81 80 82 81 void dc_dsc_policy_set_max_target_bpp_limit(uint32_t limit); 82 + 83 + void dc_dsc_policy_set_enable_dsc_when_not_needed(bool enable); 83 84 84 85 #endif
+15 -1
drivers/gpu/drm/amd/display/dc/dsc/dc_dsc.c
··· 34 34 /* default DSC policy target bitrate limit is 16bpp */ 35 35 static uint32_t dsc_policy_max_target_bpp_limit = 16; 36 36 37 + /* default DSC policy enables DSC only when needed */ 38 + static bool dsc_policy_enable_dsc_when_not_needed; 39 + 37 40 static uint32_t dc_dsc_bandwidth_in_kbps_from_timing( 38 41 const struct dc_crtc_timing *timing) 39 42 { ··· 363 360 364 361 get_dsc_bandwidth_range(policy->min_target_bpp, policy->max_target_bpp, 365 362 dsc_common_caps, timing, &range); 366 - if (target_bandwidth_kbps >= range.stream_kbps) { 363 + if (!policy->enable_dsc_when_not_needed && target_bandwidth_kbps >= range.stream_kbps) { 367 364 /* enough bandwidth without dsc */ 368 365 *target_bpp_x16 = 0; 369 366 should_use_dsc = false; ··· 964 961 /* internal upper limit, default 16 bpp */ 965 962 if (policy->max_target_bpp > dsc_policy_max_target_bpp_limit) 966 963 policy->max_target_bpp = dsc_policy_max_target_bpp_limit; 964 + 965 + /* enable DSC when not needed, default false */ 966 + if (dsc_policy_enable_dsc_when_not_needed) 967 + policy->enable_dsc_when_not_needed = dsc_policy_enable_dsc_when_not_needed; 968 + else 969 + policy->enable_dsc_when_not_needed = false; 967 970 } 968 971 969 972 void dc_dsc_policy_set_max_target_bpp_limit(uint32_t limit) 970 973 { 971 974 dsc_policy_max_target_bpp_limit = limit; 975 + } 976 + 977 + void dc_dsc_policy_set_enable_dsc_when_not_needed(bool enable) 978 + { 979 + dsc_policy_enable_dsc_when_not_needed = enable; 972 980 }