[PATCH 11/11] drm/vc4: hdmi: Force YUV422 if the rate is too high

Maxime Ripard maxime at cerno.tech
Fri Dec 3 10:54:20 UTC 2021


When using the modes that need the highest pixel rate we support (such
as 4k at 60Hz), using a 10 or 12 bpc output will put us over the limit
of what we can achieve.

In such a case, let's force our output to be YUV422 so that we can go
back down under the required clock rate.

Signed-off-by: Maxime Ripard <maxime at cerno.tech>
---
 drivers/gpu/drm/vc4/vc4_hdmi.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c
index 04eb1ab9dad3..5b8b2688a3f4 100644
--- a/drivers/gpu/drm/vc4/vc4_hdmi.c
+++ b/drivers/gpu/drm/vc4/vc4_hdmi.c
@@ -1411,8 +1411,15 @@ vc4_hdmi_encoder_compute_config(struct vc4_hdmi *vc4_hdmi,
 					     vc4_state, mode,
 					     conn_state->max_bpc,
 					     format);
-	if (ret)
-		return ret;
+	if (ret) {
+		format = VC4_HDMI_OUTPUT_YUV422;
+		ret = vc4_hdmi_encoder_compute_clock(vc4_hdmi,
+						     vc4_state, mode,
+						     conn_state->max_bpc,
+						     format);
+		if (ret)
+			return ret;
+	}
 
 	vc4_state->output_format = format;
 	return ret;
-- 
2.33.1



More information about the dri-devel mailing list