mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git
synced 2026-04-21 04:53:46 -04:00
drm/display/dsc: add helper to set semi-const parameters
Add a helper setting config values which are typically constant across operating modes (table E-4 of the standard) and mux_word_size (which is a const according to 3.5.2). Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Reviewed-by: Marijn Suijten <marijn.suijten@somainline.org> Signed-off-by: Jessica Zhang <quic_jesszhan@quicinc.com> Patchwork: https://patchwork.freedesktop.org/patch/539280/ Link: https://lore.kernel.org/r/20230329-rfc-msm-dsc-helper-v14-2-bafc7be95691@quicinc.com Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
This commit is contained in:
@@ -270,6 +270,28 @@ void drm_dsc_pps_payload_pack(struct drm_dsc_picture_parameter_set *pps_payload,
|
||||
}
|
||||
EXPORT_SYMBOL(drm_dsc_pps_payload_pack);
|
||||
|
||||
/**
|
||||
* drm_dsc_set_const_params() - Set DSC parameters considered typically
|
||||
* constant across operation modes
|
||||
*
|
||||
* @vdsc_cfg:
|
||||
* DSC Configuration data partially filled by driver
|
||||
*/
|
||||
void drm_dsc_set_const_params(struct drm_dsc_config *vdsc_cfg)
|
||||
{
|
||||
if (!vdsc_cfg->rc_model_size)
|
||||
vdsc_cfg->rc_model_size = DSC_RC_MODEL_SIZE_CONST;
|
||||
vdsc_cfg->rc_edge_factor = DSC_RC_EDGE_FACTOR_CONST;
|
||||
vdsc_cfg->rc_tgt_offset_high = DSC_RC_TGT_OFFSET_HI_CONST;
|
||||
vdsc_cfg->rc_tgt_offset_low = DSC_RC_TGT_OFFSET_LO_CONST;
|
||||
|
||||
if (vdsc_cfg->bits_per_component <= 10)
|
||||
vdsc_cfg->mux_word_size = DSC_MUX_WORD_SIZE_8_10_BPC;
|
||||
else
|
||||
vdsc_cfg->mux_word_size = DSC_MUX_WORD_SIZE_12_BPC;
|
||||
}
|
||||
EXPORT_SYMBOL(drm_dsc_set_const_params);
|
||||
|
||||
/* From DSC_v1.11 spec, rc_parameter_Set syntax element typically constant */
|
||||
static const u16 drm_dsc_rc_buf_thresh[] = {
|
||||
896, 1792, 2688, 3584, 4480, 5376, 6272, 6720, 7168, 7616,
|
||||
|
||||
Reference in New Issue
Block a user