Skip to content

Commit ce9b146

Browse files
committed
drm/i915: Replace to_bpp_int_roundup() with fxp_q4_to_int_roundup()
Replace the to_bpp_int_roundup() helper defined by the driver with the equivalent fxp_q4_to_int_roundup() helper defined by DRM core. v2: Rebase on 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 8466a14 commit ce9b146

File tree

4 files changed

+8
-10
lines changed

4 files changed

+8
-10
lines changed

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,10 @@
2323

2424
#include <linux/time.h>
2525

26+
#include <drm/drm_fixed.h>
27+
2628
#include "soc/intel_dram.h"
29+
2730
#include "hsw_ips.h"
2831
#include "i915_reg.h"
2932
#include "intel_atomic.h"
@@ -2750,7 +2753,7 @@ static int intel_vdsc_min_cdclk(const struct intel_crtc_state *crtc_state)
27502753
*/
27512754
int bigjoiner_interface_bits = DISPLAY_VER(i915) >= 14 ? 36 : 24;
27522755
int min_cdclk_bj =
2753-
(to_bpp_int_roundup(crtc_state->dsc.compressed_bpp_x16) *
2756+
(fxp_q4_to_int_roundup(crtc_state->dsc.compressed_bpp_x16) *
27542757
pixel_clock) / (2 * bigjoiner_interface_bits);
27552758

27562759
min_cdclk = max(min_cdclk, min_cdclk_bj);

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

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2208,11 +2208,6 @@ static inline int to_bpp_frac(int bpp_x16)
22082208
#define BPP_X16_FMT "%d.%04d"
22092209
#define BPP_X16_ARGS(bpp_x16) fxp_q4_to_int(bpp_x16), (to_bpp_frac(bpp_x16) * 625)
22102210

2211-
static inline int to_bpp_int_roundup(int bpp_x16)
2212-
{
2213-
return (bpp_x16 + 0xf) >> 4;
2214-
}
2215-
22162211
/*
22172212
* Conversion functions/macros from various pointer types to struct
22182213
* intel_display pointer.

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2101,7 +2101,7 @@ static int dsc_compute_compressed_bpp(struct intel_dp *intel_dp,
21012101
dsc_src_min_bpp = dsc_src_min_compressed_bpp();
21022102
dsc_sink_min_bpp = intel_dp_dsc_sink_min_compressed_bpp(pipe_config);
21032103
dsc_min_bpp = max(dsc_src_min_bpp, dsc_sink_min_bpp);
2104-
dsc_min_bpp = max(dsc_min_bpp, to_bpp_int_roundup(limits->link.min_bpp_x16));
2104+
dsc_min_bpp = max(dsc_min_bpp, fxp_q4_to_int_roundup(limits->link.min_bpp_x16));
21052105

21062106
dsc_src_max_bpp = dsc_src_max_compressed_bpp(intel_dp);
21072107
dsc_sink_max_bpp = intel_dp_dsc_sink_max_compressed_bpp(connector,
@@ -2263,7 +2263,7 @@ static int intel_edp_dsc_compute_pipe_bpp(struct intel_dp *intel_dp,
22632263
dsc_src_min_bpp = dsc_src_min_compressed_bpp();
22642264
dsc_sink_min_bpp = intel_dp_dsc_sink_min_compressed_bpp(pipe_config);
22652265
dsc_min_bpp = max(dsc_src_min_bpp, dsc_sink_min_bpp);
2266-
dsc_min_bpp = max(dsc_min_bpp, to_bpp_int_roundup(limits->link.min_bpp_x16));
2266+
dsc_min_bpp = max(dsc_min_bpp, fxp_q4_to_int_roundup(limits->link.min_bpp_x16));
22672267

22682268
dsc_src_max_bpp = dsc_src_max_compressed_bpp(intel_dp);
22692269
dsc_sink_max_bpp = intel_dp_dsc_sink_max_compressed_bpp(connector,
@@ -2489,7 +2489,7 @@ int intel_dp_config_required_rate(const struct intel_crtc_state *crtc_state)
24892489
const struct drm_display_mode *adjusted_mode =
24902490
&crtc_state->hw.adjusted_mode;
24912491
int bpp = crtc_state->dsc.compression_enable ?
2492-
to_bpp_int_roundup(crtc_state->dsc.compressed_bpp_x16) :
2492+
fxp_q4_to_int_roundup(crtc_state->dsc.compressed_bpp_x16) :
24932493
crtc_state->pipe_bpp;
24942494

24952495
return intel_dp_link_required(adjusted_mode->crtc_clock, bpp);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ static int intel_dp_dsc_mst_compute_link_config(struct intel_encoder *encoder,
379379

380380
min_compressed_bpp = intel_dp_dsc_sink_min_compressed_bpp(crtc_state);
381381
min_compressed_bpp = max(min_compressed_bpp,
382-
to_bpp_int_roundup(limits->link.min_bpp_x16));
382+
fxp_q4_to_int_roundup(limits->link.min_bpp_x16));
383383

384384
drm_dbg_kms(&i915->drm, "DSC Sink supported compressed min bpp %d compressed max bpp %d\n",
385385
min_compressed_bpp, max_compressed_bpp);

0 commit comments

Comments
 (0)