From: Jessica Zhang <quic_jesszhan@quicinc.com>
To: <freedreno@lists.freedesktop.org>
Cc: linux-arm-msm@vger.kernel.org,
Abhinav Kumar <quic_abhinavk@quicinc.com>,
Kuogee Hsieh <quic_khsieh@quicinc.com>,
Konrad Dybcio <konrad.dybcio@linaro.org>,
dri-devel@lists.freedesktop.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: [PATCH v14 3/9] drm/display/dsc: Add drm_dsc_get_bpp_int helper
Date: Wed, 24 May 2023 10:45:16 -0700 [thread overview]
Message-ID: <20230329-rfc-msm-dsc-helper-v14-3-bafc7be95691@quicinc.com> (raw)
In-Reply-To: <20230329-rfc-msm-dsc-helper-v14-0-bafc7be95691@quicinc.com>
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>
---
drivers/gpu/drm/display/drm_dsc_helper.c | 13 +++++++++++++
include/drm/display/drm_dsc_helper.h | 1 +
2 files changed, 14 insertions(+)
diff --git a/drivers/gpu/drm/display/drm_dsc_helper.c b/drivers/gpu/drm/display/drm_dsc_helper.c
index b31fe9849784..4424380c6cb6 100644
--- a/drivers/gpu/drm/display/drm_dsc_helper.c
+++ b/drivers/gpu/drm/display/drm_dsc_helper.c
@@ -1436,6 +1436,19 @@ int drm_dsc_compute_rc_parameters(struct drm_dsc_config *vdsc_cfg)
}
EXPORT_SYMBOL(drm_dsc_compute_rc_parameters);
+/**
+ * drm_dsc_get_bpp_int() - Get integer bits per pixel value for the given DRM DSC config
+ * @vdsc_cfg: Pointer to DRM DSC config struct
+ *
+ * Return: Integer BPP value
+ */
+u32 drm_dsc_get_bpp_int(const struct drm_dsc_config *vdsc_cfg)
+{
+ WARN_ON_ONCE(vdsc_cfg->bits_per_pixel & 0xf);
+ return vdsc_cfg->bits_per_pixel >> 4;
+}
+EXPORT_SYMBOL(drm_dsc_get_bpp_int);
+
/**
* drm_dsc_initial_scale_value() - Calculate the initial scale value for the given DSC config
* @dsc: Pointer to DRM DSC config struct
diff --git a/include/drm/display/drm_dsc_helper.h b/include/drm/display/drm_dsc_helper.h
index f4e18e5d077a..913aa2071232 100644
--- a/include/drm/display/drm_dsc_helper.h
+++ b/include/drm/display/drm_dsc_helper.h
@@ -27,6 +27,7 @@ int drm_dsc_setup_rc_params(struct drm_dsc_config *vdsc_cfg, enum drm_dsc_params
int drm_dsc_compute_rc_parameters(struct drm_dsc_config *vdsc_cfg);
u8 drm_dsc_initial_scale_value(const struct drm_dsc_config *dsc);
u32 drm_dsc_flatness_det_thresh(const struct drm_dsc_config *dsc);
+u32 drm_dsc_get_bpp_int(const struct drm_dsc_config *vdsc_cfg);
#endif /* _DRM_DSC_HELPER_H_ */
--
2.40.1
next prev parent reply other threads:[~2023-05-24 17:45 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-24 17:45 [PATCH v14 0/9] Introduce MSM-specific DSC helpers Jessica Zhang
2023-05-24 17:45 ` [PATCH v14 1/9] drm/display/dsc: Add flatness and initial scale value calculations Jessica Zhang
2023-05-24 19:05 ` Marijn Suijten
2023-05-25 1:05 ` Jessica Zhang
2023-05-25 20:33 ` Marijn Suijten
2023-05-24 17:45 ` [PATCH v14 2/9] drm/display/dsc: add helper to set semi-const parameters Jessica Zhang
2023-05-24 17:45 ` Jessica Zhang [this message]
2023-05-24 19:14 ` [PATCH v14 3/9] drm/display/dsc: Add drm_dsc_get_bpp_int helper Marijn Suijten
2023-05-24 22:38 ` Jessica Zhang
2023-05-25 20:18 ` Marijn Suijten
2023-05-25 21:23 ` Dmitry Baryshkov
2023-05-24 17:45 ` [PATCH v14 4/9] drm/msm/dsi: use DRM DSC helpers for DSC setup Jessica Zhang
2023-05-24 17:45 ` [PATCH v14 5/9] drm/msm: Add MSM-specific DSC helper methods Jessica Zhang
2023-05-24 17:45 ` [PATCH v14 6/9] drm/msm/dpu: Use fixed DRM DSC helper for det_thresh_flatness Jessica Zhang
2023-05-24 17:45 ` [PATCH v14 7/9] drm/msm/dpu: Fix slice_last_group_size calculation Jessica Zhang
2023-05-24 17:45 ` [PATCH v14 8/9] drm/msm/dsi: Use MSM and DRM DSC helper methods Jessica Zhang
2023-05-24 17:45 ` [PATCH v14 9/9] drm/msm/dsi: update hdisplay calculation for dsi_timing_setup Jessica Zhang
2023-05-24 19:09 ` [PATCH v14 0/9] Introduce MSM-specific DSC helpers Marijn Suijten
2023-06-15 11:31 ` Dmitry Baryshkov
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=20230329-rfc-msm-dsc-helper-v14-3-bafc7be95691@quicinc.com \
--to=quic_jesszhan@quicinc.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_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;
as well as URLs for NNTP newsgroup(s).