Linux ARM-MSM sub-architecture
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@linux.intel.com>
To: Jessica Zhang <quic_jesszhan@quicinc.com>,
	freedreno@lists.freedesktop.org
Cc: 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>,
	Jessica Zhang <quic_jesszhan@quicinc.com>,
	Dmitry Baryshkov <dmitry.baryshkov@linaro.org>,
	Marijn Suijten <marijn.suijten@somainline.org>,
	Sean Paul <sean@poorly.run>
Subject: Re: [PATCH v12 3/9] drm/display/dsc: Add drm_dsc_get_bpp_int helper
Date: Mon, 22 May 2023 12:35:33 +0300	[thread overview]
Message-ID: <87a5xwogii.fsf@intel.com> (raw)
In-Reply-To: <20230329-rfc-msm-dsc-helper-v12-3-9cdb7401f614@quicinc.com>

On Wed, 17 May 2023, Jessica Zhang <quic_jesszhan@quicinc.com> wrote:
> Add helper to get the integer value of drm_dsc_config.bits_per_pixel
>
> Reviewed-by: Marijn Suijten <marijn.suijten@somainline.org>
> Signed-off-by: Jessica Zhang <quic_jesszhan@quicinc.com>
> ---
>  include/drm/display/drm_dsc_helper.h | 7 +++++++
>  1 file changed, 7 insertions(+)
>
> diff --git a/include/drm/display/drm_dsc_helper.h b/include/drm/display/drm_dsc_helper.h
> index e0cbc38ada26..7bf7e8ff8eb4 100644
> --- a/include/drm/display/drm_dsc_helper.h
> +++ b/include/drm/display/drm_dsc_helper.h
> @@ -9,6 +9,7 @@
>  #define DRM_DSC_HELPER_H_
>  
>  #include <drm/display/drm_dsc.h>
> +#include <linux/bug.h>

Seems like a small thing, adding static inlines in headers usually leads
to more header dependencies like this, and gradually slows down build.

Does it need to be a static inline?

BR,
Jani.

>  
>  enum drm_dsc_params_type {
>  	DRM_DSC_1_2_444,
> @@ -26,6 +27,12 @@ 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_type type);
>  int drm_dsc_compute_rc_parameters(struct drm_dsc_config *vdsc_cfg);
>  
> +static inline u32 drm_dsc_get_bpp_int(const struct drm_dsc_config *dsc)
> +{
> +	WARN_ON_ONCE(dsc->bits_per_pixel & 0xf);
> +	return dsc->bits_per_pixel >> 4;
> +}
> +
>  static inline u8 drm_dsc_initial_scale_value(const struct drm_dsc_config *dsc)
>  {
>  	return 8 * dsc->rc_model_size / (dsc->rc_model_size - dsc->initial_offset);

-- 
Jani Nikula, Intel Open Source Graphics Center

  parent reply	other threads:[~2023-05-22  9:35 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-17 22:27 [PATCH v12 0/9] Introduce MSM-specific DSC helpers Jessica Zhang
2023-05-17 22:27 ` [PATCH v12 1/9] drm/display/dsc: Add flatness and initial scale value calculations Jessica Zhang
2023-05-18  0:37   ` Dmitry Baryshkov
2023-05-22  9:37   ` Jani Nikula
2023-05-22 21:15     ` Jessica Zhang
2023-05-17 22:27 ` [PATCH v12 2/9] drm/display/dsc: add helper to set semi-const parameters Jessica Zhang
2023-05-17 22:27 ` [PATCH v12 3/9] drm/display/dsc: Add drm_dsc_get_bpp_int helper Jessica Zhang
2023-05-18  0:38   ` Dmitry Baryshkov
2023-05-22  9:35   ` Jani Nikula [this message]
2023-05-22 21:16     ` Jessica Zhang
2023-05-17 22:27 ` [PATCH v12 4/9] drm/msm/dsi: use DRM DSC helpers for DSC setup Jessica Zhang
2023-05-17 22:27 ` [PATCH v12 5/9] drm/msm: Add MSM-specific DSC helper methods Jessica Zhang
2023-05-17 23:01   ` Marijn Suijten
2023-05-18  0:26     ` Jessica Zhang
2023-05-17 22:27 ` [PATCH v12 6/9] drm/msm/dpu: Use fixed DRM DSC helper for det_thresh_flatness Jessica Zhang
2023-05-17 22:27 ` [PATCH v12 7/9] drm/msm/dpu: Fix slice_last_group_size calculation Jessica Zhang
2023-05-17 22:27 ` [PATCH v12 8/9] drm/msm/dsi: Use MSM and DRM DSC helper methods Jessica Zhang
2023-05-17 22:27 ` [PATCH v12 9/9] 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=87a5xwogii.fsf@intel.com \
    --to=jani.nikula@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