]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob
8592fd8c6445e8cec7e22561a3ee6e46f1953a74
[thirdparty/kernel/stable-queue.git] /
1 From 247a631f9c0ffb37ed0786a94cb4c5f2b6fc7ab1 Mon Sep 17 00:00:00 2001
2 From: Dom Cobley <popcornmix@gmail.com>
3 Date: Fri, 27 Jan 2023 15:55:58 +0100
4 Subject: drm/vc4: crtc: Increase setup cost in core clock calculation to handle extreme reduced blanking
5
6 From: Dom Cobley <popcornmix@gmail.com>
7
8 commit 247a631f9c0ffb37ed0786a94cb4c5f2b6fc7ab1 upstream.
9
10 The formula that determines the core clock requirement based on pixel
11 clock and blanking has been determined experimentally to minimise the
12 clock while supporting all modes we've seen.
13
14 A new reduced blanking mode (4kp60 at 533MHz rather than the standard
15 594MHz) has been seen that doesn't produce a high enough clock and
16 results in "flip_done timed out" error.
17
18 Increase the setup cost in the formula to make this work. The result is
19 a reduced blanking mode increases by up to 7MHz while leaving the
20 standard timing
21 mode untouched
22
23 Link: https://github.com/raspberrypi/linux/issues/4446
24 Fixes: 16e101051f32 ("drm/vc4: Increase the core clock based on HVS load")
25 Signed-off-by: Dom Cobley <popcornmix@gmail.com>
26 Signed-off-by: Maxime Ripard <maxime@cerno.tech>
27 Link: https://patchwork.freedesktop.org/patch/msgid/20230127145558.446123-1-maxime@cerno.tech
28 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
29 ---
30 drivers/gpu/drm/vc4/vc4_crtc.c | 2 +-
31 1 file changed, 1 insertion(+), 1 deletion(-)
32
33 --- a/drivers/gpu/drm/vc4/vc4_crtc.c
34 +++ b/drivers/gpu/drm/vc4/vc4_crtc.c
35 @@ -711,7 +711,7 @@ static int vc4_crtc_atomic_check(struct
36 struct vc4_encoder *vc4_encoder = to_vc4_encoder(encoder);
37
38 if (vc4_encoder->type == VC4_ENCODER_TYPE_HDMI0) {
39 - vc4_state->hvs_load = max(mode->clock * mode->hdisplay / mode->htotal + 1000,
40 + vc4_state->hvs_load = max(mode->clock * mode->hdisplay / mode->htotal + 8000,
41 mode->clock * 9 / 10) * 1000;
42 } else {
43 vc4_state->hvs_load = mode->clock * 1000;