From nobody Thu Dec 18 00:25:35 2025 Received: from bali.collaboradmins.com (bali.collaboradmins.com [148.251.105.195]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5E8B5212F8E for ; Tue, 24 Dec 2024 18:23:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.251.105.195 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735064591; cv=none; b=qtndrG6hLs/Zbj35nTyEd9eP+uNIaZ7rETOFT89qe/Dz+YWfS2rPswjYwQ2QeFRhKUiOOMYcc746x5yxKOdxOh1mDOfwS9Tpav1UKIrSV3O4oQzklDEsNkUNEOHKQpolobA2Pxj0GvYcVO3+LhrAhRWBYpGVCOXNH4V7FX/mmq8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735064591; c=relaxed/simple; bh=JtCEEwmYZPadtfHTgKuyPEYfaljhF6+DmUW9Qug1I4M=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=IcDR04+d1LcjAZpaT2uuAjx8gG44DxetbnyRU10ByA87NCNVzj0DlGOKdrFAZx8BeQOuRd6OlTkXtn74dKS3+/0hrJ70Ujce2uJbinOu1Jx6SWAerwHh3WACfFRxotzUqeaPOnVTyZqWND0D/NG1Y3w9GHGMBD27YhQyxt+ye/s= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=qzI7FbCW; arc=none smtp.client-ip=148.251.105.195 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="qzI7FbCW" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1735064581; bh=JtCEEwmYZPadtfHTgKuyPEYfaljhF6+DmUW9Qug1I4M=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=qzI7FbCWnx/0g6jIYxWEd+JuYqJXEbRwwVIjXxn7RQO7LD4Xj8bJbWQWqihG8aFw3 OltivGsPgga1xixCuqC1dfDln2S05NeMcWJWaEKtJCCFP96LDP4i0+GgWh8ASkOZH/ 36iJQ9rV0U9V24GYioy4/sDAtXAAVAFloik/JmG9Jl8WKt7jG0iEtNh/VHHMNeLIfr AqYUbEz5kaSVJm3n3R2LhaO5VzWgkwDiDGR5lyV637BnVNuyE3WoVMJCPhP2DFHjV/ LrZ4tbVdBvWarPHbjsnFtkzt52z0Fu+6hDRknO35u9hesZHF5oDAtIuIVXlI7e4phg qNQcJJw+eDsUA== Received: from localhost (unknown [84.232.140.38]) (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 ESMTPSA id D682A17E15B4; Tue, 24 Dec 2024 19:23:00 +0100 (CET) From: Cristian Ciocaltea Date: Tue, 24 Dec 2024 20:22:43 +0200 Subject: [PATCH v4 3/4] drm/connector: hdmi: Validate supported_formats matches ycbcr_420_allowed Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20241224-bridge-conn-fmt-prio-v4-3-a9ceb5671379@collabora.com> References: <20241224-bridge-conn-fmt-prio-v4-0-a9ceb5671379@collabora.com> In-Reply-To: <20241224-bridge-conn-fmt-prio-v4-0-a9ceb5671379@collabora.com> To: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Dmitry Baryshkov Cc: kernel@collabora.com, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org X-Mailer: b4 0.14.2 Ensure HDMI connector initialization fails when the presence of HDMI_COLORSPACE_YUV420 in the given supported_formats bitmask doesn't match the value of drm_connector->ycbcr_420_allowed. Suggested-by: Dmitry Baryshkov Reviewed-by: Dmitry Baryshkov Signed-off-by: Cristian Ciocaltea --- drivers/gpu/drm/drm_connector.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connecto= r.c index ae6e71305f3000aff1cfe96b050061a300b9478e..46295176f39f91d69eaad716bb9= 315002f38e633 100644 --- a/drivers/gpu/drm/drm_connector.c +++ b/drivers/gpu/drm/drm_connector.c @@ -590,6 +590,9 @@ int drmm_connector_hdmi_init(struct drm_device *dev, if (!supported_formats || !(supported_formats & BIT(HDMI_COLORSPACE_RGB))) return -EINVAL; =20 + if (connector->ycbcr_420_allowed !=3D !!(supported_formats & BIT(HDMI_COL= ORSPACE_YUV420))) + return -EINVAL; + if (!(max_bpc =3D=3D 8 || max_bpc =3D=3D 10 || max_bpc =3D=3D 12)) return -EINVAL; =20 --=20 2.47.0