Skip to content

Commit 2796b7c

Browse files
committed
drm/i915: Replace BPP_X16_FMT()/ARGS() with FXP_Q4_FMT()/ARGS()
Replace the BPP_X16_FMT()/ARGS() helpers defined by the driver with the equivalent FXP_Q4_FMT()/ARGS() helpers 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 e602445 commit 2796b7c

File tree

5 files changed

+15
-17
lines changed

5 files changed

+15
-17
lines changed

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626

2727
#include <drm/drm_edid.h>
2828
#include <drm/drm_eld.h>
29+
#include <drm/drm_fixed.h>
2930
#include <drm/intel/i915_component.h>
3031

3132
#include "i915_drv.h"
@@ -452,8 +453,8 @@ static unsigned int calc_hblank_early_prog(struct intel_encoder *encoder,
452453
lanes = crtc_state->lane_count;
453454

454455
drm_dbg_kms(&i915->drm,
455-
"h_active = %u link_clk = %u : lanes = %u vdsc_bpp = " BPP_X16_FMT " cdclk = %u\n",
456-
h_active, link_clk, lanes, BPP_X16_ARGS(vdsc_bppx16), cdclk);
456+
"h_active = %u link_clk = %u : lanes = %u vdsc_bpp = " FXP_Q4_FMT " cdclk = %u\n",
457+
h_active, link_clk, lanes, FXP_Q4_ARGS(vdsc_bppx16), cdclk);
457458

458459
if (WARN_ON(!link_clk || !pixel_clk || !lanes || !vdsc_bppx16 || !cdclk))
459460
return 0;

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4682,9 +4682,9 @@ intel_modeset_pipe_config(struct intel_atomic_state *state,
46824682

46834683
if (crtc_state->pipe_bpp > fxp_q4_to_int(crtc_state->max_link_bpp_x16)) {
46844684
drm_dbg_kms(&i915->drm,
4685-
"[CRTC:%d:%s] Link bpp limited to " BPP_X16_FMT "\n",
4685+
"[CRTC:%d:%s] Link bpp limited to " FXP_Q4_FMT "\n",
46864686
crtc->base.base.id, crtc->base.name,
4687-
BPP_X16_ARGS(crtc_state->max_link_bpp_x16));
4687+
FXP_Q4_ARGS(crtc_state->max_link_bpp_x16));
46884688
crtc_state->bw_constrained = true;
46894689
}
46904690

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

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

2203-
#define BPP_X16_FMT "%d.%04d"
2204-
#define BPP_X16_ARGS(bpp_x16) fxp_q4_to_int(bpp_x16), (fxp_q4_to_frac(bpp_x16) * 625)
2205-
22062203
/*
22072204
* Conversion functions/macros from various pointer types to struct
22082205
* intel_display pointer.

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2366,17 +2366,17 @@ int intel_dp_dsc_compute_config(struct intel_dp *intel_dp,
23662366
if (ret < 0) {
23672367
drm_dbg_kms(&dev_priv->drm,
23682368
"Cannot compute valid DSC parameters for Input Bpp = %d"
2369-
"Compressed BPP = " BPP_X16_FMT "\n",
2369+
"Compressed BPP = " FXP_Q4_FMT "\n",
23702370
pipe_config->pipe_bpp,
2371-
BPP_X16_ARGS(pipe_config->dsc.compressed_bpp_x16));
2371+
FXP_Q4_ARGS(pipe_config->dsc.compressed_bpp_x16));
23722372
return ret;
23732373
}
23742374

23752375
pipe_config->dsc.compression_enable = true;
23762376
drm_dbg_kms(&dev_priv->drm, "DP DSC computed with Input Bpp = %d "
2377-
"Compressed Bpp = " BPP_X16_FMT " Slice Count = %d\n",
2377+
"Compressed Bpp = " FXP_Q4_FMT " Slice Count = %d\n",
23782378
pipe_config->pipe_bpp,
2379-
BPP_X16_ARGS(pipe_config->dsc.compressed_bpp_x16),
2379+
FXP_Q4_ARGS(pipe_config->dsc.compressed_bpp_x16),
23802380
pipe_config->dsc.slice_count);
23812381

23822382
return 0;
@@ -2429,15 +2429,15 @@ intel_dp_compute_config_link_bpp_limits(struct intel_dp *intel_dp,
24292429
limits->link.max_bpp_x16 = max_link_bpp_x16;
24302430

24312431
drm_dbg_kms(&i915->drm,
2432-
"[ENCODER:%d:%s][CRTC:%d:%s] DP link limits: pixel clock %d kHz DSC %s max lanes %d max rate %d max pipe_bpp %d max link_bpp " BPP_X16_FMT "\n",
2432+
"[ENCODER:%d:%s][CRTC:%d:%s] DP link limits: pixel clock %d kHz DSC %s max lanes %d max rate %d max pipe_bpp %d max link_bpp " FXP_Q4_FMT "\n",
24332433
encoder->base.base.id, encoder->base.name,
24342434
crtc->base.base.id, crtc->base.name,
24352435
adjusted_mode->crtc_clock,
24362436
dsc ? "on" : "off",
24372437
limits->max_lane_count,
24382438
limits->max_rate,
24392439
limits->pipe.max_bpp,
2440-
BPP_X16_ARGS(limits->link.max_bpp_x16));
2440+
FXP_Q4_ARGS(limits->link.max_bpp_x16));
24412441

24422442
return true;
24432443
}
@@ -2568,10 +2568,10 @@ intel_dp_compute_link_config(struct intel_encoder *encoder,
25682568
}
25692569

25702570
drm_dbg_kms(&i915->drm,
2571-
"DP lane count %d clock %d bpp input %d compressed " BPP_X16_FMT " link rate required %d available %d\n",
2571+
"DP lane count %d clock %d bpp input %d compressed " FXP_Q4_FMT " link rate required %d available %d\n",
25722572
pipe_config->lane_count, pipe_config->port_clock,
25732573
pipe_config->pipe_bpp,
2574-
BPP_X16_ARGS(pipe_config->dsc.compressed_bpp_x16),
2574+
FXP_Q4_ARGS(pipe_config->dsc.compressed_bpp_x16),
25752575
intel_dp_config_required_rate(pipe_config),
25762576
intel_dp_max_link_data_rate(intel_dp,
25772577
pipe_config->port_clock,

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -498,10 +498,10 @@ adjust_limits_for_dsc_hblank_expansion_quirk(const struct intel_connector *conne
498498
return true;
499499

500500
drm_dbg_kms(&i915->drm,
501-
"[CRTC:%d:%s][CONNECTOR:%d:%s] Increasing link min bpp to " BPP_X16_FMT " in DSC mode due to hblank expansion quirk\n",
501+
"[CRTC:%d:%s][CONNECTOR:%d:%s] Increasing link min bpp to " FXP_Q4_FMT " in DSC mode due to hblank expansion quirk\n",
502502
crtc->base.base.id, crtc->base.name,
503503
connector->base.base.id, connector->base.name,
504-
BPP_X16_ARGS(min_bpp_x16));
504+
FXP_Q4_ARGS(min_bpp_x16));
505505

506506
if (limits->link.max_bpp_x16 < min_bpp_x16)
507507
return false;

0 commit comments

Comments
 (0)