]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
drm/connector: hdmi: Evaluate limited range after computing format
authorCristian Ciocaltea <cristian.ciocaltea@collabora.com>
Tue, 27 May 2025 12:11:09 +0000 (15:11 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 15 Aug 2025 14:38:36 +0000 (16:38 +0200)
[ Upstream commit 21f627139652dd8329a88e281df6600f3866d238 ]

Evaluating the requirement to use a limited RGB quantization range
involves a verification of the output format, among others, but this is
currently performed before actually computing the format, hence relying
on the old connector state.

Move the call to hdmi_is_limited_range() after hdmi_compute_config() to
ensure the verification is done on the updated output format.

Fixes: 027d43590649 ("drm/connector: hdmi: Add RGB Quantization Range to the connector state")
Reviewed-by: Dmitry Baryshkov <lumag@kernel.org>
Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
Acked-by: Maxime Ripard <mripard@kernel.org>
Link: https://lore.kernel.org/r/20250527-hdmi-conn-yuv-v5-1-74c9c4a8ac0c@collabora.com
Signed-off-by: Maxime Ripard <mripard@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/display/drm_hdmi_state_helper.c

index d9d9948b29e9d5ef9bc9cc9108b3ace4aca2e3ae..45b154c8abb2cc731bf4be472e58815cf47463d4 100644 (file)
@@ -798,12 +798,12 @@ int drm_atomic_helper_connector_hdmi_check(struct drm_connector *connector,
        if (!new_conn_state->crtc || !new_conn_state->best_encoder)
                return 0;
 
-       new_conn_state->hdmi.is_limited_range = hdmi_is_limited_range(connector, new_conn_state);
-
        ret = hdmi_compute_config(connector, new_conn_state, mode);
        if (ret)
                return ret;
 
+       new_conn_state->hdmi.is_limited_range = hdmi_is_limited_range(connector, new_conn_state);
+
        ret = hdmi_generate_infoframes(connector, new_conn_state);
        if (ret)
                return ret;