Unverified Commit 3870b54e authored by Maxime Ripard's avatar Maxime Ripard
Browse files

drm/vc4: kms: Improve logging



When debugging, finding out what muxing decisions were made and what the
actual core clock rate is is always useful, so let's add some more
messages.

Signed-off-by: default avatarMaxime Ripard <maxime@cerno.tech>
Acked-by: default avatarThomas Zimmermann <tzimmermann@suse.de>
Link: https://lore.kernel.org/r/20220328153659.2382206-7-maxime@cerno.tech
parent 457e5184
Loading
Loading
Loading
Loading
+19 −1
Original line number Diff line number Diff line
@@ -439,6 +439,9 @@ static void vc4_atomic_commit_tail(struct drm_atomic_state *state)
		 * requirements.
		 */
		clk_set_min_rate(hvs->core_clk, new_hvs_state->core_clock_rate);

		drm_dbg(dev, "Core clock actual rate: %lu Hz\n",
			clk_get_rate(hvs->core_clk));
	}
}

@@ -822,9 +825,18 @@ static int vc4_pv_muxing_atomic_check(struct drm_device *dev,
		unsigned int matching_channels;
		unsigned int channel;

		drm_dbg(dev, "%s: Trying to find a channel.\n", crtc->name);

		/* Nothing to do here, let's skip it */
		if (old_crtc_state->enable == new_crtc_state->enable)
		if (old_crtc_state->enable == new_crtc_state->enable) {
			if (new_crtc_state->enable)
				drm_dbg(dev, "%s: Already enabled, reusing channel %d.\n",
					crtc->name, new_vc4_crtc_state->assigned_channel);
			else
				drm_dbg(dev, "%s: Disabled, ignoring.\n", crtc->name);

			continue;
		}

		/* Muxing will need to be modified, mark it as such */
		new_vc4_crtc_state->update_muxing = true;
@@ -832,6 +844,10 @@ static int vc4_pv_muxing_atomic_check(struct drm_device *dev,
		/* If we're disabling our CRTC, we put back our channel */
		if (!new_crtc_state->enable) {
			channel = old_vc4_crtc_state->assigned_channel;

			drm_dbg(dev, "%s: Disabling, Freeing channel %d\n",
				crtc->name, channel);

			hvs_new_state->fifo_state[channel].in_use = false;
			new_vc4_crtc_state->assigned_channel = VC4_HVS_CHANNEL_DISABLED;
			continue;
@@ -866,6 +882,8 @@ static int vc4_pv_muxing_atomic_check(struct drm_device *dev,
			return -EINVAL;

		channel = ffs(matching_channels) - 1;

		drm_dbg(dev, "Assigned HVS channel %d to CRTC %s\n", channel, crtc->name);
		new_vc4_crtc_state->assigned_channel = channel;
		unassigned_channels &= ~BIT(channel);
		hvs_new_state->fifo_state[channel].in_use = true;