Received: by 2002:a05:7412:798b:b0:fc:a2b0:25d7 with SMTP id fb11csp260013rdb; Thu, 22 Feb 2024 02:55:43 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCU/OhPY2aHMNI76b1dQ4QlMGT6E2TuFXNSyHpohJ/47Fi1eKu50kznzwwqleHidgygWmkKgF7OMGn1WL8hOTqs5v6gIztuK9PFYvL/O5A== X-Google-Smtp-Source: AGHT+IHe7Cl4ALqSbTnm/n1nBm35nIlHePa+knxlouX1u0l/gqK6I82e+bWMssNCmjVeg1utAhw6 X-Received: by 2002:a5b:89:0:b0:dcc:54d0:85ef with SMTP id b9-20020a5b0089000000b00dcc54d085efmr2029105ybp.5.1708599342814; Thu, 22 Feb 2024 02:55:42 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708599342; cv=pass; d=google.com; s=arc-20160816; b=tJxo6+NsB4EnMPANSiOyPyin+kgIvjxGHUshTeQjMIk/nITKbDYNM/KlrBvbEUOaZW rIB8hdjZ+Hwht8gQmH34JOprC8Q/BvmVg/wUrBaqOSJsdplU4Nk1V1/LZ6e9o0pmMi5m TerpREVpESgVAk2Ari9Wq2ckWqroF1M8gi80xUJfBBsR0f6bgl3m0R2AQgVnbI3mFZbU JpLz5HSxIAqYh9wJ0DNTBElJR1DEPHWtSAgbFVIXyuzuex4hypqDXcOUDtkb4g8tws5F 6LQsxfQpEvEFf6BSx9yXmZhQfRbm+A5Sxs2F+I5flFAitSJnfd2wxYiDaruW2Lh6MRpz TeHw== 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=AfTB07v8ucG82zPL0GXwlZQoKs+4KxcWTQ8+yMXFQSs=; fh=/i3NE5F5Re2e93K8X4bL4wUMEFJ9PWxi9kr9p6Q4Q8M=; b=xzpTqHibHKWSPGtYe25EqOE8K6fGTebdrzth/hfLUo0EubaEQ6XeAQKOWfEoxTOZM0 yqFG8l26Ku5gDqm+PWkQqRvXWYSvaQ2rynsY3F0rzOvhwwww7B7Z2sNjc5OcB7W5OPx6 4phX9umFDFKfroKw7hhwc8QCoL1AzQV6+HVqdrbfCTQ93553etTLSp0Fu/utt5YzQxbQ PjOjGjFiV/JZP1iR/sCmtUs0FxkmCh99iPcm9ZvSL331tkqda8ytgur27/yTGdp2k3Gt unXQSexI9f/IQATZGPnM84dpmRjfbHhXZ5UXTsDnxsagIj68SKP5WKQPcuwz2TZObqw7 xo+A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=p3wvyloe; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-76366-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-76366-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id s24-20020ac87598000000b0042e50c47cafsi549757qtq.47.2024.02.22.02.55.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Feb 2024 02:55:42 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-76366-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=p3wvyloe; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-76366-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-76366-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 811DE1C24193 for ; Thu, 22 Feb 2024 10:55:42 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 521E246448; Thu, 22 Feb 2024 10:54:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="p3wvyloe" 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 101833C480; Thu, 22 Feb 2024 10:54:07 +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=1708599248; cv=none; b=tRcgXXpLVUWb59YyfhMKkqjHfDPcXdNfKYJtz+nDnhXkT2E2tR8un6BVDVkmUMoqxX/K3J0ODAyB1vlc6GsUz65nuyKujhaQYt3LfRgPjlwJ7IvIyIJem74EJoV+0s8vGFltBhtbdeCHEWlPOMawY0CVuSOhsK1TCHE08naaRAI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708599248; c=relaxed/simple; bh=loLivqtLkCVCvcc36ob4PcvIWRrqM9ZGR67glJQXpxQ=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=b2J/kFiQq5SsozDBwcM5sLvNeazGVgJa+jltan6ulbAOjITnQdtG5ZWejbkVDtTbFsDFYE/2gGl7DPKwoJwPXqHOwi4CNFxhvus3G/R/W+0MqzAe108oKWE7Gi9jbn73cI0krG1jopLnua4LFHk11zM1MMA5GSZjkFPbLVlK40I= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=p3wvyloe; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 062AFC433F1; Thu, 22 Feb 2024 10:54:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708599247; bh=loLivqtLkCVCvcc36ob4PcvIWRrqM9ZGR67glJQXpxQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=p3wvyloeEyROYySZMhKhyijsbbEPmsXor7/vqv3JAmDrQirLk9J3HpQfxHf2AHS4g 3Mfkl4Z2sWtuKKkFkziZqxoMBoCctyt+WE9cuGJGizwvG7yvpeRcurNfsWHiVi+mYH THcCJ1trswqTgqUw3+La26WaVeATB6DDGyEm3ySw3HZzniNsdtWbaEA9SWKHKmzLvR V5T0cnYVsMtXBcqZtBzkn+JR2bfkQmGT7/cIWQb5pB49yZCPIF2Ys527u/KCq+8nmH cUnfDQz5A0/fGs2+TufpQ3OdZXy0xGdNsd0keKdkoWu84ILsff6dzn0BFmmYCv2TXM tkSJQ6H9fU8HQ== Date: Thu, 22 Feb 2024 11:54:04 +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: [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="gwyt2ovqrahookux" Content-Disposition: inline In-Reply-To: <20240219140144.GB1956149@toolbox> --gwyt2ovqrahookux Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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 wrote: > > > > > 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 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 w= rote: > > > > > > > > > > On Fri, Feb 02, 2024 at 05:40:47PM +0200, Ville Syrj=E4= l=E4 wrote: > > > > > > > > > > > On Fri, Feb 02, 2024 at 02:01:39PM +0100, Maxime Ripa= rd 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 Limited) used. > > > > > > > > > > > > > > > + * Infoframes will be generated accordi= ng to that value. > > > > > > > > > > > > > > > + * > > > > > > > > > > > > > > > + * The value of this property can be on= e of the following: > > > > > > > > > > > > > > > + * > > > > > > > > > > > > > > > + * Automatic: > > > > > > > > > > > > > > > + * RGB Range is selected automa= tically based on the mode > > > > > > > > > > > > > > > + * according to the HDMI specif= ications. > > > > > > > > > > > > > > > + * > > > > > > > > > > > > > > > + * 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-component. > > > > > > > > > > > > > > > + * > > > > > > > > > > > > > > > + * Drivers can set up this property by = calling > > > > > > > > > > > > > > > + * drm_connector_attach_broadcast_rgb_p= roperty(). > > > > > > > > > > > > > > > + * > > > > > > > > > > > > > >=20 > > > > > > > > > > > > > > This is a good time to document this in more de= tail. 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 c= olor pipeline processing > > > > > > > > > > > > > > such that a full-range input to the CRTC is con= verted to either 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 HDM= I specific? > > > > > > > > > > > > > >=20 > > > > > > > > > > > > > > When full or limited is selected and the monito= r doesn't support the > > > > > > > > > > > > > > signalling, what happens? > > > > > > > > > > > > >=20 > > > > > > > > > > > > > Forgot to mention: user-space still has no contro= l 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 drivers, = and it looks like if > > > > > > > > > > > > we're using a YCbCr format, i915 will always use 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 "Limited = 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 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 thi= ng, 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 th= e same > > > > > > > property name it must have the same behavior. Yes, it isn't s= tandardized > > > > > > > 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 provides= , but > > > > > > it's strictly compatible with it. > > > > >=20 > > > > > No it is not. > > > >=20 > > > > The property is compatible with i915 interpretation of it, whether = 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 (whic= h you > > > > > must on many broken monitors), and then the kernel automagically > > > > > 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 nice 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 textbook > > 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. No, it's not. vc4 has been using it for a year now. > 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 doesn't > but none of that is relevant for what the property is and how user space > expects it to work. 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. > > That series has been stuck for multiple iterations on pointless and > > mundane debates while the biggest part and whole point of it is not > > getting any review. So yeah, sorry, it's frustrating. >=20 > I'm reviewing the parts that I can, and that's the uAPI. I find it > really offensive that you're saying that this is pointless and mundate. I'm sorry I offended you, but I was talking about the whole debate itself, not the uAPI. The uAPI itself exists. It's already there, it's used in the wild on several drivers, and several user-space components. What that patch does is trying to document it, and test it. It's a net benefit. Is it perfect? Probably not. It's a net benefit nonetheless. The part where I mostly disagree with you I guess (and what we've actually been arguing obut) is trying to get something perfect (to the best of our knowledge) out of it. Anyway, I'll just shut up and to do the work I guess. > The uAPI is your end product, if it can't be used, everything you do in > your driver is utterly pointless. >=20 > > > The Broadcast RGB property kind of works from a user space perspective > > > because it's a workaround for broken sinks. If a sink expects limited > > > range we can force full range. If this however affects YCbCr modes as > > > well, then this isn't a workaround for broken RGB range anymore > > > because it now breaks YCbCr. > >=20 > > Or, you know, it's a workaround for broken YCbCr display. >=20 > Displays can accept both RGB and YCbCr signals, drivers can chose > whichever they want, and user space can not influence or even know which > one is being used. >=20 > The automatic selection of the range is very different between RGB and > YCbCr. If user space forces the range to a specific value and the driver > for whatever reason switches from RGB to YCbCr or the other way around, > this forcing of the range will most likely be incorrect. >=20 > This is what we're talking about when we say that the semantics of the > vc4 Broadcast RGB property is broken. User space literally cannot use it > consistenly. By restricting it to RGB signals, user space can user it > consistently and fix monitors that do not follow the automatic > quantization range algorithm correctly. Yes, if there is an issue with > the quantization range of a YCbCr signal then this property doesn't > help, but it never tried to help those cases. Ack, thanks Maxime --gwyt2ovqrahookux Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQRcEzekXsqa64kGDp7j7w1vZxhRxQUCZdcnzAAKCRDj7w1vZxhR xRqnAQDefz6f2FBe9kLtuo09d0IXpRytvlJT3Y9pbl1YdRZYMgEApnLSteNUg63V /mBTl1qxQbzQrR5ewp8lQ1kYaAXFwQM= =eUkv -----END PGP SIGNATURE----- --gwyt2ovqrahookux--