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

drm/amd/display: Add interface to adjust DSC max target bpp limit

[Why]
For some use cases we need to be able to adjust the maximum target bpp
allowed by DSC policy.

[How]
New interface dc_dsc_policy_set_max_target_bpp_limit

Signed-off-by: Joshua Aberback <joshua.aberback@amd.com>
Reviewed-by: Nikola Cornij <Nikola.Cornij@amd.com>
Acked-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Joshua Aberback and committed by
Alex Deucher
6026be69 663bfef0

+13 -3
+2
drivers/gpu/drm/amd/display/dc/dc_dsc.h
··· 77 77 void dc_dsc_get_policy_for_timing(const struct dc_crtc_timing *timing, 78 78 struct dc_dsc_policy *policy); 79 79 80 + void dc_dsc_policy_set_max_target_bpp_limit(uint32_t limit); 81 + 80 82 #endif
+11 -3
drivers/gpu/drm/amd/display/dc/dsc/dc_dsc.c
··· 29 29 30 30 /* This module's internal functions */ 31 31 32 + /* default DSC policy target bitrate limit is 16bpp */ 33 + static uint32_t dsc_policy_max_target_bpp_limit = 16; 34 + 32 35 static uint32_t dc_dsc_bandwidth_in_kbps_from_timing( 33 36 const struct dc_crtc_timing *timing) 34 37 { ··· 954 951 default: 955 952 return; 956 953 } 957 - /* internal upper limit to 16 bpp */ 958 - if (policy->max_target_bpp > 16) 959 - policy->max_target_bpp = 16; 954 + /* internal upper limit, default 16 bpp */ 955 + if (policy->max_target_bpp > dsc_policy_max_target_bpp_limit) 956 + policy->max_target_bpp = dsc_policy_max_target_bpp_limit; 957 + } 958 + 959 + void dc_dsc_policy_set_max_target_bpp_limit(uint32_t limit) 960 + { 961 + dsc_policy_max_target_bpp_limit = limit; 960 962 }