Skip to content

Commit e602445

Browse files
committed
drm/i915: Replace to_bpp_frac() with fxp_q4_to_frac()
Replace the to_bpp_frac() helper defined by the driver with the equivalent fxp_q4_to_frac() helper defined by DRM core. v2: Rebase on the s/drm_x16/fxp_q4 change. Acked-by: Jani Nikula <[email protected]> Signed-off-by: Imre Deak <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent ce9b146 commit e602445

File tree

3 files changed

+4
-9
lines changed

3 files changed

+4
-9
lines changed

drivers/gpu/drm/i915/display/intel_display_types.h

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2200,13 +2200,8 @@ to_intel_frontbuffer(struct drm_framebuffer *fb)
22002200
return fb ? to_intel_framebuffer(fb)->frontbuffer : NULL;
22012201
}
22022202

2203-
static inline int to_bpp_frac(int bpp_x16)
2204-
{
2205-
return bpp_x16 & 0xf;
2206-
}
2207-
22082203
#define BPP_X16_FMT "%d.%04d"
2209-
#define BPP_X16_ARGS(bpp_x16) fxp_q4_to_int(bpp_x16), (to_bpp_frac(bpp_x16) * 625)
2204+
#define BPP_X16_ARGS(bpp_x16) fxp_q4_to_int(bpp_x16), (fxp_q4_to_frac(bpp_x16) * 625)
22102205

22112206
/*
22122207
* Conversion functions/macros from various pointer types to struct

drivers/gpu/drm/i915/display/intel_dp.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2066,7 +2066,7 @@ xelpd_dsc_compute_link_config(struct intel_dp *intel_dp,
20662066
compressed_bppx16 >= dsc_min_bpp;
20672067
compressed_bppx16 -= bppx16_step) {
20682068
if (intel_dp->force_dsc_fractional_bpp_en &&
2069-
!to_bpp_frac(compressed_bppx16))
2069+
!fxp_q4_to_frac(compressed_bppx16))
20702070
continue;
20712071
ret = dsc_compute_link_config(intel_dp,
20722072
pipe_config,
@@ -2076,7 +2076,7 @@ xelpd_dsc_compute_link_config(struct intel_dp *intel_dp,
20762076
if (ret == 0) {
20772077
pipe_config->dsc.compressed_bpp_x16 = compressed_bppx16;
20782078
if (intel_dp->force_dsc_fractional_bpp_en &&
2079-
to_bpp_frac(compressed_bppx16))
2079+
fxp_q4_to_frac(compressed_bppx16))
20802080
drm_dbg_kms(&i915->drm, "Forcing DSC fractional bpp\n");
20812081

20822082
return 0;

drivers/gpu/drm/i915/display/intel_vdsc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ calculate_rc_params(struct drm_dsc_config *vdsc_cfg)
185185
}
186186
} else {
187187
/* fractional bpp part * 10000 (for precision up to 4 decimal places) */
188-
int fractional_bits = to_bpp_frac(vdsc_cfg->bits_per_pixel);
188+
int fractional_bits = fxp_q4_to_frac(vdsc_cfg->bits_per_pixel);
189189

190190
static const s8 ofs_und6[] = {
191191
0, -2, -2, -4, -6, -6, -8, -8, -8, -10, -10, -12, -12, -12, -12

0 commit comments

Comments
 (0)