Received: by 2002:a05:7412:798b:b0:fc:a2b0:25d7 with SMTP id fb11csp331800rdb; Thu, 22 Feb 2024 05:21:07 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWj4GKatNG0BhBHRaXiS3hDAr6AxAlfm4u+n7CO9MMxX678eEVOjP7AWOj91xJDcn90mhg8dvolT35VOHoMbrpUl8IU3zeoYNvQtF5P0A== X-Google-Smtp-Source: AGHT+IGQoZ6rOYEH0xgp+BDFvEZhhgAB/yXVXCRSCgMZsOIF1timXD+47Iojunfetktqxcgy5icW X-Received: by 2002:a17:906:1cc2:b0:a3e:4d4c:d120 with SMTP id i2-20020a1709061cc200b00a3e4d4cd120mr11756793ejh.12.1708608066921; Thu, 22 Feb 2024 05:21:06 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708608066; cv=pass; d=google.com; s=arc-20160816; b=AsEWUL5lDczzEspyhnmJu8nb7f8Ad79gt/x/dvkBDRNAfW3cwSH10wGd16uCqG+ok0 SRrAgCpacuiCnXrOXzwct9ahGJyy9nxSfmDiQcpshOWayo0Kx2pmZNp953p7fpk6mtJE EzpFTrN7xZT5iOCwTwtBLoazdBspRlA+6BUNXx6gPSrvyYZhuJW1bkXY89Z0OVtfcLUk lX/rea+IBUc0KugTqFSWF1CQVebFDiykJvTLwhyRVPvIgN0t3+vSKj3LYOjB2ZvVV79F Tu0LSW0DPxyv3F7hbeVbjiG1Ln5ipwqXgbUNDKVA+WfY81H6CcXVHdpFrsB4eIJwtxsk z0ZA== 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=CInpbL1tcRZXtL67JbgasilIquCFg0uAxYg1B/lB/iM=; fh=r52aqt/Wxwr/YBmQPaUKndGioAWCiGpCWR25cIOSjTM=; b=yu4/k9UPLqYHRFzlrh/oOnW4VeTbV3AG7rFsxmzg30TKA+zoQa3uDa6kP1exo+8rHM lBbVu5vhiK4ExLLSrRXliLbBkjwKIMznr788EG8Rli7vE8G5HAAiO0zH23EmsUDOBct/ xUOPMpz/1lav8RlRIFpf8l9fpcLKStrMcQHxbeqDf5E/v5vrrJTM52PW2s6P7NAo4YCe T/2//s4zK1KEOAh2BAMoOnZQ/VBWC3KiDVdGMfbXtukoAynp4C6nWxd3ZZ4PH5Dzt+qM 3M3qYVR/Wn3lUQm0puIyRcba8kSYHm217T87DS8VN6abxbPhmrZOEbMkU3xfc1KIta1n RXtg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=M0WEOm8k; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-76581-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-76581-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id l8-20020a1709061c4800b00a3e7b129260si3892755ejg.179.2024.02.22.05.21.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Feb 2024 05:21:06 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-76581-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=M0WEOm8k; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-76581-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-76581-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 7E4581F27027 for ; Thu, 22 Feb 2024 13:21:06 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6D869133298; Thu, 22 Feb 2024 13:20:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="M0WEOm8k" 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 2B62B12FF74; Thu, 22 Feb 2024 13:20:52 +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=1708608053; cv=none; b=Tj1cDN2MN1j/q27Q9bWJ+snMM74KMi0jkLi58fj6q587sDbMAicm+doYSlQ3cgpmZTIJRndOWUUra1+3OJrU/dK4EBtRdvOW+Tn9ojRJhHyos4OO3zXxAr0sCZxMmJpZ2ler8YNGW6nZIQPaT93ZM5Kz+DTtApdP7zuTkRPsKRU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708608053; c=relaxed/simple; bh=Zu7T88OQKLjnCfKYveIU790NUrfbhEaWjmTCXZYnncA=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=gNtQ1ng5ixnXs4zEodUnb4v7s5rGERkXlPhT7QPNXHzZ1AaqePyIf5kIzVr0hHAtgB0NHPiGQGZs27o+DxvZjCWSh7fNED7GV0HMM+ENxtCZS1bpy7SrS8821R6g1wtjUFty/VAeR0doBCst1iyrli+wu/q2jLgZm0SXQhD/MKE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=M0WEOm8k; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3265DC433F1; Thu, 22 Feb 2024 13:20:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708608052; bh=Zu7T88OQKLjnCfKYveIU790NUrfbhEaWjmTCXZYnncA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=M0WEOm8ktKGlyWLacF5Eq1chGM6nr37qP9xBp8Ka3xn4FV0USBItMRkpg5davyEDR i7hd5f9rPQhrU9qLcZEr9ZkBmkyEzuiMvdXWJrU6qIaNCtMX4Pv5Bri+IvvSBT9eNJ R30zOLoUEJtZYT88fo7qS96vyaW4RNP+B/Q0R6TTt8n20wvvjWFebgWLnI3TK78xu7 hWDtONcnJbzb1GmEp7XrmUgYzGLDSORugYi3RB57zioad41pS0OMVfY8jVD3Al/OZs giIWtZJtXo924svaDlRRvGibfVoVwwckTcaHTVi1KwWopCvrYpqw0+Bc7SPP6IcE8W Cd2/y5xQ8erxA== Date: Thu, 22 Feb 2024 14:20:49 +0100 From: Maxime Ripard To: Ville =?utf-8?B?U3lyasOkbMOk?= Cc: Sebastian Wick , 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: [PATCH v5 08/44] drm/connector: hdmi: Add Broadcast RGB property Message-ID: References: <20240209203435.GB996172@toolbox> <20240212170618.GA1372043@toolbox> <2mih3humepuedtli7ge52ncom4uffkqravdpalncgfyucmwdzc@bp5o7i3ky77a> <20240219140144.GB1956149@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="tbiepc54hbczafix" Content-Disposition: inline In-Reply-To: --tbiepc54hbczafix Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Feb 22, 2024 at 02:58:45PM +0200, Ville Syrj=E4l=E4 wrote: > On Thu, Feb 22, 2024 at 11:54:04AM +0100, Maxime Ripard wrote: > > On Mon, Feb 19, 2024 at 03:01:44PM +0100, Sebastian Wick wrote: > > > On Thu, Feb 15, 2024 at 12:00:01PM +0100, Maxime Ripard wrote: > > > > On Mon, Feb 12, 2024 at 06:06:18PM +0100, Sebastian Wick wrote: > > > > > On Mon, Feb 12, 2024 at 05:53:48PM +0100, Maxime Ripard wrote: > > > > > > On Mon, Feb 12, 2024 at 05:49:33PM +0200, Ville Syrj=E4l=E4 wro= te: > > > > > > > On Mon, Feb 12, 2024 at 11:01:07AM +0100, Maxime Ripard wrote: > > > > > > > > On Fri, Feb 09, 2024 at 09:34:35PM +0100, Sebastian Wick wr= ote: > > > > > > > > > On Mon, Feb 05, 2024 at 10:39:38AM +0100, Maxime Ripard w= rote: > > > > > > > > > > On Fri, Feb 02, 2024 at 06:37:52PM +0200, Ville Syrj=E4= l=E4 wrote: > > > > > > > > > > > On Fri, Feb 02, 2024 at 04:59:30PM +0100, Maxime Ripa= rd wrote: > > > > > > > > > > > > On Fri, Feb 02, 2024 at 05:40:47PM +0200, Ville Syr= j=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, Sebas= tian Wick wrote: > > > > > > > > > > > > > > > > > /** > > > > > > > > > > > > > > > > > * DOC: HDMI connector properties > > > > > > > > > > > > > > > > > * > > > > > > > > > > > > > > > > > + * Broadcast RGB > > > > > > > > > > > > > > > > > + * Indicates the RGB Quantization R= ange (Full vs Limited) used. > > > > > > > > > > > > > > > > > + * Infoframes will be generated acc= ording to that value. > > > > > > > > > > > > > > > > > + * > > > > > > > > > > > > > > > > > + * The value of this property can b= e one of the following: > > > > > > > > > > > > > > > > > + * > > > > > > > > > > > > > > > > > + * Automatic: > > > > > > > > > > > > > > > > > + * RGB Range is selected au= tomatically based on the mode > > > > > > > > > > > > > > > > > + * according to the HDMI sp= ecifications. > > > > > > > > > > > > > > > > > + * > > > > > > > > > > > > > > > > > + * Full: > > > > > > > > > > > > > > > > > + * Full RGB Range is forced. > > > > > > > > > > > > > > > > > + * > > > > > > > > > > > > > > > > > + * Limited 16:235: > > > > > > > > > > > > > > > > > + * Limited RGB Range is for= ced. Unlike the name suggests, > > > > > > > > > > > > > > > > > + * this works for any numbe= r of bits-per-component. > > > > > > > > > > > > > > > > > + * > > > > > > > > > > > > > > > > > + * Drivers can set up this property= by calling > > > > > > > > > > > > > > > > > + * drm_connector_attach_broadcast_r= gb_property(). > > > > > > > > > > > > > > > > > + * > > > > > > > > > > > > > > > >=20 > > > > > > > > > > > > > > > > This is a good time to document this in mor= e 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 t= he color pipeline processing > > > > > > > > > > > > > > > > such that a full-range input to the CRTC is= converted to either full- or > > > > > > > > > > > > > > > > limited-range, depending on what the monito= r is supposed to accept. > > > > > > > > > > > > > > > >=20 > > > > > > > > > > > > > > > > When automatic is selected, does that mean = that there is no signalling, > > > > > > > > > > > > > > > > or that the signalling matches what the mon= itor is supposed to accept > > > > > > > > > > > > > > > > according to the spec? Also, is this really= HDMI specific? > > > > > > > > > > > > > > > >=20 > > > > > > > > > > > > > > > > When full or limited is selected and the mo= nitor doesn't support the > > > > > > > > > > > > > > > > signalling, what happens? > > > > > > > > > > > > > > >=20 > > > > > > > > > > > > > > > Forgot to mention: user-space still has no co= ntrol over RGB vs 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 drive= rs, and it looks like if > > > > > > > > > > > > > > we're using a YCbCr format, i915 will always us= e a limited range 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 "Limi= ted 16:235" despite > > > > > > > > > > > > being usable on bpc > 8 bits. Naming errors occurs,= and history happens > > > > > > > > > > > > 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 n= ever bothered > > > > > > > > > > > > > to enable it. > > > > > > > > > > > >=20 > > > > > > > > > > > > vc4 supports it. > > > > > > > > > > >=20 > > > > > > > > > > > Someone implemented it incorrectly then. > > > > > > > > > >=20 > > > > > > > > > > Incorrectly according to what documentation / specifica= tion? 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 use= s 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. > > > > > > > >=20 > > > > > > > > How is it not compatible? It's a superset of what i915 prov= ides, but > > > > > > > > it's strictly compatible with it. > > > > > > >=20 > > > > > > > No it is not. > > > > > >=20 > > > > > > The property is compatible with i915 interpretation of it, whet= her you > > > > > > like it or not. And that's what Sebastian was referring to. > > > > > >=20 > > > > > > > Eg. what happens if you set the thing to full range for RGB (= which you > > > > > > > must on many broken monitors), and then the kernel automagica= lly > > > > > > > switches to YCbCr (for whatever reason) but the monitor doesn= 't > > > > > > > support full range YCbCr? Answer: you get crap output. > > > > > >=20 > > > > > > And that part is just moving goalposts. > > > > >=20 > > > > > But it's really not. > > > >=20 > > > > It really is. This whole discussion started by "well it would be ni= ce if > > > > we made that property handled by the core", and we're now at the "we > > > > need to deal with broken YCbCr displays and i915 opinion about them" > > > > stage. After creating documentation, unit tests, etc. It's the text= book > > > > definition of moving goalposts. And while i915 won't be affected by= all > > > > that work. > > >=20 > > > Sorry, but what you're saying is just not true. > > >=20 > > > The Broadcast RGB property is an Intel specific property. > >=20 > > No, it's not. vc4 has been using it for a year now. > >=20 > > > It lacked documentation but the user space contract exists and it > > > based on how i915 implemented it. By changing the semantics you're > > > breaking user space. The documentation has to document the current > > > contract between i915 and user space, not whatever you want the > > > property to be like. > > >=20 > > > I get that you're frustrated that you have to do work while i915 does= n't > > > but none of that is relevant for what the property is and how user sp= ace > > > expects it to work. > >=20 > > That's not it, really. I don't mind doing the work. I do mind losing > > functionalities on something that was working fine. And getting the > > blame for something that is, at best, just as much of an documentation > > issue on i915 devs. >=20 > We've had a couple of these cases recently where people have taken > some old property implemented by i915 and implemented it differently > in some other driver. Dunno if the reason was that people didn't try > to understand what i915 is doing and why, or they misundestood it, > or they understood it but decided to ignore it anyway. I can't tell for the other cases, but in this particular case it's definitely in the misunderstanding category. And implying that we didn't even try to understand it, or that we didn't consult anyone when the patches were posted on the ML for months doesn't seem fair either. > Unfortunately having undocumented corners in the uapi is simply > a fact of life when dealing with a >15 year old legacy codebase. > Also there were basically no rules regarding properties in the > past, so everyone just added random properties whenever they=20 > felt like it. >=20 > I think going forward we should probably lay down some extra > ground rules; if an old undocumented uapi is being extended > to cover more than one driver we must first figure out what > the de facto semantics are, and document things properly > before anything else gets done. That sounds reasonable, but you (not you personally, but the i915 team in general) also have to engage, you can't just impose that on everyone else, and then just hope they will figure it out perfectly without your help. I think that whole story is a testament to that. Maxime --tbiepc54hbczafix Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQRcEzekXsqa64kGDp7j7w1vZxhRxQUCZddKMQAKCRDj7w1vZxhR xQZ0AP9xIjID3WRjPO9YmF5lo+fbKpeIUuu3c3a+WG/PCA+kOAD/d6a9EMFe7j7G LSSIf9ENRHhLQi1d/PbumiFAR9PLeQM= =aA2v -----END PGP SIGNATURE----- --tbiepc54hbczafix--