Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp761491rdb; Fri, 2 Feb 2024 03:20:38 -0800 (PST) X-Google-Smtp-Source: AGHT+IH/+XPuocdAxb7pEPfBWltXnrFDNPVjd1uMRh6R7ZFuiWv4mCENzHFWtQHCPqY/0DOgmJD3 X-Received: by 2002:a5b:142:0:b0:dc3:71ac:cbd7 with SMTP id c2-20020a5b0142000000b00dc371accbd7mr8128897ybp.8.1706872838318; Fri, 02 Feb 2024 03:20:38 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706872838; cv=pass; d=google.com; s=arc-20160816; b=gQvOXkk7yPhmWu7ZRx83/MtIUiMzdYc1C0cLjjIN+iapadQea6exyWXMGpuBnUCPJH feZzTS/X1rUScgjNVwKTqkLwP/6rYgNFQ/48b/qPNmEQuzIbKNq99iA93VDD9BpeK8jz Rq4h3Ts6PVemOVbjLTu4JqPeqQX7vXChtutDkfnN2ORKSdjPIuMqw/XVDJ+s3o76BcFv ekdgi0a240Fuzi+5Lm7RkZ+59yFHe5NDRWeGPJ7zIyIKPMHyurmizS2Tpg/iIY9cV7G5 UIry6uAAQaa+ezjVPa59o9UZmWY+IXkbwoSyoE1+QC73sHKcZcNpm6oqJzk7JdxFmnoE Z+Fw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:date:message-id; bh=p5evmNWraY2yDk60WtR4N8snNKD9UHR+GVMtvr0Lhcs=; fh=eipGblizY1gWsIRMZeBHvHiZ1+X7NAxE1afFnxdHM8M=; b=k0nbvUxtkGx1i5jtjwbwYQD9pwsJHIs84WvDFhHQZpADxdyjyptpx3k78dATgueu4M 9M5owVWrfTQwVrhrHO2wmyVYJ+BbdJyxX/ra8kM6xHLmCQ3/csxdbDC+2cc8cg6WnrSr IGW0SjaupM0lJsXB2lGAq/hdKfWhtHft5Z2Zlg8aGZ+xEmShFG8XDWlrBpZfYY9U92R+ wjgJmcXsxTReUbitn7Gsg8OOZ5QDYVuFS4H7T0nxfJHAXN/NC8ujVZZBX5wZrcOl0mgW N2vdtJxLeykA4ps9iZCDHNoCzSi+h/+HRG2MR0HDvHENTT49FIKMpv+DjELn7FaLKYvy Ro+Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-49739-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-49739-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=xs4all.nl X-Forwarded-Encrypted: i=1; AJvYcCWJDfk+sSEyPMdmTM28jV/8pk/fNE5gr9iEKjpxyE6GDO8lTulFch6XdX9/OxjvZoAb8FkwTuIIbgnWdtGaC6Qp3/EpKq8/mUGEHW4LKw== Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id w19-20020a05620a445300b007853e4e8acasi310062qkp.753.2024.02.02.03.20.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Feb 2024 03:20:38 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-49739-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; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-49739-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-49739-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=xs4all.nl 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 156FD1C216BF for ; Fri, 2 Feb 2024 11:20:38 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id F2FAC13D51D; Fri, 2 Feb 2024 11:20:28 +0000 (UTC) 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 494D560244; Fri, 2 Feb 2024 11:20:27 +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=1706872828; cv=none; b=sPm+CXi+cn3eRheQvZ5+fWjznSySFqXqv41XP89+40xVGIUoyZHg7Tk2tWggRVm/RMH7hC1yZboc/DGIeF4NVJz1oVTE+LRPM8qmUAVmFS+G7ASb9rw0/41krpTqni80ApFzKfzrI/tASzQXAZ45EeGg3ZNjZOEsmdXrd6/KLn0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706872828; c=relaxed/simple; bh=UgCZ0dCPok1yCgQUIpcSRxnDE9MtjJTQmgm/MixG4IU=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=HzECF7EVR10+sjv5MRkDDUdL+zPaHNmCIZgkDK3AD+yUPtjHHml/khk9sOudEVA8BydnANcJD+mJErqpqoQlVJ1t6is/3iVAp+TGJGPbk4o57c5bD6yJwUcJFXoCDWwYULnk/VmTNaigT4aFMsW3wpizQvGMhmARpc/5nqkLRmg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id DADD9C433C7; Fri, 2 Feb 2024 11:20:23 +0000 (UTC) Message-ID: Date: Fri, 2 Feb 2024 12:20:21 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v5 08/44] drm/connector: hdmi: Add Broadcast RGB property Content-Language: en-US, nl To: Jani Nikula , Sebastian Wick , Maxime Ripard Cc: Thomas Zimmermann , Emma Anholt , Jonathan Corbet , linux-kernel@vger.kernel.org, Samuel Holland , Sandy Huang , Jernej Skrabec , linux-doc@vger.kernel.org, linux-rockchip@lists.infradead.org, Chen-Yu Tsai , dri-devel@lists.freedesktop.org, linux-media@vger.kernel.org, David Airlie , linux-sunxi@lists.linux.dev, linux-arm-kernel@lists.infradead.org, =?UTF-8?B?VmlsbGUgU3lyasOkbMOk?= References: <20231207-kms-hdmi-connector-state-v5-0-6538e19d634d@kernel.org> <20231207-kms-hdmi-connector-state-v5-8-6538e19d634d@kernel.org> <20240115143308.GA159345@toolbox> <874jerf7ot.fsf@intel.com> From: Hans Verkuil Autocrypt: addr=hverkuil@xs4all.nl; keydata= xsFNBFQ84W0BEAC7EF1iL4s3tY8cRTVkJT/297h0Hz0ypA+ByVM4CdU9sN6ua/YoFlr9k0K4 BFUlg7JzJoUuRbKxkYb8mmqOe722j7N3HO8+ofnio5cAP5W0WwDpM0kM84BeHU0aPSTsWiGR yw55SOK2JBSq7hueotWLfJLobMWhQii0Zd83hGT9SIt9uHaHjgwmtTH7MSTIiaY6N14nw2Ud C6Uykc1va0Wqqc2ov5ihgk/2k2SKa02ookQI3e79laOrbZl5BOXNKR9LguuOZdX4XYR3Zi6/ BsJ7pVCK9xkiVf8svlEl94IHb+sa1KrlgGv3fn5xgzDw8Z222TfFceDL/2EzUyTdWc4GaPMC E/c1B4UOle6ZHg02+I8tZicjzj5+yffv1lB5A1btG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7zhcx6sm5T7v16VceF96jG61bnJ2GFS+QZerZp3PY27XgtPxRxYj AmFUeF486PHx/2Yi4u1rQpIpC5inPxIgR1+ZFvQrAV36SvLFfuMhyCAxV6WBlQc85ArOiQZB Wm7L0repwr7zEJFEkdy8C81WRhMdPvHkAIh3RoY1SGcdB7rB3wCzfYkAuCBqaF7Zgfw8xkad KEiQTexRbM1sc/I8ACpla3N26SfQwrfg6V7TIoweP0RwDrcf5PVvwSWsRQp2LxFCkwnCXOra gYmkrmv0duG1FStpY+IIQn1TOkuXrciTVfZY1cZD0aVxwlxXBnUNZZNslldvXFtndxR0SFat sflovhDxKyhFwXOP0Rv8H378/+14TaykknRBIKEc0+lcr+EMOSUR5eg4aURb8Gc3Uc7fgQ6q UssTXzHPyj1hAyDpfu8DzAwlh4kKFTodxSsKAjI45SLjadSc94/5Gy8645Y1KgBzBPTH7Q== In-Reply-To: <874jerf7ot.fsf@intel.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 02/02/2024 12:04, Jani Nikula wrote: > On Mon, 15 Jan 2024, Sebastian Wick wrote: >> On Thu, Dec 07, 2023 at 04:49:31PM +0100, Maxime Ripard wrote: >>> The i915 driver has a property to force the RGB range of an HDMI output. >>> The vc4 driver then implemented the same property with the same >>> semantics. KWin has support for it, and a PR for mutter is also there to >>> support it. >>> >>> Both drivers implementing the same property with the same semantics, >>> plus the userspace having support for it, is proof enough that it's >>> pretty much a de-facto standard now and we can provide helpers for it. >>> >>> Let's plumb it into the newly created HDMI connector. >>> >>> Signed-off-by: Maxime Ripard > > [snip] > >>> @@ -1655,6 +1678,26 @@ EXPORT_SYMBOL(drm_connector_attach_dp_subconnector_property); >>> /** >>> * 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? > > Automatic is based on the mode as described in the specs > below. Basically certain modes are expected to be broadcast range, and > others full range. > > I don't remember why we don't use the full range if the display > indicates it supports selectable quantization range in Video > Capabilities Data Block. It's quite possible there are displays that > declare support but don't. Cc: Ville. I have not seen such displays. Enabling RGB Selectable Quantization Range is something that a vendor has to do explicitly, so it is reasonable to expect that it works, otherwise there would be no point to that flag! Transmitting full range if possible gives a better picture quality and so is recommended. > > - HDMI 1.4b section 6.6 Video Quantization Ranges > > - HDMI 2.1 section 7.3 Video Quantization Ranges > > - DP 2.1 (and earlier) section 5.1.1.1 Video Colorimetry > > - CTA-861-H (and earlier) section 5.1 Default Encoding Parameters and > section 6.4.3 Quantization Range Note that CTA-861-H deprecated the use of Default Range in the AVI InfoFrame, instead the source should always signal limited or full range in the Q field. Regards, Hans > >> When full or limited is selected and the monitor doesn't support the >> signalling, what happens? > > 1) Limited selected, display expects full, colors seem washed out. > > 2) Full selected, display expects limited, black screen possible. > > We receive the occasional bug report for 1, because there are displays > that incorrectly expect full when spec says it should be limited. We > reject the bug reports, because erring the other way can lead to black > screens. > > > BR, > Jani. > > >