bcm27xx: add support for linux v5.15
[openwrt/openwrt.git] / target / linux / bcm27xx / patches-5.15 / 950-0758-drm-vc4-kms-Improve-logging.patch
1 From 0fc2455e0b6cf188c529915de2627bdfb3e5ff01 Mon Sep 17 00:00:00 2001
2 From: Maxime Ripard <maxime@cerno.tech>
3 Date: Fri, 4 Mar 2022 15:59:40 +0100
4 Subject: [PATCH] drm/vc4: kms: Improve logging
5
6 When debugging, finding out what muxing decisions were made and what the
7 actual core clock rate is is always useful, so let's add some more
8 messages.
9
10 Signed-off-by: Maxime Ripard <maxime@cerno.tech>
11 ---
12 drivers/gpu/drm/vc4/vc4_kms.c | 20 +++++++++++++++++++-
13 1 file changed, 19 insertions(+), 1 deletion(-)
14
15 --- a/drivers/gpu/drm/vc4/vc4_kms.c
16 +++ b/drivers/gpu/drm/vc4/vc4_kms.c
17 @@ -447,6 +447,9 @@ static void vc4_atomic_commit_tail(struc
18
19 /* And drop the temporary request */
20 clk_request_done(core_req);
21 +
22 + drm_dbg(dev, "Core clock actual rate: %lu Hz\n",
23 + clk_get_rate(hvs->core_clk));
24 }
25 }
26
27 @@ -827,9 +830,18 @@ static int vc4_pv_muxing_atomic_check(st
28 if (vc4->firmware_kms)
29 continue;
30
31 + drm_dbg(dev, "%s: Trying to find a channel.\n", crtc->name);
32 +
33 /* Nothing to do here, let's skip it */
34 - if (old_crtc_state->enable == new_crtc_state->enable)
35 + if (old_crtc_state->enable == new_crtc_state->enable) {
36 + if (new_crtc_state->enable)
37 + drm_dbg(dev, "%s: Already enabled, reusing channel %d.\n",
38 + crtc->name, new_vc4_crtc_state->assigned_channel);
39 + else
40 + drm_dbg(dev, "%s: Disabled, ignoring.\n", crtc->name);
41 +
42 continue;
43 + }
44
45 /* Muxing will need to be modified, mark it as such */
46 new_vc4_crtc_state->update_muxing = true;
47 @@ -837,6 +849,10 @@ static int vc4_pv_muxing_atomic_check(st
48 /* If we're disabling our CRTC, we put back our channel */
49 if (!new_crtc_state->enable) {
50 channel = old_vc4_crtc_state->assigned_channel;
51 +
52 + drm_dbg(dev, "%s: Disabling, Freeing channel %d\n",
53 + crtc->name, channel);
54 +
55 hvs_new_state->fifo_state[channel].in_use = false;
56 new_vc4_crtc_state->assigned_channel = VC4_HVS_CHANNEL_DISABLED;
57 continue;
58 @@ -871,6 +887,8 @@ static int vc4_pv_muxing_atomic_check(st
59 return -EINVAL;
60
61 channel = ffs(matching_channels) - 1;
62 +
63 + drm_dbg(dev, "Assigned HVS channel %d to CRTC %s\n", channel, crtc->name);
64 new_vc4_crtc_state->assigned_channel = channel;
65 unassigned_channels &= ~BIT(channel);
66 hvs_new_state->fifo_state[channel].in_use = true;