Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp2361004rdb; Mon, 12 Feb 2024 02:08:17 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCX4ImVjF3Buay2dRJ+HdzpBfepGZ0VQ0/QiomdQNoj0em1xoecXn9BYBJFRNGtkCW39cz0xDz+Me+6HhqmhBUxpzLTJ+xYIz4COyqWbXA== X-Google-Smtp-Source: AGHT+IFEDcDk9pK/6OBYXC0hd8o0n6j9q0DxjmPySNUvboUUYCn3wqdqRRFOYX4m5E8cczfy3sDA X-Received: by 2002:a05:6870:678c:b0:219:ed49:f1b3 with SMTP id gc12-20020a056870678c00b00219ed49f1b3mr6510032oab.28.1707732496686; Mon, 12 Feb 2024 02:08:16 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707732496; cv=pass; d=google.com; s=arc-20160816; b=r9xcG1vwLDduwctDOUr6X/QFPbjZEMeCqIOMhikt+14mjuNZmNk7JIEsA0jrf7Ev0e gKALxS3VzHbjtqceeDaLRPNjzqdhrQTKLzPjTmdvbIuN/mz2ue7YnyFc0eaP5LvtGl3I bd5+ZGvBoOqnMjMQp5dP4AD7ZcwRjN7U0j/WPBU03ZoP7jeQScYEKO0Kw0zqxDzAbeVI vrcKFVNeYmBmUg3egDiGh7dNqofNRSf9ts436SvcFB4NJlYJ/yFWViaidbSsCmAXvI99 QT7QlIeHfSNHQzPY6c54MSve9+1/Uv6GGhoNlVG3fq3bH2I8yEKap0k9MD6Mk82tvVuL tmhA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=yA6p+EOjgyZ23gL9UtpNPuMol2WZ2yaU3m75LLWG9Rc=; fh=h45Gsr7lCAlVnUdw696CEqzfmZk5J7vHSZNcS0U4cGI=; b=jr2hx41c1RNxvWh9nZfiooUcWxtGPof7F0XA4cqom0i4uM6yJtQoW81GxFPYl1x+WW HL5lDNuJmDLbOhi5PQEh1BYOoqIcoM+YJy/2hZ+clZg35BJyKFJK35FOWZJ70q9SAwXF Bvh78BZ20YyKtbRQNY6yN/APFmd8RM5gQ7EoiVT/SyxGBWDxLC8vv+tMKTp/GTtd7UVd SxqAZ6peBaQCaAujnQu/Jkc0JavjvBg3of388sERX0xsrJNOZdvHq0e6gBXXr+6YR+yJ ykkKNMgnpw9/gA4JLPNFs4EBDTnA1YhDlQDZDsgz9JtSRDN9kDPH15QcchcfaF0iyIgc Ag2g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=vRdcfGdN; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-61276-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-61276-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Forwarded-Encrypted: i=2; AJvYcCUABF7MHz4XlPXbKmlErFFyQSW1HM53XcQhP2S8ezPEaWd/+nNqgu/yfO5+Q2fsB5uJogXS0P6i+Vc2PHWXsRhHERCNWsywuAvBK7em+w== Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id dq8-20020a056a020f8800b005dc351748d6si25774pgb.40.2024.02.12.02.08.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Feb 2024 02:08:16 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-61276-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=vRdcfGdN; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-61276-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-61276-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id CC554B24031 for ; Mon, 12 Feb 2024 10:01:37 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5FDB71803A; Mon, 12 Feb 2024 10:01:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="vRdcfGdN" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 524A05244; Mon, 12 Feb 2024 10:01:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707732070; cv=none; b=RHo4JKsS12kA7Rx+FWwZUwvXZaiFUD37VD7XhXBfqUnJ0wsHqu6wiTlkzg5TozZwyUsnxKq0amWx03ysyQA2pnIi4Jr62Woi29SljbsGydyf7sfrnFRHFVQGEKQKcGXzfPyrFbiehzhgREjd3dkdJ8mrDSjaGFUoIDU9XCKGP1E= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707732070; c=relaxed/simple; bh=ZV4pECgPYcbYpTFYE/HHDZCGaJXwRLM519uxPcGBl0I=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=PKSuZrig1GVtHjpM6uqtZY8wBSkBw3q0hEPwC+TGxjHRqOoo4RibGAVvMggxICaXNhLiLkKCcOku8kLtVgRCNerQ3YNG1qiXC2/LNeOv37VSjcAFStQXba2jx/cY9RB7a44XzR5Gi+GaUuZDYg3NbcorZLl2IFIok7y5Pnd8CEc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=vRdcfGdN; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 76253C433F1; Mon, 12 Feb 2024 10:01:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1707732069; bh=ZV4pECgPYcbYpTFYE/HHDZCGaJXwRLM519uxPcGBl0I=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=vRdcfGdNCOnmnB8/dcuM1aTGBkhnZCU+s8sdi2HDhKo1bAM9sweGpXpaiAluc56DU 6M+uTI+N44afTG92KjSZS06Cfpa3OKXGNfTgQHDL2jFuLI3Rng7DXh+ZJI3cWNlsJS BrKiT9j7VQH3iQOQrybjasLvm2WVuEaU0eflNduPT/sjhtKqTrydzL3flueiwkwNlu f/aJmEAyfDnbIhycldNE2lW71I6zwId6r2BydT7BXebgkkBpsQreTcUL1iJlcsiVx/ 1f3nRZU3Jb4tGQY9zd4Z/FxH4FKFD7uYhtz7fG5gF60eK1onGRgp31xxYoRYOP9X6S MgypK9eU7VjMA== Date: Mon, 12 Feb 2024 11:01:07 +0100 From: Maxime Ripard To: Sebastian Wick Cc: Ville =?utf-8?B?U3lyasOkbMOk?= , Maarten Lankhorst , Thomas Zimmermann , David Airlie , Daniel Vetter , Emma Anholt , Jonathan Corbet , Sandy Huang , Heiko =?utf-8?Q?St=C3=BCbner?= , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Hans Verkuil , linux-rockchip@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org Subject: Re: Re: Re: Re: Re: [PATCH v5 08/44] drm/connector: hdmi: Add Broadcast RGB property Message-ID: References: <20231207-kms-hdmi-connector-state-v5-0-6538e19d634d@kernel.org> <20231207-kms-hdmi-connector-state-v5-8-6538e19d634d@kernel.org> <20240115143308.GA159345@toolbox> <20240115143720.GA160656@toolbox> <73peztbeeikb3fg6coxu3punxllgtyrmgco34tnxkojtsjbr3s@26bud3sjbcez> <20240209203435.GB996172@toolbox> 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-sha512; protocol="application/pgp-signature"; boundary="jve3saefgwx6cqdm" Content-Disposition: inline In-Reply-To: <20240209203435.GB996172@toolbox> --jve3saefgwx6cqdm Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Feb 09, 2024 at 09:34:35PM +0100, Sebastian Wick wrote: > On Mon, Feb 05, 2024 at 10:39:38AM +0100, Maxime Ripard wrote: > > On Fri, Feb 02, 2024 at 06:37:52PM +0200, Ville Syrj=E4l=E4 wrote: > > > On Fri, Feb 02, 2024 at 04:59:30PM +0100, Maxime Ripard wrote: > > > > On Fri, Feb 02, 2024 at 05:40:47PM +0200, Ville Syrj=E4l=E4 wrote: > > > > > On Fri, Feb 02, 2024 at 02:01:39PM +0100, Maxime Ripard wrote: > > > > > > Hi, > > > > > >=20 > > > > > > On Mon, Jan 15, 2024 at 03:37:20PM +0100, Sebastian Wick wrote: > > > > > > > > > /** > > > > > > > > > * DOC: HDMI connector properties > > > > > > > > > * > > > > > > > > > + * Broadcast RGB > > > > > > > > > + * Indicates the RGB Quantization Range (Full vs Li= mited) used. > > > > > > > > > + * Infoframes will be generated according to that v= alue. > > > > > > > > > + * > > > > > > > > > + * The value of this property can be one of the fol= lowing: > > > > > > > > > + * > > > > > > > > > + * Automatic: > > > > > > > > > + * RGB Range is selected automatically base= d on the mode > > > > > > > > > + * according to the HDMI specifications. > > > > > > > > > + * > > > > > > > > > + * Full: > > > > > > > > > + * Full RGB Range is forced. > > > > > > > > > + * > > > > > > > > > + * Limited 16:235: > > > > > > > > > + * Limited RGB Range is forced. Unlike the = name suggests, > > > > > > > > > + * this works for any number of bits-per-co= mponent. > > > > > > > > > + * > > > > > > > > > + * Drivers can set up this property by calling > > > > > > > > > + * drm_connector_attach_broadcast_rgb_property(). > > > > > > > > > + * > > > > > > > >=20 > > > > > > > > This is a good time to document this in more detail. There = might be two > > > > > > > > different things being affected: > > > > > > > >=20 > > > > > > > > 1. The signalling (InfoFrame/SDP/...) > > > > > > > > 2. The color pipeline processing > > > > > > > >=20 > > > > > > > > All values of Broadcast RGB always affect the color pipelin= e processing > > > > > > > > such that a full-range input to the CRTC is converted to ei= ther full- or > > > > > > > > limited-range, depending on what the monitor is supposed to= accept. > > > > > > > >=20 > > > > > > > > When automatic is selected, does that mean that there is no= signalling, > > > > > > > > or that the signalling matches what the monitor is supposed= to accept > > > > > > > > according to the spec? Also, is this really HDMI specific? > > > > > > > >=20 > > > > > > > > When full or limited is selected and the monitor doesn't su= pport the > > > > > > > > signalling, what happens? > > > > > > >=20 > > > > > > > Forgot to mention: user-space still has no control over RGB v= s YCbCr on > > > > > > > the cable, so is this only affecting RGB? If not, how does it= affect > > > > > > > YCbCr? > > > > > >=20 > > > > > > So I dug a bit into both the i915 and vc4 drivers, and it looks= like if > > > > > > we're using a YCbCr format, i915 will always use a limited rang= e while > > > > > > vc4 will follow the value of the property. > > > > >=20 > > > > > The property is literally called "Broadcast *RGB*". > > > > > That should explain why it's only affecting RGB. > > > >=20 > > > > Right. And the limited range option is called "Limited 16:235" desp= ite > > > > being usable on bpc > 8 bits. Naming errors occurs, and history hap= pens > > > > to make names inconsistent too, that's fine and not an argument in > > > > itself. > > > >=20 > > > > > Full range YCbCr is a much rarer beast so we've never bothered > > > > > to enable it. > > > >=20 > > > > vc4 supports it. > > >=20 > > > Someone implemented it incorrectly then. > >=20 > > Incorrectly according to what documentation / specification? I'm sorry, > > but I find it super ironic that i915 gets to do its own thing, not > > document any of it, and when people try to clean things up they get told > > that we got it all wrong. >=20 > FWIW, this was an i915 property and if another driver uses the same > property name it must have the same behavior. Yes, it isn't standardized > and yes, it's not documented (hence this effort here) but it's still on > vc4 to make the property compatible. How is it not compatible? It's a superset of what i915 provides, but it's strictly compatible with it. I would argue that i915 is the broken one since userspace could force a full range output, but since the driver takes the YUV vs RGB decision itself and only supports limited range for YUV, the driver would effectively ignore that user-space property, without the user-space being able to tell it was ignored in the first place. > Trying to make the property handle YCbCr is very much in the "let's try > to fix the property" territory that I want to avoid, so I'm in favor of > adjusting vc4. Breaking the ABI in the process. For something that is explicitly supported by the spec, the driver, and the hardware. On a property that never said it wasn't meant to be used that way, and with semantics based on a driver that never provided a way to check those restrictions in the first place. And it's not like i915 is going to use that code anyway. Maxime --jve3saefgwx6cqdm Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQRcEzekXsqa64kGDp7j7w1vZxhRxQUCZcnsYgAKCRDj7w1vZxhR xbXvAQCwcVIa0ZIBiFB60+Djxs5Q9r6KT+VmRcFEid+4vu5kmAD/SoSSxALs4Fec o0UKGT8WuF+A9QWBqCkljcQ1i+X1aAA= =q4Ag -----END PGP SIGNATURE----- --jve3saefgwx6cqdm--