Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp2704301rdb; Mon, 12 Feb 2024 13:46:16 -0800 (PST) X-Google-Smtp-Source: AGHT+IHMHJXmNsqpTJD9cwOCcRcWQySipkSklQfjDSQUBywnrE+jxc9lD7nOuAxxeKKnYe4jjT+r X-Received: by 2002:a17:906:ad8a:b0:a3c:efd6:f5c0 with SMTP id la10-20020a170906ad8a00b00a3cefd6f5c0mr345357ejb.35.1707774376367; Mon, 12 Feb 2024 13:46:16 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707774376; cv=pass; d=google.com; s=arc-20160816; b=iatR6S64rqB1Xwp7Q4ChMYtH1CivJ35ucLnBu6d2smJBJhIeghR0kXSCZQz0MORlDr puqzLeDSU759TBkdSf3g7fUnpzoo00SyuhskesHXSgzQyKEJvUlAvQO/y+72uHmxFOgA Tcas2TYsFQBL2R8b+1bOcFSIRVNGwYfGoYzP8qfMpNlbpVlPRqTF18DXaFOZrn4owxLf tNzRKt1Lxc1KUp58tQyBsO3NcfsorMVHfD92hD3l9GqEu80WibKm3JKr8FN+jNWjbU6F ViXA8wuqgbkEOk7RA8WlkLAUwYSezOu9BHySIsJBMl1mf1kR9reAOC/998GOn3vHG1if 0Q+g== 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=PX0gZMgcD6cvQtCZN/fVEkS0xD5cnXfFK+4Rcbhyo7M=; fh=v46GXJ2mipJre4/NOl0Kl+hxuYNjnLsg+uU933HlcqA=; b=A0x3ba+16+F/pNFfTtZVY1O+24MhqMxSkREnVXocQQxo9SKIZnP/MvN46Xf8q108CG VOUGWGQtsgAFOeDWePHzQi6fmjqwIaPA6mD3Yc2nAZcHQBPBY2WkV9oqa1nWY4miSAJs UBrT5zsBvL0vbywgk4N2G9iJeFa1y0Z6ObHQfxuA+ed1XbaL3ypmttlP+CR1sNdDmZ5I MkebMw7qVGuHnVvZU3Aah24YWiXG84goo3twWg7Cx1JAxGZmn3WQHLQIt66w/vZNu10V wqn6ypI/SD2EwmaXG8MsIgmE+/t7ntvq0N2+zhZMYopNO33fKjQeRC63atYgthsKQCfc JHWA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="IqHcer/r"; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-61919-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-61919-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com X-Forwarded-Encrypted: i=2; AJvYcCWBpRLyIYVjo1TeQzXLIerdK2AlYK7IVumR5i4Ln91V18M872OUUzHD0SdWtA+5k5L3FvYQ9HjM/3jhGI3vS9SyV+4IiJmzrxr1FSW7MQ== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id a20-20020a1709066d5400b00a381793e309si540759ejt.292.2024.02.12.13.46.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Feb 2024 13:46:16 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-61919-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=@intel.com header.s=Intel header.b="IqHcer/r"; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-61919-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-61919-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 E41AF1F22BB6 for ; Mon, 12 Feb 2024 15:49:54 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 578243CF6C; Mon, 12 Feb 2024 15:49:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="IqHcer/r" Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.9]) (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 50A433CF4C; Mon, 12 Feb 2024 15:49:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.9 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707752983; cv=none; b=Loh2nwP4xi8wFt8PcoY5dETwOx6YLnek4vlmgeWS0EL65r2W2XZ7lydo/uX5ZjML7Xj0/Lbh/b4eJbQQnvs0Uz2cMlylOtu8QEsZ8kEv4yxreyJMMLEkOsAbQYVRaWhT8jx/fSuVjtuM1g4IHKQJ6CAfElGS9QOF+z+kO8RCUv0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707752983; c=relaxed/simple; bh=RaXsYzelOZvoa5TGyCbteu+6xy/YY/Aun1Nfajjsacg=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=HLfrSYGpX8uzRdfSK2e4WZMNNPTPpJGy9ywMPGnh0xky0nxBXHkUwXBoKNFddwV0t/GUgE6NppqeoOEyKEF4s5lR2z+Z4rpdqOXlAmtQ47vl9gPYB/ZJd20hu6TqUb5NfzY/0S8ven3t5Z8quZQYIdWleIpk+AYoP2Xz5JZQMBo= 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=IqHcer/r; arc=none smtp.client-ip=198.175.65.9 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=1707752982; x=1739288982; h=date:from:to:cc:subject:message-id:references: mime-version:content-transfer-encoding:in-reply-to; bh=RaXsYzelOZvoa5TGyCbteu+6xy/YY/Aun1Nfajjsacg=; b=IqHcer/rhQbI3jE9pk0HNclSvXd1+WkzQJuInfZk74hQ4NXffibKBtyF eY+dyHqfY6Z6WY5bJa7Q34WIuIX7BJZtHIf9/QUNwymyscWgyfvMzkTY+ POcgRZ2AZI3Z31rOvVc3D8v0NwneDy0x8yRSQYnphAf+n1fVIoE/+Ggi2 CcAx2LFN5POd0iDeOTpaRz8HXxyAY9GbomJez+Dfex5bzpf7HJWC1TT0x d4ctc/jgOUeGb4tjapS89Ck/Z3k7aGPhvkz8cZK/1XZEsIoFIwSaebd5k pdU89HupPg91VZhLffeSvL0orKiJ8b3pt9ZueCQcZ865re9bGpYGdZzZj g==; X-IronPort-AV: E=McAfee;i="6600,9927,10982"; a="24202747" X-IronPort-AV: E=Sophos;i="6.06,264,1705392000"; d="scan'208";a="24202747" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orvoesa101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Feb 2024 07:49:40 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10982"; a="825840546" X-IronPort-AV: E=Sophos;i="6.06,264,1705392000"; d="scan'208";a="825840546" Received: from stinkpipe.fi.intel.com (HELO stinkbox) ([10.237.72.74]) by orsmga001.jf.intel.com with SMTP; 12 Feb 2024 07:49:34 -0800 Received: by stinkbox (sSMTP sendmail emulation); Mon, 12 Feb 2024 17:49:33 +0200 Date: Mon, 12 Feb 2024 17:49:33 +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: [PATCH v5 08/44] drm/connector: hdmi: Add Broadcast RGB property Message-ID: References: <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: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Patchwork-Hint: comment 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. 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. > > 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 -- Ville Syrj?l? Intel