From patchwork Tue Mar 11 10:57:33 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Ciocaltea X-Patchwork-Id: 14011504 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6CB06C35FF2 for ; Tue, 11 Mar 2025 10:58:16 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 34C0610E56B; Tue, 11 Mar 2025 10:58:13 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=collabora.com header.i=@collabora.com header.b="BbFsu31j"; dkim-atps=neutral Received: from bali.collaboradmins.com (bali.collaboradmins.com [148.251.105.195]) by gabe.freedesktop.org (Postfix) with ESMTPS id B46DF10E560 for ; Tue, 11 Mar 2025 10:58:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1741690680; bh=eUTUFtS8Nktp9rKcRss9kYcMfJ0/9ybWHArlzdKrdNc=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=BbFsu31jQ4vmn8GMqW58a6I0NP47h+H8awJA0kLjeXJ5te3qAQ8lt+8WjsUPagYqW G4J2KVxtCNu/Uo18UqWtsZj51x1Mbumznl/jInS3Jz/AIqR7gd6EmIKdwUxYLcDI6O XJWaB74ni8N3oShohalM2DFetZgOE4kr32zzqBn/H0h6HRcacJoeXUZxMYypiSWBhy Np63po1dfvaVASlaZEhEhnes9auIt9T/fb+WmUwVd6Saei+lbQC96lt5ejR40yz9D5 gvq4E96WCnyLUVXVwpI9hdQUqcMi5eC1i+KrpLiDgkScZhw4E7IU8WunQIEyOme5Dh h1C+UrXS899kQ== Received: from localhost (unknown [84.232.140.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: cristicc) by bali.collaboradmins.com (Postfix) with UTF8SMTPSA id EB4C917E13A2; Tue, 11 Mar 2025 11:57:59 +0100 (CET) From: Cristian Ciocaltea Date: Tue, 11 Mar 2025 12:57:33 +0200 Subject: [PATCH v2 1/7] drm/connector: hdmi: Evaluate limited range after computing format MIME-Version: 1.0 Message-Id: <20250311-hdmi-conn-yuv-v2-1-fbdb94f02562@collabora.com> References: <20250311-hdmi-conn-yuv-v2-0-fbdb94f02562@collabora.com> In-Reply-To: <20250311-hdmi-conn-yuv-v2-0-fbdb94f02562@collabora.com> To: Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Dave Stevenson , Dmitry Baryshkov Cc: kernel@collabora.com, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org X-Mailer: b4 0.14.2 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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") Signed-off-by: Cristian Ciocaltea Reviewed-by: Dmitry Baryshkov --- drivers/gpu/drm/display/drm_hdmi_state_helper.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/display/drm_hdmi_state_helper.c b/drivers/gpu/drm/display/drm_hdmi_state_helper.c index c205f37da1e12b11c384670db83e43613e031340..6bc96d5d1ab9115989e208d9899e16cd22254fb6 100644 --- a/drivers/gpu/drm/display/drm_hdmi_state_helper.c +++ b/drivers/gpu/drm/display/drm_hdmi_state_helper.c @@ -506,12 +506,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;