Skip to content

Commit 8290bce

Browse files
committed
drm/i915: Don't rely that 2 VDSC engines are always enough for pixel rate
We are currently having FIFO underruns happening for kms_dsc test case, problem is that, we check if curreny cdclk is >= pixel rate only if there is a single VDSC engine enabled(i.e dsc_split=false) however if we happen to have 2 VDSC engines enabled, we just kinda rely that this would be automatically enough. However pixel rate can be even >= than VDSC clock(cdclk) * 2, so in that case even with 2 VDSC engines enabled, we still need to tweak it up. So lets compare pixel rate with cdclk * VDSC engine count and check if it still requires bumping up. Previously we had to bump up CDCLK many times for similar reasons. v2: - Use new intel_dsc_get_num_vdsc_instances to determine number of VDSC engines, instead of slice count(Ankit Nautiyal) v3: - s/u8/int/ (Jani Nikula) v4: - Remove slice count mentions(Ankit Nautiyal) - Use DIV_ROUND_UP in order to make sure that resulting CDCLK would be always >= than required, after division(Ankit Nautiyal) Signed-off-by: Stanislav Lisovskiy <[email protected]> Reviewed-by: Ankit Nautiyal <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 08a3a79 commit 8290bce

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

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

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
#include "intel_pci_config.h"
3838
#include "intel_pcode.h"
3939
#include "intel_psr.h"
40+
#include "intel_vdsc.h"
4041
#include "vlv_sideband.h"
4142

4243
/**
@@ -2607,9 +2608,16 @@ int intel_crtc_compute_min_cdclk(const struct intel_crtc_state *crtc_state)
26072608
* When we decide to use only one VDSC engine, since
26082609
* each VDSC operates with 1 ppc throughput, pixel clock
26092610
* cannot be higher than the VDSC clock (cdclk)
2611+
* If there 2 VDSC engines, then pixel clock can't be higher than
2612+
* VDSC clock(cdclk) * 2 and so on.
26102613
*/
2611-
if (crtc_state->dsc.compression_enable && !crtc_state->dsc.dsc_split)
2612-
min_cdclk = max(min_cdclk, (int)crtc_state->pixel_rate);
2614+
if (crtc_state->dsc.compression_enable) {
2615+
int num_vdsc_instances = intel_dsc_get_num_vdsc_instances(crtc_state);
2616+
2617+
min_cdclk = max_t(int, min_cdclk,
2618+
DIV_ROUND_UP(crtc_state->pixel_rate,
2619+
num_vdsc_instances));
2620+
}
26132621

26142622
/*
26152623
* HACK. Currently for TGL/DG2 platforms we calculate

0 commit comments

Comments
 (0)