Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp144422rdb; Thu, 1 Feb 2024 04:51:32 -0800 (PST) X-Google-Smtp-Source: AGHT+IH2TFIUOI+WS4I3vUGCiQtJBKTHji4q+FhtIExBEQGFILldJi3P/YcpvVzx/JA8W5aWkSVL X-Received: by 2002:ac8:59c3:0:b0:42b:6a2d:7528 with SMTP id f3-20020ac859c3000000b0042b6a2d7528mr5464035qtf.32.1706791891865; Thu, 01 Feb 2024 04:51:31 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706791891; cv=pass; d=google.com; s=arc-20160816; b=DxKhbEkhfKAORBSQ0+m877VkI+KTpeeMrOvBhkp7HN2meT+/mT1RTSn7uaFUSRMD9K 0XlYAH49eu17mLM3c1ZP8RlG4rgCDPxtqtxnHCCQYl6qU9dYL0X4hcjZnmOAzVjLudWv q/CCohLfF4EUqpEZU/lPqn4VQvvAo7jmwd78EHWGnO1IgNbkIdsjnYvVYOhL5c61/52f OiyJ13IzhNkohq38ZV24OemyhInrLNWA9/r3Nr3UyJulwACvhnKQvxwaAIaJ1nmMcr9i dP601M1XpcMDHAXjPdVrYaKE1FXiBHjEgOeeUuy9CEwIg7pXnhodwMvfVQffWya0fJLt jsuQ== 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=810OEXPjgoXvDDdViOcXFdz1y5/Vp23vJZGt6Gj5JmY=; fh=w1dngE+kPILkt4VMxWaQdgQVgH+C4O3el5l/N5DdqGc=; b=L90ch57FA4F65jDwJphWnHAYTEo9DRIWQxPgboBD7X1tDXc0ya8gIbbSPlsg3yEiPH EfT/P4BU8lnbx0xj9aK1plVt1VMeTSY/C4AMyQukO7Yf+cjXSdZRViMc9JNajnBdbFOJ 1ABL+LHuHUISN2gwl7rwIjgpKWFMi94a0MgqMak+hcBjomnOn0U84Pe8nR2TFYuSVv0t wSfErbBv3LlSdEEoahpfbKBw3ULIx+mp2UkJr1JNE7dh+BqOjll4yGtZ0Tbd6jfiiL/c qXePawGtlSAbXQflGO8aogjHuncd7R2gJN681W/zrujWmm/G+YYeEuY0kdFQN3iVkd81 eYrA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=VG2TeXqv; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-48162-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-48162-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Forwarded-Encrypted: i=1; AJvYcCUgGIWb38w3DpJcfCaxzHtalqRprJAeWjeQWlbE4qseDf5PKR1W5y6QVa+IpukOAVWHR/iXKKiKqzyiXNO+sO8B1ZcIOZa8jevExh+WkA== Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id s14-20020ac85cce000000b0042beeaa909bsi2432991qta.527.2024.02.01.04.51.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Feb 2024 04:51:31 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-48162-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=VG2TeXqv; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-48162-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-48162-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 7957E1C21DAC for ; Thu, 1 Feb 2024 12:51:31 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id F2D132134F; Thu, 1 Feb 2024 12:51:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="VG2TeXqv" 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 0DF8186645; Thu, 1 Feb 2024 12:51:18 +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=1706791879; cv=none; b=NEbKthR7KDB36Dsm1MXCL1aH/OW0nYpJCXhE6EOvMxQI6oBgaoePOfB9F+cl215C/5kEtv7Jh9Vv+wmClKATK6a4iepx42+Ii/dIa9b/UfTIQT44lmqS6AXIo8uJR9iYSYkz4szi/eeDxJVLE2+kSzw8NYVbSfXXoGJazFB0atU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706791879; c=relaxed/simple; bh=iO+Eo8pPglcxEzFGDR/NbmaGU1weyDXreVR1dhmvHfA=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=BU6Uilh/3Bu4lu1s94Sps9ggfaww2gGJeozR5fFbi8InMUe8JdAHqPzpb3kFhlwRpXGBP7OA98xrjtTBmJFhbyHdA1DeEMRF7QjskXqEg31nZc7d2CD9aWzPhA2nHiMWYDLLeqh6WxlU4/MGmvonuIgoLzfcEHWo1ssRjas4qys= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=VG2TeXqv; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3C37FC433C7; Thu, 1 Feb 2024 12:51:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706791878; bh=iO+Eo8pPglcxEzFGDR/NbmaGU1weyDXreVR1dhmvHfA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=VG2TeXqvjxGcRv1tIL7nOyafkaL7z3CCvzIcS+2JApyFPDRQM0dhUM3PKC9rui9W7 opOWXzX3wf+INRuwos5WuH4cf3M6JbqJJyg+LLI0aU/Mjafxp/zI/6LLOjymUIwDoC VDSk9ZulqP9mhOGNO91YqNdrN/xj0ITM+fgsH8po+qhjWD78Oni1Q/PDRrpA8716mK q7pVitaQP60mvxztWefD4GBlghOrGBUOghPd2F99j+OOahvR6F8gTncbv1qJZI/FBz m1WAK/Vazl7vTC3aR4c4aWHK20XFT2GuwJVRCjUR6Z4saoYMDPtpDx3hv0SXZYc5LH BbV/B+1mMlIrg== Date: Thu, 1 Feb 2024 13:51:15 +0100 From: Maxime Ripard To: Dave Stevenson Cc: 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: Re: [PATCH v5 15/44] drm/connector: hdmi: Compute bpc and format automatically Message-ID: References: <20231207-kms-hdmi-connector-state-v5-0-6538e19d634d@kernel.org> <20231207-kms-hdmi-connector-state-v5-15-6538e19d634d@kernel.org> 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="vqybhtpmawkwvb6z" Content-Disposition: inline In-Reply-To: --vqybhtpmawkwvb6z Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Dec 14, 2023 at 03:10:43PM +0000, Dave Stevenson wrote: > > +static bool > > +sink_supports_format_bpc(const struct drm_connector *connector, > > + const struct drm_display_info *info, > > + const struct drm_display_mode *mode, > > + unsigned int format, unsigned int bpc) > > +{ > > + struct drm_device *dev =3D connector->dev; > > + u8 vic =3D drm_match_cea_mode(mode); > > + > > + if (vic =3D=3D 1 && bpc !=3D 8) { > > + drm_dbg(dev, "VIC1 requires a bpc of 8, got %u\n", bpc); > > + return false; > > + } > > + > > + if (!info->is_hdmi && > > + (format !=3D HDMI_COLORSPACE_RGB || bpc !=3D 8)) { > > + drm_dbg(dev, "DVI Monitors require an RGB output at 8 b= pc\n"); > > + return false; > > + } > > + > > + if (!(connector->hdmi.supported_formats & BIT(format))) { > > + drm_dbg(dev, "%s format unsupported by the connector.\n= ", > > + drm_hdmi_connector_get_output_format_name(forma= t)); > > + return false; > > + } > > + > > + switch (format) { > > + case HDMI_COLORSPACE_RGB: > > + drm_dbg(dev, "RGB Format, checking the constraints.\n"); > > + > > + if (!(info->color_formats & DRM_COLOR_FORMAT_RGB444)) > > + return false; >=20 > We've dropped this check from vc4 in our downstream kernel as it stops > you using the prebaked EDIDs (eg drm.edid_firmware=3Dedid/1024x768.bin), > or any other EDID that is defined as an analog monitor. > The EDID parsing bombs out at [1], so info->color_formats gets left at 0. Right, but it only does so if the display isn't defined as a digital displa= y... > RGB is mandatory for both DVI and HDMI, so rejecting it seems overly fuss= y. =2E.. which is required for both DVI and HDMI. And sure enough, if we decode that EDID: edid-decode (hex): 00 ff ff ff ff ff ff 00 31 d8 00 00 00 00 00 00 05 16 01 03 6d 23 1a 78 ea 5e c0 a4 59 4a 98 25 20 50 54 00 08 00 61 40 01 01 01 01 01 01 01 01 01 01 01 01 01 01 64 19 00 40 41 00 26 30 08 90 36 00 63 0a 11 00 00 18 00 00 00 ff 00 4c 69 6e 75 78 20 23 30 0a 20 20 20 20 00 00 00 fd 00 3b 3d 2f 31 07 00 0a 20 20 20 20 20 20 00 00 00 fc 00 4c 69 6e 75 78 20 58 47 41 0a 20 20 20 00 55 ---------------- Block 0, Base EDID: EDID Structure Version & Revision: 1.3 Vendor & Product Identification: Manufacturer: LNX Model: 0 Made in: week 5 of 2012 Basic Display Parameters & Features: Analog display Signal Level Standard: 0.700 : 0.000 : 0.700 V p-p Blank level equals black level Sync: Separate Composite Serration Maximum image size: 35 cm x 26 cm Gamma: 2.20 DPMS levels: Standby Suspend Off RGB color display First detailed timing is the preferred timing Color Characteristics: Red : 0.6416, 0.3486 Green: 0.2919, 0.5957 Blue : 0.1474, 0.1250 White: 0.3125, 0.3281 Established Timings I & II: DMT 0x10: 1024x768 60.003840 Hz 4:3 48.363 kHz 65.000000 = MHz Standard Timings: DMT 0x10: 1024x768 60.003840 Hz 4:3 48.363 kHz 65.000000 = MHz Detailed Timing Descriptors: DTD 1: 1024x768 60.003840 Hz 4:3 48.363 kHz 65.000000 MHz= (355 mm x 266 mm) Hfront 8 Hsync 144 Hback 168 Hpol N Vfront 3 Vsync 6 Vback 29 Vpol N Display Product Serial Number: 'Linux #0' Display Range Limits: Monitor ranges (GTF): 59-61 Hz V, 47-49 kHz H, max dotclock 70 MHz Display Product Name: 'Linux XGA' Checksum: 0x55 ---------------- Warnings: Block 0, Base EDID: Detailed Timing Descriptor #1: DTD is similar but not identical to DMT 0x= 10. EDID conformity: PASS So, if anything, it's the EDID that needs to be updated, not the code there. Maxime --vqybhtpmawkwvb6z Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQRcEzekXsqa64kGDp7j7w1vZxhRxQUCZbuTwwAKCRDj7w1vZxhR xStzAQDYM7L7UXag4iNuhrqdZjT3FFQPKQRkvAlVCUNanR6aCQEAkg4xQyzE9/jz b81DQAxlvCB4Ne7NX/cfiEPrXcR93Q0= =Fb2U -----END PGP SIGNATURE----- --vqybhtpmawkwvb6z--