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 88D1A261B8D for ; Thu, 18 Jun 2026 15:48:44 +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=1781797725; cv=none; b=laCyi2kHlpNo5ijvPkSr7a8p19Y+GASSMX92VLYBvkz6P6dgoLoDirjBaoDmitBsOk08y/nJd9rgNtlU6VC1SQI3lVF/zge2QV1pcTopYB4L5SP7qMvK9xyXgofETEwGGwD7UHV0uAEAQvdysq9mGamngE05cCV2NT/i4gRYMUI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781797725; c=relaxed/simple; bh=8n4HL8JKwhJmIYyhxPMrMUQdSZP+magVoUvrNWlahuY=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=NgDjfsdtevoV0BBrNuYGPFrsZ3ryMRC+4YtxRK9oY+KIayssS/wj4dZiQSCu0c3f2IyWBsw3hI9Bl9Mhw4U/reaCkrnxPk58j4RBwjjK0vGukVpVh1FDbY/oUr/+gf/9Tu19nX41e+6eP8zSG2dUTz/2lIHidZ0W4CkD8Ubwz8s= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=P+Z/0JkK; 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="P+Z/0JkK" Received: by smtp.kernel.org (Postfix) with ESMTPSA id ECDEC1F000E9; Thu, 18 Jun 2026 15:48:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1781797724; bh=8n4HL8JKwhJmIYyhxPMrMUQdSZP+magVoUvrNWlahuY=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=P+Z/0JkK/8j8bM1+eDmWnagnvJRTInoq5J96N6HgSSbyh2UuQmlr5Tz3iZioEJE8Y ykUh8p1bI5CGKVHhaDigS+YxZN2DPbEOAGcsWGEGtogdCOvh0girwEcsmT37YkIGLZ 4Z5mY4r0Un7PCeXF0xPGj0ByyyNT1DK2d8GwAcxTV3UUFR+bjkhXUMXiyrfwA276Bt xvr2OvlRuiwIbWJ4/yaEF7bedojNIGAnaM6FJn6jaOexrmijxFVdu2SSEKQ+MO+w9o J0bzuCGOfohPDqL4Czx3oG5ab06ggGF3sFZqqnWDNDzEH4s8LSoGErievhE90KPJsY jiZ66Jq9Y/CEg== Date: Thu, 18 Jun 2026 17:48:42 +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 0/2] Make HDMI state helpers handle odd max bpc requests Message-ID: <20260618-evasive-devious-cassowary-70a2b6@houat> References: <20260608-hdmi-max-bpc-fix-v1-0-6e8dcebc7274@collabora.com> <20260609-orthodox-cocky-bull-5ddef8@houat> 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="nawyvqvn2shi7gai" Content-Disposition: inline In-Reply-To: --nawyvqvn2shi7gai Content-Type: text/plain; protected-headers=v1; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Subject: Re: [PATCH 0/2] Make HDMI state helpers handle odd max bpc requests MIME-Version: 1.0 On Tue, Jun 09, 2026 at 05:46:20PM +0200, Nicolas Frattaroli wrote: > On Tuesday, 9 June 2026 14:51:12 Central European Summer Time Maxime Ripa= rd wrote: > > Hi, > >=20 > > On Mon, Jun 08, 2026 at 01:19:06PM +0200, Nicolas Frattaroli wrote: > > > With the "max bpc" KMS connector property, userspace can arbitrarily > > > restrict the upper end of the bits-per-component range. This is fine = and > > > good, except the HDMI state helpers never considered that max_bpc cou= ld > > > be influenced by a userspace setting, so assumed it'll always be an e= ven > > > value from the HDMI standards. > > >=20 > > > This, unfortunately, is not the world we live in anymore. Patch 1 > > > corrects sink_supports_format_bpc to return false on BPCs outside of > > > what HDMI allows. Patch 2 then corrects handling of odd-numbered max > > > bpcs by rounding the loop start value down to an even number instead.= It > > > also adds a KUnit test to make sure nobody breaks this again in the > > > future. > > >=20 > > > Signed-off-by: Nicolas Frattaroli > >=20 > > Do you have a bit more details on the world you live in? :) > >=20 > > In particular, why would erroring out on setting an odd value in > > atomic_set_property not work? >=20 > It would work, but it'd be an inferior solution IMHO. (If the intent > was to point out this is already done then I can't find the code where > such a check is performed.) >=20 > It's perfectly fine, albeit weird, for userspace to say it wants a max > bpc of 11. That HDMI does not support 11 bpc isn't really something the > upper end of the range should concern itself with, much like we don't > error out on a max bpc of 14 either even though HDMI does not support > bit depths of 14 bits. Yeah, this makes total sense indeed. > By counting from the next even number, we don't leak our implementation's > choice of trying every other bit depth through the uAPI with an overly > restrictive constraint being placed. In an alternate universe, mirror > world Maxime may have decided to i-- in that for loop instead just in > case, and the second patch wouldn't be needed. Damn current world Maxime :D Thanks for the explanation, the series looks mostly fine and I had two nits. Maxime --nawyvqvn2shi7gai Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iJUEABMJAB0WIQTkHFbLp4ejekA/qfgnX84Zoj2+dgUCajQTWQAKCRAnX84Zoj2+ dtnMAXoDM65XFye2u/uB3v/ttHxIq8Mo5Q622H77WbWYRTguvfOGQKNUcmTDLlFM wr4ldusBfiIc+J8jiaFbr06gVnmk79bQVfr0N4daYgHKhNVDgk9lxbysA/Qw5Ql5 PbShmX6wGA== =VBfy -----END PGP SIGNATURE----- --nawyvqvn2shi7gai--