Received: by 2002:a05:7412:1e0b:b0:fc:a2b0:25d7 with SMTP id kr11csp715968rdb; Thu, 15 Feb 2024 13:11:29 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWAMuqT9QH9Upnk283eWiuaMDSS5ZXPixYSKV0n+ndRbiCzZC+CLMhsqcg/Yq8c7tsOyl13wP8tZtqETrx6l5OQ+MMtUQsaW+zoFonPRQ== X-Google-Smtp-Source: AGHT+IG41e5Nnqbt77FkDa6k67QOW5mdUf1xVEXu2n2uB2Voq+6YuYJViTItSJbmDijRViIwrHcq X-Received: by 2002:a17:907:b9c4:b0:a3d:ad12:1923 with SMTP id xa4-20020a170907b9c400b00a3dad121923mr1578227ejc.6.1708031489266; Thu, 15 Feb 2024 13:11:29 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708031489; cv=pass; d=google.com; s=arc-20160816; b=hy9Rw9FVtE4ft8nIke2hFw9r8KF/9OklYAea9dnwbu0mLUKB7k/q9+U7vBP2oyUrvY eKgbeRLM5ivXeYe6h49o5Hli8CX8QOJ4LXr3IfC7/85Mt0PvgywLZVrUrEXigXJ3ui0v d3LETSccGi55wjdHbOIi9p87ZEbsj94TCCaxMKAvP1wP7tPItAnl9AemPYJD4xDkLOfS 6p2Mo2livHXMGJY1KNrUasNp0Jn2bSw4Kzqe8ZNEuXwppm7WRcUY4WAdDqfR35PJ/AAF 7hplY/zvyAUoRqvlXYWZVPq6Tgw4XtFhN7AweF4GQt6W7L9XGuhPeoItXCqmYcQBCScW 2jpw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:subject:cc:to:from:date:dkim-signature; bh=pjl3DknUfDqixz7mP7BJa4MvP9BzJh4t4qG74in7V7o=; fh=OAhJ0oawE8wCYMmX4m9xGROHl8Ij+aff980UOoIIDP4=; b=D3P9Qy5j0YUSWBuBdK8b16AtbJgQpBCaBm2yEcRUCbSTJfYx7ie6VZdzOUceI7fB1m xlBQCRcq2FW2TOKm1z4DuCwy+bN4ZUHUMZgLOzjucYF/NnKBIGVkIqFlwmf9Xh6JfS3s sj5TxfkUBYY6a3U30NftWpDCKKqG6KUZb6kSGgAoJuqrgVDc5n29m8JqvUykonLvShEU NFiEDGPv+Mqwf1hr2JJwnJo4K93s+GmZNHm3Yn7uCXeaxAclmM9XITUhNClJGsRw9Bl1 BjqXmpoQ0SkQWpyle8JHJKh0IF8G6Egdo343QDA1dO+7jvyWYXCMDUlonyVHflPesha5 22EQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=ApIWkTco; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-67141-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-67141-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id mj7-20020a170906af8700b00a3d19188117si1008438ejb.517.2024.02.15.13.11.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Feb 2024 13:11:29 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-67141-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=ApIWkTco; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-67141-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-67141-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com 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 3BA561F22E76 for ; Thu, 15 Feb 2024 15:09:43 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 73BA3133287; Thu, 15 Feb 2024 15:09:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="ApIWkTco" Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.15]) (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 4C84713248B; Thu, 15 Feb 2024 15:09:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.15 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708009756; cv=none; b=VswTsEt9Ke2d8V8x6gohS1AEUfhAlcs+tkndAFYLR9DA1isvAGXDaOghMLf/zmta9TJbAWkbdb2E0wYIN0JRNvtAteGP0Wnh3Kf0CeKr26t2xavO1K/V5yXQpQxvq0KdPV4sEGqDieeh7On4rSIfbafHJCw7h6L5tQf4TT/+qAQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708009756; c=relaxed/simple; bh=1dewdp2A0Zo42dyThGoQOQMbyk8kJSMF3Ua2SIJeM54=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Qpp0s7L2t5fS1fD+wN/i+oosLMLGiQ6PFwf47A/GtC8zxsxvsq7N+PF6Ys6DMWV2+HtpHYi+n5vhqbKuRrC7cYezf8MjgkMFZatSLppehitQ/XVFLPhfpyB9yb+PTtmrKES0Q1Acrzo1NxA51AC1+oVdbAvpu02zzvlXRDjGTNA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=ApIWkTco; arc=none smtp.client-ip=198.175.65.15 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1708009755; x=1739545755; h=date:from:to:cc:subject:message-id:references: mime-version:content-transfer-encoding:in-reply-to; bh=1dewdp2A0Zo42dyThGoQOQMbyk8kJSMF3Ua2SIJeM54=; b=ApIWkTcopMBYHHLcqaY4WvaivqTmGD4bX9BEWo70RJsYJ183w8vqA+TY GUO8q+O1J4K2pNnGRkkIVY7K38oKM3fXYntwBSDrpv8RzITPPYuKoTJEa TITDKVthtk2iDVJLlVfMBgWifkTl8Ha8ykCiztaBBuzCc6BRFk6puOcPo PPbz8E4WpImeuqldPTUtYdhDQ7FzPUQ3ohKc/FuyDGUl+16oY1HKnK5oi 5fXS8mWIL3ddVT8xSik0Yytd4qSOBdhAwf2RLST9UlDH4nbiaPnSDVHL1 A8HlcaCAVX4o7sVD7sWPTZyAwDDTWatdNJJW/qjN5efBI5ZLW8tApb/eE A==; X-IronPort-AV: E=McAfee;i="6600,9927,10984"; a="5930139" X-IronPort-AV: E=Sophos;i="6.06,161,1705392000"; d="scan'208";a="5930139" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orvoesa107.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Feb 2024 07:09:14 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10984"; a="826423681" X-IronPort-AV: E=Sophos;i="6.06,161,1705392000"; d="scan'208";a="826423681" Received: from stinkpipe.fi.intel.com (HELO stinkbox) ([10.237.72.74]) by orsmga001.jf.intel.com with SMTP; 15 Feb 2024 07:09:06 -0800 Received: by stinkbox (sSMTP sendmail emulation); Thu, 15 Feb 2024 17:09:05 +0200 Date: Thu, 15 Feb 2024 17:09:05 +0200 From: Ville =?iso-8859-1?Q?Syrj=E4l=E4?= To: Maxime Ripard Cc: Sebastian Wick , Maarten Lankhorst , Thomas Zimmermann , David Airlie , Daniel Vetter , Emma Anholt , Jonathan Corbet , Sandy Huang , Heiko =?iso-8859-1?Q?St=FCbner?= , 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: Re: Re: [PATCH v5 08/44] drm/connector: hdmi: Add Broadcast RGB property Message-ID: References: <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: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Patchwork-Hint: comment On Thu, Feb 15, 2024 at 11:53:17AM +0100, Maxime Ripard wrote: > On Tue, Feb 13, 2024 at 10:38:56AM +0200, Ville Syrjälä 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älä 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älä 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älä wrote: > > > > > > > > > > On Fri, Feb 02, 2024 at 02:01:39PM +0100, Maxime Ripard wrote: > > > > > > > > > > > Hi, > > > > > > > > > > > > > > > > > > > > > > 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 according to that value. > > > > > > > > > > > > > > + * > > > > > > > > > > > > > > + * The value of this property can be one of the following: > > > > > > > > > > > > > > + * > > > > > > > > > > > > > > + * Automatic: > > > > > > > > > > > > > > + * RGB Range is selected automatically based 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-component. > > > > > > > > > > > > > > + * > > > > > > > > > > > > > > + * Drivers can set up this property by calling > > > > > > > > > > > > > > + * drm_connector_attach_broadcast_rgb_property(). > > > > > > > > > > > > > > + * > > > > > > > > > > > > > > > > > > > > > > > > > > This is a good time to document this in more detail. There might be two > > > > > > > > > > > > > different things being affected: > > > > > > > > > > > > > > > > > > > > > > > > > > 1. The signalling (InfoFrame/SDP/...) > > > > > > > > > > > > > 2. The color pipeline processing > > > > > > > > > > > > > > > > > > > > > > > > > > All values of Broadcast RGB always affect the color pipeline processing > > > > > > > > > > > > > such that a full-range input to the CRTC is converted to either full- or > > > > > > > > > > > > > limited-range, depending on what the monitor is supposed to accept. > > > > > > > > > > > > > > > > > > > > > > > > > > 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? > > > > > > > > > > > > > > > > > > > > > > > > > > When full or limited is selected and the monitor doesn't support the > > > > > > > > > > > > > signalling, what happens? > > > > > > > > > > > > > > > > > > > > > > > > Forgot to mention: user-space still has no control over RGB vs YCbCr on > > > > > > > > > > > > the cable, so is this only affecting RGB? If not, how does it affect > > > > > > > > > > > > YCbCr? > > > > > > > > > > > > > > > > > > > > > > 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. > > > > > > > > > > > > > > > > > > > > The property is literally called "Broadcast *RGB*". > > > > > > > > > > That should explain why it's only affecting RGB. > > > > > > > > > > > > > > > > > > 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. > > > > > > > > > > > > > > > > > > > Full range YCbCr is a much rarer beast so we've never bothered > > > > > > > > > > to enable it. > > > > > > > > > > > > > > > > > > vc4 supports it. > > > > > > > > > > > > > > > > Someone implemented it incorrectly then. > > > > > > > > > > > > > > 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. > > > > > > > > > > > > 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. > > > > > > > > No it is not. > > > > > > The property is compatible with i915 interpretation of it, whether you > > > like it or not. And that's what Sebastian was referring to. > > > > > > > Eg. what happens if you set the thing to full range for RGB (which 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. > > > > > > And that part is just moving goalposts. > > > > No. Allowing users to get correct colors with broken displays > > is the sole reason why this property even exists. > > HDMI 1.4, Section 6.6 - Video Quantization Ranges: > > If the sink’s EDID declares a selectable YCC Quantization Range > (QY=1), then it shall expect limited range pixel values if it receives > AVI YQ=0 and it shall expect full range pixel values if it receives > AVI YQ=1. For other values of YQ, the sink shall expect pixel values > with the default range for the transmitted video format. > > So, the only concern you have is if the EDID has QY set to 1 but the > monitor doesn't actually support it? If so, could we qualify the monitor > as a "broken display" and thus would require that property to apply to > YUV too? Sinks that declare a selectable quantization range are not the problem, or at least I don't recall ever seeing one that lied about that. The problem is the sinks that don't have selectable quantization range, and which implement the default rules incorrectly. The only way to get correct colors on those is for the user to override the quantization range manually. Typically TVs get it mostly right (though I have at least one that also expects limited range for 640x480 which is not correct), and many (perhaps even most?) computer displays get it wrong (as in they always assume RGB to be full range). We could in theory quirk those, but the quirk list would be enormous, and fragile to maintain because the user can also shoot themselves in the foot here by frobbing with the "black level"/etc. settings on the display itself. So we'd surely end up with lots of false positives on the quirk list. -- Ville Syrjälä Intel