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

drm/display/dsc: Add drm_dsc_get_bpp_int helper

Add helper to get the integer value of drm_dsc_config.bits_per_pixel

Reviewed-by: Marijn Suijten <marijn.suijten@somainline.org>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Signed-off-by: Jessica Zhang <quic_jesszhan@quicinc.com>
Patchwork: https://patchwork.freedesktop.org/patch/539268/
Link: https://lore.kernel.org/r/20230329-rfc-msm-dsc-helper-v14-3-bafc7be95691@quicinc.com
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>

authored by

Jessica Zhang and committed by
Dmitry Baryshkov
68858328 e871a70d

+14
+13
drivers/gpu/drm/display/drm_dsc_helper.c
··· 1437 1437 EXPORT_SYMBOL(drm_dsc_compute_rc_parameters); 1438 1438 1439 1439 /** 1440 + * drm_dsc_get_bpp_int() - Get integer bits per pixel value for the given DRM DSC config 1441 + * @vdsc_cfg: Pointer to DRM DSC config struct 1442 + * 1443 + * Return: Integer BPP value 1444 + */ 1445 + u32 drm_dsc_get_bpp_int(const struct drm_dsc_config *vdsc_cfg) 1446 + { 1447 + WARN_ON_ONCE(vdsc_cfg->bits_per_pixel & 0xf); 1448 + return vdsc_cfg->bits_per_pixel >> 4; 1449 + } 1450 + EXPORT_SYMBOL(drm_dsc_get_bpp_int); 1451 + 1452 + /** 1440 1453 * drm_dsc_initial_scale_value() - Calculate the initial scale value for the given DSC config 1441 1454 * @dsc: Pointer to DRM DSC config struct 1442 1455 *
+1
include/drm/display/drm_dsc_helper.h
··· 27 27 int drm_dsc_compute_rc_parameters(struct drm_dsc_config *vdsc_cfg); 28 28 u8 drm_dsc_initial_scale_value(const struct drm_dsc_config *dsc); 29 29 u32 drm_dsc_flatness_det_thresh(const struct drm_dsc_config *dsc); 30 + u32 drm_dsc_get_bpp_int(const struct drm_dsc_config *vdsc_cfg); 30 31 31 32 #endif /* _DRM_DSC_HELPER_H_ */ 32 33