diff options
author | Guo, Bing <Bing.Guo@amd.com> | 2021-11-08 17:17:46 -0500 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2021-11-24 14:06:52 -0500 |
commit | f53e191e2be811158f59024524b509d39808e454 (patch) | |
tree | cc9accfaa0f9b8c018403006e4e6577b92f9740a /drivers/gpu/drm/amd/display/dc/dsc/rc_calc.c | |
parent | 6984fa418b8efde7662af151bae4b8dc66e65fcf (diff) | |
download | linux-f53e191e2be811158f59024524b509d39808e454.tar.gz linux-f53e191e2be811158f59024524b509d39808e454.tar.bz2 linux-f53e191e2be811158f59024524b509d39808e454.zip |
drm/amd/display: fixed an error related to 4:2:0/4:2:2 DSC
[Why]
OPTC_BYTES_PER_PIXEL calculation for 4:2:2 and 4:2:0 could have error.
[How]
Change to use following formula:
OPTC_DSC_BYTES_PER_PIXEL = ceiling((chunk size * 2^28) / slice width)
v2: squash in 64 bit divide fix (Alex)
Reviewed-by: Wenjing Liu <Wenjing.Liu@amd.com>
Acked-by: Qingqing Zhuo <qingqing.zhuo@amd.com>
Signed-off-by: Bing Guo <Bing.Guo@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/display/dc/dsc/rc_calc.c')
-rw-r--r-- | drivers/gpu/drm/amd/display/dc/dsc/rc_calc.c | 28 |
1 files changed, 0 insertions, 28 deletions
diff --git a/drivers/gpu/drm/amd/display/dc/dsc/rc_calc.c b/drivers/gpu/drm/amd/display/dc/dsc/rc_calc.c index b19d3aeb5962..e97cf09be9d5 100644 --- a/drivers/gpu/drm/amd/display/dc/dsc/rc_calc.c +++ b/drivers/gpu/drm/amd/display/dc/dsc/rc_calc.c @@ -60,31 +60,3 @@ void calc_rc_params(struct rc_params *rc, const struct drm_dsc_config *pps) pps->dsc_version_minor); DC_FP_END(); } - -/** - * calc_dsc_bytes_per_pixel - calculate bytes per pixel - * @pps: DRM struct with all required DSC values - * - * Based on the information inside drm_dsc_config, this function calculates the - * total of bytes per pixel. - * - * @note This calculation requires float point operation, most of it executes - * under kernel_fpu_{begin,end}. - * - * Return: - * Return the number of bytes per pixel - */ -u32 calc_dsc_bytes_per_pixel(const struct drm_dsc_config *pps) - -{ - u32 ret; - u16 drm_bpp = pps->bits_per_pixel; - int slice_width = pps->slice_width; - bool is_navite_422_or_420 = pps->native_422 || pps->native_420; - - DC_FP_START(); - ret = _do_bytes_per_pixel_calc(slice_width, drm_bpp, - is_navite_422_or_420); - DC_FP_END(); - return ret; -} |