Linux ARM-MSM sub-architecture
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Jessica Zhang <quic_jesszhan@quicinc.com>
Cc: freedreno@lists.freedesktop.org, linux-arm-msm@vger.kernel.org,
	Abhinav Kumar <quic_abhinavk@quicinc.com>,
	dri-devel@lists.freedesktop.org,
	Kuogee Hsieh <quic_khsieh@quicinc.com>,
	Konrad Dybcio <konrad.dybcio@linaro.org>,
	Dmitry Baryshkov <dmitry.baryshkov@linaro.org>,
	Marijn Suijten <marijn.suijten@somainline.org>,
	Sean Paul <sean@poorly.run>
Subject: Re: [PATCH v9 1/8] drm/display/dsc: Add flatness and initial scale value calculations
Date: Thu, 11 May 2023 15:30:49 +0300	[thread overview]
Message-ID: <ZFzf-firnfYKwmy1@intel.com> (raw)
In-Reply-To: <20230329-rfc-msm-dsc-helper-v9-1-87daeaec2c0a@quicinc.com>

On Wed, May 10, 2023 at 03:54:41PM -0700, Jessica Zhang wrote:
> Add helpers to calculate det_thresh_flatness and initial_scale_value as
> these calculations are defined within the DSC spec.
> 
> Signed-off-by: Jessica Zhang <quic_jesszhan@quicinc.com>
> 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>
> ---
>  include/drm/display/drm_dsc_helper.h | 11 +++++++++++
>  1 file changed, 11 insertions(+)
> 
> diff --git a/include/drm/display/drm_dsc_helper.h b/include/drm/display/drm_dsc_helper.h
> index 0bb0c3afd740..422135a33d65 100644
> --- a/include/drm/display/drm_dsc_helper.h
> +++ b/include/drm/display/drm_dsc_helper.h
> @@ -25,5 +25,16 @@ void drm_dsc_set_rc_buf_thresh(struct drm_dsc_config *vdsc_cfg);
>  int drm_dsc_setup_rc_params(struct drm_dsc_config *vdsc_cfg, enum drm_dsc_params_kind kind);
>  int drm_dsc_compute_rc_parameters(struct drm_dsc_config *vdsc_cfg);
>  
> +static inline void drm_dsc_set_initial_scale_value(struct drm_dsc_config *dsc)
> +{
> +	dsc->initial_scale_value = 8 * dsc->rc_model_size /
> +		(dsc->rc_model_size - dsc->initial_offset);
> +}

I would suggest using pure functions whenever possible. Makes it much
easier to reason about the code when you know there are no side effects.

> +
> +static inline int drm_dsc_calculate_flatness_det_thresh(struct drm_dsc_config *dsc)

'dsc' can be const. The word "calculate" seems pretty much redundant.

> +{
> +	return 2 << (dsc->bits_per_component - 8);
> +}
> +
>  #endif /* _DRM_DSC_HELPER_H_ */
>  
> 
> -- 
> 2.40.1

-- 
Ville Syrjälä
Intel

  reply	other threads:[~2023-05-11 12:30 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-10 22:54 [PATCH v9 0/8] Introduce MSM-specific DSC helpers Jessica Zhang
2023-05-10 22:54 ` [PATCH v9 1/8] drm/display/dsc: Add flatness and initial scale value calculations Jessica Zhang
2023-05-11 12:30   ` Ville Syrjälä [this message]
2023-05-10 22:54 ` [PATCH v9 2/8] drm/display/dsc: add helper to set semi-const parameters Jessica Zhang
2023-05-10 22:54 ` [PATCH v9 3/8] drm/msm/dsi: use DRM DSC helpers for DSC setup Jessica Zhang
2023-05-10 22:54 ` [PATCH v9 4/8] drm/msm: Add MSM-specific DSC helper methods Jessica Zhang
2023-05-10 22:54 ` [PATCH v9 5/8] drm/msm/dpu: Use fixed DRM DSC helper for det_thresh_flatness Jessica Zhang
2023-05-10 22:54 ` [PATCH v9 6/8] drm/msm/dpu: Fix slice_last_group_size calculation Jessica Zhang
2023-05-10 22:54 ` [PATCH v9 7/8] drm/msm/dsi: Use MSM and DRM DSC helper methods Jessica Zhang
2023-05-10 22:54 ` [PATCH v9 8/8] drm/msm/dsi: update hdisplay calculation for dsi_timing_setup Jessica Zhang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZFzf-firnfYKwmy1@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=dmitry.baryshkov@linaro.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=freedreno@lists.freedesktop.org \
    --cc=konrad.dybcio@linaro.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=marijn.suijten@somainline.org \
    --cc=quic_abhinavk@quicinc.com \
    --cc=quic_jesszhan@quicinc.com \
    --cc=quic_khsieh@quicinc.com \
    --cc=sean@poorly.run \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox