From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 4988C1E51E0 for ; Fri, 19 Jun 2026 14:01:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781877712; cv=none; b=CGswTah9XsRzeGA8LniQFxd+SYSAPVbEelNsVuxPllHz+w97vL+xG25sfIeYiMdd7xXnDbi5i7+1Nl0TnCt6cFMAJ057W2LwdOHR7XSnE3Wma90+0f21K6y2aASeJ4Ct0ortZMJ7uzA/H3ssqSfkVjL3/n18F1g1/PGh1l/VYm4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781877712; c=relaxed/simple; bh=j2P1uvS4/QvkbSFQnOYHms+m1OJ+GUJ1egZUbhln/uw=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=FnN4knFMOwUUKa5uiGlmyfRh5/v1r3Z9fUIOdDg4SjOWZcahT9XDgy9Ro0nqaS0zuiHWZ+GtIEt2FpVDfsg/7ip/aru37VYdns+Qzc2ZycadBVlDJhBg+y0itbyTX03JgVGTASLEim5VrlzCiUP7P+Ymqkn4+gXw5S/boaMPWvE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=fPMsuA12; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="fPMsuA12" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5A8041F00A3A; Fri, 19 Jun 2026 14:01:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1781877710; bh=L3w5DFmo5LWBF/MmINv32YYzLvzXSqsQ7GWh271tmlU=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=fPMsuA12Y32h107pM3faOHT7T70MDyIZOZbqXEpcSfY1nbfwAszB990E+asjUPJgw FyKAH3JLnjqDswXDUCcIwgNd+OmJ5aRKBCKTPuF8ZTvNqlao0/Zj8VS6CDgf28dnXb hHHZOTSRzl0HAY59FDB+nkNN+vEIE1347gD5VQB79jgzBX8OCrAkYwn0hl0rJngJnZ jQesCMI4yK5Roex1d2YNwNOnOBx3hBOg+khJgCLJxbbYhImndcjpo4X/CYx2k6O1Qp KZBmrlxlYs2f2sILIiXl6KhMTZj1GoyVNy6A1c4h8J/Z/1gYSrGOoXf68k57b3g/X+ TW1AHGk90CtNA== Date: Fri, 19 Jun 2026 16:01:48 +0200 From: Maxime Ripard To: Nicolas Frattaroli Cc: Maarten Lankhorst , Thomas Zimmermann , David Airlie , Simona Vetter , Dmitry Baryshkov , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, kernel@collabora.com Subject: Re: [PATCH v2 1/2] drm/display: hdmi: Only allow BPC values of 8, 10, 12 and 16 Message-ID: <20260619-shapeless-proficient-corgi-4cdeb1@houat> References: <20260618-hdmi-max-bpc-fix-v2-0-7b67f489b0cc@collabora.com> <20260618-hdmi-max-bpc-fix-v2-1-7b67f489b0cc@collabora.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha384; protocol="application/pgp-signature"; boundary="lchwn5gpqwej4pby" Content-Disposition: inline In-Reply-To: <20260618-hdmi-max-bpc-fix-v2-1-7b67f489b0cc@collabora.com> --lchwn5gpqwej4pby Content-Type: text/plain; protected-headers=v1; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Subject: Re: [PATCH v2 1/2] drm/display: hdmi: Only allow BPC values of 8, 10, 12 and 16 MIME-Version: 1.0 Hi Nicolas, On Thu, Jun 18, 2026 at 08:54:23PM +0200, Nicolas Frattaroli wrote: > As per the comment in sink_supports_format_bpc(), CTA-861-F defines that > only bits-per-channel values of 8, 10, 12 and 16 are allowed for HDMI. > Allowing more than this has surprising consequences for the atomic check > phase. The HDMI state helpers may accidentally conclude that a sink > supports 11bpc if a caller asks for it. >=20 > Fix this by exiting early if the bpc value doesn't match one of those > given in the standard. >=20 > Fixes: 26ff1c38fc29 ("drm/connector: hdmi: Compute bpc and format automat= ically") > Signed-off-by: Nicolas Frattaroli > --- > drivers/gpu/drm/display/drm_hdmi_state_helper.c | 10 ++++++++++ > 1 file changed, 10 insertions(+) >=20 > diff --git a/drivers/gpu/drm/display/drm_hdmi_state_helper.c b/drivers/gp= u/drm/display/drm_hdmi_state_helper.c > index ce17eeefc2da..0bf6102244f7 100644 > --- a/drivers/gpu/drm/display/drm_hdmi_state_helper.c > +++ b/drivers/gpu/drm/display/drm_hdmi_state_helper.c > @@ -420,6 +420,16 @@ sink_supports_format_bpc(const struct drm_connector = *connector, > return false; > } > =20 > + switch (bpc) { > + case 8: > + case 10: > + case 12: > + case 16: > + break; > + default: > + return false; > + } > + Sorry for not noticing in your first version, but I'd move this before the VIC 1 check, and would add a comment to refer to the spec (possibly by splitting the comment already there for the VIC 1 check). We should also log debug message on failure like we do for every other rejection path. Maxime --lchwn5gpqwej4pby Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iJUEABMJAB0WIQTkHFbLp4ejekA/qfgnX84Zoj2+dgUCajVLzAAKCRAnX84Zoj2+ dlpLAYD01pN0pz6tGuaz2wd0mxFQ3rHcyXxXDjpx0LVqb6F5FPiYjRKlM9DMzMhr wlBanTUBf36bd0rutP5lNFgPWTemzh9AGcrxCgHDCnKk3E3Nw6AtNAVEwNBaL6PR yh1F/cqykw== =oOlc -----END PGP SIGNATURE----- --lchwn5gpqwej4pby--