From patchwork Fri Jul 31 16:19:08 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Ciocaltea X-Patchwork-Id: 2850 Return-Path: X-Original-To: noreply@patchwork.local Delivered-To: noreply@patchwork.local Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114]) by mxe881.netcup.net (Postfix) with ESMTPS id 602571C22F7 for ; Fri, 31 Jul 2026 18:38:28 +0200 (CEST) Authentication-Results: mxe881; dkim=pass header.d=collabora.com; spf=pass (sender IP is 172.105.105.114) smtp.mailfrom=linux-sunxi+bounces-24810-noreply=patchwork.local@lists.linux.dev smtp.helo=tor.lore.kernel.org Received-SPF: pass (mxe881: domain of lists.linux.dev designates 172.105.105.114 as permitted sender) client-ip=172.105.105.114; envelope-from=linux-sunxi+bounces-24810-noreply=patchwork.local@lists.linux.dev; helo=tor.lore.kernel.org; Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by tor.lore.kernel.org (Postfix) with ESMTP id CC5F03083BAD for ; Fri, 31 Jul 2026 16:19:55 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1C3D744E648; Fri, 31 Jul 2026 16:19:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="Btvzf6YQ" X-Original-To: linux-sunxi@lists.linux.dev Received: from bali.collaboradmins.com (bali.collaboradmins.com [148.251.105.195]) (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 CAC2644AB78 for ; Fri, 31 Jul 2026 16:19:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.251.105.195 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785514765; cv=none; b=TVerjvMw2B6/SqzpcEBK7RpNb/a4xUyQHFnb2oioJpkNEipcAbH3YvgEu5Y3hBKWKc3QsRMOJwwTXLVQqhIskuKKt7LrVUJLqp5ijBmdlVPTPqV8IOLb7+6lau0i6CQq4tkhAdKCSZNdtVTXfEFx5DU7RovL7kveD7kblIpgqyE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785514765; c=relaxed/simple; bh=D/Mo27GDMqgDFGKu/PHByp3WOMc3rGEVU+1xPyeAtoA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=FFfzDX8hJoqH102xM+eEabP171ibFn8020drB+GNt+T89HSmyyIr3a3F7xUYpB1lBYS5cbl1YSgFZbuZ3YIqoFwbBHuX4v5UAsgWXfj89JZxsXXbgcv3+RjUdmvMmtk9SKCx3XgHWY5u/XJbD66woFma0lpMpzh38qxO3Ncy/h8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=Btvzf6YQ; arc=none smtp.client-ip=148.251.105.195 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1785514755; bh=D/Mo27GDMqgDFGKu/PHByp3WOMc3rGEVU+1xPyeAtoA=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=Btvzf6YQ8Hr6V5dxzD3f7nLe5rZLZWQBrh8abN2zzoUgX2XRBCakV09TDJbTfkUdK yUnJyXHhNkOyN6lcnxCRaNYfaSCXO4E8F9x3HLdboU4RgYb65wQXZ1RN5CICZLCne7 9KQMMQmp6GvWgfi3pIqkyo26BKoH6aOzVPiL997ZQTAzZoRjFnld7Tb/53qq3nnGx8 ydcgePpBjZAgxCNaBfZuv861joyCQqdGYsWk/zR4G/5V08sqES2VRnQI+NAi3fJ752 tEyOnlo6REWRnbfLclXexLFFETBvbQV9ZSFqioJ8N1S81ROnOHotBYCUW+CfspSqbv PlK+nMYHfTXAQ== Received: from localhost (unknown [100.64.0.241]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange secp256r1 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: cristicc) by bali.collaboradmins.com (Postfix) with ESMTPSA id 7D33017E0682; Fri, 31 Jul 2026 18:19:15 +0200 (CEST) From: Cristian Ciocaltea Date: Fri, 31 Jul 2026 19:19:08 +0300 Subject: [PATCH v10 01/69] video/hdmi: Introduce HDMI version enum Precedence: bulk X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20260731-dw-hdmi-qp-scramb-v10-1-294364b2cf15@collabora.com> References: <20260731-dw-hdmi-qp-scramb-v10-0-294364b2cf15@collabora.com> In-Reply-To: <20260731-dw-hdmi-qp-scramb-v10-0-294364b2cf15@collabora.com> To: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Luca Ceresoli , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Chen-Yu Tsai , Samuel Holland , Dave Stevenson , =?utf-8?q?Ma=C3=ADra_Canal?= , Raspberry Pi Kernel Maintenance , Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Andy Yan , Algea Cao , Daniel Stone , Liu Ying , Phong LE Cc: kernel@collabora.com, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-rockchip@lists.infradead.org, Dmitry Baryshkov X-Mailer: b4 0.15.2 X-Rspamd-Server: rspamd-worker-8404 X-Spamd-Result: default: False [-2.16 / 15.00]; BAYES_HAM(-5.50)[100.00%]; RBL_SENDERSCORE(2.00)[172.105.105.114:from]; SUSPICIOUS_RECIPS(1.50)[]; MAILLIST(-0.15)[generic]; BAD_REP_POLICIES(0.10)[]; MIME_GOOD(-0.10)[text/plain]; HAS_LIST_UNSUB(-0.01)[]; MID_RHS_MATCH_FROM(0.00)[]; R_DKIM_ALLOW(0.00)[collabora.com:s=mail]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_TWELVE(0.00)[31]; PRECEDENCE_BULK(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[collabora.com:email,collabora.com:dkim,tor.lore.kernel.org:rdns,tor.lore.kernel.org:helo]; TAGGED_RCPT(0.00)[]; FORGED_SENDER_MAILLIST(0.00)[]; RCVD_COUNT_FIVE(0.00)[5]; ARC_ALLOW(0.00)[subspace.kernel.org:s=arc-20240116:i=1]; DKIM_TRACE(0.00)[collabora.com:+]; DMARC_POLICY_ALLOW(0.00)[collabora.com,none]; R_SPF_ALLOW(0.00)[+ip4:172.105.105.114:c]; TO_DN_SOME(0.00)[]; FROM_NEQ_ENVFROM(0.00)[cristian.ciocaltea@collabora.com,linux-sunxi@lists.linux.dev]; FREEMAIL_TO(0.00)[intel.com,linaro.org,kernel.org,ideasonboard.com,kwiboo.se,gmail.com,bootlin.com,linux.intel.com,suse.de,ffwll.ch,sholland.org,raspberrypi.com,igalia.com,rock-chips.com,sntech.de,collabora.com,nxp.com,baylibre.com]; MIME_TRACE(0.00)[0:+]; TAGGED_FROM(0.00)[bounces-24810-noreply=patchwork.local]; FORGED_RECIPIENTS_MAILLIST(0.00)[]; ASN(0.00)[asn:63949, ipnet:172.105.96.0/20, country:SG]; RCVD_TLS_LAST(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[] X-Rspamd-Queue-Id: 602571C22F7 X-MORS-Enabled: yes X-MORS-DOMAIN: patchwork.local X-MORS-HOSTING: hosting172546 X-MORS-USER: hosting172546 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= Add an enum to represent HDMI specification versions. This will be used by upcoming changes to associate HDMI connectors and bridges with a maximum supported version and to simplify handling of version-dependent features. Reviewed-by: Maxime Ripard Reviewed-by: Dmitry Baryshkov Signed-off-by: Cristian Ciocaltea --- include/linux/hdmi.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/include/linux/hdmi.h b/include/linux/hdmi.h index 8dab78e1f61b..b80a5ee63bb2 100644 --- a/include/linux/hdmi.h +++ b/include/linux/hdmi.h @@ -27,6 +27,18 @@ #include #include +enum hdmi_version { + HDMI_VERSION_UNKNOWN, + HDMI_VERSION_1_0, + HDMI_VERSION_1_1, + HDMI_VERSION_1_2, + HDMI_VERSION_1_3, + HDMI_VERSION_1_4, + HDMI_VERSION_2_0, + HDMI_VERSION_2_1, + HDMI_VERSION_2_2, +}; + enum hdmi_packet_type { HDMI_PACKET_TYPE_NULL = 0x00, HDMI_PACKET_TYPE_AUDIO_CLOCK_REGEN = 0x01, From patchwork Fri Jul 31 16:19:09 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Ciocaltea X-Patchwork-Id: 2860 Return-Path: X-Original-To: noreply@patchwork.local Delivered-To: noreply@patchwork.local Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114]) by mxe881.netcup.net (Postfix) with ESMTPS id 58E781C22FB for ; Fri, 31 Jul 2026 18:39:54 +0200 (CEST) Authentication-Results: mxe881; dkim=pass header.d=collabora.com; spf=pass (sender IP is 172.105.105.114) smtp.mailfrom=linux-sunxi+bounces-24816-noreply=patchwork.local@lists.linux.dev smtp.helo=tor.lore.kernel.org Received-SPF: pass (mxe881: domain of lists.linux.dev designates 172.105.105.114 as permitted sender) client-ip=172.105.105.114; envelope-from=linux-sunxi+bounces-24816-noreply=patchwork.local@lists.linux.dev; helo=tor.lore.kernel.org; Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by tor.lore.kernel.org (Postfix) with ESMTP id EE92A312AA4F for ; Fri, 31 Jul 2026 16:21:18 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6FDFF45518A; Fri, 31 Jul 2026 16:19:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="QQM1/ODC" X-Original-To: linux-sunxi@lists.linux.dev Received: from bali.collaboradmins.com (bali.collaboradmins.com [148.251.105.195]) (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 6C56944C4F8 for ; Fri, 31 Jul 2026 16:19:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.251.105.195 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785514776; cv=none; b=XMAkx18ttbpZFiiVn45s9mj4OkOgVhpM3UaQeGnWYdUO9scYAdJFeM9R8EM5j34kwQGV/JQaagCHxLDWPuuf5WGUT3/w2JoMCccJcbXsVs4WJZunziIgIuziMcRRTzXV9ZyASfT0OvEr0iz6KJDyRrqcvWLAAYbXPFDXOU9Hz3g= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785514776; c=relaxed/simple; bh=LoKeK7pz3tUS/HI4nQVJBEnI7or53/FZb/3CkVSEbPw=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=IFrQW01cB707lbV6J6qYG71e1QlEiJzo4E03M5cSfa66vnb5t6E37Ny7o8CViFG6sXT7r43BVoxdFfK61bFVUepl/4HH+o3TsGLSiqC5eVPmDE8Cqiya6m0aphQe+ajh0ZakaZCbaGbhXHJy1u3uRRFRKE1JyPFIh2JoFhdg9wI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=QQM1/ODC; arc=none smtp.client-ip=148.251.105.195 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1785514756; bh=LoKeK7pz3tUS/HI4nQVJBEnI7or53/FZb/3CkVSEbPw=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=QQM1/ODCZaPF1EY3Nxc7TDsGlmIpqDCOp1EloFd/Dg0nSRCI8T0Yua4Xa6iFFl0EQ 93L0dJXf4MvpSKPTrnZAoSll5FcXHffJWev2kM+iUT1VIky+BM8eqQjKbboK/cBqCD v8jvuh5ULLoPfn4lFhAgNl7UfCwyLP+KTMafOUsQ/RwnfXG09kVG58/P/P8SfV3oIo 9Z2r0DVtmbO2ReeYVgWBLAMST73ftdx792z/gqpaqAzHBKjzaDb7hDh7Pnbl/gDVi6 krHJpbQkBGyYr5MQlQ+ouHuzD48rdOhbnsZzKc4qyUjQfnlowx83kkaJ2/dk31XZ5J p5w1n8oDumsmg== Received: from localhost (unknown [100.64.0.241]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange secp256r1 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: cristicc) by bali.collaboradmins.com (Postfix) with ESMTPSA id 34FF117E0700; Fri, 31 Jul 2026 18:19:16 +0200 (CEST) From: Cristian Ciocaltea Date: Fri, 31 Jul 2026 19:19:09 +0300 Subject: [PATCH v10 02/69] drm/connector: hdmi: Handle reset() state allocation failure Precedence: bulk X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20260731-dw-hdmi-qp-scramb-v10-2-294364b2cf15@collabora.com> References: <20260731-dw-hdmi-qp-scramb-v10-0-294364b2cf15@collabora.com> In-Reply-To: <20260731-dw-hdmi-qp-scramb-v10-0-294364b2cf15@collabora.com> To: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Luca Ceresoli , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Chen-Yu Tsai , Samuel Holland , Dave Stevenson , =?utf-8?q?Ma=C3=ADra_Canal?= , Raspberry Pi Kernel Maintenance , Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Andy Yan , Algea Cao , Daniel Stone , Liu Ying , Phong LE Cc: kernel@collabora.com, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-rockchip@lists.infradead.org, Sashiko X-Mailer: b4 0.15.2 X-Rspamd-Server: rspamd-worker-8404 X-Spamd-Result: default: False [-2.16 / 15.00]; BAYES_HAM(-5.50)[100.00%]; RBL_SENDERSCORE(2.00)[172.105.105.114:from]; SUSPICIOUS_RECIPS(1.50)[]; MAILLIST(-0.15)[generic]; BAD_REP_POLICIES(0.10)[]; MIME_GOOD(-0.10)[text/plain]; HAS_LIST_UNSUB(-0.01)[]; RCVD_COUNT_FIVE(0.00)[5]; ARC_ALLOW(0.00)[subspace.kernel.org:s=arc-20240116:i=1]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_TWELVE(0.00)[31]; PRECEDENCE_BULK(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[tor.lore.kernel.org:rdns,tor.lore.kernel.org:helo,collabora.com:email,collabora.com:dkim]; TAGGED_RCPT(0.00)[]; FORGED_SENDER_MAILLIST(0.00)[]; R_DKIM_ALLOW(0.00)[collabora.com:s=mail]; ASN(0.00)[asn:63949, ipnet:172.105.96.0/20, country:SG]; DKIM_TRACE(0.00)[collabora.com:+]; DMARC_POLICY_ALLOW(0.00)[collabora.com,none]; R_SPF_ALLOW(0.00)[+ip4:172.105.105.114:c]; TO_DN_SOME(0.00)[]; FROM_NEQ_ENVFROM(0.00)[cristian.ciocaltea@collabora.com,linux-sunxi@lists.linux.dev]; FREEMAIL_TO(0.00)[intel.com,linaro.org,kernel.org,ideasonboard.com,kwiboo.se,gmail.com,bootlin.com,linux.intel.com,suse.de,ffwll.ch,sholland.org,raspberrypi.com,igalia.com,rock-chips.com,sntech.de,collabora.com,nxp.com,baylibre.com]; MIME_TRACE(0.00)[0:+]; TAGGED_FROM(0.00)[bounces-24816-noreply=patchwork.local]; FORGED_RECIPIENTS_MAILLIST(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[] X-Rspamd-Queue-Id: 58E781C22FB X-MORS-Enabled: yes X-MORS-DOMAIN: patchwork.local X-MORS-HOSTING: hosting172546 X-MORS-USER: hosting172546 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= In drmm_connector_hdmi_init(), if the reset callback fails to allocate memory, e.g. inside drm_atomic_helper_connector_reset(), connector->state will remain NULL. This is unconditionally passed to drm_connector_attach_max_bpc_property(), leading to a NULL pointer dereference. Bail out with -ENOMEM if the reset callback leaves connector->state unset. Fixes: aadb3e16b8f3 ("drm/connector: hdmi: Add output BPC to the connector state") Reported-by: Sashiko Closes: https://lore.kernel.org/all/20260723015306.C94241F000E9@smtp.kernel.org/ Signed-off-by: Cristian Ciocaltea Reviewed-by: Maxime Ripard --- drivers/gpu/drm/drm_connector.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c index 8b4baed060f3..0e39431e85b2 100644 --- a/drivers/gpu/drm/drm_connector.c +++ b/drivers/gpu/drm/drm_connector.c @@ -628,6 +628,8 @@ int drmm_connector_hdmi_init(struct drm_device *dev, connector->state = state; } else if (connector->funcs->reset) { connector->funcs->reset(connector); + if (!connector->state) + return -ENOMEM; } drm_connector_attach_max_bpc_property(connector, 8, max_bpc); From patchwork Fri Jul 31 16:19:10 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Ciocaltea X-Patchwork-Id: 2817 Return-Path: X-Original-To: noreply@patchwork.local Delivered-To: noreply@patchwork.local Received: from sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74]) by mxe881.netcup.net (Postfix) with ESMTPS id AA6C61C0254 for ; Fri, 31 Jul 2026 18:29:58 +0200 (CEST) Authentication-Results: mxe881; dkim=pass header.d=collabora.com; spf=pass (sender IP is 172.232.135.74) smtp.mailfrom=linux-sunxi+bounces-24811-noreply=patchwork.local@lists.linux.dev smtp.helo=sto.lore.kernel.org Received-SPF: pass (mxe881: domain of lists.linux.dev designates 172.232.135.74 as permitted sender) client-ip=172.232.135.74; envelope-from=linux-sunxi+bounces-24811-noreply=patchwork.local@lists.linux.dev; helo=sto.lore.kernel.org; Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by sto.lore.kernel.org (Postfix) with ESMTP id 01AE7308FF75 for ; Fri, 31 Jul 2026 16:20:10 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A66A24503F9; Fri, 31 Jul 2026 16:19:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="CJ8cGjku" X-Original-To: linux-sunxi@lists.linux.dev Received: from bali.collaboradmins.com (bali.collaboradmins.com [148.251.105.195]) (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 85C3244DB6D for ; Fri, 31 Jul 2026 16:19:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.251.105.195 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785514770; cv=none; b=hHhHNK+Amm9hCTFP5WHc3nLOF8bAWxreYAYHGtPkBmCR65gmoYDOHo2KSGOyw25vHShI47yMqMT63+y3injF07iCYeVNJtV3tRqkxeYSSt3pR3n1dbHrVsjiC4/o09jcU1QSQfaiKixrXhn3Xu6R8k7zCDf1g9y70LRxciYCE30= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785514770; c=relaxed/simple; bh=1IyvFR8Zj1ReQgjwIsvN96oZ36UcefVdUN7fDEWJ+B4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=cleDr1Ql/FvS1PGf/JoVLftSgyk7QF3uo+ol7yV6NqOsictlBNSX22JPrTSnX2H39VO4jzAqQA8F1xX9z7rrSa2ICwnNq98g7BH58WYkvclDy+SerWANqY9Gy9WGVOpZKhQTn4upOpNEylm/ouzS97FCdj1sA7yeVUpEv9eDDmU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=CJ8cGjku; arc=none smtp.client-ip=148.251.105.195 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1785514757; bh=1IyvFR8Zj1ReQgjwIsvN96oZ36UcefVdUN7fDEWJ+B4=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=CJ8cGjkuyeuTmRc/PCIO0ISa3+XmTjajc10QK9pnBSqwn3pIcVEBw2Wd8KtADlxrB XAjV0stphwHEpo3/d4xeS/Qo+zacOkstZtfpRFxP97Gb7YYcQHVq8FcveTRvfTFqWA T1xuLHmflUhT0/dv10uZJUJsw2FemzGpHr70wsrxhmGsw++Z6AQQ43B0rwLEXDENgD 4P0rSWNdSOF5nVrzZrPY/ebJ82gyKfjaaTq7ECOtV3Is2tlMYtZsyUyj6BYB7UTmbx 05NyPY9CUsl+/4G/w4ohRWAEYz557iUr+xXtdbjxZB9sndCFDpF/tNS/oKhWr67qfr OWfaIuUMtrdJA== Received: from localhost (unknown [100.64.0.241]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange secp256r1 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: cristicc) by bali.collaboradmins.com (Postfix) with ESMTPSA id EC95717E08D6; Fri, 31 Jul 2026 18:19:16 +0200 (CEST) From: Cristian Ciocaltea Date: Fri, 31 Jul 2026 19:19:10 +0300 Subject: [PATCH v10 03/69] drm/display: hdmi: Rename drmm_connector_hdmi_init() to *_ini2() Precedence: bulk X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20260731-dw-hdmi-qp-scramb-v10-3-294364b2cf15@collabora.com> References: <20260731-dw-hdmi-qp-scramb-v10-0-294364b2cf15@collabora.com> In-Reply-To: <20260731-dw-hdmi-qp-scramb-v10-0-294364b2cf15@collabora.com> To: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Luca Ceresoli , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Chen-Yu Tsai , Samuel Holland , Dave Stevenson , =?utf-8?q?Ma=C3=ADra_Canal?= , Raspberry Pi Kernel Maintenance , Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Andy Yan , Algea Cao , Daniel Stone , Liu Ying , Phong LE Cc: kernel@collabora.com, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-rockchip@lists.infradead.org, Dmitry Baryshkov , Diederik de Haas X-Mailer: b4 0.15.2 X-MORS-Enabled: yes X-MORS-DOMAIN: patchwork.local X-MORS-HOSTING: hosting172546 X-MORS-USER: hosting172546 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= In preparation for changing the signature of drmm_connector_hdmi_init(), i.e. dropping the vendor, product, supported_formats and max_bpc arguments, which are being moved into struct drm_connector_hdmi_funcs, temporarily rename the helper to drmm_connector_hdmi_ini2(). This lets the new signature be introduced under the original name while callers are converted incrementally. The final patch removes *_ini2() once no callers remain. This is a mechanical, same-length rename performed with sed: $ git grep -l 'drmm_connector_hdmi_init' -- '*.[ch]' \ | xargs sed -i 's/drmm_connector_hdmi_init/drmm_connector_hdmi_ini2/g' The transitional name matches the original's length so continuation-line arguments stay aligned to the opening parenthesis, keeping the diff to the identifier itself and avoiding re-alignment churn here and in the later conversions. No functional change intended. Reviewed-by: Dmitry Baryshkov Tested-by: Diederik de Haas # NanoPC-T6 LTS, Rock 5B Signed-off-by: Cristian Ciocaltea --- drivers/gpu/drm/display/drm_bridge_connector.c | 2 +- drivers/gpu/drm/drm_connector.c | 6 ++-- drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c | 2 +- drivers/gpu/drm/tests/drm_connector_test.c | 42 +++++++++++----------- drivers/gpu/drm/tests/drm_hdmi_state_helper_test.c | 2 +- drivers/gpu/drm/vc4/vc4_hdmi.c | 2 +- include/drm/drm_connector.h | 2 +- 7 files changed, 29 insertions(+), 29 deletions(-) diff --git a/drivers/gpu/drm/display/drm_bridge_connector.c b/drivers/gpu/drm/display/drm_bridge_connector.c index 8b54069fa53a..f75ce47a6350 100644 --- a/drivers/gpu/drm/display/drm_bridge_connector.c +++ b/drivers/gpu/drm/display/drm_bridge_connector.c @@ -1010,7 +1010,7 @@ struct drm_connector *drm_bridge_connector_init(struct drm_device *drm, bridge_connector->hdmi_funcs.spd = drm_bridge_connector_hdmi_spd_infoframe; - ret = drmm_connector_hdmi_init(drm, connector, + ret = drmm_connector_hdmi_ini2(drm, connector, bridge_connector->bridge_hdmi->vendor, bridge_connector->bridge_hdmi->product, &drm_bridge_connector_funcs, diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c index 0e39431e85b2..5e520cff6094 100644 --- a/drivers/gpu/drm/drm_connector.c +++ b/drivers/gpu/drm/drm_connector.c @@ -543,7 +543,7 @@ int drmm_connector_init(struct drm_device *dev, EXPORT_SYMBOL(drmm_connector_init); /** - * drmm_connector_hdmi_init - Init a preallocated HDMI connector + * drmm_connector_hdmi_ini2 - Init a preallocated HDMI connector * @dev: DRM device * @connector: A pointer to the HDMI connector to init * @vendor: HDMI Controller Vendor name @@ -568,7 +568,7 @@ EXPORT_SYMBOL(drmm_connector_init); * Returns: * Zero on success, error code on failure. */ -int drmm_connector_hdmi_init(struct drm_device *dev, +int drmm_connector_hdmi_ini2(struct drm_device *dev, struct drm_connector *connector, const char *vendor, const char *product, const struct drm_connector_funcs *funcs, @@ -646,7 +646,7 @@ int drmm_connector_hdmi_init(struct drm_device *dev, return 0; } -EXPORT_SYMBOL(drmm_connector_hdmi_init); +EXPORT_SYMBOL(drmm_connector_hdmi_ini2); /** * drm_connector_attach_edid_property - attach edid property. diff --git a/drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c b/drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c index e99f52ebb26f..96b2b597caa6 100644 --- a/drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c +++ b/drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c @@ -653,7 +653,7 @@ static int sun4i_hdmi_bind(struct device *dev, struct device *master, drm_connector_helper_add(&hdmi->connector, &sun4i_hdmi_connector_helper_funcs); - ret = drmm_connector_hdmi_init(drm, &hdmi->connector, + ret = drmm_connector_hdmi_ini2(drm, &hdmi->connector, /* * NOTE: Those are likely to be * wrong, but I couldn't find the diff --git a/drivers/gpu/drm/tests/drm_connector_test.c b/drivers/gpu/drm/tests/drm_connector_test.c index beb1d50a6646..3368aedd4e66 100644 --- a/drivers/gpu/drm/tests/drm_connector_test.c +++ b/drivers/gpu/drm/tests/drm_connector_test.c @@ -669,7 +669,7 @@ static void drm_test_connector_hdmi_init_valid(struct kunit *test) struct drm_connector_init_priv *priv = test->priv; int ret; - ret = drmm_connector_hdmi_init(&priv->drm, &priv->connector, + ret = drmm_connector_hdmi_ini2(&priv->drm, &priv->connector, "Vendor", "Product", &dummy_funcs, &dummy_hdmi_funcs, @@ -689,7 +689,7 @@ static void drm_test_connector_hdmi_init_null_ddc(struct kunit *test) struct drm_connector_init_priv *priv = test->priv; int ret; - ret = drmm_connector_hdmi_init(&priv->drm, &priv->connector, + ret = drmm_connector_hdmi_ini2(&priv->drm, &priv->connector, "Vendor", "Product", &dummy_funcs, &dummy_hdmi_funcs, @@ -709,7 +709,7 @@ static void drm_test_connector_hdmi_init_null_vendor(struct kunit *test) struct drm_connector_init_priv *priv = test->priv; int ret; - ret = drmm_connector_hdmi_init(&priv->drm, &priv->connector, + ret = drmm_connector_hdmi_ini2(&priv->drm, &priv->connector, NULL, "Product", &dummy_funcs, &dummy_hdmi_funcs, @@ -729,7 +729,7 @@ static void drm_test_connector_hdmi_init_null_product(struct kunit *test) struct drm_connector_init_priv *priv = test->priv; int ret; - ret = drmm_connector_hdmi_init(&priv->drm, &priv->connector, + ret = drmm_connector_hdmi_ini2(&priv->drm, &priv->connector, "Vendor", NULL, &dummy_funcs, &dummy_hdmi_funcs, @@ -755,7 +755,7 @@ static void drm_test_connector_hdmi_init_product_valid(struct kunit *test) KUNIT_ASSERT_LT(test, strlen(product_name), DRM_CONNECTOR_HDMI_PRODUCT_LEN); - ret = drmm_connector_hdmi_init(&priv->drm, &priv->connector, + ret = drmm_connector_hdmi_ini2(&priv->drm, &priv->connector, "Vendor", product_name, &dummy_funcs, &dummy_hdmi_funcs, @@ -788,7 +788,7 @@ static void drm_test_connector_hdmi_init_product_length_exact(struct kunit *test KUNIT_ASSERT_EQ(test, strlen(product_name), DRM_CONNECTOR_HDMI_PRODUCT_LEN); - ret = drmm_connector_hdmi_init(&priv->drm, &priv->connector, + ret = drmm_connector_hdmi_ini2(&priv->drm, &priv->connector, "Vendor", product_name, &dummy_funcs, &dummy_hdmi_funcs, @@ -815,7 +815,7 @@ static void drm_test_connector_hdmi_init_product_length_too_long(struct kunit *t KUNIT_ASSERT_GT(test, strlen(product_name), DRM_CONNECTOR_HDMI_PRODUCT_LEN); - ret = drmm_connector_hdmi_init(&priv->drm, &priv->connector, + ret = drmm_connector_hdmi_ini2(&priv->drm, &priv->connector, "Vendor", product_name, &dummy_funcs, &dummy_hdmi_funcs, @@ -841,7 +841,7 @@ static void drm_test_connector_hdmi_init_vendor_valid(struct kunit *test) KUNIT_ASSERT_LT(test, strlen(vendor_name), DRM_CONNECTOR_HDMI_VENDOR_LEN); - ret = drmm_connector_hdmi_init(&priv->drm, &priv->connector, + ret = drmm_connector_hdmi_ini2(&priv->drm, &priv->connector, vendor_name, "Product", &dummy_funcs, &dummy_hdmi_funcs, @@ -873,7 +873,7 @@ static void drm_test_connector_hdmi_init_vendor_length_exact(struct kunit *test) KUNIT_ASSERT_EQ(test, strlen(vendor_name), DRM_CONNECTOR_HDMI_VENDOR_LEN); - ret = drmm_connector_hdmi_init(&priv->drm, &priv->connector, + ret = drmm_connector_hdmi_ini2(&priv->drm, &priv->connector, vendor_name, "Product", &dummy_funcs, &dummy_hdmi_funcs, @@ -900,7 +900,7 @@ static void drm_test_connector_hdmi_init_vendor_length_too_long(struct kunit *te KUNIT_ASSERT_GT(test, strlen(vendor_name), DRM_CONNECTOR_HDMI_VENDOR_LEN); - ret = drmm_connector_hdmi_init(&priv->drm, &priv->connector, + ret = drmm_connector_hdmi_ini2(&priv->drm, &priv->connector, vendor_name, "Product", &dummy_funcs, &dummy_hdmi_funcs, @@ -920,7 +920,7 @@ static void drm_test_connector_hdmi_init_bpc_invalid(struct kunit *test) struct drm_connector_init_priv *priv = test->priv; int ret; - ret = drmm_connector_hdmi_init(&priv->drm, &priv->connector, + ret = drmm_connector_hdmi_ini2(&priv->drm, &priv->connector, "Vendor", "Product", &dummy_funcs, &dummy_hdmi_funcs, @@ -940,7 +940,7 @@ static void drm_test_connector_hdmi_init_bpc_null(struct kunit *test) struct drm_connector_init_priv *priv = test->priv; int ret; - ret = drmm_connector_hdmi_init(&priv->drm, &priv->connector, + ret = drmm_connector_hdmi_ini2(&priv->drm, &priv->connector, "Vendor", "Product", &dummy_funcs, &dummy_hdmi_funcs, @@ -965,7 +965,7 @@ static void drm_test_connector_hdmi_init_bpc_8(struct kunit *test) uint64_t val; int ret; - ret = drmm_connector_hdmi_init(&priv->drm, connector, + ret = drmm_connector_hdmi_ini2(&priv->drm, connector, "Vendor", "Product", &dummy_funcs, &dummy_hdmi_funcs, @@ -1006,7 +1006,7 @@ static void drm_test_connector_hdmi_init_bpc_10(struct kunit *test) uint64_t val; int ret; - ret = drmm_connector_hdmi_init(&priv->drm, connector, + ret = drmm_connector_hdmi_ini2(&priv->drm, connector, "Vendor", "Product", &dummy_funcs, &dummy_hdmi_funcs, @@ -1047,7 +1047,7 @@ static void drm_test_connector_hdmi_init_bpc_12(struct kunit *test) uint64_t val; int ret; - ret = drmm_connector_hdmi_init(&priv->drm, connector, + ret = drmm_connector_hdmi_ini2(&priv->drm, connector, "Vendor", "Product", &dummy_funcs, &dummy_hdmi_funcs, @@ -1083,7 +1083,7 @@ static void drm_test_connector_hdmi_init_formats_empty(struct kunit *test) struct drm_connector_init_priv *priv = test->priv; int ret; - ret = drmm_connector_hdmi_init(&priv->drm, &priv->connector, + ret = drmm_connector_hdmi_ini2(&priv->drm, &priv->connector, "Vendor", "Product", &dummy_funcs, &dummy_hdmi_funcs, @@ -1103,7 +1103,7 @@ static void drm_test_connector_hdmi_init_formats_no_rgb(struct kunit *test) struct drm_connector_init_priv *priv = test->priv; int ret; - ret = drmm_connector_hdmi_init(&priv->drm, &priv->connector, + ret = drmm_connector_hdmi_ini2(&priv->drm, &priv->connector, "Vendor", "Product", &dummy_funcs, &dummy_hdmi_funcs, @@ -1161,7 +1161,7 @@ static void drm_test_connector_hdmi_init_formats_yuv420_allowed(struct kunit *te params = test->param_value; priv->connector.ycbcr_420_allowed = params->yuv420_allowed; - ret = drmm_connector_hdmi_init(&priv->drm, &priv->connector, + ret = drmm_connector_hdmi_ini2(&priv->drm, &priv->connector, "Vendor", "Product", &dummy_funcs, &dummy_hdmi_funcs, @@ -1182,7 +1182,7 @@ static void drm_test_connector_hdmi_init_type_valid(struct kunit *test) unsigned int connector_type = *(unsigned int *)test->param_value; int ret; - ret = drmm_connector_hdmi_init(&priv->drm, &priv->connector, + ret = drmm_connector_hdmi_ini2(&priv->drm, &priv->connector, "Vendor", "Product", &dummy_funcs, &dummy_hdmi_funcs, @@ -1217,7 +1217,7 @@ static void drm_test_connector_hdmi_init_type_invalid(struct kunit *test) unsigned int connector_type = *(unsigned int *)test->param_value; int ret; - ret = drmm_connector_hdmi_init(&priv->drm, &priv->connector, + ret = drmm_connector_hdmi_ini2(&priv->drm, &priv->connector, "Vendor", "Product", &dummy_funcs, &dummy_hdmi_funcs, @@ -1494,7 +1494,7 @@ static void drm_test_drm_connector_attach_broadcast_rgb_property_hdmi_connector( struct drm_property *prop; int ret; - ret = drmm_connector_hdmi_init(&priv->drm, connector, + ret = drmm_connector_hdmi_ini2(&priv->drm, connector, "Vendor", "Product", &dummy_funcs, &dummy_hdmi_funcs, diff --git a/drivers/gpu/drm/tests/drm_hdmi_state_helper_test.c b/drivers/gpu/drm/tests/drm_hdmi_state_helper_test.c index 353a261d42da..4c2a400bc15a 100644 --- a/drivers/gpu/drm/tests/drm_hdmi_state_helper_test.c +++ b/drivers/gpu/drm/tests/drm_hdmi_state_helper_test.c @@ -275,7 +275,7 @@ __connector_hdmi_init(struct kunit *test, conn = &priv->connector; conn->ycbcr_420_allowed = !!(formats & BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR420)); - ret = drmm_connector_hdmi_init(drm, conn, + ret = drmm_connector_hdmi_ini2(drm, conn, "Vendor", "Product", &dummy_connector_funcs, hdmi_funcs, diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c index 17c8635c5afa..72ff95ca97de 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c @@ -541,7 +541,7 @@ static int vc4_hdmi_connector_init(struct drm_device *dev, if (vc4_hdmi->variant->supports_hdr) max_bpc = 12; - ret = drmm_connector_hdmi_init(dev, connector, + ret = drmm_connector_hdmi_ini2(dev, connector, "Broadcom", "Videocore", &vc4_hdmi_connector_funcs, &vc4_hdmi_hdmi_connector_funcs, diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h index a0cf0268de48..2e7d75cb0adf 100644 --- a/include/drm/drm_connector.h +++ b/include/drm/drm_connector.h @@ -2549,7 +2549,7 @@ int drmm_connector_init(struct drm_device *dev, const struct drm_connector_funcs *funcs, int connector_type, struct i2c_adapter *ddc); -int drmm_connector_hdmi_init(struct drm_device *dev, +int drmm_connector_hdmi_ini2(struct drm_device *dev, struct drm_connector *connector, const char *vendor, const char *product, const struct drm_connector_funcs *funcs, From patchwork Fri Jul 31 16:19:11 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Ciocaltea X-Patchwork-Id: 2818 Return-Path: X-Original-To: noreply@patchwork.local Delivered-To: noreply@patchwork.local Received: from sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74]) by mxe881.netcup.net (Postfix) with ESMTPS id 3CF8F1C0254 for ; Fri, 31 Jul 2026 18:30:31 +0200 (CEST) Authentication-Results: mxe881; dkim=pass header.d=collabora.com; spf=pass (sender IP is 172.232.135.74) smtp.mailfrom=linux-sunxi+bounces-24813-noreply=patchwork.local@lists.linux.dev smtp.helo=sto.lore.kernel.org Received-SPF: pass (mxe881: domain of lists.linux.dev designates 172.232.135.74 as permitted sender) client-ip=172.232.135.74; envelope-from=linux-sunxi+bounces-24813-noreply=patchwork.local@lists.linux.dev; helo=sto.lore.kernel.org; Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by sto.lore.kernel.org (Postfix) with ESMTP id 7918C3046DB5 for ; Fri, 31 Jul 2026 16:20:40 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 918C04519A0; Fri, 31 Jul 2026 16:19:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="BWSvj1aY" X-Original-To: linux-sunxi@lists.linux.dev Received: from bali.collaboradmins.com (bali.collaboradmins.com [148.251.105.195]) (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 CD6D644AB66 for ; Fri, 31 Jul 2026 16:19:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.251.105.195 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785514772; cv=none; b=Ez2GnF97y8Iu5Cf8Pwb1VlFDm/VHIIjrbx4bYC/jtTblmpx+agDvlX2GIXvym3tLXO1dOBOi924mNQmjgal93lRCVPkX4tkFj8vE7bDxzXFZCUsFU3iGJHDAy5aG6M1awBqty/xeMW13hiJO/xXmnJ6/kMD1yisCDdnnWVGI0f0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785514772; c=relaxed/simple; bh=NoIEJfzsPnttpMy6TCleHNM/qDBVTlWkZiIKX22Bc5g=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=fzN20y1/2mCA0CftgniMXlxJNRHuKGTbc6NjL5yxpRAs0+wCnUPFTvXZ4IU049P0Rnf2wR19PH4YErA0DvCCLQoa665FURt5IpBfT+Ssc7ZHTT/9DNq5eFR+y90BK4UtVMlMt8xLYsdkuB52TuIvg5FFn4mfWj9bSbkEmYzo1Uc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=BWSvj1aY; arc=none smtp.client-ip=148.251.105.195 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1785514757; bh=NoIEJfzsPnttpMy6TCleHNM/qDBVTlWkZiIKX22Bc5g=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=BWSvj1aYnurkJs2uxXnSS26owG5ntL/d5szAEDky5vXgvXrcGzZX3omWQ3eeA7kjp I/Qkx6d2n/oRr+MpGCyNUbx/+1LdMTop5+CU5EOkZR52suDzJrwTLGrJxTjKH/jfO8 dlx8LIFCsHuEe8CVWHIn2us881q04bGRFWp1Vv2ISrRkGgwOshl8FCS16T7TG5RJFY ZrdlNmgm/Wt2mEN08QmYrCh8utCav4XlnV3mijR47//uye/34uBrl9J/tbcbW1l1mS 2itLPKiWiDC4D/HYc0qXiif0eEGgMcVgFRmfQ29ose3mesfyy9fRP8YXFZ3bzNijyS h17IBVEAIksCw== Received: from localhost (unknown [100.64.0.241]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange secp256r1 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: cristicc) by bali.collaboradmins.com (Postfix) with ESMTPSA id A153417E08E0; Fri, 31 Jul 2026 18:19:17 +0200 (CEST) From: Cristian Ciocaltea Date: Fri, 31 Jul 2026 19:19:11 +0300 Subject: [PATCH v10 04/69] drm/connector: Add drmm_connector_hdmi_init() with new signature Precedence: bulk X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20260731-dw-hdmi-qp-scramb-v10-4-294364b2cf15@collabora.com> References: <20260731-dw-hdmi-qp-scramb-v10-0-294364b2cf15@collabora.com> In-Reply-To: <20260731-dw-hdmi-qp-scramb-v10-0-294364b2cf15@collabora.com> To: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Luca Ceresoli , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Chen-Yu Tsai , Samuel Holland , Dave Stevenson , =?utf-8?q?Ma=C3=ADra_Canal?= , Raspberry Pi Kernel Maintenance , Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Andy Yan , Algea Cao , Daniel Stone , Liu Ying , Phong LE Cc: kernel@collabora.com, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-rockchip@lists.infradead.org, Diederik de Haas X-Mailer: b4 0.15.2 X-Rspamd-Server: rspamd-worker-8404 X-Spamd-Result: default: False [-2.16 / 15.00]; BAYES_HAM(-5.50)[100.00%]; RBL_SENDERSCORE(2.00)[172.232.135.74:from]; SUSPICIOUS_RECIPS(1.50)[]; MAILLIST(-0.15)[generic]; BAD_REP_POLICIES(0.10)[]; MIME_GOOD(-0.10)[text/plain]; HAS_LIST_UNSUB(-0.01)[]; R_DKIM_ALLOW(0.00)[collabora.com:s=mail]; ARC_ALLOW(0.00)[subspace.kernel.org:s=arc-20240116:i=1]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_TWELVE(0.00)[31]; PRECEDENCE_BULK(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[collabora.com:email,collabora.com:dkim,sto.lore.kernel.org:rdns,sto.lore.kernel.org:helo,cknow-tech.com:email]; TAGGED_RCPT(0.00)[]; FORGED_SENDER_MAILLIST(0.00)[]; RCVD_COUNT_FIVE(0.00)[5]; ASN(0.00)[asn:63949, ipnet:172.232.128.0/19, country:SG]; DKIM_TRACE(0.00)[collabora.com:+]; DMARC_POLICY_ALLOW(0.00)[collabora.com,none]; R_SPF_ALLOW(0.00)[+ip4:172.232.135.74]; TO_DN_SOME(0.00)[]; FROM_NEQ_ENVFROM(0.00)[cristian.ciocaltea@collabora.com,linux-sunxi@lists.linux.dev]; FREEMAIL_TO(0.00)[intel.com,linaro.org,kernel.org,ideasonboard.com,kwiboo.se,gmail.com,bootlin.com,linux.intel.com,suse.de,ffwll.ch,sholland.org,raspberrypi.com,igalia.com,rock-chips.com,sntech.de,collabora.com,nxp.com,baylibre.com]; MIME_TRACE(0.00)[0:+]; TAGGED_FROM(0.00)[bounces-24813-noreply=patchwork.local]; FORGED_RECIPIENTS_MAILLIST(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[] X-Rspamd-Queue-Id: 3CF8F1C0254 X-MORS-Enabled: yes X-MORS-DOMAIN: patchwork.local X-MORS-HOSTING: hosting172546 X-MORS-USER: hosting172546 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= In preparation for providing HDMI 2.x source capabilities, move the vendor, product, supported_formats and max_bpc parameters out of the init function into struct drm_connector_hdmi_funcs, and add new supported_hdmi_ver and supported_tmds_char_rate fields there as well. Appending more HDMI-specific arguments to that function would not scale well, hence introduce drmm_connector_hdmi_init() with the reduced signature. Additionally, add the max_tmds_char_rate field to struct drm_connector_hdmi and use the supported HDMI version to determinate the maximum TMDS character rate allowed by the specification. Some controllers, however, may support a lower rate than that version would imply. A non-zero supported_tmds_char_rate lets drivers override this default with the actual controller capability. A value of zero keeps the limit inferred from supported_hdmi_ver. Callers are converted in the following patches, while the old and now renamed *_ini2() helper is removed at the end of the series. No functional changes expected for existing callers. Tested-by: Diederik de Haas # NanoPC-T6 LTS, Rock 5B Signed-off-by: Cristian Ciocaltea Reviewed-by: Maxime Ripard --- drivers/gpu/drm/drm_connector.c | 136 ++++++++++++++++++++++++++++++++++++++++ include/drm/drm_connector.h | 62 +++++++++++++++++- 2 files changed, 197 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c index 5e520cff6094..4721cdeafc84 100644 --- a/drivers/gpu/drm/drm_connector.c +++ b/drivers/gpu/drm/drm_connector.c @@ -542,6 +542,142 @@ int drmm_connector_init(struct drm_device *dev, } EXPORT_SYMBOL(drmm_connector_init); +/** + * drmm_connector_hdmi_init - Init a preallocated HDMI connector + * @dev: DRM device + * @connector: A pointer to the HDMI connector to init + * @funcs: callbacks for this connector + * @hdmi_funcs: HDMI-related callbacks and capabilities for this connector + * @connector_type: user visible type of the connector + * @ddc: optional pointer to the associated ddc adapter + * + * Initialises a preallocated HDMI connector. Connectors can be + * subclassed as part of driver connector objects. + * + * Cleanup is automatically handled with a call to + * drm_connector_cleanup() in a DRM-managed action. + * + * The connector structure should be allocated with drmm_kzalloc(). + * + * The @drm_connector_funcs.destroy hook must be NULL. + * + * Returns: + * Zero on success, error code on failure. + */ +int drmm_connector_hdmi_init(struct drm_device *dev, + struct drm_connector *connector, + const struct drm_connector_funcs *funcs, + const struct drm_connector_hdmi_funcs *hdmi_funcs, + int connector_type, + struct i2c_adapter *ddc) +{ + int ret; + + if (!hdmi_funcs) + return -EINVAL; + + if (!hdmi_funcs->vendor || !hdmi_funcs->product) + return -EINVAL; + + if ((strlen(hdmi_funcs->vendor) > DRM_CONNECTOR_HDMI_VENDOR_LEN) || + (strlen(hdmi_funcs->product) > DRM_CONNECTOR_HDMI_PRODUCT_LEN)) + return -EINVAL; + + if (!hdmi_funcs->supported_formats || + !(hdmi_funcs->supported_formats & BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444))) + return -EINVAL; + + if (connector->ycbcr_420_allowed != + !!(hdmi_funcs->supported_formats & BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR420))) + return -EINVAL; + + if (!(hdmi_funcs->max_bpc == 8 || + hdmi_funcs->max_bpc == 10 || + hdmi_funcs->max_bpc == 12)) + return -EINVAL; + + if (!hdmi_funcs->avi.clear_infoframe || + !hdmi_funcs->avi.write_infoframe || + !hdmi_funcs->hdmi.clear_infoframe || + !hdmi_funcs->hdmi.write_infoframe) + return -EINVAL; + + if (!(connector_type == DRM_MODE_CONNECTOR_HDMIA || + connector_type == DRM_MODE_CONNECTOR_HDMIB)) + return -EINVAL; + + ret = drmm_connector_init(dev, connector, funcs, connector_type, ddc); + if (ret) + return ret; + + /* TODO: remove after conversion to new drmm_connector_hdmi_init() */ + connector->hdmi.supported_formats = hdmi_funcs->supported_formats; + + /* + * The supported HDMI version can be used to determinate the maximum + * TMDS character rate allowed by the specification. Some controllers, + * however, may support a lower rate than that version would imply. + * + * A non-zero caps->max_tmds_char_rate lets drivers override this + * default with the actual controller capability. A value of zero keeps + * the limit inferred from supported_hdmi_ver. + */ + if (hdmi_funcs->supported_hdmi_ver >= HDMI_VERSION_2_0) + connector->hdmi.max_tmds_char_rate = HDMI_2_0_TMDS_CHAR_RATE_MAX_HZ; + else if (hdmi_funcs->supported_hdmi_ver >= HDMI_VERSION_1_3) + connector->hdmi.max_tmds_char_rate = HDMI_1_3_TMDS_CHAR_RATE_MAX_HZ; + else if (hdmi_funcs->supported_hdmi_ver >= HDMI_VERSION_1_0) + connector->hdmi.max_tmds_char_rate = HDMI_1_0_TMDS_CHAR_RATE_MAX_HZ; + + if (hdmi_funcs->supported_tmds_char_rate) { + if (hdmi_funcs->supported_tmds_char_rate > connector->hdmi.max_tmds_char_rate) { + drm_err(dev, "Enforced max_tmds_char_rate exceeds %llu spec limit\n", + connector->hdmi.max_tmds_char_rate); + return -EINVAL; + } + connector->hdmi.max_tmds_char_rate = hdmi_funcs->supported_tmds_char_rate; + } + + /* TODO: remove after conversion to new drmm_connector_hdmi_init() */ + strtomem_pad(connector->hdmi.vendor, hdmi_funcs->vendor, 0); + strtomem_pad(connector->hdmi.product, hdmi_funcs->product, 0); + + /* + * drm_connector_attach_max_bpc_property() requires the + * connector to have a state. + */ + if (connector->funcs->atomic_create_state) { + struct drm_connector_state *state; + + state = connector->funcs->atomic_create_state(connector); + if (IS_ERR(state)) + return PTR_ERR(state); + + connector->state = state; + } else if (connector->funcs->reset) { + connector->funcs->reset(connector); + if (!connector->state) + return -ENOMEM; + } + + drm_connector_attach_max_bpc_property(connector, 8, hdmi_funcs->max_bpc); + /* TODO: remove after conversion to new drmm_connector_hdmi_init() */ + connector->max_bpc = hdmi_funcs->max_bpc; + + if (hdmi_funcs->max_bpc > 8) + drm_connector_attach_hdr_output_metadata_property(connector); + + ret = drm_connector_attach_color_format_property(connector, + hdmi_funcs->supported_formats); + if (ret) + return ret; + + connector->hdmi.funcs = hdmi_funcs; + + return 0; +} +EXPORT_SYMBOL(drmm_connector_hdmi_init); + /** * drmm_connector_hdmi_ini2 - Init a preallocated HDMI connector * @dev: DRM device diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h index 2e7d75cb0adf..2a49c4d55f77 100644 --- a/include/drm/drm_connector.h +++ b/include/drm/drm_connector.h @@ -1403,8 +1403,50 @@ struct drm_connector_infoframe_funcs { /** * struct drm_connector_hdmi_funcs - drm_hdmi_connector control functions + * and controller capabilities */ struct drm_connector_hdmi_funcs { + /** + * @vendor: HDMI Controller Vendor name. + */ + const char *vendor; + + /** + * @product: HDMI Controller Product name + */ + const char *product; + + /** + * @supported_hdmi_ver: + * + * Maximum HDMI specification version supported by the controller side + * of this connector. This describes the controller capability only; + * the effective link capabilities may be further restricted by the + * sink, bridge, or mode validation. + */ + enum hdmi_version supported_hdmi_ver; + + /** + * @supported_tmds_char_rate: + * + * Maximum TMDS character rate supported by the controller, in Hz. + * A value of 0 means the core should use the default limit implied by + * @supported_hdmi_ver. + */ + unsigned long long supported_tmds_char_rate; + + /** + * @supported_formats: + * + * Bitmask of @drm_output_color_format listing supported output formats. + */ + unsigned long supported_formats; + + /** + * @max_bpc: Maximum bits per char the HDMI connector supports. + */ + unsigned int max_bpc; + /** * @tmds_char_rate_valid: * @@ -2052,7 +2094,19 @@ struct drm_connector_hdmi { unsigned long supported_formats; /** - * @funcs: HDMI connector Control Functions + * @max_tmds_char_rate: Maximum TMDS character rate, in Hz, + * supported by the controller. + * + * This is inferred from &drm_connector_hdmi_funcs.supported_hdmi_ver, + * by default. However, controllers may support a lower rate than that + * specification version would imply. If that is the case, drivers are + * expected to set &drm_connector_hdmi_funcs.supported_tmds_char_rate + * to a non-zero value indicating the actual limit. + */ + unsigned long long max_tmds_char_rate; + + /** + * @funcs: HDMI connector Control Functions and controller capabilities */ const struct drm_connector_hdmi_funcs *funcs; @@ -2549,6 +2603,12 @@ int drmm_connector_init(struct drm_device *dev, const struct drm_connector_funcs *funcs, int connector_type, struct i2c_adapter *ddc); +int drmm_connector_hdmi_init(struct drm_device *dev, + struct drm_connector *connector, + const struct drm_connector_funcs *funcs, + const struct drm_connector_hdmi_funcs *hdmi_funcs, + int connector_type, + struct i2c_adapter *ddc); int drmm_connector_hdmi_ini2(struct drm_device *dev, struct drm_connector *connector, const char *vendor, const char *product, From patchwork Fri Jul 31 16:19:12 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Ciocaltea X-Patchwork-Id: 2828 Return-Path: X-Original-To: noreply@patchwork.local Delivered-To: noreply@patchwork.local Received: from sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74]) by mxe881.netcup.net (Postfix) with ESMTPS id 6D5E31C0254 for ; Fri, 31 Jul 2026 18:33:39 +0200 (CEST) Authentication-Results: mxe881; dkim=pass header.d=collabora.com; spf=pass (sender IP is 172.232.135.74) smtp.mailfrom=linux-sunxi+bounces-24833-noreply=patchwork.local@lists.linux.dev smtp.helo=sto.lore.kernel.org Received-SPF: pass (mxe881: domain of lists.linux.dev designates 172.232.135.74 as permitted sender) client-ip=172.232.135.74; envelope-from=linux-sunxi+bounces-24833-noreply=patchwork.local@lists.linux.dev; helo=sto.lore.kernel.org; Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by sto.lore.kernel.org (Postfix) with ESMTP id BD31330C2A42 for ; Fri, 31 Jul 2026 16:23:22 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7E3E8463B70; Fri, 31 Jul 2026 16:19:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="q3MxyLXS" X-Original-To: linux-sunxi@lists.linux.dev Received: from bali.collaboradmins.com (bali.collaboradmins.com [148.251.105.195]) (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 DC94A44C66F for ; Fri, 31 Jul 2026 16:19:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.251.105.195 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785514789; cv=none; b=TXd968CN4vaJmMnLSd6KmqhvJQ/RF5IDhR/3HzmZisHpxhek/1YUgK9FjvI76PkNCFiIEAJWg0Ge5IRH7dBEc4bALwcCASvySiHRb0vzoRDo2owK0h0vObjN+r3wB62ZjuJeeWQTdEX4mFfHt5n86GA/iGSLJYJE5ejK7Zwbnag= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785514789; c=relaxed/simple; bh=b87VQOa3xlfBpCsbJozJkyeYCHqO1zOr7tVUdQC4OLo=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=QU95A2SCzbs4/YuJxryck//luIqMpH43hZqs1ec84PTOSIYsGVXy9w7Ks5F5pVzBUYraGufeMj3lH2heEgAM7XFM/uajD+fhDdXfULbBI25HwODV4JB4blry4b1W07cnkkXfc48HqPFSVkAuYfUpQvHaMPALpo/rs1W0+I4fRNI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=q3MxyLXS; arc=none smtp.client-ip=148.251.105.195 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1785514758; bh=b87VQOa3xlfBpCsbJozJkyeYCHqO1zOr7tVUdQC4OLo=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=q3MxyLXSw4l/vRfJeVtaxn7zH1/95dwVW3+m5C293AK4b7XXNJ2eFWFQScvUwa6Q3 RseusnCqqMBJUFYfiQAbw/eek8YpzWjzGR2gr7Ll7DJZfrYih/JI9SwDk0h0mfh6it 5KSyDRBXC5r7/dEe4xV5GcYh49m02+JMsIXKrqy+ARFvX+/7nrbTdBPTOSqYLTU9OD OUW/B9fQEBM/hTBZItUehy6sc9nO/aRo1eOfhI4Jq8AT01IKHcxC9CFsN7NSzQe/A5 ZgCq0nwcyzzlWCcsc5ROwJpemlPbmRriViN4tElOjdvdrwBZ37AQkKzzoFAcDHkt5Y kQWheZqPYCz+w== Received: from localhost (unknown [100.64.0.241]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange secp256r1 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: cristicc) by bali.collaboradmins.com (Postfix) with ESMTPSA id 5A18A17E08E9; Fri, 31 Jul 2026 18:19:18 +0200 (CEST) From: Cristian Ciocaltea Date: Fri, 31 Jul 2026 19:19:12 +0300 Subject: [PATCH v10 05/69] drm/display: bridge_connector: Convert to drmm_connector_hdmi_init() Precedence: bulk X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20260731-dw-hdmi-qp-scramb-v10-5-294364b2cf15@collabora.com> References: <20260731-dw-hdmi-qp-scramb-v10-0-294364b2cf15@collabora.com> In-Reply-To: <20260731-dw-hdmi-qp-scramb-v10-0-294364b2cf15@collabora.com> To: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Luca Ceresoli , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Chen-Yu Tsai , Samuel Holland , Dave Stevenson , =?utf-8?q?Ma=C3=ADra_Canal?= , Raspberry Pi Kernel Maintenance , Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Andy Yan , Algea Cao , Daniel Stone , Liu Ying , Phong LE Cc: kernel@collabora.com, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-rockchip@lists.infradead.org, Maud Spierings , Diederik de Haas X-Mailer: b4 0.15.2 X-Rspamd-Server: rspamd-worker-8404 X-Spamd-Result: default: False [-2.16 / 15.00]; BAYES_HAM(-5.50)[100.00%]; RBL_SENDERSCORE(2.00)[172.232.135.74:from]; SUSPICIOUS_RECIPS(1.50)[]; MAILLIST(-0.15)[generic]; MIME_GOOD(-0.10)[text/plain]; BAD_REP_POLICIES(0.10)[]; HAS_LIST_UNSUB(-0.01)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[collabora.com:email,collabora.com:dkim,cknow-tech.com:email,sto.lore.kernel.org:rdns,sto.lore.kernel.org:helo]; TAGGED_RCPT(0.00)[]; PRECEDENCE_BULK(0.00)[]; RCPT_COUNT_TWELVE(0.00)[32]; FREEMAIL_CC(0.00)[collabora.com,vger.kernel.org,lists.freedesktop.org,lists.infradead.org,lists.linux.dev,hotmail.com,cknow-tech.com]; FROM_HAS_DN(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_COUNT_FIVE(0.00)[5]; R_DKIM_ALLOW(0.00)[collabora.com:s=mail]; FROM_NEQ_ENVFROM(0.00)[cristian.ciocaltea@collabora.com,linux-sunxi@lists.linux.dev]; DMARC_POLICY_ALLOW(0.00)[collabora.com,none]; FREEMAIL_TO(0.00)[intel.com,linaro.org,kernel.org,ideasonboard.com,kwiboo.se,gmail.com,bootlin.com,linux.intel.com,suse.de,ffwll.ch,sholland.org,raspberrypi.com,igalia.com,rock-chips.com,sntech.de,collabora.com,nxp.com,baylibre.com]; DKIM_TRACE(0.00)[collabora.com:+]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(0.00)[+ip4:172.232.135.74:c]; FORGED_SENDER_MAILLIST(0.00)[]; FORGED_RECIPIENTS_MAILLIST(0.00)[]; RCVD_TLS_LAST(0.00)[]; ARC_ALLOW(0.00)[subspace.kernel.org:s=arc-20240116:i=1]; MIME_TRACE(0.00)[0:+]; TAGGED_FROM(0.00)[bounces-24833-noreply=patchwork.local]; ASN(0.00)[asn:63949, ipnet:172.232.128.0/19, country:SG]; RCVD_VIA_SMTP_AUTH(0.00)[] X-Rspamd-Queue-Id: 6D5E31C0254 X-MORS-Enabled: yes X-MORS-DOMAIN: patchwork.local X-MORS-HOSTING: hosting172546 X-MORS-USER: hosting172546 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= Switch drm_bridge_connector to the new drmm_connector_hdmi_init() signature. The vendor, product, supported_formats and max_bpc values now live in struct drm_connector_hdmi_funcs instead of being passed as separate arguments. This allows future HDMI 2.x capabilities to be plumbed without growing the function's argument list. Introduce the supported_hdmi_ver field in struct drm_bridge to let bridges declare the HDMI specification version they comply with, as well as max_tmds_char_rate to allow them to override the limit inferred from that version. This is particularly useful when handling chip variants with different capabilities. Additionally, add a warning in drm_bridge_add() if an HDMI bridge leaves supported_hdmi_ver unset. This alerts bridge drivers setting the DRM_BRIDGE_OP_HDMI flag that they must also declare their supported HDMI version. Tested-by: Maud Spierings Tested-by: Diederik de Haas # NanoPC-T6 LTS, Rock 5B Signed-off-by: Cristian Ciocaltea Reviewed-by: Maxime Ripard --- drivers/gpu/drm/display/drm_bridge_connector.c | 43 ++++++++++++++++---------- drivers/gpu/drm/drm_bridge.c | 6 +++- include/drm/drm_bridge.h | 14 +++++++++ 3 files changed, 46 insertions(+), 17 deletions(-) diff --git a/drivers/gpu/drm/display/drm_bridge_connector.c b/drivers/gpu/drm/display/drm_bridge_connector.c index f75ce47a6350..9ad31e9df0ab 100644 --- a/drivers/gpu/drm/display/drm_bridge_connector.c +++ b/drivers/gpu/drm/display/drm_bridge_connector.c @@ -590,6 +590,8 @@ drm_bridge_connector_read_edid(struct drm_connector *connector) } static const struct drm_connector_hdmi_funcs drm_bridge_connector_hdmi_funcs = { + .supported_formats = BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444), + .max_bpc = 8, .tmds_char_rate_valid = drm_bridge_connector_tmds_char_rate_valid, .read_edid = drm_bridge_connector_read_edid, .avi = { @@ -823,8 +825,6 @@ struct drm_connector *drm_bridge_connector_init(struct drm_device *drm, struct drm_connector *connector; struct i2c_adapter *ddc = NULL; struct drm_bridge *panel_bridge __free(drm_bridge_put) = NULL; - unsigned int supported_formats = BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444); - unsigned int max_bpc = 8; bool support_hdcp = false; int connector_type; int ret; @@ -907,11 +907,6 @@ struct drm_connector *drm_bridge_connector_init(struct drm_device *drm, return ERR_PTR(-EINVAL); bridge_connector->bridge_hdmi = drm_bridge_get(bridge); - - if (bridge->supported_formats) - supported_formats = bridge->supported_formats; - if (bridge->max_bpc) - max_bpc = bridge->max_bpc; } if (bridge->ops & DRM_BRIDGE_OP_HDMI_AUDIO) { @@ -993,11 +988,31 @@ struct drm_connector *drm_bridge_connector_init(struct drm_device *drm, return ERR_PTR(-EINVAL); if (bridge_connector->bridge_hdmi) { - if (!connector->ycbcr_420_allowed) - supported_formats &= ~BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR420); - bridge_connector->hdmi_funcs = drm_bridge_connector_hdmi_funcs; + bridge_connector->hdmi_funcs.vendor = bridge_connector->bridge_hdmi->vendor; + bridge_connector->hdmi_funcs.product = bridge_connector->bridge_hdmi->product; + + if (bridge_connector->bridge_hdmi->supported_hdmi_ver) + bridge_connector->hdmi_funcs.supported_hdmi_ver = + bridge_connector->bridge_hdmi->supported_hdmi_ver; + + if (bridge_connector->bridge_hdmi->supported_formats) + bridge_connector->hdmi_funcs.supported_formats = + bridge_connector->bridge_hdmi->supported_formats; + + if (!connector->ycbcr_420_allowed) + bridge_connector->hdmi_funcs.supported_formats &= + ~BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR420); + + if (bridge_connector->bridge_hdmi->max_tmds_char_rate) + bridge_connector->hdmi_funcs.supported_tmds_char_rate = + bridge_connector->bridge_hdmi->max_tmds_char_rate; + + if (bridge_connector->bridge_hdmi->max_bpc) + bridge_connector->hdmi_funcs.max_bpc = + bridge_connector->bridge_hdmi->max_bpc; + if (bridge_connector->bridge_hdmi->ops & DRM_BRIDGE_OP_HDMI_AUDIO) bridge_connector->hdmi_funcs.audio = drm_bridge_connector_hdmi_audio_infoframe; @@ -1010,14 +1025,10 @@ struct drm_connector *drm_bridge_connector_init(struct drm_device *drm, bridge_connector->hdmi_funcs.spd = drm_bridge_connector_hdmi_spd_infoframe; - ret = drmm_connector_hdmi_ini2(drm, connector, - bridge_connector->bridge_hdmi->vendor, - bridge_connector->bridge_hdmi->product, + ret = drmm_connector_hdmi_init(drm, connector, &drm_bridge_connector_funcs, &bridge_connector->hdmi_funcs, - connector_type, ddc, - supported_formats, - max_bpc); + connector_type, ddc); if (ret) return ERR_PTR(ret); } else { diff --git a/drivers/gpu/drm/drm_bridge.c b/drivers/gpu/drm/drm_bridge.c index 83f1809a5d37..afaae272347c 100644 --- a/drivers/gpu/drm/drm_bridge.c +++ b/drivers/gpu/drm/drm_bridge.c @@ -460,9 +460,13 @@ void drm_bridge_add(struct drm_bridge *bridge) mutex_init(&bridge->hpd_state_mutex); mutex_init(&bridge->hpd_mutex); - if (bridge->ops & DRM_BRIDGE_OP_HDMI) + if (bridge->ops & DRM_BRIDGE_OP_HDMI) { + if (bridge->supported_hdmi_ver == HDMI_VERSION_UNKNOWN) + DRM_WARN("HDMI bridge misses supported HDMI version\n"); + bridge->ycbcr_420_allowed = !!(bridge->supported_formats & BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR420)); + } mutex_lock(&bridge_lock); list_add_tail(&bridge->list, &bridge_list); diff --git a/include/drm/drm_bridge.h b/include/drm/drm_bridge.h index 58fff047f43b..5a5a25995471 100644 --- a/include/drm/drm_bridge.h +++ b/include/drm/drm_bridge.h @@ -1081,6 +1081,12 @@ struct drm_bridge { */ const char *product; + /** + * @supported_hdmi_ver: HDMI version the bridge is conformant with. + * This is only relevant if @DRM_BRIDGE_OP_HDMI is set. + */ + enum hdmi_version supported_hdmi_ver; + /** * @supported_formats: Bitmask of @drm_output_color_format listing * supported output formats. This is only relevant if @@ -1088,6 +1094,14 @@ struct drm_bridge { */ unsigned int supported_formats; + /** + * @max_tmds_char_rate: Maximum TMDS character rate, in Hz, the HDMI + * bridge supports. A value of 0 means the core should use the default + * limit implied by @supported_hdmi_ver. This is only relevant if + * @DRM_BRIDGE_OP_HDMI is set. + */ + unsigned long long max_tmds_char_rate; + /** * @max_bpc: Maximum bits per char the HDMI bridge supports. Allowed * values are 8, 10 and 12. This is only relevant if From patchwork Fri Jul 31 16:19:13 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Ciocaltea X-Patchwork-Id: 2854 Return-Path: X-Original-To: noreply@patchwork.local Delivered-To: noreply@patchwork.local Received: from sin.lore.kernel.org (sin.lore.kernel.org [104.64.211.4]) by mxe881.netcup.net (Postfix) with ESMTPS id CE1D61C22FA for ; Fri, 31 Jul 2026 18:39:25 +0200 (CEST) Authentication-Results: mxe881; dkim=pass header.d=collabora.com; spf=pass (sender IP is 104.64.211.4) smtp.mailfrom=linux-sunxi+bounces-24829-noreply=patchwork.local@lists.linux.dev smtp.helo=sin.lore.kernel.org Received-SPF: pass (mxe881: domain of lists.linux.dev designates 104.64.211.4 as permitted sender) client-ip=104.64.211.4; envelope-from=linux-sunxi+bounces-24829-noreply=patchwork.local@lists.linux.dev; helo=sin.lore.kernel.org; Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by sin.lore.kernel.org (Postfix) with ESMTP id A0B563055F05 for ; Fri, 31 Jul 2026 16:23:15 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D5B084611F4; Fri, 31 Jul 2026 16:19:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="YbtuXWh6" X-Original-To: linux-sunxi@lists.linux.dev Received: from bali.collaboradmins.com (bali.collaboradmins.com [148.251.105.195]) (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 33F114582E4 for ; Fri, 31 Jul 2026 16:19:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.251.105.195 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785514787; cv=none; b=YeYjS9vKqL63MfGvPVIQ8mb5Kl+PEfEl8gl4AQV69rnJltxxXF6BWq/Wk0F61NeEY5KvqzhBle20LG5mFZXxr89A7Ns1ghC0akCfjoUp+MXSD+dpMoQvswDWzgriVt8Co1VgphplNsOApwXsvkWs2hT+ztrS+FuysyF551aRGf0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785514787; c=relaxed/simple; bh=zZekc2wO4hv/88Qt7fIQVdz7WdxIyZgalaH2L/jTaLU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=dQTP80b5nYQdV1IcKzTnBS9exv+EgwSxZW59r9EDiIenYd053KYqSz1XyzycafTAPwucNjT1Fg78BoXv3Lx1IyvY6anCQ89lNh/eE2GStVFIR8mwZHUy0a9wcr3lzZuTpvZSu+aa2vfJst9UOk7l6kp0bXxhyHVvb9Hc+odt3D8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=YbtuXWh6; arc=none smtp.client-ip=148.251.105.195 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1785514759; bh=zZekc2wO4hv/88Qt7fIQVdz7WdxIyZgalaH2L/jTaLU=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=YbtuXWh6M2rS59EBp6uD5toPJfpcC2gpfkuP1MOCUSlPNR5yDYmyXg0xQUh4ecfz9 1T6fqVztjllvq68VsDIMWAXeoFJV1+FDH9y8crvEmhse3u2L74n73qimA4xsBQU2B8 1GsgY0ynuv7t+EBsvYgpEURHtluxoUsou15L34vGeuNUFdjkm450bcROBKbQ4SIEX1 Va7pf0Za//tNv0IGIULDeJMrXvNj7t3ENIgPOZ+zLirE4VT7U1q/lP37dbeMWjFpa9 cnZdwuWyzM1M4IYBQAX5P4QdLsmNzPW7TwR+Dj+ZmqHDVLwZD16fmkf2JbLedyQrNf jldHOD1oUtuYg== Received: from localhost (unknown [100.64.0.241]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange secp256r1 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: cristicc) by bali.collaboradmins.com (Postfix) with ESMTPSA id 1A91017E08EB; Fri, 31 Jul 2026 18:19:19 +0200 (CEST) From: Cristian Ciocaltea Date: Fri, 31 Jul 2026 19:19:13 +0300 Subject: [PATCH v10 06/69] drm/probe-helper: Introduce .force_ctx() connector callback Precedence: bulk X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20260731-dw-hdmi-qp-scramb-v10-6-294364b2cf15@collabora.com> References: <20260731-dw-hdmi-qp-scramb-v10-0-294364b2cf15@collabora.com> In-Reply-To: <20260731-dw-hdmi-qp-scramb-v10-0-294364b2cf15@collabora.com> To: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Luca Ceresoli , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Chen-Yu Tsai , Samuel Holland , Dave Stevenson , =?utf-8?q?Ma=C3=ADra_Canal?= , Raspberry Pi Kernel Maintenance , Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Andy Yan , Algea Cao , Daniel Stone , Liu Ying , Phong LE Cc: kernel@collabora.com, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-rockchip@lists.infradead.org X-Mailer: b4 0.15.2 X-Rspamd-Server: rspamd-worker-8404 X-Spamd-Result: default: False [-2.16 / 15.00]; BAYES_HAM(-5.50)[100.00%]; RBL_SENDERSCORE(2.00)[104.64.211.4:from]; SUSPICIOUS_RECIPS(1.50)[]; MAILLIST(-0.15)[generic]; BAD_REP_POLICIES(0.10)[]; MIME_GOOD(-0.10)[text/plain]; HAS_LIST_UNSUB(-0.01)[]; RCVD_COUNT_FIVE(0.00)[5]; ARC_ALLOW(0.00)[subspace.kernel.org:s=arc-20240116:i=1]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_TWELVE(0.00)[30]; PRECEDENCE_BULK(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[sin.lore.kernel.org:rdns,sin.lore.kernel.org:helo,collabora.com:email,collabora.com:dkim]; TAGGED_RCPT(0.00)[]; FORGED_SENDER_MAILLIST(0.00)[]; R_DKIM_ALLOW(0.00)[collabora.com:s=mail]; ASN(0.00)[asn:63949, ipnet:104.64.192.0/19, country:SG]; DKIM_TRACE(0.00)[collabora.com:+]; DMARC_POLICY_ALLOW(0.00)[collabora.com,none]; R_SPF_ALLOW(0.00)[+ip4:104.64.211.4:c]; TO_DN_SOME(0.00)[]; FROM_NEQ_ENVFROM(0.00)[cristian.ciocaltea@collabora.com,linux-sunxi@lists.linux.dev]; FREEMAIL_TO(0.00)[intel.com,linaro.org,kernel.org,ideasonboard.com,kwiboo.se,gmail.com,bootlin.com,linux.intel.com,suse.de,ffwll.ch,sholland.org,raspberrypi.com,igalia.com,rock-chips.com,sntech.de,collabora.com,nxp.com,baylibre.com]; MIME_TRACE(0.00)[0:+]; TAGGED_FROM(0.00)[bounces-24829-noreply=patchwork.local]; FORGED_RECIPIENTS_MAILLIST(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[] X-Rspamd-Queue-Id: CE1D61C22FA X-MORS-Enabled: yes X-MORS-DOMAIN: patchwork.local X-MORS-HOSTING: hosting172546 X-MORS-USER: hosting172546 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= The .force() connector callback is invoked by drm_helper_probe_single_connector_modes() while the modeset acquire context it created is live, but the hook signature provides no way to pass it down, e.g. to support implementations needing to lock further objects. Add a .force_ctx() variant to drm_connector_helper_funcs, taking the acquire context and returning an error code, so that -EDEADLK propagates into the existing retry path. When provided, it takes precedence over drm_connector_funcs' .force(), which is kept for existing users. This is a prerequisite for SCDC status synchronization in the HDMI connector framework. Signed-off-by: Cristian Ciocaltea Reviewed-by: Maxime Ripard --- drivers/gpu/drm/drm_probe_helper.c | 14 +++++++++++++- include/drm/drm_connector.h | 6 ++++++ include/drm/drm_modeset_helper_vtables.h | 28 ++++++++++++++++++++++++++++ 3 files changed, 47 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/drm_probe_helper.c b/drivers/gpu/drm/drm_probe_helper.c index e26ead5b5e58..918255bcfa09 100644 --- a/drivers/gpu/drm/drm_probe_helper.c +++ b/drivers/gpu/drm/drm_probe_helper.c @@ -559,6 +559,7 @@ static int __drm_helper_update_and_validate(struct drm_connector *connector, int drm_helper_probe_single_connector_modes(struct drm_connector *connector, uint32_t maxX, uint32_t maxY) { + const struct drm_connector_helper_funcs *funcs = connector->helper_private; struct drm_device *dev = connector->dev; struct drm_display_mode *mode; int count = 0, ret; @@ -592,8 +593,19 @@ int drm_helper_probe_single_connector_modes(struct drm_connector *connector, connector->status = connector_status_connected; else connector->status = connector_status_disconnected; - if (connector->funcs->force) + + if (funcs && funcs->force_ctx) { + ret = funcs->force_ctx(connector, &ctx); + if (ret == -EDEADLK) { + drm_modeset_backoff(&ctx); + goto retry; + } else if (ret < 0) { + drm_dbg_kms(dev, "[CONNECTOR:%d:%s] force_ctx failed: %d\n", + connector->base.id, connector->name, ret); + } + } else if (connector->funcs->force) { connector->funcs->force(connector); + } } else { ret = drm_helper_probe_detect(connector, &ctx, true); diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h index 2a49c4d55f77..a6de3e63b462 100644 --- a/include/drm/drm_connector.h +++ b/include/drm/drm_connector.h @@ -1603,6 +1603,12 @@ struct drm_connector_funcs { * the sysfs interfaces or on the kernel cmdline. In that case the * @detect callback isn't called. * + * New drivers should implement + * &drm_connector_helper_funcs.force_ctx instead, which gets passed + * the modeset acquire context and thus allows taking additional + * locks. It takes precedence over this callback when both are + * implemented. + * * FIXME: * * Note that this hook is only called by the probe helper. It's not in diff --git a/include/drm/drm_modeset_helper_vtables.h b/include/drm/drm_modeset_helper_vtables.h index ca6268945c28..cf5fe5ba2b18 100644 --- a/include/drm/drm_modeset_helper_vtables.h +++ b/include/drm/drm_modeset_helper_vtables.h @@ -921,6 +921,34 @@ struct drm_connector_helper_funcs { struct drm_modeset_acquire_ctx *ctx, bool force); + /** + * @force_ctx: + * + * This function is called to update internal encoder state when the + * connector is forced to a certain state by userspace, either through + * the sysfs interfaces or on the kernel cmdline. In that case the + * @detect_ctx callback isn't called. + * + * This is the atomic version of &drm_connector_funcs.force. When + * both are implemented, this one takes precedence and + * &drm_connector_funcs.force is not called. + * + * To avoid races against concurrent connector state updates, the + * helper libraries always call this with ctx set to a valid context, + * and &drm_mode_config.connection_mutex will always be locked with + * the ctx parameter set to this ctx. This allows taking additional + * locks as required. + * + * RETURNS: + * + * Zero on success, or a negative error code otherwise. This includes + * -EDEADLK when a lock acquisition needs to be restarted, in which + * case the helpers take care of backing off and calling this function + * again. + */ + int (*force_ctx)(struct drm_connector *connector, + struct drm_modeset_acquire_ctx *ctx); + /** * @mode_valid: * From patchwork Fri Jul 31 16:19:14 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Ciocaltea X-Patchwork-Id: 2829 Return-Path: X-Original-To: noreply@patchwork.local Delivered-To: noreply@patchwork.local Received: from sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74]) by mxe881.netcup.net (Postfix) with ESMTPS id 3BFF91C1D58 for ; Fri, 31 Jul 2026 18:33:41 +0200 (CEST) Authentication-Results: mxe881; dkim=pass header.d=collabora.com; spf=pass (sender IP is 172.232.135.74) smtp.mailfrom=linux-sunxi+bounces-24830-noreply=patchwork.local@lists.linux.dev smtp.helo=sto.lore.kernel.org Received-SPF: pass (mxe881: domain of lists.linux.dev designates 172.232.135.74 as permitted sender) client-ip=172.232.135.74; envelope-from=linux-sunxi+bounces-24830-noreply=patchwork.local@lists.linux.dev; helo=sto.lore.kernel.org; Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by sto.lore.kernel.org (Postfix) with ESMTP id 0D4D230C2A69 for ; Fri, 31 Jul 2026 16:23:23 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 91E574657EE; Fri, 31 Jul 2026 16:19:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="n2HWz8SG" X-Original-To: linux-sunxi@lists.linux.dev Received: from bali.collaboradmins.com (bali.collaboradmins.com [148.251.105.195]) (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 6CB384582ED for ; Fri, 31 Jul 2026 16:19:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.251.105.195 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785514788; cv=none; b=NjYgPeKMpgGw+K7PnbssW9Kqjf3r8sd6gqEkpEilTj8qkmdgINOAJ3mzbaycg6Hjl7XFXrn3hmNFw+PqiozVpfKad23HLt7/+a6Z0OoltlR/S9jajlvk/+DPe4c+ey0fnQlnxMOYv/ECvyf5LaWYj7uw2SG/k4K/exGcvu+16b4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785514788; c=relaxed/simple; bh=J1vxmseoLPQQnv2CmyOezLJSX3z1Sy0R9f4GOVZ1xq4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=B9i1UJH56OUZDt1T+0GXsfqm00Qm4LRUi7DGBqWW3GxE3nobhGVVVYUkWJAdvLQsdfCAiK2t4Cv8/XC/5rGbFelpLJnvdJipyK/RGbeUIQs0MigGwUd8xQDUAKGkLwtbp0zbaARl1X7I9+CJ8zI4Sd5l+n8DSprk2aza9c+Dbro= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=n2HWz8SG; arc=none smtp.client-ip=148.251.105.195 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1785514759; bh=J1vxmseoLPQQnv2CmyOezLJSX3z1Sy0R9f4GOVZ1xq4=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=n2HWz8SG6RstpcZ9zFQnUXMQH9z1/0e7VaWgppUHpn4sJQk3gXGV+Dw4pWZlu/4ns Ce3Xed+/KWrQycb1w+i4KJZbj3pgdSOvHvTIevkqPKsF9ySjaiZMtEOA+1DJK2xCjh xKxt5PmqsOPbGVSbj1YB3kqzMHM+UyofBhfpjSSNSdbnihZV7fA4T9q7Snuiya98VE EO06t4ZptZELQB7msWLgicEXbMcqasWI14b+0kwtkr6m/rAsa4IKnDhMHXi1ook0tG xx2rY0xS1HmQbsbQJONAB/vEPlQ2Q+KT1C3Zq4QfuTIVA4IMqzY/ScE4gRquQa0S3E cMFPHF1936ymw== Received: from localhost (unknown [100.64.0.241]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange secp256r1 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: cristicc) by bali.collaboradmins.com (Postfix) with ESMTPSA id C7AA817E08F7; Fri, 31 Jul 2026 18:19:19 +0200 (CEST) From: Cristian Ciocaltea Date: Fri, 31 Jul 2026 19:19:14 +0300 Subject: [PATCH v10 07/69] drm/connector: Add HDMI 2.0 scrambler infrastructure Precedence: bulk X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20260731-dw-hdmi-qp-scramb-v10-7-294364b2cf15@collabora.com> References: <20260731-dw-hdmi-qp-scramb-v10-0-294364b2cf15@collabora.com> In-Reply-To: <20260731-dw-hdmi-qp-scramb-v10-0-294364b2cf15@collabora.com> To: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Luca Ceresoli , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Chen-Yu Tsai , Samuel Holland , Dave Stevenson , =?utf-8?q?Ma=C3=ADra_Canal?= , Raspberry Pi Kernel Maintenance , Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Andy Yan , Algea Cao , Daniel Stone , Liu Ying , Phong LE Cc: kernel@collabora.com, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-rockchip@lists.infradead.org, Maud Spierings , Diederik de Haas X-Mailer: b4 0.15.2 X-Rspamd-Server: rspamd-worker-8404 X-Spamd-Result: default: False [-2.16 / 15.00]; BAYES_HAM(-5.50)[100.00%]; RBL_SENDERSCORE(2.00)[172.232.135.74:from]; SUSPICIOUS_RECIPS(1.50)[]; MAILLIST(-0.15)[generic]; MIME_GOOD(-0.10)[text/plain]; BAD_REP_POLICIES(0.10)[]; HAS_LIST_UNSUB(-0.01)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[collabora.com:email,collabora.com:dkim,sto.lore.kernel.org:rdns,sto.lore.kernel.org:helo,cknow-tech.com:email]; TAGGED_RCPT(0.00)[]; PRECEDENCE_BULK(0.00)[]; RCPT_COUNT_TWELVE(0.00)[32]; FREEMAIL_CC(0.00)[collabora.com,vger.kernel.org,lists.freedesktop.org,lists.infradead.org,lists.linux.dev,hotmail.com,cknow-tech.com]; FROM_HAS_DN(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_COUNT_FIVE(0.00)[5]; R_DKIM_ALLOW(0.00)[collabora.com:s=mail]; FROM_NEQ_ENVFROM(0.00)[cristian.ciocaltea@collabora.com,linux-sunxi@lists.linux.dev]; DMARC_POLICY_ALLOW(0.00)[collabora.com,none]; FREEMAIL_TO(0.00)[intel.com,linaro.org,kernel.org,ideasonboard.com,kwiboo.se,gmail.com,bootlin.com,linux.intel.com,suse.de,ffwll.ch,sholland.org,raspberrypi.com,igalia.com,rock-chips.com,sntech.de,collabora.com,nxp.com,baylibre.com]; DKIM_TRACE(0.00)[collabora.com:+]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(0.00)[+ip4:172.232.135.74]; FORGED_SENDER_MAILLIST(0.00)[]; FORGED_RECIPIENTS_MAILLIST(0.00)[]; RCVD_TLS_LAST(0.00)[]; ARC_ALLOW(0.00)[subspace.kernel.org:s=arc-20240116:i=1]; MIME_TRACE(0.00)[0:+]; TAGGED_FROM(0.00)[bounces-24830-noreply=patchwork.local]; ASN(0.00)[asn:63949, ipnet:172.232.128.0/19, country:SG]; RCVD_VIA_SMTP_AUTH(0.00)[] X-Rspamd-Queue-Id: 3BFF91C1D58 X-MORS-Enabled: yes X-MORS-DOMAIN: patchwork.local X-MORS-HOSTING: hosting172546 X-MORS-USER: hosting172546 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= Add the connector-level infrastructure to support HDMI 2.0 scrambling: - A drm_connector_hdmi_scrambler_supported() helper to report whether the source supports the scrambling capability, based on the presence of the newly introduced .scrambler_{enable|disable}() callbacks in drm_connector_hdmi_funcs are mandatory - A scrambler_needed flag to be managed by the hdmi state helpers based on the negotiated TMDS character rate and the source/sink scrambling capabilities - A scrambler_enabled flag to track whether scrambling is currently active - A delayed work item (scdc_work) to monitor sink-side scrambling status and retry the setup if the sink resets it - A scdc_work_initialized flag to support lazy initialization of the work item on the first scrambling enable and guard the teardown paths These are intended to be used by SCDC scrambling helpers to coordinate scrambling setup and teardown between the source driver and the DRM core. Tested-by: Maud Spierings Tested-by: Diederik de Haas # NanoPC-T6 LTS, Rock 5B Signed-off-by: Cristian Ciocaltea --- drivers/gpu/drm/drm_connector.c | 31 ++++++++++++--- include/drm/drm_connector.h | 83 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 109 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c index 4721cdeafc84..a18410faf040 100644 --- a/drivers/gpu/drm/drm_connector.c +++ b/drivers/gpu/drm/drm_connector.c @@ -622,12 +622,29 @@ int drmm_connector_hdmi_init(struct drm_device *dev, * default with the actual controller capability. A value of zero keeps * the limit inferred from supported_hdmi_ver. */ - if (hdmi_funcs->supported_hdmi_ver >= HDMI_VERSION_2_0) + if (hdmi_funcs->supported_hdmi_ver >= HDMI_VERSION_2_0) { + if (!hdmi_funcs->scrambler_enable || !hdmi_funcs->scrambler_disable) { + drm_err(dev, "Scrambler callbacks missing for HDMI 2.x\n"); + return -EINVAL; + } + connector->hdmi.max_tmds_char_rate = HDMI_2_0_TMDS_CHAR_RATE_MAX_HZ; - else if (hdmi_funcs->supported_hdmi_ver >= HDMI_VERSION_1_3) - connector->hdmi.max_tmds_char_rate = HDMI_1_3_TMDS_CHAR_RATE_MAX_HZ; - else if (hdmi_funcs->supported_hdmi_ver >= HDMI_VERSION_1_0) - connector->hdmi.max_tmds_char_rate = HDMI_1_0_TMDS_CHAR_RATE_MAX_HZ; + } else { + /* + * Scrambler callbacks are only valid for connectors advertising + * HDMI 2.0 capability. drm_connector_hdmi_scrambler_supported() + * relies on their presence to report scrambling support. + */ + if (hdmi_funcs->scrambler_enable || hdmi_funcs->scrambler_disable) { + drm_err(dev, "Scrambler callbacks unexpected for HDMI 1.x\n"); + return -EINVAL; + } + + if (hdmi_funcs->supported_hdmi_ver >= HDMI_VERSION_1_3) + connector->hdmi.max_tmds_char_rate = HDMI_1_3_TMDS_CHAR_RATE_MAX_HZ; + else if (hdmi_funcs->supported_hdmi_ver >= HDMI_VERSION_1_0) + connector->hdmi.max_tmds_char_rate = HDMI_1_0_TMDS_CHAR_RATE_MAX_HZ; + } if (hdmi_funcs->supported_tmds_char_rate) { if (hdmi_funcs->supported_tmds_char_rate > connector->hdmi.max_tmds_char_rate) { @@ -635,6 +652,7 @@ int drmm_connector_hdmi_init(struct drm_device *dev, connector->hdmi.max_tmds_char_rate); return -EINVAL; } + connector->hdmi.max_tmds_char_rate = hdmi_funcs->supported_tmds_char_rate; } @@ -918,6 +936,9 @@ void drm_connector_cleanup(struct drm_connector *connector) DRM_CONNECTOR_REGISTERED)) drm_connector_unregister(connector); + if (connector->hdmi.scdc_work_initialized) + cancel_delayed_work_sync(&connector->hdmi.scdc_work); + platform_device_unregister(connector->hdmi_audio.codec_pdev); if (connector->privacy_screen) { diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h index a6de3e63b462..89a140d6f064 100644 --- a/include/drm/drm_connector.h +++ b/include/drm/drm_connector.h @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include @@ -1131,6 +1132,17 @@ struct drm_connector_hdmi_state { * @tmds_char_rate: TMDS Character Rate, in Hz. */ unsigned long long tmds_char_rate; + + /** + * @scrambler_needed: Whether HDMI 2.0 SCDC scrambling is required + * for the negotiated mode/bpc/format. + * + * Computed by drm_atomic_helper_connector_hdmi_check() according to + * the HDMI 2.0 specification: scrambling is mandatory above a 340 MHz + * TMDS character rate. Optional scrambling at lower rates is + * deliberately not requested by the helper. + */ + bool scrambler_needed; }; /** @@ -1481,6 +1493,36 @@ struct drm_connector_hdmi_funcs { */ const struct drm_edid *(*read_edid)(struct drm_connector *connector); + /** + * @scrambler_enable: + * + * The callback is invoked via @drm_connector_hdmi_enable_scrambling + * during commit to setup SCDC scrambling and high TMDS clock ratio on + * the source side. + * + * The @scrambler_enable callback is mandatory if HDMI 2.0 is to be + * supported. + * + * Returns: + * 0 on success, a negative error code otherwise + */ + int (*scrambler_enable)(struct drm_connector *connector); + + /** + * @scrambler_disable: + * + * The callback is invoked via @drm_connector_hdmi_disable_scrambling + * during commit to tear down SCDC scrambling and high TMDS clock ratio + * on the source side. + * + * The @scrambler_disable callback is mandatory if HDMI 2.0 is to be + * supported. + * + * Returns: + * 0 on success, a negative error code otherwise + */ + int (*scrambler_disable)(struct drm_connector *connector); + /** * @avi: * @@ -2111,6 +2153,25 @@ struct drm_connector_hdmi { */ unsigned long long max_tmds_char_rate; + /** + * @scrambler_enabled: Tracks whether HDMI 2.0 scrambler is currently enabled. + */ + bool scrambler_enabled; + + /** + * @scdc_work: Work item currently used to monitor sink-side scrambling + * status and retry setup if the sink resets it. + */ + struct delayed_work scdc_work; + + /** + * @scdc_work_initialized: Tracks whether @scdc_work has been set up via + * INIT_DELAYED_WORK(). The work item is initialized lazily on the first + * scrambling enable, so this guards the teardown paths against touching + * an uninitialized work item. + */ + bool scdc_work_initialized; + /** * @funcs: HDMI connector Control Functions and controller capabilities */ @@ -2702,6 +2763,28 @@ drm_connector_is_unregistered(struct drm_connector *connector) DRM_CONNECTOR_UNREGISTERED; } +/** + * drm_connector_hdmi_scrambler_supported - does connector support HDMI + * scrambling? + * @connector: DRM connector + * + * Checks whether or not @connector driver supports HDMI scrambling. When + * controller advertises HDMI_VERSION_2_0 support, the + * @drm_connector_hdmi_funcs.scrambler_enable and + * @drm_connector_hdmi_funcs.scrambler_disable callbacks are mandatory and + * enforced during drmm_connector_hdmi_init(). + * + * Returns: + * True if the connector supports scrambling, false otherwise. + */ +static inline bool +drm_connector_hdmi_scrambler_supported(struct drm_connector *connector) +{ + return connector->hdmi.funcs && + connector->hdmi.funcs->scrambler_enable && + connector->hdmi.funcs->scrambler_disable; +} + void drm_connector_oob_hotplug_event(struct fwnode_handle *connector_fwnode, enum drm_connector_status status); enum drm_connector_color_format From patchwork Fri Jul 31 16:19:15 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Ciocaltea X-Patchwork-Id: 2849 Return-Path: X-Original-To: noreply@patchwork.local Delivered-To: noreply@patchwork.local Received: from sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74]) by mxe881.netcup.net (Postfix) with ESMTPS id D4F6B1C0944 for ; Fri, 31 Jul 2026 18:37:51 +0200 (CEST) Authentication-Results: mxe881; dkim=pass header.d=collabora.com; spf=pass (sender IP is 172.232.135.74) smtp.mailfrom=linux-sunxi+bounces-24834-noreply=patchwork.local@lists.linux.dev smtp.helo=sto.lore.kernel.org Received-SPF: pass (mxe881: domain of lists.linux.dev designates 172.232.135.74 as permitted sender) client-ip=172.232.135.74; envelope-from=linux-sunxi+bounces-24834-noreply=patchwork.local@lists.linux.dev; helo=sto.lore.kernel.org; Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by sto.lore.kernel.org (Postfix) with ESMTP id A39B6310E523 for ; Fri, 31 Jul 2026 16:23:24 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0245B4657FB; Fri, 31 Jul 2026 16:19:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="GFx218J8" X-Original-To: linux-sunxi@lists.linux.dev Received: from bali.collaboradmins.com (bali.collaboradmins.com [148.251.105.195]) (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 6B00D4582EB for ; Fri, 31 Jul 2026 16:19:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.251.105.195 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785514791; cv=none; b=sLwzDPIsZsI0iG+DRkqNIUaHnosbahr1Cc9AdAKJXiJoWQ6F2hG97pLW+4KNfLhzIVDLFDDPCJAoYuJfMp7aIKYArPnotNzyUslXq+fIMUzTqpwFVW80rkNvbZKfm4skV+5jG7P3H34zN9nRFismfYm3iq8WCQ8c8g0CsKckTUM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785514791; c=relaxed/simple; bh=5chiiqvOGjNz1K5v/jGNzf6XZ2rKQEpF9DoEmCabu+Y=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=XgRGOiBgxmZcDCabSHMDrYUNr9qVwmTahOUQxn4TxrG84BE58ygSBBzGyoUhNdRKUHQT0gEYvGZS2hZKRiGRZvPW/y4zH8RzOeBwnFoPIZbs/yGo+2IIjkkh5Hlp6s3z8MD+RTOPughzmqFNs8RmsjTP+SoK59l4vjI+/iPtrwc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=GFx218J8; arc=none smtp.client-ip=148.251.105.195 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1785514760; bh=5chiiqvOGjNz1K5v/jGNzf6XZ2rKQEpF9DoEmCabu+Y=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=GFx218J8j5Ek5nLREwrXSAbJfTs9iV5Pf2FCNA/ilZp1bC6i1H3fhsleRtBXfy/vE YXN0QLMgpofZKevq83g0c0nMinBUDO7tdG/awzw5U9l+ZrnLQKEqEQlIMK+0DnMODB lhvi7PqVbddn2HCx7VFAXU7DJF/EMA8dwFZZ6PydZKfPoXJzfoqWtzTA1+Us9xFV18 tUwoHjQwAWNE4tfvjGqENoyx+EW5oxlKwfYL5AOPNHd9i/XCmmPwCPng+sLeau3gJ/ a6gIn4KGrcyToUDE0UwrN2+IFxrofMGC3rLFbfQRZ9lfalJCKN8fQ8nH+WtM42H2eP JgcmmSnZ3fZpw== Received: from localhost (unknown [100.64.0.241]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange secp256r1 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: cristicc) by bali.collaboradmins.com (Postfix) with ESMTPSA id 7F63917E0906; Fri, 31 Jul 2026 18:19:20 +0200 (CEST) From: Cristian Ciocaltea Date: Fri, 31 Jul 2026 19:19:15 +0300 Subject: [PATCH v10 08/69] drm/display: scdc-helper: Add macro for connector-prefixed debug messages Precedence: bulk X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20260731-dw-hdmi-qp-scramb-v10-8-294364b2cf15@collabora.com> References: <20260731-dw-hdmi-qp-scramb-v10-0-294364b2cf15@collabora.com> In-Reply-To: <20260731-dw-hdmi-qp-scramb-v10-0-294364b2cf15@collabora.com> To: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Luca Ceresoli , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Chen-Yu Tsai , Samuel Holland , Dave Stevenson , =?utf-8?q?Ma=C3=ADra_Canal?= , Raspberry Pi Kernel Maintenance , Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Andy Yan , Algea Cao , Daniel Stone , Liu Ying , Phong LE Cc: kernel@collabora.com, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-rockchip@lists.infradead.org, Maud Spierings , Diederik de Haas X-Mailer: b4 0.15.2 X-Rspamd-Server: rspamd-worker-8404 X-Spamd-Result: default: False [-2.16 / 15.00]; BAYES_HAM(-5.50)[100.00%]; RBL_SENDERSCORE(2.00)[172.232.135.74:from]; SUSPICIOUS_RECIPS(1.50)[]; MAILLIST(-0.15)[generic]; MIME_GOOD(-0.10)[text/plain]; BAD_REP_POLICIES(0.10)[]; HAS_LIST_UNSUB(-0.01)[]; ARC_ALLOW(0.00)[subspace.kernel.org:s=arc-20240116:i=1]; PRECEDENCE_BULK(0.00)[]; TAGGED_RCPT(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[collabora.com:email,collabora.com:dkim,sto.lore.kernel.org:rdns,sto.lore.kernel.org:helo,cknow-tech.com:email]; FROM_HAS_DN(0.00)[]; FREEMAIL_CC(0.00)[collabora.com,vger.kernel.org,lists.freedesktop.org,lists.infradead.org,lists.linux.dev,hotmail.com,cknow-tech.com]; RCPT_COUNT_TWELVE(0.00)[32]; R_DKIM_ALLOW(0.00)[collabora.com:s=mail]; RCVD_COUNT_FIVE(0.00)[5]; FROM_NEQ_ENVFROM(0.00)[cristian.ciocaltea@collabora.com,linux-sunxi@lists.linux.dev]; DMARC_POLICY_ALLOW(0.00)[collabora.com,none]; FREEMAIL_TO(0.00)[intel.com,linaro.org,kernel.org,ideasonboard.com,kwiboo.se,gmail.com,bootlin.com,linux.intel.com,suse.de,ffwll.ch,sholland.org,raspberrypi.com,igalia.com,rock-chips.com,sntech.de,collabora.com,nxp.com,baylibre.com]; DKIM_TRACE(0.00)[collabora.com:+]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(0.00)[+ip4:172.232.135.74]; FORGED_SENDER_MAILLIST(0.00)[]; FORGED_RECIPIENTS_MAILLIST(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:63949, ipnet:172.232.128.0/19, country:SG]; MIME_TRACE(0.00)[0:+]; TAGGED_FROM(0.00)[bounces-24834-noreply=patchwork.local]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[] X-Rspamd-Queue-Id: D4F6B1C0944 X-MORS-Enabled: yes X-MORS-DOMAIN: patchwork.local X-MORS-HOSTING: hosting172546 X-MORS-USER: hosting172546 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= Introduce the drm_scdc_dbg() wrapper over drm_dbg_kms() to help getting rid of the boilerplate around prefixing the debug messages with the connector information. Acked-by: Maxime Ripard Tested-by: Maud Spierings Tested-by: Diederik de Haas # NanoPC-T6 LTS, Rock 5B Signed-off-by: Cristian Ciocaltea --- drivers/gpu/drm/display/drm_scdc_helper.c | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/drivers/gpu/drm/display/drm_scdc_helper.c b/drivers/gpu/drm/display/drm_scdc_helper.c index df878aad4a36..cb6632346aad 100644 --- a/drivers/gpu/drm/display/drm_scdc_helper.c +++ b/drivers/gpu/drm/display/drm_scdc_helper.c @@ -55,6 +55,10 @@ #define SCDC_I2C_SLAVE_ADDRESS 0x54 +#define drm_scdc_dbg(connector, fmt, ...) \ + drm_dbg_kms((connector)->dev, "[CONNECTOR:%d:%s] " fmt, \ + (connector)->base.id, (connector)->name, ##__VA_ARGS__) + /** * drm_scdc_read - read a block of data from SCDC * @adapter: I2C controller @@ -158,9 +162,7 @@ bool drm_scdc_get_scrambling_status(struct drm_connector *connector) ret = drm_scdc_readb(connector->ddc, SCDC_SCRAMBLER_STATUS, &status); if (ret < 0) { - drm_dbg_kms(connector->dev, - "[CONNECTOR:%d:%s] Failed to read scrambling status: %d\n", - connector->base.id, connector->name, ret); + drm_scdc_dbg(connector, "Failed to read scrambling status: %d\n", ret); return false; } @@ -188,9 +190,7 @@ bool drm_scdc_set_scrambling(struct drm_connector *connector, ret = drm_scdc_readb(connector->ddc, SCDC_TMDS_CONFIG, &config); if (ret < 0) { - drm_dbg_kms(connector->dev, - "[CONNECTOR:%d:%s] Failed to read TMDS config: %d\n", - connector->base.id, connector->name, ret); + drm_scdc_dbg(connector, "Failed to read TMDS config: %d\n", ret); return false; } @@ -201,9 +201,7 @@ bool drm_scdc_set_scrambling(struct drm_connector *connector, ret = drm_scdc_writeb(connector->ddc, SCDC_TMDS_CONFIG, config); if (ret < 0) { - drm_dbg_kms(connector->dev, - "[CONNECTOR:%d:%s] Failed to enable scrambling: %d\n", - connector->base.id, connector->name, ret); + drm_scdc_dbg(connector, "Failed to enable scrambling: %d\n", ret); return false; } @@ -248,9 +246,7 @@ bool drm_scdc_set_high_tmds_clock_ratio(struct drm_connector *connector, ret = drm_scdc_readb(connector->ddc, SCDC_TMDS_CONFIG, &config); if (ret < 0) { - drm_dbg_kms(connector->dev, - "[CONNECTOR:%d:%s] Failed to read TMDS config: %d\n", - connector->base.id, connector->name, ret); + drm_scdc_dbg(connector, "Failed to read TMDS config: %d\n", ret); return false; } @@ -261,9 +257,7 @@ bool drm_scdc_set_high_tmds_clock_ratio(struct drm_connector *connector, ret = drm_scdc_writeb(connector->ddc, SCDC_TMDS_CONFIG, config); if (ret < 0) { - drm_dbg_kms(connector->dev, - "[CONNECTOR:%d:%s] Failed to set TMDS clock ratio: %d\n", - connector->base.id, connector->name, ret); + drm_scdc_dbg(connector, "Failed to set TMDS clock ratio: %d\n", ret); return false; } From patchwork Fri Jul 31 16:19:16 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Ciocaltea X-Patchwork-Id: 2848 Return-Path: X-Original-To: noreply@patchwork.local Delivered-To: noreply@patchwork.local Received: from sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74]) by mxe881.netcup.net (Postfix) with ESMTPS id 50A251C22F5 for ; Fri, 31 Jul 2026 18:37:55 +0200 (CEST) Authentication-Results: mxe881; dkim=pass header.d=collabora.com; spf=pass (sender IP is 172.232.135.74) smtp.mailfrom=linux-sunxi+bounces-24831-noreply=patchwork.local@lists.linux.dev smtp.helo=sto.lore.kernel.org Received-SPF: pass (mxe881: domain of lists.linux.dev designates 172.232.135.74 as permitted sender) client-ip=172.232.135.74; envelope-from=linux-sunxi+bounces-24831-noreply=patchwork.local@lists.linux.dev; helo=sto.lore.kernel.org; Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by sto.lore.kernel.org (Postfix) with ESMTP id 1D33E30C3233 for ; Fri, 31 Jul 2026 16:23:24 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 80C8C463B8B; Fri, 31 Jul 2026 16:19:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="Cmp1zkJe" X-Original-To: linux-sunxi@lists.linux.dev Received: from bali.collaboradmins.com (bali.collaboradmins.com [148.251.105.195]) (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 2E8A44582E2 for ; Fri, 31 Jul 2026 16:19:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.251.105.195 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785514788; cv=none; b=QAz1wxWvN/xB4a9birK0CjDFptRxeudeOhtg2XXFmOM7mCnCdIOjk6TzHvHoDbwbGX3uJhHZKeaCIhYRD9itLGLj0UZ1fo7GEKktt+OOLd78YWyOWHILj8389we132k9gEIxwCd0y43t3FHF+Hp0MDvjF2z1HMXaAUIwDIPgzaU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785514788; c=relaxed/simple; bh=7R9BhZhCyLUbve7Hk5/UX4wcbViLo6DsTEiegFJ7c0M=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=rnKK820MahI5TzAGjRjG/UwQy9zT2g4ZOGnG6izaYcxA4BLwXqXoWOMb8s72kfUwPaOieTRrersTo/Knxm4ECC9i7jb6f8dO5QYfAxshbRcuRjkf3qVLHGeupWHTm3UymlSyo2jKE2wbJodK3U/EkqiDK5b8ttDA02rqOtJFpCY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=Cmp1zkJe; arc=none smtp.client-ip=148.251.105.195 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1785514761; bh=7R9BhZhCyLUbve7Hk5/UX4wcbViLo6DsTEiegFJ7c0M=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=Cmp1zkJeb75hdD0GB2WOsrT3TzHWyFI65GOyYes9D0MDgCSGmnXg491UhlnZuXe8P X1limW0xZudgcxX0gCcfi0iRkDl9yA4RiaVBYrrK2ZHYgPRHsZ85NaeDioQ9T6PC1H GmtkrNOXVV2HY24VnRtMQAo8seUvBTqYV+0pBx66zKuFFq4med9bK8njFCMpFItMJz AzcnuAshyvrgSgEsbIJWeCuVeQmMzu6ibF8i0WWp9Uw5VLU+z4ywF6NfX9kKAUIXH8 SIVPO9//8AkJSWTz6OUvddWZXDSEKLpxm06R5Ir55hnxAZ9Ausq6TXyV9j3l14LT+o h9fVekEGF8r3Q== Received: from localhost (unknown [100.64.0.241]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange secp256r1 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: cristicc) by bali.collaboradmins.com (Postfix) with ESMTPSA id 3440717E090B; Fri, 31 Jul 2026 18:19:21 +0200 (CEST) From: Cristian Ciocaltea Date: Fri, 31 Jul 2026 19:19:16 +0300 Subject: [PATCH v10 09/69] drm/display: scdc-helper: Add helper to set SCDC version information Precedence: bulk X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20260731-dw-hdmi-qp-scramb-v10-9-294364b2cf15@collabora.com> References: <20260731-dw-hdmi-qp-scramb-v10-0-294364b2cf15@collabora.com> In-Reply-To: <20260731-dw-hdmi-qp-scramb-v10-0-294364b2cf15@collabora.com> To: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Luca Ceresoli , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Chen-Yu Tsai , Samuel Holland , Dave Stevenson , =?utf-8?q?Ma=C3=ADra_Canal?= , Raspberry Pi Kernel Maintenance , Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Andy Yan , Algea Cao , Daniel Stone , Liu Ying , Phong LE Cc: kernel@collabora.com, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-rockchip@lists.infradead.org, Dmitry Baryshkov , Maud Spierings , Diederik de Haas X-Mailer: b4 0.15.2 X-MORS-Enabled: yes X-MORS-DOMAIN: patchwork.local X-MORS-HOSTING: hosting172546 X-MORS-USER: hosting172546 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= The HDMI 2.x specs mandate that compliant Sink devices report their SCDC version in the Sink Version register, which reads as 1 on any SCDC-capable sink. There is also a dedicated Source Version register. Writing it is not compulsory, but the spec advises that compliant Source devices do so, in which case the value must be 1. Add drm_scdc_set_source_version() to follow this recommendation. The Sink Version register is read first, both to log the advertised SCDC version and to guard against non-conformant devices: a sink reporting version 0 is either not SCDC-version-aware or broken, so writing the source version gains nothing and risks upsetting such hardware. In that case the write is skipped. The source version is passed as a parameter rather than hardcoded, as future spec revisions may define additional rules for the allowable version values. The written value is additionally clamped to the sink's reported version so the source never advertises a version the sink does not understand. Acked-by: Maxime Ripard Reviewed-by: Dmitry Baryshkov Tested-by: Maud Spierings Tested-by: Diederik de Haas # NanoPC-T6 LTS, Rock 5B Signed-off-by: Cristian Ciocaltea --- drivers/gpu/drm/display/drm_scdc_helper.c | 46 ++++++++++++++++++++++++++++++- include/drm/display/drm_scdc_helper.h | 2 ++ 2 files changed, 47 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/display/drm_scdc_helper.c b/drivers/gpu/drm/display/drm_scdc_helper.c index cb6632346aad..6d804ee19420 100644 --- a/drivers/gpu/drm/display/drm_scdc_helper.c +++ b/drivers/gpu/drm/display/drm_scdc_helper.c @@ -21,10 +21,11 @@ * DEALINGS IN THE SOFTWARE. */ +#include #include #include +#include #include -#include #include #include @@ -270,3 +271,46 @@ bool drm_scdc_set_high_tmds_clock_ratio(struct drm_connector *connector, return true; } EXPORT_SYMBOL(drm_scdc_set_high_tmds_clock_ratio); + +/** + * drm_scdc_set_source_version - set SCDC source version on the sink + * @connector: connector + * @ver: source version to advertise (per spec, 1) + * + * Reads the sink version for diagnostics and as a guard, then writes + * the source version unless the sink reports version 0. + * + * Returns: + * 0 on success or when skipped; a negative error code when either + * the read or the write failed. + */ +int drm_scdc_set_source_version(struct drm_connector *connector, u8 ver) +{ + u8 sink_ver; + int ret; + + ret = drm_scdc_readb(connector->ddc, SCDC_SINK_VERSION, &sink_ver); + if (ret) { + drm_scdc_dbg(connector, "Failed to read SCDC_SINK_VERSION: %d\n", ret); + return ret; + } + + drm_scdc_dbg(connector, "Sink reported SCDC ver. %u\n", sink_ver); + + /* + * Only advertise our source version to sinks that report a + * non-zero sink version. A sink reporting version 0 is either + * not SCDC-version-aware or non-conformant; writing the source + * version gains nothing and may upset broken hardware. + */ + if (sink_ver) { + ret = drm_scdc_writeb(connector->ddc, SCDC_SOURCE_VERSION, + min_t(u8, sink_ver, ver)); + if (ret) + drm_scdc_dbg(connector, + "Failed to write SCDC_SOURCE_VERSION: %d\n", ret); + } + + return ret; +} +EXPORT_SYMBOL(drm_scdc_set_source_version); diff --git a/include/drm/display/drm_scdc_helper.h b/include/drm/display/drm_scdc_helper.h index 34600476a1b9..90b0828364c2 100644 --- a/include/drm/display/drm_scdc_helper.h +++ b/include/drm/display/drm_scdc_helper.h @@ -77,4 +77,6 @@ bool drm_scdc_get_scrambling_status(struct drm_connector *connector); bool drm_scdc_set_scrambling(struct drm_connector *connector, bool enable); bool drm_scdc_set_high_tmds_clock_ratio(struct drm_connector *connector, bool set); +int drm_scdc_set_source_version(struct drm_connector *connector, u8 ver); + #endif From patchwork Fri Jul 31 16:19:17 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Ciocaltea X-Patchwork-Id: 2847 Return-Path: X-Original-To: noreply@patchwork.local Delivered-To: noreply@patchwork.local Received: from sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74]) by mxe881.netcup.net (Postfix) with ESMTPS id 35EC21C22F5 for ; Fri, 31 Jul 2026 18:37:34 +0200 (CEST) Authentication-Results: mxe881; dkim=pass header.d=collabora.com; spf=pass (sender IP is 172.232.135.74) smtp.mailfrom=linux-sunxi+bounces-24832-noreply=patchwork.local@lists.linux.dev smtp.helo=sto.lore.kernel.org Received-SPF: pass (mxe881: domain of lists.linux.dev designates 172.232.135.74 as permitted sender) client-ip=172.232.135.74; envelope-from=linux-sunxi+bounces-24832-noreply=patchwork.local@lists.linux.dev; helo=sto.lore.kernel.org; Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by sto.lore.kernel.org (Postfix) with ESMTP id 1301B3063F3A for ; Fri, 31 Jul 2026 16:23:12 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C845A45FFD5; Fri, 31 Jul 2026 16:19:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="jho5VgqU" X-Original-To: linux-sunxi@lists.linux.dev Received: from bali.collaboradmins.com (bali.collaboradmins.com [148.251.105.195]) (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 313114582E3 for ; Fri, 31 Jul 2026 16:19:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.251.105.195 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785514789; cv=none; b=X8HEyBqnfh9g41JsjQBYo2NCjGPeYjhF8l1T05CZAMdivDEYMsJodqWbIwFYkvSncvHAOtGnEGDIfR3BnSHhAdTqGaN3VjJGBTjCs6H52WjDV554xdZrcWzVEnZOZfnVhBnVLq5G2pDkU7FX+WM19EEVUE0jMWUKM4yJ9g0ng9Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785514789; c=relaxed/simple; bh=U0nGSTDpiJlBTzlVgbJKVpHuwnOwyKA2kX5lgsqDcns=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Gk62lKZUp3+IkJyb7niHd76K7kwbBIEh8TclX9ynALhhlct2MkVUjMdGDK1iFhbxcB2XkIPNs4W4MEdrjdba9VhYe+MNerL4A3JSwtbelpo49+4u5i7KCf7STugHXly7XAXU7Jx3dvJOAdrCQ+sustVGS211oO1kQljeOCLlHjc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=jho5VgqU; arc=none smtp.client-ip=148.251.105.195 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1785514762; bh=U0nGSTDpiJlBTzlVgbJKVpHuwnOwyKA2kX5lgsqDcns=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=jho5VgqUW2regXG0YCaK+cHWbvWZTji+D5PxI8yKjRoHQYgPv7IhsTwhdS35KQZNe ICMJM4Cap7oVa5Sc7mPwwx/GCpZ4iSfEz8hnLtAq7iYDWl1FWpLwxOss9f4iYbQEnC epCEE84uIYof9+VvfWAxEcEjfgsa01QUW3u5YIAfMVU8dfDGT7etvwhiUNOsUlToZv IjHPJvT753l9ORmrTX94M60iLPQnPl+dq3rEs6aVB9xXIa0C3LZ7YTjJltKRc3C6bZ Dd60C5WwqRV+H9EF5YiIZp+7E43+J6XMyBrv0RmbU2ZIjQDxFHJlDAZ6noSEtqO+Dc f99mGQ7KqFYPg== Received: from localhost (unknown [100.64.0.241]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange secp256r1 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: cristicc) by bali.collaboradmins.com (Postfix) with ESMTPSA id E6E8D17E0916; Fri, 31 Jul 2026 18:19:21 +0200 (CEST) From: Cristian Ciocaltea Date: Fri, 31 Jul 2026 19:19:17 +0300 Subject: [PATCH v10 10/69] drm/display: hdmi: Add HDMI 2.0 scrambling management helpers Precedence: bulk X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20260731-dw-hdmi-qp-scramb-v10-10-294364b2cf15@collabora.com> References: <20260731-dw-hdmi-qp-scramb-v10-0-294364b2cf15@collabora.com> In-Reply-To: <20260731-dw-hdmi-qp-scramb-v10-0-294364b2cf15@collabora.com> To: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Luca Ceresoli , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Chen-Yu Tsai , Samuel Holland , Dave Stevenson , =?utf-8?q?Ma=C3=ADra_Canal?= , Raspberry Pi Kernel Maintenance , Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Andy Yan , Algea Cao , Daniel Stone , Liu Ying , Phong LE Cc: kernel@collabora.com, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-rockchip@lists.infradead.org, Maud Spierings , Diederik de Haas X-Mailer: b4 0.15.2 X-MORS-Enabled: yes X-MORS-DOMAIN: patchwork.local X-MORS-HOSTING: hosting172546 X-MORS-USER: hosting172546 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= Add helpers to manage the full lifecycle of HDMI 2.0 SCDC scrambling on both source and sink sides: - drm_hdmi_mode_needs_scrambling(): checks whether a mode, bits per component and output format combination requires scrambling, which is needed when the resulting TMDS character rate exceeds the HDMI 1.3 maximum of 340 MHz - drm_connector_hdmi_enable_scrambling(): configures SCDC scrambling and high TMDS clock ratio and starts a periodic work item that monitors the sink's SCDC scrambling status, retrying setup when the sink loses state - drm_connector_hdmi_disable_scrambling(): tears down scrambling on both sides and cancels the monitoring work - drm_connector_hdmi_sync_scdc(): triggers a CRTC reset on reconnection to restore SCDC state lost during sink disconnects within an active display pipeline Tested-by: Maud Spierings Tested-by: Diederik de Haas # NanoPC-T6 LTS, Rock 5B Signed-off-by: Cristian Ciocaltea Reviewed-by: Maxime Ripard --- drivers/gpu/drm/display/drm_hdmi_helper.c | 296 ++++++++++++++++++++++++++++++ include/drm/display/drm_hdmi_helper.h | 15 ++ 2 files changed, 311 insertions(+) diff --git a/drivers/gpu/drm/display/drm_hdmi_helper.c b/drivers/gpu/drm/display/drm_hdmi_helper.c index 5cb0b033b171..cfecfef639ad 100644 --- a/drivers/gpu/drm/display/drm_hdmi_helper.c +++ b/drivers/gpu/drm/display/drm_hdmi_helper.c @@ -4,12 +4,20 @@ #include #include +#include + +#include +#include #include +#include #include #include +#include #include #include +#define DRM_HDMI_SCDC_POLL_DELAY_MS 1000 + static inline bool is_eotf_supported(u8 output_eotf, u8 sink_eotf) { return sink_eotf & BIT(output_eotf); @@ -426,3 +434,291 @@ drm_hdmi_acr_get_n_cts(unsigned long long tmds_char_rate, *out_cts = cts; } EXPORT_SYMBOL(drm_hdmi_acr_get_n_cts); + +/** + * drm_hdmi_mode_needs_scrambling() - Check if an HDMI mode requires scrambling + * @mode: Display mode to check + * @bpc: Bits per color component + * @fmt: Output pixel format + * + * Computes the TMDS character rate for the given mode, bits per component and + * output format, and checks whether it exceeds the HDMI 1.3 maximum TMDS + * character rate of 340 MHz. + * + * Returns: + * true if the mode requires scrambling, false otherwise. + */ +bool drm_hdmi_mode_needs_scrambling(const struct drm_display_mode *mode, + unsigned int bpc, + enum drm_output_color_format fmt) +{ + unsigned long long tmds_char_rate; + + tmds_char_rate = drm_hdmi_compute_mode_clock(mode, bpc, fmt); + + return tmds_char_rate > HDMI_1_3_TMDS_CHAR_RATE_MAX_HZ; +} +EXPORT_SYMBOL(drm_hdmi_mode_needs_scrambling); + +static bool drm_scdc_sink_supports_scrambling(struct drm_connector *connector) +{ + const struct drm_display_info *info = &connector->display_info; + + return info->is_hdmi && + info->hdmi.scdc.supported && + info->hdmi.scdc.scrambling.supported; +} + +static int drm_connector_hdmi_try_scrambling_setup(struct drm_connector *connector) +{ + bool done; + + done = drm_scdc_set_high_tmds_clock_ratio(connector, true); + if (!done) + return -EIO; + + done = drm_scdc_set_scrambling(connector, true); + if (!done) + return -EIO; + + if (READ_ONCE(connector->hdmi.scrambler_enabled)) + schedule_delayed_work(&connector->hdmi.scdc_work, + msecs_to_jiffies(DRM_HDMI_SCDC_POLL_DELAY_MS)); + + return 0; +} + +static void drm_connector_hdmi_scdc_work(struct work_struct *work) +{ + struct drm_connector *connector; + struct drm_connector_hdmi *hdmi; + + hdmi = container_of(to_delayed_work(work), struct drm_connector_hdmi, + scdc_work); + connector = container_of(hdmi, struct drm_connector, hdmi); + + /* + * The connector, and hence this work item, may outlive the source + * driver, e.g. when userspace keeps a DRM file descriptor open past + * unbind. Never poke the DDC bus after the connector got unregistered, + * as the underlying I2C adapter may already be gone. + */ + if (drm_connector_is_unregistered(connector)) + return; + + if (READ_ONCE(connector->hdmi.scrambler_enabled) && + !drm_scdc_get_scrambling_status(connector)) + drm_connector_hdmi_try_scrambling_setup(connector); +} + +/** + * drm_connector_hdmi_enable_scrambling() - enable scrambling and monitor SCDC status + * @connector: connector + * @conn_state: connector state + * + * Enables scrambling and high TMDS clock ratio on both source and sink sides. + * Additionally, use a delayed work item to monitor the scrambling status on + * the sink side and retry the operation, as some displays refuse to set the + * scrambling bit right away. + * + * The work item is cancelled by drm_connector_hdmi_disable_scrambling(), hence + * source drivers must ensure the display pipeline is shut down on unbind, e.g. + * via drm_atomic_helper_shutdown(). Otherwise the work may outlive the driver's + * devres-managed resources, since the connector itself is only cleaned up when + * the last reference to the DRM device is dropped. + * + * Returns: + * Zero if scrambling is set successfully, an error code otherwise. + */ +int drm_connector_hdmi_enable_scrambling(struct drm_connector *connector, + const struct drm_connector_state *conn_state) +{ + struct drm_connector_hdmi *hdmi = &connector->hdmi; + struct drm_device *dev = connector->dev; + int ret; + + if (!conn_state) + return -EINVAL; + + if (!conn_state->hdmi.scrambler_needed) + return 0; + + if (!drm_connector_hdmi_scrambler_supported(connector)) { + drm_dbg_kms(dev, "Source doesn't support scrambling.\n"); + return -EINVAL; + } + + if (!drm_scdc_sink_supports_scrambling(connector)) { + drm_dbg_kms(dev, "Sink doesn't support scrambling.\n"); + return -EINVAL; + } + + if (!connector->ddc) + return -EINVAL; + + drm_dbg_kms(dev, "Enabling scrambling\n"); + + if (!hdmi->scdc_work_initialized) { + INIT_DELAYED_WORK(&hdmi->scdc_work, + drm_connector_hdmi_scdc_work); + hdmi->scdc_work_initialized = true; + } + + WRITE_ONCE(hdmi->scrambler_enabled, true); + + ret = drm_connector_hdmi_try_scrambling_setup(connector); + if (!ret) + ret = hdmi->funcs->scrambler_enable(connector); + + if (ret) { + WRITE_ONCE(hdmi->scrambler_enabled, false); + cancel_delayed_work_sync(&hdmi->scdc_work); + + drm_scdc_set_scrambling(connector, false); + drm_scdc_set_high_tmds_clock_ratio(connector, false); + } + + return ret; +} +EXPORT_SYMBOL(drm_connector_hdmi_enable_scrambling); + +/** + * drm_connector_hdmi_disable_scrambling() - disable scrambling and SCDC monitoring + * @connector: connector + * + * Disables scrambling and high TMDS clock ratio on both source and sink sides. + * Also cancels the SCDC status monitoring work item, if it is still pending. + * + * Returns: + * Zero if scrambling is reset successfully, an error code otherwise. + */ +int drm_connector_hdmi_disable_scrambling(struct drm_connector *connector) +{ + struct drm_connector_hdmi *hdmi = &connector->hdmi; + struct drm_device *dev = connector->dev; + + if (!READ_ONCE(hdmi->scrambler_enabled)) + return 0; + + drm_dbg_kms(dev, "Disabling scrambling\n"); + + WRITE_ONCE(hdmi->scrambler_enabled, false); + + /* + * A driver may force scrambler_enabled at init to trigger a disable + * at boot (e.g. vc4), bypassing the enable path that sets up the work + * item. Only cancel it once it has actually been initialized. + */ + if (hdmi->scdc_work_initialized) + cancel_delayed_work_sync(&hdmi->scdc_work); + + if (connector->status == connector_status_connected && + drm_scdc_sink_supports_scrambling(connector)) { + drm_scdc_set_scrambling(connector, false); + drm_scdc_set_high_tmds_clock_ratio(connector, false); + } + + return hdmi->funcs->scrambler_disable(connector); +} +EXPORT_SYMBOL(drm_connector_hdmi_disable_scrambling); + +/** + * drm_connector_hdmi_sync_scdc() - resync the sink-side SCDC upon reconnect + * @connector: connector + * @plugged: connector plugged status event + * @ctx: initialized lock acquisition context + * + * When receiving hotplug disconnect/reconnect event, while the display is + * still active (CRTC enabled), the SCDC status on the sink side is reset + * and must be explicitly restored. + * + * The typical solution for this is to trigger an empty modeset in + * drm_connector_helper_funcs.detect_ctx(), which is what this helper does + * by triggering a CRTC reset on reconnection. + * + * When making use of the HDMI connector framework, this is automatically + * triggered via drm_atomic_helper_connector_hdmi_hotplug(). + * + * Returns: + * Zero on success, an error code otherwise, including -EDEADLK. + */ +int drm_connector_hdmi_sync_scdc(struct drm_connector *connector, bool plugged, + struct drm_modeset_acquire_ctx *ctx) +{ + struct drm_connector_hdmi *hdmi = &connector->hdmi; + struct drm_device *dev = connector->dev; + struct drm_connector_state *conn_state; + struct drm_crtc *crtc; + u8 config; + int ret; + + if (!connector || !plugged || !ctx) + return 0; + + /* + * This is normally part of .detect_ctx() call path, which already holds + * connection_mutex through @ctx. However, re-acquiring it with the + * same context is a no-op and makes the helper safe under any caller. + */ + ret = drm_modeset_lock(&connector->dev->mode_config.connection_mutex, ctx); + if (ret) + return ret; + + /* TODO: Also handle HDMI 2.1 FRL link training */ + + if (!drm_connector_hdmi_scrambler_supported(connector) || + !READ_ONCE(hdmi->scrambler_enabled)) + return 0; + + conn_state = connector->state; + if (!conn_state) + return 0; + + crtc = conn_state->crtc; + if (!crtc) + return 0; + + ret = drm_modeset_lock(&crtc->mutex, ctx); + if (ret) + return ret; + + if (!crtc->state || !crtc->state->active) + return 0; + + if (!connector->ddc || !drm_scdc_sink_supports_scrambling(connector)) + return 0; + + if (conn_state->commit && + !try_wait_for_completion(&conn_state->commit->hw_done)) + return 0; + + ret = drm_scdc_readb(connector->ddc, SCDC_TMDS_CONFIG, &config); + if (ret) { + drm_dbg_kms(dev, "Failed to read TMDS config: %d\n", ret); + return ret; + } + + if (config & SCDC_SCRAMBLING_ENABLE) + return 0; + + /* + * HDMI 2.0 requires that one should not send scrambled data prior + * to configuring the sink scrambling, and that TMDS clock/data + * transmission should be suspended when changing the TMDS clock rate + * in the sink. So let's just do a full modeset here, even though some + * sinks would be perfectly happy if were to just reconfigure the SCDC + * settings on the fly. + * + * The disable/re-enable cycle triggered by the reset should call + * drm_connector_hdmi_enable_scrambling() during re-enable, thus + * properly configuring the sink before data transmission resumes. + */ + drm_dbg_kms(dev, "Resetting CRTC to restore SCDC status\n"); + + ret = drm_atomic_helper_reset_crtc(crtc, ctx); + if (ret && ret != -EDEADLK) + drm_dbg_kms(dev, "Failed to reset CRTC: %d\n", ret); + + return ret; +} +EXPORT_SYMBOL(drm_connector_hdmi_sync_scdc); diff --git a/include/drm/display/drm_hdmi_helper.h b/include/drm/display/drm_hdmi_helper.h index 9c31ed90516b..2cdd6e3bc090 100644 --- a/include/drm/display/drm_hdmi_helper.h +++ b/include/drm/display/drm_hdmi_helper.h @@ -8,6 +8,7 @@ struct drm_connector; struct drm_connector_state; struct drm_display_mode; +struct drm_modeset_acquire_ctx; enum drm_output_color_format; void @@ -35,4 +36,18 @@ drm_hdmi_acr_get_n_cts(unsigned long long tmds_char_rate, unsigned int *out_n, unsigned int *out_cts); +bool +drm_hdmi_mode_needs_scrambling(const struct drm_display_mode *mode, + unsigned int bpc, enum drm_output_color_format fmt); + +int +drm_connector_hdmi_enable_scrambling(struct drm_connector *connector, + const struct drm_connector_state *conn_state); +int +drm_connector_hdmi_disable_scrambling(struct drm_connector *connector); + +int +drm_connector_hdmi_sync_scdc(struct drm_connector *connector, bool plugged, + struct drm_modeset_acquire_ctx *ctx); + #endif From patchwork Fri Jul 31 16:19:18 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Ciocaltea X-Patchwork-Id: 2824 Return-Path: X-Original-To: noreply@patchwork.local Delivered-To: noreply@patchwork.local Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114]) by mxe881.netcup.net (Postfix) with ESMTPS id D480A1C1F37 for ; Fri, 31 Jul 2026 18:32:24 +0200 (CEST) Authentication-Results: mxe881; dkim=pass header.d=collabora.com; spf=pass (sender IP is 172.105.105.114) smtp.mailfrom=linux-sunxi+bounces-24828-noreply=patchwork.local@lists.linux.dev smtp.helo=tor.lore.kernel.org Received-SPF: pass (mxe881: domain of lists.linux.dev designates 172.105.105.114 as permitted sender) client-ip=172.105.105.114; envelope-from=linux-sunxi+bounces-24828-noreply=patchwork.local@lists.linux.dev; helo=tor.lore.kernel.org; Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by tor.lore.kernel.org (Postfix) with ESMTP id F254B3155A8D for ; Fri, 31 Jul 2026 16:23:08 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C942245FFD6; Fri, 31 Jul 2026 16:19:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="NlFzFtAM" X-Original-To: linux-sunxi@lists.linux.dev Received: from bali.collaboradmins.com (bali.collaboradmins.com [148.251.105.195]) (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 C6EEA45629B for ; Fri, 31 Jul 2026 16:19:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.251.105.195 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785514787; cv=none; b=lT8jJ0cEWCcQz+bL9ioN1+QwJjS+cR3O3NCfRFpQsiN7ToAbSMuWTvOAKrmKJE9IMBuSnFqhKR5DYNctQYkJkDKhpF8q2EzbP7u29ThgSsCebJPn/bYpASeC1a9FqvllXoOrw9JQrj4ih2L81AHA94ODZ37/CWkkGefFCNv4qZc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785514787; c=relaxed/simple; bh=xADD6VVVgtOmKPZTcdjzwmKjLCfsgRP8n3AoLi1tKmE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=kX9uxZO2D+jyLZ9Yuqx2W22FJW34DzDujZU4s295T8fH0lB1Rhm5AMc0MdfDhzXlJijCGsj2RBbDY55xX30sXFZfnRaq1uDxwiaaOu06YcTrQvqiSWdKqxCtc40NiODndygdLZy3sJJQIHxF6d+Omxshf/NHwmzemBhFIbhgOV0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=NlFzFtAM; arc=none smtp.client-ip=148.251.105.195 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1785514762; bh=xADD6VVVgtOmKPZTcdjzwmKjLCfsgRP8n3AoLi1tKmE=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=NlFzFtAMJTgoQJcSMgS8jlN99nELF/yDotOoL41GfoqWI0rTlmH9HBU8LTY7YlCk2 bXRiB57Eu5nQLlILc95fm11YfS4zFRkU5rGyq+3AwTvRKjTFihfZGycYsqxTwAefDp 2o+7lC84JLu78GRD5GBejKPN/CYC4vH5D+sSryAUEgbmxSPesuLXoVtzrcqNjgLwWZ MRuIGXBPbw4wlwoVX+6umBp0rofztyZybALeH6ysT778QCJcWtF5APiOF6FxbqOFRt BucdqwhLR3LqZ5lEgddCHRZXi/mQ1/ELsB64IhLvVqbf6c8iRFrRPaED/oHn9OrRGt 1CXvGhIJ+ayJw== Received: from localhost (unknown [100.64.0.241]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange secp256r1 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: cristicc) by bali.collaboradmins.com (Postfix) with ESMTPSA id 9CBBF17E091F; Fri, 31 Jul 2026 18:19:22 +0200 (CEST) From: Cristian Ciocaltea Date: Fri, 31 Jul 2026 19:19:18 +0300 Subject: [PATCH v10 11/69] drm/display: hdmi: Advertise SCDC source version when scrambling Precedence: bulk X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20260731-dw-hdmi-qp-scramb-v10-11-294364b2cf15@collabora.com> References: <20260731-dw-hdmi-qp-scramb-v10-0-294364b2cf15@collabora.com> In-Reply-To: <20260731-dw-hdmi-qp-scramb-v10-0-294364b2cf15@collabora.com> To: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Luca Ceresoli , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Chen-Yu Tsai , Samuel Holland , Dave Stevenson , =?utf-8?q?Ma=C3=ADra_Canal?= , Raspberry Pi Kernel Maintenance , Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Andy Yan , Algea Cao , Daniel Stone , Liu Ying , Phong LE Cc: kernel@collabora.com, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-rockchip@lists.infradead.org, Maud Spierings , Diederik de Haas X-Mailer: b4 0.15.2 X-MORS-Enabled: yes X-MORS-DOMAIN: patchwork.local X-MORS-HOSTING: hosting172546 X-MORS-USER: hosting172546 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= The HDMI 2.0 spec advises that compliant Source devices report their SCDC version in the Source Version register. Do so when enabling scrambling by calling drm_scdc_set_source_version(). Failures are non-fatal: SCDC version negotiation is purely informational and does not gate scrambling or any high-bitrate functionality, so a flaky DDC bus should not block scrambling setup. Acked-by: Maxime Ripard Tested-by: Maud Spierings Tested-by: Diederik de Haas # NanoPC-T6 LTS, Rock 5B Signed-off-by: Cristian Ciocaltea --- drivers/gpu/drm/display/drm_hdmi_helper.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/gpu/drm/display/drm_hdmi_helper.c b/drivers/gpu/drm/display/drm_hdmi_helper.c index cfecfef639ad..493f2728ab86 100644 --- a/drivers/gpu/drm/display/drm_hdmi_helper.c +++ b/drivers/gpu/drm/display/drm_hdmi_helper.c @@ -16,6 +16,7 @@ #include #include +#define DRM_HDMI_SCDC_SOURCE_VERSION 1 #define DRM_HDMI_SCDC_POLL_DELAY_MS 1000 static inline bool is_eotf_supported(u8 output_eotf, u8 sink_eotf) @@ -556,6 +557,12 @@ int drm_connector_hdmi_enable_scrambling(struct drm_connector *connector, if (!connector->ddc) return -EINVAL; + /* + * Advertise our SCDC source version. This is purely informational and + * does not gate scrambling, so failures are non-fatal. + */ + drm_scdc_set_source_version(connector, DRM_HDMI_SCDC_SOURCE_VERSION); + drm_dbg_kms(dev, "Enabling scrambling\n"); if (!hdmi->scdc_work_initialized) { From patchwork Fri Jul 31 16:19:19 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Ciocaltea X-Patchwork-Id: 2822 Return-Path: X-Original-To: noreply@patchwork.local Delivered-To: noreply@patchwork.local Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114]) by mxe881.netcup.net (Postfix) with ESMTPS id C59C31C1D58 for ; Fri, 31 Jul 2026 18:31:46 +0200 (CEST) Authentication-Results: mxe881; dkim=pass header.d=collabora.com; spf=pass (sender IP is 172.105.105.114) smtp.mailfrom=linux-sunxi+bounces-24825-noreply=patchwork.local@lists.linux.dev smtp.helo=tor.lore.kernel.org Received-SPF: pass (mxe881: domain of lists.linux.dev designates 172.105.105.114 as permitted sender) client-ip=172.105.105.114; envelope-from=linux-sunxi+bounces-24825-noreply=patchwork.local@lists.linux.dev; helo=tor.lore.kernel.org; Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by tor.lore.kernel.org (Postfix) with ESMTP id 821FC30B9B0A for ; Fri, 31 Jul 2026 16:22:38 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 515A245C718; Fri, 31 Jul 2026 16:19:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="IPvyMHq2" X-Original-To: linux-sunxi@lists.linux.dev Received: from bali.collaboradmins.com (bali.collaboradmins.com [148.251.105.195]) (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 B58A64534AC for ; Fri, 31 Jul 2026 16:19:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.251.105.195 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785514784; cv=none; b=F+WBP3LKafTtpTZHHZK7qcNHRWaei1LJnGM26bJtHBgKHYpX3Tf3QEEEyrBKlZCTMDWk7kK3hmU0hIxgAK6uDPDwJJPy8yDkV4o9cYyb/HV5SaPZ5g9IPILxuvn3RnYoC96j531Ud9zcOlG0mQqdVgQTTSkVSChlAvNuLq2vx6E= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785514784; c=relaxed/simple; bh=CUcoRbmERGYIeO3Z961lPfNQR8EGzDg1msKbqGRYj2s=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=oref98LE7t6Vwc57EolyxhUytp1rPSWb0UFsZUq3eyrkx7xzt/YYoQZDHqF79rHjL04Bs2tEfT8+RObTLBgXLHrkSN7mANIh9UNBVu0SYhlByLPtoZpVTH+V0vX2fX/ralcJ0IU5f0FMMjNJykvEqObcgrFeVsye4nyEhkOiNJI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=IPvyMHq2; arc=none smtp.client-ip=148.251.105.195 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1785514763; bh=CUcoRbmERGYIeO3Z961lPfNQR8EGzDg1msKbqGRYj2s=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=IPvyMHq2SUa2dC6Oc6b/P3NBBztmzXSQ/OxKtkYdzszJfrag3HPOu8EVb6tjH0vOB 3+mrjfxjtxuBjKPFxwnHfsc6W3AJAlesJWrRlgDj7vyU+d+hGKmQBBEq9IUoBRRzIB lq5QJtf0jlyChJHs9J+G9dGHyva8/clwp7iRc7lGCXCBFxozyLGtJ9y97jnrxt7jVX a+I1GzGSTeraQm7E1YbznmlMPIU+DKbop/0EvHj+xu+yTs7ZNGq6vt1DHK1qgni31Y SdqA4+FxVAjVSs1aIqLgKkrUyqkMlHKUuQdLm3gZGp/xbloeFQg+kjiySmMF8PRKp9 1uLCTDJ7wAWRg== Received: from localhost (unknown [100.64.0.241]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange secp256r1 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: cristicc) by bali.collaboradmins.com (Postfix) with ESMTPSA id 6322517E092C; Fri, 31 Jul 2026 18:19:23 +0200 (CEST) From: Cristian Ciocaltea Date: Fri, 31 Jul 2026 19:19:19 +0300 Subject: [PATCH v10 12/69] drm/bridge: Fix unlocked list_del in drm_bridge_add() Precedence: bulk X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20260731-dw-hdmi-qp-scramb-v10-12-294364b2cf15@collabora.com> References: <20260731-dw-hdmi-qp-scramb-v10-0-294364b2cf15@collabora.com> In-Reply-To: <20260731-dw-hdmi-qp-scramb-v10-0-294364b2cf15@collabora.com> To: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Luca Ceresoli , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Chen-Yu Tsai , Samuel Holland , Dave Stevenson , =?utf-8?q?Ma=C3=ADra_Canal?= , Raspberry Pi Kernel Maintenance , Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Andy Yan , Algea Cao , Daniel Stone , Liu Ying , Phong LE Cc: kernel@collabora.com, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-rockchip@lists.infradead.org, Sashiko X-Mailer: b4 0.15.2 X-MORS-Enabled: yes X-MORS-DOMAIN: patchwork.local X-MORS-HOSTING: hosting172546 X-MORS-USER: hosting172546 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= When re-adding a bridge that was previously removed, drm_bridge_add() drops it from bridge_lingering_list without holding bridge_lock. Both bridge_list and bridge_lingering_list are protected by bridge_lock, as they are concurrently modified by drm_bridge_remove() and __drm_bridge_free(), and walked by the debugfs 'bridges' file. Running the list_empty() test and the list_del_init() outside of the lock may therefore corrupt either list. Perform both under bridge_lock. Fixes: 17805a15d175 ("drm/bridge: add list of removed refcounted bridges") Reported-by: Sashiko Closes: https://lore.kernel.org/all/20260723015004.1F5711F000E9@smtp.kernel.org/ Signed-off-by: Cristian Ciocaltea --- drivers/gpu/drm/drm_bridge.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/drm_bridge.c b/drivers/gpu/drm/drm_bridge.c index afaae272347c..8b8f71c3ccff 100644 --- a/drivers/gpu/drm/drm_bridge.c +++ b/drivers/gpu/drm/drm_bridge.c @@ -21,6 +21,7 @@ * DEALINGS IN THE SOFTWARE. */ +#include #include #include #include @@ -454,8 +455,10 @@ void drm_bridge_add(struct drm_bridge *bridge) * in bridge_lingering_list. Remove it or bridge_lingering_list will be * corrupted when adding this bridge to bridge_list below. */ - if (!list_empty(&bridge->list)) - list_del_init(&bridge->list); + scoped_guard(mutex, &bridge_lock) { + if (!list_empty(&bridge->list)) + list_del_init(&bridge->list); + } mutex_init(&bridge->hpd_state_mutex); mutex_init(&bridge->hpd_mutex); From patchwork Fri Jul 31 16:19:20 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Ciocaltea X-Patchwork-Id: 2852 Return-Path: X-Original-To: noreply@patchwork.local Delivered-To: noreply@patchwork.local Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114]) by mxe881.netcup.net (Postfix) with ESMTPS id 7423F1C22F6 for ; Fri, 31 Jul 2026 18:39:09 +0200 (CEST) Authentication-Results: mxe881; dkim=pass header.d=collabora.com; spf=pass (sender IP is 172.105.105.114) smtp.mailfrom=linux-sunxi+bounces-24814-noreply=patchwork.local@lists.linux.dev smtp.helo=tor.lore.kernel.org Received-SPF: pass (mxe881: domain of lists.linux.dev designates 172.105.105.114 as permitted sender) client-ip=172.105.105.114; envelope-from=linux-sunxi+bounces-24814-noreply=patchwork.local@lists.linux.dev; helo=tor.lore.kernel.org; Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by tor.lore.kernel.org (Postfix) with ESMTP id 9C65D308B8AC for ; Fri, 31 Jul 2026 16:20:40 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 919E44519A1; Fri, 31 Jul 2026 16:19:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="CrkXIV4p" X-Original-To: linux-sunxi@lists.linux.dev Received: from bali.collaboradmins.com (bali.collaboradmins.com [148.251.105.195]) (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 09CC444BCB8 for ; Fri, 31 Jul 2026 16:19:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.251.105.195 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785514774; cv=none; b=jLlAtT+xqTt6tkTxQpXBpFDzVZmQ5IzuW46RXv7Lglbc0HpZBQ3CWnBRQvas7ppNa0PX4a46DSyZoJbBRkA+tGzVckWqS5sUvzatfKK2mbJTrDS3iMU1oy3zy00JaelfsUhA+7KizNpiwVPuE1R+8BuDi0VNxne+Z0S07r4XJdI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785514774; c=relaxed/simple; bh=QfP7xZFECc7vFiekq/+2Q7b3eH9Ms2hU2uC26kblPso=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=hJtKGxzslNuqGpnWcJ40e3qjIhmsdqiuM5xU/mipJKsMZ5pYk5PO5u5rLPtEtn9Zflbb1/P0jRlBx0Xtmu7HmWfkPpM+/caSJwqwCtKrVFaLUiolZKQUyDtPSJcxFchgvhpF7vZUJMV/UsAvTCw7o7oj+tBNzuTudGz6vnjhag4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=CrkXIV4p; arc=none smtp.client-ip=148.251.105.195 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1785514764; bh=QfP7xZFECc7vFiekq/+2Q7b3eH9Ms2hU2uC26kblPso=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=CrkXIV4pSbcS2j13yhmqRBSGHJg+x2dBkRF3JBOoE5pT/GVqog8GEe2lCoWfdoup0 71WFGnTTc/xb+Ht/5XfQBWs+2I2Ngpid9U+nbh8HFky+OeP6/e6y/eHt+6D9rl+mga Itjcjl9fTk+WmE8+ok3H3ut44M2ZqFQD2KRuFP5HPe3fpojoNrqNs2Le4ReLQXDXG1 S3eS6Vzl8HfM81mumZWNCX2doC3mLmV+vgJGJLtvFPsdarjmZnPcpvyRHQxNe/gBB6 mkmmmv3nFHUUMb36/0NufYnQg6lcNaNiw7sTOwrjX3DgUywFpwxHmXP5AoDzvvhk5G zBMBBfoL3iaEg== Received: from localhost (unknown [100.64.0.241]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange secp256r1 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: cristicc) by bali.collaboradmins.com (Postfix) with ESMTPSA id 2A70117E092F; Fri, 31 Jul 2026 18:19:24 +0200 (CEST) From: Cristian Ciocaltea Date: Fri, 31 Jul 2026 19:19:20 +0300 Subject: [PATCH v10 13/69] drm/bridge: Fix unlocked list access in drm_bridge_attach() Precedence: bulk X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20260731-dw-hdmi-qp-scramb-v10-13-294364b2cf15@collabora.com> References: <20260731-dw-hdmi-qp-scramb-v10-0-294364b2cf15@collabora.com> In-Reply-To: <20260731-dw-hdmi-qp-scramb-v10-0-294364b2cf15@collabora.com> To: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Luca Ceresoli , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Chen-Yu Tsai , Samuel Holland , Dave Stevenson , =?utf-8?q?Ma=C3=ADra_Canal?= , Raspberry Pi Kernel Maintenance , Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Andy Yan , Algea Cao , Daniel Stone , Liu Ying , Phong LE Cc: kernel@collabora.com, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-rockchip@lists.infradead.org X-Mailer: b4 0.15.2 X-Rspamd-Server: rspamd-worker-8404 X-Spamd-Result: default: False [-2.16 / 15.00]; BAYES_HAM(-5.50)[100.00%]; RBL_SENDERSCORE(2.00)[172.105.105.114:from]; SUSPICIOUS_RECIPS(1.50)[]; MAILLIST(-0.15)[generic]; BAD_REP_POLICIES(0.10)[]; MIME_GOOD(-0.10)[text/plain]; HAS_LIST_UNSUB(-0.01)[]; RCVD_COUNT_FIVE(0.00)[5]; ARC_ALLOW(0.00)[subspace.kernel.org:s=arc-20240116:i=1]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_TWELVE(0.00)[30]; PRECEDENCE_BULK(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[tor.lore.kernel.org:rdns,tor.lore.kernel.org:helo,collabora.com:email,collabora.com:dkim]; TAGGED_RCPT(0.00)[]; FORGED_SENDER_MAILLIST(0.00)[]; R_DKIM_ALLOW(0.00)[collabora.com:s=mail]; ASN(0.00)[asn:63949, ipnet:172.105.96.0/20, country:SG]; DKIM_TRACE(0.00)[collabora.com:+]; DMARC_POLICY_ALLOW(0.00)[collabora.com,none]; R_SPF_ALLOW(0.00)[+ip4:172.105.105.114:c]; TO_DN_SOME(0.00)[]; FROM_NEQ_ENVFROM(0.00)[cristian.ciocaltea@collabora.com,linux-sunxi@lists.linux.dev]; FREEMAIL_TO(0.00)[intel.com,linaro.org,kernel.org,ideasonboard.com,kwiboo.se,gmail.com,bootlin.com,linux.intel.com,suse.de,ffwll.ch,sholland.org,raspberrypi.com,igalia.com,rock-chips.com,sntech.de,collabora.com,nxp.com,baylibre.com]; MIME_TRACE(0.00)[0:+]; TAGGED_FROM(0.00)[bounces-24814-noreply=patchwork.local]; FORGED_RECIPIENTS_MAILLIST(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[] X-Rspamd-Queue-Id: 7423F1C22F6 X-MORS-Enabled: yes X-MORS-DOMAIN: patchwork.local X-MORS-HOSTING: hosting172546 X-MORS-USER: hosting172546 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= drm_bridge_attach() inspects bridge->list to warn about bridges being attached without a previous drm_bridge_add() call, but it does so without holding bridge_lock. The list head can be concurrently written by drm_bridge_add(), drm_bridge_remove() and __drm_bridge_free() while they operate on neighbouring entries of bridge_list or bridge_lingering_list, all of them under bridge_lock. Hence the unlocked read is a data race, even though it is unlikely to change the outcome of list_empty() in practice. Perform the check with bridge_lock held. Fixes: 76f1a9711b83 ("drm/bridge: add warning for bridges attached without being added") Signed-off-by: Cristian Ciocaltea --- drivers/gpu/drm/drm_bridge.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/drm_bridge.c b/drivers/gpu/drm/drm_bridge.c index 8b8f71c3ccff..9a658decad2a 100644 --- a/drivers/gpu/drm/drm_bridge.c +++ b/drivers/gpu/drm/drm_bridge.c @@ -600,8 +600,10 @@ int drm_bridge_attach(struct drm_encoder *encoder, struct drm_bridge *bridge, if (!bridge->container) DRM_WARN("DRM bridge corrupted or not allocated by devm_drm_bridge_alloc()\n"); - if (list_empty(&bridge->list)) - DRM_WARN("Missing drm_bridge_add() before attach\n"); + scoped_guard(mutex, &bridge_lock) { + if (list_empty(&bridge->list)) + DRM_WARN("Missing drm_bridge_add() before attach\n"); + } drm_bridge_get(bridge); From patchwork Fri Jul 31 16:19:21 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Ciocaltea X-Patchwork-Id: 2855 Return-Path: X-Original-To: noreply@patchwork.local Delivered-To: noreply@patchwork.local Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114]) by mxe881.netcup.net (Postfix) with ESMTPS id BDF041C22FC for ; Fri, 31 Jul 2026 18:39:31 +0200 (CEST) Authentication-Results: mxe881; dkim=pass header.d=collabora.com; spf=pass (sender IP is 172.105.105.114) smtp.mailfrom=linux-sunxi+bounces-24815-noreply=patchwork.local@lists.linux.dev smtp.helo=tor.lore.kernel.org Received-SPF: pass (mxe881: domain of lists.linux.dev designates 172.105.105.114 as permitted sender) client-ip=172.105.105.114; envelope-from=linux-sunxi+bounces-24815-noreply=patchwork.local@lists.linux.dev; helo=tor.lore.kernel.org; Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by tor.lore.kernel.org (Postfix) with ESMTP id 6E2D9300D176 for ; Fri, 31 Jul 2026 16:20:58 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 079FA453A32; Fri, 31 Jul 2026 16:19:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="AsM8rhD/" X-Original-To: linux-sunxi@lists.linux.dev Received: from bali.collaboradmins.com (bali.collaboradmins.com [148.251.105.195]) (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 234EB4503E1 for ; Fri, 31 Jul 2026 16:19:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.251.105.195 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785514774; cv=none; b=aB7s0xa7rrdnhLJ2weLf1yaJh0dgfZ/SzAC2ASVMC01bSvsFBzjptlZUUnAyxxIVXVHN3gzjPistAvGP6aPD1HE6eiCM7659yRVBU2ls1Zh7SKkwCSdtM7jIExZqBlv3ljhaTlxdth3CmS/+i5tXKB7RjC9SMofPaFnaR+IuEPc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785514774; c=relaxed/simple; bh=GINu5YN6iFHFeKdJNvWRwz8yrY1Ka6Rvl6f76x+SBEY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ejXwCGEa4L3So6aeP+c+gM84Z4t9mfg1Fh+SV0bO/z3DJU+6Y3mxE0ToU1f/kcGaOgJM0+z/KfgrxHN6dBT5K6om1AmsB4/bvpw5MmGGe+sPEuXYinQyCyxciqb98gy3YalhmcbAvgT2UP4/5Lz134o60+woXWWlv+ae2XdcfPQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=AsM8rhD/; arc=none smtp.client-ip=148.251.105.195 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1785514765; bh=GINu5YN6iFHFeKdJNvWRwz8yrY1Ka6Rvl6f76x+SBEY=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=AsM8rhD/IHVyq07M9VimKEE+JfV/MLDKpd73PfP1+1HDZRVkGBp8UWUBS1BlyYcLH Lyu79H5BaRIvPJJ248QOZ3Jhq98T7oo6g2o+zqMRhnfzna5Q9XOPQsRUGa7dTzj6lZ qlu2kuhZBCiDZ43SQ6rd/fz8c4RHhysWKDWCN0a94XNKgk/vVFtBqFO7wwkmOWplu3 Gdu/0uaeqRIwxz+Nnd5HwT/VL5gnIoD2SriEbElXR5dLpI8VrS3cpPI9yuunJLdPzV 9K5h5Lj2yK4LLpTa7MWmJywQ31zrYdcD098dY/EkbTiSqRSpj88mbTlrb1LyDExqQN I+5L2Jh8aqEEQ== Received: from localhost (unknown [100.64.0.241]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange secp256r1 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: cristicc) by bali.collaboradmins.com (Postfix) with ESMTPSA id D650B17E0934; Fri, 31 Jul 2026 18:19:24 +0200 (CEST) From: Cristian Ciocaltea Date: Fri, 31 Jul 2026 19:19:21 +0300 Subject: [PATCH v10 14/69] drm/bridge: Remove redundant error check in drm_bridge_helper_reset_crtc() Precedence: bulk X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20260731-dw-hdmi-qp-scramb-v10-14-294364b2cf15@collabora.com> References: <20260731-dw-hdmi-qp-scramb-v10-0-294364b2cf15@collabora.com> In-Reply-To: <20260731-dw-hdmi-qp-scramb-v10-0-294364b2cf15@collabora.com> To: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Luca Ceresoli , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Chen-Yu Tsai , Samuel Holland , Dave Stevenson , =?utf-8?q?Ma=C3=ADra_Canal?= , Raspberry Pi Kernel Maintenance , Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Andy Yan , Algea Cao , Daniel Stone , Liu Ying , Phong LE Cc: kernel@collabora.com, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-rockchip@lists.infradead.org, Dmitry Baryshkov , Maud Spierings , Diederik de Haas X-Mailer: b4 0.15.2 X-MORS-Enabled: yes X-MORS-DOMAIN: patchwork.local X-MORS-HOSTING: hosting172546 X-MORS-USER: hosting172546 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= Remove the no-op error check after drm_atomic_helper_reset_crtc() since the goto target is the immediately following label and the return value is already propagated correctly without it. Reviewed-by: Dmitry Baryshkov Tested-by: Maud Spierings Tested-by: Diederik de Haas # NanoPC-T6 LTS, Rock 5B Signed-off-by: Cristian Ciocaltea --- drivers/gpu/drm/drm_bridge_helper.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/gpu/drm/drm_bridge_helper.c b/drivers/gpu/drm/drm_bridge_helper.c index 420f29cf3e54..0a3c8fee66b3 100644 --- a/drivers/gpu/drm/drm_bridge_helper.c +++ b/drivers/gpu/drm/drm_bridge_helper.c @@ -50,8 +50,6 @@ int drm_bridge_helper_reset_crtc(struct drm_bridge *bridge, crtc = connector->state->crtc; ret = drm_atomic_helper_reset_crtc(crtc, ctx); - if (ret) - goto out; out: drm_modeset_unlock(&dev->mode_config.connection_mutex); From patchwork Fri Jul 31 16:19:22 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Ciocaltea X-Patchwork-Id: 2861 Return-Path: X-Original-To: noreply@patchwork.local Delivered-To: noreply@patchwork.local Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114]) by mxe881.netcup.net (Postfix) with ESMTPS id 17DD61C22FA for ; Fri, 31 Jul 2026 18:41:01 +0200 (CEST) Authentication-Results: mxe881; dkim=pass header.d=collabora.com; spf=pass (sender IP is 172.105.105.114) smtp.mailfrom=linux-sunxi+bounces-24823-noreply=patchwork.local@lists.linux.dev smtp.helo=tor.lore.kernel.org Received-SPF: pass (mxe881: domain of lists.linux.dev designates 172.105.105.114 as permitted sender) client-ip=172.105.105.114; envelope-from=linux-sunxi+bounces-24823-noreply=patchwork.local@lists.linux.dev; helo=tor.lore.kernel.org; Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by tor.lore.kernel.org (Postfix) with ESMTP id B287330A73BB for ; Fri, 31 Jul 2026 16:22:20 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2A79245A2A5; Fri, 31 Jul 2026 16:19:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="DdIo5jxi" X-Original-To: linux-sunxi@lists.linux.dev Received: from bali.collaboradmins.com (bali.collaboradmins.com [148.251.105.195]) (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 E3074239E7F for ; Fri, 31 Jul 2026 16:19:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.251.105.195 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785514783; cv=none; b=teS8FRrJ1uJGxn9M0TKSvruhNU1i50iLgwTtwEh06NNDIKQRZdZW5WztKiiAAlFBiI6bqpoN2Q2taQLa/QOoQKmRkZFlEFx7AWuqfgIGTB2bweJkktDp2piG+xLRvhklu03X65OjYNaZT5m50+qt9DdHC4EanOIJCrFp7gRFENA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785514783; c=relaxed/simple; bh=q5EwAZk5tThfOFfPU3cHVXQvyZ71nTre7ie20f65OJw=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=O9gIF9WwqKy1Gmh82loWf0dU5ddtPmIOiWjiv6T13UHHQiyt6zwcuMy5XRoDYMSFq9MV0y4/pIbZGl+Yf7P6xlmyP1iAMokTZd6QFnXsySde/rOxTW/ZwJxhoiUaSNmeo2pOUk7KMmcYJq3RGtOEEaqmCAJnt2Ezaq3Xmnblcmc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=DdIo5jxi; arc=none smtp.client-ip=148.251.105.195 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1785514765; bh=q5EwAZk5tThfOFfPU3cHVXQvyZ71nTre7ie20f65OJw=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=DdIo5jxi023NLYpqtZRc+FgL4egNHK4YDshSat0ZkcnE8BZMWXS5kz5DIFKNCMkRM wETpn+b+RqqvdMgvrM8bNWmVamSBGK6og61qWcM41uUEeiULeEh7wGm4B1XVVBwkkn smxJNatp+2kU5E7CscZ/bdYjNXJT6FYY3CYdLzwtQcPgmj3ahJzUeKiqbfqKPysBgs JooT8xb05zqhGXsvVE0sbat169whW1r7+ZAS01ygfxTO6Cyx8HK3iodjjkIMQPV/+i B8Dn3h80B3MzMXjiCjcrlnRiuYG0fpXOiL7CgJwaghx/UhYGw9XxSjeWiuFSkpozUt vcFHxhLyjSiHw== Received: from localhost (unknown [100.64.0.241]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange secp256r1 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: cristicc) by bali.collaboradmins.com (Postfix) with ESMTPSA id 8F15017E0936; Fri, 31 Jul 2026 18:19:25 +0200 (CEST) From: Cristian Ciocaltea Date: Fri, 31 Jul 2026 19:19:22 +0300 Subject: [PATCH v10 15/69] drm/bridge: Add bridge ops for source-side HDMI 2.0 scrambling Precedence: bulk X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20260731-dw-hdmi-qp-scramb-v10-15-294364b2cf15@collabora.com> References: <20260731-dw-hdmi-qp-scramb-v10-0-294364b2cf15@collabora.com> In-Reply-To: <20260731-dw-hdmi-qp-scramb-v10-0-294364b2cf15@collabora.com> To: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Luca Ceresoli , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Chen-Yu Tsai , Samuel Holland , Dave Stevenson , =?utf-8?q?Ma=C3=ADra_Canal?= , Raspberry Pi Kernel Maintenance , Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Andy Yan , Algea Cao , Daniel Stone , Liu Ying , Phong LE Cc: kernel@collabora.com, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-rockchip@lists.infradead.org, Dmitry Baryshkov X-Mailer: b4 0.15.2 X-MORS-Enabled: yes X-MORS-DOMAIN: patchwork.local X-MORS-HOSTING: hosting172546 X-MORS-USER: hosting172546 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= Bridges advertising HDMI 2.0 must be able to enable and disable source-side scrambling and the high TMDS clock ratio when the configured mode exceeds 340 MHz. Add .hdmi_scrambler_{enable|disable}() callbacks covering the source-side programming only; sink-side SCDC negotiation remains the job of the HDMI connector helpers. Reviewed-by: Dmitry Baryshkov Signed-off-by: Cristian Ciocaltea --- include/drm/drm_bridge.h | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/include/drm/drm_bridge.h b/include/drm/drm_bridge.h index 5a5a25995471..77b3ffe69230 100644 --- a/include/drm/drm_bridge.h +++ b/include/drm/drm_bridge.h @@ -561,6 +561,41 @@ struct drm_bridge_funcs { const struct drm_display_mode *mode, unsigned long long tmds_rate); + /** + * @hdmi_scrambler_enable: + * + * Enable source-side scrambling and the high TMDS clock ratio for the + * mode currently being applied. + * + * This only programs the source side. Sink-side SCDC configuration is + * handled by the HDMI connector helpers. + * + * Mandatory for bridges that set the DRM_BRIDGE_OP_HDMI flag in their + * &drm_bridge->ops and advertise HDMI_VERSION_2_0 or later via + * &drm_bridge->supported_hdmi_ver; unused otherwise. + * + * Returns: + * 0 on success, a negative error code otherwise. + */ + int (*hdmi_scrambler_enable)(struct drm_bridge *bridge); + + /** + * @hdmi_scrambler_disable: + * + * Disable source-side scrambling and the high TMDS clock ratio. + * + * This only programs the source side. Sink-side SCDC configuration is + * handled by the HDMI connector helpers. + * + * Mandatory for bridges that set the DRM_BRIDGE_OP_HDMI flag in their + * &drm_bridge->ops and advertise HDMI_VERSION_2_0 or later via + * &drm_bridge->supported_hdmi_ver; unused otherwise. + * + * Returns: + * 0 on success, a negative error code otherwise. + */ + int (*hdmi_scrambler_disable)(struct drm_bridge *bridge); + /** * @hdmi_clear_avi_infoframe: * From patchwork Fri Jul 31 16:19:23 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Ciocaltea X-Patchwork-Id: 2863 Return-Path: X-Original-To: noreply@patchwork.local Delivered-To: noreply@patchwork.local Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114]) by mxe881.netcup.net (Postfix) with ESMTPS id 458BE1C22FB for ; Fri, 31 Jul 2026 18:41:06 +0200 (CEST) Authentication-Results: mxe881; dkim=pass header.d=collabora.com; spf=pass (sender IP is 172.105.105.114) smtp.mailfrom=linux-sunxi+bounces-24824-noreply=patchwork.local@lists.linux.dev smtp.helo=tor.lore.kernel.org Received-SPF: pass (mxe881: domain of lists.linux.dev designates 172.105.105.114 as permitted sender) client-ip=172.105.105.114; envelope-from=linux-sunxi+bounces-24824-noreply=patchwork.local@lists.linux.dev; helo=tor.lore.kernel.org; Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by tor.lore.kernel.org (Postfix) with ESMTP id 0338730AF981 for ; Fri, 31 Jul 2026 16:22:25 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A445045A2BD; Fri, 31 Jul 2026 16:19:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="NaZLp4vV" X-Original-To: linux-sunxi@lists.linux.dev Received: from bali.collaboradmins.com (bali.collaboradmins.com [148.251.105.195]) (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 7FFD6449B17 for ; Fri, 31 Jul 2026 16:19:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.251.105.195 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785514783; cv=none; b=DWG6RBcfa99WDCXwfgVOt2Z8Dybep2udk6CQ8PR7WB3NySiU95TK7LjnLTrxNu0xrxD8hcCUlxF0OSNByaBRenAftfDIQxMepSDtNggIh0EkTfk+S4I8nMiP+JjYxLaIs61WTQEkK6eI7LeE078DJ8f3TGaUGlWGuqb2wdUXYL4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785514783; c=relaxed/simple; bh=YSrshcvKlPJVkMkdkCHSWe2+F7O6yThKS89QqJLfJgU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=mw5wPKGXuTJo12D21C8CEwPjaPEnSXLjE2IRfsnhy6eZVXDGvPOkUdtQu5ifo3c7FWZnViuUPUejURgc6bxm2ljBR755eaZ+bKzRPRjTLU6T0khDVntyIIIU9Akx3h0t6GO7pjV37seChlPgnI3Gs4piRYzlXAr9LSj4v4xjl3Y= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=NaZLp4vV; arc=none smtp.client-ip=148.251.105.195 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1785514766; bh=YSrshcvKlPJVkMkdkCHSWe2+F7O6yThKS89QqJLfJgU=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=NaZLp4vVwcpqBh2I//J0jNjl/gaTmNAKo7sXaQXj414VByKEmVIAhGtS2GPGy1krd AJSavfMwpNoNYLrTYVEmsvLUOePL9x4pg4D3r6BMDZT80jRt6sulEtoB8YBRh3+qR1 w50ijZYK4VY88B3gCW0vfp4FZUxYiP+igRBXvl1ktH8ZyBFju5/x0JPTJj7B1asHCy CA//5BAA1DIfVs8h3XOwB6BuTYIyGL0aDiK4bmWjGeCYsfCxcHXuiv6m9Y1yXA4C/B ws1hJntQA9W/hD4xbyht7UejlFYDGVG7bY2nWGtpaSD3nW7nEmD1V8sCSOy7MsFTsE kGy49S8XLqCgQ== Received: from localhost (unknown [100.64.0.241]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange secp256r1 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: cristicc) by bali.collaboradmins.com (Postfix) with ESMTPSA id 464A817E0937; Fri, 31 Jul 2026 18:19:26 +0200 (CEST) From: Cristian Ciocaltea Date: Fri, 31 Jul 2026 19:19:23 +0300 Subject: [PATCH v10 16/69] drm/display: bridge_connector: Use cached connector status in .get_modes() Precedence: bulk X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20260731-dw-hdmi-qp-scramb-v10-16-294364b2cf15@collabora.com> References: <20260731-dw-hdmi-qp-scramb-v10-0-294364b2cf15@collabora.com> In-Reply-To: <20260731-dw-hdmi-qp-scramb-v10-0-294364b2cf15@collabora.com> To: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Luca Ceresoli , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Chen-Yu Tsai , Samuel Holland , Dave Stevenson , =?utf-8?q?Ma=C3=ADra_Canal?= , Raspberry Pi Kernel Maintenance , Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Andy Yan , Algea Cao , Daniel Stone , Liu Ying , Phong LE Cc: kernel@collabora.com, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-rockchip@lists.infradead.org, Dmitry Baryshkov , Maud Spierings , Diederik de Haas X-Mailer: b4 0.15.2 X-Rspamd-Server: rspamd-worker-8404 X-Spamd-Result: default: False [-2.16 / 15.00]; BAYES_HAM(-5.50)[100.00%]; RBL_SENDERSCORE(2.00)[172.105.105.114:from]; SUSPICIOUS_RECIPS(1.50)[]; MAILLIST(-0.15)[generic]; MIME_GOOD(-0.10)[text/plain]; BAD_REP_POLICIES(0.10)[]; HAS_LIST_UNSUB(-0.01)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[qualcomm.com:email,collabora.com:email,collabora.com:dkim,cknow-tech.com:email,tor.lore.kernel.org:rdns,tor.lore.kernel.org:helo]; TAGGED_RCPT(0.00)[]; PRECEDENCE_BULK(0.00)[]; RCPT_COUNT_TWELVE(0.00)[33]; FREEMAIL_CC(0.00)[collabora.com,vger.kernel.org,lists.freedesktop.org,lists.infradead.org,lists.linux.dev,oss.qualcomm.com,hotmail.com,cknow-tech.com]; FROM_HAS_DN(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_COUNT_FIVE(0.00)[5]; R_DKIM_ALLOW(0.00)[collabora.com:s=mail]; FROM_NEQ_ENVFROM(0.00)[cristian.ciocaltea@collabora.com,linux-sunxi@lists.linux.dev]; DMARC_POLICY_ALLOW(0.00)[collabora.com,none]; FREEMAIL_TO(0.00)[intel.com,linaro.org,kernel.org,ideasonboard.com,kwiboo.se,gmail.com,bootlin.com,linux.intel.com,suse.de,ffwll.ch,sholland.org,raspberrypi.com,igalia.com,rock-chips.com,sntech.de,collabora.com,nxp.com,baylibre.com]; DKIM_TRACE(0.00)[collabora.com:+]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(0.00)[+ip4:172.105.105.114:c]; FORGED_SENDER_MAILLIST(0.00)[]; FORGED_RECIPIENTS_MAILLIST(0.00)[]; RCVD_TLS_LAST(0.00)[]; ARC_ALLOW(0.00)[subspace.kernel.org:s=arc-20240116:i=1]; MIME_TRACE(0.00)[0:+]; TAGGED_FROM(0.00)[bounces-24824-noreply=patchwork.local]; ASN(0.00)[asn:63949, ipnet:172.105.96.0/20, country:SG]; RCVD_VIA_SMTP_AUTH(0.00)[] X-Rspamd-Queue-Id: 458BE1C22FB X-MORS-Enabled: yes X-MORS-DOMAIN: patchwork.local X-MORS-HOSTING: hosting172546 X-MORS-USER: hosting172546 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= Replace the active drm_bridge_connector_detect() call in get_modes() with a read of the already-cached connector->status. The .get_modes() callback is only invoked from drm_helper_probe_single_connector_modes(), which has already retrieved the connector status. Calling detect again is redundant and triggers a duplicate hotplug event. This is also a prerequisite for switching to the .detect_ctx() hook, which requires a drm_modeset_acquire_ctx not available in the .get_modes() path. Reviewed-by: Dmitry Baryshkov Tested-by: Maud Spierings Tested-by: Diederik de Haas # NanoPC-T6 LTS, Rock 5B Signed-off-by: Cristian Ciocaltea --- drivers/gpu/drm/display/drm_bridge_connector.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/gpu/drm/display/drm_bridge_connector.c b/drivers/gpu/drm/display/drm_bridge_connector.c index 9ad31e9df0ab..8a833c813101 100644 --- a/drivers/gpu/drm/display/drm_bridge_connector.c +++ b/drivers/gpu/drm/display/drm_bridge_connector.c @@ -325,12 +325,10 @@ static const struct drm_connector_funcs drm_bridge_connector_funcs = { static int drm_bridge_connector_get_modes_edid(struct drm_connector *connector, struct drm_bridge *bridge) { - enum drm_connector_status status; const struct drm_edid *drm_edid; int n; - status = drm_bridge_connector_detect(connector, false); - if (status != connector_status_connected) + if (connector->status != connector_status_connected) goto no_edid; drm_edid = drm_bridge_edid_read(bridge, connector); From patchwork Fri Jul 31 16:19:24 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Ciocaltea X-Patchwork-Id: 2853 Return-Path: X-Original-To: noreply@patchwork.local Delivered-To: noreply@patchwork.local Received: from sin.lore.kernel.org (sin.lore.kernel.org [104.64.211.4]) by mxe881.netcup.net (Postfix) with ESMTPS id EF3EB1C0944 for ; Fri, 31 Jul 2026 18:39:08 +0200 (CEST) Authentication-Results: mxe881; dkim=pass header.d=collabora.com; spf=pass (sender IP is 104.64.211.4) smtp.mailfrom=linux-sunxi+bounces-24827-noreply=patchwork.local@lists.linux.dev smtp.helo=sin.lore.kernel.org Received-SPF: pass (mxe881: domain of lists.linux.dev designates 104.64.211.4 as permitted sender) client-ip=104.64.211.4; envelope-from=linux-sunxi+bounces-24827-noreply=patchwork.local@lists.linux.dev; helo=sin.lore.kernel.org; Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by sin.lore.kernel.org (Postfix) with ESMTP id DF7333041F8C for ; Fri, 31 Jul 2026 16:22:51 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DDE0645DF65; Fri, 31 Jul 2026 16:19:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="NQ9nSGUD" X-Original-To: linux-sunxi@lists.linux.dev Received: from bali.collaboradmins.com (bali.collaboradmins.com [148.251.105.195]) (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 B6CCA456295 for ; Fri, 31 Jul 2026 16:19:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.251.105.195 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785514785; cv=none; b=V5MlHSkSS8Mv9tcc4doXRaAoGsoHvpNbzI8HHqk0PqY/e79WhDdVspVFYN6F4BSuvoAtADtWeRCMe0ltnLAAGYnl2XG08OiFWDiRASTFT2/B1dYobkmxaeMK2SrOODMuie2W9e3kshFM6aHx04/5s0WLBb9dh65PbOh3b/Fp7xo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785514785; c=relaxed/simple; bh=FOscVPxk5ijAnlxV+5EsB7BXSUeJJTBPUJmcKia0yJ8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=g0hNjFEt+on4qtKBtn7r5KP3xtles3CpCHBIgr6T+0qjbuupg8B68pAc5RYU3s/J539KLtg52xunIdQMaZARNwld4WWJsRWJFArIbca0wwBt9ln+N/2K9TiUEDxS26yUTLrj12l+g2qOl8rVZL9J8wMakEZIdgKVOLmL6e7Ht/k= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=NQ9nSGUD; arc=none smtp.client-ip=148.251.105.195 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1785514767; bh=FOscVPxk5ijAnlxV+5EsB7BXSUeJJTBPUJmcKia0yJ8=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=NQ9nSGUD7UgVYTX5BBZ4WhnZSxV3/eyhgx/jT9IjI8U2cRjjK1cjxbDfNzPGS1uJJ g0gsUsnbjkrK+EE5FdZ8BAGORiaLyxhKGzoCTZZPnNPa00+TJm5vJYjIbp/xgujVzu DkUbovcBVdGY70kYqqhoXN2wp8sgNDtYesg4eUCqZnDaprE8FF37/55aBV1kuuwK4I PdNKPyTGKqwBOSv1vjwf8V0O9uL0QC9soUiqsX3YrbL0A/luus0n2p4vc9zLN8hccQ n6NgdIcc2rNDaU+1AmoklXfOWXlYCvlNmlCQqJjnF3VzoXVDZd5cNJuCCo2pvS6klA iE55ANZhiD7nA== Received: from localhost (unknown [100.64.0.241]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange secp256r1 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: cristicc) by bali.collaboradmins.com (Postfix) with ESMTPSA id F1ADD17E0682; Fri, 31 Jul 2026 18:19:26 +0200 (CEST) From: Cristian Ciocaltea Date: Fri, 31 Jul 2026 19:19:24 +0300 Subject: [PATCH v10 17/69] drm/display: bridge_connector: Switch to .detect_ctx() connector helper Precedence: bulk X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20260731-dw-hdmi-qp-scramb-v10-17-294364b2cf15@collabora.com> References: <20260731-dw-hdmi-qp-scramb-v10-0-294364b2cf15@collabora.com> In-Reply-To: <20260731-dw-hdmi-qp-scramb-v10-0-294364b2cf15@collabora.com> To: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Luca Ceresoli , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Chen-Yu Tsai , Samuel Holland , Dave Stevenson , =?utf-8?q?Ma=C3=ADra_Canal?= , Raspberry Pi Kernel Maintenance , Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Andy Yan , Algea Cao , Daniel Stone , Liu Ying , Phong LE Cc: kernel@collabora.com, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-rockchip@lists.infradead.org, Dmitry Baryshkov , Maud Spierings , Diederik de Haas X-Mailer: b4 0.15.2 X-Rspamd-Server: rspamd-worker-8404 X-Spamd-Result: default: False [-2.16 / 15.00]; BAYES_HAM(-5.50)[100.00%]; RBL_SENDERSCORE(2.00)[104.64.211.4:from]; SUSPICIOUS_RECIPS(1.50)[]; MAILLIST(-0.15)[generic]; MIME_GOOD(-0.10)[text/plain]; BAD_REP_POLICIES(0.10)[]; HAS_LIST_UNSUB(-0.01)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[sin.lore.kernel.org:rdns,sin.lore.kernel.org:helo,cknow-tech.com:email,collabora.com:email,collabora.com:dkim,qualcomm.com:email]; TAGGED_RCPT(0.00)[]; PRECEDENCE_BULK(0.00)[]; RCPT_COUNT_TWELVE(0.00)[33]; FREEMAIL_CC(0.00)[collabora.com,vger.kernel.org,lists.freedesktop.org,lists.infradead.org,lists.linux.dev,oss.qualcomm.com,hotmail.com,cknow-tech.com]; FROM_HAS_DN(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_COUNT_FIVE(0.00)[5]; R_DKIM_ALLOW(0.00)[collabora.com:s=mail]; FROM_NEQ_ENVFROM(0.00)[cristian.ciocaltea@collabora.com,linux-sunxi@lists.linux.dev]; DMARC_POLICY_ALLOW(0.00)[collabora.com,none]; FREEMAIL_TO(0.00)[intel.com,linaro.org,kernel.org,ideasonboard.com,kwiboo.se,gmail.com,bootlin.com,linux.intel.com,suse.de,ffwll.ch,sholland.org,raspberrypi.com,igalia.com,rock-chips.com,sntech.de,collabora.com,nxp.com,baylibre.com]; DKIM_TRACE(0.00)[collabora.com:+]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(0.00)[+ip4:104.64.211.4:c]; FORGED_SENDER_MAILLIST(0.00)[]; FORGED_RECIPIENTS_MAILLIST(0.00)[]; RCVD_TLS_LAST(0.00)[]; ARC_ALLOW(0.00)[subspace.kernel.org:s=arc-20240116:i=1]; MIME_TRACE(0.00)[0:+]; TAGGED_FROM(0.00)[bounces-24827-noreply=patchwork.local]; ASN(0.00)[asn:63949, ipnet:104.64.192.0/19, country:SG]; RCVD_VIA_SMTP_AUTH(0.00)[] X-Rspamd-Queue-Id: EF3EB1C0944 X-MORS-Enabled: yes X-MORS-DOMAIN: patchwork.local X-MORS-HOSTING: hosting172546 X-MORS-USER: hosting172546 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= Replace the .detect() connector_funcs callback with the atomic-aware .detect_ctx() connector_helper_funcs hook. This is preparatory work to allow propagating the modeset acquire context through drm_atomic_helper_connector_hdmi_hotplug() to the HDMI connector framework, enabling SCDC state recovery via CRTC reset when the sink reconnects during an active display pipeline. Reviewed-by: Dmitry Baryshkov Tested-by: Maud Spierings Tested-by: Diederik de Haas # NanoPC-T6 LTS, Rock 5B Signed-off-by: Cristian Ciocaltea --- drivers/gpu/drm/display/drm_bridge_connector.c | 69 +++++++++++++------------- 1 file changed, 35 insertions(+), 34 deletions(-) diff --git a/drivers/gpu/drm/display/drm_bridge_connector.c b/drivers/gpu/drm/display/drm_bridge_connector.c index 8a833c813101..0d44a270b636 100644 --- a/drivers/gpu/drm/display/drm_bridge_connector.c +++ b/drivers/gpu/drm/display/drm_bridge_connector.c @@ -208,39 +208,6 @@ static void drm_bridge_connector_disable_hpd(struct drm_connector *connector) * Bridge Connector Functions */ -static enum drm_connector_status -drm_bridge_connector_detect(struct drm_connector *connector, bool force) -{ - struct drm_bridge_connector *bridge_connector = - to_drm_bridge_connector(connector); - struct drm_bridge *detect = bridge_connector->bridge_detect; - struct drm_bridge *hdmi = bridge_connector->bridge_hdmi; - enum drm_connector_status status; - - if (detect) { - status = detect->funcs->detect(detect, connector); - - if (hdmi) - drm_atomic_helper_connector_hdmi_hotplug(connector, status); - - drm_bridge_connector_hpd_notify(connector, status); - } else { - switch (connector->connector_type) { - case DRM_MODE_CONNECTOR_DPI: - case DRM_MODE_CONNECTOR_LVDS: - case DRM_MODE_CONNECTOR_DSI: - case DRM_MODE_CONNECTOR_eDP: - status = connector_status_connected; - break; - default: - status = connector_status_unknown; - break; - } - } - - return status; -} - static void drm_bridge_connector_force(struct drm_connector *connector) { struct drm_bridge_connector *bridge_connector = @@ -307,7 +274,6 @@ drm_bridge_connector_color_format(const struct drm_connector_state *conn_state) } static const struct drm_connector_funcs drm_bridge_connector_funcs = { - .detect = drm_bridge_connector_detect, .force = drm_bridge_connector_force, .fill_modes = drm_helper_probe_single_connector_modes, .atomic_create_state = drm_bridge_connector_create_state, @@ -322,6 +288,40 @@ static const struct drm_connector_funcs drm_bridge_connector_funcs = { * Bridge Connector Helper Functions */ +static int drm_bridge_connector_detect_ctx(struct drm_connector *connector, + struct drm_modeset_acquire_ctx *ctx, + bool force) +{ + struct drm_bridge_connector *bridge_connector = + to_drm_bridge_connector(connector); + struct drm_bridge *detect = bridge_connector->bridge_detect; + struct drm_bridge *hdmi = bridge_connector->bridge_hdmi; + enum drm_connector_status status; + + if (detect) { + status = detect->funcs->detect(detect, connector); + + if (hdmi) + drm_atomic_helper_connector_hdmi_hotplug(connector, status); + + drm_bridge_connector_hpd_notify(connector, status); + } else { + switch (connector->connector_type) { + case DRM_MODE_CONNECTOR_DPI: + case DRM_MODE_CONNECTOR_LVDS: + case DRM_MODE_CONNECTOR_DSI: + case DRM_MODE_CONNECTOR_eDP: + status = connector_status_connected; + break; + default: + status = connector_status_unknown; + break; + } + } + + return status; +} + static int drm_bridge_connector_get_modes_edid(struct drm_connector *connector, struct drm_bridge *bridge) { @@ -413,6 +413,7 @@ static int drm_bridge_connector_atomic_check(struct drm_connector *connector, static const struct drm_connector_helper_funcs drm_bridge_connector_helper_funcs = { .get_modes = drm_bridge_connector_get_modes, + .detect_ctx = drm_bridge_connector_detect_ctx, .mode_valid = drm_bridge_connector_mode_valid, .enable_hpd = drm_bridge_connector_enable_hpd, .disable_hpd = drm_bridge_connector_disable_hpd, From patchwork Fri Jul 31 16:19:25 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Ciocaltea X-Patchwork-Id: 2823 Return-Path: X-Original-To: noreply@patchwork.local Delivered-To: noreply@patchwork.local Received: from sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74]) by mxe881.netcup.net (Postfix) with ESMTPS id 7E6331C1D58 for ; Fri, 31 Jul 2026 18:32:01 +0200 (CEST) Authentication-Results: mxe881; dkim=pass header.d=collabora.com; spf=pass (sender IP is 172.232.135.74) smtp.mailfrom=linux-sunxi+bounces-24819-noreply=patchwork.local@lists.linux.dev smtp.helo=sto.lore.kernel.org Received-SPF: pass (mxe881: domain of lists.linux.dev designates 172.232.135.74 as permitted sender) client-ip=172.232.135.74; envelope-from=linux-sunxi+bounces-24819-noreply=patchwork.local@lists.linux.dev; helo=sto.lore.kernel.org; Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by sto.lore.kernel.org (Postfix) with ESMTP id 6B3E530A6802 for ; Fri, 31 Jul 2026 16:21:54 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0975544D035; Fri, 31 Jul 2026 16:19:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="pjkxXoRU" X-Original-To: linux-sunxi@lists.linux.dev Received: from bali.collaboradmins.com (bali.collaboradmins.com [148.251.105.195]) (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 90AB34519AD for ; Fri, 31 Jul 2026 16:19:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.251.105.195 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785514780; cv=none; b=GNW9H0rqIUnxKqOdlOFPpGe6Xx09u7R2PjUvjczbzFjRIV6Ns12jwarzeEh7MHtBX3UuoVv+9xkY8fVKsis+wn9h12KzcfTAXxlQHnCYLEJMOTcmoFOsSVUwZpohQP2jfQqe45RT3+euwuaPCnW3K3bthKosz0Fq+IJKxfnvyxs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785514780; c=relaxed/simple; bh=/TKBya/JRolWMqyMoq59j0Jgp+DNbAGSUTJj0kIybwo=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=SN6dQHF9/z9KKCv5hOdHUAI3zndMusAeYLIg8uLpQ7poaGz+cCgaeiqhiW23qIo0Cvhl18wLf7HQGLAi2fzhcTser9n/An+VubYVyvltUICrBjwKdcwDWoHaAlqyc5bJEc+JeLbwv3NtAGgJZANJ3TBv06CzZf0e3k60FJSAWdg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=pjkxXoRU; arc=none smtp.client-ip=148.251.105.195 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1785514767; bh=/TKBya/JRolWMqyMoq59j0Jgp+DNbAGSUTJj0kIybwo=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=pjkxXoRUML7OflI1VWYB4yh2ZD1+v//L/vm+F599mt2GJb8l5kypciiwowIDJvJoh yB266LaFP21ZV119m/yqpOhr244odPvxfcgPTmSfd82hehoOkrP412Y+SKKIxEVf08 QuCqxjEhBqAzPM2q4SV+QPnauZ8uo/lSROZloowftk7eVORduw7lvhpZDVqAuIGwfI KH0VJur2+v7X7J/5etJCDOM9C4CFdmndp5F/BrteWZr/OH1SZKtGM2rsfSalheiVqP yASK47x4eusofxz60dvb3Ixt8Z3WkNu1soIjZHtU7NSCsdNe0v2RBRYdc+nNMXE0JS BSGRLbgbCamvw== Received: from localhost (unknown [100.64.0.241]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange secp256r1 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: cristicc) by bali.collaboradmins.com (Postfix) with ESMTPSA id AB58C17E093D; Fri, 31 Jul 2026 18:19:27 +0200 (CEST) From: Cristian Ciocaltea Date: Fri, 31 Jul 2026 19:19:25 +0300 Subject: [PATCH v10 18/69] drm/display: bridge_connector: Switch to .force_ctx() connector helper Precedence: bulk X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20260731-dw-hdmi-qp-scramb-v10-18-294364b2cf15@collabora.com> References: <20260731-dw-hdmi-qp-scramb-v10-0-294364b2cf15@collabora.com> In-Reply-To: <20260731-dw-hdmi-qp-scramb-v10-0-294364b2cf15@collabora.com> To: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Luca Ceresoli , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Chen-Yu Tsai , Samuel Holland , Dave Stevenson , =?utf-8?q?Ma=C3=ADra_Canal?= , Raspberry Pi Kernel Maintenance , Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Andy Yan , Algea Cao , Daniel Stone , Liu Ying , Phong LE Cc: kernel@collabora.com, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-rockchip@lists.infradead.org X-Mailer: b4 0.15.2 X-MORS-Enabled: yes X-MORS-DOMAIN: patchwork.local X-MORS-HOSTING: hosting172546 X-MORS-USER: hosting172546 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= Turn drm_bridge_connector_force() into a .force_ctx() implementation and hand the acquire context over to drm_atomic_helper_connector_hdmi_force_ctx(), so that the HDMI connector framework can reset the CRTC to recover the SCDC state when the sink reconnects while the display pipeline is active. No functional change for non-HDMI bridge connectors, which keep behaving as a no-op. Signed-off-by: Cristian Ciocaltea --- drivers/gpu/drm/display/drm_bridge_connector.c | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/drivers/gpu/drm/display/drm_bridge_connector.c b/drivers/gpu/drm/display/drm_bridge_connector.c index 0d44a270b636..86353a0b9758 100644 --- a/drivers/gpu/drm/display/drm_bridge_connector.c +++ b/drivers/gpu/drm/display/drm_bridge_connector.c @@ -208,16 +208,6 @@ static void drm_bridge_connector_disable_hpd(struct drm_connector *connector) * Bridge Connector Functions */ -static void drm_bridge_connector_force(struct drm_connector *connector) -{ - struct drm_bridge_connector *bridge_connector = - to_drm_bridge_connector(connector); - struct drm_bridge *hdmi = bridge_connector->bridge_hdmi; - - if (hdmi) - drm_atomic_helper_connector_hdmi_force(connector); -} - static void drm_bridge_connector_debugfs_init(struct drm_connector *connector, struct dentry *root) { @@ -274,7 +264,6 @@ drm_bridge_connector_color_format(const struct drm_connector_state *conn_state) } static const struct drm_connector_funcs drm_bridge_connector_funcs = { - .force = drm_bridge_connector_force, .fill_modes = drm_helper_probe_single_connector_modes, .atomic_create_state = drm_bridge_connector_create_state, .atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state, @@ -322,6 +311,19 @@ static int drm_bridge_connector_detect_ctx(struct drm_connector *connector, return status; } +static int drm_bridge_connector_force_ctx(struct drm_connector *connector, + struct drm_modeset_acquire_ctx *ctx) +{ + struct drm_bridge_connector *bridge_connector = + to_drm_bridge_connector(connector); + struct drm_bridge *hdmi = bridge_connector->bridge_hdmi; + + if (hdmi) + return drm_atomic_helper_connector_hdmi_force_ctx(connector, ctx); + + return 0; +} + static int drm_bridge_connector_get_modes_edid(struct drm_connector *connector, struct drm_bridge *bridge) { @@ -414,6 +416,7 @@ static int drm_bridge_connector_atomic_check(struct drm_connector *connector, static const struct drm_connector_helper_funcs drm_bridge_connector_helper_funcs = { .get_modes = drm_bridge_connector_get_modes, .detect_ctx = drm_bridge_connector_detect_ctx, + .force_ctx = drm_bridge_connector_force_ctx, .mode_valid = drm_bridge_connector_mode_valid, .enable_hpd = drm_bridge_connector_enable_hpd, .disable_hpd = drm_bridge_connector_disable_hpd, From patchwork Fri Jul 31 16:19:26 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Ciocaltea X-Patchwork-Id: 2877 Return-Path: X-Original-To: noreply@patchwork.local Delivered-To: noreply@patchwork.local Received: from sin.lore.kernel.org (sin.lore.kernel.org [104.64.211.4]) by mxe881.netcup.net (Postfix) with ESMTPS id 27C011C0256 for ; Fri, 31 Jul 2026 19:01:50 +0200 (CEST) Authentication-Results: mxe881; dkim=pass header.d=collabora.com; spf=pass (sender IP is 104.64.211.4) smtp.mailfrom=linux-sunxi+bounces-24818-noreply=patchwork.local@lists.linux.dev smtp.helo=sin.lore.kernel.org Received-SPF: pass (mxe881: domain of lists.linux.dev designates 104.64.211.4 as permitted sender) client-ip=104.64.211.4; envelope-from=linux-sunxi+bounces-24818-noreply=patchwork.local@lists.linux.dev; helo=sin.lore.kernel.org; Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by sin.lore.kernel.org (Postfix) with ESMTP id B10A43012CF6 for ; Fri, 31 Jul 2026 16:21:41 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A3E0F456DE4; Fri, 31 Jul 2026 16:19:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="REUAeMTh" X-Original-To: linux-sunxi@lists.linux.dev Received: from bali.collaboradmins.com (bali.collaboradmins.com [148.251.105.195]) (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 84498451986 for ; Fri, 31 Jul 2026 16:19:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.251.105.195 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785514779; cv=none; b=agWGS05iSbX15qOETtx5jOVbbBhfcLC3gP1J+ASxqvFwpGrmOgWX+jYE5/2qmDkn2aLqcGZtvSWE9zMtRLOPGpRWeQWdJsBIu/AOxvZiBCbXvRkuvlCRXXZeaHEGZiUj7R6r6Bz3oghpGc/axVTa33aURAnXkB1fD4euFfew26o= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785514779; c=relaxed/simple; bh=8K2UYBSnPY80dXtzmdVQyx34GOgVTImDqKMUj0/HGi8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=LgALTiQcn+1pNKK43HN9zVs1D5sNBiGNagjfWhGOD7AfkN/dzqpw+dZB/1Z+rEUcbeUfanmGXowZStZXcEQ/Kn6G/bL1IweOTYCQi9GLz5niEQJZY6mgi9dSVoIlEyQ0Ez693ORkfWVogv98qZdor6KRMiMxRFxNmaP/f2Vaq+Y= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=REUAeMTh; arc=none smtp.client-ip=148.251.105.195 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1785514768; bh=8K2UYBSnPY80dXtzmdVQyx34GOgVTImDqKMUj0/HGi8=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=REUAeMThoT68dG+Q98yoiSGipFezFqECWE8iq7EJU3ol2V9enQrOT9LJZY3iLtqjs P0lr1v8P1r9WPY0z9wQkIj+PuDp524Fj6y+P+ETd2eVMvbcTHwMRFcKKuHGt3lw9Nm 71TRVZS8ca6tZiX/r9QeAST+XKrTMhJauD1yWbZXQeSBu+EsCNnzA5Yl9ebcz2tZ50 AqeXzk6NMK98y77DUAoW8HJeGA6iXtUZODt4SuYpCoAKQvfhGIjWm79R2F4bWhIbzd 7WQqPi/WqyDenf3TkKOHusCB7nSPvF1CT+oy6wawlsejO9DiYdd2gYIWJWseMh2bMU m0r1QmfRVkjBw== Received: from localhost (unknown [100.64.0.241]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange secp256r1 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: cristicc) by bali.collaboradmins.com (Postfix) with ESMTPSA id 6801517E093E; Fri, 31 Jul 2026 18:19:28 +0200 (CEST) From: Cristian Ciocaltea Date: Fri, 31 Jul 2026 19:19:26 +0300 Subject: [PATCH v10 19/69] drm/display: bridge_connector: Wire up HDMI 2.0 scrambler callbacks Precedence: bulk X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20260731-dw-hdmi-qp-scramb-v10-19-294364b2cf15@collabora.com> References: <20260731-dw-hdmi-qp-scramb-v10-0-294364b2cf15@collabora.com> In-Reply-To: <20260731-dw-hdmi-qp-scramb-v10-0-294364b2cf15@collabora.com> To: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Luca Ceresoli , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Chen-Yu Tsai , Samuel Holland , Dave Stevenson , =?utf-8?q?Ma=C3=ADra_Canal?= , Raspberry Pi Kernel Maintenance , Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Andy Yan , Algea Cao , Daniel Stone , Liu Ying , Phong LE Cc: kernel@collabora.com, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-rockchip@lists.infradead.org, Maud Spierings , Diederik de Haas X-Mailer: b4 0.15.2 X-Rspamd-Server: rspamd-worker-8404 X-Spamd-Result: default: False [-2.16 / 15.00]; BAYES_HAM(-5.50)[100.00%]; RBL_SENDERSCORE(2.00)[104.64.211.4:from]; SUSPICIOUS_RECIPS(1.50)[]; MAILLIST(-0.15)[generic]; MIME_GOOD(-0.10)[text/plain]; BAD_REP_POLICIES(0.10)[]; HAS_LIST_UNSUB(-0.01)[]; ARC_ALLOW(0.00)[subspace.kernel.org:s=arc-20240116:i=1]; PRECEDENCE_BULK(0.00)[]; TAGGED_RCPT(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[cknow-tech.com:email,sin.lore.kernel.org:rdns,sin.lore.kernel.org:helo,collabora.com:email,collabora.com:dkim]; FROM_HAS_DN(0.00)[]; FREEMAIL_CC(0.00)[collabora.com,vger.kernel.org,lists.freedesktop.org,lists.infradead.org,lists.linux.dev,hotmail.com,cknow-tech.com]; RCPT_COUNT_TWELVE(0.00)[32]; R_DKIM_ALLOW(0.00)[collabora.com:s=mail]; RCVD_COUNT_FIVE(0.00)[5]; FROM_NEQ_ENVFROM(0.00)[cristian.ciocaltea@collabora.com,linux-sunxi@lists.linux.dev]; DMARC_POLICY_ALLOW(0.00)[collabora.com,none]; FREEMAIL_TO(0.00)[intel.com,linaro.org,kernel.org,ideasonboard.com,kwiboo.se,gmail.com,bootlin.com,linux.intel.com,suse.de,ffwll.ch,sholland.org,raspberrypi.com,igalia.com,rock-chips.com,sntech.de,collabora.com,nxp.com,baylibre.com]; DKIM_TRACE(0.00)[collabora.com:+]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(0.00)[+ip4:104.64.211.4]; FORGED_SENDER_MAILLIST(0.00)[]; FORGED_RECIPIENTS_MAILLIST(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:63949, ipnet:104.64.192.0/19, country:SG]; MIME_TRACE(0.00)[0:+]; TAGGED_FROM(0.00)[bounces-24818-noreply=patchwork.local]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[] X-Rspamd-Queue-Id: 27C011C0256 X-MORS-Enabled: yes X-MORS-DOMAIN: patchwork.local X-MORS-HOSTING: hosting172546 X-MORS-USER: hosting172546 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= Connect the bridge connector's .scrambler_{enable|disable} callbacks to the underlying bridge's .hdmi_scrambler_{enable|disable} funcs when HDMI 2.0 conformance is advertised. This completes the bridge connector plumbing so that the SCDC scrambling helpers can control source-side scrambling through the bridge chain. Tested-by: Maud Spierings Tested-by: Diederik de Haas # NanoPC-T6 LTS, Rock 5B Signed-off-by: Cristian Ciocaltea Reviewed-by: Maxime Ripard --- drivers/gpu/drm/display/drm_bridge_connector.c | 40 +++++++++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/display/drm_bridge_connector.c b/drivers/gpu/drm/display/drm_bridge_connector.c index 86353a0b9758..80b33d4f6b38 100644 --- a/drivers/gpu/drm/display/drm_bridge_connector.c +++ b/drivers/gpu/drm/display/drm_bridge_connector.c @@ -577,6 +577,32 @@ static int drm_bridge_connector_write_spd_infoframe(struct drm_connector *connec return bridge->funcs->hdmi_write_spd_infoframe(bridge, buffer, len); } +static int drm_bridge_connector_scrambler_enable(struct drm_connector *connector) +{ + struct drm_bridge_connector *bridge_connector = + to_drm_bridge_connector(connector); + struct drm_bridge *bridge; + + bridge = bridge_connector->bridge_hdmi; + if (!bridge) + return -EINVAL; + + return bridge->funcs->hdmi_scrambler_enable(bridge); +} + +static int drm_bridge_connector_scrambler_disable(struct drm_connector *connector) +{ + struct drm_bridge_connector *bridge_connector = + to_drm_bridge_connector(connector); + struct drm_bridge *bridge; + + bridge = bridge_connector->bridge_hdmi; + if (!bridge) + return -EINVAL; + + return bridge->funcs->hdmi_scrambler_disable(bridge); +} + static const struct drm_edid * drm_bridge_connector_read_edid(struct drm_connector *connector) { @@ -604,7 +630,7 @@ static const struct drm_connector_hdmi_funcs drm_bridge_connector_hdmi_funcs = { .clear_infoframe = drm_bridge_connector_clear_hdmi_infoframe, .write_infoframe = drm_bridge_connector_write_hdmi_infoframe, }, - /* audio, hdr_drm and spd are set dynamically during init */ + /* scrambler, audio, hdr_drm and spd are set dynamically during init */ }; static const struct drm_connector_infoframe_funcs drm_bridge_connector_hdmi_audio_infoframe = { @@ -908,6 +934,11 @@ struct drm_connector *drm_bridge_connector_init(struct drm_device *drm, !bridge->funcs->hdmi_clear_spd_infoframe)) return ERR_PTR(-EINVAL); + if (bridge->supported_hdmi_ver >= HDMI_VERSION_2_0 && + (!bridge->funcs->hdmi_scrambler_enable || + !bridge->funcs->hdmi_scrambler_disable)) + return ERR_PTR(-EINVAL); + bridge_connector->bridge_hdmi = drm_bridge_get(bridge); } @@ -1027,6 +1058,13 @@ struct drm_connector *drm_bridge_connector_init(struct drm_device *drm, bridge_connector->hdmi_funcs.spd = drm_bridge_connector_hdmi_spd_infoframe; + if (bridge_connector->bridge_hdmi->supported_hdmi_ver >= HDMI_VERSION_2_0) { + bridge_connector->hdmi_funcs.scrambler_enable = + drm_bridge_connector_scrambler_enable; + bridge_connector->hdmi_funcs.scrambler_disable = + drm_bridge_connector_scrambler_disable; + } + ret = drmm_connector_hdmi_init(drm, connector, &drm_bridge_connector_funcs, &bridge_connector->hdmi_funcs, From patchwork Fri Jul 31 16:19:27 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Ciocaltea X-Patchwork-Id: 2819 Return-Path: X-Original-To: noreply@patchwork.local Delivered-To: noreply@patchwork.local Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114]) by mxe881.netcup.net (Postfix) with ESMTPS id 531611C0254 for ; Fri, 31 Jul 2026 18:30:53 +0200 (CEST) Authentication-Results: mxe881; dkim=pass header.d=collabora.com; spf=pass (sender IP is 172.105.105.114) smtp.mailfrom=linux-sunxi+bounces-24820-noreply=patchwork.local@lists.linux.dev smtp.helo=tor.lore.kernel.org Received-SPF: pass (mxe881: domain of lists.linux.dev designates 172.105.105.114 as permitted sender) client-ip=172.105.105.114; envelope-from=linux-sunxi+bounces-24820-noreply=patchwork.local@lists.linux.dev; helo=tor.lore.kernel.org; Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by tor.lore.kernel.org (Postfix) with ESMTP id B6F203138D2D for ; Fri, 31 Jul 2026 16:21:51 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A8FA54570CC; Fri, 31 Jul 2026 16:19:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="Nx3zp4QP" X-Original-To: linux-sunxi@lists.linux.dev Received: from bali.collaboradmins.com (bali.collaboradmins.com [148.251.105.195]) (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 8F878451998 for ; Fri, 31 Jul 2026 16:19:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.251.105.195 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785514780; cv=none; b=JHCG9pt1BqoVDgduwQjqLe1aive7fTWnBsEyRQaoDksh3Z0PECBaM8cV/H0Juq2LYeyv4FtdP3WKfDpBZDvTKNoqxYXDuJPFXwgGAbeSOTK3MX6mTR+AORSPHrSDmSoW75p24xsltauyg/8OnjsTds/4A1JiOELPGpWxtMCPnao= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785514780; c=relaxed/simple; bh=/yiHYpv6JDAP8TqmgFqNkriKXPlZVLMG1+AZdUe8aaI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=SAXyroLh6q9WJjZrudvamNLNlyncE65wMh+FjyTd9yqmWL8PihGaHw6mOaL3bvzdDWTOnzEHh7LNWZrUiyJQ/U7vOM2hh6ASt2PD3rSXVZZcmuJD8DOPM0bnqYsjTFFulegPG9/QxCHOHyj+litlOfZ8/fHiKkxW3KVz7ugDybs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=Nx3zp4QP; arc=none smtp.client-ip=148.251.105.195 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1785514769; bh=/yiHYpv6JDAP8TqmgFqNkriKXPlZVLMG1+AZdUe8aaI=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=Nx3zp4QP1XWq1RhdyKxkJGxDjKSAnScsdyLyY/Ejw8Maix9gxRsKZmnBh48DMaOk8 Dc8B/0q2srvMM6Vb9cuztdMcU0TndG/ZwvQrn3f7BabQcibqis3G0Z5OFrTgGnHEDp 6g7rAhRyZNC7Hn3BSpy9O50UHugX5cNaCSHEMn3q8m2Ema5cSwb3z/M8aW47RKvGJD z926IbktF3gvsVSniXa5qoJLtyHVqYc73Bu0yP50EN4pPxa+4xvCnGm3KoBa0/iBxw FviX8yaiIpnynaWY+ncL+ofGGpKjGi0cC64I2V8wg7+9f8uVXAWGz9LSxL7NkVtCxE yEOaibzjaAsMg== Received: from localhost (unknown [100.64.0.241]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange secp256r1 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: cristicc) by bali.collaboradmins.com (Postfix) with ESMTPSA id 2A77117E0943; Fri, 31 Jul 2026 18:19:29 +0200 (CEST) From: Cristian Ciocaltea Date: Fri, 31 Jul 2026 19:19:27 +0300 Subject: [PATCH v10 20/69] drm/display: hdmi-state-helper: Add source TMDS rate validation Precedence: bulk X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20260731-dw-hdmi-qp-scramb-v10-20-294364b2cf15@collabora.com> References: <20260731-dw-hdmi-qp-scramb-v10-0-294364b2cf15@collabora.com> In-Reply-To: <20260731-dw-hdmi-qp-scramb-v10-0-294364b2cf15@collabora.com> To: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Luca Ceresoli , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Chen-Yu Tsai , Samuel Holland , Dave Stevenson , =?utf-8?q?Ma=C3=ADra_Canal?= , Raspberry Pi Kernel Maintenance , Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Andy Yan , Algea Cao , Daniel Stone , Liu Ying , Phong LE Cc: kernel@collabora.com, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-rockchip@lists.infradead.org, Maud Spierings , Diederik de Haas X-Mailer: b4 0.15.2 X-MORS-Enabled: yes X-MORS-DOMAIN: patchwork.local X-MORS-HOSTING: hosting172546 X-MORS-USER: hosting172546 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= Validate the computed TMDS character rate against connector->hdmi.max_tmds_char_rate, when provided by the driver/source. This gives HDMI connectors common support for rejecting modes whose TMDS character rate exceeds the source supported limit, while still allowing drivers with custom validation requirements to implement their own tmds_char_rate_valid() callback. Tested-by: Maud Spierings Tested-by: Diederik de Haas # NanoPC-T6 LTS, Rock 5B Signed-off-by: Cristian Ciocaltea Reviewed-by: Maxime Ripard --- drivers/gpu/drm/display/drm_hdmi_state_helper.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/gpu/drm/display/drm_hdmi_state_helper.c b/drivers/gpu/drm/display/drm_hdmi_state_helper.c index ce17eeefc2da..92be6278ea44 100644 --- a/drivers/gpu/drm/display/drm_hdmi_state_helper.c +++ b/drivers/gpu/drm/display/drm_hdmi_state_helper.c @@ -560,6 +560,10 @@ hdmi_clock_valid(const struct drm_connector *connector, if (info->max_tmds_clock && clock > info->max_tmds_clock * 1000) return MODE_CLOCK_HIGH; + if (connector->hdmi.max_tmds_char_rate && + clock > connector->hdmi.max_tmds_char_rate) + return MODE_CLOCK_HIGH; + if (funcs && funcs->tmds_char_rate_valid) { enum drm_mode_status status; From patchwork Fri Jul 31 16:19:28 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Ciocaltea X-Patchwork-Id: 2816 Return-Path: X-Original-To: noreply@patchwork.local Delivered-To: noreply@patchwork.local Received: from sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74]) by mxe881.netcup.net (Postfix) with ESMTPS id 25BCB1C0254 for ; Fri, 31 Jul 2026 18:29:03 +0200 (CEST) Authentication-Results: mxe881; dkim=pass header.d=collabora.com; spf=pass (sender IP is 172.232.135.74) smtp.mailfrom=linux-sunxi+bounces-24817-noreply=patchwork.local@lists.linux.dev smtp.helo=sto.lore.kernel.org Received-SPF: pass (mxe881: domain of lists.linux.dev designates 172.232.135.74 as permitted sender) client-ip=172.232.135.74; envelope-from=linux-sunxi+bounces-24817-noreply=patchwork.local@lists.linux.dev; helo=sto.lore.kernel.org; Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by sto.lore.kernel.org (Postfix) with ESMTP id B037E30A555C for ; Fri, 31 Jul 2026 16:21:43 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9CE124562AF; Fri, 31 Jul 2026 16:19:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="ku3bQHkY" X-Original-To: linux-sunxi@lists.linux.dev Received: from bali.collaboradmins.com (bali.collaboradmins.com [148.251.105.195]) (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 BE0F244CF34 for ; Fri, 31 Jul 2026 16:19:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.251.105.195 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785514778; cv=none; b=HBxYUpzC58fJc5/P4gOp7AfvljA71s9a0xI5/fJ7Kn309Jtl3nCt5QzmY6F4yEKiwZkvZrTu5JplO0z/kNSA6T8ugSwN0qQvrJsMFF84a+hWOyshoUtkxYUje3QlZiGh/RjWP4Eo2PrzImGMMwQPnPjQBJ2Io3MzuvY4kaW36LQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785514778; c=relaxed/simple; bh=YrLuithMFkLDAjThMfMTDpP5bdJo0erAdpeO29hYvF4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=GSASzciVD5g1M8AVTpgBeMNc/T4j2cq0gMA3rEbtwOhWRPNq0RhjQpqURTMKJU6+PkXaoop6sveIeZW/UFFq2GyBBWVZJiOn2vq1cMxqz8QCqJX4vah7NcR6uDKXoCvXeNlSi4Kx0RRfYkGVRL7jLRGq1nYBLRevJ8k/7YQ70GY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=ku3bQHkY; arc=none smtp.client-ip=148.251.105.195 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1785514770; bh=YrLuithMFkLDAjThMfMTDpP5bdJo0erAdpeO29hYvF4=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=ku3bQHkYSrt0LYc9m+gpk2ZS3I4kRzbsdeHbu+38zF3JW1JyRnR47C8+zPO9gb0k3 Jx6QhvvTrtW9GxplaQPjV6xi6MTvc+wxbTqB9TbT2t8t+g4770RJQJ0gC1Qxb0LR+1 6Z+UjnsN7YibLXqGRMtDF/zINxGnyh5ABGsuqEQAxTr4PrnwQZZ16vIEdU7HgSzJjd lnK2oTS8IqgPHgo6dSrGYJ5R2SQRhPR0iKqQ1ZdZL/pJmRY/nlnLFO21wYtnasGl4G +X32VpAf7TOEBcSscjaVVK4amQUpiLg36ZQuYMjWirkVPPXtX9+tDSa7ZDDxSO7TcW N7QH5eLU2DNhA== Received: from localhost (unknown [100.64.0.241]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange secp256r1 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: cristicc) by bali.collaboradmins.com (Postfix) with ESMTPSA id D3AB517E0945; Fri, 31 Jul 2026 18:19:29 +0200 (CEST) From: Cristian Ciocaltea Date: Fri, 31 Jul 2026 19:19:28 +0300 Subject: [PATCH v10 21/69] drm/display: hdmi-state-helper: Pass acquire ctx to hotplug helpers Precedence: bulk X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20260731-dw-hdmi-qp-scramb-v10-21-294364b2cf15@collabora.com> References: <20260731-dw-hdmi-qp-scramb-v10-0-294364b2cf15@collabora.com> In-Reply-To: <20260731-dw-hdmi-qp-scramb-v10-0-294364b2cf15@collabora.com> To: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Luca Ceresoli , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Chen-Yu Tsai , Samuel Holland , Dave Stevenson , =?utf-8?q?Ma=C3=ADra_Canal?= , Raspberry Pi Kernel Maintenance , Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Andy Yan , Algea Cao , Daniel Stone , Liu Ying , Phong LE Cc: kernel@collabora.com, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-rockchip@lists.infradead.org, Diederik de Haas X-Mailer: b4 0.15.2 X-MORS-Enabled: yes X-MORS-DOMAIN: patchwork.local X-MORS-HOSTING: hosting172546 X-MORS-USER: hosting172546 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= In preparation for supporting SCDC status synchronization on hotplug events, extend drm_atomic_helper_connector_hdmi_hotplug() and drm_atomic_helper_connector_hdmi_update() to take a struct drm_modeset_acquire_ctx argument. This will be used when a CRTC reset is required. Additionally, change their return type from void to int to allow propagation of errors such as -EDEADLK caused by lock contention. Update existing callers accordingly. Note that in the VC4 case, the return code is ignored, as it cannot fail: being in the .detect_ctx() call path, the connection mutex is already held through ctx, and it bails out early because the driver relies on a local SCDC state-management implementation, and therefore does not yet expose the scrambler capability through the common helpers. Similarly, introduce drm_atomic_helper_connector_hdmi_force_ctx() as the HDMI connector implementation of the .force_ctx() callback. Since migrating from the .force() callback is somewhat more involved, its users will be migrated incrementally, after which drm_atomic_helper_connector_hdmi_force() will be removed. Tested-by: Diederik de Haas # NanoPC-T6 LTS, Rock 5B Signed-off-by: Cristian Ciocaltea Reviewed-by: Maxime Ripard --- drivers/gpu/drm/display/drm_bridge_connector.c | 8 +++-- drivers/gpu/drm/display/drm_hdmi_state_helper.c | 42 +++++++++++++++++++++---- drivers/gpu/drm/vc4/vc4_hdmi.c | 2 +- include/drm/display/drm_hdmi_state_helper.h | 8 +++-- 4 files changed, 49 insertions(+), 11 deletions(-) diff --git a/drivers/gpu/drm/display/drm_bridge_connector.c b/drivers/gpu/drm/display/drm_bridge_connector.c index 80b33d4f6b38..e78efccb7757 100644 --- a/drivers/gpu/drm/display/drm_bridge_connector.c +++ b/drivers/gpu/drm/display/drm_bridge_connector.c @@ -286,12 +286,16 @@ static int drm_bridge_connector_detect_ctx(struct drm_connector *connector, struct drm_bridge *detect = bridge_connector->bridge_detect; struct drm_bridge *hdmi = bridge_connector->bridge_hdmi; enum drm_connector_status status; + int ret; if (detect) { status = detect->funcs->detect(detect, connector); - if (hdmi) - drm_atomic_helper_connector_hdmi_hotplug(connector, status); + if (hdmi) { + ret = drm_atomic_helper_connector_hdmi_hotplug(connector, ctx, status); + if (ret == -EDEADLK) + return ret; + } drm_bridge_connector_hpd_notify(connector, status); } else { diff --git a/drivers/gpu/drm/display/drm_hdmi_state_helper.c b/drivers/gpu/drm/display/drm_hdmi_state_helper.c index 92be6278ea44..4a93c279c9a7 100644 --- a/drivers/gpu/drm/display/drm_hdmi_state_helper.c +++ b/drivers/gpu/drm/display/drm_hdmi_state_helper.c @@ -1199,8 +1199,9 @@ drm_atomic_helper_connector_hdmi_clear_audio_infoframe(struct drm_connector *con } EXPORT_SYMBOL(drm_atomic_helper_connector_hdmi_clear_audio_infoframe); -static void +static int drm_atomic_helper_connector_hdmi_update(struct drm_connector *connector, + struct drm_modeset_acquire_ctx *ctx, enum drm_connector_status status) { const struct drm_edid *drm_edid; @@ -1210,7 +1211,7 @@ drm_atomic_helper_connector_hdmi_update(struct drm_connector *connector, drm_connector_hdmi_audio_plugged_notify(connector, false); drm_edid_connector_update(connector, NULL); drm_connector_cec_phys_addr_invalidate(connector); - return; + return 0; } if (connector->hdmi.funcs->read_edid) @@ -1227,20 +1228,28 @@ drm_atomic_helper_connector_hdmi_update(struct drm_connector *connector, drm_connector_hdmi_audio_plugged_notify(connector, true); drm_connector_cec_phys_addr_set(connector); } + + return 0; } /** * drm_atomic_helper_connector_hdmi_hotplug - Handle the hotplug event for the HDMI connector * @connector: A pointer to the HDMI connector + * @ctx: Lock acquisition context to be used for resetting CRTC * @status: Connection status * * This function should be called as a part of the .detect() / .detect_ctx() * callbacks for all status changes. + * + * Returns: + * Zero on success, error code on failure. + * If @ctx is set, it might also return -EDEADLK. */ -void drm_atomic_helper_connector_hdmi_hotplug(struct drm_connector *connector, - enum drm_connector_status status) +int drm_atomic_helper_connector_hdmi_hotplug(struct drm_connector *connector, + struct drm_modeset_acquire_ctx *ctx, + enum drm_connector_status status) { - drm_atomic_helper_connector_hdmi_update(connector, status); + return drm_atomic_helper_connector_hdmi_update(connector, ctx, status); } EXPORT_SYMBOL(drm_atomic_helper_connector_hdmi_hotplug); @@ -1255,6 +1264,27 @@ EXPORT_SYMBOL(drm_atomic_helper_connector_hdmi_hotplug); */ void drm_atomic_helper_connector_hdmi_force(struct drm_connector *connector) { - drm_atomic_helper_connector_hdmi_update(connector, connector->status); + drm_atomic_helper_connector_hdmi_update(connector, NULL, connector->status); } EXPORT_SYMBOL(drm_atomic_helper_connector_hdmi_force); + +/** + * drm_atomic_helper_connector_hdmi_force_ctx - HDMI Connector implementation + * of the force_ctx callback + * @connector: A pointer to the HDMI connector + * @ctx: Lock acquisition context to be used for resetting CRTC + * + * This function implements the .force_ctx() callback for the HDMI connectors. + * It can either be used directly as the callback or should be called from + * within the .force_ctx() callback implementation to maintain the HDMI-specific + * connector's data. + * + * Returns: + * Zero on success, error code on failure, including -EDEADLK. + */ +int drm_atomic_helper_connector_hdmi_force_ctx(struct drm_connector *connector, + struct drm_modeset_acquire_ctx *ctx) +{ + return drm_atomic_helper_connector_hdmi_update(connector, ctx, connector->status); +} +EXPORT_SYMBOL(drm_atomic_helper_connector_hdmi_force_ctx); diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c index 72ff95ca97de..7f613f912368 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c @@ -375,7 +375,7 @@ static void vc4_hdmi_handle_hotplug(struct vc4_hdmi *vc4_hdmi, * the lock for now. */ - drm_atomic_helper_connector_hdmi_hotplug(connector, status); + drm_atomic_helper_connector_hdmi_hotplug(connector, ctx, status); if (status != connector_status_connected) return; diff --git a/include/drm/display/drm_hdmi_state_helper.h b/include/drm/display/drm_hdmi_state_helper.h index 13375bd0f4ae..ae4fff82c3fb 100644 --- a/include/drm/display/drm_hdmi_state_helper.h +++ b/include/drm/display/drm_hdmi_state_helper.h @@ -7,6 +7,7 @@ struct drm_atomic_commit; struct drm_connector; struct drm_connector_state; struct drm_display_mode; +struct drm_modeset_acquire_ctx; struct hdmi_audio_infoframe; enum drm_connector_status; @@ -22,9 +23,12 @@ int drm_atomic_helper_connector_hdmi_update_audio_infoframe(struct drm_connector int drm_atomic_helper_connector_hdmi_clear_audio_infoframe(struct drm_connector *connector); int drm_atomic_helper_connector_hdmi_update_infoframes(struct drm_connector *connector, struct drm_atomic_commit *state); -void drm_atomic_helper_connector_hdmi_hotplug(struct drm_connector *connector, - enum drm_connector_status status); +int drm_atomic_helper_connector_hdmi_hotplug(struct drm_connector *connector, + struct drm_modeset_acquire_ctx *ctx, + enum drm_connector_status status); void drm_atomic_helper_connector_hdmi_force(struct drm_connector *connector); +int drm_atomic_helper_connector_hdmi_force_ctx(struct drm_connector *connector, + struct drm_modeset_acquire_ctx *ctx); enum drm_mode_status drm_hdmi_connector_mode_valid(struct drm_connector *connector, From patchwork Fri Jul 31 16:19:29 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Ciocaltea X-Patchwork-Id: 2820 Return-Path: X-Original-To: noreply@patchwork.local Delivered-To: noreply@patchwork.local Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114]) by mxe881.netcup.net (Postfix) with ESMTPS id BB5791C0254 for ; Fri, 31 Jul 2026 18:31:12 +0200 (CEST) Authentication-Results: mxe881; dkim=pass header.d=collabora.com; spf=pass (sender IP is 172.105.105.114) smtp.mailfrom=linux-sunxi+bounces-24821-noreply=patchwork.local@lists.linux.dev smtp.helo=tor.lore.kernel.org Received-SPF: pass (mxe881: domain of lists.linux.dev designates 172.105.105.114 as permitted sender) client-ip=172.105.105.114; envelope-from=linux-sunxi+bounces-24821-noreply=patchwork.local@lists.linux.dev; helo=tor.lore.kernel.org; Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by tor.lore.kernel.org (Postfix) with ESMTP id 22B91309F73E for ; Fri, 31 Jul 2026 16:22:09 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 44F2A44DB61; Fri, 31 Jul 2026 16:19:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="oPHcO2kn" X-Original-To: linux-sunxi@lists.linux.dev Received: from bali.collaboradmins.com (bali.collaboradmins.com [148.251.105.195]) (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 D20A845628E for ; Fri, 31 Jul 2026 16:19:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.251.105.195 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785514782; cv=none; b=Z+x4cIudDAcjLW+f3kDU7n7YPfhSs+HaX8gsc7XECF18D9iYHNmNDNprYVml+SkLC0O8gcR/ymjKvh08wxEe2097/sQ3oH+oJoTFeP1/XUhgjz5keE1O13E8j5jygSryu/WSyiMWIEJ3mj2pssl26BEybSDL1QsSFZn3WsTXGiY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785514782; c=relaxed/simple; bh=t0n10iHhf/9/WODO+84lsoOn3fsfS146FQnPcalTtBc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=lgCwgsu+3bxiBMAWbLZea6vYgtk4UagFSfpnEY6EvEsMTFRiBXkX9T7MldJEBeRWj2nlc5bOMtUvEvOT0yKq8QzZLWDiaMEoaxOQ+6NdDPQl4eR/T3+eVvl1OCXXfaztTnohIAl2N29yHvEmRwOMisD8F3h4H4u3q8oaeoo5upg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=oPHcO2kn; arc=none smtp.client-ip=148.251.105.195 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1785514770; bh=t0n10iHhf/9/WODO+84lsoOn3fsfS146FQnPcalTtBc=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=oPHcO2knZfcrbYyL+Fyjs2Qx87cgYxiiKE6eaoviBJst4Fst+LYvUH9kJeDHkZAif ntmEcCBKzOmQTFT7qRuERxlxK284mM6Nwb0ajFbO5vpskSBRFbu4p+TD03DoGJNKp2 XkqRKXOg2inVB3I4wq9MRCPDGrAfxQsbt97QdDAshF3LM3rS2Z19KqywLdXheF0uBd 0WFL2hG1/NywKSKOL6IIvr4YxOoaohamBh3JqI9tLu7UWHducnnnvylVuJKQqj33lB qokdKyX7mYZS2PWkOIPKq72INkfG3TqH7wPEtlZ1u9Fs6Fk7HTq/EQ05GoH+YiTtdn Gthb2vgTnznQw== Received: from localhost (unknown [100.64.0.241]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange secp256r1 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: cristicc) by bali.collaboradmins.com (Postfix) with ESMTPSA id 9A03517E0946; Fri, 31 Jul 2026 18:19:30 +0200 (CEST) From: Cristian Ciocaltea Date: Fri, 31 Jul 2026 19:19:29 +0300 Subject: [PATCH v10 22/69] drm/display: hdmi-state-helper: Sync SCDC state on hotplug Precedence: bulk X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20260731-dw-hdmi-qp-scramb-v10-22-294364b2cf15@collabora.com> References: <20260731-dw-hdmi-qp-scramb-v10-0-294364b2cf15@collabora.com> In-Reply-To: <20260731-dw-hdmi-qp-scramb-v10-0-294364b2cf15@collabora.com> To: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Luca Ceresoli , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Chen-Yu Tsai , Samuel Holland , Dave Stevenson , =?utf-8?q?Ma=C3=ADra_Canal?= , Raspberry Pi Kernel Maintenance , Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Andy Yan , Algea Cao , Daniel Stone , Liu Ying , Phong LE Cc: kernel@collabora.com, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-rockchip@lists.infradead.org, Maud Spierings , Diederik de Haas X-Mailer: b4 0.15.2 X-MORS-Enabled: yes X-MORS-DOMAIN: patchwork.local X-MORS-HOSTING: hosting172546 X-MORS-USER: hosting172546 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= drm_atomic_helper_connector_hdmi_hotplug() does not currently synchronize SCDC status on hotplug events, leaving the scrambler state potentially inconsistent after (re)connect. Hook drm_connector_hdmi_sync_scdc() into both the connect and disconnect paths, replacing the existing TODOs around missing scrambler handling. Tested-by: Maud Spierings Tested-by: Diederik de Haas # NanoPC-T6 LTS, Rock 5B Signed-off-by: Cristian Ciocaltea --- drivers/gpu/drm/display/drm_hdmi_state_helper.c | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/drm/display/drm_hdmi_state_helper.c b/drivers/gpu/drm/display/drm_hdmi_state_helper.c index 4a93c279c9a7..3377ea936120 100644 --- a/drivers/gpu/drm/display/drm_hdmi_state_helper.c +++ b/drivers/gpu/drm/display/drm_hdmi_state_helper.c @@ -1205,13 +1205,16 @@ drm_atomic_helper_connector_hdmi_update(struct drm_connector *connector, enum drm_connector_status status) { const struct drm_edid *drm_edid; + int ret = 0; if (status == connector_status_disconnected) { - // TODO: also handle scramber, HDMI sink disconnected. - drm_connector_hdmi_audio_plugged_notify(connector, false); - drm_edid_connector_update(connector, NULL); - drm_connector_cec_phys_addr_invalidate(connector); - return 0; + ret = drm_connector_hdmi_sync_scdc(connector, false, ctx); + if (ret != -EDEADLK) { + drm_connector_hdmi_audio_plugged_notify(connector, false); + drm_edid_connector_update(connector, NULL); + drm_connector_cec_phys_addr_invalidate(connector); + } + return ret; } if (connector->hdmi.funcs->read_edid) @@ -1224,12 +1227,14 @@ drm_atomic_helper_connector_hdmi_update(struct drm_connector *connector, drm_edid_free(drm_edid); if (status == connector_status_connected) { - // TODO: also handle scramber, HDMI sink is now connected. - drm_connector_hdmi_audio_plugged_notify(connector, true); - drm_connector_cec_phys_addr_set(connector); + ret = drm_connector_hdmi_sync_scdc(connector, true, ctx); + if (ret != -EDEADLK) { + drm_connector_hdmi_audio_plugged_notify(connector, true); + drm_connector_cec_phys_addr_set(connector); + } } - return 0; + return ret; } /** From patchwork Fri Jul 31 16:19:30 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Ciocaltea X-Patchwork-Id: 2825 Return-Path: X-Original-To: noreply@patchwork.local Delivered-To: noreply@patchwork.local Received: from sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74]) by mxe881.netcup.net (Postfix) with ESMTPS id 9B7371C0254 for ; Fri, 31 Jul 2026 18:32:35 +0200 (CEST) Authentication-Results: mxe881; dkim=pass header.d=collabora.com; spf=pass (sender IP is 172.232.135.74) smtp.mailfrom=linux-sunxi+bounces-24822-noreply=patchwork.local@lists.linux.dev smtp.helo=sto.lore.kernel.org Received-SPF: pass (mxe881: domain of lists.linux.dev designates 172.232.135.74 as permitted sender) client-ip=172.232.135.74; envelope-from=linux-sunxi+bounces-24822-noreply=patchwork.local@lists.linux.dev; helo=sto.lore.kernel.org; Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by sto.lore.kernel.org (Postfix) with ESMTP id 8DA7C310409A for ; Fri, 31 Jul 2026 16:22:22 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6339E4582E1; Fri, 31 Jul 2026 16:19:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="c5rFA9KS" X-Original-To: linux-sunxi@lists.linux.dev Received: from bali.collaboradmins.com (bali.collaboradmins.com [148.251.105.195]) (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 9F53345519B for ; Fri, 31 Jul 2026 16:19:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.251.105.195 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785514783; cv=none; b=HWrROViZYBshIbvbOcC0EQocrx8jaQ0B2YOFd3s+pcOYp6fgaLGRBcU+NgQZNXgGRsKKO2vmkrmYLXOsGoXoaSk1R5pN4JU10Ebb5vbce6m00THxbWRl+HO50WMVWa37RkCdw1BgyFITOaL+fO/UwkfYMMf8AWku78JIeftF2Jg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785514783; c=relaxed/simple; bh=y/oPi/fnmwrFajh0Q2Bmgy/nAjgH57+rFmteNZPqQ30=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=tMXtnS4eMQbKmYFGQr5ZMxJHGszI45UDsDApjobh1XYM1fbt+9R94yXhKoNkADZ1//EPMPAlvzVgsVTUzL/kMY6xtgWNthCzkKYg5YHLMbcFneP9N5C9rJbSwt9npRmsF7dC/ch1FLgF6ffZj2tpbDHd80fBvi+wCuYER8TCLig= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=c5rFA9KS; arc=none smtp.client-ip=148.251.105.195 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1785514771; bh=y/oPi/fnmwrFajh0Q2Bmgy/nAjgH57+rFmteNZPqQ30=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=c5rFA9KSpWytkG1gOfR/SX/kk6TaMt5iTq+mOUZ1i0/fvUP7esFrVUsCTs3Fm3p2b CefzERDAfHUD7Fb3A7DUOrSyN4Tf7bgedHthno16Apkjmdojp/gSnFeI/q2dHIWzqB TV54XjGeH4qrSmKRgY+9LC4j+iPpOAjWGzAkCpbA11yMT3/o/TuvQaEYjZGpxmaWTI yUCMHzAxEj9IRj+TX+phIGg3xplsvkCNnlWCr4pS8yxE3WnA38VtP8klA/MVvGR1cS soZ2NQhgaY+GMdd4Bzeadkw3LXnAw5jbNTd6UY3vtbwwD91caaGAAzBa0XxNtKV2Xo dZKFyVO3vSWUA== Received: from localhost (unknown [100.64.0.241]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange secp256r1 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: cristicc) by bali.collaboradmins.com (Postfix) with ESMTPSA id 52C5D17E0582; Fri, 31 Jul 2026 18:19:31 +0200 (CEST) From: Cristian Ciocaltea Date: Fri, 31 Jul 2026 19:19:30 +0300 Subject: [PATCH v10 23/69] drm/display: hdmi-state-helper: Set HDMI scrambling requirement Precedence: bulk X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20260731-dw-hdmi-qp-scramb-v10-23-294364b2cf15@collabora.com> References: <20260731-dw-hdmi-qp-scramb-v10-0-294364b2cf15@collabora.com> In-Reply-To: <20260731-dw-hdmi-qp-scramb-v10-0-294364b2cf15@collabora.com> To: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Luca Ceresoli , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Chen-Yu Tsai , Samuel Holland , Dave Stevenson , =?utf-8?q?Ma=C3=ADra_Canal?= , Raspberry Pi Kernel Maintenance , Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Andy Yan , Algea Cao , Daniel Stone , Liu Ying , Phong LE Cc: kernel@collabora.com, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-rockchip@lists.infradead.org, Maud Spierings , Diederik de Haas X-Mailer: b4 0.15.2 X-Rspamd-Server: rspamd-worker-8404 X-Spamd-Result: default: False [-2.16 / 15.00]; BAYES_HAM(-5.50)[100.00%]; RBL_SENDERSCORE(2.00)[172.232.135.74:from]; SUSPICIOUS_RECIPS(1.50)[]; MAILLIST(-0.15)[generic]; MIME_GOOD(-0.10)[text/plain]; BAD_REP_POLICIES(0.10)[]; HAS_LIST_UNSUB(-0.01)[]; FROM_HAS_DN(0.00)[]; PRECEDENCE_BULK(0.00)[]; TAGGED_RCPT(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[sto.lore.kernel.org:rdns,sto.lore.kernel.org:helo,collabora.com:email,collabora.com:dkim,cknow-tech.com:email]; R_DKIM_ALLOW(0.00)[collabora.com:s=mail]; FREEMAIL_CC(0.00)[collabora.com,vger.kernel.org,lists.freedesktop.org,lists.infradead.org,lists.linux.dev,hotmail.com,cknow-tech.com]; RCPT_COUNT_TWELVE(0.00)[32]; RCVD_COUNT_FIVE(0.00)[5]; FROM_NEQ_ENVFROM(0.00)[cristian.ciocaltea@collabora.com,linux-sunxi@lists.linux.dev]; ASN(0.00)[asn:63949, ipnet:172.232.128.0/19, country:SG]; DMARC_POLICY_ALLOW(0.00)[collabora.com,none]; FREEMAIL_TO(0.00)[intel.com,linaro.org,kernel.org,ideasonboard.com,kwiboo.se,gmail.com,bootlin.com,linux.intel.com,suse.de,ffwll.ch,sholland.org,raspberrypi.com,igalia.com,rock-chips.com,sntech.de,collabora.com,nxp.com,baylibre.com]; DKIM_TRACE(0.00)[collabora.com:+]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(0.00)[+ip4:172.232.135.74:c]; FORGED_SENDER_MAILLIST(0.00)[]; FORGED_RECIPIENTS_MAILLIST(0.00)[]; RCVD_TLS_LAST(0.00)[]; TAGGED_FROM(0.00)[bounces-24822-noreply=patchwork.local]; MIME_TRACE(0.00)[0:+]; MID_RHS_MATCH_FROM(0.00)[]; ARC_ALLOW(0.00)[subspace.kernel.org:s=arc-20240116:i=1]; RCVD_VIA_SMTP_AUTH(0.00)[] X-Rspamd-Queue-Id: 9B7371C0254 X-MORS-Enabled: yes X-MORS-DOMAIN: patchwork.local X-MORS-HOSTING: hosting172546 X-MORS-USER: hosting172546 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= Set drm_connector_hdmi_state.scrambler_needed when the computed TMDS character rate exceeds the HDMI 1.3 maximum TMDS character rate. HDMI 2.0 requires scrambling above 340 MHz. Centralize that clock-based requirement in the HDMI state helper so drivers do not need to open-code the threshold check. Acked-by: Maxime Ripard Tested-by: Maud Spierings Tested-by: Diederik de Haas # NanoPC-T6 LTS, Rock 5B Signed-off-by: Cristian Ciocaltea --- drivers/gpu/drm/display/drm_hdmi_state_helper.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/drm/display/drm_hdmi_state_helper.c b/drivers/gpu/drm/display/drm_hdmi_state_helper.c index 3377ea936120..9544eb8659aa 100644 --- a/drivers/gpu/drm/display/drm_hdmi_state_helper.c +++ b/drivers/gpu/drm/display/drm_hdmi_state_helper.c @@ -594,6 +594,9 @@ hdmi_compute_clock(const struct drm_connector *connector, conn_state->hdmi.tmds_char_rate = clock; + /* TODO: also check drm_display_info.hdmi.scdc.scrambling.low_rates */ + conn_state->hdmi.scrambler_needed = (clock > HDMI_1_3_TMDS_CHAR_RATE_MAX_HZ); + return 0; } From patchwork Fri Jul 31 16:19:31 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Ciocaltea X-Patchwork-Id: 2821 Return-Path: X-Original-To: noreply@patchwork.local Delivered-To: noreply@patchwork.local Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114]) by mxe881.netcup.net (Postfix) with ESMTPS id 7ACC21C1D58 for ; Fri, 31 Jul 2026 18:31:42 +0200 (CEST) Authentication-Results: mxe881; dkim=pass header.d=collabora.com; spf=pass (sender IP is 172.105.105.114) smtp.mailfrom=linux-sunxi+bounces-24826-noreply=patchwork.local@lists.linux.dev smtp.helo=tor.lore.kernel.org Received-SPF: pass (mxe881: domain of lists.linux.dev designates 172.105.105.114 as permitted sender) client-ip=172.105.105.114; envelope-from=linux-sunxi+bounces-24826-noreply=patchwork.local@lists.linux.dev; helo=tor.lore.kernel.org; Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by tor.lore.kernel.org (Postfix) with ESMTP id 8BD6D3147FFB for ; Fri, 31 Jul 2026 16:22:33 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 65F9F45D5CB; Fri, 31 Jul 2026 16:19:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="Q8uVcg8G" X-Original-To: linux-sunxi@lists.linux.dev Received: from bali.collaboradmins.com (bali.collaboradmins.com [148.251.105.195]) (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 ED3CA453A21 for ; Fri, 31 Jul 2026 16:19:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.251.105.195 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785514785; cv=none; b=cIHPJiYukzf8tqBkr6Bt+RZNUSO/c88WY8j1gk+Vf3y+X9gb+s1e9/NVwhRee0UVIiuIxAOMLXprx0l+agE/c9LoWVe20M3rACR/AtkY7Wat9au7CKGsjTvMzgpd9bsXXTRICihzMxnpmVOr9HraReQcavWhXvDYa6wrXGsPvG0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785514785; c=relaxed/simple; bh=Np7wpAYZLHRt1c9crOqakHGhI+KoSOWphtz4jQaYs5Y=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=laXaZDLdzEPYq2kXf6IFKpObQxx7ZkbKMEeumm131bddQXlvuwf05T1LTXb0vgRnbhv2Im0KUNiQBb3I3ImW+e5e5z2s8gYOGlWsLjz/4Fzg2TGcKlgjpROcX5dQ2qmFSafscwtrU4EbEL3lV1YvLY/+vqHsDYCBQH8fLCqkkRc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=Q8uVcg8G; arc=none smtp.client-ip=148.251.105.195 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1785514772; bh=Np7wpAYZLHRt1c9crOqakHGhI+KoSOWphtz4jQaYs5Y=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=Q8uVcg8Gc5mgbp/ldddahcqc2rvbMiA+kjtISS0W172/7czwRf71jj8olFmjRCt6t ol8XjeJtLyfvHkcVOjo+k3IBUH39XYKhHKs9Sd4Qzh9ZUHjgKgYJRL8OBy7b10IqND LQxLjRMPhFnX3rVPM70LQe2Xpvd6fLHDDwIJyaB+hVYCeOtShZ6oqc6ycbJaUbglay VUi7oqXCdt2Y/cWL0semkrTIS0UEfA8RwkJHm1Mxt9yYBe1CIoEwd6HzhxUmOCgsyh Amr4fPgnGTkjly3im4T118u1Jh3G7YaXkNdHH3Lv5HX/nYUo+37rgVOl3PcPmsBfFI 9+eejfuZrrgzg== Received: from localhost (unknown [100.64.0.241]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange secp256r1 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: cristicc) by bali.collaboradmins.com (Postfix) with ESMTPSA id 1145E17E0952; Fri, 31 Jul 2026 18:19:32 +0200 (CEST) From: Cristian Ciocaltea Date: Fri, 31 Jul 2026 19:19:31 +0300 Subject: [PATCH v10 24/69] drm/bridge: dw-hdmi-qp: Rate limit i2c read error messages Precedence: bulk X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20260731-dw-hdmi-qp-scramb-v10-24-294364b2cf15@collabora.com> References: <20260731-dw-hdmi-qp-scramb-v10-0-294364b2cf15@collabora.com> In-Reply-To: <20260731-dw-hdmi-qp-scramb-v10-0-294364b2cf15@collabora.com> To: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Luca Ceresoli , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Chen-Yu Tsai , Samuel Holland , Dave Stevenson , =?utf-8?q?Ma=C3=ADra_Canal?= , Raspberry Pi Kernel Maintenance , Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Andy Yan , Algea Cao , Daniel Stone , Liu Ying , Phong LE Cc: kernel@collabora.com, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-rockchip@lists.infradead.org, Maud Spierings , Diederik de Haas X-Mailer: b4 0.15.2 X-MORS-Enabled: yes X-MORS-DOMAIN: patchwork.local X-MORS-HOSTING: hosting172546 X-MORS-USER: hosting172546 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= During EDID reads, repeated i2c errors can flood the kernel log: [ 25.361716] dwhdmiqp-rockchip fde80000.hdmi: i2c read error [ 25.363376] dwhdmiqp-rockchip fde80000.hdmi: i2c read error ... [ 25.368671] dwhdmiqp-rockchip fde80000.hdmi: i2c read error [ 25.369440] dwhdmiqp-rockchip fde80000.hdmi: failed to get edid Switch to dev_err_ratelimited() in dw_hdmi_qp_i2c_read() to reduce log spam while still reporting the condition. Reviewed-by: Heiko Stuebner Tested-by: Maud Spierings Tested-by: Diederik de Haas # NanoPC-T6 LTS, Rock 5B Signed-off-by: Cristian Ciocaltea --- drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c index cfd1b18c06e6..7475b6b71836 100644 --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c @@ -561,7 +561,7 @@ static int dw_hdmi_qp_i2c_read(struct dw_hdmi_qp *hdmi, dev_dbg_ratelimited(hdmi->dev, "i2c read timed out\n"); else - dev_err(hdmi->dev, "i2c read timed out\n"); + dev_err_ratelimited(hdmi->dev, "i2c read timed out\n"); dw_hdmi_qp_write(hdmi, 0x01, I2CM_CONTROL0); return -EAGAIN; } @@ -572,7 +572,7 @@ static int dw_hdmi_qp_i2c_read(struct dw_hdmi_qp *hdmi, dev_dbg_ratelimited(hdmi->dev, "i2c read error\n"); else - dev_err(hdmi->dev, "i2c read error\n"); + dev_err_ratelimited(hdmi->dev, "i2c read error\n"); dw_hdmi_qp_write(hdmi, 0x01, I2CM_CONTROL0); return -EIO; } From patchwork Fri Jul 31 16:19:32 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Ciocaltea X-Patchwork-Id: 2840 Return-Path: X-Original-To: noreply@patchwork.local Delivered-To: noreply@patchwork.local Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114]) by mxe881.netcup.net (Postfix) with ESMTPS id 773661C20B3 for ; Fri, 31 Jul 2026 18:35:20 +0200 (CEST) Authentication-Results: mxe881; dkim=pass header.d=collabora.com; spf=pass (sender IP is 172.105.105.114) smtp.mailfrom=linux-sunxi+bounces-24861-noreply=patchwork.local@lists.linux.dev smtp.helo=tor.lore.kernel.org Received-SPF: pass (mxe881: domain of lists.linux.dev designates 172.105.105.114 as permitted sender) client-ip=172.105.105.114; envelope-from=linux-sunxi+bounces-24861-noreply=patchwork.local@lists.linux.dev; helo=tor.lore.kernel.org; Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by tor.lore.kernel.org (Postfix) with ESMTP id 97AB730D50CB for ; Fri, 31 Jul 2026 16:25:55 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 57FDA46D095; Fri, 31 Jul 2026 16:20:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="bHUZ9jy0" X-Original-To: linux-sunxi@lists.linux.dev Received: from bali.collaboradmins.com (bali.collaboradmins.com [148.251.105.195]) (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 D5C6B46AA62 for ; Fri, 31 Jul 2026 16:20:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.251.105.195 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785514809; cv=none; b=URlsc00q8ZI+s4dp7OD9oMpMMoI0swYRGRJ5CjXFgejRXeFDGbiwfn2KPTx8pIvpIUwx3aWe9Hv/CA1CnKojDYSTVY4HjawW6/75joiuFPXRtNKdRFrVovU1kBFn+N7EvWKQnUwi40iJw8DN4O9Q9gimD4fK904bHp1mokbBSag= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785514809; c=relaxed/simple; bh=fw8obzJP5OPYqaOUFHt36T0iWpVWKUYn3AqoExbRHJc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=NuvaADBcaRKm4Vszeq7BGsbY8PT7BArqc4JRdNv11A1noHwJY6xyhMHYC0EezYQGR60rjv5QI3UnwP22+FYn12OnUt9/pyM5O6sPgPHdBim1g+2PSxYGbiCpuz6GfKMwuG2OwrMgRvaGqJ3Q2vTb/az7RBQT32/v7ABZZ9BKDGc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=bHUZ9jy0; arc=none smtp.client-ip=148.251.105.195 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1785514772; bh=fw8obzJP5OPYqaOUFHt36T0iWpVWKUYn3AqoExbRHJc=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=bHUZ9jy0n2KaQdJ+NlJchUfjMKIpNDaY1O2NlzvV3A5HvWXoZMM7IRZTVMG3K7439 s2YHV/HLKccLhBWsoX0GYlj16Gv6MtgPL/dJJOjw7M8cHgTSLQofjn1anIAi3welAa P3zm2biK/E60UMq7b/mbzTF5degQBChOYnrnjbVOtx2/R8blOQ6Sr44oUjLkh/w97h xqLijZqfWRRPngypOZXrbdBeF/uYY92mDMOVn6vyjH8E5rCiaaHMXJ3sS26Bo5/d9J bv3LYG4I5IScefPwS168XUXnna4Vd/im6cE9krxwD4/T2oDvCbEMGbZUUEXoIRbgBr NMW3x1iQGpgZg== Received: from localhost (unknown [100.64.0.241]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange secp256r1 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: cristicc) by bali.collaboradmins.com (Postfix) with ESMTPSA id B948B17E08E0; Fri, 31 Jul 2026 18:19:32 +0200 (CEST) From: Cristian Ciocaltea Date: Fri, 31 Jul 2026 19:19:32 +0300 Subject: [PATCH v10 25/69] drm/bridge: dw-hdmi-qp: Provide .{enable,disable}_hpd() PHY ops Precedence: bulk X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20260731-dw-hdmi-qp-scramb-v10-25-294364b2cf15@collabora.com> References: <20260731-dw-hdmi-qp-scramb-v10-0-294364b2cf15@collabora.com> In-Reply-To: <20260731-dw-hdmi-qp-scramb-v10-0-294364b2cf15@collabora.com> To: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Luca Ceresoli , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Chen-Yu Tsai , Samuel Holland , Dave Stevenson , =?utf-8?q?Ma=C3=ADra_Canal?= , Raspberry Pi Kernel Maintenance , Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Andy Yan , Algea Cao , Daniel Stone , Liu Ying , Phong LE Cc: kernel@collabora.com, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-rockchip@lists.infradead.org, Maud Spierings , Diederik de Haas X-Mailer: b4 0.15.2 X-MORS-Enabled: yes X-MORS-DOMAIN: patchwork.local X-MORS-HOSTING: hosting172546 X-MORS-USER: hosting172546 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= Implement the .hpd_enable() and .hpd_disable() bridge callbacks and extend dw_hdmi_qp_phy_ops with corresponding hooks. This enables the DRM core to control when HPD interrupts are armed, which is needed to prevent premature interrupt delivery before the connector is fully initialized, and to properly quiesce HPD during suspend. Tested-by: Maud Spierings Tested-by: Diederik de Haas # NanoPC-T6 LTS, Rock 5B Signed-off-by: Cristian Ciocaltea --- drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c | 18 ++++++++++++++++++ include/drm/bridge/dw_hdmi_qp.h | 2 ++ 2 files changed, 20 insertions(+) diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c index 7475b6b71836..a0613f0d2ebc 100644 --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c @@ -1189,6 +1189,22 @@ static int dw_hdmi_qp_cec_transmit(struct drm_bridge *bridge, u8 attempts, #define dw_hdmi_qp_cec_transmit NULL #endif /* CONFIG_DRM_DW_HDMI_QP_CEC */ +static void dw_hdmi_qp_bridge_hpd_enable(struct drm_bridge *bridge) +{ + struct dw_hdmi_qp *hdmi = bridge->driver_private; + + if (hdmi->phy.ops->enable_hpd) + hdmi->phy.ops->enable_hpd(hdmi, hdmi->phy.data); +} + +static void dw_hdmi_qp_bridge_hpd_disable(struct drm_bridge *bridge) +{ + struct dw_hdmi_qp *hdmi = bridge->driver_private; + + if (hdmi->phy.ops->disable_hpd) + hdmi->phy.ops->disable_hpd(hdmi, hdmi->phy.data); +} + static const struct drm_bridge_funcs dw_hdmi_qp_bridge_funcs = { .atomic_get_output_bus_fmts = drm_atomic_helper_bridge_get_hdmi_output_bus_fmts, .atomic_duplicate_state = drm_atomic_helper_bridge_duplicate_state, @@ -1197,6 +1213,8 @@ static const struct drm_bridge_funcs dw_hdmi_qp_bridge_funcs = { .atomic_enable = dw_hdmi_qp_bridge_atomic_enable, .atomic_disable = dw_hdmi_qp_bridge_atomic_disable, .detect = dw_hdmi_qp_bridge_detect, + .hpd_enable = dw_hdmi_qp_bridge_hpd_enable, + .hpd_disable = dw_hdmi_qp_bridge_hpd_disable, .edid_read = dw_hdmi_qp_bridge_edid_read, .hdmi_tmds_char_rate_valid = dw_hdmi_qp_bridge_tmds_char_rate_valid, .hdmi_clear_avi_infoframe = dw_hdmi_qp_bridge_clear_avi_infoframe, diff --git a/include/drm/bridge/dw_hdmi_qp.h b/include/drm/bridge/dw_hdmi_qp.h index 6ea9c561cfef..b80fceffc315 100644 --- a/include/drm/bridge/dw_hdmi_qp.h +++ b/include/drm/bridge/dw_hdmi_qp.h @@ -17,6 +17,8 @@ struct dw_hdmi_qp_phy_ops { void (*disable)(struct dw_hdmi_qp *hdmi, void *data); enum drm_connector_status (*read_hpd)(struct dw_hdmi_qp *hdmi, void *data); void (*setup_hpd)(struct dw_hdmi_qp *hdmi, void *data); + void (*enable_hpd)(struct dw_hdmi_qp *hdmi, void *data); + void (*disable_hpd)(struct dw_hdmi_qp *hdmi, void *data); }; struct dw_hdmi_qp_plat_data { From patchwork Fri Jul 31 16:19:33 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Ciocaltea X-Patchwork-Id: 2827 Return-Path: X-Original-To: noreply@patchwork.local Delivered-To: noreply@patchwork.local Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114]) by mxe881.netcup.net (Postfix) with ESMTPS id 76CC51C0254 for ; Fri, 31 Jul 2026 18:33:33 +0200 (CEST) Authentication-Results: mxe881; dkim=pass header.d=collabora.com; spf=pass (sender IP is 172.105.105.114) smtp.mailfrom=linux-sunxi+bounces-24837-noreply=patchwork.local@lists.linux.dev smtp.helo=tor.lore.kernel.org Received-SPF: pass (mxe881: domain of lists.linux.dev designates 172.105.105.114 as permitted sender) client-ip=172.105.105.114; envelope-from=linux-sunxi+bounces-24837-noreply=patchwork.local@lists.linux.dev; helo=tor.lore.kernel.org; Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by tor.lore.kernel.org (Postfix) with ESMTP id E993A3172080 for ; Fri, 31 Jul 2026 16:24:10 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 25596469823; Fri, 31 Jul 2026 16:19:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="Y9mo1MSS" X-Original-To: linux-sunxi@lists.linux.dev Received: from bali.collaboradmins.com (bali.collaboradmins.com [148.251.105.195]) (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 EE9C2459ADE for ; Fri, 31 Jul 2026 16:19:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.251.105.195 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785514794; cv=none; b=dbkUONKEExrLqYU6CBQlOzVVzKAsJRZCZ0V8kb/3QoAb6g37rwiVVyVyN+IqnZZ3xuRXwOg21mJlaETlggfnCFm6raEVgLyJNmV61poncH2wV/9aXtW/nFey/VbeIksnPgaxOMp+fmD6PStXv+X3g1xddQBmusUtf9Q0PmodNg8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785514794; c=relaxed/simple; bh=8Oq1JKZ+6aISjMBfW/rB+bCdiIclZbkZhtUTs+Enj9E=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ux43L1TtORUx08nX/ejQBogEcpeEPwHYoRbX/IOaXTN5gYX0/6+AxUBf4w4hpPX/qQrDo8xAcbOT3IQrvOxErNGtQaMzXmbO7bAAj2DMzt7L/Q7MJjQHROoIv+AGx4vzVLTSs0DZe+jVJYfKM0GUg+gyElbSqSLL9FQEDVcCR44= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=Y9mo1MSS; arc=none smtp.client-ip=148.251.105.195 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1785514773; bh=8Oq1JKZ+6aISjMBfW/rB+bCdiIclZbkZhtUTs+Enj9E=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=Y9mo1MSSugUDTQ7PYBx1WjuXhx5EsAdDS9RCFSO+TcQkTsD7kaDAorFb/idNuTTqT U5Cshp4VcWU/CvEndyCPYEHpth0a5w8p+CffpAVvJXhFpqEIr0BeFfZJKRHWANpxiN IekxEFY4dpNbJ53B6YtAwvTGGeIriDSi2fdiJouNZlH8/opyk2EXajafw5FKnS/Saa B7AhaDRlplu5gwR+92ObMQY2YB3sGtrauPrXddbqgjX5Patak82VOf5+/pAREbypKY JTmmPUAFyYZA3UFRKz1ljTOErR2rJ0sD7aodIIyNoG6KEsq29lB/qQbOL4EdGWLluF a4cM28tR/16tg== Received: from localhost (unknown [100.64.0.241]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange secp256r1 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: cristicc) by bali.collaboradmins.com (Postfix) with ESMTPSA id 7306517E095A; Fri, 31 Jul 2026 18:19:33 +0200 (CEST) From: Cristian Ciocaltea Date: Fri, 31 Jul 2026 19:19:33 +0300 Subject: [PATCH v10 26/69] drm/bridge: dw-hdmi-qp: Remove unused workqueue include and define Precedence: bulk X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20260731-dw-hdmi-qp-scramb-v10-26-294364b2cf15@collabora.com> References: <20260731-dw-hdmi-qp-scramb-v10-0-294364b2cf15@collabora.com> In-Reply-To: <20260731-dw-hdmi-qp-scramb-v10-0-294364b2cf15@collabora.com> To: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Luca Ceresoli , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Chen-Yu Tsai , Samuel Holland , Dave Stevenson , =?utf-8?q?Ma=C3=ADra_Canal?= , Raspberry Pi Kernel Maintenance , Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Andy Yan , Algea Cao , Daniel Stone , Liu Ying , Phong LE Cc: kernel@collabora.com, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-rockchip@lists.infradead.org X-Mailer: b4 0.15.2 X-Rspamd-Server: rspamd-worker-8404 X-Spamd-Result: default: False [-2.16 / 15.00]; BAYES_HAM(-5.50)[100.00%]; RBL_SENDERSCORE(2.00)[172.105.105.114:from]; SUSPICIOUS_RECIPS(1.50)[]; MAILLIST(-0.15)[generic]; BAD_REP_POLICIES(0.10)[]; MIME_GOOD(-0.10)[text/plain]; HAS_LIST_UNSUB(-0.01)[]; R_DKIM_ALLOW(0.00)[collabora.com:s=mail]; ARC_ALLOW(0.00)[subspace.kernel.org:s=arc-20240116:i=1]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_TWELVE(0.00)[30]; PRECEDENCE_BULK(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[tor.lore.kernel.org:rdns,tor.lore.kernel.org:helo,collabora.com:email,collabora.com:dkim]; TAGGED_RCPT(0.00)[]; FORGED_SENDER_MAILLIST(0.00)[]; RCVD_COUNT_FIVE(0.00)[5]; ASN(0.00)[asn:63949, ipnet:172.105.96.0/20, country:SG]; DKIM_TRACE(0.00)[collabora.com:+]; DMARC_POLICY_ALLOW(0.00)[collabora.com,none]; R_SPF_ALLOW(0.00)[+ip4:172.105.105.114]; TO_DN_SOME(0.00)[]; FROM_NEQ_ENVFROM(0.00)[cristian.ciocaltea@collabora.com,linux-sunxi@lists.linux.dev]; FREEMAIL_TO(0.00)[intel.com,linaro.org,kernel.org,ideasonboard.com,kwiboo.se,gmail.com,bootlin.com,linux.intel.com,suse.de,ffwll.ch,sholland.org,raspberrypi.com,igalia.com,rock-chips.com,sntech.de,collabora.com,nxp.com,baylibre.com]; MIME_TRACE(0.00)[0:+]; TAGGED_FROM(0.00)[bounces-24837-noreply=patchwork.local]; FORGED_RECIPIENTS_MAILLIST(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[] X-Rspamd-Queue-Id: 76CC51C0254 X-MORS-Enabled: yes X-MORS-DOMAIN: patchwork.local X-MORS-HOSTING: hosting172546 X-MORS-USER: hosting172546 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= linux/workqueue.h is no longer needed, and SCRAMB_POLL_DELAY_MS is unused. Remove them. Signed-off-by: Cristian Ciocaltea --- drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c index a0613f0d2ebc..246c4161e627 100644 --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c @@ -15,7 +15,6 @@ #include #include #include -#include #include #include @@ -38,8 +37,6 @@ #define DDC_CI_ADDR 0x37 #define DDC_SEGMENT_ADDR 0x30 -#define SCRAMB_POLL_DELAY_MS 3000 - /* * Unless otherwise noted, entries in this table are 100% optimization. * Values can be obtained from dw_hdmi_qp_compute_n() but that function is From patchwork Fri Jul 31 16:19:34 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Ciocaltea X-Patchwork-Id: 2826 Return-Path: X-Original-To: noreply@patchwork.local Delivered-To: noreply@patchwork.local Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114]) by mxe881.netcup.net (Postfix) with ESMTPS id 6E8501C0254 for ; Fri, 31 Jul 2026 18:32:57 +0200 (CEST) Authentication-Results: mxe881; dkim=pass header.d=collabora.com; spf=pass (sender IP is 172.105.105.114) smtp.mailfrom=linux-sunxi+bounces-24835-noreply=patchwork.local@lists.linux.dev smtp.helo=tor.lore.kernel.org Received-SPF: pass (mxe881: domain of lists.linux.dev designates 172.105.105.114 as permitted sender) client-ip=172.105.105.114; envelope-from=linux-sunxi+bounces-24835-noreply=patchwork.local@lists.linux.dev; helo=tor.lore.kernel.org; Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by tor.lore.kernel.org (Postfix) with ESMTP id 17DAE3161CB6 for ; Fri, 31 Jul 2026 16:23:39 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2A260466B03; Fri, 31 Jul 2026 16:19:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="J3MWfpfP" X-Original-To: linux-sunxi@lists.linux.dev Received: from bali.collaboradmins.com (bali.collaboradmins.com [148.251.105.195]) (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 ECCFE459AD7 for ; Fri, 31 Jul 2026 16:19:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.251.105.195 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785514791; cv=none; b=G+yh11MyqT1vFnbpfpOIteIV8xO1k2tYGYzK99ZNPB/B28DWslohA3tb8ptN248zwiyQP8ihXR0+UlzfSSRPUs078Qlv5e2+GdJrdeP5uZmjF0/KKwmI0pCuuEeunkxmJQCOP5QTE1pLivkIK85GZDFwLO1vSCmLIroilZ/Pu4w= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785514791; c=relaxed/simple; bh=F/ORXJLv87LmKmtOIy0lgbR5TcfqZIJa8uHK88OlK5U=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=SDvEv77GpiTw+fxBOBiVHl8JtWrm+Vtba2THMmeGplOR5iiHqmc7Soryi2M/gw/bcrE8sjmltizFDH/Y8eH7MkJ1foHYsHBZRGmRa1uL8mTO8E+2sgxcjkEf/CYzcZzHsKEHw4hf9vX36KjQgtfeN+gMtxfPM0lSVM0vtUp8Pfw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=J3MWfpfP; arc=none smtp.client-ip=148.251.105.195 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1785514774; bh=F/ORXJLv87LmKmtOIy0lgbR5TcfqZIJa8uHK88OlK5U=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=J3MWfpfPXI9l7szvDtMyKjDWsaxejYvAiwBFMRED/dY0sfSoK4zESg19H5Jrg3inw FtQW2ZehMvrQeTNrPShmo8xWH6Ny/M9+N/7C6pd7YnG6zGHguLrQJCwfbztEH7/vV3 wsjDLy7Hx/u0HWVVkDy8Rm4jVTKRrLCTlyjla5IlkeQy4cflbq8fSt5MJV11ZeaMhr 5r/mlVLjQEJIC2je7u8+wToI9nakvpohcnjj+EFc/3Lgf58M6aDZtGWUVNnywVbxUR 0Me6z/MkhkfACpyVwm6tt32/nLa90n8JfSzPrbitqpiopxtGt3H+iMopVjGb58GzJT pVwhbTo6j624Q== Received: from localhost (unknown [100.64.0.241]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange secp256r1 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: cristicc) by bali.collaboradmins.com (Postfix) with ESMTPSA id 26D4A17E095D; Fri, 31 Jul 2026 18:19:34 +0200 (CEST) From: Cristian Ciocaltea Date: Fri, 31 Jul 2026 19:19:34 +0300 Subject: [PATCH v10 27/69] drm/bridge: dw-hdmi-qp: Add HDMI 2.0 scrambling support Precedence: bulk X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20260731-dw-hdmi-qp-scramb-v10-27-294364b2cf15@collabora.com> References: <20260731-dw-hdmi-qp-scramb-v10-0-294364b2cf15@collabora.com> In-Reply-To: <20260731-dw-hdmi-qp-scramb-v10-0-294364b2cf15@collabora.com> To: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Luca Ceresoli , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Chen-Yu Tsai , Samuel Holland , Dave Stevenson , =?utf-8?q?Ma=C3=ADra_Canal?= , Raspberry Pi Kernel Maintenance , Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Andy Yan , Algea Cao , Daniel Stone , Liu Ying , Phong LE Cc: kernel@collabora.com, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-rockchip@lists.infradead.org, Maud Spierings , Diederik de Haas X-Mailer: b4 0.15.2 X-MORS-Enabled: yes X-MORS-DOMAIN: patchwork.local X-MORS-HOSTING: hosting172546 X-MORS-USER: hosting172546 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= Add support for SCDC scrambling and the high TMDS clock ratio required by HDMI 2.0 modes with TMDS character rates above 340 MHz, such as 4K@60Hz. Hook the bridge into the DRM HDMI connector scrambling helpers so the sink-side SCDC state and the controller scrambler are updated together as part of the atomic enable and disable paths. This allows the driver to advertise HDMI 2.0 support when HPD is available. Keep no-HPD configurations limited to HDMI 1.4, since SCDC access requires a connected HDMI sink. Modes above the HDMI 2.0 600 MHz TMDS character-rate limit are now implicitly rejected by the DRM HDMI connector/bridge infrastructure, making the dw_hdmi_qp_bridge_tmds_char_rate_valid() callback redundant. Drop it. Tested-by: Maud Spierings Tested-by: Diederik de Haas # NanoPC-T6 LTS, Rock 5B Acked-by: Heiko Stuebner Signed-off-by: Cristian Ciocaltea --- drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c | 60 ++++++++++++++++++---------- 1 file changed, 39 insertions(+), 21 deletions(-) diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c index 246c4161e627..ee74266b7aa9 100644 --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c @@ -2,6 +2,7 @@ /* * Copyright (c) 2021-2022 Rockchip Electronics Co., Ltd. * Copyright (c) 2024 Collabora Ltd. + * Copyright (c) 2025 Amazon.com, Inc. or its affiliates. * * Author: Algea Cao * Author: Cristian Ciocaltea @@ -751,6 +752,7 @@ static void dw_hdmi_qp_bridge_atomic_enable(struct drm_bridge *bridge, struct drm_connector_state *conn_state; struct drm_connector *connector; unsigned int op_mode; + int ret; connector = drm_atomic_get_new_connector_for_encoder(state, bridge->encoder); if (WARN_ON(!connector)) @@ -761,14 +763,20 @@ static void dw_hdmi_qp_bridge_atomic_enable(struct drm_bridge *bridge, return; if (connector->display_info.is_hdmi) { - dev_dbg(hdmi->dev, "%s mode=HDMI %s rate=%llu bpc=%u\n", __func__, - drm_hdmi_connector_get_output_format_name(conn_state->hdmi.output_format), - conn_state->hdmi.tmds_char_rate, conn_state->hdmi.output_bpc); op_mode = 0; hdmi->tmds_char_rate = conn_state->hdmi.tmds_char_rate; + + ret = drm_connector_hdmi_enable_scrambling(connector, conn_state); + if (ret) + dev_warn(hdmi->dev, "Failed to enable scrambling: %d\n", ret); + + dev_dbg(hdmi->dev, "%s mode=HDMI %s rate=%llu bpc=%u scramb=%d\n", __func__, + drm_hdmi_connector_get_output_format_name(conn_state->hdmi.output_format), + conn_state->hdmi.tmds_char_rate, conn_state->hdmi.output_bpc, + connector->hdmi.scrambler_enabled); } else { - dev_dbg(hdmi->dev, "%s mode=DVI\n", __func__); op_mode = OPMODE_DVI; + dev_dbg(hdmi->dev, "%s mode=DVI\n", __func__); } hdmi->phy.ops->init(hdmi, hdmi->phy.data); @@ -783,9 +791,13 @@ static void dw_hdmi_qp_bridge_atomic_disable(struct drm_bridge *bridge, struct drm_atomic_commit *state) { struct dw_hdmi_qp *hdmi = bridge->driver_private; + struct drm_connector *connector; hdmi->tmds_char_rate = 0; + connector = drm_atomic_get_old_connector_for_encoder(state, bridge->encoder); + drm_connector_hdmi_disable_scrambling(connector); + hdmi->phy.ops->disable(hdmi, hdmi->phy.data); } @@ -820,24 +832,24 @@ dw_hdmi_qp_bridge_edid_read(struct drm_bridge *bridge, return drm_edid; } -static enum drm_mode_status -dw_hdmi_qp_bridge_tmds_char_rate_valid(const struct drm_bridge *bridge, - const struct drm_display_mode *mode, - unsigned long long rate) +static int dw_hdmi_qp_bridge_scrambler_enable(struct drm_bridge *bridge) { struct dw_hdmi_qp *hdmi = bridge->driver_private; - /* - * TODO: when hdmi->no_hpd is 1 we must not support modes that - * require scrambling, including every mode with a clock above - * HDMI_1_3_TMDS_CHAR_RATE_MAX_HZ. - */ - if (rate > HDMI_1_3_TMDS_CHAR_RATE_MAX_HZ) { - dev_dbg(hdmi->dev, "Unsupported TMDS char rate: %lld\n", rate); - return MODE_CLOCK_HIGH; - } + dw_hdmi_qp_write(hdmi, 1, SCRAMB_CONFIG0); + dev_dbg(hdmi->dev, "scrambler enabled\n"); - return MODE_OK; + return 0; +} + +static int dw_hdmi_qp_bridge_scrambler_disable(struct drm_bridge *bridge) +{ + struct dw_hdmi_qp *hdmi = bridge->driver_private; + + dw_hdmi_qp_write(hdmi, 0, SCRAMB_CONFIG0); + dev_dbg(hdmi->dev, "scrambler disabled\n"); + + return 0; } static int dw_hdmi_qp_bridge_clear_avi_infoframe(struct drm_bridge *bridge) @@ -1213,7 +1225,8 @@ static const struct drm_bridge_funcs dw_hdmi_qp_bridge_funcs = { .hpd_enable = dw_hdmi_qp_bridge_hpd_enable, .hpd_disable = dw_hdmi_qp_bridge_hpd_disable, .edid_read = dw_hdmi_qp_bridge_edid_read, - .hdmi_tmds_char_rate_valid = dw_hdmi_qp_bridge_tmds_char_rate_valid, + .hdmi_scrambler_enable = dw_hdmi_qp_bridge_scrambler_enable, + .hdmi_scrambler_disable = dw_hdmi_qp_bridge_scrambler_disable, .hdmi_clear_avi_infoframe = dw_hdmi_qp_bridge_clear_avi_infoframe, .hdmi_write_avi_infoframe = dw_hdmi_qp_bridge_write_avi_infoframe, .hdmi_clear_hdmi_infoframe = dw_hdmi_qp_bridge_clear_hdmi_infoframe, @@ -1341,13 +1354,18 @@ struct dw_hdmi_qp *dw_hdmi_qp_bind(struct platform_device *pdev, DRM_BRIDGE_OP_HDMI_AUDIO | DRM_BRIDGE_OP_HDMI_HDR_DRM_INFOFRAME | DRM_BRIDGE_OP_HDMI_SPD_INFOFRAME; - if (!hdmi->no_hpd) - hdmi->bridge.ops |= DRM_BRIDGE_OP_HPD; hdmi->bridge.of_node = pdev->dev.of_node; hdmi->bridge.type = DRM_MODE_CONNECTOR_HDMIA; hdmi->bridge.vendor = "Synopsys"; hdmi->bridge.product = "DW HDMI QP TX"; + if (hdmi->no_hpd) { + hdmi->bridge.supported_hdmi_ver = HDMI_VERSION_1_4; + } else { + hdmi->bridge.supported_hdmi_ver = HDMI_VERSION_2_0; + hdmi->bridge.ops |= DRM_BRIDGE_OP_HPD; + } + if (plat_data->supported_formats) hdmi->bridge.supported_formats = plat_data->supported_formats; From patchwork Fri Jul 31 16:19:35 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Ciocaltea X-Patchwork-Id: 2839 Return-Path: X-Original-To: noreply@patchwork.local Delivered-To: noreply@patchwork.local Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114]) by mxe881.netcup.net (Postfix) with ESMTPS id 4657F1C20B3 for ; Fri, 31 Jul 2026 18:35:19 +0200 (CEST) Authentication-Results: mxe881; dkim=pass header.d=collabora.com; spf=pass (sender IP is 172.105.105.114) smtp.mailfrom=linux-sunxi+bounces-24864-noreply=patchwork.local@lists.linux.dev smtp.helo=tor.lore.kernel.org Received-SPF: pass (mxe881: domain of lists.linux.dev designates 172.105.105.114 as permitted sender) client-ip=172.105.105.114; envelope-from=linux-sunxi+bounces-24864-noreply=patchwork.local@lists.linux.dev; helo=tor.lore.kernel.org; Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by tor.lore.kernel.org (Postfix) with ESMTP id 7036C3194E20 for ; Fri, 31 Jul 2026 16:25:54 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 49B7A46D082; Fri, 31 Jul 2026 16:20:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="VKoe5QEx" X-Original-To: linux-sunxi@lists.linux.dev Received: from bali.collaboradmins.com (bali.collaboradmins.com [148.251.105.195]) (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 C4E0C46AA7C for ; Fri, 31 Jul 2026 16:20:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.251.105.195 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785514811; cv=none; b=Wc1SU+UKfYumVU5uu2h3ASo5OL5jSz2G37J4XutksTPOmGwOErXo7rZDZ+G0Jer6svyBOZFFHJRA3I+H7GPav739sWzOFWEdmzSU9SZZG+f+CPl54vwRuj0TbGGVwp0+qMMCDZRu+blQ9Wosmrv8p1Js/GVNe2pPNLvUqiI0Lyc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785514811; c=relaxed/simple; bh=qtNL65/c4PhNmZPiAInduzePTu8PpXnaj5N7uxfmkyI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=eXfL5RRPs9Wxs3iaG5UvalARoqthFR+SGyIYgTGqOWDgFOz9eN1Y2tEY42WDYE+eqlw6k68vgNEV1Trv8SKdHXGPp9a9no9SISMUidpq4jklvnqqn8L5F7HQerAX/gryFnFGd8hqKss1dDr/ccnpMmy3qHu9Ucti/aNCABfM6jo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=VKoe5QEx; arc=none smtp.client-ip=148.251.105.195 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1785514775; bh=qtNL65/c4PhNmZPiAInduzePTu8PpXnaj5N7uxfmkyI=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=VKoe5QExB0CyfPg02pl59/CFBcolK/mHiHrCMoobNg46aWuiF5P8pJmUGZGZ60h2X aw5rsqqpCTCxEOWL6168R8SG//5pQYy/JdF2QzejxRhEdBoGCMvU7Gey2B5kxegFqd riFHIB29DLi/o3SneP4rJGV+3n48KLLaXgkVEHp6cZnmaENyDEdDE8F8DVpxMOXGeC Z4DNL20a4hCUHO8eFIKFPrnIFA+nmsk4cD9BGIgeGchatQxgZqfsfaI6zaA4ULAA6h 52Dt2dp7OOgQijVkdtwPB2ku68bKcBaUkN2RosylTmjODpDPiBVAlNCIGxhIz0/veG mG3lbNXZqYkHw== Received: from localhost (unknown [100.64.0.241]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange secp256r1 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: cristicc) by bali.collaboradmins.com (Postfix) with ESMTPSA id DE67217E08D6; Fri, 31 Jul 2026 18:19:34 +0200 (CEST) From: Cristian Ciocaltea Date: Fri, 31 Jul 2026 19:19:35 +0300 Subject: [PATCH v10 28/69] drm/bridge: dw-hdmi-qp: Provide dw_hdmi_qp_hpd_notify() helper Precedence: bulk X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20260731-dw-hdmi-qp-scramb-v10-28-294364b2cf15@collabora.com> References: <20260731-dw-hdmi-qp-scramb-v10-0-294364b2cf15@collabora.com> In-Reply-To: <20260731-dw-hdmi-qp-scramb-v10-0-294364b2cf15@collabora.com> To: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Luca Ceresoli , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Chen-Yu Tsai , Samuel Holland , Dave Stevenson , =?utf-8?q?Ma=C3=ADra_Canal?= , Raspberry Pi Kernel Maintenance , Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Andy Yan , Algea Cao , Daniel Stone , Liu Ying , Phong LE Cc: kernel@collabora.com, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-rockchip@lists.infradead.org, Maud Spierings , Diederik de Haas X-Mailer: b4 0.15.2 X-MORS-Enabled: yes X-MORS-DOMAIN: patchwork.local X-MORS-HOSTING: hosting172546 X-MORS-USER: hosting172546 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= Export dw_hdmi_qp_hpd_notify() for platform drivers to report hot-plug detection events. Unlike drm_helper_hpd_irq_event() which polls all connectors, this helper targets only the affected connector and ensures .detect_ctx() is invoked on reconnection events to trigger SCDC state recovery. Note that this helper may sleep, so it must only be called from a threaded HPD interrupt handler or a work function. Tested-by: Maud Spierings Tested-by: Diederik de Haas # NanoPC-T6 LTS, Rock 5B Signed-off-by: Cristian Ciocaltea --- drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c | 37 ++++++++++++++++++++++++++++ include/drm/bridge/dw_hdmi_qp.h | 1 + 2 files changed, 38 insertions(+) diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c index ee74266b7aa9..a2277531182c 100644 --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c @@ -28,6 +28,7 @@ #include #include #include +#include #include @@ -163,6 +164,8 @@ struct dw_hdmi_qp { struct regmap *regm; int main_irq; + /* Written by the atomic enable/disable hooks, read locklessly by HPD */ + struct drm_connector *curr_conn; unsigned long tmds_char_rate; bool no_hpd; }; @@ -785,6 +788,8 @@ static void dw_hdmi_qp_bridge_atomic_enable(struct drm_bridge *bridge, dw_hdmi_qp_mod(hdmi, op_mode, OPMODE_DVI, LINK_CONFIG0); drm_atomic_helper_connector_hdmi_update_infoframes(connector, state); + + WRITE_ONCE(hdmi->curr_conn, connector); } static void dw_hdmi_qp_bridge_atomic_disable(struct drm_bridge *bridge, @@ -793,6 +798,7 @@ static void dw_hdmi_qp_bridge_atomic_disable(struct drm_bridge *bridge, struct dw_hdmi_qp *hdmi = bridge->driver_private; struct drm_connector *connector; + WRITE_ONCE(hdmi->curr_conn, NULL); hdmi->tmds_char_rate = 0; connector = drm_atomic_get_old_connector_for_encoder(state, bridge->encoder); @@ -1409,6 +1415,37 @@ struct dw_hdmi_qp *dw_hdmi_qp_bind(struct platform_device *pdev, } EXPORT_SYMBOL_GPL(dw_hdmi_qp_bind); +/** + * dw_hdmi_qp_hpd_notify() - Notify a hot-plug detection event + * @hdmi: pointer to the DW HDMI QP controller + * + * Platform drivers should call this from their threaded IRQ handler or work + * function to notify the bridge of a connection status change. + * The bridge's .read_hpd() phy_ops callback is used to read the current + * connection status. + */ +void dw_hdmi_qp_hpd_notify(struct dw_hdmi_qp *hdmi) +{ + struct drm_connector *conn = READ_ONCE(hdmi->curr_conn); + enum drm_connector_status status; + + status = hdmi->phy.ops->read_hpd(hdmi, hdmi->phy.data); + dev_dbg(hdmi->dev, "%s status=%d\n", __func__, status); + + /* + * When the display pipeline has been already active, switch to + * drm_connector_helper_hpd_irq_event() to ensure .detect_ctx() + * gets invoked, i.e. via drm_helper_probe_detect(), because + * drm_bridge_hpd_notify() defers to a delayed hotplug path in + * this case. + */ + if (conn && status == connector_status_connected) + drm_connector_helper_hpd_irq_event(conn); + else + drm_bridge_hpd_notify(&hdmi->bridge, status); +} +EXPORT_SYMBOL_GPL(dw_hdmi_qp_hpd_notify); + void dw_hdmi_qp_suspend(struct device *dev, struct dw_hdmi_qp *hdmi) { disable_irq(hdmi->main_irq); diff --git a/include/drm/bridge/dw_hdmi_qp.h b/include/drm/bridge/dw_hdmi_qp.h index b80fceffc315..b4fb1c578a5b 100644 --- a/include/drm/bridge/dw_hdmi_qp.h +++ b/include/drm/bridge/dw_hdmi_qp.h @@ -36,6 +36,7 @@ struct dw_hdmi_qp_plat_data { struct dw_hdmi_qp *dw_hdmi_qp_bind(struct platform_device *pdev, struct drm_encoder *encoder, const struct dw_hdmi_qp_plat_data *plat_data); +void dw_hdmi_qp_hpd_notify(struct dw_hdmi_qp *hdmi); void dw_hdmi_qp_suspend(struct device *dev, struct dw_hdmi_qp *hdmi); void dw_hdmi_qp_resume(struct device *dev, struct dw_hdmi_qp *hdmi); #endif /* __DW_HDMI_QP__ */ From patchwork Fri Jul 31 16:19:36 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Ciocaltea X-Patchwork-Id: 2883 Return-Path: X-Original-To: noreply@patchwork.local Delivered-To: noreply@patchwork.local Received: from sin.lore.kernel.org (sin.lore.kernel.org [104.64.211.4]) by mxe881.netcup.net (Postfix) with ESMTPS id EF9071C0256 for ; Fri, 31 Jul 2026 19:06:32 +0200 (CEST) Authentication-Results: mxe881; dkim=pass header.d=collabora.com; spf=pass (sender IP is 104.64.211.4) smtp.mailfrom=linux-sunxi+bounces-24860-noreply=patchwork.local@lists.linux.dev smtp.helo=sin.lore.kernel.org Received-SPF: pass (mxe881: domain of lists.linux.dev designates 104.64.211.4 as permitted sender) client-ip=104.64.211.4; envelope-from=linux-sunxi+bounces-24860-noreply=patchwork.local@lists.linux.dev; helo=sin.lore.kernel.org; Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by sin.lore.kernel.org (Postfix) with ESMTP id BC05B3040F51 for ; Fri, 31 Jul 2026 16:25:43 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 775E246C85C; Fri, 31 Jul 2026 16:20:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="Qpc0N2qY" X-Original-To: linux-sunxi@lists.linux.dev Received: from bali.collaboradmins.com (bali.collaboradmins.com [148.251.105.195]) (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 EF4AE44E64E for ; Fri, 31 Jul 2026 16:20:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.251.105.195 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785514809; cv=none; b=VAL2ZHzVsGmeWlLXL0eBGcZGgsWx3E2VOT/rmNZO/+anx200rrWdWZeLH5ifvq8+1OCBG6ReNfD3s5LaV1827DOXI1Dyrb1Gsr7ltMXPAyovnNuGcw3V1Xx+U/emjxc0hUatFsmOVAo2sQMcb9i6RdueWA+2DLDRaQPw0udVqdI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785514809; c=relaxed/simple; bh=8nvSV+nWPFUZXqT08BM59NFazu9V0O6/Yz51yOFt+3A=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=EiNUW0HhKfHX/cT670Iy6OyHVTjYJHkHDwG2jkh5kLaI/ednszZCUuR7DGEpTChL6Lk/l/eM0e7Rwz8GsZf9Gz/p/QjBF758zmW5XU9nv8966VzTAI7Bp3g1LkaZqnyLYaa5cLwr6xuuhcX8uTb+Q51gQECcGs5CuirDVCixhKQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=Qpc0N2qY; arc=none smtp.client-ip=148.251.105.195 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1785514775; bh=8nvSV+nWPFUZXqT08BM59NFazu9V0O6/Yz51yOFt+3A=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=Qpc0N2qY9F96XlP1jiuBu23w9d7ybxKu1jufE0iVbV4zbVzIY2sN4E2fkMZ1E7Jvj +Cd4fHq/Sh2k7ZM3aD3QF3dgNNnMesOrVP2DItVCEPHUsEmS9ZaDfFF/1Rklm7JzLp ajrm1Dbcoh8fabQEyoISX0GNotZqhPQ6SrIPDWzsKeJ78QuPgOi7A/Txl9h+RIGczh 3YnaxaroHLPuXq9ELek0WqPJ2SrYK8AKJmXYKiqALJ2c65bjupWIkJOZ6lUWhSVxBI +RqkAKltUhj0I8Dk5mp9eC349bG69lpkUZb/6MBNPMYfxmaA2b/d0RclpEdimrAfbX +1a2BF+psXVSw== Received: from localhost (unknown [100.64.0.241]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange secp256r1 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: cristicc) by bali.collaboradmins.com (Postfix) with ESMTPSA id A3C1817E095F; Fri, 31 Jul 2026 18:19:35 +0200 (CEST) From: Cristian Ciocaltea Date: Fri, 31 Jul 2026 19:19:36 +0300 Subject: [PATCH v10 29/69] drm/rockchip: dw_hdmi_qp: Fix invalid drvdata access in PM ops Precedence: bulk X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20260731-dw-hdmi-qp-scramb-v10-29-294364b2cf15@collabora.com> References: <20260731-dw-hdmi-qp-scramb-v10-0-294364b2cf15@collabora.com> In-Reply-To: <20260731-dw-hdmi-qp-scramb-v10-0-294364b2cf15@collabora.com> To: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Luca Ceresoli , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Chen-Yu Tsai , Samuel Holland , Dave Stevenson , =?utf-8?q?Ma=C3=ADra_Canal?= , Raspberry Pi Kernel Maintenance , Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Andy Yan , Algea Cao , Daniel Stone , Liu Ying , Phong LE Cc: kernel@collabora.com, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-rockchip@lists.infradead.org, Sashiko X-Mailer: b4 0.15.2 X-MORS-Enabled: yes X-MORS-DOMAIN: patchwork.local X-MORS-HOSTING: hosting172546 X-MORS-USER: hosting172546 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= The system-sleep PM callbacks fetch the driver state via dev_get_drvdata() and dereference it unconditionally. However, the platform device is bound by ->probe(), which merely registers a component, hence the callbacks may well run when no valid state is available: - Before the aggregate driver calls ->bind(), e.g. when the system suspends while probing is still deferred waiting for the VOP, dev_get_drvdata() returns NULL. - After ->unbind(), or when ->bind() fails past platform_set_drvdata(), drvdata is left pointing to memory obtained via drmm_kzalloc(), which is released together with the DRM device, while this platform device remains bound and PM-capable. Publish the driver data only after ->bind() completes successfully, and clear it in ->unbind(). This ensures that a non-NULL drvdata always represents live state, allowing each PM callback to rely on a single NULL check. Fixes: 128a9bf8ace2 ("drm/rockchip: Add basic RK3588 HDMI output support") Reported-by: Sashiko Closes: https://lore.kernel.org/all/20260702151550.8E14D1F000E9@smtp.kernel.org/ Closes: https://lore.kernel.org/all/20260723014811.1F9F01F000E9@smtp.kernel.org/ Signed-off-by: Cristian Ciocaltea --- drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c b/drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c index 9c4cf68d79d5..646a4cb96830 100644 --- a/drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c +++ b/drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c @@ -683,8 +683,6 @@ static int dw_hdmi_qp_rockchip_bind(struct device *dev, struct device *master, if (ret) return dev_err_probe(hdmi->dev, ret, "Failed to init encoder"); - platform_set_drvdata(pdev, hdmi); - hdmi->hdmi = dw_hdmi_qp_bind(pdev, encoder, &plat_data); if (IS_ERR(hdmi->hdmi)) return dev_err_probe(hdmi->dev, PTR_ERR(hdmi->hdmi), @@ -695,6 +693,8 @@ static int dw_hdmi_qp_rockchip_bind(struct device *dev, struct device *master, return dev_err_probe(hdmi->dev, PTR_ERR(connector), "Failed to init bridge connector\n"); + platform_set_drvdata(pdev, hdmi); + return 0; } @@ -704,6 +704,8 @@ static void dw_hdmi_qp_rockchip_unbind(struct device *dev, { struct rockchip_hdmi_qp *hdmi = dev_get_drvdata(dev); + dev_set_drvdata(dev, NULL); + cancel_delayed_work_sync(&hdmi->hpd_work); } @@ -726,7 +728,8 @@ static int __maybe_unused dw_hdmi_qp_rockchip_suspend(struct device *dev) { struct rockchip_hdmi_qp *hdmi = dev_get_drvdata(dev); - dw_hdmi_qp_suspend(dev, hdmi->hdmi); + if (hdmi) + dw_hdmi_qp_suspend(dev, hdmi->hdmi); return 0; } @@ -735,6 +738,9 @@ static int __maybe_unused dw_hdmi_qp_rockchip_resume(struct device *dev) { struct rockchip_hdmi_qp *hdmi = dev_get_drvdata(dev); + if (!hdmi) + return 0; + hdmi->ctrl_ops->io_init(hdmi); dw_hdmi_qp_resume(dev, hdmi->hdmi); From patchwork Fri Jul 31 16:19:37 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Ciocaltea X-Patchwork-Id: 2836 Return-Path: X-Original-To: noreply@patchwork.local Delivered-To: noreply@patchwork.local Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114]) by mxe881.netcup.net (Postfix) with ESMTPS id 94EA41C20B3 for ; Fri, 31 Jul 2026 18:34:34 +0200 (CEST) Authentication-Results: mxe881; dkim=pass header.d=collabora.com; spf=pass (sender IP is 172.105.105.114) smtp.mailfrom=linux-sunxi+bounces-24858-noreply=patchwork.local@lists.linux.dev smtp.helo=tor.lore.kernel.org Received-SPF: pass (mxe881: domain of lists.linux.dev designates 172.105.105.114 as permitted sender) client-ip=172.105.105.114; envelope-from=linux-sunxi+bounces-24858-noreply=patchwork.local@lists.linux.dev; helo=tor.lore.kernel.org; Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by tor.lore.kernel.org (Postfix) with ESMTP id E33853185A21 for ; Fri, 31 Jul 2026 16:25:08 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1F18346C4B8; Fri, 31 Jul 2026 16:20:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="PDesiiMF" X-Original-To: linux-sunxi@lists.linux.dev Received: from bali.collaboradmins.com (bali.collaboradmins.com [148.251.105.195]) (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 BE38E459ADE for ; Fri, 31 Jul 2026 16:19:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.251.105.195 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785514805; cv=none; b=QfS2QexELzPYQOTQN9HV4JeQD8gLKPu3tXvxgMjITzIqaBVB666tQvi1vcyLlm4Uy9zKr3GTS2Lk4XhCP8MrvGcl7DzsPBmVzZAwog6reX69kOGuwsnvzSQHs6gND9VrBriOOCAwrzsumGPNXoJGuJo0wWIMugMhjFFY8Mgb1C8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785514805; c=relaxed/simple; bh=0pZoBcYKk9FCtfu5YMrWLdOS0g+RVxG5yRMx6m6fO08=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=fHoYLgYk7BdEhT2JRAKKtQxmu8GzNv6C1vNQWX2hlcJFen5qCG6yFiBOTg3LXlXHZqBuTIKzBCvB9Fhb+NFg7DtkoS7oBNTx+PyLzC2xCK3qnmPq7p6UFhmMyKOfOdlBSMAWoc2H//i4SGhW+DuB6KVuoFqNWzc6XJqDHTk9CKI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=PDesiiMF; arc=none smtp.client-ip=148.251.105.195 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1785514776; bh=0pZoBcYKk9FCtfu5YMrWLdOS0g+RVxG5yRMx6m6fO08=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=PDesiiMFzhrIC3SQmtU7Uv3nG5etQEfAH60Q+CqI1bZF3Evcf38/pASAMxL0d3GPK PzYTw0P48xWvKsFw5tbKs88fiJtaXjA0aJLGOWL6Os97F7/P7XGEKmGQbfr/aDwUL5 iG1letnz+t4pL6a4YtH5ySwpmW1qTIxCiOmCfF21ha6Z3UrOWN/tc2fXDSRrMzzb8T RjWwWHjA9SzEwt4qwlgd7SkkA5216KitaYPoZtdSBd9JIZ6/DYwDu4DLKQiEXZYDEV gb44JlZ5FXsdVRDdZChUZfpUEJSR/rFrkIOrdWNTfUKBZadpKw7TKQDeJxSnZWsnl/ C3IrFnqUevXtg== Received: from localhost (unknown [100.64.0.241]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange secp256r1 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: cristicc) by bali.collaboradmins.com (Postfix) with ESMTPSA id 606FE17E0700; Fri, 31 Jul 2026 18:19:36 +0200 (CEST) From: Cristian Ciocaltea Date: Fri, 31 Jul 2026 19:19:37 +0300 Subject: [PATCH v10 30/69] drm/rockchip: dw_hdmi_qp: Cancel pending HPD work on suspend Precedence: bulk X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20260731-dw-hdmi-qp-scramb-v10-30-294364b2cf15@collabora.com> References: <20260731-dw-hdmi-qp-scramb-v10-0-294364b2cf15@collabora.com> In-Reply-To: <20260731-dw-hdmi-qp-scramb-v10-0-294364b2cf15@collabora.com> To: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Luca Ceresoli , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Chen-Yu Tsai , Samuel Holland , Dave Stevenson , =?utf-8?q?Ma=C3=ADra_Canal?= , Raspberry Pi Kernel Maintenance , Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Andy Yan , Algea Cao , Daniel Stone , Liu Ying , Phong LE Cc: kernel@collabora.com, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-rockchip@lists.infradead.org, Sashiko X-Mailer: b4 0.15.2 X-Rspamd-Server: rspamd-worker-8404 X-Spamd-Result: default: False [-2.16 / 15.00]; BAYES_HAM(-5.50)[100.00%]; RBL_SENDERSCORE(2.00)[172.105.105.114:from]; SUSPICIOUS_RECIPS(1.50)[]; MAILLIST(-0.15)[generic]; BAD_REP_POLICIES(0.10)[]; MIME_GOOD(-0.10)[text/plain]; HAS_LIST_UNSUB(-0.01)[]; RCVD_COUNT_FIVE(0.00)[5]; ARC_ALLOW(0.00)[subspace.kernel.org:s=arc-20240116:i=1]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_TWELVE(0.00)[31]; PRECEDENCE_BULK(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[collabora.com:email,collabora.com:dkim,tor.lore.kernel.org:rdns,tor.lore.kernel.org:helo]; TAGGED_RCPT(0.00)[]; FORGED_SENDER_MAILLIST(0.00)[]; R_DKIM_ALLOW(0.00)[collabora.com:s=mail]; ASN(0.00)[asn:63949, ipnet:172.105.96.0/20, country:SG]; DKIM_TRACE(0.00)[collabora.com:+]; DMARC_POLICY_ALLOW(0.00)[collabora.com,none]; R_SPF_ALLOW(0.00)[+ip4:172.105.105.114:c]; TO_DN_SOME(0.00)[]; FROM_NEQ_ENVFROM(0.00)[cristian.ciocaltea@collabora.com,linux-sunxi@lists.linux.dev]; FREEMAIL_TO(0.00)[intel.com,linaro.org,kernel.org,ideasonboard.com,kwiboo.se,gmail.com,bootlin.com,linux.intel.com,suse.de,ffwll.ch,sholland.org,raspberrypi.com,igalia.com,rock-chips.com,sntech.de,collabora.com,nxp.com,baylibre.com]; MIME_TRACE(0.00)[0:+]; TAGGED_FROM(0.00)[bounces-24858-noreply=patchwork.local]; FORGED_RECIPIENTS_MAILLIST(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[] X-Rspamd-Queue-Id: 94EA41C20B3 X-MORS-Enabled: yes X-MORS-DOMAIN: patchwork.local X-MORS-HOSTING: hosting172546 X-MORS-USER: hosting172546 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= The HPD threaded handler debounces hotplug events by delaying hdmi->hpd_work for 150 ms. Nothing discards that work when the system goes to sleep: drm_kms_helper_poll_disable() only disables the HPD IRQ line via the bridge .hpd_disable() op, and disable_irq() merely waits for the threaded handler, which has already returned after arming the timer. If the debounce expires during suspend, its non-freezable work may probe the connector and read the EDID over DDC. Since genpd powers off the HDMI controller's power domain in ->suspend_noirq(), this access may hit unpowered hardware and hang the system. Cancel the work in the suspend callback. The DRM device is registered as a consumer of the HDMI device, so it always suspends first and the HPD IRQ is already disabled by that point, meaning nothing can re-arm the work behind our back. No counterpart is needed on resume, as the work gets scheduled again on the next hotplug interrupt. Fixes: 128a9bf8ace2 ("drm/rockchip: Add basic RK3588 HDMI output support") Reported-by: Sashiko Closes: https://lore.kernel.org/all/20260723015909.7F79A1F000E9@smtp.kernel.org/ Signed-off-by: Cristian Ciocaltea --- drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c b/drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c index 646a4cb96830..e9fda67b8ca9 100644 --- a/drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c +++ b/drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c @@ -728,8 +728,12 @@ static int __maybe_unused dw_hdmi_qp_rockchip_suspend(struct device *dev) { struct rockchip_hdmi_qp *hdmi = dev_get_drvdata(dev); - if (hdmi) - dw_hdmi_qp_suspend(dev, hdmi->hdmi); + if (!hdmi) + return 0; + + dw_hdmi_qp_suspend(dev, hdmi->hdmi); + + cancel_delayed_work_sync(&hdmi->hpd_work); return 0; } From patchwork Fri Jul 31 16:19:38 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Ciocaltea X-Patchwork-Id: 2879 Return-Path: X-Original-To: noreply@patchwork.local Delivered-To: noreply@patchwork.local Received: from sin.lore.kernel.org (sin.lore.kernel.org [104.64.211.4]) by mxe881.netcup.net (Postfix) with ESMTPS id 5DC331C0256 for ; Fri, 31 Jul 2026 19:04:58 +0200 (CEST) Authentication-Results: mxe881; dkim=pass header.d=collabora.com; spf=pass (sender IP is 104.64.211.4) smtp.mailfrom=linux-sunxi+bounces-24845-noreply=patchwork.local@lists.linux.dev smtp.helo=sin.lore.kernel.org Received-SPF: pass (mxe881: domain of lists.linux.dev designates 104.64.211.4 as permitted sender) client-ip=104.64.211.4; envelope-from=linux-sunxi+bounces-24845-noreply=patchwork.local@lists.linux.dev; helo=sin.lore.kernel.org; Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by sin.lore.kernel.org (Postfix) with ESMTP id 2EE5730EC01E for ; Fri, 31 Jul 2026 16:24:28 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4659946985A; Fri, 31 Jul 2026 16:20:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="ldqJm2Kc" X-Original-To: linux-sunxi@lists.linux.dev Received: from bali.collaboradmins.com (bali.collaboradmins.com [148.251.105.195]) (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 E2E5645DF70 for ; Fri, 31 Jul 2026 16:19:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.251.105.195 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785514797; cv=none; b=Y6uj4qiEsXWlnkbWMFwsde8rHzpOTikgFmikwlQtmLebCQ93Tyh1Clrck5WUtuV6LTNTectjpaZQ+LoTfmRdtPAqL99wrLNdYHXULi4cCvEKauNFZLFMLMv8ORcd/LrH3htGMVsKqo+ixdp1yfoxvJZ+TwK2DggpUEhM6URJwBk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785514797; c=relaxed/simple; bh=nLsJmF2gP+Ibwk4xSRh3va9+XgtdrzUv0K++TOJHryQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=QguAjQueuJ5HnpVKIdj536hoekSrX8toSsK/ESEscFWN56a07o3NWlx2M2WA9VIbi6V8Ki2UuoKphS1wwkJroNBzBr12yI30DNqAnDNdFCGltFnd5jsfTULWJp/GZu+v6vHhz+/a84Y5xe8aEjeSfJFYPJ2eztoi1S4g5h2b1iE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=ldqJm2Kc; arc=none smtp.client-ip=148.251.105.195 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1785514777; bh=nLsJmF2gP+Ibwk4xSRh3va9+XgtdrzUv0K++TOJHryQ=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=ldqJm2Kckgv0TOuO4l+8QqCG3hXFQ+dFH6yul9YEWcUFPXwA2ik4FgAIjuAzLNQyF sLnvVe4W3HZz4OggJxTdvALq8C//2VkQv80yIjsFZg5giMNOMccqHYY6lnxabWplYW 2OA3hDsyP7CwEmxyAEjD6yb599HLigde4dzHnHMWLPAO8oLalwvsxvgKvmPt5+Cgsg YzyL0Wl6m0kbNNQHsG6aJi+gobQGQMg/MchorPapeXL1CTGYOJOYvdO6OqODSuAkWI hdI6Y3ai48rCiINGgqEMNx0vOIZiUZvxfTzfepQ91HBd2ZIaecW2nV4TKI5WGKWdNA KvTlJ/jrQ8djQ== Received: from localhost (unknown [100.64.0.241]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange secp256r1 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: cristicc) by bali.collaboradmins.com (Postfix) with ESMTPSA id 1436717E015B; Fri, 31 Jul 2026 18:19:37 +0200 (CEST) From: Cristian Ciocaltea Date: Fri, 31 Jul 2026 19:19:38 +0300 Subject: [PATCH v10 31/69] drm/rockchip: dw_hdmi_qp: Add missing newlines in dev_err_probe() messages Precedence: bulk X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20260731-dw-hdmi-qp-scramb-v10-31-294364b2cf15@collabora.com> References: <20260731-dw-hdmi-qp-scramb-v10-0-294364b2cf15@collabora.com> In-Reply-To: <20260731-dw-hdmi-qp-scramb-v10-0-294364b2cf15@collabora.com> To: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Luca Ceresoli , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Chen-Yu Tsai , Samuel Holland , Dave Stevenson , =?utf-8?q?Ma=C3=ADra_Canal?= , Raspberry Pi Kernel Maintenance , Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Andy Yan , Algea Cao , Daniel Stone , Liu Ying , Phong LE Cc: kernel@collabora.com, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-rockchip@lists.infradead.org, Maud Spierings , Diederik de Haas X-Mailer: b4 0.15.2 X-Rspamd-Server: rspamd-worker-8404 X-Spamd-Result: default: False [-2.16 / 15.00]; BAYES_HAM(-5.50)[100.00%]; RBL_SENDERSCORE(2.00)[104.64.211.4:from]; SUSPICIOUS_RECIPS(1.50)[]; MAILLIST(-0.15)[generic]; MIME_GOOD(-0.10)[text/plain]; BAD_REP_POLICIES(0.10)[]; HAS_LIST_UNSUB(-0.01)[]; ARC_ALLOW(0.00)[subspace.kernel.org:s=arc-20240116:i=1]; PRECEDENCE_BULK(0.00)[]; TAGGED_RCPT(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[collabora.com:email,collabora.com:dkim,sin.lore.kernel.org:rdns,sin.lore.kernel.org:helo,cknow-tech.com:email]; FROM_HAS_DN(0.00)[]; FREEMAIL_CC(0.00)[collabora.com,vger.kernel.org,lists.freedesktop.org,lists.infradead.org,lists.linux.dev,hotmail.com,cknow-tech.com]; RCPT_COUNT_TWELVE(0.00)[32]; R_DKIM_ALLOW(0.00)[collabora.com:s=mail]; RCVD_COUNT_FIVE(0.00)[5]; FROM_NEQ_ENVFROM(0.00)[cristian.ciocaltea@collabora.com,linux-sunxi@lists.linux.dev]; DMARC_POLICY_ALLOW(0.00)[collabora.com,none]; FREEMAIL_TO(0.00)[intel.com,linaro.org,kernel.org,ideasonboard.com,kwiboo.se,gmail.com,bootlin.com,linux.intel.com,suse.de,ffwll.ch,sholland.org,raspberrypi.com,igalia.com,rock-chips.com,sntech.de,collabora.com,nxp.com,baylibre.com]; DKIM_TRACE(0.00)[collabora.com:+]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(0.00)[+ip4:104.64.211.4]; FORGED_SENDER_MAILLIST(0.00)[]; FORGED_RECIPIENTS_MAILLIST(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:63949, ipnet:104.64.192.0/19, country:SG]; MIME_TRACE(0.00)[0:+]; TAGGED_FROM(0.00)[bounces-24845-noreply=patchwork.local]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[] X-Rspamd-Queue-Id: 5DC331C0256 X-MORS-Enabled: yes X-MORS-DOMAIN: patchwork.local X-MORS-HOSTING: hosting172546 X-MORS-USER: hosting172546 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= Add the missing trailing newlines to a couple of dev_err_probe() calls in dw_hdmi_qp_rockchip_bind(). Fixes: b6736a4ea3fa ("drm/rockchip: dw_hdmi_qp: Improve error handling with dev_err_probe()") Fixes: e1f7b7cbd74c ("drm/rockchip: dw_hdmi_qp: Switch to drmm_encoder_init()") Reviewed-by: Heiko Stuebner Tested-by: Maud Spierings Tested-by: Diederik de Haas # NanoPC-T6 LTS, Rock 5B Signed-off-by: Cristian Ciocaltea --- drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c b/drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c index e9fda67b8ca9..8b48558deb3e 100644 --- a/drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c +++ b/drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c @@ -681,12 +681,12 @@ static int dw_hdmi_qp_rockchip_bind(struct device *dev, struct device *master, drm_encoder_helper_add(encoder, &dw_hdmi_qp_rockchip_encoder_helper_funcs); ret = drmm_encoder_init(drm, encoder, NULL, DRM_MODE_ENCODER_TMDS, NULL); if (ret) - return dev_err_probe(hdmi->dev, ret, "Failed to init encoder"); + return dev_err_probe(hdmi->dev, ret, "Failed to init encoder\n"); hdmi->hdmi = dw_hdmi_qp_bind(pdev, encoder, &plat_data); if (IS_ERR(hdmi->hdmi)) return dev_err_probe(hdmi->dev, PTR_ERR(hdmi->hdmi), - "Failed to bind dw-hdmi-qp"); + "Failed to bind dw-hdmi-qp\n"); connector = drm_bridge_connector_init(drm, encoder); if (IS_ERR(connector)) From patchwork Fri Jul 31 16:19:39 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Ciocaltea X-Patchwork-Id: 2878 Return-Path: X-Original-To: noreply@patchwork.local Delivered-To: noreply@patchwork.local Received: from sin.lore.kernel.org (sin.lore.kernel.org [104.64.211.4]) by mxe881.netcup.net (Postfix) with ESMTPS id 72D561C09D5 for ; Fri, 31 Jul 2026 19:04:58 +0200 (CEST) Authentication-Results: mxe881; dkim=pass header.d=collabora.com; spf=pass (sender IP is 104.64.211.4) smtp.mailfrom=linux-sunxi+bounces-24846-noreply=patchwork.local@lists.linux.dev smtp.helo=sin.lore.kernel.org Received-SPF: pass (mxe881: domain of lists.linux.dev designates 104.64.211.4 as permitted sender) client-ip=104.64.211.4; envelope-from=linux-sunxi+bounces-24846-noreply=patchwork.local@lists.linux.dev; helo=sin.lore.kernel.org; Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by sin.lore.kernel.org (Postfix) with ESMTP id 1325130EC016 for ; Fri, 31 Jul 2026 16:24:28 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 46268469857; Fri, 31 Jul 2026 16:20:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="W/aXjGBk" X-Original-To: linux-sunxi@lists.linux.dev Received: from bali.collaboradmins.com (bali.collaboradmins.com [148.251.105.195]) (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 C410945D5D6 for ; Fri, 31 Jul 2026 16:19:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.251.105.195 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785514797; cv=none; b=irTEZ9HGfgtXB4UZM/taLmt9L4z2cEYueYv8p8WyNrEUowLzFnQr+uy5xM6tTLCMgJlt9I7gHwQiN58BnLIXWVPvgbTHhbWg9AbHKZkvFRG6SCVfUl0c/RykCKrBweZfHiUZJmhQF5EpvAhG6Uou8FZaPMPiMEbtZE4xdD/x9e0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785514797; c=relaxed/simple; bh=JbW8f4el2mFe4+XGbTbJU5Xyehv5uYd4tsQ5QlXCZF4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=JOWUwxjFjwmF6e1E4Q5n9RowoBbkJHywW4cet2mh/n17yUwvXAy4GHjP98plB6aK4NfZmSaLc3vvNqHbh3AegJEhDkj4+fSGsyJJNE+4MvfjB8szxCZoLfOGlk2gDXAgUvSU04Sykd0SSe7UwOJ39vNH6bH3ISqMXfHQcXIhVY0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=W/aXjGBk; arc=none smtp.client-ip=148.251.105.195 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1785514777; bh=JbW8f4el2mFe4+XGbTbJU5Xyehv5uYd4tsQ5QlXCZF4=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=W/aXjGBknObSn9h4jm72atc4N7ja2E0nqizFMJLXIpHrC8bkHFXs8JZBDs6wpMZLl cVx2t1thPLA65yEFRFp1d8od9ZWx0ZiXHMlfTi8/Z4NMDQeOOW8U4rCSe4Zf/yPw6b dlGs3nYN1Fruoq6J4DWuOUouh2kgZsov9EhyBLb/SRHKEwo5NeHNx2E6UpfvGcHlYx jNEFNNbQuZAWaCo+xI3X697xeDDITe/7fuSYwMeHF1GfeUKqH5jFpH1XR9ymCEAVRm vZhaz/nMfTzg9nvjNG0rmZ5F4wOWYB9JumYQ50s7P+bzhPG0BjZVctIpZfnA0HODEW SCKkSz44rc5oQ== Received: from localhost (unknown [100.64.0.241]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange secp256r1 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: cristicc) by bali.collaboradmins.com (Postfix) with ESMTPSA id C21C217E0213; Fri, 31 Jul 2026 18:19:37 +0200 (CEST) From: Cristian Ciocaltea Date: Fri, 31 Jul 2026 19:19:39 +0300 Subject: [PATCH v10 32/69] drm/rockchip: dw_hdmi_qp: Use local dev variable consistently in bind() Precedence: bulk X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20260731-dw-hdmi-qp-scramb-v10-32-294364b2cf15@collabora.com> References: <20260731-dw-hdmi-qp-scramb-v10-0-294364b2cf15@collabora.com> In-Reply-To: <20260731-dw-hdmi-qp-scramb-v10-0-294364b2cf15@collabora.com> To: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Luca Ceresoli , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Chen-Yu Tsai , Samuel Holland , Dave Stevenson , =?utf-8?q?Ma=C3=ADra_Canal?= , Raspberry Pi Kernel Maintenance , Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Andy Yan , Algea Cao , Daniel Stone , Liu Ying , Phong LE Cc: kernel@collabora.com, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-rockchip@lists.infradead.org, Maud Spierings , Diederik de Haas X-Mailer: b4 0.15.2 X-MORS-Enabled: yes X-MORS-DOMAIN: patchwork.local X-MORS-HOSTING: hosting172546 X-MORS-USER: hosting172546 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= Replace indirect struct device accesses via hdmi->dev and pdev->dev with the local dev parameter already available in dw_hdmi_qp_rockchip_bind(), for consistency and readability. Reviewed-by: Heiko Stuebner Tested-by: Maud Spierings Tested-by: Diederik de Haas # NanoPC-T6 LTS, Rock 5B Signed-off-by: Cristian Ciocaltea --- drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c | 33 +++++++++++++------------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c b/drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c index 8b48558deb3e..36043bf82273 100644 --- a/drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c +++ b/drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c @@ -563,7 +563,7 @@ static int dw_hdmi_qp_rockchip_bind(struct device *dev, struct device *master, struct clk *ref_clk; int ret, irq, i; - if (!pdev->dev.of_node) + if (!dev->of_node) return -ENODEV; hdmi = drmm_kzalloc(drm, sizeof(*hdmi), GFP_KERNEL); @@ -583,7 +583,7 @@ static int dw_hdmi_qp_rockchip_bind(struct device *dev, struct device *master, return dev_err_probe(dev, -ENODEV, "Missing platform ctrl ops\n"); hdmi->ctrl_ops = cfg->ctrl_ops; - hdmi->dev = &pdev->dev; + hdmi->dev = dev; hdmi->port_id = -ENODEV; /* Identify port ID by matching base IO address */ @@ -594,7 +594,7 @@ static int dw_hdmi_qp_rockchip_bind(struct device *dev, struct device *master, } } if (hdmi->port_id < 0) - return dev_err_probe(hdmi->dev, hdmi->port_id, + return dev_err_probe(dev, hdmi->port_id, "Failed to match HDMI port ID\n"); plat_data.phy_ops = cfg->phy_ops; @@ -622,37 +622,36 @@ static int dw_hdmi_qp_rockchip_bind(struct device *dev, struct device *master, hdmi->regmap = syscon_regmap_lookup_by_phandle(dev->of_node, "rockchip,grf"); if (IS_ERR(hdmi->regmap)) - return dev_err_probe(hdmi->dev, PTR_ERR(hdmi->regmap), + return dev_err_probe(dev, PTR_ERR(hdmi->regmap), "Unable to get rockchip,grf\n"); hdmi->vo_regmap = syscon_regmap_lookup_by_phandle(dev->of_node, "rockchip,vo-grf"); if (IS_ERR(hdmi->vo_regmap)) - return dev_err_probe(hdmi->dev, PTR_ERR(hdmi->vo_regmap), + return dev_err_probe(dev, PTR_ERR(hdmi->vo_regmap), "Unable to get rockchip,vo-grf\n"); - ret = devm_clk_bulk_get_all_enabled(hdmi->dev, &clks); + ret = devm_clk_bulk_get_all_enabled(dev, &clks); if (ret < 0) - return dev_err_probe(hdmi->dev, ret, "Failed to get clocks\n"); + return dev_err_probe(dev, ret, "Failed to get clocks\n"); - ref_clk = clk_get(hdmi->dev, "ref"); + ref_clk = clk_get(dev, "ref"); if (IS_ERR(ref_clk)) - return dev_err_probe(hdmi->dev, PTR_ERR(ref_clk), + return dev_err_probe(dev, PTR_ERR(ref_clk), "Failed to get ref clock\n"); plat_data.ref_clk_rate = clk_get_rate(ref_clk); clk_put(ref_clk); - hdmi->frl_enable_gpio = devm_gpiod_get_optional(hdmi->dev, "frl-enable", + hdmi->frl_enable_gpio = devm_gpiod_get_optional(dev, "frl-enable", GPIOD_OUT_LOW); if (IS_ERR(hdmi->frl_enable_gpio)) - return dev_err_probe(hdmi->dev, PTR_ERR(hdmi->frl_enable_gpio), + return dev_err_probe(dev, PTR_ERR(hdmi->frl_enable_gpio), "Failed to request FRL enable GPIO\n"); hdmi->phy = devm_of_phy_get_by_index(dev, dev->of_node, 0); if (IS_ERR(hdmi->phy)) - return dev_err_probe(hdmi->dev, PTR_ERR(hdmi->phy), - "Failed to get phy\n"); + return dev_err_probe(dev, PTR_ERR(hdmi->phy), "Failed to get phy\n"); cfg->ctrl_ops->io_init(hdmi); @@ -670,7 +669,7 @@ static int dw_hdmi_qp_rockchip_bind(struct device *dev, struct device *master, if (irq < 0) return irq; - ret = devm_request_threaded_irq(hdmi->dev, irq, + ret = devm_request_threaded_irq(dev, irq, cfg->ctrl_ops->hardirq_callback, cfg->ctrl_ops->irq_callback, IRQF_SHARED, "dw-hdmi-qp-hpd", @@ -681,16 +680,16 @@ static int dw_hdmi_qp_rockchip_bind(struct device *dev, struct device *master, drm_encoder_helper_add(encoder, &dw_hdmi_qp_rockchip_encoder_helper_funcs); ret = drmm_encoder_init(drm, encoder, NULL, DRM_MODE_ENCODER_TMDS, NULL); if (ret) - return dev_err_probe(hdmi->dev, ret, "Failed to init encoder\n"); + return dev_err_probe(dev, ret, "Failed to init encoder\n"); hdmi->hdmi = dw_hdmi_qp_bind(pdev, encoder, &plat_data); if (IS_ERR(hdmi->hdmi)) - return dev_err_probe(hdmi->dev, PTR_ERR(hdmi->hdmi), + return dev_err_probe(dev, PTR_ERR(hdmi->hdmi), "Failed to bind dw-hdmi-qp\n"); connector = drm_bridge_connector_init(drm, encoder); if (IS_ERR(connector)) - return dev_err_probe(hdmi->dev, PTR_ERR(connector), + return dev_err_probe(dev, PTR_ERR(connector), "Failed to init bridge connector\n"); platform_set_drvdata(pdev, hdmi); From patchwork Fri Jul 31 16:19:40 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Ciocaltea X-Patchwork-Id: 2832 Return-Path: X-Original-To: noreply@patchwork.local Delivered-To: noreply@patchwork.local Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114]) by mxe881.netcup.net (Postfix) with ESMTPS id 3BE021C0254 for ; Fri, 31 Jul 2026 18:33:55 +0200 (CEST) Authentication-Results: mxe881; dkim=pass header.d=collabora.com; spf=pass (sender IP is 172.105.105.114) smtp.mailfrom=linux-sunxi+bounces-24842-noreply=patchwork.local@lists.linux.dev smtp.helo=tor.lore.kernel.org Received-SPF: pass (mxe881: domain of lists.linux.dev designates 172.105.105.114 as permitted sender) client-ip=172.105.105.114; envelope-from=linux-sunxi+bounces-24842-noreply=patchwork.local@lists.linux.dev; helo=tor.lore.kernel.org; Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by tor.lore.kernel.org (Postfix) with ESMTP id 7F1D03177C09 for ; Fri, 31 Jul 2026 16:24:29 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 468A246985C; Fri, 31 Jul 2026 16:20:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="iTU4mu4H" X-Original-To: linux-sunxi@lists.linux.dev Received: from bali.collaboradmins.com (bali.collaboradmins.com [148.251.105.195]) (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 DB93045DF5F for ; Fri, 31 Jul 2026 16:19:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.251.105.195 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785514797; cv=none; b=QutouPfWADETkHsqToL/6ZoEdszYzSkHTfqkAhoJKFCOIHN/1CC576HH5S9f+xHdYQejV/3FpcT2+IhOxxKu1FsHtrz6S+8tmD8zRMQr27A+NEHY/vKGQQJTaPMueUX+Y3fc9tX20YDmZ5nQI5Hwjd/cL9cUDHy43tHFEY0HLr4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785514797; c=relaxed/simple; bh=axyEhyrbSPDLEngu1fOLPydAjE3efHkcs4SL0mWR/K8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=bhq08PteGKYvtoLCtwoh/jKZcLFi1rlv7VL9PTGkrCbdfs/XN9X+IgzRUUP8cXRphtigCBivYAzwtN76vtTG61zTjBKEBSrpwJR0NIVnkk6eLkwhOrjDjLbJtlMSNixvrqT/0Mnis29br4s8LVlUtPwMecLQgoGb2SsADG13+Io= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=iTU4mu4H; arc=none smtp.client-ip=148.251.105.195 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1785514778; bh=axyEhyrbSPDLEngu1fOLPydAjE3efHkcs4SL0mWR/K8=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=iTU4mu4HCxz8/kki3Ce1wvFpDV44wWMPfHhvI4WBYwQNsvlGi7J+hmG4d5rVTX1Iq e4woVfXzJIusrwXjSzOuTZLEBlm+HiFEMGiymthSaDtJdgr3HGlTuA6QL5nSFZwhkf imneXj8k6vrAf9dvXR6JYN83/pTMUaVpkFk8Ls/6w5mz7/3Ag65t6G2qoOI7j7Y/A/ Vz2LBG2c7iySgUzchfPjSWoGRFflIfnjAIYwDIUp7JIdtTRpdzH5boNJP3SNcMkD7Q +CBlAJo9zYfsvEmkDGvJkfbyoq3wA+1EA0QpEaD9ODeI0EJrylauaSO530p1lIFfap iiBPpHD6w8aRw== Received: from localhost (unknown [100.64.0.241]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange secp256r1 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: cristicc) by bali.collaboradmins.com (Postfix) with ESMTPSA id 77D3E17E0967; Fri, 31 Jul 2026 18:19:38 +0200 (CEST) From: Cristian Ciocaltea Date: Fri, 31 Jul 2026 19:19:40 +0300 Subject: [PATCH v10 33/69] drm/rockchip: dw_hdmi_qp: Avoid spurious HPD IRQ thread wakeups Precedence: bulk X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20260731-dw-hdmi-qp-scramb-v10-33-294364b2cf15@collabora.com> References: <20260731-dw-hdmi-qp-scramb-v10-0-294364b2cf15@collabora.com> In-Reply-To: <20260731-dw-hdmi-qp-scramb-v10-0-294364b2cf15@collabora.com> To: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Luca Ceresoli , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Chen-Yu Tsai , Samuel Holland , Dave Stevenson , =?utf-8?q?Ma=C3=ADra_Canal?= , Raspberry Pi Kernel Maintenance , Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Andy Yan , Algea Cao , Daniel Stone , Liu Ying , Phong LE Cc: kernel@collabora.com, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-rockchip@lists.infradead.org, Sashiko , Diederik de Haas X-Mailer: b4 0.15.2 X-Rspamd-Server: rspamd-worker-8404 X-Spamd-Result: default: False [-2.16 / 15.00]; BAYES_HAM(-5.50)[100.00%]; RBL_SENDERSCORE(2.00)[172.105.105.114:from]; SUSPICIOUS_RECIPS(1.50)[]; MAILLIST(-0.15)[generic]; BAD_REP_POLICIES(0.10)[]; MIME_GOOD(-0.10)[text/plain]; HAS_LIST_UNSUB(-0.01)[]; R_DKIM_ALLOW(0.00)[collabora.com:s=mail]; ARC_ALLOW(0.00)[subspace.kernel.org:s=arc-20240116:i=1]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_TWELVE(0.00)[32]; PRECEDENCE_BULK(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[collabora.com:email,collabora.com:dkim,tor.lore.kernel.org:rdns,tor.lore.kernel.org:helo,cknow-tech.com:email]; TAGGED_RCPT(0.00)[]; FORGED_SENDER_MAILLIST(0.00)[]; RCVD_COUNT_FIVE(0.00)[5]; ASN(0.00)[asn:63949, ipnet:172.105.96.0/20, country:SG]; DKIM_TRACE(0.00)[collabora.com:+]; DMARC_POLICY_ALLOW(0.00)[collabora.com,none]; R_SPF_ALLOW(0.00)[+ip4:172.105.105.114]; TO_DN_SOME(0.00)[]; FROM_NEQ_ENVFROM(0.00)[cristian.ciocaltea@collabora.com,linux-sunxi@lists.linux.dev]; FREEMAIL_TO(0.00)[intel.com,linaro.org,kernel.org,ideasonboard.com,kwiboo.se,gmail.com,bootlin.com,linux.intel.com,suse.de,ffwll.ch,sholland.org,raspberrypi.com,igalia.com,rock-chips.com,sntech.de,collabora.com,nxp.com,baylibre.com]; MIME_TRACE(0.00)[0:+]; TAGGED_FROM(0.00)[bounces-24842-noreply=patchwork.local]; FORGED_RECIPIENTS_MAILLIST(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[] X-Rspamd-Queue-Id: 3BE021C0254 X-MORS-Enabled: yes X-MORS-DOMAIN: patchwork.local X-MORS-HOSTING: hosting172546 X-MORS-USER: hosting172546 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= The RK3576 and RK3588 HPD hardirq handlers read shared status registers and currently wake the threaded handler whenever any bit in those registers is set. This can wake the HDMI IRQ thread for unrelated status bits, and on RK3588 can also wake the thread for the other HDMI port. Mask the status value with the SoC-specific HPD interrupt bit before deciding whether to wake the threaded handler. On RK3588, select the HDMI0 or HDMI1 HPD bit according to the instance port id. No stable backport is needed. The issue may only cause spurious IRQ thread wakeups and does not cause functional breakage. Reported-by: Sashiko Closes: https://lore.kernel.org/all/20260702151346.5A4EC1F000E9@smtp.kernel.org/ Tested-by: Diederik de Haas # NanoPC-T6 LTS, Rock 5B Signed-off-by: Cristian Ciocaltea --- drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c b/drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c index 36043bf82273..f5342c5f457b 100644 --- a/drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c +++ b/drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c @@ -34,6 +34,7 @@ #define RK3576_IOC_HDMI_HPD_STATUS 0xa440 #define RK3576_HDMI_LEVEL_INT BIT(3) +#define RK3576_HDMI_OHPD_INT BIT(4) #define RK3576_VO0_GRF_SOC_CON1 0x0004 #define RK3576_HDMI_FRL_MOD BIT(0) @@ -64,7 +65,9 @@ #define RK3588_HPD_HDMI1_IO_EN_MASK BIT(13) #define RK3588_GRF_SOC_STATUS1 0x0384 #define RK3588_HDMI0_LEVEL_INT BIT(16) +#define RK3588_HDMI0_OHPD_INT BIT(17) #define RK3588_HDMI1_LEVEL_INT BIT(24) +#define RK3588_HDMI1_OHPD_INT BIT(25) #define RK3588_GRF_VO1_CON3 0x000c #define RK3588_GRF_VO1_CON6 0x0018 #define RK3588_COLOR_DEPTH_MASK GENMASK(7, 4) @@ -348,7 +351,7 @@ static irqreturn_t dw_hdmi_qp_rk3576_hardirq(int irq, void *dev_id) u32 intr_stat, val; regmap_read(hdmi->regmap, RK3576_IOC_HDMI_HPD_STATUS, &intr_stat); - if (intr_stat) { + if (intr_stat & RK3576_HDMI_OHPD_INT) { val = FIELD_PREP_WM16(RK3576_HDMI_HPD_INT_MSK, 1); regmap_write(hdmi->regmap, RK3576_IOC_MISC_CON0, val); @@ -381,6 +384,8 @@ static irqreturn_t dw_hdmi_qp_rk3588_hardirq(int irq, void *dev_id) regmap_read(hdmi->regmap, RK3588_GRF_SOC_STATUS1, &intr_stat); + intr_stat &= hdmi->port_id ? RK3588_HDMI1_OHPD_INT : RK3588_HDMI0_OHPD_INT; + if (intr_stat) { if (hdmi->port_id) val = FIELD_PREP_WM16(RK3588_HDMI1_HPD_INT_MSK, 1); From patchwork Fri Jul 31 16:19:41 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Ciocaltea X-Patchwork-Id: 2830 Return-Path: X-Original-To: noreply@patchwork.local Delivered-To: noreply@patchwork.local Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114]) by mxe881.netcup.net (Postfix) with ESMTPS id CF3D71C0254 for ; Fri, 31 Jul 2026 18:33:51 +0200 (CEST) Authentication-Results: mxe881; dkim=pass header.d=collabora.com; spf=pass (sender IP is 172.105.105.114) smtp.mailfrom=linux-sunxi+bounces-24841-noreply=patchwork.local@lists.linux.dev smtp.helo=tor.lore.kernel.org Received-SPF: pass (mxe881: domain of lists.linux.dev designates 172.105.105.114 as permitted sender) client-ip=172.105.105.114; envelope-from=linux-sunxi+bounces-24841-noreply=patchwork.local@lists.linux.dev; helo=tor.lore.kernel.org; Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by tor.lore.kernel.org (Postfix) with ESMTP id BED243176C02 for ; Fri, 31 Jul 2026 16:24:25 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4465A46984E; Fri, 31 Jul 2026 16:20:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="hOGi+lHR" X-Original-To: linux-sunxi@lists.linux.dev Received: from bali.collaboradmins.com (bali.collaboradmins.com [148.251.105.195]) (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 D490C45DF47 for ; Fri, 31 Jul 2026 16:19:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.251.105.195 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785514797; cv=none; b=GfTgIhueAF+WNf38LuciFeBMgb948IWCglOe6ksM6vSGrE2aIh4769P/jsG7sRhf/688AV4HgZsBr4gykzqpVO6jNpGZHb8OK6/WBZsD+lb90jrthNUPdeQGe1CLHg0o7Mtrl0CjIR5RGabpcKBgxOB61bGhTsYSskojOzFohRw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785514797; c=relaxed/simple; bh=cD0+/HfmX6kyKNERhJbIzwqeRqoG4S21IHzyef7ml5w=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=IRIEV9f1pZvM00nrCaYO7fhPvCiYOna9Ekybr2fWQq47zu2mtQQcEJGiD+/JNJ7Bi6woCys34OfOLd4QGiiTyzcIp3XB97JyapmWYKqR5h8sw8w6VR9B4NBHq/mBVnj/7hE0ZkkPRg/xolJDC2QkRLbbWdExJOtALSERNLBq9NA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=hOGi+lHR; arc=none smtp.client-ip=148.251.105.195 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1785514779; bh=cD0+/HfmX6kyKNERhJbIzwqeRqoG4S21IHzyef7ml5w=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=hOGi+lHRBgySpQW2uguQ7wsos1kzzG8W3hTgHG4zsO3iZhFXFRTp7MwCwGwswst0k WvxJsEIy5w4NlG9nenga1sACsJ81ZwdOsrqTPIzSg1j2A2QYQ2KbEAksthrCAQlvYZ hkgy4tc5gKSdJ+D6hWGZjTy9GFoNvpowysgh5qNErQhh5AIwsVQJpjkRI7dfwxi1wh hGeIFE+JHvSpdx+Zy9xj3FUikWT5Tyfkv9hxJwQpc65e1EbyAaJom+UrKoK3fFzVln 0qt+5XW7EGq9VjfxDlrcup7lj4g1s1EoGq53tRT++BhOhsqyxfY7oPkGM3fRmBZSUP kj3ySNTVNhWHw== Received: from localhost (unknown [100.64.0.241]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange secp256r1 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: cristicc) by bali.collaboradmins.com (Postfix) with ESMTPSA id 3C40717E0972; Fri, 31 Jul 2026 18:19:39 +0200 (CEST) From: Cristian Ciocaltea Date: Fri, 31 Jul 2026 19:19:41 +0300 Subject: [PATCH v10 34/69] drm/rockchip: dw_hdmi_qp: Mask RK3576 HPD IRQ in io_init Precedence: bulk X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20260731-dw-hdmi-qp-scramb-v10-34-294364b2cf15@collabora.com> References: <20260731-dw-hdmi-qp-scramb-v10-0-294364b2cf15@collabora.com> In-Reply-To: <20260731-dw-hdmi-qp-scramb-v10-0-294364b2cf15@collabora.com> To: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Luca Ceresoli , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Chen-Yu Tsai , Samuel Holland , Dave Stevenson , =?utf-8?q?Ma=C3=ADra_Canal?= , Raspberry Pi Kernel Maintenance , Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Andy Yan , Algea Cao , Daniel Stone , Liu Ying , Phong LE Cc: kernel@collabora.com, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-rockchip@lists.infradead.org X-Mailer: b4 0.15.2 X-MORS-Enabled: yes X-MORS-DOMAIN: patchwork.local X-MORS-HOSTING: hosting172546 X-MORS-USER: hosting172546 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= Start with HPD masked, matching RK3588, so the bridge framework controls when interrupts are armed via hpd_enable(). Signed-off-by: Cristian Ciocaltea --- drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c b/drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c index f5342c5f457b..64e8e4c12cbd 100644 --- a/drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c +++ b/drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c @@ -432,7 +432,7 @@ static void dw_hdmi_qp_rk3576_io_init(struct rockchip_hdmi_qp *hdmi) regmap_write(hdmi->vo_regmap, RK3576_VO0_GRF_SOC_CON14, val); - val = FIELD_PREP_WM16(RK3576_HDMI_HPD_INT_MSK, 0); + val = FIELD_PREP_WM16(RK3576_HDMI_HPD_INT_MSK, 1); regmap_write(hdmi->regmap, RK3576_IOC_MISC_CON0, val); } From patchwork Fri Jul 31 16:19:42 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Ciocaltea X-Patchwork-Id: 2851 Return-Path: X-Original-To: noreply@patchwork.local Delivered-To: noreply@patchwork.local Received: from sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74]) by mxe881.netcup.net (Postfix) with ESMTPS id 6B3C21C0944 for ; Fri, 31 Jul 2026 18:38:39 +0200 (CEST) Authentication-Results: mxe881; dkim=pass header.d=collabora.com; spf=pass (sender IP is 172.232.135.74) smtp.mailfrom=linux-sunxi+bounces-24836-noreply=patchwork.local@lists.linux.dev smtp.helo=sto.lore.kernel.org Received-SPF: pass (mxe881: domain of lists.linux.dev designates 172.232.135.74 as permitted sender) client-ip=172.232.135.74; envelope-from=linux-sunxi+bounces-24836-noreply=patchwork.local@lists.linux.dev; helo=sto.lore.kernel.org; Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by sto.lore.kernel.org (Postfix) with ESMTP id 559A430CA644 for ; Fri, 31 Jul 2026 16:23:51 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6FBED468C0A; Fri, 31 Jul 2026 16:19:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="aV2PB+7F" X-Original-To: linux-sunxi@lists.linux.dev Received: from bali.collaboradmins.com (bali.collaboradmins.com [148.251.105.195]) (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 4456F45C710 for ; Fri, 31 Jul 2026 16:19:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.251.105.195 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785514792; cv=none; b=Eb7m2Wekm8OsHAUUxmdjDJAfNQblXAOQlxnHsaXGi7wV/ArC7soLrtWK/5zkcawgtTuXTrmZHjAKsp0Oa0sXo3DjNKJWCA4OVfUgftlyMlUQuAVQEXtSbNzxqK9SxHu3UW72p6jge/yidlCoqOCLbKO6RUuvaX9j/H+FiQHnOkU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785514792; c=relaxed/simple; bh=qWfQqJ5gFaQoXW8ldkI+fynaFa/cuemiR58bxMArXaY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=eCTjR4u7IeoBII3RQi0qnFXFM+FZKud17PtlO7nx6EzMiMfmoE9EZHmqMC+NFzDQfhbqBbnVF3FXsQinVjypkMOLmIiTb79pVTC2OhRycXA4Bx1sUqdv3vtvZidy2+vrCg9twbd+ZPSoQOihPabqUVda8wj9TvPmi6GvNdmC7hw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=aV2PB+7F; arc=none smtp.client-ip=148.251.105.195 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1785514780; bh=qWfQqJ5gFaQoXW8ldkI+fynaFa/cuemiR58bxMArXaY=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=aV2PB+7FwzURa9BPtCWqVk/JlqfBIJPgjyvJw2Uee88zt4Dy15cB/dpqtiEhXIn49 ZBrBFwPyLbc5ZTSOEbve9at5lBTN9uXZhJcURU3SCj78ZZkAh597WJl+Oh/PDXk2pu cw44djfBSBCihzq9FLrGFtgdfru7oCorOWTIJqmRe1Dou3KIgdN8SEAF2JbpwLP6bg 007ujj1XQUZR4cXSTFBNVd8m3u0Cf8G7gch+tp7CYuKWH0GmRnbXZUVTHKWr+pwEps 4b6y1Di9HdfRiGP46nUWbsH8Tr0ph90I1ITc+TYGvFXedtBLW/aF3cpCr6Gw4fgGmi GtlGRgzZUuMRw== Received: from localhost (unknown [100.64.0.241]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange secp256r1 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: cristicc) by bali.collaboradmins.com (Postfix) with ESMTPSA id E37AA17E0974; Fri, 31 Jul 2026 18:19:39 +0200 (CEST) From: Cristian Ciocaltea Date: Fri, 31 Jul 2026 19:19:42 +0300 Subject: [PATCH v10 35/69] drm/rockchip: dw_hdmi_qp: Implement .{enable,disable}_hpd() PHY ops Precedence: bulk X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20260731-dw-hdmi-qp-scramb-v10-35-294364b2cf15@collabora.com> References: <20260731-dw-hdmi-qp-scramb-v10-0-294364b2cf15@collabora.com> In-Reply-To: <20260731-dw-hdmi-qp-scramb-v10-0-294364b2cf15@collabora.com> To: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Luca Ceresoli , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Chen-Yu Tsai , Samuel Holland , Dave Stevenson , =?utf-8?q?Ma=C3=ADra_Canal?= , Raspberry Pi Kernel Maintenance , Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Andy Yan , Algea Cao , Daniel Stone , Liu Ying , Phong LE Cc: kernel@collabora.com, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-rockchip@lists.infradead.org, Maud Spierings , Diederik de Haas X-Mailer: b4 0.15.2 X-Rspamd-Server: rspamd-worker-8404 X-Spamd-Result: default: False [-2.16 / 15.00]; BAYES_HAM(-5.50)[100.00%]; RBL_SENDERSCORE(2.00)[172.232.135.74:from]; SUSPICIOUS_RECIPS(1.50)[]; MAILLIST(-0.15)[generic]; MIME_GOOD(-0.10)[text/plain]; BAD_REP_POLICIES(0.10)[]; HAS_LIST_UNSUB(-0.01)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[collabora.com:email,collabora.com:dkim,cknow-tech.com:email]; TAGGED_RCPT(0.00)[]; PRECEDENCE_BULK(0.00)[]; RCPT_COUNT_TWELVE(0.00)[32]; FREEMAIL_CC(0.00)[collabora.com,vger.kernel.org,lists.freedesktop.org,lists.infradead.org,lists.linux.dev,hotmail.com,cknow-tech.com]; FROM_HAS_DN(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_COUNT_FIVE(0.00)[5]; R_DKIM_ALLOW(0.00)[collabora.com:s=mail]; FROM_NEQ_ENVFROM(0.00)[cristian.ciocaltea@collabora.com,linux-sunxi@lists.linux.dev]; DMARC_POLICY_ALLOW(0.00)[collabora.com,none]; FREEMAIL_TO(0.00)[intel.com,linaro.org,kernel.org,ideasonboard.com,kwiboo.se,gmail.com,bootlin.com,linux.intel.com,suse.de,ffwll.ch,sholland.org,raspberrypi.com,igalia.com,rock-chips.com,sntech.de,collabora.com,nxp.com,baylibre.com]; DKIM_TRACE(0.00)[collabora.com:+]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(0.00)[+ip4:172.232.135.74]; FORGED_SENDER_MAILLIST(0.00)[]; FORGED_RECIPIENTS_MAILLIST(0.00)[]; RCVD_TLS_LAST(0.00)[]; ARC_ALLOW(0.00)[subspace.kernel.org:s=arc-20240116:i=1]; MIME_TRACE(0.00)[0:+]; TAGGED_FROM(0.00)[bounces-24836-noreply=patchwork.local]; ASN(0.00)[asn:63949, ipnet:172.232.128.0/19, country:SG]; RCVD_VIA_SMTP_AUTH(0.00)[] X-Rspamd-Queue-Id: 6B3C21C0944 X-MORS-Enabled: yes X-MORS-DOMAIN: patchwork.local X-MORS-HOSTING: hosting172546 X-MORS-USER: hosting172546 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= Implement .enable_hpd() and .disable_hpd() phy ops for RK3576 and RK3588 SoCs, used by the corresponding bridge callbacks for HPD activation control. Consolidate the interrupt clear-and-unmask sequence into enable_hpd() and the mask-only operation into disable_hpd(), replacing the open-coded register writes in the interrupt handlers and io_init(). The .setup_hpd() phy op, which was previously called from dw_hdmi_qp_init_hw(), is no longer needed and its users are removed. Tested-by: Maud Spierings Tested-by: Diederik de Haas # NanoPC-T6 LTS, Rock 5B Signed-off-by: Cristian Ciocaltea --- drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c | 78 +++++++++++++------------- 1 file changed, 38 insertions(+), 40 deletions(-) diff --git a/drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c b/drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c index 64e8e4c12cbd..1965641fbadf 100644 --- a/drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c +++ b/drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c @@ -277,7 +277,7 @@ dw_hdmi_qp_rk3588_read_hpd(struct dw_hdmi_qp *dw_hdmi, void *data) return val ? connector_status_connected : connector_status_disconnected; } -static void dw_hdmi_qp_rk3588_setup_hpd(struct dw_hdmi_qp *dw_hdmi, void *data) +static void dw_hdmi_qp_rk3588_enable_hpd(struct dw_hdmi_qp *dw_hdmi, void *data) { struct rockchip_hdmi_qp *hdmi = (struct rockchip_hdmi_qp *)data; u32 val; @@ -292,11 +292,25 @@ static void dw_hdmi_qp_rk3588_setup_hpd(struct dw_hdmi_qp *dw_hdmi, void *data) regmap_write(hdmi->regmap, RK3588_GRF_SOC_CON2, val); } +static void dw_hdmi_qp_rk3588_disable_hpd(struct dw_hdmi_qp *dw_hdmi, void *data) +{ + struct rockchip_hdmi_qp *hdmi = (struct rockchip_hdmi_qp *)data; + u32 val; + + if (hdmi->port_id) + val = FIELD_PREP_WM16(RK3588_HDMI1_HPD_INT_MSK, 1); + else + val = FIELD_PREP_WM16(RK3588_HDMI0_HPD_INT_MSK, 1); + + regmap_write(hdmi->regmap, RK3588_GRF_SOC_CON2, val); +} + static const struct dw_hdmi_qp_phy_ops rk3588_hdmi_phy_ops = { .init = dw_hdmi_qp_rk3588_phy_init, .disable = dw_hdmi_qp_rk3588_phy_disable, .read_hpd = dw_hdmi_qp_rk3588_read_hpd, - .setup_hpd = dw_hdmi_qp_rk3588_setup_hpd, + .enable_hpd = dw_hdmi_qp_rk3588_enable_hpd, + .disable_hpd = dw_hdmi_qp_rk3588_disable_hpd, }; static enum drm_connector_status @@ -311,7 +325,7 @@ dw_hdmi_qp_rk3576_read_hpd(struct dw_hdmi_qp *dw_hdmi, void *data) connector_status_connected : connector_status_disconnected; } -static void dw_hdmi_qp_rk3576_setup_hpd(struct dw_hdmi_qp *dw_hdmi, void *data) +static void dw_hdmi_qp_rk3576_enable_hpd(struct dw_hdmi_qp *dw_hdmi, void *data) { struct rockchip_hdmi_qp *hdmi = (struct rockchip_hdmi_qp *)data; u32 val; @@ -320,14 +334,22 @@ static void dw_hdmi_qp_rk3576_setup_hpd(struct dw_hdmi_qp *dw_hdmi, void *data) FIELD_PREP_WM16(RK3576_HDMI_HPD_INT_MSK, 0)); regmap_write(hdmi->regmap, RK3576_IOC_MISC_CON0, val); - regmap_write(hdmi->regmap, 0xa404, 0xffff0102); +} + +static void dw_hdmi_qp_rk3576_disable_hpd(struct dw_hdmi_qp *dw_hdmi, void *data) +{ + struct rockchip_hdmi_qp *hdmi = (struct rockchip_hdmi_qp *)data; + + regmap_write(hdmi->regmap, RK3576_IOC_MISC_CON0, + FIELD_PREP_WM16(RK3576_HDMI_HPD_INT_MSK, 1)); } static const struct dw_hdmi_qp_phy_ops rk3576_hdmi_phy_ops = { .init = dw_hdmi_qp_rk3588_phy_init, .disable = dw_hdmi_qp_rk3588_phy_disable, .read_hpd = dw_hdmi_qp_rk3576_read_hpd, - .setup_hpd = dw_hdmi_qp_rk3576_setup_hpd, + .enable_hpd = dw_hdmi_qp_rk3576_enable_hpd, + .disable_hpd = dw_hdmi_qp_rk3576_disable_hpd, }; static void dw_hdmi_qp_rk3588_hpd_work(struct work_struct *work) @@ -348,13 +370,12 @@ static void dw_hdmi_qp_rk3588_hpd_work(struct work_struct *work) static irqreturn_t dw_hdmi_qp_rk3576_hardirq(int irq, void *dev_id) { struct rockchip_hdmi_qp *hdmi = dev_id; - u32 intr_stat, val; + u32 intr_stat; regmap_read(hdmi->regmap, RK3576_IOC_HDMI_HPD_STATUS, &intr_stat); - if (intr_stat & RK3576_HDMI_OHPD_INT) { - val = FIELD_PREP_WM16(RK3576_HDMI_HPD_INT_MSK, 1); - regmap_write(hdmi->regmap, RK3576_IOC_MISC_CON0, val); + if (intr_stat & RK3576_HDMI_OHPD_INT) { + dw_hdmi_qp_rk3576_disable_hpd(NULL, hdmi); return IRQ_WAKE_THREAD; } @@ -364,15 +385,11 @@ static irqreturn_t dw_hdmi_qp_rk3576_hardirq(int irq, void *dev_id) static irqreturn_t dw_hdmi_qp_rk3576_irq(int irq, void *dev_id) { struct rockchip_hdmi_qp *hdmi = dev_id; - u32 val; - val = FIELD_PREP_WM16(RK3576_HDMI_HPD_INT_CLR, 1); - regmap_write(hdmi->regmap, RK3576_IOC_MISC_CON0, val); mod_delayed_work(system_percpu_wq, &hdmi->hpd_work, msecs_to_jiffies(HOTPLUG_DEBOUNCE_MS)); - val = FIELD_PREP_WM16(RK3576_HDMI_HPD_INT_MSK, 0); - regmap_write(hdmi->regmap, RK3576_IOC_MISC_CON0, val); + dw_hdmi_qp_rk3576_enable_hpd(NULL, hdmi); return IRQ_HANDLED; } @@ -380,18 +397,14 @@ static irqreturn_t dw_hdmi_qp_rk3576_irq(int irq, void *dev_id) static irqreturn_t dw_hdmi_qp_rk3588_hardirq(int irq, void *dev_id) { struct rockchip_hdmi_qp *hdmi = dev_id; - u32 intr_stat, val; + u32 intr_stat; regmap_read(hdmi->regmap, RK3588_GRF_SOC_STATUS1, &intr_stat); intr_stat &= hdmi->port_id ? RK3588_HDMI1_OHPD_INT : RK3588_HDMI0_OHPD_INT; if (intr_stat) { - if (hdmi->port_id) - val = FIELD_PREP_WM16(RK3588_HDMI1_HPD_INT_MSK, 1); - else - val = FIELD_PREP_WM16(RK3588_HDMI0_HPD_INT_MSK, 1); - regmap_write(hdmi->regmap, RK3588_GRF_SOC_CON2, val); + dw_hdmi_qp_rk3588_disable_hpd(NULL, hdmi); return IRQ_WAKE_THREAD; } @@ -401,22 +414,11 @@ static irqreturn_t dw_hdmi_qp_rk3588_hardirq(int irq, void *dev_id) static irqreturn_t dw_hdmi_qp_rk3588_irq(int irq, void *dev_id) { struct rockchip_hdmi_qp *hdmi = dev_id; - u32 val; - - if (hdmi->port_id) - val = FIELD_PREP_WM16(RK3588_HDMI1_HPD_INT_CLR, 1); - else - val = FIELD_PREP_WM16(RK3588_HDMI0_HPD_INT_CLR, 1); - regmap_write(hdmi->regmap, RK3588_GRF_SOC_CON2, val); mod_delayed_work(system_percpu_wq, &hdmi->hpd_work, msecs_to_jiffies(HOTPLUG_DEBOUNCE_MS)); - if (hdmi->port_id) - val |= FIELD_PREP_WM16(RK3588_HDMI1_HPD_INT_MSK, 0); - else - val |= FIELD_PREP_WM16(RK3588_HDMI0_HPD_INT_MSK, 0); - regmap_write(hdmi->regmap, RK3588_GRF_SOC_CON2, val); + dw_hdmi_qp_rk3588_enable_hpd(NULL, hdmi); return IRQ_HANDLED; } @@ -429,11 +431,11 @@ static void dw_hdmi_qp_rk3576_io_init(struct rockchip_hdmi_qp *hdmi) FIELD_PREP_WM16(RK3576_SDAIN_MASK, 1) | FIELD_PREP_WM16(RK3576_HDMI_GRANT_SEL, 1) | FIELD_PREP_WM16(RK3576_I2S_SEL_MASK, 1); - regmap_write(hdmi->vo_regmap, RK3576_VO0_GRF_SOC_CON14, val); - val = FIELD_PREP_WM16(RK3576_HDMI_HPD_INT_MSK, 1); - regmap_write(hdmi->regmap, RK3576_IOC_MISC_CON0, val); + regmap_write(hdmi->regmap, 0xa404, 0xffff0102); + + dw_hdmi_qp_rk3576_disable_hpd(NULL, hdmi); } static void dw_hdmi_qp_rk3588_io_init(struct rockchip_hdmi_qp *hdmi) @@ -458,11 +460,7 @@ static void dw_hdmi_qp_rk3588_io_init(struct rockchip_hdmi_qp *hdmi) val = FIELD_PREP_WM16(RK3588_HDMI0_GRANT_SEL, 1); regmap_write(hdmi->vo_regmap, RK3588_GRF_VO1_CON9, val); - if (hdmi->port_id) - val = FIELD_PREP_WM16(RK3588_HDMI1_HPD_INT_MSK, 1); - else - val = FIELD_PREP_WM16(RK3588_HDMI0_HPD_INT_MSK, 1); - regmap_write(hdmi->regmap, RK3588_GRF_SOC_CON2, val); + dw_hdmi_qp_rk3588_disable_hpd(NULL, hdmi); } static void dw_hdmi_qp_rk3576_enc_init(struct rockchip_hdmi_qp *hdmi, From patchwork Fri Jul 31 16:19:43 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Ciocaltea X-Patchwork-Id: 2866 Return-Path: X-Original-To: noreply@patchwork.local Delivered-To: noreply@patchwork.local Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114]) by mxe881.netcup.net (Postfix) with ESMTPS id 2D4261C2305 for ; Fri, 31 Jul 2026 18:42:29 +0200 (CEST) Authentication-Results: mxe881; dkim=pass header.d=collabora.com; spf=pass (sender IP is 172.105.105.114) smtp.mailfrom=linux-sunxi+bounces-24838-noreply=patchwork.local@lists.linux.dev smtp.helo=tor.lore.kernel.org Received-SPF: pass (mxe881: domain of lists.linux.dev designates 172.105.105.114 as permitted sender) client-ip=172.105.105.114; envelope-from=linux-sunxi+bounces-24838-noreply=patchwork.local@lists.linux.dev; helo=tor.lore.kernel.org; Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by tor.lore.kernel.org (Postfix) with ESMTP id 602073010EE2 for ; Fri, 31 Jul 2026 16:24:08 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1F7CB469820; Fri, 31 Jul 2026 16:19:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="LoiDDZEJ" X-Original-To: linux-sunxi@lists.linux.dev Received: from bali.collaboradmins.com (bali.collaboradmins.com [148.251.105.195]) (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 395FB45C70C for ; Fri, 31 Jul 2026 16:19:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.251.105.195 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785514794; cv=none; b=rDSqAwmzmWGlM9loCvzx5hGy7+0xALiy4sICPm3u/vhUbYcRXCHEbefuj0URkue0XdUe230ij2KOwZ11OgyGNi9yL14DKTXOlmRNizexLojJ7oimuvsKNUEKNRcWCd0ZI0dagdr21TkUYDAA8AgmeOTGRyVeUXLm5iNT+IxGG4E= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785514794; c=relaxed/simple; bh=6v6rpPedeAMKVFD0zDZFin3GPDFPHPjEIUODdsZVUGY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=RvMnOw+9QQrOYDIuOu89YQmtX0q0rY+tcaXiCHKwSaVGtXdlb7849tq+flz9YDm8gG4hfTDnt58elnxqB/IP/xzIZDnUu1ykUkmkTsWp+XUrG4zQd5Q9+fJ0q+4kuZReRFz8k3CuJlJc5M8eLbOi4tMoEb4jNboqx8sISPqqZoE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=LoiDDZEJ; arc=none smtp.client-ip=148.251.105.195 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1785514780; bh=6v6rpPedeAMKVFD0zDZFin3GPDFPHPjEIUODdsZVUGY=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=LoiDDZEJWCeQehkDP+5MFPFTT58vc9OiauOPM3qpmqVqYZ4GcJ9kyCxtlA/SZupkn kPlpXOilNBm1Q5CHbp+rjr1Ww4LOggXnZvRcCnbb7SOowL9G8qmcX3MSMSNYWpbTI9 PEDtfscsDyAXtvbBvqtEq8niQRPbgftV2JgkB70fB3BCku1vW+sOmPVi1Ujv3fFs7Z khBjlycdFFMJyTgkLdkeyGARWRZ+qz7A/OlfbEN/4Ii5hpTnkR+ZRwBTkEAWjfKjfx R2fMD7h2kAz0JtTRG6bOHyeSJOJHpo19I5+k+LmgJvbe3eW4DXrWrAdU8w+wlofRUp r2mGxLez8CHsQ== Received: from localhost (unknown [100.64.0.241]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange secp256r1 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: cristicc) by bali.collaboradmins.com (Postfix) with ESMTPSA id 9A3DC17E097A; Fri, 31 Jul 2026 18:19:40 +0200 (CEST) From: Cristian Ciocaltea Date: Fri, 31 Jul 2026 19:19:43 +0300 Subject: [PATCH v10 36/69] drm/rockchip: dw_hdmi_qp: Factor out HPD interrupt (un)mask helpers Precedence: bulk X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20260731-dw-hdmi-qp-scramb-v10-36-294364b2cf15@collabora.com> References: <20260731-dw-hdmi-qp-scramb-v10-0-294364b2cf15@collabora.com> In-Reply-To: <20260731-dw-hdmi-qp-scramb-v10-0-294364b2cf15@collabora.com> To: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Luca Ceresoli , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Chen-Yu Tsai , Samuel Holland , Dave Stevenson , =?utf-8?q?Ma=C3=ADra_Canal?= , Raspberry Pi Kernel Maintenance , Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Andy Yan , Algea Cao , Daniel Stone , Liu Ying , Phong LE Cc: kernel@collabora.com, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-rockchip@lists.infradead.org, Diederik de Haas X-Mailer: b4 0.15.2 X-MORS-Enabled: yes X-MORS-DOMAIN: patchwork.local X-MORS-HOSTING: hosting172546 X-MORS-USER: hosting172546 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= Extract the GRF-level HPD interrupt mask/unmask register writes into dedicated dw_hdmi_qp_rk35{88,76}_{mask,unmask}_hpd() helpers, and use them from the .enable_hpd()/.disable_hpd() phy ops as well as the hardirq, threaded re-arm and io_init() paths. This is a preparatory refactor that separates the SoC-level HPD mask from the phy op entry points, so a subsequent change can gate the platform HPD IRQ line without affecting the debounce paths. Tested-by: Diederik de Haas # NanoPC-T6 LTS, Rock 5B Signed-off-by: Cristian Ciocaltea --- drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c | 54 ++++++++++++++++++-------- 1 file changed, 37 insertions(+), 17 deletions(-) diff --git a/drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c b/drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c index 1965641fbadf..46a61112c14f 100644 --- a/drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c +++ b/drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c @@ -277,9 +277,8 @@ dw_hdmi_qp_rk3588_read_hpd(struct dw_hdmi_qp *dw_hdmi, void *data) return val ? connector_status_connected : connector_status_disconnected; } -static void dw_hdmi_qp_rk3588_enable_hpd(struct dw_hdmi_qp *dw_hdmi, void *data) +static void dw_hdmi_qp_rk3588_unmask_hpd(struct rockchip_hdmi_qp *hdmi) { - struct rockchip_hdmi_qp *hdmi = (struct rockchip_hdmi_qp *)data; u32 val; if (hdmi->port_id) @@ -292,9 +291,8 @@ static void dw_hdmi_qp_rk3588_enable_hpd(struct dw_hdmi_qp *dw_hdmi, void *data) regmap_write(hdmi->regmap, RK3588_GRF_SOC_CON2, val); } -static void dw_hdmi_qp_rk3588_disable_hpd(struct dw_hdmi_qp *dw_hdmi, void *data) +static void dw_hdmi_qp_rk3588_mask_hpd(struct rockchip_hdmi_qp *hdmi) { - struct rockchip_hdmi_qp *hdmi = (struct rockchip_hdmi_qp *)data; u32 val; if (hdmi->port_id) @@ -305,6 +303,20 @@ static void dw_hdmi_qp_rk3588_disable_hpd(struct dw_hdmi_qp *dw_hdmi, void *data regmap_write(hdmi->regmap, RK3588_GRF_SOC_CON2, val); } +static void dw_hdmi_qp_rk3588_enable_hpd(struct dw_hdmi_qp *dw_hdmi, void *data) +{ + struct rockchip_hdmi_qp *hdmi = (struct rockchip_hdmi_qp *)data; + + dw_hdmi_qp_rk3588_unmask_hpd(hdmi); +} + +static void dw_hdmi_qp_rk3588_disable_hpd(struct dw_hdmi_qp *dw_hdmi, void *data) +{ + struct rockchip_hdmi_qp *hdmi = (struct rockchip_hdmi_qp *)data; + + dw_hdmi_qp_rk3588_mask_hpd(hdmi); +} + static const struct dw_hdmi_qp_phy_ops rk3588_hdmi_phy_ops = { .init = dw_hdmi_qp_rk3588_phy_init, .disable = dw_hdmi_qp_rk3588_phy_disable, @@ -325,23 +337,31 @@ dw_hdmi_qp_rk3576_read_hpd(struct dw_hdmi_qp *dw_hdmi, void *data) connector_status_connected : connector_status_disconnected; } +static void dw_hdmi_qp_rk3576_unmask_hpd(struct rockchip_hdmi_qp *hdmi) +{ + regmap_write(hdmi->regmap, RK3576_IOC_MISC_CON0, + FIELD_PREP_WM16(RK3576_HDMI_HPD_INT_CLR, 1) | + FIELD_PREP_WM16(RK3576_HDMI_HPD_INT_MSK, 0)); +} + +static void dw_hdmi_qp_rk3576_mask_hpd(struct rockchip_hdmi_qp *hdmi) +{ + regmap_write(hdmi->regmap, RK3576_IOC_MISC_CON0, + FIELD_PREP_WM16(RK3576_HDMI_HPD_INT_MSK, 1)); +} + static void dw_hdmi_qp_rk3576_enable_hpd(struct dw_hdmi_qp *dw_hdmi, void *data) { struct rockchip_hdmi_qp *hdmi = (struct rockchip_hdmi_qp *)data; - u32 val; - val = (FIELD_PREP_WM16(RK3576_HDMI_HPD_INT_CLR, 1) | - FIELD_PREP_WM16(RK3576_HDMI_HPD_INT_MSK, 0)); - - regmap_write(hdmi->regmap, RK3576_IOC_MISC_CON0, val); + dw_hdmi_qp_rk3576_unmask_hpd(hdmi); } static void dw_hdmi_qp_rk3576_disable_hpd(struct dw_hdmi_qp *dw_hdmi, void *data) { struct rockchip_hdmi_qp *hdmi = (struct rockchip_hdmi_qp *)data; - regmap_write(hdmi->regmap, RK3576_IOC_MISC_CON0, - FIELD_PREP_WM16(RK3576_HDMI_HPD_INT_MSK, 1)); + dw_hdmi_qp_rk3576_mask_hpd(hdmi); } static const struct dw_hdmi_qp_phy_ops rk3576_hdmi_phy_ops = { @@ -375,7 +395,7 @@ static irqreturn_t dw_hdmi_qp_rk3576_hardirq(int irq, void *dev_id) regmap_read(hdmi->regmap, RK3576_IOC_HDMI_HPD_STATUS, &intr_stat); if (intr_stat & RK3576_HDMI_OHPD_INT) { - dw_hdmi_qp_rk3576_disable_hpd(NULL, hdmi); + dw_hdmi_qp_rk3576_mask_hpd(hdmi); return IRQ_WAKE_THREAD; } @@ -389,7 +409,7 @@ static irqreturn_t dw_hdmi_qp_rk3576_irq(int irq, void *dev_id) mod_delayed_work(system_percpu_wq, &hdmi->hpd_work, msecs_to_jiffies(HOTPLUG_DEBOUNCE_MS)); - dw_hdmi_qp_rk3576_enable_hpd(NULL, hdmi); + dw_hdmi_qp_rk3576_unmask_hpd(hdmi); return IRQ_HANDLED; } @@ -404,7 +424,7 @@ static irqreturn_t dw_hdmi_qp_rk3588_hardirq(int irq, void *dev_id) intr_stat &= hdmi->port_id ? RK3588_HDMI1_OHPD_INT : RK3588_HDMI0_OHPD_INT; if (intr_stat) { - dw_hdmi_qp_rk3588_disable_hpd(NULL, hdmi); + dw_hdmi_qp_rk3588_mask_hpd(hdmi); return IRQ_WAKE_THREAD; } @@ -418,7 +438,7 @@ static irqreturn_t dw_hdmi_qp_rk3588_irq(int irq, void *dev_id) mod_delayed_work(system_percpu_wq, &hdmi->hpd_work, msecs_to_jiffies(HOTPLUG_DEBOUNCE_MS)); - dw_hdmi_qp_rk3588_enable_hpd(NULL, hdmi); + dw_hdmi_qp_rk3588_unmask_hpd(hdmi); return IRQ_HANDLED; } @@ -435,7 +455,7 @@ static void dw_hdmi_qp_rk3576_io_init(struct rockchip_hdmi_qp *hdmi) regmap_write(hdmi->regmap, 0xa404, 0xffff0102); - dw_hdmi_qp_rk3576_disable_hpd(NULL, hdmi); + dw_hdmi_qp_rk3576_mask_hpd(hdmi); } static void dw_hdmi_qp_rk3588_io_init(struct rockchip_hdmi_qp *hdmi) @@ -460,7 +480,7 @@ static void dw_hdmi_qp_rk3588_io_init(struct rockchip_hdmi_qp *hdmi) val = FIELD_PREP_WM16(RK3588_HDMI0_GRANT_SEL, 1); regmap_write(hdmi->vo_regmap, RK3588_GRF_VO1_CON9, val); - dw_hdmi_qp_rk3588_disable_hpd(NULL, hdmi); + dw_hdmi_qp_rk3588_mask_hpd(hdmi); } static void dw_hdmi_qp_rk3576_enc_init(struct rockchip_hdmi_qp *hdmi, From patchwork Fri Jul 31 16:19:44 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Ciocaltea X-Patchwork-Id: 2868 Return-Path: X-Original-To: noreply@patchwork.local Delivered-To: noreply@patchwork.local Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114]) by mxe881.netcup.net (Postfix) with ESMTPS id 495091C2304 for ; Fri, 31 Jul 2026 18:42:37 +0200 (CEST) Authentication-Results: mxe881; dkim=pass header.d=collabora.com; spf=pass (sender IP is 172.105.105.114) smtp.mailfrom=linux-sunxi+bounces-24849-noreply=patchwork.local@lists.linux.dev smtp.helo=tor.lore.kernel.org Received-SPF: pass (mxe881: domain of lists.linux.dev designates 172.105.105.114 as permitted sender) client-ip=172.105.105.114; envelope-from=linux-sunxi+bounces-24849-noreply=patchwork.local@lists.linux.dev; helo=tor.lore.kernel.org; Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by tor.lore.kernel.org (Postfix) with ESMTP id 41AB43175DFE for ; Fri, 31 Jul 2026 16:24:26 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 557EC449B19; Fri, 31 Jul 2026 16:20:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="R7GNVSHU" X-Original-To: linux-sunxi@lists.linux.dev Received: from bali.collaboradmins.com (bali.collaboradmins.com [148.251.105.195]) (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 CB96645D5F6 for ; Fri, 31 Jul 2026 16:19:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.251.105.195 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785514798; cv=none; b=Mo7A7/UEQnGqR2fEa5O/rqcEo7WCjJqzZF0u6MZi+R0eGVpJmJdHgL2dz53WFMYhst2YwJF0RxpKKVZ6TyzMN6OdsAzMSRWVkU/1/UvHdTBsW8g2Dd1IikbFVjvoRJjUJHP6lku6A1gqi6Wbgp+erdNKU9glCbmHR3zinHNtHBM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785514798; c=relaxed/simple; bh=h9JN00DCDPHlyOAmChEQgWAf1Wo4zXLn+vKlFPmSOyU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=IMyjbU5CWJreZKcHRRoNbmd7arikYDbO1zKbNYEg6JLvqZeaYtntMloH53g2C0PzSaSdDamXkgKMd0N9arAMWI1ZV/A6Pcax9X/9oqZWbwKqeac8zQsDEhcIbLEunHl3Jvc9aykJFCAhR97mzRPfJZ6x62pMd3f3FTC9xobbJPg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=R7GNVSHU; arc=none smtp.client-ip=148.251.105.195 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1785514781; bh=h9JN00DCDPHlyOAmChEQgWAf1Wo4zXLn+vKlFPmSOyU=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=R7GNVSHUEdY9uJaVmgvccseLKzBvolOgxfYTySMYYNg9TfB6khNRIvasVF5aNBWvw zrGjUxA6mlFM36QRAyaAN31KkwoWyY+Sbc6dOmM3d5sNabcRWJOPo5jI45s8zKX30G TLDSzke6BLsqzfztEmAcDI2PMb46Redy/Vk64tyto2HitF7pM+3s79ko+qwHi2oDNG UeWeBtGRWONLwTw8FJ2lQPilQ3d+LPnL8jLpcnueSdpLkzJ70m/ZhSj7THWX3qN+QQ op1cbugTWK2Jg3LMpVOqh0IlE01sdT9Lui5fcSaQH7u9pQqBc/K0CUgK0Cn3UuBExs aFUQl9V6zToew== Received: from localhost (unknown [100.64.0.241]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange secp256r1 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: cristicc) by bali.collaboradmins.com (Postfix) with ESMTPSA id 51FDA17E097C; Fri, 31 Jul 2026 18:19:41 +0200 (CEST) From: Cristian Ciocaltea Date: Fri, 31 Jul 2026 19:19:44 +0300 Subject: [PATCH v10 37/69] drm/rockchip: dw_hdmi_qp: Control the HPD IRQ line via the bridge HPD ops Precedence: bulk X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20260731-dw-hdmi-qp-scramb-v10-37-294364b2cf15@collabora.com> References: <20260731-dw-hdmi-qp-scramb-v10-0-294364b2cf15@collabora.com> In-Reply-To: <20260731-dw-hdmi-qp-scramb-v10-0-294364b2cf15@collabora.com> To: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Luca Ceresoli , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Chen-Yu Tsai , Samuel Holland , Dave Stevenson , =?utf-8?q?Ma=C3=ADra_Canal?= , Raspberry Pi Kernel Maintenance , Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Andy Yan , Algea Cao , Daniel Stone , Liu Ying , Phong LE Cc: kernel@collabora.com, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-rockchip@lists.infradead.org, Diederik de Haas X-Mailer: b4 0.15.2 X-Rspamd-Server: rspamd-worker-8404 X-Spamd-Result: default: False [-2.16 / 15.00]; BAYES_HAM(-5.50)[100.00%]; RBL_SENDERSCORE(2.00)[172.105.105.114:from]; SUSPICIOUS_RECIPS(1.50)[]; MAILLIST(-0.15)[generic]; BAD_REP_POLICIES(0.10)[]; MIME_GOOD(-0.10)[text/plain]; HAS_LIST_UNSUB(-0.01)[]; RCVD_COUNT_FIVE(0.00)[5]; ARC_ALLOW(0.00)[subspace.kernel.org:s=arc-20240116:i=1]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_TWELVE(0.00)[31]; PRECEDENCE_BULK(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[tor.lore.kernel.org:rdns,tor.lore.kernel.org:helo,collabora.com:email,collabora.com:dkim,cknow-tech.com:email]; TAGGED_RCPT(0.00)[]; FORGED_SENDER_MAILLIST(0.00)[]; R_DKIM_ALLOW(0.00)[collabora.com:s=mail]; ASN(0.00)[asn:63949, ipnet:172.105.96.0/20, country:SG]; DKIM_TRACE(0.00)[collabora.com:+]; DMARC_POLICY_ALLOW(0.00)[collabora.com,none]; R_SPF_ALLOW(0.00)[+ip4:172.105.105.114:c]; TO_DN_SOME(0.00)[]; FROM_NEQ_ENVFROM(0.00)[cristian.ciocaltea@collabora.com,linux-sunxi@lists.linux.dev]; FREEMAIL_TO(0.00)[intel.com,linaro.org,kernel.org,ideasonboard.com,kwiboo.se,gmail.com,bootlin.com,linux.intel.com,suse.de,ffwll.ch,sholland.org,raspberrypi.com,igalia.com,rock-chips.com,sntech.de,collabora.com,nxp.com,baylibre.com]; MIME_TRACE(0.00)[0:+]; TAGGED_FROM(0.00)[bounces-24849-noreply=patchwork.local]; FORGED_RECIPIENTS_MAILLIST(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[] X-Rspamd-Queue-Id: 495091C2304 X-MORS-Enabled: yes X-MORS-DOMAIN: patchwork.local X-MORS-HOSTING: hosting172546 X-MORS-USER: hosting172546 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= The HPD interrupt must not be delivered before the DRM connector is fully set up, and it should be quiesced while the display pipeline is suspended. On top of that, the threaded handler re-arms HPD unconditionally after the hotplug debounce, which must not override an explicit disable requested by the DRM core. Request the HPD IRQ in bind() with IRQF_NO_AUTOEN so it stays disabled until the core arms it, and drive enable_irq()/disable_irq() from the phy ops invoked by the bridge through its hpd_{enable,disable}() callbacks. This ensures the line is only armed after the connector is ready. disable_irq() additionally waits for the threaded handler to finish, so its GRF re-arm can no longer race with and override a core-requested disable. Note that IRQF_NO_AUTOEN is incompatible with IRQF_SHARED; the latter is dropped as this IRQ has no other users. Tested-by: Diederik de Haas # NanoPC-T6 LTS, Rock 5B Signed-off-by: Cristian Ciocaltea --- drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c b/drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c index 46a61112c14f..253da2162ce6 100644 --- a/drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c +++ b/drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c @@ -99,6 +99,7 @@ struct rockchip_hdmi_qp { struct phy *phy; struct gpio_desc *frl_enable_gpio; struct delayed_work hpd_work; + int hpd_irq; int port_id; const struct rockchip_hdmi_qp_ctrl_ops *ctrl_ops; unsigned long long tmds_char_rate; @@ -308,12 +309,14 @@ static void dw_hdmi_qp_rk3588_enable_hpd(struct dw_hdmi_qp *dw_hdmi, void *data) struct rockchip_hdmi_qp *hdmi = (struct rockchip_hdmi_qp *)data; dw_hdmi_qp_rk3588_unmask_hpd(hdmi); + enable_irq(hdmi->hpd_irq); } static void dw_hdmi_qp_rk3588_disable_hpd(struct dw_hdmi_qp *dw_hdmi, void *data) { struct rockchip_hdmi_qp *hdmi = (struct rockchip_hdmi_qp *)data; + disable_irq(hdmi->hpd_irq); dw_hdmi_qp_rk3588_mask_hpd(hdmi); } @@ -355,12 +358,14 @@ static void dw_hdmi_qp_rk3576_enable_hpd(struct dw_hdmi_qp *dw_hdmi, void *data) struct rockchip_hdmi_qp *hdmi = (struct rockchip_hdmi_qp *)data; dw_hdmi_qp_rk3576_unmask_hpd(hdmi); + enable_irq(hdmi->hpd_irq); } static void dw_hdmi_qp_rk3576_disable_hpd(struct dw_hdmi_qp *dw_hdmi, void *data) { struct rockchip_hdmi_qp *hdmi = (struct rockchip_hdmi_qp *)data; + disable_irq(hdmi->hpd_irq); dw_hdmi_qp_rk3576_mask_hpd(hdmi); } @@ -584,7 +589,7 @@ static int dw_hdmi_qp_rockchip_bind(struct device *dev, struct device *master, struct resource *res; struct clk_bulk_data *clks; struct clk *ref_clk; - int ret, irq, i; + int ret, i; if (!dev->of_node) return -ENODEV; @@ -688,14 +693,14 @@ static int dw_hdmi_qp_rockchip_bind(struct device *dev, struct device *master, if (plat_data.cec_irq < 0) return plat_data.cec_irq; - irq = platform_get_irq_byname(pdev, "hpd"); - if (irq < 0) - return irq; + hdmi->hpd_irq = platform_get_irq_byname(pdev, "hpd"); + if (hdmi->hpd_irq < 0) + return hdmi->hpd_irq; - ret = devm_request_threaded_irq(dev, irq, + ret = devm_request_threaded_irq(dev, hdmi->hpd_irq, cfg->ctrl_ops->hardirq_callback, cfg->ctrl_ops->irq_callback, - IRQF_SHARED, "dw-hdmi-qp-hpd", + IRQF_NO_AUTOEN, "dw-hdmi-qp-hpd", hdmi); if (ret) return ret; From patchwork Fri Jul 31 16:19:45 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Ciocaltea X-Patchwork-Id: 2833 Return-Path: X-Original-To: noreply@patchwork.local Delivered-To: noreply@patchwork.local Received: from sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74]) by mxe881.netcup.net (Postfix) with ESMTPS id 3BFC81C1D58 for ; Fri, 31 Jul 2026 18:34:21 +0200 (CEST) Authentication-Results: mxe881; dkim=pass header.d=collabora.com; spf=pass (sender IP is 172.232.135.74) smtp.mailfrom=linux-sunxi+bounces-24844-noreply=patchwork.local@lists.linux.dev smtp.helo=sto.lore.kernel.org Received-SPF: pass (mxe881: domain of lists.linux.dev designates 172.232.135.74 as permitted sender) client-ip=172.232.135.74; envelope-from=linux-sunxi+bounces-24844-noreply=patchwork.local@lists.linux.dev; helo=sto.lore.kernel.org; Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by sto.lore.kernel.org (Postfix) with ESMTP id C5C7C30D27A8 for ; Fri, 31 Jul 2026 16:24:26 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5769C46A5F2; Fri, 31 Jul 2026 16:20:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="IATk21M/" X-Original-To: linux-sunxi@lists.linux.dev Received: from bali.collaboradmins.com (bali.collaboradmins.com [148.251.105.195]) (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 CB8B845D5F3 for ; Fri, 31 Jul 2026 16:19:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.251.105.195 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785514797; cv=none; b=aPZcPYApMNu+aNnRtzVMmKvDZNd6n+HZNdYcYXiIGLuA0HbMlx5bN8sNXz9ic147U5AhUFK+uryhpM7ZsrABPdzNXuHxITjQbYLa6ofRcTkxR8I9qyo38ofn/C628tZMjaE8dGhhaKkXYxKwKYh/XTIu+nZN96hU6oO7eXAw8UQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785514797; c=relaxed/simple; bh=DeZtw3F7yKEtM3L+V9bSKt+8ejdCYffKo0KzIQCU4VA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=jKq6WS25ZvX/Pi4J+U5TiL/7kAMP8XWASu0t5pZ4Y8V+/b08HEBp89/cso7deEf8ULFLCAZxDfjeei/MSVOK3czEFtFVAbmZJGWQ8zzk3YXdYKT7mK4w9UU8w6Auz4O9rZhCrEgThe0jJEj+UJCkcRkdnFidDhdJeWmlrPl80Xw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=IATk21M/; arc=none smtp.client-ip=148.251.105.195 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1785514782; bh=DeZtw3F7yKEtM3L+V9bSKt+8ejdCYffKo0KzIQCU4VA=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=IATk21M/72a2R4cXCbUZVF3ePeVq81iTArMzkz7ChPS0RMlzJJH6k9ypb6UJd+bmy G46sERS2xR/HGIsOqWL8hT7cOfMUqAFSAV+WnZaC3nkgBaAX0amQz69o0xPdcJ/r1O GqzIkJryyE/AD1Jo/qyYXw2A/CnAMewuAx/cn5SToCilEfMWrZpIeqAySNADG2clDs Uojg0GB2plD0gF+8UIVxwzxDLkc5sWmM3Pf9ZCSYWnSMJBf/XaD2LxkJa++968r3u9 4jrsghrIAdt5t0wz+4+gc1b5Xc0MBnzjQZLl1Qrv6u83qZhpDq+FO2cQHmdtnxwSrc UFva8zGFVqLDg== Received: from localhost (unknown [100.64.0.241]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange secp256r1 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: cristicc) by bali.collaboradmins.com (Postfix) with ESMTPSA id 03E1F17E0984; Fri, 31 Jul 2026 18:19:42 +0200 (CEST) From: Cristian Ciocaltea Date: Fri, 31 Jul 2026 19:19:45 +0300 Subject: [PATCH v10 38/69] drm/rockchip: dw_hdmi_qp: Use dw_hdmi_qp_hpd_notify() for HPD reports Precedence: bulk X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20260731-dw-hdmi-qp-scramb-v10-38-294364b2cf15@collabora.com> References: <20260731-dw-hdmi-qp-scramb-v10-0-294364b2cf15@collabora.com> In-Reply-To: <20260731-dw-hdmi-qp-scramb-v10-0-294364b2cf15@collabora.com> To: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Luca Ceresoli , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Chen-Yu Tsai , Samuel Holland , Dave Stevenson , =?utf-8?q?Ma=C3=ADra_Canal?= , Raspberry Pi Kernel Maintenance , Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Andy Yan , Algea Cao , Daniel Stone , Liu Ying , Phong LE Cc: kernel@collabora.com, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-rockchip@lists.infradead.org, Maud Spierings , Diederik de Haas X-Mailer: b4 0.15.2 X-Rspamd-Server: rspamd-worker-8404 X-Spamd-Result: default: False [-2.16 / 15.00]; BAYES_HAM(-5.50)[100.00%]; RBL_SENDERSCORE(2.00)[172.232.135.74:from]; SUSPICIOUS_RECIPS(1.50)[]; MAILLIST(-0.15)[generic]; MIME_GOOD(-0.10)[text/plain]; BAD_REP_POLICIES(0.10)[]; HAS_LIST_UNSUB(-0.01)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[cknow-tech.com:email,collabora.com:email,collabora.com:dkim,sto.lore.kernel.org:rdns,sto.lore.kernel.org:helo]; TAGGED_RCPT(0.00)[]; PRECEDENCE_BULK(0.00)[]; RCPT_COUNT_TWELVE(0.00)[32]; FREEMAIL_CC(0.00)[collabora.com,vger.kernel.org,lists.freedesktop.org,lists.infradead.org,lists.linux.dev,hotmail.com,cknow-tech.com]; FROM_HAS_DN(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_COUNT_FIVE(0.00)[5]; R_DKIM_ALLOW(0.00)[collabora.com:s=mail]; FROM_NEQ_ENVFROM(0.00)[cristian.ciocaltea@collabora.com,linux-sunxi@lists.linux.dev]; DMARC_POLICY_ALLOW(0.00)[collabora.com,none]; FREEMAIL_TO(0.00)[intel.com,linaro.org,kernel.org,ideasonboard.com,kwiboo.se,gmail.com,bootlin.com,linux.intel.com,suse.de,ffwll.ch,sholland.org,raspberrypi.com,igalia.com,rock-chips.com,sntech.de,collabora.com,nxp.com,baylibre.com]; DKIM_TRACE(0.00)[collabora.com:+]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(0.00)[+ip4:172.232.135.74]; FORGED_SENDER_MAILLIST(0.00)[]; FORGED_RECIPIENTS_MAILLIST(0.00)[]; RCVD_TLS_LAST(0.00)[]; ARC_ALLOW(0.00)[subspace.kernel.org:s=arc-20240116:i=1]; MIME_TRACE(0.00)[0:+]; TAGGED_FROM(0.00)[bounces-24844-noreply=patchwork.local]; ASN(0.00)[asn:63949, ipnet:172.232.128.0/19, country:SG]; RCVD_VIA_SMTP_AUTH(0.00)[] X-Rspamd-Queue-Id: 3BFC81C1D58 X-MORS-Enabled: yes X-MORS-DOMAIN: patchwork.local X-MORS-HOSTING: hosting172546 X-MORS-USER: hosting172546 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= Notify only the affected connector instead of polling all of them, and ensure .detect_ctx() runs on reconnect to recover SCDC state. Tested-by: Maud Spierings Tested-by: Diederik de Haas # NanoPC-T6 LTS, Rock 5B Signed-off-by: Cristian Ciocaltea --- drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c b/drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c index 253da2162ce6..bbdd47d4f381 100644 --- a/drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c +++ b/drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c @@ -24,7 +24,6 @@ #include #include #include -#include #include "rockchip_drm_drv.h" @@ -382,14 +381,8 @@ static void dw_hdmi_qp_rk3588_hpd_work(struct work_struct *work) struct rockchip_hdmi_qp *hdmi = container_of(work, struct rockchip_hdmi_qp, hpd_work.work); - struct drm_device *drm = hdmi->encoder.encoder.dev; - bool changed; - if (drm) { - changed = drm_helper_hpd_irq_event(drm); - if (changed) - dev_dbg(hdmi->dev, "connector status changed\n"); - } + dw_hdmi_qp_hpd_notify(hdmi->hdmi); } static irqreturn_t dw_hdmi_qp_rk3576_hardirq(int irq, void *dev_id) @@ -776,8 +769,7 @@ static int __maybe_unused dw_hdmi_qp_rockchip_resume(struct device *dev) dw_hdmi_qp_resume(dev, hdmi->hdmi); - if (hdmi->encoder.encoder.dev) - drm_helper_hpd_irq_event(hdmi->encoder.encoder.dev); + dw_hdmi_qp_hpd_notify(hdmi->hdmi); return 0; } From patchwork Fri Jul 31 16:19:46 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Ciocaltea X-Patchwork-Id: 2856 Return-Path: X-Original-To: noreply@patchwork.local Delivered-To: noreply@patchwork.local Received: from sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74]) by mxe881.netcup.net (Postfix) with ESMTPS id 62E481C22FA for ; Fri, 31 Jul 2026 18:39:31 +0200 (CEST) Authentication-Results: mxe881; dkim=pass header.d=collabora.com; spf=pass (sender IP is 172.232.135.74) smtp.mailfrom=linux-sunxi+bounces-24847-noreply=patchwork.local@lists.linux.dev smtp.helo=sto.lore.kernel.org Received-SPF: pass (mxe881: domain of lists.linux.dev designates 172.232.135.74 as permitted sender) client-ip=172.232.135.74; envelope-from=linux-sunxi+bounces-24847-noreply=patchwork.local@lists.linux.dev; helo=sto.lore.kernel.org; Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by sto.lore.kernel.org (Postfix) with ESMTP id ADBEC30D230B for ; Fri, 31 Jul 2026 16:24:25 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 46479469859; Fri, 31 Jul 2026 16:20:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="Y31T1Cbx" X-Original-To: linux-sunxi@lists.linux.dev Received: from bali.collaboradmins.com (bali.collaboradmins.com [148.251.105.195]) (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 C6EAC45D5E2 for ; Fri, 31 Jul 2026 16:19:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.251.105.195 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785514797; cv=none; b=oO9scvcq5STu0VsTESqLFUdEXzdCa4Ucg9VLfbnbi70vNhaLqUB1WN2CeJi0F/8hPChIHEWfV+6+Oca0PqWD4j5OcvMhKotc66jOFgIsDT3DxYxjMxRY8llG3VQ/BUaRjNyJnu+v2TGTK54B4RbqfQOA4rfaXaKgjUyxgI23ixw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785514797; c=relaxed/simple; bh=hMfmPjxTX291Q5EGzy4LRXRcR3XKvgItQhsbL5BpXSo=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Yq/ixZi7RNkEb/BSNEQ3ep3jzN10afB0zY74R5G2nw0YjwglyeAwm56Mtux3yL2ynyA2O/2wPfJljdjwBjDWO7p6Ndezf+b3xIDkdaG2bhVbHgjg7HnLOzVAb7OsFHL05roJZWqnlP0er2X3tDf9klUQripL+8wYbxEC4ndT2Y8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=Y31T1Cbx; arc=none smtp.client-ip=148.251.105.195 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1785514782; bh=hMfmPjxTX291Q5EGzy4LRXRcR3XKvgItQhsbL5BpXSo=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=Y31T1CbxRMTEv0VHq3rKBFvjGN7T4PHqWzcFv3WBxy+p5EENVAZIrKHCt1X9dcl/t je//Wvnhilp0J2oKlBjnLkancuuayTRy0xPL6VDqPISVo1mhUWb5N21KlebznHeZv7 Wb7uPlfZKYNFC0/WB0fzG2AA/rKVV6Soy8IsoRHUGiT+RBW+Aezi0dgHr+5LRsgEtb aXS8WOcs0kZiSNR1pdoaEt7WWnMwgmCsVkGYKhkTJAVVgS1YK09BQdP+Tt6apRJldp DttKHxr9wdZyTOcIaLeNxwgkPL7xVKhImzHm+DpDJ9kX3h+GdVbGSUB4yxXJIs3xCT 5QYACaAi+DLkQ== Received: from localhost (unknown [100.64.0.241]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange secp256r1 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: cristicc) by bali.collaboradmins.com (Postfix) with ESMTPSA id B0C5417E0988; Fri, 31 Jul 2026 18:19:42 +0200 (CEST) From: Cristian Ciocaltea Date: Fri, 31 Jul 2026 19:19:46 +0300 Subject: [PATCH v10 39/69] drm/bridge: dw-hdmi-qp: Drop unused .setup_hpd() phy op Precedence: bulk X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20260731-dw-hdmi-qp-scramb-v10-39-294364b2cf15@collabora.com> References: <20260731-dw-hdmi-qp-scramb-v10-0-294364b2cf15@collabora.com> In-Reply-To: <20260731-dw-hdmi-qp-scramb-v10-0-294364b2cf15@collabora.com> To: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Luca Ceresoli , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Chen-Yu Tsai , Samuel Holland , Dave Stevenson , =?utf-8?q?Ma=C3=ADra_Canal?= , Raspberry Pi Kernel Maintenance , Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Andy Yan , Algea Cao , Daniel Stone , Liu Ying , Phong LE Cc: kernel@collabora.com, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-rockchip@lists.infradead.org, Maud Spierings , Diederik de Haas X-Mailer: b4 0.15.2 X-Rspamd-Server: rspamd-worker-8404 X-Spamd-Result: default: False [-2.16 / 15.00]; BAYES_HAM(-5.50)[100.00%]; RBL_SENDERSCORE(2.00)[172.232.135.74:from]; SUSPICIOUS_RECIPS(1.50)[]; MAILLIST(-0.15)[generic]; MIME_GOOD(-0.10)[text/plain]; BAD_REP_POLICIES(0.10)[]; HAS_LIST_UNSUB(-0.01)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[cknow-tech.com:email,collabora.com:email,collabora.com:dkim]; TAGGED_RCPT(0.00)[]; PRECEDENCE_BULK(0.00)[]; RCPT_COUNT_TWELVE(0.00)[32]; FREEMAIL_CC(0.00)[collabora.com,vger.kernel.org,lists.freedesktop.org,lists.infradead.org,lists.linux.dev,hotmail.com,cknow-tech.com]; FROM_HAS_DN(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_COUNT_FIVE(0.00)[5]; R_DKIM_ALLOW(0.00)[collabora.com:s=mail]; FROM_NEQ_ENVFROM(0.00)[cristian.ciocaltea@collabora.com,linux-sunxi@lists.linux.dev]; DMARC_POLICY_ALLOW(0.00)[collabora.com,none]; FREEMAIL_TO(0.00)[intel.com,linaro.org,kernel.org,ideasonboard.com,kwiboo.se,gmail.com,bootlin.com,linux.intel.com,suse.de,ffwll.ch,sholland.org,raspberrypi.com,igalia.com,rock-chips.com,sntech.de,collabora.com,nxp.com,baylibre.com]; DKIM_TRACE(0.00)[collabora.com:+]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(0.00)[+ip4:172.232.135.74]; FORGED_SENDER_MAILLIST(0.00)[]; FORGED_RECIPIENTS_MAILLIST(0.00)[]; RCVD_TLS_LAST(0.00)[]; ARC_ALLOW(0.00)[subspace.kernel.org:s=arc-20240116:i=1]; MIME_TRACE(0.00)[0:+]; TAGGED_FROM(0.00)[bounces-24847-noreply=patchwork.local]; ASN(0.00)[asn:63949, ipnet:172.232.128.0/19, country:SG]; RCVD_VIA_SMTP_AUTH(0.00)[] X-Rspamd-Queue-Id: 62E481C22FA X-MORS-Enabled: yes X-MORS-DOMAIN: patchwork.local X-MORS-HOSTING: hosting172546 X-MORS-USER: hosting172546 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= With the transition to .{enable|disable}_hpd() phy ops complete in both the bridge and platform drivers, .setup_hpd() has no remaining callers. Drop it. Tested-by: Maud Spierings Tested-by: Diederik de Haas # NanoPC-T6 LTS, Rock 5B Signed-off-by: Cristian Ciocaltea --- drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c | 3 --- include/drm/bridge/dw_hdmi_qp.h | 1 - 2 files changed, 4 deletions(-) diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c index a2277531182c..fcbc518cd90a 100644 --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c @@ -1295,9 +1295,6 @@ static void dw_hdmi_qp_init_hw(struct dw_hdmi_qp *hdmi) /* Clear DONE and ERROR interrupts */ dw_hdmi_qp_write(hdmi, I2CM_OP_DONE_CLEAR | I2CM_NACK_RCVD_CLEAR, MAINUNIT_1_INT_CLEAR); - - if (hdmi->phy.ops->setup_hpd) - hdmi->phy.ops->setup_hpd(hdmi, hdmi->phy.data); } struct dw_hdmi_qp *dw_hdmi_qp_bind(struct platform_device *pdev, diff --git a/include/drm/bridge/dw_hdmi_qp.h b/include/drm/bridge/dw_hdmi_qp.h index b4fb1c578a5b..ad33f9cafdeb 100644 --- a/include/drm/bridge/dw_hdmi_qp.h +++ b/include/drm/bridge/dw_hdmi_qp.h @@ -16,7 +16,6 @@ struct dw_hdmi_qp_phy_ops { int (*init)(struct dw_hdmi_qp *hdmi, void *data); void (*disable)(struct dw_hdmi_qp *hdmi, void *data); enum drm_connector_status (*read_hpd)(struct dw_hdmi_qp *hdmi, void *data); - void (*setup_hpd)(struct dw_hdmi_qp *hdmi, void *data); void (*enable_hpd)(struct dw_hdmi_qp *hdmi, void *data); void (*disable_hpd)(struct dw_hdmi_qp *hdmi, void *data); }; From patchwork Fri Jul 31 16:19:47 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Ciocaltea X-Patchwork-Id: 2834 Return-Path: X-Original-To: noreply@patchwork.local Delivered-To: noreply@patchwork.local Received: from sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74]) by mxe881.netcup.net (Postfix) with ESMTPS id 4E10D1C1D58 for ; Fri, 31 Jul 2026 18:34:32 +0200 (CEST) Authentication-Results: mxe881; dkim=pass header.d=collabora.com; spf=pass (sender IP is 172.232.135.74) smtp.mailfrom=linux-sunxi+bounces-24851-noreply=patchwork.local@lists.linux.dev smtp.helo=sto.lore.kernel.org Received-SPF: pass (mxe881: domain of lists.linux.dev designates 172.232.135.74 as permitted sender) client-ip=172.232.135.74; envelope-from=linux-sunxi+bounces-24851-noreply=patchwork.local@lists.linux.dev; helo=sto.lore.kernel.org; Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by sto.lore.kernel.org (Postfix) with ESMTP id 799AF311C0AC for ; Fri, 31 Jul 2026 16:24:47 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 05F6046AA6D; Fri, 31 Jul 2026 16:20:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="FuouhmE5" X-Original-To: linux-sunxi@lists.linux.dev Received: from bali.collaboradmins.com (bali.collaboradmins.com [148.251.105.195]) (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 DDCA545DF61 for ; Fri, 31 Jul 2026 16:19:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.251.105.195 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785514800; cv=none; b=fX3a2jkP/zT7o6T+QEcKUUyA45eifbfw179afyiUQ6heAMHgwDUvyphoT8Sd8xlLwo1yQ8mI4EhOkge1IHsGZl9aQMBRQfjEtvS3g2vYw+ifIE0uIyLNiV+Dr3X825kBLfbUzk8miPjHjwvOa1Np4Zdqc2KaCPGIgCyJGx3/3BI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785514800; c=relaxed/simple; bh=iLBgGcOxsOS2yAa7hsIIJ+lrcLo+tkotBZn2zYbteNg=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=YD+x6A75wTVv5kpUzge3GE/K6VXvT1HWA9VDZq6o/jlhVL3ToUt1zbTRx2331fxcK4qnuobhvpYHphk5jMMSvDTHjMcXi8HBXgkw6M0g6RoFP+4vHWlkOrfh/qSTKhyFculEELqyxX1IvG4uonYB7uxSn3KQei5aHYgQEYbzYTQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=FuouhmE5; arc=none smtp.client-ip=148.251.105.195 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1785514783; bh=iLBgGcOxsOS2yAa7hsIIJ+lrcLo+tkotBZn2zYbteNg=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=FuouhmE5WKR/cwxLxk68g3Re9XTm68F1E70jZT37s5Cy236NflauLhMUjbDnipY5G S7RAkyl4Ci2J2Q6p9KBNxvKCM2In7RoCLqf2FvwC3GQRzR5RXLiIs8zv/IUXAWVoGh 0w6zomaPplnl93t3dH+JzfCgxDeBrCDq7VWKlo+KPx7BPJUQPAED8ZqWll+l4kFUfF H+oGU/mXMOYjigMJ55NcgbkCv9prbQ5fFOEYVPD+ACcZ/nxg7Tt5WYL16qWEp4ooDd mj66OfMScjjNPns9SbhuHNqoVJldLhdT5uuJkQVwQfmZeSv7XSXNFpYe436QQW5fXK 5U7c+T3CVuQDQ== Received: from localhost (unknown [100.64.0.241]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange secp256r1 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: cristicc) by bali.collaboradmins.com (Postfix) with ESMTPSA id 668AC17E093E; Fri, 31 Jul 2026 18:19:43 +0200 (CEST) From: Cristian Ciocaltea Date: Fri, 31 Jul 2026 19:19:47 +0300 Subject: [PATCH v10 40/69] drm/vc4: hdmi: Use common TMDS char rate constants Precedence: bulk X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20260731-dw-hdmi-qp-scramb-v10-40-294364b2cf15@collabora.com> References: <20260731-dw-hdmi-qp-scramb-v10-0-294364b2cf15@collabora.com> In-Reply-To: <20260731-dw-hdmi-qp-scramb-v10-0-294364b2cf15@collabora.com> To: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Luca Ceresoli , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Chen-Yu Tsai , Samuel Holland , Dave Stevenson , =?utf-8?q?Ma=C3=ADra_Canal?= , Raspberry Pi Kernel Maintenance , Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Andy Yan , Algea Cao , Daniel Stone , Liu Ying , Phong LE Cc: kernel@collabora.com, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-rockchip@lists.infradead.org X-Mailer: b4 0.15.2 X-Rspamd-Server: rspamd-worker-8404 X-Spamd-Result: default: False [-2.16 / 15.00]; BAYES_HAM(-5.50)[100.00%]; RBL_SENDERSCORE(2.00)[172.232.135.74:from]; SUSPICIOUS_RECIPS(1.50)[]; MAILLIST(-0.15)[generic]; BAD_REP_POLICIES(0.10)[]; MIME_GOOD(-0.10)[text/plain]; HAS_LIST_UNSUB(-0.01)[]; R_DKIM_ALLOW(0.00)[collabora.com:s=mail]; ARC_ALLOW(0.00)[subspace.kernel.org:s=arc-20240116:i=1]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_TWELVE(0.00)[30]; PRECEDENCE_BULK(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[raspberrypi.com:email,collabora.com:email,collabora.com:dkim,0.0.0.60:email,sto.lore.kernel.org:rdns,sto.lore.kernel.org:helo]; TAGGED_RCPT(0.00)[]; FORGED_SENDER_MAILLIST(0.00)[]; RCVD_COUNT_FIVE(0.00)[5]; ASN(0.00)[asn:63949, ipnet:172.232.128.0/19, country:SG]; DKIM_TRACE(0.00)[collabora.com:+]; DMARC_POLICY_ALLOW(0.00)[collabora.com,none]; R_SPF_ALLOW(0.00)[+ip4:172.232.135.74]; TO_DN_SOME(0.00)[]; FROM_NEQ_ENVFROM(0.00)[cristian.ciocaltea@collabora.com,linux-sunxi@lists.linux.dev]; FREEMAIL_TO(0.00)[intel.com,linaro.org,kernel.org,ideasonboard.com,kwiboo.se,gmail.com,bootlin.com,linux.intel.com,suse.de,ffwll.ch,sholland.org,raspberrypi.com,igalia.com,rock-chips.com,sntech.de,collabora.com,nxp.com,baylibre.com]; MIME_TRACE(0.00)[0:+]; TAGGED_FROM(0.00)[bounces-24851-noreply=patchwork.local]; FORGED_RECIPIENTS_MAILLIST(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[] X-Rspamd-Queue-Id: 4E10D1C1D58 X-MORS-Enabled: yes X-MORS-DOMAIN: patchwork.local X-MORS-HOSTING: hosting172546 X-MORS-USER: hosting172546 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= Replace HDMI_14_MAX_TMDS_CLK defined locally with HDMI_1_3_TMDS_CHAR_RATE_MAX_HZ provided by linux/hdmi.h. Note this incorrectly referenced HDMI 1.4, as the 340 MHz maximum TMDS character rate was actually introduced in HDMI 1.3. Similarly, use HDMI_2_0_TMDS_CHAR_RATE_MAX_HZ instead of the 600000000 magic number. Reviewed-by: Dave Stevenson Acked-by: Maxime Ripard Signed-off-by: Cristian Ciocaltea --- drivers/gpu/drm/vc4/vc4_hdmi.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c index 7f613f912368..9ce56eca775c 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c @@ -45,6 +45,7 @@ #include #include #include +#include #include #include #include @@ -113,8 +114,6 @@ #define HSM_MIN_CLOCK_FREQ 120000000 #define CEC_CLOCK_FREQ 40000 -#define HDMI_14_MAX_TMDS_CLK (340 * 1000 * 1000) - static bool vc4_hdmi_supports_scrambling(struct vc4_hdmi *vc4_hdmi) { struct drm_display_info *display = &vc4_hdmi->connector.display_info; @@ -137,7 +136,7 @@ static bool vc4_hdmi_mode_needs_scrambling(const struct drm_display_mode *mode, { unsigned long long clock = drm_hdmi_compute_mode_clock(mode, bpc, fmt); - return clock > HDMI_14_MAX_TMDS_CLK; + return clock > HDMI_1_3_TMDS_CHAR_RATE_MAX_HZ; } static int vc4_hdmi_debugfs_regs(struct seq_file *m, void *unused) @@ -1727,7 +1726,7 @@ vc4_hdmi_connector_clock_valid(const struct drm_connector *connector, if (clock > vc4_hdmi->variant->max_pixel_clock) return MODE_CLOCK_HIGH; - if (!vc4->hvs->vc5_hdmi_enable_hdmi_20 && clock > HDMI_14_MAX_TMDS_CLK) + if (!vc4->hvs->vc5_hdmi_enable_hdmi_20 && clock > HDMI_1_3_TMDS_CHAR_RATE_MAX_HZ) return MODE_CLOCK_HIGH; /* 4096x2160@60 is not reliable without overclocking core */ @@ -3253,7 +3252,7 @@ static int vc4_hdmi_bind(struct device *dev, struct device *master, void *data) * vc4_hdmi_disable_scrambling() will thus run at boot, make * sure it's disabled, and avoid any inconsistency. */ - if (variant->max_pixel_clock > HDMI_14_MAX_TMDS_CLK) + if (variant->max_pixel_clock > HDMI_1_3_TMDS_CHAR_RATE_MAX_HZ) vc4_hdmi->scdc_enabled = true; ret = variant->init_resources(drm, vc4_hdmi); @@ -3383,7 +3382,7 @@ static const struct vc4_hdmi_variant bcm2711_hdmi0_variant = { .encoder_type = VC4_ENCODER_TYPE_HDMI0, .debugfs_name = "hdmi0_regs", .card_name = "vc4-hdmi-0", - .max_pixel_clock = 600000000, + .max_pixel_clock = HDMI_2_0_TMDS_CHAR_RATE_MAX_HZ, .registers = vc5_hdmi_hdmi0_fields, .num_registers = ARRAY_SIZE(vc5_hdmi_hdmi0_fields), .phy_lane_mapping = { @@ -3412,7 +3411,7 @@ static const struct vc4_hdmi_variant bcm2711_hdmi1_variant = { .encoder_type = VC4_ENCODER_TYPE_HDMI1, .debugfs_name = "hdmi1_regs", .card_name = "vc4-hdmi-1", - .max_pixel_clock = HDMI_14_MAX_TMDS_CLK, + .max_pixel_clock = HDMI_1_3_TMDS_CHAR_RATE_MAX_HZ, .registers = vc5_hdmi_hdmi1_fields, .num_registers = ARRAY_SIZE(vc5_hdmi_hdmi1_fields), .phy_lane_mapping = { @@ -3441,7 +3440,7 @@ static const struct vc4_hdmi_variant bcm2712_hdmi0_variant = { .encoder_type = VC4_ENCODER_TYPE_HDMI0, .debugfs_name = "hdmi0_regs", .card_name = "vc4-hdmi-0", - .max_pixel_clock = 600000000, + .max_pixel_clock = HDMI_2_0_TMDS_CHAR_RATE_MAX_HZ, .registers = vc6_hdmi_hdmi0_fields, .num_registers = ARRAY_SIZE(vc6_hdmi_hdmi0_fields), .phy_lane_mapping = { @@ -3468,7 +3467,7 @@ static const struct vc4_hdmi_variant bcm2712_hdmi1_variant = { .encoder_type = VC4_ENCODER_TYPE_HDMI1, .debugfs_name = "hdmi1_regs", .card_name = "vc4-hdmi-1", - .max_pixel_clock = 600000000, + .max_pixel_clock = HDMI_2_0_TMDS_CHAR_RATE_MAX_HZ, .registers = vc6_hdmi_hdmi1_fields, .num_registers = ARRAY_SIZE(vc6_hdmi_hdmi1_fields), .phy_lane_mapping = { From patchwork Fri Jul 31 16:19:48 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Ciocaltea X-Patchwork-Id: 2867 Return-Path: X-Original-To: noreply@patchwork.local Delivered-To: noreply@patchwork.local Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114]) by mxe881.netcup.net (Postfix) with ESMTPS id 2F6751C2304 for ; Fri, 31 Jul 2026 18:42:28 +0200 (CEST) Authentication-Results: mxe881; dkim=pass header.d=collabora.com; spf=pass (sender IP is 172.105.105.114) smtp.mailfrom=linux-sunxi+bounces-24839-noreply=patchwork.local@lists.linux.dev smtp.helo=tor.lore.kernel.org Received-SPF: pass (mxe881: domain of lists.linux.dev designates 172.105.105.114 as permitted sender) client-ip=172.105.105.114; envelope-from=linux-sunxi+bounces-24839-noreply=patchwork.local@lists.linux.dev; helo=tor.lore.kernel.org; Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by tor.lore.kernel.org (Postfix) with ESMTP id DD5913170329 for ; Fri, 31 Jul 2026 16:24:06 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C786C468C30; Fri, 31 Jul 2026 16:19:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="LP7UoA9X" X-Original-To: linux-sunxi@lists.linux.dev Received: from bali.collaboradmins.com (bali.collaboradmins.com [148.251.105.195]) (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 E077645DF6B for ; Fri, 31 Jul 2026 16:19:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.251.105.195 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785514795; cv=none; b=H5onYdhc/2Zt1GfqNHs8iTNzF9oyOangIqCPe5A00C11ROoC+aEu9eX1CnfpA6t9Lp3U0b9fzBEoqVFruwJPWyQnVx5W1PrSK2mH1aDZAkXZJzTy0rWuuS1e/8zeyxtQsGJ8zXMN1ijf2Au10+DHTYIb91geNdR7WwyYAa2h4uo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785514795; c=relaxed/simple; bh=T57B2HIpxjOg2246T5ktjF/JgTCd4d9jWzrI7OnBqP0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=oVHAhoWfvzsRSkUc4nd1QYvrM4dl+tBIRk1YD/YlFZX/qWwIbGr/eutDZQn3qPQiBvbxKSziLsqfiZszBTL1TUqb3ZvLYLYqU9nkQdd0dOVGBR1oER3CAXn4nw6bS/OtMNUUUrqcbeatgOyQS3L670F2UtL1x/89Feo4s0MbJlA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=LP7UoA9X; arc=none smtp.client-ip=148.251.105.195 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1785514784; bh=T57B2HIpxjOg2246T5ktjF/JgTCd4d9jWzrI7OnBqP0=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=LP7UoA9Xj4+0SCmFFy4slUzG9qksnmPdmhrc+bzX4b1fl+siK8bEPBcvSxVMlzahA xy/mcQ5TIqSvGUIVbnxnsbCAduq94oxpZPqv5LYQH9iVljwwGyA0Ig55Qi6uc0wj+P Pm9cD5dtEQJfQgG7nS82WFbX5VkqI+4ds+3xbr4OUMo9Eb7ZSgW1X6sojH7zog1xpa VNH/aktvWtNwhpP4JtWxa5AXyWFkbhOqjrbIe5hAXks/fjyRyn8+i445yrZwL5ZIxm 7OvWCfQleS8eMUN1wPKcvlyjuUqe+zci5NN7iq/tt5upQJzj585ESM3B80lEgHYQq6 7gLHueC2ZBlmQ== Received: from localhost (unknown [100.64.0.241]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange secp256r1 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: cristicc) by bali.collaboradmins.com (Postfix) with ESMTPSA id 1B4A017E0936; Fri, 31 Jul 2026 18:19:44 +0200 (CEST) From: Cristian Ciocaltea Date: Fri, 31 Jul 2026 19:19:48 +0300 Subject: [PATCH v10 41/69] drm/vc4: hdmi: Switch to drm_hdmi_mode_needs_scrambling() Precedence: bulk X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20260731-dw-hdmi-qp-scramb-v10-41-294364b2cf15@collabora.com> References: <20260731-dw-hdmi-qp-scramb-v10-0-294364b2cf15@collabora.com> In-Reply-To: <20260731-dw-hdmi-qp-scramb-v10-0-294364b2cf15@collabora.com> To: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Luca Ceresoli , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Chen-Yu Tsai , Samuel Holland , Dave Stevenson , =?utf-8?q?Ma=C3=ADra_Canal?= , Raspberry Pi Kernel Maintenance , Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Andy Yan , Algea Cao , Daniel Stone , Liu Ying , Phong LE Cc: kernel@collabora.com, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-rockchip@lists.infradead.org X-Mailer: b4 0.15.2 X-Rspamd-Server: rspamd-worker-8404 X-Spamd-Result: default: False [-2.16 / 15.00]; BAYES_HAM(-5.50)[100.00%]; RBL_SENDERSCORE(2.00)[172.105.105.114:from]; SUSPICIOUS_RECIPS(1.50)[]; MAILLIST(-0.15)[generic]; MIME_GOOD(-0.10)[text/plain]; BAD_REP_POLICIES(0.10)[]; HAS_LIST_UNSUB(-0.01)[]; FROM_HAS_DN(0.00)[]; TAGGED_RCPT(0.00)[]; PRECEDENCE_BULK(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; RCPT_COUNT_TWELVE(0.00)[30]; RCVD_COUNT_FIVE(0.00)[5]; DBL_BLOCKED_OPENRESOLVER(0.00)[tor.lore.kernel.org:rdns,tor.lore.kernel.org:helo,collabora.com:email,collabora.com:dkim]; FORGED_SENDER_MAILLIST(0.00)[]; R_DKIM_ALLOW(0.00)[collabora.com:s=mail]; ARC_ALLOW(0.00)[subspace.kernel.org:s=arc-20240116:i=1]; DKIM_TRACE(0.00)[collabora.com:+]; DMARC_POLICY_ALLOW(0.00)[collabora.com,none]; R_SPF_ALLOW(0.00)[+ip4:172.105.105.114]; TO_DN_SOME(0.00)[]; FROM_NEQ_ENVFROM(0.00)[cristian.ciocaltea@collabora.com,linux-sunxi@lists.linux.dev]; FREEMAIL_TO(0.00)[intel.com,linaro.org,kernel.org,ideasonboard.com,kwiboo.se,gmail.com,bootlin.com,linux.intel.com,suse.de,ffwll.ch,sholland.org,raspberrypi.com,igalia.com,rock-chips.com,sntech.de,collabora.com,nxp.com,baylibre.com]; MIME_TRACE(0.00)[0:+]; TAGGED_FROM(0.00)[bounces-24839-noreply=patchwork.local]; FORGED_RECIPIENTS_MAILLIST(0.00)[]; ASN(0.00)[asn:63949, ipnet:172.105.96.0/20, country:SG]; RCVD_TLS_LAST(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[] X-Rspamd-Queue-Id: 2F6751C2304 X-MORS-Enabled: yes X-MORS-DOMAIN: patchwork.local X-MORS-HOSTING: hosting172546 X-MORS-USER: hosting172546 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= The VC4 HDMI driver has a local helper to check whether a mode requires scrambling. It is equivalent to drm_hdmi_mode_needs_scrambling(), so use the common helper instead. No functional change intended. Acked-by: Maxime Ripard Signed-off-by: Cristian Ciocaltea --- drivers/gpu/drm/vc4/vc4_hdmi.c | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c index 9ce56eca775c..4f7fc6689869 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c @@ -130,15 +130,6 @@ static bool vc4_hdmi_supports_scrambling(struct vc4_hdmi *vc4_hdmi) return true; } -static bool vc4_hdmi_mode_needs_scrambling(const struct drm_display_mode *mode, - unsigned int bpc, - enum drm_output_color_format fmt) -{ - unsigned long long clock = drm_hdmi_compute_mode_clock(mode, bpc, fmt); - - return clock > HDMI_1_3_TMDS_CHAR_RATE_MAX_HZ; -} - static int vc4_hdmi_debugfs_regs(struct seq_file *m, void *unused) { struct drm_debugfs_entry *entry = m->private; @@ -313,7 +304,7 @@ static int vc4_hdmi_reset_link(struct drm_connector *connector, return 0; } - scrambling_needed = vc4_hdmi_mode_needs_scrambling(&vc4_hdmi->saved_adjusted_mode, + scrambling_needed = drm_hdmi_mode_needs_scrambling(&vc4_hdmi->saved_adjusted_mode, vc4_hdmi->output_bpc, vc4_hdmi->output_format); if (!scrambling_needed) { @@ -443,7 +434,8 @@ static int vc4_hdmi_connector_get_modes(struct drm_connector *connector) const struct drm_display_mode *mode; list_for_each_entry(mode, &connector->probed_modes, head) { - if (vc4_hdmi_mode_needs_scrambling(mode, 8, DRM_OUTPUT_COLOR_FORMAT_RGB444)) { + if (drm_hdmi_mode_needs_scrambling(mode, 8, + DRM_OUTPUT_COLOR_FORMAT_RGB444)) { drm_warn_once(drm, "The core clock cannot reach frequencies high enough to support 4k @ 60Hz."); drm_warn_once(drm, "Please change your config.txt file to add hdmi_enable_4kp60."); } @@ -802,7 +794,7 @@ static void vc4_hdmi_enable_scrambling(struct drm_encoder *encoder) if (!vc4_hdmi_supports_scrambling(vc4_hdmi)) return; - if (!vc4_hdmi_mode_needs_scrambling(mode, + if (!drm_hdmi_mode_needs_scrambling(mode, vc4_hdmi->output_bpc, vc4_hdmi->output_format)) return; From patchwork Fri Jul 31 16:19:49 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Ciocaltea X-Patchwork-Id: 2831 Return-Path: X-Original-To: noreply@patchwork.local Delivered-To: noreply@patchwork.local Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114]) by mxe881.netcup.net (Postfix) with ESMTPS id 628CD1C1D77 for ; Fri, 31 Jul 2026 18:33:55 +0200 (CEST) Authentication-Results: mxe881; dkim=pass header.d=collabora.com; spf=pass (sender IP is 172.105.105.114) smtp.mailfrom=linux-sunxi+bounces-24843-noreply=patchwork.local@lists.linux.dev smtp.helo=tor.lore.kernel.org Received-SPF: pass (mxe881: domain of lists.linux.dev designates 172.105.105.114 as permitted sender) client-ip=172.105.105.114; envelope-from=linux-sunxi+bounces-24843-noreply=patchwork.local@lists.linux.dev; helo=tor.lore.kernel.org; Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by tor.lore.kernel.org (Postfix) with ESMTP id 8012B3177C0F for ; Fri, 31 Jul 2026 16:24:30 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B1B5F46A600; Fri, 31 Jul 2026 16:20:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="Z3rE6q9C" X-Original-To: linux-sunxi@lists.linux.dev Received: from bali.collaboradmins.com (bali.collaboradmins.com [148.251.105.195]) (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 1EC7144CF29 for ; Fri, 31 Jul 2026 16:19:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.251.105.195 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785514797; cv=none; b=PYEs/oyOfCWURNA7J3IRxkbW+VGJQrSYWdtkj9bPtNo3u4xd9nsjT+mWwo5qm03VDrX9Ae9fsQLDdbFRk3nbOb1gU8J7uSY1Qeh+qczk/ggWKxQ9eBulgGR6h301/5STkYRsN/pDNngBXXr79E8hD//RruCqCdtAM0uetPYpo1c= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785514797; c=relaxed/simple; bh=hEKxNu2C8ewO/+aCheyfTQqRKZ28rWyZ2tMcGpLe148=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=YOeFMLQ4MScM9LbF8s6kc4uiO2Uke2edP6zgBp2TbxxTDETomH+lHGIg2HtaPzUAHRLoy5zmPivZYPRk1Iwt2UiTY4m7A+lIDy5ix/MPfkEn3rYgX1Wn38Qi2YIowoD/pGPHNiqlwXygtkcQny41bHUalwunHin2xh/FfL8B5/4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=Z3rE6q9C; arc=none smtp.client-ip=148.251.105.195 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1785514784; bh=hEKxNu2C8ewO/+aCheyfTQqRKZ28rWyZ2tMcGpLe148=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=Z3rE6q9Cp7WrUcC9hRs9EHgLzZR/YIutuDawEQhKJgH/dBBSsPWw1waoIfSWvBAzD Bhuip3VcxJC4YKp2duFTkO9Hn6e9Fqtu5MylYhGA/YuQkEqbx/8GxH2QEQiA6l6F6W fjZPjEjl4L/neFWhl5cpt7ZUFhqrwbV9H8x1m6ba0KkDlLk2O0UwqA7Q1W4LrOG66q a+GLnh52m+g66/Bxdrprj4LRDyi5uT+QoOZG+Z0y39YONHtPs9mzL9plmksi30sjZ6 yps35to6E65uZtzUOZhXDYCofov0YSubrCC9SvHsQzh9ez3j992zJKHDCY9JSWo501 uuMkuOyRaJxig== Received: from localhost (unknown [100.64.0.241]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange secp256r1 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: cristicc) by bali.collaboradmins.com (Postfix) with ESMTPSA id BE6E317E0937; Fri, 31 Jul 2026 18:19:44 +0200 (CEST) From: Cristian Ciocaltea Date: Fri, 31 Jul 2026 19:19:49 +0300 Subject: [PATCH v10 42/69] drm/vc4: hdmi: Switch to .force_ctx() connector helper Precedence: bulk X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20260731-dw-hdmi-qp-scramb-v10-42-294364b2cf15@collabora.com> References: <20260731-dw-hdmi-qp-scramb-v10-0-294364b2cf15@collabora.com> In-Reply-To: <20260731-dw-hdmi-qp-scramb-v10-0-294364b2cf15@collabora.com> To: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Luca Ceresoli , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Chen-Yu Tsai , Samuel Holland , Dave Stevenson , =?utf-8?q?Ma=C3=ADra_Canal?= , Raspberry Pi Kernel Maintenance , Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Andy Yan , Algea Cao , Daniel Stone , Liu Ying , Phong LE Cc: kernel@collabora.com, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-rockchip@lists.infradead.org X-Mailer: b4 0.15.2 X-MORS-Enabled: yes X-MORS-DOMAIN: patchwork.local X-MORS-HOSTING: hosting172546 X-MORS-USER: hosting172546 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= Use drm_atomic_helper_connector_hdmi_force_ctx() as the .force_ctx() implementation, so that the acquire context created by the probe helper reaches the HDMI connector framework. This is a prerequisite for converting the driver to the common HDMI 2.0 scrambling infrastructure, which implicitly handles SCDC state recovery through a CRTC reset when the sink reconnects while the display pipeline is active. Note that this does not interfere with the local SCDC state-management implementation, since the driver's scrambler capability has not yet been exposed through the common helpers. Signed-off-by: Cristian Ciocaltea Reviewed-by: Maxime Ripard --- drivers/gpu/drm/vc4/vc4_hdmi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c index 4f7fc6689869..ba16e7944cf3 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c @@ -504,7 +504,6 @@ static void vc4_hdmi_connector_reset(struct drm_connector *connector) } static const struct drm_connector_funcs vc4_hdmi_connector_funcs = { - .force = drm_atomic_helper_connector_hdmi_force, .fill_modes = drm_helper_probe_single_connector_modes, .reset = vc4_hdmi_connector_reset, .atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state, @@ -513,6 +512,7 @@ static const struct drm_connector_funcs vc4_hdmi_connector_funcs = { static const struct drm_connector_helper_funcs vc4_hdmi_connector_helper_funcs = { .detect_ctx = vc4_hdmi_connector_detect_ctx, + .force_ctx = drm_atomic_helper_connector_hdmi_force_ctx, .get_modes = vc4_hdmi_connector_get_modes, .atomic_check = vc4_hdmi_connector_atomic_check, .mode_valid = drm_hdmi_connector_mode_valid, From patchwork Fri Jul 31 16:19:50 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Ciocaltea X-Patchwork-Id: 2881 Return-Path: X-Original-To: noreply@patchwork.local Delivered-To: noreply@patchwork.local Received: from sin.lore.kernel.org (sin.lore.kernel.org [104.64.211.4]) by mxe881.netcup.net (Postfix) with ESMTPS id C4A6C1C0256 for ; Fri, 31 Jul 2026 19:05:47 +0200 (CEST) Authentication-Results: mxe881; dkim=pass header.d=collabora.com; spf=pass (sender IP is 104.64.211.4) smtp.mailfrom=linux-sunxi+bounces-24856-noreply=patchwork.local@lists.linux.dev smtp.helo=sin.lore.kernel.org Received-SPF: pass (mxe881: domain of lists.linux.dev designates 104.64.211.4 as permitted sender) client-ip=104.64.211.4; envelope-from=linux-sunxi+bounces-24856-noreply=patchwork.local@lists.linux.dev; helo=sin.lore.kernel.org; Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by sin.lore.kernel.org (Postfix) with ESMTP id 187843037227 for ; Fri, 31 Jul 2026 16:25:08 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8F6D944C4FF; Fri, 31 Jul 2026 16:20:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="NtmcqgNS" X-Original-To: linux-sunxi@lists.linux.dev Received: from bali.collaboradmins.com (bali.collaboradmins.com [148.251.105.195]) (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 6DAC0468C03 for ; Fri, 31 Jul 2026 16:19:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.251.105.195 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785514803; cv=none; b=RC8IzaRC/TyAhg0E0ULRtvJIWTiNdYPasVXRbNL3yNbVR8XJGS4JY45yxstyf5QXVfqzviioRu/WppTgYYVqZTO7UHkYw+vIvFv2TXawZFmr9AMvB7gYomgbOmNIcTkbDWHjUvK6qYZK9QSoKXs+J5bK3B+UmTzHBGU1P82Z9hg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785514803; c=relaxed/simple; bh=KwjregJEK1zHltpBaTSfhes6ErUtOgc/LRhZ6h3oFOI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=CSbfV7EnaUA2Hz3/5Qel5OCs8i8LgIBk3WSSbgSEEH5tRyBrtpgWgZtU0RWcIQZEpz2tShtGXYNWkYOvWBCeHTAP8dGmsD1N+1pAu3ZBKjffo3OBFbNOQkJNnBaXtMgRyLhbKZkohDe8xAYVwiov4+ha4hL+x9ral31c3FirvtM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=NtmcqgNS; arc=none smtp.client-ip=148.251.105.195 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1785514785; bh=KwjregJEK1zHltpBaTSfhes6ErUtOgc/LRhZ6h3oFOI=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=NtmcqgNSXRllEqlJW21sZx46nixZ5YWJzFqDA0DLvVWk07hwsd9sms+ahhduBVtGz QWOadKsy596BtM/7jAO9ZFaIwS94m8HitODlKf8zG0MtYyHt09pvaLfgVGspcBojma qu1u0hi3IpVyBxCS9MlyhhdsoEoR7ZJ0B7FHgBe/5nyHeI/xkUus4mzmAoaHV2GGWD FCzk7tbZXpad4UEyACbzX6bSVBqggvYnKtufy/ePUWMtjPqmuUMtsI4Cit2vucjM9O c4BTVRyyfOMjdE1Pg1LRBc6v7lz9IcCa0SPrbVA/ls5xqIma+YSWxOIvJ51Ex0O8o7 YM9rVA/DRRMIw== Received: from localhost (unknown [100.64.0.241]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange secp256r1 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: cristicc) by bali.collaboradmins.com (Postfix) with ESMTPSA id 7B05517E092C; Fri, 31 Jul 2026 18:19:45 +0200 (CEST) From: Cristian Ciocaltea Date: Fri, 31 Jul 2026 19:19:50 +0300 Subject: [PATCH v10 43/69] drm/vc4: hdmi: Propagate -EDEADLK to the top level Precedence: bulk X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20260731-dw-hdmi-qp-scramb-v10-43-294364b2cf15@collabora.com> References: <20260731-dw-hdmi-qp-scramb-v10-0-294364b2cf15@collabora.com> In-Reply-To: <20260731-dw-hdmi-qp-scramb-v10-0-294364b2cf15@collabora.com> To: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Luca Ceresoli , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Chen-Yu Tsai , Samuel Holland , Dave Stevenson , =?utf-8?q?Ma=C3=ADra_Canal?= , Raspberry Pi Kernel Maintenance , Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Andy Yan , Algea Cao , Daniel Stone , Liu Ying , Phong LE Cc: kernel@collabora.com, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-rockchip@lists.infradead.org X-Mailer: b4 0.15.2 X-MORS-Enabled: yes X-MORS-DOMAIN: patchwork.local X-MORS-HOSTING: hosting172546 X-MORS-USER: hosting172546 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= drm_connector_helper_funcs.detect_ctx() is expected to propagate -EDEADLK so that context owners, e.g. drm_helper_probe_detect_ctx(), can perform the required backoff and retry. vc4_hdmi_handle_hotplug() instead runs its own retry loop and calls drm_modeset_backoff() on an acquire context it does not own. This drops all locks in the context, including connection_mutex held by the core. Drop the local retry logic and propagate -EDEADLK to the caller instead. This aligns VC4 with the expected detect_ctx() semantics. Signed-off-by: Cristian Ciocaltea --- drivers/gpu/drm/vc4/vc4_hdmi.c | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c index ba16e7944cf3..72042fad04c5 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c @@ -344,12 +344,11 @@ static int vc4_hdmi_reset_link(struct drm_connector *connector, return drm_atomic_helper_reset_crtc(crtc, ctx); } -static void vc4_hdmi_handle_hotplug(struct vc4_hdmi *vc4_hdmi, - struct drm_modeset_acquire_ctx *ctx, - enum drm_connector_status status) +static int vc4_hdmi_handle_hotplug(struct vc4_hdmi *vc4_hdmi, + struct drm_modeset_acquire_ctx *ctx, + enum drm_connector_status status) { struct drm_connector *connector = &vc4_hdmi->connector; - int ret; /* * NOTE: This function should really be called with vc4_hdmi->mutex @@ -368,17 +367,9 @@ static void vc4_hdmi_handle_hotplug(struct vc4_hdmi *vc4_hdmi, drm_atomic_helper_connector_hdmi_hotplug(connector, ctx, status); if (status != connector_status_connected) - return; + return 0; - for (;;) { - ret = vc4_hdmi_reset_link(connector, ctx); - if (ret == -EDEADLK) { - drm_modeset_backoff(ctx); - continue; - } - - break; - } + return vc4_hdmi_reset_link(connector, ctx); } static int vc4_hdmi_connector_detect_ctx(struct drm_connector *connector, @@ -416,10 +407,10 @@ static int vc4_hdmi_connector_detect_ctx(struct drm_connector *connector, status = connector_status_connected; } - vc4_hdmi_handle_hotplug(vc4_hdmi, ctx, status); + ret = vc4_hdmi_handle_hotplug(vc4_hdmi, ctx, status); pm_runtime_put(&vc4_hdmi->pdev->dev); - return status; + return ret == -EDEADLK ? ret : status; } static int vc4_hdmi_connector_get_modes(struct drm_connector *connector) From patchwork Fri Jul 31 16:19:51 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Ciocaltea X-Patchwork-Id: 2859 Return-Path: X-Original-To: noreply@patchwork.local Delivered-To: noreply@patchwork.local Received: from sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74]) by mxe881.netcup.net (Postfix) with ESMTPS id D92671C22FA for ; Fri, 31 Jul 2026 18:39:51 +0200 (CEST) Authentication-Results: mxe881; dkim=pass header.d=collabora.com; spf=pass (sender IP is 172.232.135.74) smtp.mailfrom=linux-sunxi+bounces-24850-noreply=patchwork.local@lists.linux.dev smtp.helo=sto.lore.kernel.org Received-SPF: pass (mxe881: domain of lists.linux.dev designates 172.232.135.74 as permitted sender) client-ip=172.232.135.74; envelope-from=linux-sunxi+bounces-24850-noreply=patchwork.local@lists.linux.dev; helo=sto.lore.kernel.org; Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by sto.lore.kernel.org (Postfix) with ESMTP id 8E82930D7FC3 for ; Fri, 31 Jul 2026 16:24:39 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1F28446A611; Fri, 31 Jul 2026 16:20:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="dTUa6HGm" X-Original-To: linux-sunxi@lists.linux.dev Received: from bali.collaboradmins.com (bali.collaboradmins.com [148.251.105.195]) (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 EC7EF44C66F for ; Fri, 31 Jul 2026 16:19:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.251.105.195 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785514800; cv=none; b=MKXkwXgi6BwRJRU/PE7GxK2BTq11QUXB9cJsjeVIXsALR8eLUwjL0pa55DLjYC58f3062PSfKh5y5BHeTnnSb1Vuso3Ag4Z13giCZkz/62L+KGEvjaxyu/d80OZKdNxXdq0w7OgqmVmT0R99ohAF0/AosAlHlUi8r+pCbFSqJzo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785514800; c=relaxed/simple; bh=VhJ+GnFaAbBhWAyFrqoTC2CFyDpjFZZYBelBK4ZT1vg=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=KjMwe07ArOgczSgJhvoQ/sygFVBFqDNV5e+KXHyUaWMr6j9Flh0Al7e6QqZfIYn1bliDOVvRmb6hiF29UBY0WcQJTjOjJNlwShZPRh9DLuLv2H2dv3k/AsbOnzzcLgnYa2B6TPBFTKUyTs0GH3AwDDMcdcJ0sd0Jc0+/r445Uk0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=dTUa6HGm; arc=none smtp.client-ip=148.251.105.195 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1785514786; bh=VhJ+GnFaAbBhWAyFrqoTC2CFyDpjFZZYBelBK4ZT1vg=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=dTUa6HGmGPwDKtPqgWFH2CJlKGpwTv76m3LZwlcTEWDie0/lDVr6+gsMkYpcQEJTV VASXgpw6Knd0iCZbCXW63SL5CuNK6kXtE+y8z/zXd0y+h+/rHOMtk5ZxDO8c9X0f3D 39fp45HgoHsS75Ef08iZRz80B7Dw5cGEpzWO9nEI3190J4L6ceapdk1S+RA6JVDYun Hyr73GZe6vQgtUhb+D3+8/sDpeIPdZBpHwWAryH+6tnWkwcVBG2Kfwf53wVa7POGhx 0Bk2sh0rCnLdcD/iF9vgF2oW+wbknWw3r55Ee2Vvq3KUxr53sRSydPaM1GG/TR6iYR XVUWAjC4AXRXQ== Received: from localhost (unknown [100.64.0.241]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange secp256r1 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: cristicc) by bali.collaboradmins.com (Postfix) with ESMTPSA id 31D2A17E098E; Fri, 31 Jul 2026 18:19:46 +0200 (CEST) From: Cristian Ciocaltea Date: Fri, 31 Jul 2026 19:19:51 +0300 Subject: [PATCH v10 44/69] drm/vc4: hdmi: Convert to drmm_connector_hdmi_init() Precedence: bulk X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20260731-dw-hdmi-qp-scramb-v10-44-294364b2cf15@collabora.com> References: <20260731-dw-hdmi-qp-scramb-v10-0-294364b2cf15@collabora.com> In-Reply-To: <20260731-dw-hdmi-qp-scramb-v10-0-294364b2cf15@collabora.com> To: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Luca Ceresoli , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Chen-Yu Tsai , Samuel Holland , Dave Stevenson , =?utf-8?q?Ma=C3=ADra_Canal?= , Raspberry Pi Kernel Maintenance , Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Andy Yan , Algea Cao , Daniel Stone , Liu Ying , Phong LE Cc: kernel@collabora.com, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-rockchip@lists.infradead.org X-Mailer: b4 0.15.2 X-Rspamd-Server: rspamd-worker-8404 X-Spamd-Result: default: False [-2.16 / 15.00]; BAYES_HAM(-5.50)[100.00%]; RBL_SENDERSCORE(2.00)[172.232.135.74:from]; SUSPICIOUS_RECIPS(1.50)[]; MAILLIST(-0.15)[generic]; MIME_GOOD(-0.10)[text/plain]; BAD_REP_POLICIES(0.10)[]; HAS_LIST_UNSUB(-0.01)[]; FROM_HAS_DN(0.00)[]; TAGGED_RCPT(0.00)[]; PRECEDENCE_BULK(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; RCPT_COUNT_TWELVE(0.00)[30]; RCVD_COUNT_FIVE(0.00)[5]; DBL_BLOCKED_OPENRESOLVER(0.00)[collabora.com:email,collabora.com:dkim,sto.lore.kernel.org:rdns,sto.lore.kernel.org:helo]; FORGED_SENDER_MAILLIST(0.00)[]; R_DKIM_ALLOW(0.00)[collabora.com:s=mail]; ARC_ALLOW(0.00)[subspace.kernel.org:s=arc-20240116:i=1]; DKIM_TRACE(0.00)[collabora.com:+]; DMARC_POLICY_ALLOW(0.00)[collabora.com,none]; R_SPF_ALLOW(0.00)[+ip4:172.232.135.74]; TO_DN_SOME(0.00)[]; FROM_NEQ_ENVFROM(0.00)[cristian.ciocaltea@collabora.com,linux-sunxi@lists.linux.dev]; FREEMAIL_TO(0.00)[intel.com,linaro.org,kernel.org,ideasonboard.com,kwiboo.se,gmail.com,bootlin.com,linux.intel.com,suse.de,ffwll.ch,sholland.org,raspberrypi.com,igalia.com,rock-chips.com,sntech.de,collabora.com,nxp.com,baylibre.com]; MIME_TRACE(0.00)[0:+]; TAGGED_FROM(0.00)[bounces-24850-noreply=patchwork.local]; FORGED_RECIPIENTS_MAILLIST(0.00)[]; ASN(0.00)[asn:63949, ipnet:172.232.128.0/19, country:SG]; RCVD_TLS_LAST(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[] X-Rspamd-Queue-Id: D92671C22FA X-MORS-Enabled: yes X-MORS-DOMAIN: patchwork.local X-MORS-HOSTING: hosting172546 X-MORS-USER: hosting172546 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= Switch driver over to the new drmm_connector_hdmi_init() signature. The vendor, product, supported_formats and max_bpc values previously passed as arguments are now provided through struct drm_connector_hdmi_funcs, together with the new supported_hdmi_ver field. VC4 needs three distinct capability sets, based on the maximum TMDS character rate and color depth supported by each controller variant: RPi 0-3: 162 MHz (HDMI 1.2), 8-bit RPi 4 (HDMI1): 340 MHz (HDMI 1.4), 12-bit RPi 4 (HDMI0), RPi 5: 600 MHz (HDMI 2.0), 12-bit Introduce three drm_connector_hdmi_funcs instances for these tiers and assign them to the corresponding vc4_hdmi_variant entries. Additionally, drop the now redundant .supports_hdr field of struct vc4_hdmi_variant. As the callback members are identical across all three, factor the shared initializers into a VC4_HDMI_CONNECTOR_FUNCS_COMMON macro to avoid duplication, with each variant adding only its distinguishing max_bpc/supported_hdmi_ver fields. Note that HDMI 2.0 cannot be advertised at this point, since it requires converting the driver to common scrambling infrastructure. This will be handled separately, hence temporarily use HDMI_VERSION_UNKNOWN for the related hdmi_funcs instance to skip generic scrambler and TMDS rate validation, and continue to rely on current driver-local implementation. No functional change intended. Signed-off-by: Cristian Ciocaltea Reviewed-by: Maxime Ripard --- drivers/gpu/drm/vc4/vc4_hdmi.c | 93 ++++++++++++++++++++++++------------------ drivers/gpu/drm/vc4/vc4_hdmi.h | 6 +-- 2 files changed, 56 insertions(+), 43 deletions(-) diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c index 72042fad04c5..d599957fee3a 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c @@ -509,7 +509,6 @@ static const struct drm_connector_helper_funcs vc4_hdmi_connector_helper_funcs = .mode_valid = drm_hdmi_connector_mode_valid, }; -static const struct drm_connector_hdmi_funcs vc4_hdmi_hdmi_connector_funcs; static const struct drm_connector_hdmi_audio_funcs vc4_hdmi_audio_funcs; static int vc4_hdmi_connector_init(struct drm_device *dev, @@ -517,22 +516,13 @@ static int vc4_hdmi_connector_init(struct drm_device *dev, { struct drm_connector *connector = &vc4_hdmi->connector; struct drm_encoder *encoder = &vc4_hdmi->encoder.base; - unsigned int max_bpc = 8; int ret; - if (vc4_hdmi->variant->supports_hdr) - max_bpc = 12; - - ret = drmm_connector_hdmi_ini2(dev, connector, - "Broadcom", "Videocore", + ret = drmm_connector_hdmi_init(dev, connector, &vc4_hdmi_connector_funcs, - &vc4_hdmi_hdmi_connector_funcs, + vc4_hdmi->variant->hdmi_funcs, DRM_MODE_CONNECTOR_HDMIA, - vc4_hdmi->ddc, - BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444) | - BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR422) | - BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR444), - max_bpc); + vc4_hdmi->ddc); if (ret) return ret; @@ -1721,28 +1711,51 @@ vc4_hdmi_connector_clock_valid(const struct drm_connector *connector, return MODE_OK; } -static const struct drm_connector_hdmi_funcs vc4_hdmi_hdmi_connector_funcs = { - .tmds_char_rate_valid = vc4_hdmi_connector_clock_valid, - .avi = { - .clear_infoframe = vc4_hdmi_clear_avi_infoframe, - .write_infoframe = vc4_hdmi_write_avi_infoframe, - }, - .hdmi = { - .clear_infoframe = vc4_hdmi_clear_hdmi_infoframe, - .write_infoframe = vc4_hdmi_write_hdmi_infoframe, - }, - .audio = { - .clear_infoframe = vc4_hdmi_clear_audio_infoframe, - .write_infoframe = vc4_hdmi_write_audio_infoframe, - }, - .hdr_drm = { - .clear_infoframe = vc4_hdmi_clear_hdr_drm_infoframe, - .write_infoframe = vc4_hdmi_write_hdr_drm_infoframe, - }, - .spd = { - .clear_infoframe = vc4_hdmi_clear_spd_infoframe, - .write_infoframe = vc4_hdmi_write_spd_infoframe, - }, +#define VC4_HDMI_CONNECTOR_FUNCS_COMMON \ + .vendor = "Broadcom", \ + .product = "Videocore", \ + .supported_formats = BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444) | \ + BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR422) | \ + BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR444), \ + .tmds_char_rate_valid = vc4_hdmi_connector_clock_valid, \ + .avi = { \ + .clear_infoframe = vc4_hdmi_clear_avi_infoframe, \ + .write_infoframe = vc4_hdmi_write_avi_infoframe, \ + }, \ + .hdmi = { \ + .clear_infoframe = vc4_hdmi_clear_hdmi_infoframe, \ + .write_infoframe = vc4_hdmi_write_hdmi_infoframe, \ + }, \ + .audio = { \ + .clear_infoframe = vc4_hdmi_clear_audio_infoframe, \ + .write_infoframe = vc4_hdmi_write_audio_infoframe, \ + }, \ + .hdr_drm = { \ + .clear_infoframe = vc4_hdmi_clear_hdr_drm_infoframe, \ + .write_infoframe = vc4_hdmi_write_hdr_drm_infoframe, \ + }, \ + .spd = { \ + .clear_infoframe = vc4_hdmi_clear_spd_infoframe, \ + .write_infoframe = vc4_hdmi_write_spd_infoframe, \ + } + +static const struct drm_connector_hdmi_funcs vc4_hdmi_connector_funcs_hdmi12 = { + VC4_HDMI_CONNECTOR_FUNCS_COMMON, + .max_bpc = 8, + .supported_hdmi_ver = HDMI_VERSION_1_2, +}; + +static const struct drm_connector_hdmi_funcs vc4_hdmi_connector_funcs_hdmi14 = { + VC4_HDMI_CONNECTOR_FUNCS_COMMON, + .max_bpc = 12, + .supported_hdmi_ver = HDMI_VERSION_1_4, +}; + +static const struct drm_connector_hdmi_funcs vc4_hdmi_connector_funcs_hdmi20 = { + VC4_HDMI_CONNECTOR_FUNCS_COMMON, + .max_bpc = 12, + /* TODO: set HDMI_VERSION_2_0 and convert to common scrambler infra */ + .supported_hdmi_ver = HDMI_VERSION_UNKNOWN, }; #define WIFI_2_4GHz_CH1_MIN_FREQ 2400000000ULL @@ -3358,7 +3371,7 @@ static const struct vc4_hdmi_variant bcm2835_variant = { .phy_rng_enable = vc4_hdmi_phy_rng_enable, .phy_rng_disable = vc4_hdmi_phy_rng_disable, .channel_map = vc4_hdmi_channel_map, - .supports_hdr = false, + .hdmi_funcs = &vc4_hdmi_connector_funcs_hdmi12, }; static const struct vc4_hdmi_variant bcm2711_hdmi0_variant = { @@ -3386,8 +3399,8 @@ static const struct vc4_hdmi_variant bcm2711_hdmi0_variant = { .phy_rng_enable = vc5_hdmi_phy_rng_enable, .phy_rng_disable = vc5_hdmi_phy_rng_disable, .channel_map = vc5_hdmi_channel_map, - .supports_hdr = true, .hp_detect = vc5_hdmi_hp_detect, + .hdmi_funcs = &vc4_hdmi_connector_funcs_hdmi20, }; static const struct vc4_hdmi_variant bcm2711_hdmi1_variant = { @@ -3415,8 +3428,8 @@ static const struct vc4_hdmi_variant bcm2711_hdmi1_variant = { .phy_rng_enable = vc5_hdmi_phy_rng_enable, .phy_rng_disable = vc5_hdmi_phy_rng_disable, .channel_map = vc5_hdmi_channel_map, - .supports_hdr = true, .hp_detect = vc5_hdmi_hp_detect, + .hdmi_funcs = &vc4_hdmi_connector_funcs_hdmi14, }; static const struct vc4_hdmi_variant bcm2712_hdmi0_variant = { @@ -3442,8 +3455,8 @@ static const struct vc4_hdmi_variant bcm2712_hdmi0_variant = { .phy_init = vc6_hdmi_phy_init, .phy_disable = vc6_hdmi_phy_disable, .channel_map = vc5_hdmi_channel_map, - .supports_hdr = true, .hp_detect = vc5_hdmi_hp_detect, + .hdmi_funcs = &vc4_hdmi_connector_funcs_hdmi20, }; static const struct vc4_hdmi_variant bcm2712_hdmi1_variant = { @@ -3469,8 +3482,8 @@ static const struct vc4_hdmi_variant bcm2712_hdmi1_variant = { .phy_init = vc6_hdmi_phy_init, .phy_disable = vc6_hdmi_phy_disable, .channel_map = vc5_hdmi_channel_map, - .supports_hdr = true, .hp_detect = vc5_hdmi_hp_detect, + .hdmi_funcs = &vc4_hdmi_connector_funcs_hdmi20, }; static const struct of_device_id vc4_hdmi_dt_match[] = { diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.h b/drivers/gpu/drm/vc4/vc4_hdmi.h index 29d461d4ee49..d5ffcc17de32 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.h +++ b/drivers/gpu/drm/vc4/vc4_hdmi.h @@ -90,11 +90,11 @@ struct vc4_hdmi_variant { /* Callback to get channel map */ u32 (*channel_map)(struct vc4_hdmi *vc4_hdmi, u32 channel_mask); - /* Enables HDR metadata */ - bool supports_hdr; - /* Callback for hardware specific hotplug detect */ bool (*hp_detect)(struct vc4_hdmi *vc4_hdmi); + + /* HDMI-related connector callbacks and controller capabilities */ + const struct drm_connector_hdmi_funcs *hdmi_funcs; }; /* HDMI audio information */ From patchwork Fri Jul 31 16:19:52 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Ciocaltea X-Patchwork-Id: 2858 Return-Path: X-Original-To: noreply@patchwork.local Delivered-To: noreply@patchwork.local Received: from sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74]) by mxe881.netcup.net (Postfix) with ESMTPS id 9A9381C22FA for ; Fri, 31 Jul 2026 18:39:37 +0200 (CEST) Authentication-Results: mxe881; dkim=pass header.d=collabora.com; spf=pass (sender IP is 172.232.135.74) smtp.mailfrom=linux-sunxi+bounces-24840-noreply=patchwork.local@lists.linux.dev smtp.helo=sto.lore.kernel.org Received-SPF: pass (mxe881: domain of lists.linux.dev designates 172.232.135.74 as permitted sender) client-ip=172.232.135.74; envelope-from=linux-sunxi+bounces-24840-noreply=patchwork.local@lists.linux.dev; helo=sto.lore.kernel.org; Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by sto.lore.kernel.org (Postfix) with ESMTP id C9C0A30D2335 for ; Fri, 31 Jul 2026 16:24:29 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5282846A5EB; Fri, 31 Jul 2026 16:20:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="hvzWtqOS" X-Original-To: linux-sunxi@lists.linux.dev Received: from bali.collaboradmins.com (bali.collaboradmins.com [148.251.105.195]) (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 508534582E3 for ; Fri, 31 Jul 2026 16:19:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.251.105.195 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785514796; cv=none; b=Jlp4EtSoaZHwIXBh/zxGZQFspaesdtDA3N7L9mFXGkT5NM+liLJX0LAfQOcgZVnP1F+dtcKum+56KOgJKYpZhZ5C21PCDYZvl34+u4E/up+EQVZyLGequsTRWqqQ67ZkLyoujFUpgk4KrRYhoWPij/5nAryUQzzRtPj6fJgIxEE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785514796; c=relaxed/simple; bh=HLqZQKV5JFNObYB5noaYf2bUTn1vvtuCTd3ferhs8B8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=awc7Ms3IYpkMT53x4xZnBrMvcEhH7yg/Q/X/aTWDQ2OHePL0sfrXzrckn5G++pwzhs2A0Ws8goSh/MSqrb8lMRqsHp1/23PmhZ1yNFO4bevq2fF8jFcFMKs42/wDDdxXbW78+fI1LRzIlvvj054cw9QwYQWn0ePZkldGjHkKm2Y= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=hvzWtqOS; arc=none smtp.client-ip=148.251.105.195 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1785514787; bh=HLqZQKV5JFNObYB5noaYf2bUTn1vvtuCTd3ferhs8B8=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=hvzWtqOSUFMROagsImQZW2ttdWqJuTlsdsG6dOOo//Q8r1Inh9ThmMn4AHyJzQWb7 eUpJ2vF+emDjb83pb0OMtZnznLHoYJ2f6Dp0PYfUM8Bz9LmsFhbDhcBR1KxGX8NMv2 WND0kxxYi8DDyyhCErS2Dx55BIYjpfJrQQ5exule6HOKNDwVPfJEl+qBXLjL/gHKRo EWdwjt01ZZt1u742bJH7prEHNMMBMmvpC5X055uzEAPGr7x90N+DffmkkrFBHIzBh8 kje/DYSA148rQNDMcySvqojCN1ovpvlAbd41lKTV/R8USXh46lTioFyHuqiYo3uJlV +q2evZqpqlpxQ== Received: from localhost (unknown [100.64.0.241]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange secp256r1 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: cristicc) by bali.collaboradmins.com (Postfix) with ESMTPSA id DBAFA17E0990; Fri, 31 Jul 2026 18:19:46 +0200 (CEST) From: Cristian Ciocaltea Date: Fri, 31 Jul 2026 19:19:52 +0300 Subject: [PATCH v10 45/69] drm/vc4: hdmi: Convert to common HDMI 2.0 scrambling infrastructure Precedence: bulk X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20260731-dw-hdmi-qp-scramb-v10-45-294364b2cf15@collabora.com> References: <20260731-dw-hdmi-qp-scramb-v10-0-294364b2cf15@collabora.com> In-Reply-To: <20260731-dw-hdmi-qp-scramb-v10-0-294364b2cf15@collabora.com> To: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Luca Ceresoli , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Chen-Yu Tsai , Samuel Holland , Dave Stevenson , =?utf-8?q?Ma=C3=ADra_Canal?= , Raspberry Pi Kernel Maintenance , Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Andy Yan , Algea Cao , Daniel Stone , Liu Ying , Phong LE Cc: kernel@collabora.com, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-rockchip@lists.infradead.org X-Mailer: b4 0.15.2 X-MORS-Enabled: yes X-MORS-DOMAIN: lists.linux.dev X-MORS-HOSTING: hosting172546 X-MORS-USER: hosting172546 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= Replace driver local scrambling logic with the newly introduced common HDMI 2.0 scrambling support: - Advertise source-side scrambling capability by setting supported HDMI version based on the variant's max_pixel_clock. - Provide minimal .scrambler_{enable,disable} connector callbacks that only toggle the VC5 HDMI_SCRAMBLER_CTL register, while delegating sink-side SCDC programming and periodic status monitoring to drm_connector_hdmi_{enable,disable}_scrambling(). - Drop vc4_hdmi_reset_link() and vc4_hdmi_handle_hotplug(), switching the .detect_ctx() path to drm_atomic_helper_connector_hdmi_hotplug() which internally calls drm_connector_hdmi_sync_scdc() to trigger a CRTC reset on reconnection. - Drop the local scrambling_work delayed workqueue and scdc_enabled flag, now tracked by the common drm_connector_hdmi layer, as well as the now unused output_{bpc,color_format} driver data members. No functional change intended. Signed-off-by: Cristian Ciocaltea --- drivers/gpu/drm/vc4/vc4_hdmi.c | 230 +++++------------------------------------ drivers/gpu/drm/vc4/vc4_hdmi.h | 21 ---- 2 files changed, 28 insertions(+), 223 deletions(-) diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c index d599957fee3a..ec0c1f4224d7 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c @@ -35,7 +35,6 @@ #include #include #include -#include #include #include #include @@ -114,22 +113,6 @@ #define HSM_MIN_CLOCK_FREQ 120000000 #define CEC_CLOCK_FREQ 40000 -static bool vc4_hdmi_supports_scrambling(struct vc4_hdmi *vc4_hdmi) -{ - struct drm_display_info *display = &vc4_hdmi->connector.display_info; - - lockdep_assert_held(&vc4_hdmi->mutex); - - if (!display->is_hdmi) - return false; - - if (!display->hdmi.scdc.supported || - !display->hdmi.scdc.scrambling.supported) - return false; - - return true; -} - static int vc4_hdmi_debugfs_regs(struct seq_file *m, void *unused) { struct drm_debugfs_entry *entry = m->private; @@ -263,115 +246,6 @@ static void vc4_hdmi_cec_update_clk_div(struct vc4_hdmi *vc4_hdmi) static void vc4_hdmi_cec_update_clk_div(struct vc4_hdmi *vc4_hdmi) {} #endif -static int vc4_hdmi_reset_link(struct drm_connector *connector, - struct drm_modeset_acquire_ctx *ctx) -{ - struct drm_device *drm; - struct vc4_hdmi *vc4_hdmi; - struct drm_connector_state *conn_state; - struct drm_crtc_state *crtc_state; - struct drm_crtc *crtc; - bool scrambling_needed; - u8 config; - int ret; - - if (!connector) - return 0; - - drm = connector->dev; - ret = drm_modeset_lock(&drm->mode_config.connection_mutex, ctx); - if (ret) - return ret; - - conn_state = connector->state; - crtc = conn_state->crtc; - if (!crtc) - return 0; - - ret = drm_modeset_lock(&crtc->mutex, ctx); - if (ret) - return ret; - - crtc_state = crtc->state; - if (!crtc_state->active) - return 0; - - vc4_hdmi = connector_to_vc4_hdmi(connector); - mutex_lock(&vc4_hdmi->mutex); - - if (!vc4_hdmi_supports_scrambling(vc4_hdmi)) { - mutex_unlock(&vc4_hdmi->mutex); - return 0; - } - - scrambling_needed = drm_hdmi_mode_needs_scrambling(&vc4_hdmi->saved_adjusted_mode, - vc4_hdmi->output_bpc, - vc4_hdmi->output_format); - if (!scrambling_needed) { - mutex_unlock(&vc4_hdmi->mutex); - return 0; - } - - if (conn_state->commit && - !try_wait_for_completion(&conn_state->commit->hw_done)) { - mutex_unlock(&vc4_hdmi->mutex); - return 0; - } - - ret = drm_scdc_readb(connector->ddc, SCDC_TMDS_CONFIG, &config); - if (ret < 0) { - drm_err(drm, "Failed to read TMDS config: %d\n", ret); - mutex_unlock(&vc4_hdmi->mutex); - return 0; - } - - if (!!(config & SCDC_SCRAMBLING_ENABLE) == scrambling_needed) { - mutex_unlock(&vc4_hdmi->mutex); - return 0; - } - - mutex_unlock(&vc4_hdmi->mutex); - - /* - * HDMI 2.0 says that one should not send scrambled data - * prior to configuring the sink scrambling, and that - * TMDS clock/data transmission should be suspended when - * changing the TMDS clock rate in the sink. So let's - * just do a full modeset here, even though some sinks - * would be perfectly happy if were to just reconfigure - * the SCDC settings on the fly. - */ - return drm_atomic_helper_reset_crtc(crtc, ctx); -} - -static int vc4_hdmi_handle_hotplug(struct vc4_hdmi *vc4_hdmi, - struct drm_modeset_acquire_ctx *ctx, - enum drm_connector_status status) -{ - struct drm_connector *connector = &vc4_hdmi->connector; - - /* - * NOTE: This function should really be called with vc4_hdmi->mutex - * held, but doing so results in reentrancy issues since - * cec_s_phys_addr() might call .adap_enable, which leads to that - * funtion being called with our mutex held. - * - * A similar situation occurs with vc4_hdmi_reset_link() that - * will call into our KMS hooks if the scrambling was enabled. - * - * Concurrency isn't an issue at the moment since we don't share - * any state with any of the other frameworks so we can ignore - * the lock for now. - */ - - drm_atomic_helper_connector_hdmi_hotplug(connector, ctx, status); - - if (status != connector_status_connected) - return 0; - - return vc4_hdmi_reset_link(connector, ctx); -} - static int vc4_hdmi_connector_detect_ctx(struct drm_connector *connector, struct drm_modeset_acquire_ctx *ctx, bool force) @@ -383,8 +257,8 @@ static int vc4_hdmi_connector_detect_ctx(struct drm_connector *connector, /* * NOTE: This function should really take vc4_hdmi->mutex, but * doing so results in reentrancy issues since - * vc4_hdmi_handle_hotplug() can call into other functions that - * would take the mutex while it's held here. + * drm_atomic_helper_connector_hdmi_hotplug() can call into other + * functions that would take the mutex while it's held here. * * Concurrency isn't an issue at the moment since we don't share * any state with any of the other frameworks so we can ignore @@ -407,7 +281,8 @@ static int vc4_hdmi_connector_detect_ctx(struct drm_connector *connector, status = connector_status_connected; } - ret = vc4_hdmi_handle_hotplug(vc4_hdmi, ctx, status); + ret = drm_atomic_helper_connector_hdmi_hotplug(connector, ctx, status); + pm_runtime_put(&vc4_hdmi->pdev->dev); return ret == -EDEADLK ? ret : status; @@ -534,6 +409,14 @@ static int vc4_hdmi_connector_init(struct drm_device *dev, drm_connector_helper_add(connector, &vc4_hdmi_connector_helper_funcs); + /* + * Since we don't know the state of the controller and its + * display (if any), let's assume it's always enabled. + * drm_connector_hdmi_disable_scrambling() will thus run at boot, + * make sure it's disabled, and avoid any inconsistency. + */ + connector->hdmi.scrambler_enabled = drm_connector_hdmi_scrambler_supported(connector); + /* * Some of the properties below require access to state, like bpc. * Allocate some default initial connector state with our reset helper. @@ -759,32 +642,15 @@ static int vc4_hdmi_write_spd_infoframe(struct drm_connector *connector, buffer, len); } -#define SCRAMBLING_POLLING_DELAY_MS 1000 - -static void vc4_hdmi_enable_scrambling(struct drm_encoder *encoder) +static int vc4_hdmi_scrambler_enable(struct drm_connector *connector) { - struct vc4_hdmi *vc4_hdmi = encoder_to_vc4_hdmi(encoder); - struct drm_connector *connector = &vc4_hdmi->connector; + struct vc4_hdmi *vc4_hdmi = connector_to_vc4_hdmi(connector); struct drm_device *drm = connector->dev; - const struct drm_display_mode *mode = &vc4_hdmi->saved_adjusted_mode; unsigned long flags; int idx; - lockdep_assert_held(&vc4_hdmi->mutex); - - if (!vc4_hdmi_supports_scrambling(vc4_hdmi)) - return; - - if (!drm_hdmi_mode_needs_scrambling(mode, - vc4_hdmi->output_bpc, - vc4_hdmi->output_format)) - return; - if (!drm_dev_enter(drm, &idx)) - return; - - drm_scdc_set_high_tmds_clock_ratio(connector, true); - drm_scdc_set_scrambling(connector, true); + return -ENODEV; spin_lock_irqsave(&vc4_hdmi->hw_lock, flags); HDMI_WRITE(HDMI_SCRAMBLER_CTL, HDMI_READ(HDMI_SCRAMBLER_CTL) | @@ -793,59 +659,27 @@ static void vc4_hdmi_enable_scrambling(struct drm_encoder *encoder) drm_dev_exit(idx); - vc4_hdmi->scdc_enabled = true; - - queue_delayed_work(system_percpu_wq, &vc4_hdmi->scrambling_work, - msecs_to_jiffies(SCRAMBLING_POLLING_DELAY_MS)); + return 0; } -static void vc4_hdmi_disable_scrambling(struct drm_encoder *encoder) +static int vc4_hdmi_scrambler_disable(struct drm_connector *connector) { - struct vc4_hdmi *vc4_hdmi = encoder_to_vc4_hdmi(encoder); - struct drm_connector *connector = &vc4_hdmi->connector; + struct vc4_hdmi *vc4_hdmi = connector_to_vc4_hdmi(connector); struct drm_device *drm = connector->dev; unsigned long flags; int idx; - lockdep_assert_held(&vc4_hdmi->mutex); - - if (!vc4_hdmi->scdc_enabled) - return; - - vc4_hdmi->scdc_enabled = false; - - if (delayed_work_pending(&vc4_hdmi->scrambling_work)) - cancel_delayed_work_sync(&vc4_hdmi->scrambling_work); - if (!drm_dev_enter(drm, &idx)) - return; + return -ENODEV; spin_lock_irqsave(&vc4_hdmi->hw_lock, flags); HDMI_WRITE(HDMI_SCRAMBLER_CTL, HDMI_READ(HDMI_SCRAMBLER_CTL) & ~VC5_HDMI_SCRAMBLER_CTL_ENABLE); spin_unlock_irqrestore(&vc4_hdmi->hw_lock, flags); - drm_scdc_set_scrambling(connector, false); - drm_scdc_set_high_tmds_clock_ratio(connector, false); - drm_dev_exit(idx); -} -static void vc4_hdmi_scrambling_wq(struct work_struct *work) -{ - struct vc4_hdmi *vc4_hdmi = container_of(to_delayed_work(work), - struct vc4_hdmi, - scrambling_work); - struct drm_connector *connector = &vc4_hdmi->connector; - - if (drm_scdc_get_scrambling_status(connector)) - return; - - drm_scdc_set_high_tmds_clock_ratio(connector, true); - drm_scdc_set_scrambling(connector, true); - - queue_delayed_work(system_percpu_wq, &vc4_hdmi->scrambling_work, - msecs_to_jiffies(SCRAMBLING_POLLING_DELAY_MS)); + return 0; } static void vc4_hdmi_encoder_post_crtc_disable(struct drm_encoder *encoder, @@ -890,7 +724,7 @@ static void vc4_hdmi_encoder_post_crtc_disable(struct drm_encoder *encoder, spin_unlock_irqrestore(&vc4_hdmi->hw_lock, flags); } - vc4_hdmi_disable_scrambling(encoder); + drm_connector_hdmi_disable_scrambling(&vc4_hdmi->connector); drm_dev_exit(idx); @@ -1598,6 +1432,7 @@ static void vc4_hdmi_encoder_post_crtc_enable(struct drm_encoder *encoder, struct drm_display_info *display = &vc4_hdmi->connector.display_info; bool hsync_pos = mode->flags & DRM_MODE_FLAG_PHSYNC; bool vsync_pos = mode->flags & DRM_MODE_FLAG_PVSYNC; + struct drm_connector_state *conn_state; unsigned long flags; int ret; int idx; @@ -1666,7 +1501,9 @@ static void vc4_hdmi_encoder_post_crtc_enable(struct drm_encoder *encoder, } vc4_hdmi_recenter_fifo(vc4_hdmi); - vc4_hdmi_enable_scrambling(encoder); + + conn_state = drm_atomic_get_new_connector_state(state, connector); + drm_connector_hdmi_enable_scrambling(connector, conn_state); drm_dev_exit(idx); @@ -1683,8 +1520,6 @@ static void vc4_hdmi_encoder_atomic_mode_set(struct drm_encoder *encoder, mutex_lock(&vc4_hdmi->mutex); drm_mode_copy(&vc4_hdmi->saved_adjusted_mode, &crtc_state->adjusted_mode); - vc4_hdmi->output_bpc = conn_state->hdmi.output_bpc; - vc4_hdmi->output_format = conn_state->hdmi.output_format; mutex_unlock(&vc4_hdmi->mutex); } @@ -1754,8 +1589,9 @@ static const struct drm_connector_hdmi_funcs vc4_hdmi_connector_funcs_hdmi14 = { static const struct drm_connector_hdmi_funcs vc4_hdmi_connector_funcs_hdmi20 = { VC4_HDMI_CONNECTOR_FUNCS_COMMON, .max_bpc = 12, - /* TODO: set HDMI_VERSION_2_0 and convert to common scrambler infra */ - .supported_hdmi_ver = HDMI_VERSION_UNKNOWN, + .supported_hdmi_ver = HDMI_VERSION_2_0, + .scrambler_enable = vc4_hdmi_scrambler_enable, + .scrambler_disable = vc4_hdmi_scrambler_disable, }; #define WIFI_2_4GHz_CH1_MIN_FREQ 2400000000ULL @@ -3229,7 +3065,6 @@ static int vc4_hdmi_bind(struct device *dev, struct device *master, void *data) return ret; spin_lock_init(&vc4_hdmi->hw_lock); - INIT_DELAYED_WORK(&vc4_hdmi->scrambling_work, vc4_hdmi_scrambling_wq); dev_set_drvdata(dev, vc4_hdmi); encoder = &vc4_hdmi->encoder.base; @@ -3242,15 +3077,6 @@ static int vc4_hdmi_bind(struct device *dev, struct device *master, void *data) vc4_hdmi->pdev = pdev; vc4_hdmi->variant = variant; - /* - * Since we don't know the state of the controller and its - * display (if any), let's assume it's always enabled. - * vc4_hdmi_disable_scrambling() will thus run at boot, make - * sure it's disabled, and avoid any inconsistency. - */ - if (variant->max_pixel_clock > HDMI_1_3_TMDS_CHAR_RATE_MAX_HZ) - vc4_hdmi->scdc_enabled = true; - ret = variant->init_resources(drm, vc4_hdmi); if (ret) return ret; diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.h b/drivers/gpu/drm/vc4/vc4_hdmi.h index d5ffcc17de32..f6159c9e6144 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.h +++ b/drivers/gpu/drm/vc4/vc4_hdmi.h @@ -118,8 +118,6 @@ struct vc4_hdmi { struct vc4_encoder encoder; struct drm_connector connector; - struct delayed_work scrambling_work; - struct i2c_adapter *ddc; void __iomem *hdmicore_regs; void __iomem *hd_regs; @@ -193,25 +191,6 @@ struct vc4_hdmi { */ bool packet_ram_enabled; - /** - * @scdc_enabled: Is the HDMI controller currently running with - * the scrambler on? Protected by @mutex. - */ - bool scdc_enabled; - - /** - * @output_bpc: Copy of @drm_connector_state.hdmi.output_bpc for - * use outside of KMS hooks. Protected by @mutex. - */ - unsigned int output_bpc; - - /** - * @output_format: Copy of - * @drm_connector_state.hdmi.output_format for use outside of - * KMS hooks. Protected by @mutex. - */ - enum drm_output_color_format output_format; - /** * @hdmi_jack: Represents the connection state of the HDMI plug, for * ALSA jack detection. From patchwork Fri Jul 31 16:19:53 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Ciocaltea X-Patchwork-Id: 2870 Return-Path: X-Original-To: noreply@patchwork.local Delivered-To: noreply@patchwork.local Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114]) by mxe881.netcup.net (Postfix) with ESMTPS id 6C2FA1C2304 for ; Fri, 31 Jul 2026 18:42:56 +0200 (CEST) Authentication-Results: mxe881; dkim=pass header.d=collabora.com; spf=pass (sender IP is 172.105.105.114) smtp.mailfrom=linux-sunxi+bounces-24852-noreply=patchwork.local@lists.linux.dev smtp.helo=tor.lore.kernel.org Received-SPF: pass (mxe881: domain of lists.linux.dev designates 172.105.105.114 as permitted sender) client-ip=172.105.105.114; envelope-from=linux-sunxi+bounces-24852-noreply=patchwork.local@lists.linux.dev; helo=tor.lore.kernel.org; Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by tor.lore.kernel.org (Postfix) with ESMTP id CC54D317FD52 for ; Fri, 31 Jul 2026 16:24:52 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EACAF46AA90; Fri, 31 Jul 2026 16:20:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="JhKXXhqQ" X-Original-To: linux-sunxi@lists.linux.dev Received: from bali.collaboradmins.com (bali.collaboradmins.com [148.251.105.195]) (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 1EDFB466B02 for ; Fri, 31 Jul 2026 16:19:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.251.105.195 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785514802; cv=none; b=nwwkLkSbfewdxm3Fn4YdeNomJOJoi1zyVz57qQOIuaSczzkKlpc5ggkbBtYBhyLkvEL1JO52ee1L76jN9BHU2OVdQbgEpo+vJV24onX8TyPa5XS7X9tNc3ktpXOqj+ah1PEY35G6T0x3m2YRR6Dxiv16E//7DyspRXL3Wow1gm8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785514802; c=relaxed/simple; bh=SInzfAoNKwOGfiPcNGWTLjbBIPQWpxV2s3PHDL7O56s=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=itZS4Cm5l/ZzxlU3v2lb3/78Onruge/JZ8NTt8sNszqX081IujFEwa+ajfd1uuiwCLph19Z23SXlpB/MJGw/U7pdg1DC7/ySNCclGsL/g9gFodujdJFfUkjsUojNrKEZVrKrUgPwMa18hifTUe4J1aMQ3UIYutDCMMCGeDP/7UE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=JhKXXhqQ; arc=none smtp.client-ip=148.251.105.195 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1785514787; bh=SInzfAoNKwOGfiPcNGWTLjbBIPQWpxV2s3PHDL7O56s=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=JhKXXhqQjsFmHphEOmYM+UICGiZ3r8r3yU8Z1F1XG/UBLJk8L5Ku8gkUYvweQ3scp zVH8Kd4CDBKRPj/uox68U9+2XRwV7lChdbgTQMTosTHGv6XqrSZ9aX13dQddpSiNS0 d2kj9Yv+TrX5Z3lUwfZKkfavzbR/prPmV0e7E9Jfr0ekGH8J6qPZMvL5p4zncwckZZ xytULWN4Z9mRAwuR03C2CwJIYv8ze0sp7UH7KaALlGVD8USVkk98VPmdyo+dUFo4ao UrLW9YW/CUCduYJtbD09eFDSgSER8bPV8IGUq7ZJLWju6Ij053HbK+U1oaTAxXF091 uU8WrQHyn+jrw== Received: from localhost (unknown [100.64.0.241]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange secp256r1 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: cristicc) by bali.collaboradmins.com (Postfix) with ESMTPSA id 8B6E717E0991; Fri, 31 Jul 2026 18:19:47 +0200 (CEST) From: Cristian Ciocaltea Date: Fri, 31 Jul 2026 19:19:53 +0300 Subject: [PATCH v10 46/69] drm/vc4: hdmi: Defer pixel clock validation to HDMI helpers Precedence: bulk X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20260731-dw-hdmi-qp-scramb-v10-46-294364b2cf15@collabora.com> References: <20260731-dw-hdmi-qp-scramb-v10-0-294364b2cf15@collabora.com> In-Reply-To: <20260731-dw-hdmi-qp-scramb-v10-0-294364b2cf15@collabora.com> To: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Luca Ceresoli , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Chen-Yu Tsai , Samuel Holland , Dave Stevenson , =?utf-8?q?Ma=C3=ADra_Canal?= , Raspberry Pi Kernel Maintenance , Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Andy Yan , Algea Cao , Daniel Stone , Liu Ying , Phong LE Cc: kernel@collabora.com, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-rockchip@lists.infradead.org X-Mailer: b4 0.15.2 X-Rspamd-Server: rspamd-worker-8404 X-Spamd-Result: default: False [-2.16 / 15.00]; BAYES_HAM(-5.50)[100.00%]; RBL_SENDERSCORE(2.00)[172.105.105.114:from]; SUSPICIOUS_RECIPS(1.50)[]; MAILLIST(-0.15)[generic]; BAD_REP_POLICIES(0.10)[]; MIME_GOOD(-0.10)[text/plain]; HAS_LIST_UNSUB(-0.01)[]; RCVD_COUNT_FIVE(0.00)[5]; ARC_ALLOW(0.00)[subspace.kernel.org:s=arc-20240116:i=1]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_TWELVE(0.00)[30]; PRECEDENCE_BULK(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[collabora.com:email,collabora.com:dkim,tor.lore.kernel.org:rdns,tor.lore.kernel.org:helo]; TAGGED_RCPT(0.00)[]; FORGED_SENDER_MAILLIST(0.00)[]; R_DKIM_ALLOW(0.00)[collabora.com:s=mail]; ASN(0.00)[asn:63949, ipnet:172.105.96.0/20, country:SG]; DKIM_TRACE(0.00)[collabora.com:+]; DMARC_POLICY_ALLOW(0.00)[collabora.com,none]; R_SPF_ALLOW(0.00)[+ip4:172.105.105.114:c]; TO_DN_SOME(0.00)[]; FROM_NEQ_ENVFROM(0.00)[cristian.ciocaltea@collabora.com,linux-sunxi@lists.linux.dev]; FREEMAIL_TO(0.00)[intel.com,linaro.org,kernel.org,ideasonboard.com,kwiboo.se,gmail.com,bootlin.com,linux.intel.com,suse.de,ffwll.ch,sholland.org,raspberrypi.com,igalia.com,rock-chips.com,sntech.de,collabora.com,nxp.com,baylibre.com]; MIME_TRACE(0.00)[0:+]; TAGGED_FROM(0.00)[bounces-24852-noreply=patchwork.local]; FORGED_RECIPIENTS_MAILLIST(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[] X-Rspamd-Queue-Id: 6C2FA1C2304 X-MORS-Enabled: yes X-MORS-DOMAIN: patchwork.local X-MORS-HOSTING: hosting172546 X-MORS-USER: hosting172546 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= drm_atomic_helper_connector_hdmi_check() rejects modes whose computed TMDS character rate exceeds the connector limit before invoking the driver's .tmds_char_rate_valid() hook. BCM2835 is capped at 162 MHz, slightly below the 165 MHz limit of HDMI 1.2. Set supported_tmds_char_rate in vc4_hdmi_connector_funcs_hdmi10 so that the limit inferred from supported_hdmi_ver is overridden by the lower hardware constraint. All other chip variants rely on the standard HDMI 1.4/2.0 limits, so the default validation suffices. This allows vc4_hdmi_connector_clock_valid() to be simplified by dropping the now-redundant max_pixel_clock field from struct vc4_hdmi_variant. Signed-off-by: Cristian Ciocaltea Reviewed-by: Maxime Ripard --- drivers/gpu/drm/vc4/vc4_hdmi.c | 10 +--------- drivers/gpu/drm/vc4/vc4_hdmi.h | 3 --- 2 files changed, 1 insertion(+), 12 deletions(-) diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c index ec0c1f4224d7..12d0adc3cb1f 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c @@ -1528,12 +1528,8 @@ vc4_hdmi_connector_clock_valid(const struct drm_connector *connector, const struct drm_display_mode *mode, unsigned long long clock) { - const struct vc4_hdmi *vc4_hdmi = connector_to_vc4_hdmi(connector); struct vc4_dev *vc4 = to_vc4_dev(connector->dev); - if (clock > vc4_hdmi->variant->max_pixel_clock) - return MODE_CLOCK_HIGH; - if (!vc4->hvs->vc5_hdmi_enable_hdmi_20 && clock > HDMI_1_3_TMDS_CHAR_RATE_MAX_HZ) return MODE_CLOCK_HIGH; @@ -1578,6 +1574,7 @@ static const struct drm_connector_hdmi_funcs vc4_hdmi_connector_funcs_hdmi12 = { VC4_HDMI_CONNECTOR_FUNCS_COMMON, .max_bpc = 8, .supported_hdmi_ver = HDMI_VERSION_1_2, + .supported_tmds_char_rate = 162000000, }; static const struct drm_connector_hdmi_funcs vc4_hdmi_connector_funcs_hdmi14 = { @@ -3184,7 +3181,6 @@ static const struct vc4_hdmi_variant bcm2835_variant = { .encoder_type = VC4_ENCODER_TYPE_HDMI0, .debugfs_name = "hdmi_regs", .card_name = "vc4-hdmi", - .max_pixel_clock = 162000000, .registers = vc4_hdmi_fields, .num_registers = ARRAY_SIZE(vc4_hdmi_fields), @@ -3204,7 +3200,6 @@ static const struct vc4_hdmi_variant bcm2711_hdmi0_variant = { .encoder_type = VC4_ENCODER_TYPE_HDMI0, .debugfs_name = "hdmi0_regs", .card_name = "vc4-hdmi-0", - .max_pixel_clock = HDMI_2_0_TMDS_CHAR_RATE_MAX_HZ, .registers = vc5_hdmi_hdmi0_fields, .num_registers = ARRAY_SIZE(vc5_hdmi_hdmi0_fields), .phy_lane_mapping = { @@ -3233,7 +3228,6 @@ static const struct vc4_hdmi_variant bcm2711_hdmi1_variant = { .encoder_type = VC4_ENCODER_TYPE_HDMI1, .debugfs_name = "hdmi1_regs", .card_name = "vc4-hdmi-1", - .max_pixel_clock = HDMI_1_3_TMDS_CHAR_RATE_MAX_HZ, .registers = vc5_hdmi_hdmi1_fields, .num_registers = ARRAY_SIZE(vc5_hdmi_hdmi1_fields), .phy_lane_mapping = { @@ -3262,7 +3256,6 @@ static const struct vc4_hdmi_variant bcm2712_hdmi0_variant = { .encoder_type = VC4_ENCODER_TYPE_HDMI0, .debugfs_name = "hdmi0_regs", .card_name = "vc4-hdmi-0", - .max_pixel_clock = HDMI_2_0_TMDS_CHAR_RATE_MAX_HZ, .registers = vc6_hdmi_hdmi0_fields, .num_registers = ARRAY_SIZE(vc6_hdmi_hdmi0_fields), .phy_lane_mapping = { @@ -3289,7 +3282,6 @@ static const struct vc4_hdmi_variant bcm2712_hdmi1_variant = { .encoder_type = VC4_ENCODER_TYPE_HDMI1, .debugfs_name = "hdmi1_regs", .card_name = "vc4-hdmi-1", - .max_pixel_clock = HDMI_2_0_TMDS_CHAR_RATE_MAX_HZ, .registers = vc6_hdmi_hdmi1_fields, .num_registers = ARRAY_SIZE(vc6_hdmi_hdmi1_fields), .phy_lane_mapping = { diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.h b/drivers/gpu/drm/vc4/vc4_hdmi.h index f6159c9e6144..61486e7b4ba2 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.h +++ b/drivers/gpu/drm/vc4/vc4_hdmi.h @@ -29,9 +29,6 @@ struct vc4_hdmi_variant { /* Filename to expose the registers in debugfs */ const char *debugfs_name; - /* Maximum pixel clock supported by the controller (in Hz) */ - unsigned long long max_pixel_clock; - /* List of the registers available on that variant */ const struct vc4_hdmi_register *registers; From patchwork Fri Jul 31 16:19:54 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Ciocaltea X-Patchwork-Id: 2880 Return-Path: X-Original-To: noreply@patchwork.local Delivered-To: noreply@patchwork.local Received: from sin.lore.kernel.org (sin.lore.kernel.org [104.64.211.4]) by mxe881.netcup.net (Postfix) with ESMTPS id 90C3A1C093B for ; Fri, 31 Jul 2026 19:05:36 +0200 (CEST) Authentication-Results: mxe881; dkim=pass header.d=collabora.com; spf=pass (sender IP is 104.64.211.4) smtp.mailfrom=linux-sunxi+bounces-24855-noreply=patchwork.local@lists.linux.dev smtp.helo=sin.lore.kernel.org Received-SPF: pass (mxe881: domain of lists.linux.dev designates 104.64.211.4 as permitted sender) client-ip=104.64.211.4; envelope-from=linux-sunxi+bounces-24855-noreply=patchwork.local@lists.linux.dev; helo=sin.lore.kernel.org; Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by sin.lore.kernel.org (Postfix) with ESMTP id 66EE63035F87 for ; Fri, 31 Jul 2026 16:25:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B8A5244E66F; Fri, 31 Jul 2026 16:20:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="dVnch+0k" X-Original-To: linux-sunxi@lists.linux.dev Received: from bali.collaboradmins.com (bali.collaboradmins.com [148.251.105.195]) (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 E115D466B75 for ; Fri, 31 Jul 2026 16:19:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.251.105.195 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785514803; cv=none; b=ZtidfrjADtOSILtFwQ7quSvdBQ3Rm8ZHUVwAw+VRRAnekOZzOzKEdh+URpvWHdxu4cim8gPaQkeBPG/kg2xR1PVjx/zi0XBrgXbFKaW9fpigS6l9cdCqt95L29B+xRXuYhvB5cPdzgrycGHdDdWdWgUyZdFBJJlfDsYwy6mPtFs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785514803; c=relaxed/simple; bh=AJ/omjN/lK86toWZGrUtZiZmvSWbYljt1UsCr8wPgmY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Xx1tvNtlDMiiWNwisYtgEPeriTucZtIpkuu/KAgb6DBKsrDL08rYNgJ4mWjoJv/AuAJpvWulP/NB8JIrm3wF78xEhXljyxlVes/RCWMUAboJkUojJNSBTxYJMNnLb4B6Ko9wDyWnY8k9R4BVrwhlxIIUmkktFTtS2YdVLqXbMX8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=dVnch+0k; arc=none smtp.client-ip=148.251.105.195 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1785514788; bh=AJ/omjN/lK86toWZGrUtZiZmvSWbYljt1UsCr8wPgmY=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=dVnch+0kNLmLhfj41SPiKFwqYpfM0HL/9gmQ8VhVgah7IsW8juZUXcdYRLva1LXuF rGeizyZs4dqtJyweYyYRLtpyAZEF5hII0tfaDn+l6wvaqZMkW6RPfCk1rsXrwXg5z9 BHI0BE6+KUZIIUICEFa6q7UjezPL4PE7qBfkInxKWDOIFRANBX4z/852NSMgasMcDB Bt0Ibsa7ESFWkDrDrSSHxRxT4qdlte9swm7kdVDrpk/lTa50ASYk0jmAOkIXxlDl0w jQOYXzoBj6mssyyNQRpSMFjx01iE8ljm1YOc9jUivTkJ3C3IjqddFhw2jopUD1nqcG KWtmIBJ3EIzQg== Received: from localhost (unknown [100.64.0.241]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange secp256r1 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: cristicc) by bali.collaboradmins.com (Postfix) with ESMTPSA id 444E017E091F; Fri, 31 Jul 2026 18:19:48 +0200 (CEST) From: Cristian Ciocaltea Date: Fri, 31 Jul 2026 19:19:54 +0300 Subject: [PATCH v10 47/69] drm/display: hdmi-state-helper: Drop drm_atomic_helper_connector_hdmi_force() Precedence: bulk X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20260731-dw-hdmi-qp-scramb-v10-47-294364b2cf15@collabora.com> References: <20260731-dw-hdmi-qp-scramb-v10-0-294364b2cf15@collabora.com> In-Reply-To: <20260731-dw-hdmi-qp-scramb-v10-0-294364b2cf15@collabora.com> To: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Luca Ceresoli , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Chen-Yu Tsai , Samuel Holland , Dave Stevenson , =?utf-8?q?Ma=C3=ADra_Canal?= , Raspberry Pi Kernel Maintenance , Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Andy Yan , Algea Cao , Daniel Stone , Liu Ying , Phong LE Cc: kernel@collabora.com, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-rockchip@lists.infradead.org X-Mailer: b4 0.15.2 X-Rspamd-Server: rspamd-worker-8404 X-Spamd-Result: default: False [-2.16 / 15.00]; BAYES_HAM(-5.50)[100.00%]; RBL_SENDERSCORE(2.00)[104.64.211.4:from]; SUSPICIOUS_RECIPS(1.50)[]; MAILLIST(-0.15)[generic]; MIME_GOOD(-0.10)[text/plain]; BAD_REP_POLICIES(0.10)[]; HAS_LIST_UNSUB(-0.01)[]; FROM_HAS_DN(0.00)[]; TAGGED_RCPT(0.00)[]; PRECEDENCE_BULK(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; RCPT_COUNT_TWELVE(0.00)[30]; RCVD_COUNT_FIVE(0.00)[5]; DBL_BLOCKED_OPENRESOLVER(0.00)[collabora.com:email,collabora.com:dkim,sin.lore.kernel.org:rdns,sin.lore.kernel.org:helo]; FORGED_SENDER_MAILLIST(0.00)[]; R_DKIM_ALLOW(0.00)[collabora.com:s=mail]; ARC_ALLOW(0.00)[subspace.kernel.org:s=arc-20240116:i=1]; DKIM_TRACE(0.00)[collabora.com:+]; DMARC_POLICY_ALLOW(0.00)[collabora.com,none]; R_SPF_ALLOW(0.00)[+ip4:104.64.211.4]; TO_DN_SOME(0.00)[]; FROM_NEQ_ENVFROM(0.00)[cristian.ciocaltea@collabora.com,linux-sunxi@lists.linux.dev]; FREEMAIL_TO(0.00)[intel.com,linaro.org,kernel.org,ideasonboard.com,kwiboo.se,gmail.com,bootlin.com,linux.intel.com,suse.de,ffwll.ch,sholland.org,raspberrypi.com,igalia.com,rock-chips.com,sntech.de,collabora.com,nxp.com,baylibre.com]; MIME_TRACE(0.00)[0:+]; TAGGED_FROM(0.00)[bounces-24855-noreply=patchwork.local]; FORGED_RECIPIENTS_MAILLIST(0.00)[]; ASN(0.00)[asn:63949, ipnet:104.64.192.0/19, country:SG]; RCVD_TLS_LAST(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[] X-Rspamd-Queue-Id: 90C3A1C093B X-MORS-Enabled: yes X-MORS-DOMAIN: patchwork.local X-MORS-HOSTING: hosting172546 X-MORS-USER: hosting172546 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= With all callers converted to the .force_ctx() connector helper, this function has no users left. Remove it. Signed-off-by: Cristian Ciocaltea Reviewed-by: Maxime Ripard --- drivers/gpu/drm/display/drm_hdmi_state_helper.c | 15 --------------- include/drm/display/drm_hdmi_state_helper.h | 1 - 2 files changed, 16 deletions(-) diff --git a/drivers/gpu/drm/display/drm_hdmi_state_helper.c b/drivers/gpu/drm/display/drm_hdmi_state_helper.c index 9544eb8659aa..04c9e06b9dc1 100644 --- a/drivers/gpu/drm/display/drm_hdmi_state_helper.c +++ b/drivers/gpu/drm/display/drm_hdmi_state_helper.c @@ -1261,21 +1261,6 @@ int drm_atomic_helper_connector_hdmi_hotplug(struct drm_connector *connector, } EXPORT_SYMBOL(drm_atomic_helper_connector_hdmi_hotplug); -/** - * drm_atomic_helper_connector_hdmi_force - HDMI Connector implementation of the force callback - * @connector: A pointer to the HDMI connector - * - * This function implements the .force() callback for the HDMI connectors. It - * can either be used directly as the callback or should be called from within - * the .force() callback implementation to maintain the HDMI-specific - * connector's data. - */ -void drm_atomic_helper_connector_hdmi_force(struct drm_connector *connector) -{ - drm_atomic_helper_connector_hdmi_update(connector, NULL, connector->status); -} -EXPORT_SYMBOL(drm_atomic_helper_connector_hdmi_force); - /** * drm_atomic_helper_connector_hdmi_force_ctx - HDMI Connector implementation * of the force_ctx callback diff --git a/include/drm/display/drm_hdmi_state_helper.h b/include/drm/display/drm_hdmi_state_helper.h index ae4fff82c3fb..81c85b4dce56 100644 --- a/include/drm/display/drm_hdmi_state_helper.h +++ b/include/drm/display/drm_hdmi_state_helper.h @@ -26,7 +26,6 @@ int drm_atomic_helper_connector_hdmi_update_infoframes(struct drm_connector *con int drm_atomic_helper_connector_hdmi_hotplug(struct drm_connector *connector, struct drm_modeset_acquire_ctx *ctx, enum drm_connector_status status); -void drm_atomic_helper_connector_hdmi_force(struct drm_connector *connector); int drm_atomic_helper_connector_hdmi_force_ctx(struct drm_connector *connector, struct drm_modeset_acquire_ctx *ctx); From patchwork Fri Jul 31 16:19:55 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Ciocaltea X-Patchwork-Id: 2871 Return-Path: X-Original-To: noreply@patchwork.local Delivered-To: noreply@patchwork.local Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114]) by mxe881.netcup.net (Postfix) with ESMTPS id 0B9CE1C2304 for ; Fri, 31 Jul 2026 18:43:02 +0200 (CEST) Authentication-Results: mxe881; dkim=pass header.d=collabora.com; spf=pass (sender IP is 172.105.105.114) smtp.mailfrom=linux-sunxi+bounces-24853-noreply=patchwork.local@lists.linux.dev smtp.helo=tor.lore.kernel.org Received-SPF: pass (mxe881: domain of lists.linux.dev designates 172.105.105.114 as permitted sender) client-ip=172.105.105.114; envelope-from=linux-sunxi+bounces-24853-noreply=patchwork.local@lists.linux.dev; helo=tor.lore.kernel.org; Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by tor.lore.kernel.org (Postfix) with ESMTP id 55D873181F29 for ; Fri, 31 Jul 2026 16:24:58 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5AB5246AF11; Fri, 31 Jul 2026 16:20:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="QokOt9JT" X-Original-To: linux-sunxi@lists.linux.dev Received: from bali.collaboradmins.com (bali.collaboradmins.com [148.251.105.195]) (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 7DF9E468C1B for ; Fri, 31 Jul 2026 16:19:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.251.105.195 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785514803; cv=none; b=axKDy9iZJrup3NniyOgPtjbpkgdn0XPTqXCpBcY7G5FiyWIOt9jHe7EEvIcSfxAJU+F/KujmjvYaJDFvzcCmhkn49ytDw3FGrxyxEOdCyYJ97BriBtrbA2hHkLnouYvZpkxs2+TB1nvE/EPsET9f2wW2ZDPkd9oCxOWisCx9TzI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785514803; c=relaxed/simple; bh=0cXQh/wi9mNTTITbxgaDB3yHqtiGn5+Qa+cNMfRk9UA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=W9Az5ATjr+GvDIAQk3XQrHy5lkwKgteVT5FD40+XP976S4ZIk69CyRJ4zHXMGqmk/q+IdGsTwLacgijpVpzEr5CaryOeeIBGeVf5HtEyNANQBwOHHCkTAyZCzDP6aw9tXC4liV1CBlOAH3M9XEdYqHaPbIAas+njAeXrZUR3Vp0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=QokOt9JT; arc=none smtp.client-ip=148.251.105.195 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1785514789; bh=0cXQh/wi9mNTTITbxgaDB3yHqtiGn5+Qa+cNMfRk9UA=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=QokOt9JTCghHQqgaFmv7YW2OfQO804zPDPvd0V9NEdkZNb0xGkFT++WwjQBLlrLlN I+faxIFULRQi6QJbBp22hUwuvNbcJJJ3kDNIA5bo4Qpk1Zr9VHCMczhHQ9L2o27ox/ 9u1MC0KH+4f9esQu4xVGTkAWlG3LuyFk/MfgQDpNrr/3wZ5EvT2CcLN8bWHOs5Pjsl I1Zdo8+C1n8ootnUPk3AFXvqAlRxFZXybo3KdaBNjRywMd2aeTTVA/j8mIs6Cw0j07 /QlMfkCxRzkRLtelo0r4eOo1sXGP7EaA7CLXKnKm3+8uo1NPiwv8F0E3XI8WlC2Ahh ZSzW/ZsO9/rDw== Received: from localhost (unknown [100.64.0.241]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange secp256r1 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: cristicc) by bali.collaboradmins.com (Postfix) with ESMTPSA id EA51D17E092F; Fri, 31 Jul 2026 18:19:48 +0200 (CEST) From: Cristian Ciocaltea Date: Fri, 31 Jul 2026 19:19:55 +0300 Subject: [PATCH v10 48/69] drm/bridge: adv7511: Advertise HDMI 1.2 capabilities Precedence: bulk X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20260731-dw-hdmi-qp-scramb-v10-48-294364b2cf15@collabora.com> References: <20260731-dw-hdmi-qp-scramb-v10-0-294364b2cf15@collabora.com> In-Reply-To: <20260731-dw-hdmi-qp-scramb-v10-0-294364b2cf15@collabora.com> To: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Luca Ceresoli , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Chen-Yu Tsai , Samuel Holland , Dave Stevenson , =?utf-8?q?Ma=C3=ADra_Canal?= , Raspberry Pi Kernel Maintenance , Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Andy Yan , Algea Cao , Daniel Stone , Liu Ying , Phong LE Cc: kernel@collabora.com, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-rockchip@lists.infradead.org X-Mailer: b4 0.15.2 X-MORS-Enabled: yes X-MORS-DOMAIN: patchwork.local X-MORS-HOSTING: hosting172546 X-MORS-USER: hosting172546 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= Bridges using DRM_BRIDGE_OP_HDMI are now expected to also provide a supported HDMI version. This is not yet enforced, but will become mandatory once the migration to the new caps-based HDMI connector initialization API is completed. Since max_mode_clock_khz does not exceed 165 MHz for any of the chip variants handled by the driver, advertise HDMI 1.2 as the supported version and set the bridge's max_tmds_char_rate so the connector limit inferred from supported_hdmi_ver is overridden by the chip-specific hardware constraints. drm_bridge_connector_atomic_check() runs drm_atomic_helper_connector_hdmi_check(), which rejects modes whose computed TMDS character rate exceeds the connector limit before invoking the driver's .tmds_char_rate_valid() hook, making adv7511_bridge_hdmi_tmds_char_rate_valid() redundant. Drop it. Signed-off-by: Cristian Ciocaltea --- drivers/gpu/drm/bridge/adv7511/adv7511_drv.c | 22 +++------------------- 1 file changed, 3 insertions(+), 19 deletions(-) diff --git a/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c b/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c index 038b852405b5..c3ef44074477 100644 --- a/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c +++ b/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c @@ -8,6 +8,7 @@ #include #include #include +#include #include #include #include @@ -775,11 +776,6 @@ static int adv7511_connector_init(struct adv7511 *adv) * DRM Bridge Operations */ -static const struct adv7511 *bridge_to_adv7511_const(const struct drm_bridge *bridge) -{ - return container_of(bridge, struct adv7511, bridge); -} - static void adv7511_bridge_atomic_enable(struct drm_bridge *bridge, struct drm_atomic_commit *state) { @@ -817,19 +813,6 @@ static void adv7511_bridge_atomic_disable(struct drm_bridge *bridge, adv7511_power_off(adv); } -static enum drm_mode_status -adv7511_bridge_hdmi_tmds_char_rate_valid(const struct drm_bridge *bridge, - const struct drm_display_mode *mode, - unsigned long long tmds_rate) -{ - const struct adv7511 *adv = bridge_to_adv7511_const(bridge); - - if (tmds_rate > 1000ULL * adv->info->max_mode_clock_khz) - return MODE_CLOCK_HIGH; - - return MODE_OK; -} - static enum drm_mode_status adv7511_bridge_mode_valid(struct drm_bridge *bridge, const struct drm_display_info *info, const struct drm_display_mode *mode) @@ -1006,7 +989,6 @@ static const struct drm_bridge_funcs adv7511_bridge_funcs = { .atomic_destroy_state = drm_atomic_helper_bridge_destroy_state, .atomic_create_state = drm_atomic_helper_bridge_create_state, - .hdmi_tmds_char_rate_valid = adv7511_bridge_hdmi_tmds_char_rate_valid, .hdmi_clear_audio_infoframe = adv7511_bridge_hdmi_clear_audio_infoframe, .hdmi_write_audio_infoframe = adv7511_bridge_hdmi_write_audio_infoframe, .hdmi_clear_avi_infoframe = adv7511_bridge_hdmi_clear_avi_infoframe, @@ -1359,6 +1341,8 @@ static int adv7511_probe(struct i2c_client *i2c) adv7511->bridge.vendor = "Analog"; adv7511->bridge.product = adv7511->info->name; + adv7511->bridge.supported_hdmi_ver = HDMI_VERSION_1_2; + adv7511->bridge.max_tmds_char_rate = 1000ULL * adv7511->info->max_mode_clock_khz; #ifdef CONFIG_DRM_I2C_ADV7511_AUDIO adv7511->bridge.ops |= DRM_BRIDGE_OP_HDMI_AUDIO; From patchwork Fri Jul 31 16:19:56 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Ciocaltea X-Patchwork-Id: 2857 Return-Path: X-Original-To: noreply@patchwork.local Delivered-To: noreply@patchwork.local Received: from sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74]) by mxe881.netcup.net (Postfix) with ESMTPS id 227B51C22FA for ; Fri, 31 Jul 2026 18:39:36 +0200 (CEST) Authentication-Results: mxe881; dkim=pass header.d=collabora.com; spf=pass (sender IP is 172.232.135.74) smtp.mailfrom=linux-sunxi+bounces-24848-noreply=patchwork.local@lists.linux.dev smtp.helo=sto.lore.kernel.org Received-SPF: pass (mxe881: domain of lists.linux.dev designates 172.232.135.74 as permitted sender) client-ip=172.232.135.74; envelope-from=linux-sunxi+bounces-24848-noreply=patchwork.local@lists.linux.dev; helo=sto.lore.kernel.org; Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by sto.lore.kernel.org (Postfix) with ESMTP id 7312731190FC for ; Fri, 31 Jul 2026 16:24:29 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 48DF246A5E2; Fri, 31 Jul 2026 16:20:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="IiFq5wAR" X-Original-To: linux-sunxi@lists.linux.dev Received: from bali.collaboradmins.com (bali.collaboradmins.com [148.251.105.195]) (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 58F2E44C649 for ; Fri, 31 Jul 2026 16:19:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.251.105.195 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785514798; cv=none; b=W74bWdbtlqEBusIzThKBUiD2F+ZJ2Y/DIwb3RqRo6dIXfsO2hf+Gfty8BCloOdJM6t0CCp78VyK7nWv2M5W7t1wCGujzv7B6g9MRjj1jEWPy2WF+qbSaz2CNHNdIhn1SxZYA4wrOfmWIXyHqVzqgIZjU6OYUKzAIMDtUTxZy+5c= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785514798; c=relaxed/simple; bh=hse6ZoBRDdkgueZEFZSp6DqlC7adzsHmGMK2OKfFL4E=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Vww7RhG6KXbRMkb9NOPGcg9d8hYfam43gYVrtIIQEDr8YkMnURyiY45OkyhL4XFdrD0w+KRtCC1UjcnkZBC4o9y2lxj89WM3uHRav7fQCgTsk0H3+yB4lPecbKtEunnFPaLRNaAgn9Mg+TwAS5NZq4S759NIzXMVXcWFXs/uK6o= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=IiFq5wAR; arc=none smtp.client-ip=148.251.105.195 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1785514789; bh=hse6ZoBRDdkgueZEFZSp6DqlC7adzsHmGMK2OKfFL4E=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=IiFq5wARocQVqFD0cNI83kNg5TUsSbclt8ZwoJEBxXDvmO1oxshnL1PymkbQk4abG J4jCdnMtGv61ajDAZNcicCL+1MZRS8yKjMczkmIByIPRKQQGJwkA+l29u0HhLt8a7q ENZekvJp2QuJwBKVaIB26gmr9+Zgn/ZB6W89sDgmRlSEH+ivzhiNKK5QGb79wJ3rdh 8wZzraSEvRWQAEMsfiPx6QpJVIhpiVaJVyI35n+zTwYqsg9lHvn5Xr8e1EPXTw0x0/ CW1XJSlNMsLT2rcEa45in5sqzDfpyos2E9g+gjVghMZCZ/BGNZbiCTp628ptZgLZGV /2rbb4pP7MJ4g== Received: from localhost (unknown [100.64.0.241]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange secp256r1 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: cristicc) by bali.collaboradmins.com (Postfix) with ESMTPSA id A01BA17E090B; Fri, 31 Jul 2026 18:19:49 +0200 (CEST) From: Cristian Ciocaltea Date: Fri, 31 Jul 2026 19:19:56 +0300 Subject: [PATCH v10 49/69] drm/bridge: inno-hdmi: Advertise HDMI 1.2 capabilities Precedence: bulk X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20260731-dw-hdmi-qp-scramb-v10-49-294364b2cf15@collabora.com> References: <20260731-dw-hdmi-qp-scramb-v10-0-294364b2cf15@collabora.com> In-Reply-To: <20260731-dw-hdmi-qp-scramb-v10-0-294364b2cf15@collabora.com> To: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Luca Ceresoli , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Chen-Yu Tsai , Samuel Holland , Dave Stevenson , =?utf-8?q?Ma=C3=ADra_Canal?= , Raspberry Pi Kernel Maintenance , Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Andy Yan , Algea Cao , Daniel Stone , Liu Ying , Phong LE Cc: kernel@collabora.com, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-rockchip@lists.infradead.org X-Mailer: b4 0.15.2 X-MORS-Enabled: yes X-MORS-DOMAIN: patchwork.local X-MORS-HOSTING: hosting172546 X-MORS-USER: hosting172546 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= Bridges using DRM_BRIDGE_OP_HDMI are now expected to also provide a supported HDMI version. This is not yet enforced, but will become mandatory once the migration to the new caps-based HDMI connector initialization API is completed. Since inno_hdmi_phy_config.pixelclock does not exceed 165 MHz for any of the chip variants handled by the driver, advertise HDMI 1.2 as the supported version. Signed-off-by: Cristian Ciocaltea --- drivers/gpu/drm/bridge/inno-hdmi.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/bridge/inno-hdmi.c b/drivers/gpu/drm/bridge/inno-hdmi.c index dd35f5a875d3..ea3447d4f285 100644 --- a/drivers/gpu/drm/bridge/inno-hdmi.c +++ b/drivers/gpu/drm/bridge/inno-hdmi.c @@ -1119,6 +1119,7 @@ struct inno_hdmi *inno_hdmi_bind(struct device *dev, hdmi->bridge.type = DRM_MODE_CONNECTOR_HDMIA; hdmi->bridge.vendor = "Inno"; hdmi->bridge.product = "Inno HDMI"; + hdmi->bridge.supported_hdmi_ver = HDMI_VERSION_1_2; hdmi->bridge.ddc = inno_hdmi_i2c_adapter(hdmi); if (IS_ERR(hdmi->bridge.ddc)) From patchwork Fri Jul 31 16:19:57 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Ciocaltea X-Patchwork-Id: 2835 Return-Path: X-Original-To: noreply@patchwork.local Delivered-To: noreply@patchwork.local Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114]) by mxe881.netcup.net (Postfix) with ESMTPS id 692311C20B4 for ; Fri, 31 Jul 2026 18:34:36 +0200 (CEST) Authentication-Results: mxe881; dkim=pass header.d=collabora.com; spf=pass (sender IP is 172.105.105.114) smtp.mailfrom=linux-sunxi+bounces-24854-noreply=patchwork.local@lists.linux.dev smtp.helo=tor.lore.kernel.org Received-SPF: pass (mxe881: domain of lists.linux.dev designates 172.105.105.114 as permitted sender) client-ip=172.105.105.114; envelope-from=linux-sunxi+bounces-24854-noreply=patchwork.local@lists.linux.dev; helo=tor.lore.kernel.org; Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by tor.lore.kernel.org (Postfix) with ESMTP id 348183185BF2 for ; Fri, 31 Jul 2026 16:25:10 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 209DA46C4BF; Fri, 31 Jul 2026 16:20:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="Hyrr0XvA" X-Original-To: linux-sunxi@lists.linux.dev Received: from bali.collaboradmins.com (bali.collaboradmins.com [148.251.105.195]) (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 BB0EF45C710 for ; Fri, 31 Jul 2026 16:19:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.251.105.195 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785514803; cv=none; b=b7ArfMdxN5a3EQMYB6S3neuyUrS+PleNiDcVTzKsx56yJWHSWK5n8LAD4hZYhN3V97/ojh74xofpiBrC31JC01MttSs+grelr0taA64jEfe70ftnYAEEP78gpAoizFwiQEIWC7i/JyMhLFl4Tfn2KSRQcDtm4gkNtN8ApmYgZA0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785514803; c=relaxed/simple; bh=FjNG/FbAfUxNWdfXcasZdzMERNWbRLC78jj086GTy6I=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=JJZ4PPs/5feRlG4HXmysH+P5Eo+8SZNaUu4bosYI93Q71KhpUUQyIoPlhy3B0BPwgHqO3gRDlnlgjPqrJk8fQFWnDJTZ+dCm617u8kbBcjvSpXenI5IZilBG+cNj2YW1BI0nxo6SfQ+/sIbT0D+W0v+sBXPSKfZFpTLVdRrgrQI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=Hyrr0XvA; arc=none smtp.client-ip=148.251.105.195 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1785514790; bh=FjNG/FbAfUxNWdfXcasZdzMERNWbRLC78jj086GTy6I=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=Hyrr0XvAvuzJDNa4V3fiG10eP9Etlr1hu5kpnKfXp3XP900r4GhIrAS8DlBN0bjqK SNAd5iaIPQ97UyS6C8qMrkvdZtYOjJvjNqmnY3uKU7NDWa+/NlAjk2h3hIVRqgKATX jztlOrxBM8CfmbKFxaZlP9824yanMlGxW911NyDjsuEosqtU8besE0lw9Bf7MkZhF+ 0A/1gmYzATtn7uNC+8uquq9pCKWh5CtTad+QxWE8vIYPxruer/e/bnebHK6Kk2G13A zxgVz8G2mpFHm99QAReBetdo9n4IkSh4RpOlEqK99sla344hDoIbYxzhUft3tegrOg LXd3FTojNwsHA== Received: from localhost (unknown [100.64.0.241]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange secp256r1 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: cristicc) by bali.collaboradmins.com (Postfix) with ESMTPSA id 6709017E093D; Fri, 31 Jul 2026 18:19:50 +0200 (CEST) From: Cristian Ciocaltea Date: Fri, 31 Jul 2026 19:19:57 +0300 Subject: [PATCH v10 50/69] drm/bridge: ite-it6263: Drop redundant .mode_valid hook Precedence: bulk X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20260731-dw-hdmi-qp-scramb-v10-50-294364b2cf15@collabora.com> References: <20260731-dw-hdmi-qp-scramb-v10-0-294364b2cf15@collabora.com> In-Reply-To: <20260731-dw-hdmi-qp-scramb-v10-0-294364b2cf15@collabora.com> To: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Luca Ceresoli , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Chen-Yu Tsai , Samuel Holland , Dave Stevenson , =?utf-8?q?Ma=C3=ADra_Canal?= , Raspberry Pi Kernel Maintenance , Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Andy Yan , Algea Cao , Daniel Stone , Liu Ying , Phong LE Cc: kernel@collabora.com, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-rockchip@lists.infradead.org X-Mailer: b4 0.15.2 X-MORS-Enabled: yes X-MORS-DOMAIN: patchwork.local X-MORS-HOSTING: hosting172546 X-MORS-USER: hosting172546 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= Bridges using DRM_BRIDGE_OP_HDMI expect connectors to be created through drm_bridge_connector_init(), thereby relying on the bridge connector's .mode_valid hook to invoke drm_hdmi_connector_mode_valid(). The generic helper computes the mode's TMDS character rate and forwards it to the bridge's .hdmi_tmds_char_rate_valid callback through the connector HDMI funcs. This covers exactly what it6263_bridge_mode_valid() does for 8 bpc RGB444, but due to being output-format aware, it also handles the validation more thoroughly. Both the connector and bridge .mode_valid hooks are invoked during mode validation through drm_mode_validate_pipeline(), so the custom bridge hook is redundant. Drop it. While at it, remove the now-unused drm_hdmi_helper.h include. Signed-off-by: Cristian Ciocaltea --- drivers/gpu/drm/bridge/ite-it6263.c | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/drivers/gpu/drm/bridge/ite-it6263.c b/drivers/gpu/drm/bridge/ite-it6263.c index 21ac8e58b9d2..550999491086 100644 --- a/drivers/gpu/drm/bridge/ite-it6263.c +++ b/drivers/gpu/drm/bridge/ite-it6263.c @@ -15,7 +15,6 @@ #include #include -#include #include #include #include @@ -669,20 +668,6 @@ static void it6263_bridge_atomic_enable(struct drm_bridge *bridge, regmap_write(regmap, HDMI_REG_PKT_GENERAL_CTRL, ENABLE_PKT | REPEAT_PKT); } -static enum drm_mode_status -it6263_bridge_mode_valid(struct drm_bridge *bridge, - const struct drm_display_info *info, - const struct drm_display_mode *mode) -{ - unsigned long long rate; - - rate = drm_hdmi_compute_mode_clock(mode, 8, DRM_OUTPUT_COLOR_FORMAT_RGB444); - if (rate == 0) - return MODE_NOCLOCK; - - return bridge->funcs->hdmi_tmds_char_rate_valid(bridge, mode, rate); -} - static int it6263_bridge_attach(struct drm_bridge *bridge, struct drm_encoder *encoder, enum drm_bridge_attach_flags flags) @@ -831,7 +816,6 @@ static const struct drm_bridge_funcs it6263_bridge_funcs = { .atomic_destroy_state = drm_atomic_helper_bridge_destroy_state, .atomic_create_state = drm_atomic_helper_bridge_create_state, .attach = it6263_bridge_attach, - .mode_valid = it6263_bridge_mode_valid, .atomic_disable = it6263_bridge_atomic_disable, .atomic_enable = it6263_bridge_atomic_enable, .detect = it6263_bridge_detect, From patchwork Fri Jul 31 16:19:58 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Ciocaltea X-Patchwork-Id: 2864 Return-Path: X-Original-To: noreply@patchwork.local Delivered-To: noreply@patchwork.local Received: from sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74]) by mxe881.netcup.net (Postfix) with ESMTPS id 9244E1C22FA for ; Fri, 31 Jul 2026 18:41:11 +0200 (CEST) Authentication-Results: mxe881; dkim=pass header.d=collabora.com; spf=pass (sender IP is 172.232.135.74) smtp.mailfrom=linux-sunxi+bounces-24862-noreply=patchwork.local@lists.linux.dev smtp.helo=sto.lore.kernel.org Received-SPF: pass (mxe881: domain of lists.linux.dev designates 172.232.135.74 as permitted sender) client-ip=172.232.135.74; envelope-from=linux-sunxi+bounces-24862-noreply=patchwork.local@lists.linux.dev; helo=sto.lore.kernel.org; Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by sto.lore.kernel.org (Postfix) with ESMTP id AC124312E247 for ; Fri, 31 Jul 2026 16:25:54 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 50F1046D08D; Fri, 31 Jul 2026 16:20:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="npjc/afz" X-Original-To: linux-sunxi@lists.linux.dev Received: from bali.collaboradmins.com (bali.collaboradmins.com [148.251.105.195]) (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 E80A744C649 for ; Fri, 31 Jul 2026 16:20:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.251.105.195 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785514809; cv=none; b=P5DTpEa7JsLCQDMadXjwzhL4+wi/w8MifGk6t3ycbRQkorOEiQfPJRb7HTc/fgtV6uomThzkrgnzIWJZEvqIT5aHWHjTzBTAXwQoacHCUfc0UU+DK4mtxERU5iOwpraiqTSHfLTNbjPqDo1ZfKwfMn0oZWl0tJCd68aKiPho1Ec= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785514809; c=relaxed/simple; bh=9ULxXAJ8Lgf9TVfLmpWCFcvW40GpvaJh+iJkfEerDYw=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=SQAaTVzVliOHmGejyXml6emZ8s8ipgFAd8xITi61K7eh3BJPoWwc58rfUlyaOGnd2sQEXpYRqKmOBvbSEA4ftryXgXGPVSXlverMnK2D+txvpu0FxOH2XhEXjrNq8WXTIQJWaK5f+Lh/180DGklWZLTZS5WRGv8s4maXJR7DSKg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=npjc/afz; arc=none smtp.client-ip=148.251.105.195 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1785514791; bh=9ULxXAJ8Lgf9TVfLmpWCFcvW40GpvaJh+iJkfEerDYw=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=npjc/afzI1OKbdV8DaRoeSuQGdPdtk/hQu4jEuEIPOBbhn+x86LnZwE528j0ygFU8 Bx90AUdWUC4HobXzn3dHl+GGMsH4/lUljY4VPMgdqL/rIADssmyl10AIugYIzjODUZ 8CLYEHw06brO/ZaVKnH4EnPfNVrwd3GC3JLiKHEWCmrmOlJ6ZtOfcC7ED5bE3okYRr 4kjWBQqi00ieV71cwrV5zPGqu8xFHNLOTxrFZ3WNn3w3fHo0yt8Fv5W2jFmENMoEWM mkxJcbTOsd1gWwwdJHeFPzfnOAiLRQjh+ohWR+8g4M6qtTiqPvkVzOwKcDL8YSw5gL PeCDoP7Os5L9w== Received: from localhost (unknown [100.64.0.241]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange secp256r1 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: cristicc) by bali.collaboradmins.com (Postfix) with ESMTPSA id 258D717E0998; Fri, 31 Jul 2026 18:19:51 +0200 (CEST) From: Cristian Ciocaltea Date: Fri, 31 Jul 2026 19:19:58 +0300 Subject: [PATCH v10 51/69] drm/bridge: ite-it6263: Advertise HDMI 1.3 capabilities Precedence: bulk X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20260731-dw-hdmi-qp-scramb-v10-51-294364b2cf15@collabora.com> References: <20260731-dw-hdmi-qp-scramb-v10-0-294364b2cf15@collabora.com> In-Reply-To: <20260731-dw-hdmi-qp-scramb-v10-0-294364b2cf15@collabora.com> To: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Luca Ceresoli , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Chen-Yu Tsai , Samuel Holland , Dave Stevenson , =?utf-8?q?Ma=C3=ADra_Canal?= , Raspberry Pi Kernel Maintenance , Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Andy Yan , Algea Cao , Daniel Stone , Liu Ying , Phong LE Cc: kernel@collabora.com, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-rockchip@lists.infradead.org X-Mailer: b4 0.15.2 X-Rspamd-Server: rspamd-worker-8404 X-Spamd-Result: default: False [-2.16 / 15.00]; BAYES_HAM(-5.50)[100.00%]; RBL_SENDERSCORE(2.00)[172.232.135.74:from]; SUSPICIOUS_RECIPS(1.50)[]; MAILLIST(-0.15)[generic]; BAD_REP_POLICIES(0.10)[]; MIME_GOOD(-0.10)[text/plain]; HAS_LIST_UNSUB(-0.01)[]; RCVD_COUNT_FIVE(0.00)[5]; ARC_ALLOW(0.00)[subspace.kernel.org:s=arc-20240116:i=1]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_TWELVE(0.00)[30]; PRECEDENCE_BULK(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[collabora.com:email,collabora.com:dkim,sto.lore.kernel.org:rdns,sto.lore.kernel.org:helo]; TAGGED_RCPT(0.00)[]; FORGED_SENDER_MAILLIST(0.00)[]; R_DKIM_ALLOW(0.00)[collabora.com:s=mail]; ASN(0.00)[asn:63949, ipnet:172.232.128.0/19, country:SG]; DKIM_TRACE(0.00)[collabora.com:+]; DMARC_POLICY_ALLOW(0.00)[collabora.com,none]; R_SPF_ALLOW(0.00)[+ip4:172.232.135.74:c]; TO_DN_SOME(0.00)[]; FROM_NEQ_ENVFROM(0.00)[cristian.ciocaltea@collabora.com,linux-sunxi@lists.linux.dev]; FREEMAIL_TO(0.00)[intel.com,linaro.org,kernel.org,ideasonboard.com,kwiboo.se,gmail.com,bootlin.com,linux.intel.com,suse.de,ffwll.ch,sholland.org,raspberrypi.com,igalia.com,rock-chips.com,sntech.de,collabora.com,nxp.com,baylibre.com]; MIME_TRACE(0.00)[0:+]; TAGGED_FROM(0.00)[bounces-24862-noreply=patchwork.local]; FORGED_RECIPIENTS_MAILLIST(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[] X-Rspamd-Queue-Id: 9244E1C22FA X-MORS-Enabled: yes X-MORS-DOMAIN: patchwork.local X-MORS-HOSTING: hosting172546 X-MORS-USER: hosting172546 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= Bridges using DRM_BRIDGE_OP_HDMI are expected to provide the supported HDMI version. This is not enforced yet, but will become mandatory once the migration to the caps-based HDMI connector initialization API is complete. Advertise HDMI 1.3 support for IT6263, covering the 225 MHz TMDS character rate currently documented by the driver, which is within the HDMI 1.3 limit of 340 MHz. Additionally, keep the stricter 150 MHz effective mode limit by setting max_tmds_char_rate from MAX_PIXEL_CLOCK_KHZ. The existing .hdmi_tmds_char_rate_valid() hook checks both the pixel clock and TMDS character rate. Since the bridge only supports 8 bpc RGB444, these are equivalent for supported modes, making the 225 MHz TMDS rate check unreachable once the 150 MHz pixel-clock limit is applied. drm_bridge_connector_atomic_check() invokes drm_atomic_helper_connector_hdmi_check(), which rejects modes whose computed TMDS character rate exceeds the connector's max_tmds_char_rate before invoking the driver's .tmds_char_rate_valid hook. Since max_tmds_char_rate now carries the existing effective limit, it6263_hdmi_tmds_char_rate_valid() is redundant. Drop it. Signed-off-by: Cristian Ciocaltea --- drivers/gpu/drm/bridge/ite-it6263.c | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/drivers/gpu/drm/bridge/ite-it6263.c b/drivers/gpu/drm/bridge/ite-it6263.c index 550999491086..e8e0197171e1 100644 --- a/drivers/gpu/drm/bridge/ite-it6263.c +++ b/drivers/gpu/drm/bridge/ite-it6263.c @@ -738,20 +738,6 @@ it6263_bridge_atomic_get_input_bus_fmts(struct drm_bridge *bridge, return input_fmts; } -static enum drm_mode_status -it6263_hdmi_tmds_char_rate_valid(const struct drm_bridge *bridge, - const struct drm_display_mode *mode, - unsigned long long tmds_rate) -{ - if (mode->clock > MAX_PIXEL_CLOCK_KHZ) - return MODE_CLOCK_HIGH; - - if (tmds_rate > MAX_HDMI_TMDS_CHAR_RATE_HZ) - return MODE_CLOCK_HIGH; - - return MODE_OK; -} - static int it6263_hdmi_clear_avi_infoframe(struct drm_bridge *bridge) { struct it6263 *it = bridge_to_it6263(bridge); @@ -821,7 +807,6 @@ static const struct drm_bridge_funcs it6263_bridge_funcs = { .detect = it6263_bridge_detect, .edid_read = it6263_bridge_edid_read, .atomic_get_input_bus_fmts = it6263_bridge_atomic_get_input_bus_fmts, - .hdmi_tmds_char_rate_valid = it6263_hdmi_tmds_char_rate_valid, .hdmi_clear_avi_infoframe = it6263_hdmi_clear_avi_infoframe, .hdmi_write_avi_infoframe = it6263_hdmi_write_avi_infoframe, .hdmi_clear_hdmi_infoframe = it6263_hdmi_clear_hdmi_infoframe, @@ -883,6 +868,8 @@ static int it6263_probe(struct i2c_client *client) it->bridge.type = DRM_MODE_CONNECTOR_HDMIA; it->bridge.vendor = "ITE"; it->bridge.product = "IT6263"; + it->bridge.supported_hdmi_ver = HDMI_VERSION_1_3; + it->bridge.max_tmds_char_rate = 1000ULL * MAX_PIXEL_CLOCK_KHZ; return devm_drm_bridge_add(dev, &it->bridge); } From patchwork Fri Jul 31 16:19:59 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Ciocaltea X-Patchwork-Id: 2837 Return-Path: X-Original-To: noreply@patchwork.local Delivered-To: noreply@patchwork.local Received: from sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74]) by mxe881.netcup.net (Postfix) with ESMTPS id 226AA1C1D58 for ; Fri, 31 Jul 2026 18:34:37 +0200 (CEST) Authentication-Results: mxe881; dkim=pass header.d=collabora.com; spf=pass (sender IP is 172.232.135.74) smtp.mailfrom=linux-sunxi+bounces-24857-noreply=patchwork.local@lists.linux.dev smtp.helo=sto.lore.kernel.org Received-SPF: pass (mxe881: domain of lists.linux.dev designates 172.232.135.74 as permitted sender) client-ip=172.232.135.74; envelope-from=linux-sunxi+bounces-24857-noreply=patchwork.local@lists.linux.dev; helo=sto.lore.kernel.org; Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by sto.lore.kernel.org (Postfix) with ESMTP id 3ADD830090BA for ; Fri, 31 Jul 2026 16:25:10 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2FE6146C4D2; Fri, 31 Jul 2026 16:20:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="fKlWS2BQ" X-Original-To: linux-sunxi@lists.linux.dev Received: from bali.collaboradmins.com (bali.collaboradmins.com [148.251.105.195]) (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 4AD7746A5E4 for ; Fri, 31 Jul 2026 16:19:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.251.105.195 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785514804; cv=none; b=syFk0L4WNOvZKhcpmy13MPKnDOjYr7MsRmYF4psu/hrRz8umhxvFetnq2Y1T/rYS5icygNN39U2E9lb1VpeesuL6tx74duyGI1KAtEBw5gUh2QjYv3fhcc5z5uCj62VkTAkKZ9Tj8k7D2DVv+18i7GBG5QkTsAWiHLaIQVanRJs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785514804; c=relaxed/simple; bh=sA9hvcyp15eD/qblsyZ0XpFBugSaj6mhi+/AmnkxIDY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=NlUyXfSXmxCQMVOxSd7BO409BzywSMUsNXnviMsp3H2/k1NoftYTWRBb6/7WdeM7IY/ZSCtPZkH0IPUicW+/DEMGJRKxo7hz7ZbEYL4BlGEv3v0r8wxzp/Os6qg/IDD/MdXcEkC7sn/At+GEmX3ALn/7xUhHHAGrkAC3YM6AtHM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=fKlWS2BQ; arc=none smtp.client-ip=148.251.105.195 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1785514791; bh=sA9hvcyp15eD/qblsyZ0XpFBugSaj6mhi+/AmnkxIDY=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=fKlWS2BQ9dRVs3IfHTGb4xDa37lKfuv0PoV87f0mci1XAKivqLCk6jMeqK+7QchEB 1koxi0GGIJzc4DBIicvY4q4aX1J9yh3u9EsM6IxMU/tixuEEXPf8kpDCAuatd7iCvx +7wzVBmaqlBE5BEHHETSdyS61T07FJXDkjYSt5cuKaruplmuEQQwsUo6uX65fUFYF4 ph0zDDOb81Tk15Mqr4IGZHYQHejWfOe1TaibzgRAVF3Deyx99D+pXtTj24FdVIihZb QMLS88og1I7mrjuPVYo1o2X29NF+RNTqqzFk5D56+xVmJKphB5SEo23KVzkNFEU/AF naXgccTTPV3Nw== Received: from localhost (unknown [100.64.0.241]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange secp256r1 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: cristicc) by bali.collaboradmins.com (Postfix) with ESMTPSA id C99E217E08E9; Fri, 31 Jul 2026 18:19:51 +0200 (CEST) From: Cristian Ciocaltea Date: Fri, 31 Jul 2026 19:19:59 +0300 Subject: [PATCH v10 52/69] drm/bridge: ite-it66121: Advertise HDMI 1.2 capabilities Precedence: bulk X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20260731-dw-hdmi-qp-scramb-v10-52-294364b2cf15@collabora.com> References: <20260731-dw-hdmi-qp-scramb-v10-0-294364b2cf15@collabora.com> In-Reply-To: <20260731-dw-hdmi-qp-scramb-v10-0-294364b2cf15@collabora.com> To: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Luca Ceresoli , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Chen-Yu Tsai , Samuel Holland , Dave Stevenson , =?utf-8?q?Ma=C3=ADra_Canal?= , Raspberry Pi Kernel Maintenance , Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Andy Yan , Algea Cao , Daniel Stone , Liu Ying , Phong LE Cc: kernel@collabora.com, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-rockchip@lists.infradead.org X-Mailer: b4 0.15.2 X-Rspamd-Server: rspamd-worker-8404 X-Spamd-Result: default: False [-2.16 / 15.00]; BAYES_HAM(-5.50)[100.00%]; RBL_SENDERSCORE(2.00)[172.232.135.74:from]; SUSPICIOUS_RECIPS(1.50)[]; MAILLIST(-0.15)[generic]; BAD_REP_POLICIES(0.10)[]; MIME_GOOD(-0.10)[text/plain]; HAS_LIST_UNSUB(-0.01)[]; RCVD_COUNT_FIVE(0.00)[5]; ARC_ALLOW(0.00)[subspace.kernel.org:s=arc-20240116:i=1]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_TWELVE(0.00)[30]; PRECEDENCE_BULK(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[sto.lore.kernel.org:rdns,sto.lore.kernel.org:helo,collabora.com:email,collabora.com:dkim]; TAGGED_RCPT(0.00)[]; FORGED_SENDER_MAILLIST(0.00)[]; R_DKIM_ALLOW(0.00)[collabora.com:s=mail]; ASN(0.00)[asn:63949, ipnet:172.232.128.0/19, country:SG]; DKIM_TRACE(0.00)[collabora.com:+]; DMARC_POLICY_ALLOW(0.00)[collabora.com,none]; R_SPF_ALLOW(0.00)[+ip4:172.232.135.74:c]; TO_DN_SOME(0.00)[]; FROM_NEQ_ENVFROM(0.00)[cristian.ciocaltea@collabora.com,linux-sunxi@lists.linux.dev]; FREEMAIL_TO(0.00)[intel.com,linaro.org,kernel.org,ideasonboard.com,kwiboo.se,gmail.com,bootlin.com,linux.intel.com,suse.de,ffwll.ch,sholland.org,raspberrypi.com,igalia.com,rock-chips.com,sntech.de,collabora.com,nxp.com,baylibre.com]; MIME_TRACE(0.00)[0:+]; TAGGED_FROM(0.00)[bounces-24857-noreply=patchwork.local]; FORGED_RECIPIENTS_MAILLIST(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[] X-Rspamd-Queue-Id: 226AA1C1D58 X-MORS-Enabled: yes X-MORS-DOMAIN: patchwork.local X-MORS-HOSTING: hosting172546 X-MORS-USER: hosting172546 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= Bridges using DRM_BRIDGE_OP_HDMI are now expected to also provide a supported HDMI version. This is not yet enforced, but will become mandatory once the migration to the new caps-based HDMI connector initialization API is completed. Since none of the chip variants handled by the driver can drive a TMDS character rate exceeding 148.5 MHz, advertise HDMI 1.2 as the supported version. HDMI 1.2 allows up to 165 MHz, so set the bridge's max_tmds_char_rate to ensure the connector limit derived from supported_hdmi_ver remains within the hardware capabilities. drm_bridge_connector_atomic_check() runs drm_atomic_helper_connector_hdmi_check(), which rejects modes whose computed TMDS character rate exceeds the connector limit before invoking the driver's .tmds_char_rate_valid() hook, making the max_rate check in it66121_bridge_hdmi_tmds_char_rate_valid() redundant. Drop it. Signed-off-by: Cristian Ciocaltea --- drivers/gpu/drm/bridge/ite-it66121.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/drm/bridge/ite-it66121.c b/drivers/gpu/drm/bridge/ite-it66121.c index 51fc68ffdf8f..c8d0a26e8e90 100644 --- a/drivers/gpu/drm/bridge/ite-it66121.c +++ b/drivers/gpu/drm/bridge/ite-it66121.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include @@ -867,15 +868,6 @@ it66121_bridge_hdmi_tmds_char_rate_valid(const struct drm_bridge *bridge, const struct drm_display_mode *mode, unsigned long long tmds_rate) { - const struct it66121_ctx *ctx = - container_of(bridge, const struct it66121_ctx, bridge); - unsigned long long max_rate; - - max_rate = (ctx->bus_width == 12) ? 74250000ULL : 148500000ULL; - - if (tmds_rate > max_rate) - return MODE_CLOCK_HIGH; - if (tmds_rate < HDMI_TMDS_CHAR_RATE_MIN_HZ) return MODE_CLOCK_LOW; @@ -1670,6 +1662,9 @@ static int it66121_probe(struct i2c_client *client) DRM_BRIDGE_OP_HDMI; ctx->bridge.vendor = "ITE"; ctx->bridge.product = "IT66121"; + ctx->bridge.supported_hdmi_ver = HDMI_VERSION_1_2; + ctx->bridge.max_tmds_char_rate = ctx->bus_width == 12 ? 74250000ULL : 148500000ULL; + if (client->irq > 0) { ctx->bridge.ops |= DRM_BRIDGE_OP_HPD; From patchwork Fri Jul 31 16:20:00 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Ciocaltea X-Patchwork-Id: 2882 Return-Path: X-Original-To: noreply@patchwork.local Delivered-To: noreply@patchwork.local Received: from sin.lore.kernel.org (sin.lore.kernel.org [104.64.211.4]) by mxe881.netcup.net (Postfix) with ESMTPS id 015331C0256 for ; Fri, 31 Jul 2026 19:06:00 +0200 (CEST) Authentication-Results: mxe881; dkim=pass header.d=collabora.com; spf=pass (sender IP is 104.64.211.4) smtp.mailfrom=linux-sunxi+bounces-24859-noreply=patchwork.local@lists.linux.dev smtp.helo=sin.lore.kernel.org Received-SPF: pass (mxe881: domain of lists.linux.dev designates 104.64.211.4 as permitted sender) client-ip=104.64.211.4; envelope-from=linux-sunxi+bounces-24859-noreply=patchwork.local@lists.linux.dev; helo=sin.lore.kernel.org; Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by sin.lore.kernel.org (Postfix) with ESMTP id 3486A30F3D85 for ; Fri, 31 Jul 2026 16:25:19 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D546944BC97; Fri, 31 Jul 2026 16:20:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="O0OWg0qf" X-Original-To: linux-sunxi@lists.linux.dev Received: from bali.collaboradmins.com (bali.collaboradmins.com [148.251.105.195]) (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 1AFF744E648 for ; Fri, 31 Jul 2026 16:19:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.251.105.195 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785514805; cv=none; b=maKYg8ZzGL2mmB64e3pzPRctQELzOGpBhfTTh2w+TMjOK9l6C2N8JGLmfKfQBf57w/1sVT1khi3X486hexmmeN+2zkWycxeR5qj17SGDE3vYbJkTGn9h0TDY93XKB90pu+lBo9/PYGzQOQQyKlh1hTPD04/XTGW4X7Crx1Afpck= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785514805; c=relaxed/simple; bh=7rSZ9gXpFQ7En3lTm1pnNmIcuFb2s4vukUXLVZ8mwlQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=rhWaj8GwNUuR2EBQP1sqGtXkwU3LzE34AAf/QEfnysBTiLAunTI4g2Eklgco3GS1EmQAk1kXULLtOQySqS2L5dU5yGpZbydbe4hn++rEuFTcHMXdifKlsoX9O3+sXpnECHPVCK6Zdqdue4wacqUtX5Yz1SWlvEHt/f0+DE/Ac/Y= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=O0OWg0qf; arc=none smtp.client-ip=148.251.105.195 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1785514792; bh=7rSZ9gXpFQ7En3lTm1pnNmIcuFb2s4vukUXLVZ8mwlQ=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=O0OWg0qfNv77GkzxlgnEtfyliP5gCib8NT0g4lJ0AcEpBQCKJHKUP6rrZE2H2/7av h7PN4nka0RVATZzhNPic9AuKoubn6+UFw2E/e3jztKrnIkQElRqKIzjmsHUzh2AG4b CMld+32ugq/lLVGGsJybBuD0bEJ9LccjuuB6ID9JSQaJ8zvtPmVL8+l5x4B8FDEQAw 2T4BCTWb69XnL+cPW1EOtUa+9MwkFRTcVwBrkHJCdynEIu805CjlzA6K6oSFBsk3+q 8CNwe9PO0Z14tUNfFitohpwd9hAih3FUMTt10PmEtQAuAoWdQosvWDSIQzufHipQKc kTEK7NDrgi4TA== Received: from localhost (unknown [100.64.0.241]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange secp256r1 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: cristicc) by bali.collaboradmins.com (Postfix) with ESMTPSA id 7C8D017E08EB; Fri, 31 Jul 2026 18:19:52 +0200 (CEST) From: Cristian Ciocaltea Date: Fri, 31 Jul 2026 19:20:00 +0300 Subject: [PATCH v10 53/69] drm/bridge: lontium-lt9611: Advertise HDMI 1.4 capabilities Precedence: bulk X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20260731-dw-hdmi-qp-scramb-v10-53-294364b2cf15@collabora.com> References: <20260731-dw-hdmi-qp-scramb-v10-0-294364b2cf15@collabora.com> In-Reply-To: <20260731-dw-hdmi-qp-scramb-v10-0-294364b2cf15@collabora.com> To: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Luca Ceresoli , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Chen-Yu Tsai , Samuel Holland , Dave Stevenson , =?utf-8?q?Ma=C3=ADra_Canal?= , Raspberry Pi Kernel Maintenance , Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Andy Yan , Algea Cao , Daniel Stone , Liu Ying , Phong LE Cc: kernel@collabora.com, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-rockchip@lists.infradead.org X-Mailer: b4 0.15.2 X-MORS-Enabled: yes X-MORS-DOMAIN: patchwork.local X-MORS-HOSTING: hosting172546 X-MORS-USER: hosting172546 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= Bridges using DRM_BRIDGE_OP_HDMI are expected to provide the supported HDMI version. This is not enforced yet, but will become mandatory once the migration to the caps-based HDMI connector initialization API is complete. As LT9611 supposedly cannot drive a TMDS character rate exceeding 297 MHz, advertise HDMI 1.4 as the supported version. HDMI 1.4 allows up to 340 MHz, so set the bridge's max_tmds_char_rate to ensure the connector limit derived from supported_hdmi_ver remains within the hardware capabilities. drm_bridge_connector_atomic_check() calls drm_atomic_helper_connector_hdmi_check(), which rejects modes whose computed TMDS character rate exceeds the connector's max_tmds_char_rate before invoking the driver's .tmds_char_rate_valid hook. Since max_tmds_char_rate now carries the existing effective limit, lt9611_hdmi_tmds_char_rate_valid() is redundant. Drop it. Signed-off-by: Cristian Ciocaltea --- drivers/gpu/drm/bridge/lontium-lt9611.c | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/drivers/gpu/drm/bridge/lontium-lt9611.c b/drivers/gpu/drm/bridge/lontium-lt9611.c index fb34f661ee0a..f66e3d1b1b57 100644 --- a/drivers/gpu/drm/bridge/lontium-lt9611.c +++ b/drivers/gpu/drm/bridge/lontium-lt9611.c @@ -5,6 +5,7 @@ */ #include +#include #include #include #include @@ -952,18 +953,6 @@ static int lt9611_hdmi_write_hdmi_infoframe(struct drm_bridge *bridge, return 0; } -static enum drm_mode_status -lt9611_hdmi_tmds_char_rate_valid(const struct drm_bridge *bridge, - const struct drm_display_mode *mode, - unsigned long long tmds_rate) -{ - /* 297 MHz for 4k@30 mode */ - if (tmds_rate > 297000000) - return MODE_CLOCK_HIGH; - - return MODE_OK; -} - static int lt9611_hdmi_audio_startup(struct drm_bridge *bridge, struct drm_connector *connector) { @@ -1029,7 +1018,6 @@ static const struct drm_bridge_funcs lt9611_bridge_funcs = { .atomic_create_state = drm_atomic_helper_bridge_create_state, .atomic_get_input_bus_fmts = lt9611_atomic_get_input_bus_fmts, - .hdmi_tmds_char_rate_valid = lt9611_hdmi_tmds_char_rate_valid, .hdmi_write_audio_infoframe = lt9611_hdmi_write_audio_infoframe, .hdmi_clear_audio_infoframe = lt9611_hdmi_clear_audio_infoframe, .hdmi_write_avi_infoframe = lt9611_hdmi_write_avi_infoframe, @@ -1177,6 +1165,8 @@ static int lt9611_probe(struct i2c_client *client) lt9611->bridge.hdmi_audio_dev = dev; lt9611->bridge.hdmi_audio_max_i2s_playback_channels = 8; lt9611->bridge.hdmi_audio_dai_port = 2; + lt9611->bridge.supported_hdmi_ver = HDMI_VERSION_1_4; + lt9611->bridge.max_tmds_char_rate = 297000000; /* 297 MHz for 4k@30 mode */ drm_bridge_add(<9611->bridge); From patchwork Fri Jul 31 16:20:01 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Ciocaltea X-Patchwork-Id: 2884 Return-Path: X-Original-To: noreply@patchwork.local Delivered-To: noreply@patchwork.local Received: from sin.lore.kernel.org (sin.lore.kernel.org [104.64.211.4]) by mxe881.netcup.net (Postfix) with ESMTPS id E38FD1C093B for ; Fri, 31 Jul 2026 19:07:38 +0200 (CEST) Authentication-Results: mxe881; dkim=pass header.d=collabora.com; spf=pass (sender IP is 104.64.211.4) smtp.mailfrom=linux-sunxi+bounces-24872-noreply=patchwork.local@lists.linux.dev smtp.helo=sin.lore.kernel.org Received-SPF: pass (mxe881: domain of lists.linux.dev designates 104.64.211.4 as permitted sender) client-ip=104.64.211.4; envelope-from=linux-sunxi+bounces-24872-noreply=patchwork.local@lists.linux.dev; helo=sin.lore.kernel.org; Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by sin.lore.kernel.org (Postfix) with ESMTP id B1EE33078524 for ; Fri, 31 Jul 2026 16:26:28 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A49B046D551; Fri, 31 Jul 2026 16:20:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="KpewS9PA" X-Original-To: linux-sunxi@lists.linux.dev Received: from bali.collaboradmins.com (bali.collaboradmins.com [148.251.105.195]) (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 E71AE46AA66 for ; Fri, 31 Jul 2026 16:20:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.251.105.195 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785514815; cv=none; b=bWn3y2VVw3dfnFocCpy8CWWuuFjSHKN+uKw4zFOzmno4TvsraY2VuCa/YoKwF/UJkZj7P/5Ck12Y40n/i5jZm5eVftl4HavSWAYVNfgOUVQdX74pqTY/UMxiNRrdduNEabpvEININvv6uOAozrFKBcoighHBgY7k7JbLoPFcJPQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785514815; c=relaxed/simple; bh=Nxh58kkTCJhDJZ7LOkXxKPsnDbbAawY8MD7ZCqqJ5bs=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=FnejdCJ3nqL2W/wEp0p12lrNofz17MsYE59sK9y63JMR9cWomfhvNiI77Hsiv7tbB73XOIMEdjQ9qmwnTxljhBTn6wxNG1zlT/EuhBs9y32OqR0Il8AcIDRwYUHYewE0FxBg5V/vvdxZBEk144xuxyEJgn9JpdJ0wOgQqPtF08Y= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=KpewS9PA; arc=none smtp.client-ip=148.251.105.195 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1785514793; bh=Nxh58kkTCJhDJZ7LOkXxKPsnDbbAawY8MD7ZCqqJ5bs=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=KpewS9PA1BDaDp0B//q/gO+9yphcABEgsq9KIxwt/mjHZ+3nObMDEbeyjCRp4k9pp 7TNs6AhYJoyXwy9v1Wji1tb3FoTTJt8FqsrP8oo18um45n5gzB67F2DNUVc58MxGzM ivtmVXnEwEHqebl2ge/J7XLYI64BuUPAi60OqpxbgS/rWt/6jEnntRQm1f3B7xsKo+ nTNJRG7WuDXCb38b5NL4caiHrVLYlj93yZc40CbFskxARjhuAljeyQTG5JBAUE2UqZ YDMmtW8z8Ek0JvYYSezDCHqbBLviOXqchG+/RfpV6co1nZKqrdjY3UJ3P79evuGYdM NDWy/xPTO4gNg== Received: from localhost (unknown [100.64.0.241]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange secp256r1 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: cristicc) by bali.collaboradmins.com (Postfix) with ESMTPSA id 3431217E08F7; Fri, 31 Jul 2026 18:19:53 +0200 (CEST) From: Cristian Ciocaltea Date: Fri, 31 Jul 2026 19:20:01 +0300 Subject: [PATCH v10 54/69] drm/rockchip: rk3066_hdmi: Advertise HDMI 1.4 capabilities Precedence: bulk X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20260731-dw-hdmi-qp-scramb-v10-54-294364b2cf15@collabora.com> References: <20260731-dw-hdmi-qp-scramb-v10-0-294364b2cf15@collabora.com> In-Reply-To: <20260731-dw-hdmi-qp-scramb-v10-0-294364b2cf15@collabora.com> To: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Luca Ceresoli , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Chen-Yu Tsai , Samuel Holland , Dave Stevenson , =?utf-8?q?Ma=C3=ADra_Canal?= , Raspberry Pi Kernel Maintenance , Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Andy Yan , Algea Cao , Daniel Stone , Liu Ying , Phong LE Cc: kernel@collabora.com, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-rockchip@lists.infradead.org X-Mailer: b4 0.15.2 X-MORS-Enabled: yes X-MORS-DOMAIN: patchwork.local X-MORS-HOSTING: hosting172546 X-MORS-USER: hosting172546 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= Bridges using DRM_BRIDGE_OP_HDMI are now expected to also provide a supported HDMI version. This is not yet enforced, but will become mandatory once the migration to the new caps-based HDMI connector initialization API is completed. The RK3066 HDMI TX supports HDMI 1.4a, as described in commit f84d3d37b7fb ("drm: rockchip: introduce rk3066 hdmi"). However, the driver does not currently enforce a maximum TMDS character rate, it only filters non-CEA modes and excludes VIC 1 (640x480) via the .mode_valid callback. Advertise HDMI 1.4 support for now so that modes exceeding the 340 MHz TMDS limit are rejected by the core. Signed-off-by: Cristian Ciocaltea Reviewed-by: Heiko Stuebner --- drivers/gpu/drm/rockchip/rk3066_hdmi.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/rockchip/rk3066_hdmi.c b/drivers/gpu/drm/rockchip/rk3066_hdmi.c index f28d6a883e09..f748700b0ba6 100644 --- a/drivers/gpu/drm/rockchip/rk3066_hdmi.c +++ b/drivers/gpu/drm/rockchip/rk3066_hdmi.c @@ -14,6 +14,7 @@ #include #include +#include #include #include #include @@ -712,6 +713,7 @@ rk3066_hdmi_register(struct drm_device *drm, struct rk3066_hdmi *hdmi) hdmi->bridge.type = DRM_MODE_CONNECTOR_HDMIA; hdmi->bridge.vendor = "Rockchip"; hdmi->bridge.product = "RK3066 HDMI"; + hdmi->bridge.supported_hdmi_ver = HDMI_VERSION_1_4; hdmi->bridge.ddc = rk3066_hdmi_i2c_adapter(hdmi); if (IS_ERR(hdmi->bridge.ddc)) From patchwork Fri Jul 31 16:20:02 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Ciocaltea X-Patchwork-Id: 2838 Return-Path: X-Original-To: noreply@patchwork.local Delivered-To: noreply@patchwork.local Received: from sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74]) by mxe881.netcup.net (Postfix) with ESMTPS id 0209C1C1D58 for ; Fri, 31 Jul 2026 18:35:19 +0200 (CEST) Authentication-Results: mxe881; dkim=pass header.d=collabora.com; spf=pass (sender IP is 172.232.135.74) smtp.mailfrom=linux-sunxi+bounces-24865-noreply=patchwork.local@lists.linux.dev smtp.helo=sto.lore.kernel.org Received-SPF: pass (mxe881: domain of lists.linux.dev designates 172.232.135.74 as permitted sender) client-ip=172.232.135.74; envelope-from=linux-sunxi+bounces-24865-noreply=patchwork.local@lists.linux.dev; helo=sto.lore.kernel.org; Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by sto.lore.kernel.org (Postfix) with ESMTP id 9FB943077CBD for ; Fri, 31 Jul 2026 16:26:10 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4264246D2B0; Fri, 31 Jul 2026 16:20:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="bShXLtHK" X-Original-To: linux-sunxi@lists.linux.dev Received: from bali.collaboradmins.com (bali.collaboradmins.com [148.251.105.195]) (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 BFD9C46AA76 for ; Fri, 31 Jul 2026 16:20:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.251.105.195 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785514813; cv=none; b=SYT2RjjD5+PfoveW791DAuEiToeWyA7vw5c1lPWD252NRB6s1RRSAC4Id+qCJGsLjTewjq/n9XhWsjLICH/1AUmXz5yQdjvm5qsJrsZdNW/wsQWuE1WqVAFl3qQ/XL9aDiFvA14zDIkRTqb6FDr3wVlqmgCs7zCIk8PRIPNcGRY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785514813; c=relaxed/simple; bh=plxawnmT20w7v+1sTZz825WPXTqg1jAro3a9cOhXJdQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=hVyVnRR77itGTmFZOB6Er60Hn3TR1ToNDryKwEnCSEDph13ekKxwZ3L0nGycX90ahcu9VWhXhvpDpxI2cganyQEtXT31H36AR72vd2l1aUpCjc4/J+pqp3s6ZgrHHCVrhUUfIOp96N9T7GKa30XZhDYIeSugxIIK49tJYnI8zs8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=bShXLtHK; arc=none smtp.client-ip=148.251.105.195 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1785514794; bh=plxawnmT20w7v+1sTZz825WPXTqg1jAro3a9cOhXJdQ=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=bShXLtHKT160n7wYmyOV6tj7a+kfV3Rcc0M0QRyMZ3WJAEcB8y0U7fB15YeS9PzUS KVQh6eZCYGfL3ZPbGhYhJ9HyyihWzoRa/C3jA98CXtb2GS+y+ZCaNbjaq6EZRoo2iY pvuJq50RzX4aVYRZH+vS1UVhnIt44j5oHtQA2qBDZur1V2bvnuNY+sgsSzmbbrIEAJ 0H/nvlaG0E5rpc4xgCpNqQzDKjoI6BJbzillghFxcRL1tYYwMAPHQgjRIcjybKD/TM UZs+kEVCgjtqpZBsxdVdROr/VPyLRHBIFVcAojrFeDR3QRyWitIPPz2WSPmt1NjUHF wZgRMS1wRJeiw== Received: from localhost (unknown [100.64.0.241]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange secp256r1 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: cristicc) by bali.collaboradmins.com (Postfix) with ESMTPSA id DD21C17E0906; Fri, 31 Jul 2026 18:19:53 +0200 (CEST) From: Cristian Ciocaltea Date: Fri, 31 Jul 2026 19:20:02 +0300 Subject: [PATCH v10 55/69] drm/sun4i: hdmi: Convert to drmm_connector_hdmi_init() Precedence: bulk X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20260731-dw-hdmi-qp-scramb-v10-55-294364b2cf15@collabora.com> References: <20260731-dw-hdmi-qp-scramb-v10-0-294364b2cf15@collabora.com> In-Reply-To: <20260731-dw-hdmi-qp-scramb-v10-0-294364b2cf15@collabora.com> To: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Luca Ceresoli , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Chen-Yu Tsai , Samuel Holland , Dave Stevenson , =?utf-8?q?Ma=C3=ADra_Canal?= , Raspberry Pi Kernel Maintenance , Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Andy Yan , Algea Cao , Daniel Stone , Liu Ying , Phong LE Cc: kernel@collabora.com, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-rockchip@lists.infradead.org X-Mailer: b4 0.15.2 X-MORS-Enabled: yes X-MORS-DOMAIN: patchwork.local X-MORS-HOSTING: hosting172546 X-MORS-USER: hosting172546 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= Switch driver over to the new drmm_connector_hdmi_init() signature and advertise HDMI 1.2 support. The vendor, product, supported_formats and max_bpc values previously passed as arguments are now provided through struct drm_connector_hdmi_funcs, together with the new supported_hdmi_ver field. The HDMI connector helpers infer the 165 MHz TMDS character rate ceiling from supported_hdmi_ver and reject modes exceeding it before invoking the driver's .tmds_char_rate_valid() hook. This makes the explicit mode clock check in sun4i_hdmi_connector_clock_valid() redundant, so drop it. No functional change intended. Signed-off-by: Cristian Ciocaltea Reviewed-by: Maxime Ripard --- drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c b/drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c index 96b2b597caa6..850a8fecf0b5 100644 --- a/drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c +++ b/drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c @@ -192,10 +192,6 @@ sun4i_hdmi_connector_clock_valid(const struct drm_connector *connector, if (mode->flags & DRM_MODE_FLAG_DBLCLK) return MODE_BAD; - /* HDMI 1.0 max TMDS character rate */ - if (clock > HDMI_1_0_TMDS_CHAR_RATE_MAX_HZ) - return MODE_CLOCK_HIGH; - rounded_rate = clk_round_rate(hdmi->tmds_clk, clock); if (rounded_rate > 0 && max_t(unsigned long, rounded_rate, clock) - @@ -253,6 +249,11 @@ static struct i2c_adapter *sun4i_hdmi_get_ddc(struct device *dev) } static const struct drm_connector_hdmi_funcs sun4i_hdmi_hdmi_connector_funcs = { + .vendor = "AW", + .product = "HDMI", + .supported_hdmi_ver = HDMI_VERSION_1_2, + .supported_formats = BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444), + .max_bpc = 8, .tmds_char_rate_valid = sun4i_hdmi_connector_clock_valid, .avi = { .clear_infoframe = sun4i_hdmi_clear_avi_infoframe, @@ -653,19 +654,16 @@ static int sun4i_hdmi_bind(struct device *dev, struct device *master, drm_connector_helper_add(&hdmi->connector, &sun4i_hdmi_connector_helper_funcs); - ret = drmm_connector_hdmi_ini2(drm, &hdmi->connector, + ret = drmm_connector_hdmi_init(drm, &hdmi->connector, /* * NOTE: Those are likely to be * wrong, but I couldn't find the * actual ones in the BSP. */ - "AW", "HDMI", &sun4i_hdmi_connector_funcs, &sun4i_hdmi_hdmi_connector_funcs, DRM_MODE_CONNECTOR_HDMIA, - hdmi->ddc_i2c, - BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444), - 8); + hdmi->ddc_i2c); if (ret) { dev_err(dev, "Couldn't initialise the HDMI connector\n"); From patchwork Fri Jul 31 16:20:03 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Ciocaltea X-Patchwork-Id: 2862 Return-Path: X-Original-To: noreply@patchwork.local Delivered-To: noreply@patchwork.local Received: from sin.lore.kernel.org (sin.lore.kernel.org [104.64.211.4]) by mxe881.netcup.net (Postfix) with ESMTPS id A9BE51C22FA for ; Fri, 31 Jul 2026 18:41:04 +0200 (CEST) Authentication-Results: mxe881; dkim=pass header.d=collabora.com; spf=pass (sender IP is 104.64.211.4) smtp.mailfrom=linux-sunxi+bounces-24863-noreply=patchwork.local@lists.linux.dev smtp.helo=sin.lore.kernel.org Received-SPF: pass (mxe881: domain of lists.linux.dev designates 104.64.211.4 as permitted sender) client-ip=104.64.211.4; envelope-from=linux-sunxi+bounces-24863-noreply=patchwork.local@lists.linux.dev; helo=sin.lore.kernel.org; Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by sin.lore.kernel.org (Postfix) with ESMTP id 706B030F938F for ; Fri, 31 Jul 2026 16:26:04 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E7AD546D09D; Fri, 31 Jul 2026 16:20:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="dIqeT/RV" X-Original-To: linux-sunxi@lists.linux.dev Received: from bali.collaboradmins.com (bali.collaboradmins.com [148.251.105.195]) (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 E0A1346A618 for ; Fri, 31 Jul 2026 16:20:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.251.105.195 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785514811; cv=none; b=FGOpKu8dcaB68mHlpY6gwm3L/Gcw2uINIM1tkAl5iO/f9ED1GxQBfTX+nGucaHSPidUkCJY/V79iEFSfkKKc2sDshBM72/fUiPJZZXCw5hma7XvWuJEqB6mTaDHRcTBp1wALtS0gZFdl9HoPLF4Sm5p9pbLFpsyB8Az3eQc+m9A= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785514811; c=relaxed/simple; bh=L/eUqdDm7UuQMmbOXx6a5bJ0OkNkDIn5Lw3Or7I74pU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=qr5nT/oH68ZRz1I6g2btpa6JLw6ZBpLRF08CpCokrvcvU4SvH4GhMkNXZqJ2/ehOjOh5TMKr4VJhd+4h1k0g3+rRarGOgSWhbFNl3voAOmR/ujNGN+kA2BPqvf7nc82pXhwIo33eLntI1n9/5SxdZt4hcDeunBqRRtKGpNzpn3w= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=dIqeT/RV; arc=none smtp.client-ip=148.251.105.195 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1785514794; bh=L/eUqdDm7UuQMmbOXx6a5bJ0OkNkDIn5Lw3Or7I74pU=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=dIqeT/RVllJz/7qaln20HJFcI90jmsuAKhJctgIhOBDJvIgVVCPtn6BJc0pyc5zlS oDX+JxNSuEKzuNTvBVDUvvpFoI1lWQx4eGLjvlAOqfSNVt8myhCzwl2qGbbWRC/W6w wVdBkWK8x4aXU2wIF/IUhvJN2R7zMqY30mcgowJC5ksLljQa4B5AaYb/uj00xnxfHW 1DHzzARKZaI8fJKvSbkPZhdmVm+3Do/r0z0gDlyqkJOLb1Nx1OEMGzAXVx/JWOIjx6 zTqtmMsv/1i+pqNUpU1cax0bs941O5VMQtscio7skvARqmKHYSLSjq25Fxo322Cjnr axrbJmuNhIYdg== Received: from localhost (unknown [100.64.0.241]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange secp256r1 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: cristicc) by bali.collaboradmins.com (Postfix) with ESMTPSA id 8DCD817E0916; Fri, 31 Jul 2026 18:19:54 +0200 (CEST) From: Cristian Ciocaltea Date: Fri, 31 Jul 2026 19:20:03 +0300 Subject: [PATCH v10 56/69] drm/tests: edid: Add 4K@60Hz EDID with 600MHz TMDS Precedence: bulk X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20260731-dw-hdmi-qp-scramb-v10-56-294364b2cf15@collabora.com> References: <20260731-dw-hdmi-qp-scramb-v10-0-294364b2cf15@collabora.com> In-Reply-To: <20260731-dw-hdmi-qp-scramb-v10-0-294364b2cf15@collabora.com> To: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Luca Ceresoli , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Chen-Yu Tsai , Samuel Holland , Dave Stevenson , =?utf-8?q?Ma=C3=ADra_Canal?= , Raspberry Pi Kernel Maintenance , Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Andy Yan , Algea Cao , Daniel Stone , Liu Ying , Phong LE Cc: kernel@collabora.com, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-rockchip@lists.infradead.org X-Mailer: b4 0.15.2 X-Rspamd-Server: rspamd-worker-8404 X-Spamd-Result: default: False [-2.16 / 15.00]; BAYES_HAM(-5.50)[100.00%]; RBL_SENDERSCORE(2.00)[104.64.211.4:from]; SUSPICIOUS_RECIPS(1.50)[]; MAILLIST(-0.15)[generic]; MIME_GOOD(-0.10)[text/plain]; BAD_REP_POLICIES(0.10)[]; HAS_LIST_UNSUB(-0.01)[]; DBL_PROHIBIT(0.00)[0.0.0.30:email]; TAGGED_RCPT(0.00)[]; PRECEDENCE_BULK(0.00)[]; RCPT_COUNT_TWELVE(0.00)[30]; DBL_BLOCKED_OPENRESOLVER(0.00)[collabora.com:email,collabora.com:dkim,0.0.0.60:email,sin.lore.kernel.org:rdns,sin.lore.kernel.org:helo]; FROM_HAS_DN(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_COUNT_FIVE(0.00)[5]; R_DKIM_ALLOW(0.00)[collabora.com:s=mail]; FROM_NEQ_ENVFROM(0.00)[cristian.ciocaltea@collabora.com,linux-sunxi@lists.linux.dev]; DMARC_POLICY_ALLOW(0.00)[collabora.com,none]; FREEMAIL_TO(0.00)[intel.com,linaro.org,kernel.org,ideasonboard.com,kwiboo.se,gmail.com,bootlin.com,linux.intel.com,suse.de,ffwll.ch,sholland.org,raspberrypi.com,igalia.com,rock-chips.com,sntech.de,collabora.com,nxp.com,baylibre.com]; DKIM_TRACE(0.00)[collabora.com:+]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(0.00)[+ip4:104.64.211.4]; FORGED_SENDER_MAILLIST(0.00)[]; FORGED_RECIPIENTS_MAILLIST(0.00)[]; RCVD_TLS_LAST(0.00)[]; ARC_ALLOW(0.00)[subspace.kernel.org:s=arc-20240116:i=1]; MIME_TRACE(0.00)[0:+]; TAGGED_FROM(0.00)[bounces-24863-noreply=patchwork.local]; ASN(0.00)[asn:63949, ipnet:104.64.192.0/19, country:SG]; RCVD_VIA_SMTP_AUTH(0.00)[] X-Rspamd-Queue-Id: A9BE51C22FA X-MORS-Enabled: yes X-MORS-DOMAIN: patchwork.local X-MORS-HOSTING: hosting172546 X-MORS-USER: hosting172546 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= Add a new test EDID advertising the following capabilities: Max resolution: 3840x2160@60Hz with RGB, YUV444, YUV422, YUV420 Max BPC: 16 Max TMDS clock: 600 MHz This is needed to exercise the new HDMI infrastructure that decides whether scrambling needs to be enabled for a given display mode and to validate that high-rate modes are properly rejected/accepted depending on the source/sink scrambling capability. The EDID is derived from test_edid_hdmi_4k_rgb_yuv420_dc_max_340mhz with the following changes: - Upgraded the first DTD from 3840x2160@30 (297 MHz) to 3840x2160@60 (594 MHz). The H/V totals (4400x2250) and porches already match the HDMI 2.0 4K@60Hz standard timing, so only the pixel clock had to be bumped. - Widened Display Range Limits descriptor to cover the new timing, i.e. 24-140 kHz H, max dotclock 600 MHz. - Updated CTA-861 Video Data Block to advertise VIC 97 (4K@60Hz) instead of VIC 95 (4k30). - Bumped HF-VSDB Max TMDS Character Rate to 600 MHz, keeping SCDC_Present set so that the sink advertises scrambling support. - Cleared HDMI VSDB Max TMDS clock byte, as required by HDMI 2.0 when the HF-VSDB declares a Max TMDS Character Rate above 340 MHz. - Provided a Video Capability Data Block advertising selectable RGB and YCC quantization range plus underscan for IT/CE formats; also set the 'IT Video Formats Underscanned' bit in the CTA-861 extension header to match. - Aligned base block image size with the DTD (160x90 cm) and replaced the bogus 'Week of Manufacture = 0xff' with the Model Year code, both fixing inherited EDID conformity warnings. - Dropped the empty YCbCr 4:2:0 Video Data Block inherited from the parent EDID, which is flagged as a failure by edid-decode v1.33.0 Signed-off-by: Cristian Ciocaltea --- drivers/gpu/drm/tests/drm_kunit_edid.c | 129 +++++++++++++++++++++++++++++++++ drivers/gpu/drm/tests/drm_kunit_edid.h | 1 + 2 files changed, 130 insertions(+) diff --git a/drivers/gpu/drm/tests/drm_kunit_edid.c b/drivers/gpu/drm/tests/drm_kunit_edid.c index c807ae0d9faa..673a0ea8c2ae 100644 --- a/drivers/gpu/drm/tests/drm_kunit_edid.c +++ b/drivers/gpu/drm/tests/drm_kunit_edid.c @@ -990,6 +990,135 @@ const unsigned char test_edid_hdmi_4k_rgb_yuv420_dc_max_340mhz[] = { }; EXPORT_SYMBOL(test_edid_hdmi_4k_rgb_yuv420_dc_max_340mhz); +/* + * Max resolution: 3840x2160@60Hz with RGB, YUV444, YUV422, YUV420 + * Max BPC: 16 for all modes + * Max TMDS clock: 600 MHz + * + * edid-decode (hex): + * + * 00 ff ff ff ff ff ff 00 31 d8 34 00 00 00 00 00 + * 00 23 01 03 80 a0 5a 78 0f ee 91 a3 54 4c 99 26 + * 0f 50 54 20 00 00 01 01 01 01 01 01 01 01 01 01 + * 01 01 01 01 01 01 08 e8 00 30 f2 70 5a 80 b0 58 + * 8a 00 40 84 63 00 00 1e 00 00 00 fc 00 54 65 73 + * 74 20 45 44 49 44 0a 20 20 20 00 00 00 fd 00 18 + * 55 18 8c 3c 00 0a 20 20 20 20 20 20 00 00 00 10 + * 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 a9 + * + * 02 03 28 b1 41 61 6c 03 0c 00 10 00 78 00 20 00 + * 00 01 03 6d d8 5d c4 01 78 80 07 00 00 00 00 00 + * 00 e2 00 ca e3 0f 01 00 00 00 00 00 00 00 00 00 + * 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 + * 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 + * 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 + * 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 + * 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 54 + * + * ---------------- + * + * Block 0, Base EDID: + * EDID Structure Version & Revision: 1.3 + * Vendor & Product Identification: + * Manufacturer: LNX + * Model: 52 + * Made in: 2025 + * Basic Display Parameters & Features: + * Digital display + * Maximum image size: 160 cm x 90 cm + * Gamma: 2.20 + * RGB color display + * Default (sRGB) color space is primary color space + * First detailed timing is the preferred timing + * Supports GTF timings within operating range + * Color Characteristics: + * Red : 0.6396, 0.3300 + * Green: 0.2998, 0.5996 + * Blue : 0.1503, 0.0595 + * White: 0.3125, 0.3291 + * Established Timings I & II: + * DMT 0x04: 640x480 59.940476 Hz 4:3 31.469 kHz 25.175000 MHz + * Standard Timings: none + * Detailed Timing Descriptors: + * DTD 1: 3840x2160 60.000000 Hz 16:9 135.000 kHz 594.000000 MHz (1600 mm x 900 mm) + * Hfront 176 Hsync 88 Hback 296 Hpol P + * Vfront 8 Vsync 10 Vback 72 Vpol P + * Display Product Name: 'Test EDID' + * Display Range Limits: + * Monitor ranges (GTF): 24-85 Hz V, 24-140 kHz H, max dotclock 600 MHz + * Dummy Descriptor: + * Extension blocks: 1 + * Checksum: 0xa9 + * + * ---------------- + * + * Block 1, CTA-861 Extension Block: + * Revision: 3 + * Underscans IT Video Formats by default + * Supports YCbCr 4:4:4 + * Supports YCbCr 4:2:2 + * Native detailed modes: 1 + * Video Data Block: + * VIC 97: 3840x2160 60.000000 Hz 16:9 135.000 kHz 594.000000 MHz + * Vendor-Specific Data Block (HDMI), OUI 00-0C-03: + * Source physical address: 1.0.0.0 + * DC_48bit + * DC_36bit + * DC_30bit + * DC_Y444 + * Maximum TMDS clock: 0 MHz + * Extended HDMI video details: + * Vendor-Specific Data Block (HDMI Forum), OUI C4-5D-D8: + * Version: 1 + * Maximum TMDS Character Rate: 600 MHz + * SCDC Present + * Supports 16-bits/component Deep Color 4:2:0 Pixel Encoding + * Supports 12-bits/component Deep Color 4:2:0 Pixel Encoding + * Supports 10-bits/component Deep Color 4:2:0 Pixel Encoding + * VRRmin: 0 Hz + * VRRmax: 0 Hz + * Video Capability Data Block: + * YCbCr quantization: Selectable (via AVI YQ) + * RGB quantization: Selectable (via AVI Q) + * PT scan behavior: No Data + * IT scan behavior: Always Underscanned + * CE scan behavior: Always Underscanned + * YCbCr 4:2:0 Capability Map Data Block: + * VIC 97: 3840x2160 60.000000 Hz 16:9 135.000 kHz 594.000000 MHz + * Checksum: 0x54 Unused space in Extension Block: 87 bytes + * + * ---------------- + * + * edid-decode 1.33.0 + * + * EDID conformity: PASS + */ +const unsigned char test_edid_hdmi_4k_rgb_yuv420_dc_max_600mhz[] = { + 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x31, 0xd8, 0x34, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x23, 0x01, 0x03, 0x80, 0xa0, 0x5a, 0x78, + 0x0f, 0xee, 0x91, 0xa3, 0x54, 0x4c, 0x99, 0x26, 0x0f, 0x50, 0x54, 0x20, + 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x08, 0xe8, 0x00, 0x30, 0xf2, 0x70, + 0x5a, 0x80, 0xb0, 0x58, 0x8a, 0x00, 0x40, 0x84, 0x63, 0x00, 0x00, 0x1e, + 0x00, 0x00, 0x00, 0xfc, 0x00, 0x54, 0x65, 0x73, 0x74, 0x20, 0x45, 0x44, + 0x49, 0x44, 0x0a, 0x20, 0x20, 0x20, 0x00, 0x00, 0x00, 0xfd, 0x00, 0x18, + 0x55, 0x18, 0x8c, 0x3c, 0x00, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xa9, 0x02, 0x03, 0x28, 0xb1, + 0x41, 0x61, 0x6c, 0x03, 0x0c, 0x00, 0x10, 0x00, 0x78, 0x00, 0x20, 0x00, + 0x00, 0x01, 0x03, 0x6d, 0xd8, 0x5d, 0xc4, 0x01, 0x78, 0x80, 0x07, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xe2, 0x00, 0xca, 0xe3, 0x0f, 0x01, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x54, +}; +EXPORT_SYMBOL(test_edid_hdmi_4k_rgb_yuv420_dc_max_600mhz); + MODULE_AUTHOR("Maxime Ripard "); MODULE_DESCRIPTION("EDID Definitions for KUnit tests"); MODULE_LICENSE("GPL"); diff --git a/drivers/gpu/drm/tests/drm_kunit_edid.h b/drivers/gpu/drm/tests/drm_kunit_edid.h index 28b4df93a555..fb5b0295e35e 100644 --- a/drivers/gpu/drm/tests/drm_kunit_edid.h +++ b/drivers/gpu/drm/tests/drm_kunit_edid.h @@ -12,5 +12,6 @@ extern const unsigned char test_edid_hdmi_1080p_rgb_yuv_dc_max_200mhz[256]; extern const unsigned char test_edid_hdmi_1080p_rgb_yuv_dc_max_340mhz[256]; extern const unsigned char test_edid_hdmi_1080p_rgb_yuv_4k_yuv420_dc_max_200mhz[256]; extern const unsigned char test_edid_hdmi_4k_rgb_yuv420_dc_max_340mhz[256]; +extern const unsigned char test_edid_hdmi_4k_rgb_yuv420_dc_max_600mhz[256]; #endif // DRM_KUNIT_EDID_H_ From patchwork Fri Jul 31 16:20:04 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Ciocaltea X-Patchwork-Id: 2872 Return-Path: X-Original-To: noreply@patchwork.local Delivered-To: noreply@patchwork.local Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114]) by mxe881.netcup.net (Postfix) with ESMTPS id 549A41C2304 for ; Fri, 31 Jul 2026 18:43:48 +0200 (CEST) Authentication-Results: mxe881; dkim=pass header.d=collabora.com; spf=pass (sender IP is 172.105.105.114) smtp.mailfrom=linux-sunxi+bounces-24866-noreply=patchwork.local@lists.linux.dev smtp.helo=tor.lore.kernel.org Received-SPF: pass (mxe881: domain of lists.linux.dev designates 172.105.105.114 as permitted sender) client-ip=172.105.105.114; envelope-from=linux-sunxi+bounces-24866-noreply=patchwork.local@lists.linux.dev; helo=tor.lore.kernel.org; Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by tor.lore.kernel.org (Postfix) with ESMTP id 8866230DB230 for ; Fri, 31 Jul 2026 16:26:11 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 273C846D2A6; Fri, 31 Jul 2026 16:20:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="SpA7qPM+" X-Original-To: linux-sunxi@lists.linux.dev Received: from bali.collaboradmins.com (bali.collaboradmins.com [148.251.105.195]) (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 9F1EA46AA73 for ; Fri, 31 Jul 2026 16:20:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.251.105.195 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785514813; cv=none; b=X+3u0PO2B7ItY3s3Nt1mtV5HXj0tSXTK+Km2DEkKXPbnF/5FVHwbG/Y8dMYc7N7c5U2areLU6uKXow1Am4Smdq/ZSAtPW6ZrkQSzw8bELLathg4gRondm9KFt/nN+jLCyJxiERg9DFNzmUVBhQgLFHXktFTDbngLySZOOR7bCBo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785514813; c=relaxed/simple; bh=9crytyeEMmKLDIScG8WR6xIWixXj3o7HvkGk8fyfNBE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=MMOd5/VZ3EcCZb3/bzD/nyTBWIg+iOR7kS3qzqehBB98aSrw5yWaBqcumEnB+uIfK1zFiOnY8bB3kBJaowfN4XNeqjBvBC/G0T3w/mOmaY37U5ycC3tfQqlVK/JFSdyZpdmVmYWd3C9y3jke/9B2kkvvzlQUf8f10/FPLVz+s/Q= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=SpA7qPM+; arc=none smtp.client-ip=148.251.105.195 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1785514795; bh=9crytyeEMmKLDIScG8WR6xIWixXj3o7HvkGk8fyfNBE=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=SpA7qPM+BxKLn0sW0UMffpxYpC/N9aUVYtIliZ1rklCW2a8nFLSRI4o668ngXzNwd 4Tn1Ay0acvvsAwx48rtLE7xUEa+VcxZdk99RP/irJHpZAY9vAiZ6P3IUDvrdpJb5K2 1718JP1WzZf4UY/qULHjay3aQKpRQl00Idv91ZwbCoT4aKFgqF6QPomuj+p8KhbQAY AE2YCIyGdZmAVaBxkAhLgU12KJoABSdTRjxOuZCM8m2N/+ih7PbwJOZ/9mYbmEXjJU zT3EX2nASs2OaTjsLPUMbV915A+1yshL1ByJsiYrwTZux3wZhMVULZz0o+OdcqKjYE sh1wWiBGuYm8A== Received: from localhost (unknown [100.64.0.241]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange secp256r1 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: cristicc) by bali.collaboradmins.com (Postfix) with ESMTPSA id 41E2517E099E; Fri, 31 Jul 2026 18:19:55 +0200 (CEST) From: Cristian Ciocaltea Date: Fri, 31 Jul 2026 19:20:04 +0300 Subject: [PATCH v10 57/69] drm/tests: edid: Fix conformity for 1080p+4K YUV420 200MHz EDID Precedence: bulk X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20260731-dw-hdmi-qp-scramb-v10-57-294364b2cf15@collabora.com> References: <20260731-dw-hdmi-qp-scramb-v10-0-294364b2cf15@collabora.com> In-Reply-To: <20260731-dw-hdmi-qp-scramb-v10-0-294364b2cf15@collabora.com> To: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Luca Ceresoli , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Chen-Yu Tsai , Samuel Holland , Dave Stevenson , =?utf-8?q?Ma=C3=ADra_Canal?= , Raspberry Pi Kernel Maintenance , Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Andy Yan , Algea Cao , Daniel Stone , Liu Ying , Phong LE Cc: kernel@collabora.com, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-rockchip@lists.infradead.org X-Mailer: b4 0.15.2 X-Rspamd-Server: rspamd-worker-8404 X-Spamd-Result: default: False [-2.16 / 15.00]; BAYES_HAM(-5.50)[100.00%]; RBL_SENDERSCORE(2.00)[172.105.105.114:from]; SUSPICIOUS_RECIPS(1.50)[]; MAILLIST(-0.15)[generic]; BAD_REP_POLICIES(0.10)[]; MIME_GOOD(-0.10)[text/plain]; HAS_LIST_UNSUB(-0.01)[]; RCVD_COUNT_FIVE(0.00)[5]; ARC_ALLOW(0.00)[subspace.kernel.org:s=arc-20240116:i=1]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_TWELVE(0.00)[30]; PRECEDENCE_BULK(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[collabora.com:email,collabora.com:dkim,tor.lore.kernel.org:rdns,tor.lore.kernel.org:helo]; TAGGED_RCPT(0.00)[]; FORGED_SENDER_MAILLIST(0.00)[]; R_DKIM_ALLOW(0.00)[collabora.com:s=mail]; ASN(0.00)[asn:63949, ipnet:172.105.96.0/20, country:SG]; DKIM_TRACE(0.00)[collabora.com:+]; DMARC_POLICY_ALLOW(0.00)[collabora.com,none]; R_SPF_ALLOW(0.00)[+ip4:172.105.105.114:c]; TO_DN_SOME(0.00)[]; FROM_NEQ_ENVFROM(0.00)[cristian.ciocaltea@collabora.com,linux-sunxi@lists.linux.dev]; FREEMAIL_TO(0.00)[intel.com,linaro.org,kernel.org,ideasonboard.com,kwiboo.se,gmail.com,bootlin.com,linux.intel.com,suse.de,ffwll.ch,sholland.org,raspberrypi.com,igalia.com,rock-chips.com,sntech.de,collabora.com,nxp.com,baylibre.com]; MIME_TRACE(0.00)[0:+]; TAGGED_FROM(0.00)[bounces-24866-noreply=patchwork.local]; FORGED_RECIPIENTS_MAILLIST(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[] X-Rspamd-Queue-Id: 549A41C2304 X-MORS-Enabled: yes X-MORS-DOMAIN: patchwork.local X-MORS-HOSTING: hosting172546 X-MORS-USER: hosting172546 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= The test EDID added by commit 58fe1d78605e ("drm/tests: hdmi: Provide EDID supporting 4K@30Hz with YUV420 only") fails 'edid-decode --check' (v1.33.0) with the following issues: Warnings: Block 1, CTA-861 Extension Block: IT Video Formats are overscanned by default, but normally this should be underscanned. YCbCr 4:2:0 Video Data Block: Some YCbCr 4:2:0 timings are invalid for HDMI 2.1 (which requires an RGB timings pixel rate >= 590 MHz). EDID: Base EDID: Some timings are out of range of the Monitor Ranges: Maximum Clock: 297.000 MHz (Monitor: 170.000 MHz) CTA-861: Multiple native progressive timings are defined. Failures: Block 0, Base EDID: Vendor & Product Identification: EDID 1.3 does not support week 0xff. Block 1, CTA-861 Extension Block: Vendor-Specific Data Block (HDMI Forum), OUI C4-5D-D8: Max TMDS rate is > 0 and <= 340 or > 600. YCbCr 4:2:0 Capability Map Data Block: Empty Capability Map. YCbCr 4:2:0 Video Data Block: YCbCr 4:2:0-only VIC 95 is also a regular VIC. Missing VCDB, needed for Set Selectable RGB Quantization to avoid interop issues. EDID: CTA-861: The maximum HDMI TMDS clock is 200000 kHz, but one or more video timings go up to 297000 kHz. Address them while preserving the advertised maximum resolutions, BPC and TMDS clock used by the existing KUnit tests: - Week 0xff is not valid for EDID 1.3; set it to 0x00 so that the Model year field becomes a regular Year of Manufacture. - The HDMI Forum VSDB Max TMDS Character Rate must be 0 when no rate above 340 MHz is supported. The HDMI VSDB still advertises 200 MHz as Max TMDS Clock. - VIC 95 (3840x2160@30Hz) was reported as YUV420-only but was listed in both the regular Video Data Block and the YCbCr 4:2:0 Video Data Block. Drop it from the regular VDB (so it stays advertised in the 4:2:0 VDB only) and remove the now unnecessary empty YCbCr 4:2:0 Capability Map Data Block. - Add a Video Capability Data Block advertising selectable RGB and YCC quantization range plus underscan for IT/CE formats; also set the 'IT Video Formats Underscanned' bit in the CTA-861 extension header to match. - Bump the Display Range Limits max pixel clock from 170 MHz to 300 MHz so it covers the 297 MHz pixel rate of VIC 95. - Drop the 'native' flag from VIC 16 in the Video Data Block so it is no longer flagged as a second native progressive timing alongside the preferred DTD. The only remaining warning is HDMI 2.1 related and can be ignored, as it requires that any mode listed in the YCbCr 4:2:0 Video Data Block must have a corresponding RGB pixel clock >= 590 MHz. Signed-off-by: Cristian Ciocaltea --- drivers/gpu/drm/tests/drm_kunit_edid.c | 65 +++++++++++++++++++++------------- 1 file changed, 41 insertions(+), 24 deletions(-) diff --git a/drivers/gpu/drm/tests/drm_kunit_edid.c b/drivers/gpu/drm/tests/drm_kunit_edid.c index 673a0ea8c2ae..4dff28fff796 100644 --- a/drivers/gpu/drm/tests/drm_kunit_edid.c +++ b/drivers/gpu/drm/tests/drm_kunit_edid.c @@ -766,22 +766,22 @@ EXPORT_SYMBOL(test_edid_hdmi_1080p_rgb_yuv_dc_max_340mhz); * edid-decode (hex): * * 00 ff ff ff ff ff ff 00 31 d8 34 00 00 00 00 00 - * ff 23 01 03 80 60 36 78 0f ee 91 a3 54 4c 99 26 + * 00 23 01 03 80 60 36 78 0f ee 91 a3 54 4c 99 26 * 0f 50 54 20 00 00 01 01 01 01 01 01 01 01 01 01 * 01 01 01 01 01 01 02 3a 80 18 71 38 2d 40 58 2c * 45 00 c0 1c 32 00 00 1e 00 00 00 fc 00 54 65 73 * 74 20 45 44 49 44 0a 20 20 20 00 00 00 fd 00 18 - * 55 18 5e 11 00 0a 20 20 20 20 20 20 00 00 00 10 - * 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 bb + * 55 18 5e 1e 00 0a 20 20 20 20 20 20 00 00 00 10 + * 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 ad * - * 02 03 29 31 42 90 5f 6c 03 0c 00 10 00 78 28 20 - * 00 00 01 03 6d d8 5d c4 01 28 80 07 00 00 00 00 - * 00 00 e3 0f 00 00 e2 0e 5f 00 00 00 00 00 00 00 + * 02 03 27 b1 41 10 6c 03 0c 00 10 00 78 28 20 00 + * 00 01 03 6d d8 5d c4 01 00 80 07 00 00 00 00 00 + * 00 e2 00 ca e2 0e 5f 00 00 00 00 00 00 00 00 00 * 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 * 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 * 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 * 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 - * 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ca + * 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 9a * * ---------------- * @@ -790,7 +790,7 @@ EXPORT_SYMBOL(test_edid_hdmi_1080p_rgb_yuv_dc_max_340mhz); * Vendor & Product Identification: * Manufacturer: LNX * Model: 52 - * Model year: 2025 + * Made in: 2025 * Basic Display Parameters & Features: * Digital display * Maximum image size: 96 cm x 54 cm @@ -813,21 +813,21 @@ EXPORT_SYMBOL(test_edid_hdmi_1080p_rgb_yuv_dc_max_340mhz); * Vfront 4 Vsync 5 Vback 36 Vpol P * Display Product Name: 'Test EDID' * Display Range Limits: - * Monitor ranges (GTF): 24-85 Hz V, 24-94 kHz H, max dotclock 170 MHz + * Monitor ranges (GTF): 24-85 Hz V, 24-94 kHz H, max dotclock 300 MHz * Dummy Descriptor: * Extension blocks: 1 - * Checksum: 0xbb + * Checksum: 0xad * * ---------------- * * Block 1, CTA-861 Extension Block: * Revision: 3 + * Underscans IT Video Formats by default * Supports YCbCr 4:4:4 * Supports YCbCr 4:2:2 * Native detailed modes: 1 * Video Data Block: - * VIC 16: 1920x1080 60.000000 Hz 16:9 67.500 kHz 148.500000 MHz (native) - * VIC 95: 3840x2160 30.000000 Hz 16:9 67.500 kHz 297.000000 MHz + * VIC 16: 1920x1080 60.000000 Hz 16:9 67.500 kHz 148.500000 MHz * Vendor-Specific Data Block (HDMI), OUI 00-0C-03: * Source physical address: 1.0.0.0 * DC_48bit @@ -838,40 +838,57 @@ EXPORT_SYMBOL(test_edid_hdmi_1080p_rgb_yuv_dc_max_340mhz); * Extended HDMI video details: * Vendor-Specific Data Block (HDMI Forum), OUI C4-5D-D8: * Version: 1 - * Maximum TMDS Character Rate: 200 MHz * SCDC Present * Supports 16-bits/component Deep Color 4:2:0 Pixel Encoding * Supports 12-bits/component Deep Color 4:2:0 Pixel Encoding * Supports 10-bits/component Deep Color 4:2:0 Pixel Encoding - * YCbCr 4:2:0 Capability Map Data Block: - * Empty Capability Map + * VRRmin: 0 Hz + * VRRmax: 0 Hz + * Video Capability Data Block: + * YCbCr quantization: Selectable (via AVI YQ) + * RGB quantization: Selectable (via AVI Q) + * PT scan behavior: No Data + * IT scan behavior: Always Underscanned + * CE scan behavior: Always Underscanned * YCbCr 4:2:0 Video Data Block: * VIC 95: 3840x2160 30.000000 Hz 16:9 67.500 kHz 297.000000 MHz - * Checksum: 0xca + * Checksum: 0x9a Unused space in Extension Block: 88 bytes + * + * ---------------- + * + * edid-decode 1.33.0 + * + * Warnings: + * + * Block 1, CTA-861 Extension Block: + * YCbCr 4:2:0 Video Data Block: Some YCbCr 4:2:0 timings are invalid for HDMI 2.1 + * (which requires an RGB timings pixel rate >= 590 MHz). + * + * EDID conformity: PASS */ const unsigned char test_edid_hdmi_1080p_rgb_yuv_4k_yuv420_dc_max_200mhz[] = { 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x31, 0xd8, 0x34, 0x00, - 0x00, 0x00, 0x00, 0x00, 0xff, 0x23, 0x01, 0x03, 0x80, 0x60, 0x36, 0x78, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x23, 0x01, 0x03, 0x80, 0x60, 0x36, 0x78, 0x0f, 0xee, 0x91, 0xa3, 0x54, 0x4c, 0x99, 0x26, 0x0f, 0x50, 0x54, 0x20, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x3a, 0x80, 0x18, 0x71, 0x38, 0x2d, 0x40, 0x58, 0x2c, 0x45, 0x00, 0xc0, 0x1c, 0x32, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0xfc, 0x00, 0x54, 0x65, 0x73, 0x74, 0x20, 0x45, 0x44, 0x49, 0x44, 0x0a, 0x20, 0x20, 0x20, 0x00, 0x00, 0x00, 0xfd, 0x00, 0x18, - 0x55, 0x18, 0x5e, 0x11, 0x00, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x55, 0x18, 0x5e, 0x1e, 0x00, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xbb, 0x02, 0x03, 0x29, 0x31, - 0x42, 0x90, 0x5f, 0x6c, 0x03, 0x0c, 0x00, 0x10, 0x00, 0x78, 0x28, 0x20, - 0x00, 0x00, 0x01, 0x03, 0x6d, 0xd8, 0x5d, 0xc4, 0x01, 0x28, 0x80, 0x07, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe3, 0x0f, 0x00, 0x00, 0xe2, 0x0e, - 0x5f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xad, 0x02, 0x03, 0x27, 0xb1, + 0x41, 0x10, 0x6c, 0x03, 0x0c, 0x00, 0x10, 0x00, 0x78, 0x28, 0x20, 0x00, + 0x00, 0x01, 0x03, 0x6d, 0xd8, 0x5d, 0xc4, 0x01, 0x00, 0x80, 0x07, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xe2, 0x00, 0xca, 0xe2, 0x0e, 0x5f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0xca + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x9a, }; EXPORT_SYMBOL(test_edid_hdmi_1080p_rgb_yuv_4k_yuv420_dc_max_200mhz); From patchwork Fri Jul 31 16:20:05 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Ciocaltea X-Patchwork-Id: 2843 Return-Path: X-Original-To: noreply@patchwork.local Delivered-To: noreply@patchwork.local Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114]) by mxe881.netcup.net (Postfix) with ESMTPS id E04741C1D58 for ; Fri, 31 Jul 2026 18:35:30 +0200 (CEST) Authentication-Results: mxe881; dkim=pass header.d=collabora.com; spf=pass (sender IP is 172.105.105.114) smtp.mailfrom=linux-sunxi+bounces-24867-noreply=patchwork.local@lists.linux.dev smtp.helo=tor.lore.kernel.org Received-SPF: pass (mxe881: domain of lists.linux.dev designates 172.105.105.114 as permitted sender) client-ip=172.105.105.114; envelope-from=linux-sunxi+bounces-24867-noreply=patchwork.local@lists.linux.dev; helo=tor.lore.kernel.org; Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by tor.lore.kernel.org (Postfix) with ESMTP id 3B7D9319884C for ; Fri, 31 Jul 2026 16:26:06 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2013546A618; Fri, 31 Jul 2026 16:20:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="hMkU4QD+" X-Original-To: linux-sunxi@lists.linux.dev Received: from bali.collaboradmins.com (bali.collaboradmins.com [148.251.105.195]) (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 C2E4C45DF5F for ; Fri, 31 Jul 2026 16:20:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.251.105.195 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785514813; cv=none; b=XGRusErEr7p7816Dmp+FibMO5N7rXr2i2l9/KNQo98WQubMxMlBzO1Y5uGGfzNap9movum0Skm2H99f8ii2qRrjlfs73jgQ3MTycQ1ejA2UfbHGyoyZZg/gpuUtZtjk479CucrwVBQlJjraSYIhJuSvL+bAq0JurS1f+I7JsSEk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785514813; c=relaxed/simple; bh=+vnOPavb35iYOmhQFn+rlvlLoNLZ072zJc+5bQT07Uk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ivx3LRUmcfyNzhks/+dGDDyi6u1sP7BAO7MCSBD8KSe/vpcGlRfO6DOia+k5FILU6Felp7L+L7RgjIPXGrUssHoo4WQ/sDnTeDv4acNruqEqqHWlefYxIk3QXfHFeNXpQLH0HO44uYx7P+g3DrjzxOVYjyiYoH0Fs1Uk6DQ/1MA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=hMkU4QD+; arc=none smtp.client-ip=148.251.105.195 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1785514796; bh=+vnOPavb35iYOmhQFn+rlvlLoNLZ072zJc+5bQT07Uk=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=hMkU4QD+O3UwnonlYRI/WnWqiZ06CLA4Wy59YLnpewwglhrw8GHpEj9KHkvatmHQz hJpEZS4oK+0elzsgZmGxHcgY6GPSStrGZj08N/iSWa2uu5fUt99vmfmsTw0a0ufA3g O6QXg2HjWNswjjTkko8RRjtfIGqNZTgunZ93Gev4wZR4ImJxjEjA6trLuPfeDmbRUK 5p3JL+F7fFOZEdJ4IbD6EjhqvvdlepPtX3hwElMOoHZ4uk6N5cJBLJUWWGzbFNogvp hBeb8x/VPJpWi3N8g2ev1jB2rwqpDKGiHlJ4PwqIZFzOtYV+aVMWPeKSLS2//p3ABt Wj6clecD9reSA== Received: from localhost (unknown [100.64.0.241]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange secp256r1 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: cristicc) by bali.collaboradmins.com (Postfix) with ESMTPSA id EAD9A17E09A0; Fri, 31 Jul 2026 18:19:55 +0200 (CEST) From: Cristian Ciocaltea Date: Fri, 31 Jul 2026 19:20:05 +0300 Subject: [PATCH v10 58/69] drm/tests: edid: Fix conformity for 4K RGB/YUV 340MHz EDID Precedence: bulk X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20260731-dw-hdmi-qp-scramb-v10-58-294364b2cf15@collabora.com> References: <20260731-dw-hdmi-qp-scramb-v10-0-294364b2cf15@collabora.com> In-Reply-To: <20260731-dw-hdmi-qp-scramb-v10-0-294364b2cf15@collabora.com> To: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Luca Ceresoli , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Chen-Yu Tsai , Samuel Holland , Dave Stevenson , =?utf-8?q?Ma=C3=ADra_Canal?= , Raspberry Pi Kernel Maintenance , Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Andy Yan , Algea Cao , Daniel Stone , Liu Ying , Phong LE Cc: kernel@collabora.com, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-rockchip@lists.infradead.org X-Mailer: b4 0.15.2 X-Rspamd-Server: rspamd-worker-8404 X-Spamd-Result: default: False [-2.16 / 15.00]; BAYES_HAM(-5.50)[100.00%]; RBL_SENDERSCORE(2.00)[172.105.105.114:from]; SUSPICIOUS_RECIPS(1.50)[]; MAILLIST(-0.15)[generic]; BAD_REP_POLICIES(0.10)[]; MIME_GOOD(-0.10)[text/plain]; HAS_LIST_UNSUB(-0.01)[]; MID_RHS_MATCH_FROM(0.00)[]; R_DKIM_ALLOW(0.00)[collabora.com:s=mail]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_TWELVE(0.00)[30]; PRECEDENCE_BULK(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[collabora.com:email,collabora.com:dkim,tor.lore.kernel.org:rdns,tor.lore.kernel.org:helo]; TAGGED_RCPT(0.00)[]; FORGED_SENDER_MAILLIST(0.00)[]; RCVD_COUNT_FIVE(0.00)[5]; ARC_ALLOW(0.00)[subspace.kernel.org:s=arc-20240116:i=1]; DKIM_TRACE(0.00)[collabora.com:+]; DMARC_POLICY_ALLOW(0.00)[collabora.com,none]; R_SPF_ALLOW(0.00)[+ip4:172.105.105.114:c]; TO_DN_SOME(0.00)[]; FROM_NEQ_ENVFROM(0.00)[cristian.ciocaltea@collabora.com,linux-sunxi@lists.linux.dev]; FREEMAIL_TO(0.00)[intel.com,linaro.org,kernel.org,ideasonboard.com,kwiboo.se,gmail.com,bootlin.com,linux.intel.com,suse.de,ffwll.ch,sholland.org,raspberrypi.com,igalia.com,rock-chips.com,sntech.de,collabora.com,nxp.com,baylibre.com]; MIME_TRACE(0.00)[0:+]; TAGGED_FROM(0.00)[bounces-24867-noreply=patchwork.local]; FORGED_RECIPIENTS_MAILLIST(0.00)[]; ASN(0.00)[asn:63949, ipnet:172.105.96.0/20, country:SG]; RCVD_TLS_LAST(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[] X-Rspamd-Queue-Id: E04741C1D58 X-MORS-Enabled: yes X-MORS-DOMAIN: patchwork.local X-MORS-HOSTING: hosting172546 X-MORS-USER: hosting172546 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= The test EDID added by commit 54a5f1c4d5f8 ("drm/tests: hdmi: Provide EDID supporting 4K@30Hz with RGB/YUV") fails 'edid-decode --check' (v1.33.0) with the following issues: Warnings: Block 1, CTA-861 Extension Block: IT Video Formats are overscanned by default, but normally this should be underscanned. YCbCr 4:2:0 Capability Map Data Block: Some YCbCr 4:2:0 timings are invalid for HDMI 2.1 (which requires an RGB timings pixel rate >= 590 MHz). Failures: Block 0, Base EDID: Vendor & Product Identification: EDID 1.3 does not support week 0xff. Detailed Timing Descriptor #1: Mismatch of image size 1600x900 mm vs display size 960x540 mm. Block 1, CTA-861 Extension Block: Vendor-Specific Data Block (HDMI Forum), OUI C4-5D-D8: Max TMDS rate is > 0 and <= 340 or > 600. YCbCr 4:2:0 Video Data Block: This Data Block is empty. Missing VCDB, needed for Set Selectable RGB Quantization to avoid interop issues. EDID: Base EDID: The DTD max image size is 1600x900mm, which is larger than the display size 960.0x540.0mm. Address them while preserving the advertised maximum resolution, BPC and TMDS clock used by the existing KUnit tests: - Week 0xff is not valid for EDID 1.3; set it to 0x00 so that the Model year field becomes a regular Year of Manufacture. - Align the DTD image size with the Basic Display Parameters maximum image size (96 cm x 54 cm). - The HDMI Forum VSDB Max TMDS Character Rate must be 0 when no rate above 340 MHz is supported. The HDMI VSDB still advertises 340 MHz as Max TMDS Clock. - Drop the empty YCbCr 4:2:0 Video Data Block. VIC 95 (3840x2160@30Hz) remains advertised as YUV420-capable via the YCbCr 4:2:0 Capability Map Data Block, which references the corresponding entry in the regular Video Data Block. - Add a Video Capability Data Block advertising selectable RGB and YCC quantization range plus underscan for IT/CE formats; also set the 'IT Video Formats Underscanned' bit in the CTA-861 extension header to match. The only remaining warning is HDMI 2.1 related and can be ignored, as it requires that any mode listed in the YCbCr 4:2:0 Video Data Block must have a corresponding RGB pixel clock >= 590 MHz. Signed-off-by: Cristian Ciocaltea --- drivers/gpu/drm/tests/drm_kunit_edid.c | 57 ++++++++++++++++++++++------------ 1 file changed, 38 insertions(+), 19 deletions(-) diff --git a/drivers/gpu/drm/tests/drm_kunit_edid.c b/drivers/gpu/drm/tests/drm_kunit_edid.c index 4dff28fff796..a6c5e8d6077a 100644 --- a/drivers/gpu/drm/tests/drm_kunit_edid.c +++ b/drivers/gpu/drm/tests/drm_kunit_edid.c @@ -900,22 +900,22 @@ EXPORT_SYMBOL(test_edid_hdmi_1080p_rgb_yuv_4k_yuv420_dc_max_200mhz); * edid-decode (hex): * * 00 ff ff ff ff ff ff 00 31 d8 34 00 00 00 00 00 - * ff 23 01 03 80 60 36 78 0f ee 91 a3 54 4c 99 26 + * 00 23 01 03 80 60 36 78 0f ee 91 a3 54 4c 99 26 * 0f 50 54 20 00 00 01 01 01 01 01 01 01 01 01 01 * 01 01 01 01 01 01 04 74 00 30 f2 70 5a 80 b0 58 - * 8a 00 40 84 63 00 00 1e 00 00 00 fc 00 54 65 73 + * 8a 00 c0 1c 32 00 00 1e 00 00 00 fc 00 54 65 73 * 74 20 45 44 49 44 0a 20 20 20 00 00 00 fd 00 18 * 55 18 5e 22 00 0a 20 20 20 20 20 20 00 00 00 10 - * 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 ce + * 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 e6 * - * 02 03 27 31 41 5f 6c 03 0c 00 10 00 78 44 20 00 - * 00 01 03 6d d8 5d c4 01 44 80 07 00 00 00 00 00 - * 00 e3 0f 01 00 e1 0e 00 00 00 00 00 00 00 00 00 + * 02 03 28 b1 41 5f 6c 03 0c 00 10 00 78 44 20 00 + * 00 01 03 6d d8 5d c4 01 00 80 07 00 00 00 00 00 + * 00 e2 00 ca e3 0f 01 00 00 00 00 00 00 00 00 00 * 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 * 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 * 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 * 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 - * 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 84 + * 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 8a * * ---------------- * @@ -924,7 +924,7 @@ EXPORT_SYMBOL(test_edid_hdmi_1080p_rgb_yuv_4k_yuv420_dc_max_200mhz); * Vendor & Product Identification: * Manufacturer: LNX * Model: 52 - * Model year: 2025 + * Made in: 2025 * Basic Display Parameters & Features: * Digital display * Maximum image size: 96 cm x 54 cm @@ -942,7 +942,7 @@ EXPORT_SYMBOL(test_edid_hdmi_1080p_rgb_yuv_4k_yuv420_dc_max_200mhz); * DMT 0x04: 640x480 59.940476 Hz 4:3 31.469 kHz 25.175000 MHz * Standard Timings: none * Detailed Timing Descriptors: - * DTD 1: 3840x2160 30.000000 Hz 16:9 67.500 kHz 297.000000 MHz (1600 mm x 900 mm) + * DTD 1: 3840x2160 30.000000 Hz 16:9 67.500 kHz 297.000000 MHz (960 mm x 540 mm) * Hfront 176 Hsync 88 Hback 296 Hpol P * Vfront 8 Vsync 10 Vback 72 Vpol P * Display Product Name: 'Test EDID' @@ -950,12 +950,13 @@ EXPORT_SYMBOL(test_edid_hdmi_1080p_rgb_yuv_4k_yuv420_dc_max_200mhz); * Monitor ranges (GTF): 24-85 Hz V, 24-94 kHz H, max dotclock 340 MHz * Dummy Descriptor: * Extension blocks: 1 - * Checksum: 0xce + * Checksum: 0xe6 * * ---------------- * * Block 1, CTA-861 Extension Block: * Revision: 3 + * Underscans IT Video Formats by default * Supports YCbCr 4:4:4 * Supports YCbCr 4:2:2 * Native detailed modes: 1 @@ -971,31 +972,49 @@ EXPORT_SYMBOL(test_edid_hdmi_1080p_rgb_yuv_4k_yuv420_dc_max_200mhz); * Extended HDMI video details: * Vendor-Specific Data Block (HDMI Forum), OUI C4-5D-D8: * Version: 1 - * Maximum TMDS Character Rate: 340 MHz * SCDC Present * Supports 16-bits/component Deep Color 4:2:0 Pixel Encoding * Supports 12-bits/component Deep Color 4:2:0 Pixel Encoding * Supports 10-bits/component Deep Color 4:2:0 Pixel Encoding + * VRRmin: 0 Hz + * VRRmax: 0 Hz + * Video Capability Data Block: + * YCbCr quantization: Selectable (via AVI YQ) + * RGB quantization: Selectable (via AVI Q) + * PT scan behavior: No Data + * IT scan behavior: Always Underscanned + * CE scan behavior: Always Underscanned * YCbCr 4:2:0 Capability Map Data Block: * VIC 95: 3840x2160 30.000000 Hz 16:9 67.500 kHz 297.000000 MHz - * YCbCr 4:2:0 Video Data Block: - * Checksum: 0x84 + * Checksum: 0x8a Unused space in Extension Block: 87 bytes + * + * ---------------- + * + * edid-decode 1.33.0 + * + * Warnings: + * + * Block 1, CTA-861 Extension Block: + * YCbCr 4:2:0 Capability Map Data Block: Some YCbCr 4:2:0 timings are invalid for HDMI 2.1 + * (which requires an RGB timings pixel rate >= 590 MHz). + * + * EDID conformity: PASS */ const unsigned char test_edid_hdmi_4k_rgb_yuv420_dc_max_340mhz[] = { 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x31, 0xd8, 0x34, 0x00, - 0x00, 0x00, 0x00, 0x00, 0xff, 0x23, 0x01, 0x03, 0x80, 0x60, 0x36, 0x78, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x23, 0x01, 0x03, 0x80, 0x60, 0x36, 0x78, 0x0f, 0xee, 0x91, 0xa3, 0x54, 0x4c, 0x99, 0x26, 0x0f, 0x50, 0x54, 0x20, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x04, 0x74, 0x00, 0x30, 0xf2, 0x70, - 0x5a, 0x80, 0xb0, 0x58, 0x8a, 0x00, 0x40, 0x84, 0x63, 0x00, 0x00, 0x1e, + 0x5a, 0x80, 0xb0, 0x58, 0x8a, 0x00, 0xc0, 0x1c, 0x32, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0xfc, 0x00, 0x54, 0x65, 0x73, 0x74, 0x20, 0x45, 0x44, 0x49, 0x44, 0x0a, 0x20, 0x20, 0x20, 0x00, 0x00, 0x00, 0xfd, 0x00, 0x18, 0x55, 0x18, 0x5e, 0x22, 0x00, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xce, 0x02, 0x03, 0x27, 0x31, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xe6, 0x02, 0x03, 0x28, 0xb1, 0x41, 0x5f, 0x6c, 0x03, 0x0c, 0x00, 0x10, 0x00, 0x78, 0x44, 0x20, 0x00, - 0x00, 0x01, 0x03, 0x6d, 0xd8, 0x5d, 0xc4, 0x01, 0x44, 0x80, 0x07, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0xe3, 0x0f, 0x01, 0x00, 0xe1, 0x0e, 0x00, + 0x00, 0x01, 0x03, 0x6d, 0xd8, 0x5d, 0xc4, 0x01, 0x00, 0x80, 0x07, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xe2, 0x00, 0xca, 0xe3, 0x0f, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -1003,7 +1022,7 @@ const unsigned char test_edid_hdmi_4k_rgb_yuv420_dc_max_340mhz[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x84 + 0x00, 0x00, 0x00, 0x8a, }; EXPORT_SYMBOL(test_edid_hdmi_4k_rgb_yuv420_dc_max_340mhz); From patchwork Fri Jul 31 16:20:06 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Ciocaltea X-Patchwork-Id: 2841 Return-Path: X-Original-To: noreply@patchwork.local Delivered-To: noreply@patchwork.local Received: from sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74]) by mxe881.netcup.net (Postfix) with ESMTPS id AEE581C1D58 for ; Fri, 31 Jul 2026 18:35:19 +0200 (CEST) Authentication-Results: mxe881; dkim=pass header.d=collabora.com; spf=pass (sender IP is 172.232.135.74) smtp.mailfrom=linux-sunxi+bounces-24868-noreply=patchwork.local@lists.linux.dev smtp.helo=sto.lore.kernel.org Received-SPF: pass (mxe881: domain of lists.linux.dev designates 172.232.135.74 as permitted sender) client-ip=172.232.135.74; envelope-from=linux-sunxi+bounces-24868-noreply=patchwork.local@lists.linux.dev; helo=sto.lore.kernel.org; Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by sto.lore.kernel.org (Postfix) with ESMTP id DB9BB31315FD for ; Fri, 31 Jul 2026 16:26:10 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3354746D2A9; Fri, 31 Jul 2026 16:20:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="IIwuyw5B" X-Original-To: linux-sunxi@lists.linux.dev Received: from bali.collaboradmins.com (bali.collaboradmins.com [148.251.105.195]) (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 4669346AA92 for ; Fri, 31 Jul 2026 16:20:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.251.105.195 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785514813; cv=none; b=o9xfNhvW7IX7ou2/2sHHlm1nBpdAcgtzQ94gdJ0QZv29T6TdKMZLNwFkd0D+mUcm/yk1RXVj7HYOPfoXcA5k7ZqY+gVOHZMbqcFcJuNyo2RgMNYDwfwVFhuQ35vI5WGH6cwwkwks+zto12GVvymQwK3uXFvDJB3eDFtgqI84EJg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785514813; c=relaxed/simple; bh=9+B0lSYbOtT/mNa8n8pzlwF+N7/unRvesgf3I/R8mRg=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=FMHxgjcMD0QbxKop/OoN2nxThvJ+zQz4gjhRz8f+GcRMUoyjS79NeEOYChIvBIs61DVR8MraFwkAVJEwEawuw5/0K2jbmIhZRUDjEvAwCRjTu9xacO/ofpUi+NQxSrwff7m6J/7nui6rz4HcWqPNvG8e1LIyqWve8Vrq9vKuxBs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=IIwuyw5B; arc=none smtp.client-ip=148.251.105.195 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1785514796; bh=9+B0lSYbOtT/mNa8n8pzlwF+N7/unRvesgf3I/R8mRg=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=IIwuyw5BA8jWEPG+nGLqT+NOCEphHcfyU5Bv02DsdqmgRqmnlqBRA5WyVs4xzvgK9 XQ1FXf4obJSaq/BTvb9wd4aKLbCyuqZG8CgM/+kN9ipMDhdOaxlS4+uMBxuflW08ll 55QCZEvTLx+Mk7PSZTwTvMGUPKiIVPwS6D7gFAViwqTGrS1bIGPxS07eiJcOb1R2Zv TngoOaQTi4RbDv5bJTO4V+NRRxZ5/IkThkb0SpeS7d1zhVZI17VC99xm2PRN1eB8tc 18tFrJTsU6x7M7KDvdDETwUGX5lFRVLUCTeAms24dq1+taOMlrPTVV4WEhhsaHO2D9 fqm6ew1wZLoyA== Received: from localhost (unknown [100.64.0.241]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange secp256r1 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: cristicc) by bali.collaboradmins.com (Postfix) with ESMTPSA id AB5A617E09A3; Fri, 31 Jul 2026 18:19:56 +0200 (CEST) From: Cristian Ciocaltea Date: Fri, 31 Jul 2026 19:20:06 +0300 Subject: [PATCH v10 59/69] drm/tests: bridge: Set supported HDMI version Precedence: bulk X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20260731-dw-hdmi-qp-scramb-v10-59-294364b2cf15@collabora.com> References: <20260731-dw-hdmi-qp-scramb-v10-0-294364b2cf15@collabora.com> In-Reply-To: <20260731-dw-hdmi-qp-scramb-v10-0-294364b2cf15@collabora.com> To: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Luca Ceresoli , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Chen-Yu Tsai , Samuel Holland , Dave Stevenson , =?utf-8?q?Ma=C3=ADra_Canal?= , Raspberry Pi Kernel Maintenance , Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Andy Yan , Algea Cao , Daniel Stone , Liu Ying , Phong LE Cc: kernel@collabora.com, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-rockchip@lists.infradead.org X-Mailer: b4 0.15.2 X-Rspamd-Server: rspamd-worker-8404 X-Spamd-Result: default: False [-2.16 / 15.00]; BAYES_HAM(-5.50)[100.00%]; RBL_SENDERSCORE(2.00)[172.232.135.74:from]; SUSPICIOUS_RECIPS(1.50)[]; MAILLIST(-0.15)[generic]; BAD_REP_POLICIES(0.10)[]; MIME_GOOD(-0.10)[text/plain]; HAS_LIST_UNSUB(-0.01)[]; RCVD_COUNT_FIVE(0.00)[5]; ARC_ALLOW(0.00)[subspace.kernel.org:s=arc-20240116:i=1]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_TWELVE(0.00)[30]; PRECEDENCE_BULK(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[collabora.com:email,collabora.com:dkim,sto.lore.kernel.org:rdns,sto.lore.kernel.org:helo]; TAGGED_RCPT(0.00)[]; FORGED_SENDER_MAILLIST(0.00)[]; R_DKIM_ALLOW(0.00)[collabora.com:s=mail]; ASN(0.00)[asn:63949, ipnet:172.232.128.0/19, country:SG]; DKIM_TRACE(0.00)[collabora.com:+]; DMARC_POLICY_ALLOW(0.00)[collabora.com,none]; R_SPF_ALLOW(0.00)[+ip4:172.232.135.74:c]; TO_DN_SOME(0.00)[]; FROM_NEQ_ENVFROM(0.00)[cristian.ciocaltea@collabora.com,linux-sunxi@lists.linux.dev]; FREEMAIL_TO(0.00)[intel.com,linaro.org,kernel.org,ideasonboard.com,kwiboo.se,gmail.com,bootlin.com,linux.intel.com,suse.de,ffwll.ch,sholland.org,raspberrypi.com,igalia.com,rock-chips.com,sntech.de,collabora.com,nxp.com,baylibre.com]; MIME_TRACE(0.00)[0:+]; TAGGED_FROM(0.00)[bounces-24868-noreply=patchwork.local]; FORGED_RECIPIENTS_MAILLIST(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[] X-Rspamd-Queue-Id: AEE581C1D58 X-MORS-Enabled: yes X-MORS-DOMAIN: patchwork.local X-MORS-HOSTING: hosting172546 X-MORS-USER: hosting172546 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= Bridges using DRM_BRIDGE_OP_HDMI are now expected to also provide a supported HDMI version. This is not yet enforced, but will become mandatory once the migration to the new HDMI connector initialization API is completed. Advertise HDMI 1.4 as the default for the test bridges, since that is the highest version that does not require additional initialization data. This also avoids implying support for HDMI capabilities they do not currently model. Signed-off-by: Cristian Ciocaltea --- drivers/gpu/drm/tests/drm_bridge_test.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/tests/drm_bridge_test.c b/drivers/gpu/drm/tests/drm_bridge_test.c index 15583ade8494..a445f71c31b8 100644 --- a/drivers/gpu/drm/tests/drm_bridge_test.c +++ b/drivers/gpu/drm/tests/drm_bridge_test.c @@ -497,6 +497,7 @@ drm_test_bridge_chain_init(struct kunit *test, unsigned int num_bridges, bridge->type = DRM_MODE_CONNECTOR_HDMIA; bridge->vendor = "LNX"; bridge->product = "KUnit"; + bridge->supported_hdmi_ver = HDMI_VERSION_1_4; bridge->supported_formats = (BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444) | BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR444) | BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR422) | @@ -597,6 +598,7 @@ drm_test_bridge_hdmi_init(struct kunit *test, const struct drm_bridge_funcs *fun bridge->ops |= DRM_BRIDGE_OP_HDMI; bridge->vendor = "LNX"; bridge->product = "KUnit"; + bridge->supported_hdmi_ver = HDMI_VERSION_1_4; ret = drm_kunit_bridge_add(test, bridge); if (ret) From patchwork Fri Jul 31 16:20:07 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Ciocaltea X-Patchwork-Id: 2842 Return-Path: X-Original-To: noreply@patchwork.local Delivered-To: noreply@patchwork.local Received: from sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74]) by mxe881.netcup.net (Postfix) with ESMTPS id ADCA31C20B3 for ; Fri, 31 Jul 2026 18:35:22 +0200 (CEST) Authentication-Results: mxe881; dkim=pass header.d=collabora.com; spf=pass (sender IP is 172.232.135.74) smtp.mailfrom=linux-sunxi+bounces-24871-noreply=patchwork.local@lists.linux.dev smtp.helo=sto.lore.kernel.org Received-SPF: pass (mxe881: domain of lists.linux.dev designates 172.232.135.74 as permitted sender) client-ip=172.232.135.74; envelope-from=linux-sunxi+bounces-24871-noreply=patchwork.local@lists.linux.dev; helo=sto.lore.kernel.org; Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by sto.lore.kernel.org (Postfix) with ESMTP id 6B7FD30743E8 for ; Fri, 31 Jul 2026 16:26:16 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D18AA46D2DD; Fri, 31 Jul 2026 16:20:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="pV7jxqqV" X-Original-To: linux-sunxi@lists.linux.dev Received: from bali.collaboradmins.com (bali.collaboradmins.com [148.251.105.195]) (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 4242F46AA97 for ; Fri, 31 Jul 2026 16:20:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.251.105.195 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785514814; cv=none; b=LkH08BJSxgoIYShQ4thuFBzraN3RW6cI551yatYkFR55PCmWE6S8xcrZQHpXPcYfr+gtIAMyHQ2OtfCx21de9vGD2fDbqSMgfI1FDXA2K6m0dM/9kbFCB2NPmub+QKSq00pFMWqIiDxfg6Y6bG316w9/yyOyzNYq9K9VSYqJ3J0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785514814; c=relaxed/simple; bh=b8b0g0mwg6DkAdX6Utag8Oehr2doi4sirDk5lkqvxCs=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Ho43S7e2Wl5X88EI0WDxhpJu7J1v81+XeQbtWb8Yiu518RFw5rtJpx+Pej/NN8qF55tQGZ7ytz+19XXzoM9YmYZqr6IeMGoNujTiHDZ3GoEcZ8TcuRGQyE0FKD3r7I+oKnDsKEDObrONXciPBvc1EqXYIWMn0Ys//OtX9W/TWpU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=pV7jxqqV; arc=none smtp.client-ip=148.251.105.195 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1785514797; bh=b8b0g0mwg6DkAdX6Utag8Oehr2doi4sirDk5lkqvxCs=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=pV7jxqqVl2oaCYn0DF6R5tiW48MSkpXK6SgQ3gB5CmULbdz71JgKzLXx+rLya8IE1 GSRSjMTIEJ83kjXi5plK4YN61xUIhxqvt3noNrF5NNgnNCps0vndkSbMiBHB/cBY/z w0zKlc5qqOexJ0G0/fQQRbiNF6+lY4eKmSvR2URheNu3Wa2D39g8/UbSG1ij+P2w1T XZAGw9DymjNXCtvYJyVH4+WQ2RNd8oZ6eb/Vcw/UPPLsqA/WgU8aL10NM0lEqSslMk ah1GdHGDv3k0nDbb73ukRZg935SPIwwehBorvLO8Z0irUtB4pPqPQv/I8eOfABVQm4 OHEDu2Hhq1FYQ== Received: from localhost (unknown [100.64.0.241]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange secp256r1 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: cristicc) by bali.collaboradmins.com (Postfix) with ESMTPSA id 626CE17E09A8; Fri, 31 Jul 2026 18:19:57 +0200 (CEST) From: Cristian Ciocaltea Date: Fri, 31 Jul 2026 19:20:07 +0300 Subject: [PATCH v10 60/69] drm/tests: connector: Convert to drmm_connector_hdmi_init() Precedence: bulk X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20260731-dw-hdmi-qp-scramb-v10-60-294364b2cf15@collabora.com> References: <20260731-dw-hdmi-qp-scramb-v10-0-294364b2cf15@collabora.com> In-Reply-To: <20260731-dw-hdmi-qp-scramb-v10-0-294364b2cf15@collabora.com> To: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Luca Ceresoli , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Chen-Yu Tsai , Samuel Holland , Dave Stevenson , =?utf-8?q?Ma=C3=ADra_Canal?= , Raspberry Pi Kernel Maintenance , Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Andy Yan , Algea Cao , Daniel Stone , Liu Ying , Phong LE Cc: kernel@collabora.com, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-rockchip@lists.infradead.org X-Mailer: b4 0.15.2 X-Rspamd-Server: rspamd-worker-8404 X-Spamd-Result: default: False [-2.16 / 15.00]; BAYES_HAM(-5.50)[100.00%]; RBL_SENDERSCORE(2.00)[172.232.135.74:from]; SUSPICIOUS_RECIPS(1.50)[]; MAILLIST(-0.15)[generic]; BAD_REP_POLICIES(0.10)[]; MIME_GOOD(-0.10)[text/plain]; HAS_LIST_UNSUB(-0.01)[]; RCVD_COUNT_FIVE(0.00)[5]; ARC_ALLOW(0.00)[subspace.kernel.org:s=arc-20240116:i=1]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_TWELVE(0.00)[30]; PRECEDENCE_BULK(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[sto.lore.kernel.org:rdns,sto.lore.kernel.org:helo,collabora.com:email,collabora.com:dkim]; TAGGED_RCPT(0.00)[]; FORGED_SENDER_MAILLIST(0.00)[]; R_DKIM_ALLOW(0.00)[collabora.com:s=mail]; ASN(0.00)[asn:63949, ipnet:172.232.128.0/19, country:SG]; DKIM_TRACE(0.00)[collabora.com:+]; DMARC_POLICY_ALLOW(0.00)[collabora.com,none]; R_SPF_ALLOW(0.00)[+ip4:172.232.135.74:c]; TO_DN_SOME(0.00)[]; FROM_NEQ_ENVFROM(0.00)[cristian.ciocaltea@collabora.com,linux-sunxi@lists.linux.dev]; FREEMAIL_TO(0.00)[intel.com,linaro.org,kernel.org,ideasonboard.com,kwiboo.se,gmail.com,bootlin.com,linux.intel.com,suse.de,ffwll.ch,sholland.org,raspberrypi.com,igalia.com,rock-chips.com,sntech.de,collabora.com,nxp.com,baylibre.com]; MIME_TRACE(0.00)[0:+]; TAGGED_FROM(0.00)[bounces-24871-noreply=patchwork.local]; FORGED_RECIPIENTS_MAILLIST(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[] X-Rspamd-Queue-Id: ADCA31C20B3 X-MORS-Enabled: yes X-MORS-DOMAIN: patchwork.local X-MORS-HOSTING: hosting172546 X-MORS-USER: hosting172546 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= Switch tests over to the new drmm_connector_hdmi_init() signature, where the vendor, product, supported_formats and max_bpc values previously passed as arguments are now provided through struct drm_connector_hdmi_funcs. As a consequence, the tests exercising those values can no longer share the static dummy_hdmi_funcs and need a modified copy of their own. Since the connector retains a pointer to it, such a copy must not be placed on the stack, which is gone by the time the DRM-managed actions release the connector. Keep it in struct drm_connector_init_priv instead: it embeds the DRM device and is only freed via managed.final_kfree, i.e. once drm_dev_release() has run all DRM-managed actions, so its lifetime strictly outlives the connector. Note that a kunit_kzalloc() buffer would not be suitable, as KUnit releases its resources in reverse order, hence one allocated by a test would be freed before the DRM device allocated by the suite .init(). Signed-off-by: Cristian Ciocaltea --- drivers/gpu/drm/tests/drm_connector_test.c | 251 ++++++++++++++--------------- 1 file changed, 119 insertions(+), 132 deletions(-) diff --git a/drivers/gpu/drm/tests/drm_connector_test.c b/drivers/gpu/drm/tests/drm_connector_test.c index 3368aedd4e66..c53ccce21a42 100644 --- a/drivers/gpu/drm/tests/drm_connector_test.c +++ b/drivers/gpu/drm/tests/drm_connector_test.c @@ -23,6 +23,8 @@ struct drm_connector_init_priv { struct drm_device drm; struct drm_connector connector; struct i2c_adapter ddc; + /* Mutable copy of a static instance for test-specific overrides */ + struct drm_connector_hdmi_funcs hdmi_funcs; }; static int accept_infoframe_clear_infoframe(struct drm_connector *connector) @@ -37,6 +39,11 @@ static int accept_infoframe_write_infoframe(struct drm_connector *connector, } static const struct drm_connector_hdmi_funcs dummy_hdmi_funcs = { + .vendor = "Vendor", + .product = "Product", + .supported_hdmi_ver = HDMI_VERSION_1_4, + .supported_formats = BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444), + .max_bpc = 8, .avi = { .clear_infoframe = accept_infoframe_clear_infoframe, .write_infoframe = accept_infoframe_write_infoframe, @@ -669,14 +676,11 @@ static void drm_test_connector_hdmi_init_valid(struct kunit *test) struct drm_connector_init_priv *priv = test->priv; int ret; - ret = drmm_connector_hdmi_ini2(&priv->drm, &priv->connector, - "Vendor", "Product", + ret = drmm_connector_hdmi_init(&priv->drm, &priv->connector, &dummy_funcs, &dummy_hdmi_funcs, DRM_MODE_CONNECTOR_HDMIA, - &priv->ddc, - BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444), - 8); + &priv->ddc); KUNIT_EXPECT_EQ(test, ret, 0); } @@ -689,14 +693,11 @@ static void drm_test_connector_hdmi_init_null_ddc(struct kunit *test) struct drm_connector_init_priv *priv = test->priv; int ret; - ret = drmm_connector_hdmi_ini2(&priv->drm, &priv->connector, - "Vendor", "Product", + ret = drmm_connector_hdmi_init(&priv->drm, &priv->connector, &dummy_funcs, &dummy_hdmi_funcs, DRM_MODE_CONNECTOR_HDMIA, - NULL, - BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444), - 8); + NULL); KUNIT_EXPECT_EQ(test, ret, 0); } @@ -709,14 +710,14 @@ static void drm_test_connector_hdmi_init_null_vendor(struct kunit *test) struct drm_connector_init_priv *priv = test->priv; int ret; - ret = drmm_connector_hdmi_ini2(&priv->drm, &priv->connector, - NULL, "Product", + priv->hdmi_funcs = dummy_hdmi_funcs; + priv->hdmi_funcs.vendor = NULL; + + ret = drmm_connector_hdmi_init(&priv->drm, &priv->connector, &dummy_funcs, - &dummy_hdmi_funcs, + &priv->hdmi_funcs, DRM_MODE_CONNECTOR_HDMIA, - &priv->ddc, - BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444), - 8); + &priv->ddc); KUNIT_EXPECT_LT(test, ret, 0); } @@ -729,14 +730,14 @@ static void drm_test_connector_hdmi_init_null_product(struct kunit *test) struct drm_connector_init_priv *priv = test->priv; int ret; - ret = drmm_connector_hdmi_ini2(&priv->drm, &priv->connector, - "Vendor", NULL, + priv->hdmi_funcs = dummy_hdmi_funcs; + priv->hdmi_funcs.product = NULL; + + ret = drmm_connector_hdmi_init(&priv->drm, &priv->connector, &dummy_funcs, - &dummy_hdmi_funcs, + &priv->hdmi_funcs, DRM_MODE_CONNECTOR_HDMIA, - &priv->ddc, - BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444), - 8); + &priv->ddc); KUNIT_EXPECT_LT(test, ret, 0); } @@ -750,19 +751,19 @@ static void drm_test_connector_hdmi_init_product_valid(struct kunit *test) const unsigned char expected_product[DRM_CONNECTOR_HDMI_PRODUCT_LEN] = { 'P', 'r', 'o', 'd', }; - const char *product_name = "Prod"; int ret; - KUNIT_ASSERT_LT(test, strlen(product_name), DRM_CONNECTOR_HDMI_PRODUCT_LEN); + priv->hdmi_funcs = dummy_hdmi_funcs; + priv->hdmi_funcs.product = "Prod"; - ret = drmm_connector_hdmi_ini2(&priv->drm, &priv->connector, - "Vendor", product_name, + KUNIT_ASSERT_LT(test, strlen(priv->hdmi_funcs.product), + DRM_CONNECTOR_HDMI_PRODUCT_LEN); + + ret = drmm_connector_hdmi_init(&priv->drm, &priv->connector, &dummy_funcs, - &dummy_hdmi_funcs, + &priv->hdmi_funcs, DRM_MODE_CONNECTOR_HDMIA, - &priv->ddc, - BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444), - 8); + &priv->ddc); KUNIT_EXPECT_EQ(test, ret, 0); KUNIT_EXPECT_MEMEQ(test, priv->connector.hdmi.product, @@ -783,19 +784,19 @@ static void drm_test_connector_hdmi_init_product_length_exact(struct kunit *test 'P', 'r', 'o', 'd', 'u', 'c', 't', 'P', 'r', }; - const char *product_name = "ProductProductPr"; int ret; - KUNIT_ASSERT_EQ(test, strlen(product_name), DRM_CONNECTOR_HDMI_PRODUCT_LEN); + priv->hdmi_funcs = dummy_hdmi_funcs; + priv->hdmi_funcs.product = "ProductProductPr"; - ret = drmm_connector_hdmi_ini2(&priv->drm, &priv->connector, - "Vendor", product_name, + KUNIT_ASSERT_EQ(test, strlen(priv->hdmi_funcs.product), + DRM_CONNECTOR_HDMI_PRODUCT_LEN); + + ret = drmm_connector_hdmi_init(&priv->drm, &priv->connector, &dummy_funcs, - &dummy_hdmi_funcs, + &priv->hdmi_funcs, DRM_MODE_CONNECTOR_HDMIA, - &priv->ddc, - BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444), - 8); + &priv->ddc); KUNIT_EXPECT_EQ(test, ret, 0); KUNIT_EXPECT_MEMEQ(test, priv->connector.hdmi.product, @@ -810,19 +811,19 @@ static void drm_test_connector_hdmi_init_product_length_exact(struct kunit *test static void drm_test_connector_hdmi_init_product_length_too_long(struct kunit *test) { struct drm_connector_init_priv *priv = test->priv; - const char *product_name = "ProductProductProduct"; int ret; - KUNIT_ASSERT_GT(test, strlen(product_name), DRM_CONNECTOR_HDMI_PRODUCT_LEN); + priv->hdmi_funcs = dummy_hdmi_funcs; + priv->hdmi_funcs.product = "ProductProductProduct"; - ret = drmm_connector_hdmi_ini2(&priv->drm, &priv->connector, - "Vendor", product_name, + KUNIT_ASSERT_GT(test, strlen(priv->hdmi_funcs.product), + DRM_CONNECTOR_HDMI_PRODUCT_LEN); + + ret = drmm_connector_hdmi_init(&priv->drm, &priv->connector, &dummy_funcs, - &dummy_hdmi_funcs, + &priv->hdmi_funcs, DRM_MODE_CONNECTOR_HDMIA, - &priv->ddc, - BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444), - 8); + &priv->ddc); KUNIT_EXPECT_LT(test, ret, 0); } @@ -836,19 +837,19 @@ static void drm_test_connector_hdmi_init_vendor_valid(struct kunit *test) const char expected_vendor[DRM_CONNECTOR_HDMI_VENDOR_LEN] = { 'V', 'e', 'n', 'd', }; - const char *vendor_name = "Vend"; int ret; - KUNIT_ASSERT_LT(test, strlen(vendor_name), DRM_CONNECTOR_HDMI_VENDOR_LEN); + priv->hdmi_funcs = dummy_hdmi_funcs; + priv->hdmi_funcs.vendor = "Vend"; - ret = drmm_connector_hdmi_ini2(&priv->drm, &priv->connector, - vendor_name, "Product", + KUNIT_ASSERT_LT(test, strlen(priv->hdmi_funcs.vendor), + DRM_CONNECTOR_HDMI_VENDOR_LEN); + + ret = drmm_connector_hdmi_init(&priv->drm, &priv->connector, &dummy_funcs, - &dummy_hdmi_funcs, + &priv->hdmi_funcs, DRM_MODE_CONNECTOR_HDMIA, - &priv->ddc, - BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444), - 8); + &priv->ddc); KUNIT_EXPECT_EQ(test, ret, 0); KUNIT_EXPECT_MEMEQ(test, priv->connector.hdmi.vendor, @@ -868,19 +869,19 @@ static void drm_test_connector_hdmi_init_vendor_length_exact(struct kunit *test) 'V', 'e', 'n', 'd', 'o', 'r', 'V', 'e', }; - const char *vendor_name = "VendorVe"; int ret; - KUNIT_ASSERT_EQ(test, strlen(vendor_name), DRM_CONNECTOR_HDMI_VENDOR_LEN); + priv->hdmi_funcs = dummy_hdmi_funcs; + priv->hdmi_funcs.vendor = "VendorVe"; - ret = drmm_connector_hdmi_ini2(&priv->drm, &priv->connector, - vendor_name, "Product", + KUNIT_ASSERT_EQ(test, strlen(priv->hdmi_funcs.vendor), + DRM_CONNECTOR_HDMI_VENDOR_LEN); + + ret = drmm_connector_hdmi_init(&priv->drm, &priv->connector, &dummy_funcs, - &dummy_hdmi_funcs, + &priv->hdmi_funcs, DRM_MODE_CONNECTOR_HDMIA, - &priv->ddc, - BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444), - 8); + &priv->ddc); KUNIT_EXPECT_EQ(test, ret, 0); KUNIT_EXPECT_MEMEQ(test, priv->connector.hdmi.vendor, @@ -895,19 +896,17 @@ static void drm_test_connector_hdmi_init_vendor_length_exact(struct kunit *test) static void drm_test_connector_hdmi_init_vendor_length_too_long(struct kunit *test) { struct drm_connector_init_priv *priv = test->priv; - const char *vendor_name = "VendorVendor"; int ret; - KUNIT_ASSERT_GT(test, strlen(vendor_name), DRM_CONNECTOR_HDMI_VENDOR_LEN); + priv->hdmi_funcs = dummy_hdmi_funcs; + priv->hdmi_funcs.vendor = "VendorVendor"; + KUNIT_ASSERT_GT(test, strlen(priv->hdmi_funcs.vendor), DRM_CONNECTOR_HDMI_VENDOR_LEN); - ret = drmm_connector_hdmi_ini2(&priv->drm, &priv->connector, - vendor_name, "Product", + ret = drmm_connector_hdmi_init(&priv->drm, &priv->connector, &dummy_funcs, - &dummy_hdmi_funcs, + &priv->hdmi_funcs, DRM_MODE_CONNECTOR_HDMIA, - &priv->ddc, - BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444), - 8); + &priv->ddc); KUNIT_EXPECT_LT(test, ret, 0); } @@ -920,14 +919,14 @@ static void drm_test_connector_hdmi_init_bpc_invalid(struct kunit *test) struct drm_connector_init_priv *priv = test->priv; int ret; - ret = drmm_connector_hdmi_ini2(&priv->drm, &priv->connector, - "Vendor", "Product", + priv->hdmi_funcs = dummy_hdmi_funcs; + priv->hdmi_funcs.max_bpc = 9; + + ret = drmm_connector_hdmi_init(&priv->drm, &priv->connector, &dummy_funcs, - &dummy_hdmi_funcs, + &priv->hdmi_funcs, DRM_MODE_CONNECTOR_HDMIA, - &priv->ddc, - BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444), - 9); + &priv->ddc); KUNIT_EXPECT_LT(test, ret, 0); } @@ -940,14 +939,14 @@ static void drm_test_connector_hdmi_init_bpc_null(struct kunit *test) struct drm_connector_init_priv *priv = test->priv; int ret; - ret = drmm_connector_hdmi_ini2(&priv->drm, &priv->connector, - "Vendor", "Product", + priv->hdmi_funcs = dummy_hdmi_funcs; + priv->hdmi_funcs.max_bpc = 0; + + ret = drmm_connector_hdmi_init(&priv->drm, &priv->connector, &dummy_funcs, - &dummy_hdmi_funcs, + &priv->hdmi_funcs, DRM_MODE_CONNECTOR_HDMIA, - &priv->ddc, - BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444), - 0); + &priv->ddc); KUNIT_EXPECT_LT(test, ret, 0); } @@ -965,14 +964,11 @@ static void drm_test_connector_hdmi_init_bpc_8(struct kunit *test) uint64_t val; int ret; - ret = drmm_connector_hdmi_ini2(&priv->drm, connector, - "Vendor", "Product", + ret = drmm_connector_hdmi_init(&priv->drm, &priv->connector, &dummy_funcs, &dummy_hdmi_funcs, DRM_MODE_CONNECTOR_HDMIA, - &priv->ddc, - BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444), - 8); + &priv->ddc); KUNIT_EXPECT_EQ(test, ret, 0); prop = connector->max_bpc_property; @@ -1006,14 +1002,14 @@ static void drm_test_connector_hdmi_init_bpc_10(struct kunit *test) uint64_t val; int ret; - ret = drmm_connector_hdmi_ini2(&priv->drm, connector, - "Vendor", "Product", + priv->hdmi_funcs = dummy_hdmi_funcs; + priv->hdmi_funcs.max_bpc = 10; + + ret = drmm_connector_hdmi_init(&priv->drm, &priv->connector, &dummy_funcs, - &dummy_hdmi_funcs, + &priv->hdmi_funcs, DRM_MODE_CONNECTOR_HDMIA, - &priv->ddc, - BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444), - 10); + &priv->ddc); KUNIT_EXPECT_EQ(test, ret, 0); prop = connector->max_bpc_property; @@ -1047,14 +1043,14 @@ static void drm_test_connector_hdmi_init_bpc_12(struct kunit *test) uint64_t val; int ret; - ret = drmm_connector_hdmi_ini2(&priv->drm, connector, - "Vendor", "Product", + priv->hdmi_funcs = dummy_hdmi_funcs; + priv->hdmi_funcs.max_bpc = 12; + + ret = drmm_connector_hdmi_init(&priv->drm, &priv->connector, &dummy_funcs, - &dummy_hdmi_funcs, + &priv->hdmi_funcs, DRM_MODE_CONNECTOR_HDMIA, - &priv->ddc, - BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444), - 12); + &priv->ddc); KUNIT_EXPECT_EQ(test, ret, 0); prop = connector->max_bpc_property; @@ -1083,14 +1079,14 @@ static void drm_test_connector_hdmi_init_formats_empty(struct kunit *test) struct drm_connector_init_priv *priv = test->priv; int ret; - ret = drmm_connector_hdmi_ini2(&priv->drm, &priv->connector, - "Vendor", "Product", + priv->hdmi_funcs = dummy_hdmi_funcs; + priv->hdmi_funcs.supported_formats = 0; + + ret = drmm_connector_hdmi_init(&priv->drm, &priv->connector, &dummy_funcs, - &dummy_hdmi_funcs, + &priv->hdmi_funcs, DRM_MODE_CONNECTOR_HDMIA, - &priv->ddc, - 0, - 8); + &priv->ddc); KUNIT_EXPECT_LT(test, ret, 0); } @@ -1103,14 +1099,14 @@ static void drm_test_connector_hdmi_init_formats_no_rgb(struct kunit *test) struct drm_connector_init_priv *priv = test->priv; int ret; - ret = drmm_connector_hdmi_ini2(&priv->drm, &priv->connector, - "Vendor", "Product", + priv->hdmi_funcs = dummy_hdmi_funcs; + priv->hdmi_funcs.supported_formats = BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR422); + + ret = drmm_connector_hdmi_init(&priv->drm, &priv->connector, &dummy_funcs, - &dummy_hdmi_funcs, + &priv->hdmi_funcs, DRM_MODE_CONNECTOR_HDMIA, - &priv->ddc, - BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR422), - 8); + &priv->ddc); KUNIT_EXPECT_LT(test, ret, 0); } @@ -1161,14 +1157,14 @@ static void drm_test_connector_hdmi_init_formats_yuv420_allowed(struct kunit *te params = test->param_value; priv->connector.ycbcr_420_allowed = params->yuv420_allowed; - ret = drmm_connector_hdmi_ini2(&priv->drm, &priv->connector, - "Vendor", "Product", + priv->hdmi_funcs = dummy_hdmi_funcs; + priv->hdmi_funcs.supported_formats = params->supported_formats; + + ret = drmm_connector_hdmi_init(&priv->drm, &priv->connector, &dummy_funcs, - &dummy_hdmi_funcs, + &priv->hdmi_funcs, DRM_MODE_CONNECTOR_HDMIA, - &priv->ddc, - params->supported_formats, - 8); + &priv->ddc); KUNIT_EXPECT_EQ(test, ret, params->expected_result); } @@ -1182,14 +1178,11 @@ static void drm_test_connector_hdmi_init_type_valid(struct kunit *test) unsigned int connector_type = *(unsigned int *)test->param_value; int ret; - ret = drmm_connector_hdmi_ini2(&priv->drm, &priv->connector, - "Vendor", "Product", + ret = drmm_connector_hdmi_init(&priv->drm, &priv->connector, &dummy_funcs, &dummy_hdmi_funcs, connector_type, - &priv->ddc, - BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444), - 8); + &priv->ddc); KUNIT_EXPECT_EQ(test, ret, 0); } @@ -1217,14 +1210,11 @@ static void drm_test_connector_hdmi_init_type_invalid(struct kunit *test) unsigned int connector_type = *(unsigned int *)test->param_value; int ret; - ret = drmm_connector_hdmi_ini2(&priv->drm, &priv->connector, - "Vendor", "Product", + ret = drmm_connector_hdmi_init(&priv->drm, &priv->connector, &dummy_funcs, &dummy_hdmi_funcs, connector_type, - &priv->ddc, - BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444), - 8); + &priv->ddc); KUNIT_EXPECT_LT(test, ret, 0); } @@ -1494,14 +1484,11 @@ static void drm_test_drm_connector_attach_broadcast_rgb_property_hdmi_connector( struct drm_property *prop; int ret; - ret = drmm_connector_hdmi_ini2(&priv->drm, connector, - "Vendor", "Product", + ret = drmm_connector_hdmi_init(&priv->drm, connector, &dummy_funcs, &dummy_hdmi_funcs, DRM_MODE_CONNECTOR_HDMIA, - &priv->ddc, - BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444), - 8); + &priv->ddc); KUNIT_EXPECT_EQ(test, ret, 0); ret = drm_connector_attach_broadcast_rgb_property(connector); From patchwork Fri Jul 31 16:20:08 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Ciocaltea X-Patchwork-Id: 2845 Return-Path: X-Original-To: noreply@patchwork.local Delivered-To: noreply@patchwork.local Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114]) by mxe881.netcup.net (Postfix) with ESMTPS id BC2F31C1D58 for ; Fri, 31 Jul 2026 18:35:45 +0200 (CEST) Authentication-Results: mxe881; dkim=pass header.d=collabora.com; spf=pass (sender IP is 172.105.105.114) smtp.mailfrom=linux-sunxi+bounces-24869-noreply=patchwork.local@lists.linux.dev smtp.helo=tor.lore.kernel.org Received-SPF: pass (mxe881: domain of lists.linux.dev designates 172.105.105.114 as permitted sender) client-ip=172.105.105.114; envelope-from=linux-sunxi+bounces-24869-noreply=patchwork.local@lists.linux.dev; helo=tor.lore.kernel.org; Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by tor.lore.kernel.org (Postfix) with ESMTP id DC272319E759 for ; Fri, 31 Jul 2026 16:26:23 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0929C46D54A; Fri, 31 Jul 2026 16:20:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="N7Myzy1d" X-Original-To: linux-sunxi@lists.linux.dev Received: from bali.collaboradmins.com (bali.collaboradmins.com [148.251.105.195]) (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 12E9144B69C for ; Fri, 31 Jul 2026 16:20:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.251.105.195 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785514814; cv=none; b=tYxINfTl47kI+78bzEgba9UfYwh9zLJEK3vsV5sax9S9hS+HMKx34vuoFlqwbeMCla3KhMohPVP3gCUmfj5tLrkdIqNMyASM2Yp1bbSfoG4Mk9tHHVo4hh44utP9dEdJSFxpbH6rRgDB55p6EsaDPaUwLPjTAMYQEJRWuWgRWIY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785514814; c=relaxed/simple; bh=wy7odb4Bzb//d8gJuSExcEjuuO+HCRVariqZb2J3yPk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=I055/9fjGZEnD2RbZzHbXbB+hnenxHwJoIzT8HcKD4dWyqEYxKQqsofVpfMgNCBepyGfObkL2/LVsYecdAHcEzi56DHUB2785N7Feqoqox9YQ8zknUDhoXJudYB0oNGseyOyqhuLSKpLXq2Ee4r+U/CJWfc/pPWAPleMpg/GwWw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=N7Myzy1d; arc=none smtp.client-ip=148.251.105.195 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1785514798; bh=wy7odb4Bzb//d8gJuSExcEjuuO+HCRVariqZb2J3yPk=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=N7Myzy1dn3sfcKWX03ftfv9R2xoj2i41t4q4D2YUWZfAn8rVWX4Z2J6RMPbnYDIAY 2P+B4tSNehhtTHV1QLBJKQ1n3uzjoQY7Au73hDY8wsNojXZ0nmrwfoUT7lAWIsmGha 82BOtbj2ncxRsEkNCRpS8RyI7Se7Vs/HciHAMnb1j83NP9RbQg1G/sipOTzu8W6A6u XhTrcZlkf89eoNkFrnDFCMzb0lEtxPvqmuragAgOmdsu6NHX+Z2Tx3jWMhJY0Y9wl2 7a9s2r4kc3zQJl+ryyTvWQElsikzEKXM3ukzZJYV6tvgNhpjtcK5/kxOyhPu1TweYR BgMDMdxERHPsw== Received: from localhost (unknown [100.64.0.241]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange secp256r1 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: cristicc) by bali.collaboradmins.com (Postfix) with ESMTPSA id 14FDD17E0972; Fri, 31 Jul 2026 18:19:58 +0200 (CEST) From: Cristian Ciocaltea Date: Fri, 31 Jul 2026 19:20:08 +0300 Subject: [PATCH v10 61/69] drm/tests: connector: Add HDMI max_tmds_char_rate init coverage Precedence: bulk X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20260731-dw-hdmi-qp-scramb-v10-61-294364b2cf15@collabora.com> References: <20260731-dw-hdmi-qp-scramb-v10-0-294364b2cf15@collabora.com> In-Reply-To: <20260731-dw-hdmi-qp-scramb-v10-0-294364b2cf15@collabora.com> To: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Luca Ceresoli , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Chen-Yu Tsai , Samuel Holland , Dave Stevenson , =?utf-8?q?Ma=C3=ADra_Canal?= , Raspberry Pi Kernel Maintenance , Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Andy Yan , Algea Cao , Daniel Stone , Liu Ying , Phong LE Cc: kernel@collabora.com, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-rockchip@lists.infradead.org X-Mailer: b4 0.15.2 X-Rspamd-Server: rspamd-worker-8404 X-Spamd-Result: default: False [-2.16 / 15.00]; BAYES_HAM(-5.50)[100.00%]; RBL_SENDERSCORE(2.00)[172.105.105.114:from]; SUSPICIOUS_RECIPS(1.50)[]; MAILLIST(-0.15)[generic]; BAD_REP_POLICIES(0.10)[]; MIME_GOOD(-0.10)[text/plain]; HAS_LIST_UNSUB(-0.01)[]; R_DKIM_ALLOW(0.00)[collabora.com:s=mail]; ARC_ALLOW(0.00)[subspace.kernel.org:s=arc-20240116:i=1]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_TWELVE(0.00)[30]; PRECEDENCE_BULK(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[tor.lore.kernel.org:rdns,tor.lore.kernel.org:helo,collabora.com:email,collabora.com:dkim]; TAGGED_RCPT(0.00)[]; FORGED_SENDER_MAILLIST(0.00)[]; RCVD_COUNT_FIVE(0.00)[5]; ASN(0.00)[asn:63949, ipnet:172.105.96.0/20, country:SG]; DKIM_TRACE(0.00)[collabora.com:+]; DMARC_POLICY_ALLOW(0.00)[collabora.com,none]; R_SPF_ALLOW(0.00)[+ip4:172.105.105.114]; TO_DN_SOME(0.00)[]; FROM_NEQ_ENVFROM(0.00)[cristian.ciocaltea@collabora.com,linux-sunxi@lists.linux.dev]; FREEMAIL_TO(0.00)[intel.com,linaro.org,kernel.org,ideasonboard.com,kwiboo.se,gmail.com,bootlin.com,linux.intel.com,suse.de,ffwll.ch,sholland.org,raspberrypi.com,igalia.com,rock-chips.com,sntech.de,collabora.com,nxp.com,baylibre.com]; MIME_TRACE(0.00)[0:+]; TAGGED_FROM(0.00)[bounces-24869-noreply=patchwork.local]; FORGED_RECIPIENTS_MAILLIST(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[] X-Rspamd-Queue-Id: BC2F31C1D58 X-MORS-Enabled: yes X-MORS-DOMAIN: patchwork.local X-MORS-HOSTING: hosting172546 X-MORS-USER: hosting172546 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= Add KUnit tests for the new drmm_connector_hdmi_init() extension, which infers the connector's max_tmds_char_rate from the HDMI specification version advertised by the driver. Also validate a driver-capped max_tmds_char_rate against the version-inferred limit: override below, accept at, reject above, reject when no version is advertised. Since HDMI_VERSION_2_0 requires scrambler callbacks to be provided, add a dummy_hdmi_funcs_scrambler instance for tests that initialize HDMI 2.0 connectors. Signed-off-by: Cristian Ciocaltea --- drivers/gpu/drm/tests/drm_connector_test.c | 179 +++++++++++++++++++++++++++++ 1 file changed, 179 insertions(+) diff --git a/drivers/gpu/drm/tests/drm_connector_test.c b/drivers/gpu/drm/tests/drm_connector_test.c index c53ccce21a42..17242d1c1b16 100644 --- a/drivers/gpu/drm/tests/drm_connector_test.c +++ b/drivers/gpu/drm/tests/drm_connector_test.c @@ -54,6 +54,34 @@ static const struct drm_connector_hdmi_funcs dummy_hdmi_funcs = { }, }; +static int accept_scrambler_enable(struct drm_connector *connector) +{ + return 0; +} + +static int accept_scrambler_disable(struct drm_connector *connector) +{ + return 0; +} + +static const struct drm_connector_hdmi_funcs dummy_hdmi_funcs_scrambler = { + .vendor = "Vendor", + .product = "Product", + .supported_hdmi_ver = HDMI_VERSION_2_0, + .supported_formats = BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444), + .max_bpc = 8, + .scrambler_enable = accept_scrambler_enable, + .scrambler_disable = accept_scrambler_disable, + .avi = { + .clear_infoframe = accept_infoframe_clear_infoframe, + .write_infoframe = accept_infoframe_write_infoframe, + }, + .hdmi = { + .clear_infoframe = accept_infoframe_clear_infoframe, + .write_infoframe = accept_infoframe_write_infoframe, + }, +}; + static const struct drm_connector_funcs dummy_funcs = { .atomic_destroy_state = drm_atomic_helper_connector_destroy_state, .atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state, @@ -1244,6 +1272,151 @@ KUNIT_ARRAY_PARAM(drm_connector_hdmi_init_type_invalid, drm_connector_hdmi_init_type_invalid_tests, drm_connector_hdmi_init_type_desc); +/* + * Test that the registration of an HDMI connector without an explicit max TMDS + * character rate being provided succeeds, and the connector limit is inferred + * from the advertised HDMI specification version. + */ +struct drm_connector_hdmi_init_max_tmds_rate_inferred_case { + const char *desc; + enum hdmi_version ver; + unsigned long long expected; +}; + +static void drm_test_connector_hdmi_init_max_tmds_rate_inferred(struct kunit *test) +{ + struct drm_connector_init_priv *priv = test->priv; + const struct drm_connector_hdmi_init_max_tmds_rate_inferred_case *params = + test->param_value; + int ret; + + priv->hdmi_funcs = params->ver < HDMI_VERSION_2_0 ? + dummy_hdmi_funcs : dummy_hdmi_funcs_scrambler; + priv->hdmi_funcs.supported_hdmi_ver = params->ver; + + ret = drmm_connector_hdmi_init(&priv->drm, &priv->connector, + &dummy_funcs, + &priv->hdmi_funcs, + DRM_MODE_CONNECTOR_HDMIA, + &priv->ddc); + KUNIT_EXPECT_EQ(test, ret, 0); + KUNIT_EXPECT_EQ(test, priv->connector.hdmi.max_tmds_char_rate, + params->expected); +} + +static const struct drm_connector_hdmi_init_max_tmds_rate_inferred_case +drm_connector_hdmi_init_max_tmds_rate_inferred_tests[] = { + { "unknown", HDMI_VERSION_UNKNOWN, 0 }, + { "1.0", HDMI_VERSION_1_0, HDMI_1_0_TMDS_CHAR_RATE_MAX_HZ }, + { "1.2", HDMI_VERSION_1_2, HDMI_1_0_TMDS_CHAR_RATE_MAX_HZ }, + { "1.3", HDMI_VERSION_1_3, HDMI_1_3_TMDS_CHAR_RATE_MAX_HZ }, + { "1.4", HDMI_VERSION_1_4, HDMI_1_3_TMDS_CHAR_RATE_MAX_HZ }, + { "2.0", HDMI_VERSION_2_0, HDMI_2_0_TMDS_CHAR_RATE_MAX_HZ }, +}; + +static void drm_connector_hdmi_init_max_tmds_rate_inferred_desc( + const struct drm_connector_hdmi_init_max_tmds_rate_inferred_case *t, + char *desc) +{ + strscpy(desc, t->desc, KUNIT_PARAM_DESC_SIZE); +} + +KUNIT_ARRAY_PARAM(drm_connector_hdmi_init_max_tmds_rate_inferred, + drm_connector_hdmi_init_max_tmds_rate_inferred_tests, + drm_connector_hdmi_init_max_tmds_rate_inferred_desc); + +/* + * Test that the registration of an HDMI connector providing a max TMDS + * character rate strictly below the version-inferred limit succeeds, and + * the connector limit is overridden. + */ +static void drm_test_connector_hdmi_init_max_tmds_rate_override(struct kunit *test) +{ + struct drm_connector_init_priv *priv = test->priv; + int ret; + + priv->hdmi_funcs = dummy_hdmi_funcs; + priv->hdmi_funcs.supported_hdmi_ver = HDMI_VERSION_1_4; + priv->hdmi_funcs.supported_tmds_char_rate = HDMI_1_0_TMDS_CHAR_RATE_MAX_HZ; + + ret = drmm_connector_hdmi_init(&priv->drm, &priv->connector, + &dummy_funcs, + &priv->hdmi_funcs, + DRM_MODE_CONNECTOR_HDMIA, + &priv->ddc); + KUNIT_EXPECT_EQ(test, ret, 0); + KUNIT_EXPECT_EQ(test, priv->connector.hdmi.max_tmds_char_rate, + HDMI_1_0_TMDS_CHAR_RATE_MAX_HZ); +} + +/* + * Test that the registration of an HDMI connector providing a max TMDS + * character rate equal to the version-inferred limit succeeds. + */ +static void drm_test_connector_hdmi_init_max_tmds_rate_at_limit(struct kunit *test) +{ + struct drm_connector_init_priv *priv = test->priv; + int ret; + + priv->hdmi_funcs = dummy_hdmi_funcs; + priv->hdmi_funcs.supported_hdmi_ver = HDMI_VERSION_1_2; + priv->hdmi_funcs.supported_tmds_char_rate = HDMI_1_0_TMDS_CHAR_RATE_MAX_HZ; + + ret = drmm_connector_hdmi_init(&priv->drm, &priv->connector, + &dummy_funcs, + &priv->hdmi_funcs, + DRM_MODE_CONNECTOR_HDMIA, + &priv->ddc); + KUNIT_EXPECT_EQ(test, ret, 0); + KUNIT_EXPECT_EQ(test, priv->connector.hdmi.max_tmds_char_rate, + HDMI_1_0_TMDS_CHAR_RATE_MAX_HZ); +} + +/* + * Test that the registration of an HDMI connector providing a max TMDS + * character rate that exceeds the limit inferred from the advertised HDMI + * specification version fails. + */ +static void drm_test_connector_hdmi_init_max_tmds_rate_off_limit(struct kunit *test) +{ + struct drm_connector_init_priv *priv = test->priv; + int ret; + + priv->hdmi_funcs = dummy_hdmi_funcs; + priv->hdmi_funcs.supported_hdmi_ver = HDMI_VERSION_1_2; + priv->hdmi_funcs.supported_tmds_char_rate = HDMI_1_3_TMDS_CHAR_RATE_MAX_HZ; + + ret = drmm_connector_hdmi_init(&priv->drm, &priv->connector, + &dummy_funcs, + &priv->hdmi_funcs, + DRM_MODE_CONNECTOR_HDMIA, + &priv->ddc); + KUNIT_EXPECT_LT(test, ret, 0); +} + +/* + * Test that the registration of an HDMI connector providing a non-zero max + * TMDS character rate without an HDMI specification version fails, as the + * version-inferred limit defaults to zero and any positive override would + * exceed it. + */ +static void drm_test_connector_hdmi_init_max_tmds_rate_no_version(struct kunit *test) +{ + struct drm_connector_init_priv *priv = test->priv; + int ret; + + priv->hdmi_funcs = dummy_hdmi_funcs; + priv->hdmi_funcs.supported_hdmi_ver = HDMI_VERSION_UNKNOWN; + priv->hdmi_funcs.supported_tmds_char_rate = HDMI_1_0_TMDS_CHAR_RATE_MAX_HZ; + + ret = drmm_connector_hdmi_init(&priv->drm, &priv->connector, + &dummy_funcs, + &priv->hdmi_funcs, + DRM_MODE_CONNECTOR_HDMIA, + &priv->ddc); + KUNIT_EXPECT_LT(test, ret, 0); +} + static struct kunit_case drmm_connector_hdmi_init_tests[] = { KUNIT_CASE(drm_test_connector_hdmi_init_valid), KUNIT_CASE(drm_test_connector_hdmi_init_bpc_8), @@ -1268,6 +1441,12 @@ static struct kunit_case drmm_connector_hdmi_init_tests[] = { drm_connector_hdmi_init_type_valid_gen_params), KUNIT_CASE_PARAM(drm_test_connector_hdmi_init_type_invalid, drm_connector_hdmi_init_type_invalid_gen_params), + KUNIT_CASE_PARAM(drm_test_connector_hdmi_init_max_tmds_rate_inferred, + drm_connector_hdmi_init_max_tmds_rate_inferred_gen_params), + KUNIT_CASE(drm_test_connector_hdmi_init_max_tmds_rate_override), + KUNIT_CASE(drm_test_connector_hdmi_init_max_tmds_rate_at_limit), + KUNIT_CASE(drm_test_connector_hdmi_init_max_tmds_rate_off_limit), + KUNIT_CASE(drm_test_connector_hdmi_init_max_tmds_rate_no_version), { } }; From patchwork Fri Jul 31 16:20:09 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Ciocaltea X-Patchwork-Id: 2846 Return-Path: X-Original-To: noreply@patchwork.local Delivered-To: noreply@patchwork.local Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114]) by mxe881.netcup.net (Postfix) with ESMTPS id DBEF01C0037 for ; Fri, 31 Jul 2026 18:36:04 +0200 (CEST) Authentication-Results: mxe881; dkim=pass header.d=collabora.com; spf=pass (sender IP is 172.105.105.114) smtp.mailfrom=linux-sunxi+bounces-24874-noreply=patchwork.local@lists.linux.dev smtp.helo=tor.lore.kernel.org Received-SPF: pass (mxe881: domain of lists.linux.dev designates 172.105.105.114 as permitted sender) client-ip=172.105.105.114; envelope-from=linux-sunxi+bounces-24874-noreply=patchwork.local@lists.linux.dev; helo=tor.lore.kernel.org; Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by tor.lore.kernel.org (Postfix) with ESMTP id 5D98130F9ACE for ; Fri, 31 Jul 2026 16:26:49 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7015244BCA5; Fri, 31 Jul 2026 16:20:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="mgQh52NJ" X-Original-To: linux-sunxi@lists.linux.dev Received: from bali.collaboradmins.com (bali.collaboradmins.com [148.251.105.195]) (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 3DED2444701 for ; Fri, 31 Jul 2026 16:20:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.251.105.195 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785514817; cv=none; b=Cp9/FYvBNeGJEfX2Smn6FTGct7e0HcCQLNpxZc8IsC1Ny5anfXSOsF2Gw+3Kl8MSsmCEa2pDnXdD/G9Nj532TvC2diYwyzxrzEH8yJWC8O2Y3c08RNJodcETo+78LbnPQY4Yo1WuW62ZgdHftN8H+vSxBI4FjeuQEFKpfrmli5M= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785514817; c=relaxed/simple; bh=AmbKeI0EA/av+tCQTuliU0wD5msuSFI/IwkTSCcBjH4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=fc+h9raQm3FtrPPJx5uEnXofCajuqR4Zoy+0+XjWWvJSDM7F9nOG9yHR596Zyie9hYlXHYsteSFtNJj8AUU9hrHTAtEW+XPyqh0uZ7pzQgcjR/BIVD320glkoAm0xyyZlb+bvy91QYsY2Ye1CP2lpNbM95pvgB447FaQUk2a6Hw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=mgQh52NJ; arc=none smtp.client-ip=148.251.105.195 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1785514798; bh=AmbKeI0EA/av+tCQTuliU0wD5msuSFI/IwkTSCcBjH4=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=mgQh52NJc/dD3AlB5W5xaMG5LiZLC1sbE7Yqx6LSC+/KF1VsSQdShrrr8q0iFYaoZ ZIObsCO4WKlHIhlq6LPy+Z7CfQetgjE2Xqps0SKJRHzr5/lTaUJE2xWlCCtK8ov2+M MS4vv2VrUmgRbg+JxoA2HOqQ+FFqKC0UBYav7Tzq7c11lQ7KofZWSZ6nqxe8DBiRX6 zmekAExsvGDsxpD4yVPCE45+p7Yxlxfz29jdMcSgkdopu7ZNth5HOpSMRRoygEoS57 B92YdZmKSYZkQcu87kXlSuHnMtnnHttjNY1R52LL/4CxuSeTcmZ3v0enXgD9ZBhFjE csTKcxZYei2jA== Received: from localhost (unknown [100.64.0.241]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange secp256r1 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: cristicc) by bali.collaboradmins.com (Postfix) with ESMTPSA id C9A8E17E09AA; Fri, 31 Jul 2026 18:19:58 +0200 (CEST) From: Cristian Ciocaltea Date: Fri, 31 Jul 2026 19:20:09 +0300 Subject: [PATCH v10 62/69] drm/tests: connector: Add HDMI source-side scrambler coverage Precedence: bulk X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20260731-dw-hdmi-qp-scramb-v10-62-294364b2cf15@collabora.com> References: <20260731-dw-hdmi-qp-scramb-v10-0-294364b2cf15@collabora.com> In-Reply-To: <20260731-dw-hdmi-qp-scramb-v10-0-294364b2cf15@collabora.com> To: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Luca Ceresoli , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Chen-Yu Tsai , Samuel Holland , Dave Stevenson , =?utf-8?q?Ma=C3=ADra_Canal?= , Raspberry Pi Kernel Maintenance , Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Andy Yan , Algea Cao , Daniel Stone , Liu Ying , Phong LE Cc: kernel@collabora.com, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-rockchip@lists.infradead.org X-Mailer: b4 0.15.2 X-MORS-Enabled: yes X-MORS-DOMAIN: patchwork.local X-MORS-HOSTING: hosting172546 X-MORS-USER: hosting172546 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= Add KUnit tests for the HDMI source-side scrambling validation done by the new drmm_connector_hdmi_init() helper. Connector initialization derives scrambler support from the driver-provided supported_hdmi_ver capability. The scrambler callbacks are only valid for connectors advertising HDMI 2.0 or later, as drm_connector_hdmi_scrambler_supported() uses their presence to report source-side scrambling support. Therefore, connectors that advertise source-side scrambling support must provide both .scrambler_enable and .scrambler_disable. Registration is rejected if either callback is missing. Conversely, connectors that do not advertise source-side scrambling support must not provide these callbacks, and registration is rejected if they are present. Test the valid and invalid callback combinations for both supported and unsupported scrambling configurations. Signed-off-by: Cristian Ciocaltea --- drivers/gpu/drm/tests/drm_connector_test.c | 87 ++++++++++++++++++++++++++++++ 1 file changed, 87 insertions(+) diff --git a/drivers/gpu/drm/tests/drm_connector_test.c b/drivers/gpu/drm/tests/drm_connector_test.c index 17242d1c1b16..3d8500ad8be9 100644 --- a/drivers/gpu/drm/tests/drm_connector_test.c +++ b/drivers/gpu/drm/tests/drm_connector_test.c @@ -1417,6 +1417,89 @@ static void drm_test_connector_hdmi_init_max_tmds_rate_no_version(struct kunit * KUNIT_EXPECT_LT(test, ret, 0); } +/* + * Test that the registration of an HDMI connector advertising source-side + * scrambling support succeeds when the .scrambler_{enable,disable} callbacks + * are provided. + */ +static void drm_test_connector_hdmi_init_scrambler_valid(struct kunit *test) +{ + struct drm_connector_init_priv *priv = test->priv; + int ret; + + ret = drmm_connector_hdmi_init(&priv->drm, &priv->connector, + &dummy_funcs, + &dummy_hdmi_funcs_scrambler, + DRM_MODE_CONNECTOR_HDMIA, + &priv->ddc); + KUNIT_EXPECT_EQ(test, ret, 0); + KUNIT_EXPECT_TRUE(test, drm_connector_hdmi_scrambler_supported(&priv->connector)); +} + +/* + * Test that the registration of an HDMI connector advertising source-side + * scrambling support fails when the .scrambler_{enable,disable} callbacks + * are not provided. + */ +static void drm_test_connector_hdmi_init_scrambler_no_callbacks(struct kunit *test) +{ + struct drm_connector_init_priv *priv = test->priv; + int ret; + + priv->hdmi_funcs = dummy_hdmi_funcs_scrambler; + priv->hdmi_funcs.scrambler_enable = NULL; + priv->hdmi_funcs.scrambler_disable = NULL; + + ret = drmm_connector_hdmi_init(&priv->drm, &priv->connector, + &dummy_funcs, + &priv->hdmi_funcs, + DRM_MODE_CONNECTOR_HDMIA, + &priv->ddc); + KUNIT_EXPECT_LT(test, ret, 0); +} + +/* + * Test that the registration of an HDMI connector advertising source-side + * scrambling support fails when only one of the .scrambler_{enable,disable} + * callbacks are provided. + */ +static void drm_test_connector_hdmi_init_scrambler_partial_callbacks(struct kunit *test) +{ + struct drm_connector_init_priv *priv = test->priv; + int ret; + + priv->hdmi_funcs = dummy_hdmi_funcs_scrambler; + priv->hdmi_funcs.scrambler_disable = NULL; + + ret = drmm_connector_hdmi_init(&priv->drm, &priv->connector, + &dummy_funcs, + &priv->hdmi_funcs, + DRM_MODE_CONNECTOR_HDMIA, + &priv->ddc); + KUNIT_EXPECT_LT(test, ret, 0); +} + +/* + * Test that the registration of an HDMI connector not advertising source-side + * scrambling support fails when .scrambler_{enable,disable} callbacks are + * provided. + */ +static void drm_test_connector_hdmi_init_scrambler_unexpected_callbacks(struct kunit *test) +{ + struct drm_connector_init_priv *priv = test->priv; + int ret; + + priv->hdmi_funcs = dummy_hdmi_funcs_scrambler; + priv->hdmi_funcs.supported_hdmi_ver = HDMI_VERSION_1_4; + + ret = drmm_connector_hdmi_init(&priv->drm, &priv->connector, + &dummy_funcs, + &priv->hdmi_funcs, + DRM_MODE_CONNECTOR_HDMIA, + &priv->ddc); + KUNIT_EXPECT_LT(test, ret, 0); +} + static struct kunit_case drmm_connector_hdmi_init_tests[] = { KUNIT_CASE(drm_test_connector_hdmi_init_valid), KUNIT_CASE(drm_test_connector_hdmi_init_bpc_8), @@ -1447,6 +1530,10 @@ static struct kunit_case drmm_connector_hdmi_init_tests[] = { KUNIT_CASE(drm_test_connector_hdmi_init_max_tmds_rate_at_limit), KUNIT_CASE(drm_test_connector_hdmi_init_max_tmds_rate_off_limit), KUNIT_CASE(drm_test_connector_hdmi_init_max_tmds_rate_no_version), + KUNIT_CASE(drm_test_connector_hdmi_init_scrambler_valid), + KUNIT_CASE(drm_test_connector_hdmi_init_scrambler_no_callbacks), + KUNIT_CASE(drm_test_connector_hdmi_init_scrambler_partial_callbacks), + KUNIT_CASE(drm_test_connector_hdmi_init_scrambler_unexpected_callbacks), { } }; From patchwork Fri Jul 31 16:20:10 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Ciocaltea X-Patchwork-Id: 2844 Return-Path: X-Original-To: noreply@patchwork.local Delivered-To: noreply@patchwork.local Received: from sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74]) by mxe881.netcup.net (Postfix) with ESMTPS id 6AA981C1D58 for ; Fri, 31 Jul 2026 18:35:36 +0200 (CEST) Authentication-Results: mxe881; dkim=pass header.d=collabora.com; spf=pass (sender IP is 172.232.135.74) smtp.mailfrom=linux-sunxi+bounces-24873-noreply=patchwork.local@lists.linux.dev smtp.helo=sto.lore.kernel.org Received-SPF: pass (mxe881: domain of lists.linux.dev designates 172.232.135.74 as permitted sender) client-ip=172.232.135.74; envelope-from=linux-sunxi+bounces-24873-noreply=patchwork.local@lists.linux.dev; helo=sto.lore.kernel.org; Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by sto.lore.kernel.org (Postfix) with ESMTP id EF2C6307A24D for ; Fri, 31 Jul 2026 16:26:37 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 979CB46D572; Fri, 31 Jul 2026 16:20:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="U7AxCbZC" X-Original-To: linux-sunxi@lists.linux.dev Received: from bali.collaboradmins.com (bali.collaboradmins.com [148.251.105.195]) (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 1E45A46C4B7 for ; Fri, 31 Jul 2026 16:20:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.251.105.195 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785514817; cv=none; b=aWnGfId9K4nhAtV5+vqlehPpuGb5tDXUxJIPseiEEizocL/6pXRp+2h7/OrvQs1KkCpK0H9ZKaiNMeuqhxZgshgRghs6Hb2wNADk3uxN8RAPSN2by5LriktILRyDnn2pyONf/YhQ/VDTdyQxGn2hSSZ4xyyKbx4bDN70GVdwarY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785514817; c=relaxed/simple; bh=0kQcEb8Hkp5EMJTEHb1RclxeTrVhTTx4W2V5Vh+7vis=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=jZGmm7p4mDlrPQ4DGTaCNsffip4P2MC2qm6x9nDN80fkX3gFAk4KAoqtH47faMQ2+N9wj12/orQDE2+6QdAEVh8MM0hCs2CMUSibvx4G78/zvOUOIEG6ypBnyRQ8MH/+W6wVaQZDQgFt5yRjHnwLW0nWQYZbhJ+oDlzO+z66BMo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=U7AxCbZC; arc=none smtp.client-ip=148.251.105.195 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1785514799; bh=0kQcEb8Hkp5EMJTEHb1RclxeTrVhTTx4W2V5Vh+7vis=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=U7AxCbZCHAI1qvMa3sSa+wO+cmbu0LjmRtkiijgm8zvf3L4QzVdGfj3W0KuRRgTzQ Ddm4a9p+Il5DyzS9oSPL7LzoTspbXEvMCOSqxWF31VqWU18kV7YhBvV+di/FEiEFQv zUvqETU2cqVj/YWjLMbc9giCjDtCd/TsTDHyPYvHR/hITR09fej7Kid8b56XIvj1aQ oIZi6AbWSDGwSvneSM9rSH8cZbVa5q4KHCaYLH1KNC+JhTt0pJo/lb7kBysHEabi19 f6bmCfPvu35UeQrm8eBo+jPCTRHrb2kJqfVejq3piSw7IAjL2L3vGixJHJqSPMHRaG wEzXQoUFe2shw== Received: from localhost (unknown [100.64.0.241]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange secp256r1 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: cristicc) by bali.collaboradmins.com (Postfix) with ESMTPSA id 8927D17E09F7; Fri, 31 Jul 2026 18:19:59 +0200 (CEST) From: Cristian Ciocaltea Date: Fri, 31 Jul 2026 19:20:10 +0300 Subject: [PATCH v10 63/69] drm/tests: hdmi_state_helper: Convert to drmm_connector_hdmi_init() Precedence: bulk X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20260731-dw-hdmi-qp-scramb-v10-63-294364b2cf15@collabora.com> References: <20260731-dw-hdmi-qp-scramb-v10-0-294364b2cf15@collabora.com> In-Reply-To: <20260731-dw-hdmi-qp-scramb-v10-0-294364b2cf15@collabora.com> To: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Luca Ceresoli , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Chen-Yu Tsai , Samuel Holland , Dave Stevenson , =?utf-8?q?Ma=C3=ADra_Canal?= , Raspberry Pi Kernel Maintenance , Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Andy Yan , Algea Cao , Daniel Stone , Liu Ying , Phong LE Cc: kernel@collabora.com, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-rockchip@lists.infradead.org X-Mailer: b4 0.15.2 X-Rspamd-Server: rspamd-worker-8404 X-Spamd-Result: default: False [-2.16 / 15.00]; BAYES_HAM(-5.50)[100.00%]; RBL_SENDERSCORE(2.00)[172.232.135.74:from]; SUSPICIOUS_RECIPS(1.50)[]; MAILLIST(-0.15)[generic]; BAD_REP_POLICIES(0.10)[]; MIME_GOOD(-0.10)[text/plain]; HAS_LIST_UNSUB(-0.01)[]; RCVD_COUNT_FIVE(0.00)[5]; ARC_ALLOW(0.00)[subspace.kernel.org:s=arc-20240116:i=1]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_TWELVE(0.00)[30]; PRECEDENCE_BULK(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[sto.lore.kernel.org:rdns,sto.lore.kernel.org:helo,collabora.com:email,collabora.com:dkim]; TAGGED_RCPT(0.00)[]; FORGED_SENDER_MAILLIST(0.00)[]; R_DKIM_ALLOW(0.00)[collabora.com:s=mail]; ASN(0.00)[asn:63949, ipnet:172.232.128.0/19, country:SG]; DKIM_TRACE(0.00)[collabora.com:+]; DMARC_POLICY_ALLOW(0.00)[collabora.com,none]; R_SPF_ALLOW(0.00)[+ip4:172.232.135.74:c]; TO_DN_SOME(0.00)[]; FROM_NEQ_ENVFROM(0.00)[cristian.ciocaltea@collabora.com,linux-sunxi@lists.linux.dev]; FREEMAIL_TO(0.00)[intel.com,linaro.org,kernel.org,ideasonboard.com,kwiboo.se,gmail.com,bootlin.com,linux.intel.com,suse.de,ffwll.ch,sholland.org,raspberrypi.com,igalia.com,rock-chips.com,sntech.de,collabora.com,nxp.com,baylibre.com]; MIME_TRACE(0.00)[0:+]; TAGGED_FROM(0.00)[bounces-24873-noreply=patchwork.local]; FORGED_RECIPIENTS_MAILLIST(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[] X-Rspamd-Queue-Id: 6AA981C1D58 X-MORS-Enabled: yes X-MORS-DOMAIN: patchwork.local X-MORS-HOSTING: hosting172546 X-MORS-USER: hosting172546 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= Switch tests over to the new drmm_connector_hdmi_init() signature, where the vendor, product, supported_formats and max_bpc values previously passed as arguments are now provided through struct drm_connector_hdmi_funcs. As a consequence, the tests exercising those values can no longer share the static hdmi_funcs and need a modified copy of their own. Since the connector retains a pointer to it, such a copy must not live on the caller's stack, which is gone by the time the DRM-managed actions release the connector. Let __connector_hdmi_init() store it in struct drm_atomic_helper_connector_hdmi_priv instead. This structure embeds the DRM device and is freed through managed.final_kfree only after drm_dev_release() has run all DRM-managed actions, so it strictly outlives the connector. Signed-off-by: Cristian Ciocaltea --- drivers/gpu/drm/tests/drm_hdmi_state_helper_test.c | 334 ++++++++++----------- 1 file changed, 164 insertions(+), 170 deletions(-) diff --git a/drivers/gpu/drm/tests/drm_hdmi_state_helper_test.c b/drivers/gpu/drm/tests/drm_hdmi_state_helper_test.c index 4c2a400bc15a..f35dc31326bc 100644 --- a/drivers/gpu/drm/tests/drm_hdmi_state_helper_test.c +++ b/drivers/gpu/drm/tests/drm_hdmi_state_helper_test.c @@ -32,6 +32,7 @@ struct drm_atomic_helper_connector_hdmi_priv { struct drm_crtc *crtc; struct drm_encoder encoder; struct drm_connector connector; + struct drm_connector_hdmi_funcs hdmi_funcs; const void *current_edid; size_t current_edid_len; @@ -124,6 +125,11 @@ static int accept_infoframe_write_infoframe(struct drm_connector *connector, } static const struct drm_connector_hdmi_funcs dummy_connector_hdmi_funcs = { + .vendor = "Vendor", + .product = "Product", + .supported_hdmi_ver = HDMI_VERSION_1_4, + .supported_formats = BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444), + .max_bpc = 8, .avi = { .clear_infoframe = accept_infoframe_clear_infoframe, .write_infoframe = accept_infoframe_write_infoframe, @@ -143,6 +149,11 @@ reject_connector_tmds_char_rate_valid(const struct drm_connector *connector, } static const struct drm_connector_hdmi_funcs reject_connector_hdmi_funcs = { + .vendor = "Vendor", + .product = "Product", + .supported_hdmi_ver = HDMI_VERSION_1_4, + .supported_formats = BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444), + .max_bpc = 8, .tmds_char_rate_valid = reject_connector_tmds_char_rate_valid, .avi = { .clear_infoframe = accept_infoframe_clear_infoframe, @@ -163,6 +174,11 @@ reject_100mhz_connector_tmds_char_rate_valid(const struct drm_connector *connect } static const struct drm_connector_hdmi_funcs reject_100mhz_connector_hdmi_funcs = { + .vendor = "Vendor", + .product = "Product", + .supported_hdmi_ver = HDMI_VERSION_1_4, + .supported_formats = BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444), + .max_bpc = 8, .tmds_char_rate_valid = reject_100mhz_connector_tmds_char_rate_valid, .avi = { .clear_infoframe = accept_infoframe_clear_infoframe, @@ -231,8 +247,6 @@ static const struct drm_encoder_helper_funcs test_encoder_helper_funcs = { static struct drm_atomic_helper_connector_hdmi_priv * __connector_hdmi_init(struct kunit *test, - unsigned int formats, - unsigned int max_bpc, const struct drm_connector_hdmi_funcs *hdmi_funcs, const void *edid_data, size_t edid_len) { @@ -273,16 +287,15 @@ __connector_hdmi_init(struct kunit *test, enc->possible_crtcs = drm_crtc_mask(priv->crtc); conn = &priv->connector; - conn->ycbcr_420_allowed = !!(formats & BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR420)); + conn->ycbcr_420_allowed = !!(hdmi_funcs->supported_formats & + BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR420)); - ret = drmm_connector_hdmi_ini2(drm, conn, - "Vendor", "Product", + priv->hdmi_funcs = *hdmi_funcs; + ret = drmm_connector_hdmi_init(drm, conn, &dummy_connector_funcs, - hdmi_funcs, + &priv->hdmi_funcs, DRM_MODE_CONNECTOR_HDMIA, - NULL, - formats, - max_bpc); + NULL); KUNIT_ASSERT_EQ(test, ret, 0); drm_connector_helper_add(conn, &dummy_connector_helper_funcs); @@ -298,18 +311,14 @@ __connector_hdmi_init(struct kunit *test, return priv; } -#define drm_kunit_helper_connector_hdmi_init_with_edid_funcs(test, formats, max_bpc, funcs, edid) \ - __connector_hdmi_init(test, formats, max_bpc, funcs, edid, ARRAY_SIZE(edid)) +#define drm_kunit_helper_connector_hdmi_init_with_edid_funcs(test, funcs, edid) \ + __connector_hdmi_init(test, funcs, edid, ARRAY_SIZE(edid)) static struct drm_atomic_helper_connector_hdmi_priv * -drm_kunit_helper_connector_hdmi_init(struct kunit *test, - unsigned int formats, - unsigned int max_bpc) +drm_kunit_helper_connector_hdmi_init(struct kunit *test) { return drm_kunit_helper_connector_hdmi_init_with_edid_funcs(test, - formats, - max_bpc, &dummy_connector_hdmi_funcs, test_edid_hdmi_1080p_rgb_max_200mhz); } @@ -333,9 +342,7 @@ static void drm_test_check_broadcast_rgb_crtc_mode_changed(struct kunit *test) struct drm_crtc *crtc; int ret; - priv = drm_kunit_helper_connector_hdmi_init(test, - BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444), - 8); + priv = drm_kunit_helper_connector_hdmi_init(test); KUNIT_ASSERT_NOT_NULL(test, priv); drm = &priv->drm; @@ -408,9 +415,7 @@ static void drm_test_check_broadcast_rgb_crtc_mode_not_changed(struct kunit *tes struct drm_crtc *crtc; int ret; - priv = drm_kunit_helper_connector_hdmi_init(test, - BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444), - 8); + priv = drm_kunit_helper_connector_hdmi_init(test); KUNIT_ASSERT_NOT_NULL(test, priv); drm = &priv->drm; @@ -483,9 +488,7 @@ static void drm_test_check_broadcast_rgb_auto_cea_mode(struct kunit *test) struct drm_crtc *crtc; int ret; - priv = drm_kunit_helper_connector_hdmi_init(test, - BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444), - 8); + priv = drm_kunit_helper_connector_hdmi_init(test); KUNIT_ASSERT_NOT_NULL(test, priv); drm = &priv->drm; @@ -550,9 +553,7 @@ static void drm_test_check_broadcast_rgb_auto_cea_mode_vic_1(struct kunit *test) struct drm_crtc *crtc; int ret; - priv = drm_kunit_helper_connector_hdmi_init(test, - BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444), - 8); + priv = drm_kunit_helper_connector_hdmi_init(test); KUNIT_ASSERT_NOT_NULL(test, priv); drm = &priv->drm; @@ -617,9 +618,7 @@ static void drm_test_check_broadcast_rgb_full_cea_mode(struct kunit *test) struct drm_crtc *crtc; int ret; - priv = drm_kunit_helper_connector_hdmi_init(test, - BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444), - 8); + priv = drm_kunit_helper_connector_hdmi_init(test); KUNIT_ASSERT_NOT_NULL(test, priv); drm = &priv->drm; @@ -686,9 +685,7 @@ static void drm_test_check_broadcast_rgb_full_cea_mode_vic_1(struct kunit *test) struct drm_crtc *crtc; int ret; - priv = drm_kunit_helper_connector_hdmi_init(test, - BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444), - 8); + priv = drm_kunit_helper_connector_hdmi_init(test); KUNIT_ASSERT_NOT_NULL(test, priv); drm = &priv->drm; @@ -755,9 +752,7 @@ static void drm_test_check_broadcast_rgb_limited_cea_mode(struct kunit *test) struct drm_crtc *crtc; int ret; - priv = drm_kunit_helper_connector_hdmi_init(test, - BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444), - 8); + priv = drm_kunit_helper_connector_hdmi_init(test); KUNIT_ASSERT_NOT_NULL(test, priv); drm = &priv->drm; @@ -824,9 +819,7 @@ static void drm_test_check_broadcast_rgb_limited_cea_mode_vic_1(struct kunit *te struct drm_crtc *crtc; int ret; - priv = drm_kunit_helper_connector_hdmi_init(test, - BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444), - 8); + priv = drm_kunit_helper_connector_hdmi_init(test); KUNIT_ASSERT_NOT_NULL(test, priv); drm = &priv->drm; @@ -883,6 +876,7 @@ static void drm_test_check_broadcast_rgb_limited_cea_mode_vic_1(struct kunit *te */ static void drm_test_check_broadcast_rgb_cea_mode_yuv420(struct kunit *test) { + struct drm_connector_hdmi_funcs hdmi_funcs = dummy_connector_hdmi_funcs; struct drm_atomic_helper_connector_hdmi_priv *priv; enum drm_hdmi_broadcast_rgb broadcast_rgb; struct drm_modeset_acquire_ctx ctx; @@ -895,12 +889,11 @@ static void drm_test_check_broadcast_rgb_cea_mode_yuv420(struct kunit *test) int ret; broadcast_rgb = *(enum drm_hdmi_broadcast_rgb *)test->param_value; + hdmi_funcs.supported_formats = BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444) | + BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR420); priv = drm_kunit_helper_connector_hdmi_init_with_edid_funcs(test, - BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444) | - BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR420), - 8, - &dummy_connector_hdmi_funcs, + &hdmi_funcs, test_edid_hdmi_1080p_rgb_yuv_4k_yuv420_dc_max_200mhz); KUNIT_ASSERT_NOT_NULL(test, priv); @@ -984,6 +977,7 @@ KUNIT_ARRAY_PARAM(check_broadcast_rgb_cea_mode_yuv420, */ static void drm_test_check_output_bpc_crtc_mode_changed(struct kunit *test) { + struct drm_connector_hdmi_funcs hdmi_funcs = dummy_connector_hdmi_funcs; struct drm_atomic_helper_connector_hdmi_priv *priv; struct drm_modeset_acquire_ctx ctx; struct drm_connector_state *old_conn_state; @@ -996,10 +990,9 @@ static void drm_test_check_output_bpc_crtc_mode_changed(struct kunit *test) struct drm_crtc *crtc; int ret; + hdmi_funcs.max_bpc = 10; priv = drm_kunit_helper_connector_hdmi_init_with_edid_funcs(test, - BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444), - 10, - &dummy_connector_hdmi_funcs, + &hdmi_funcs, test_edid_hdmi_1080p_rgb_yuv_dc_max_200mhz); KUNIT_ASSERT_NOT_NULL(test, priv); @@ -1066,6 +1059,7 @@ static void drm_test_check_output_bpc_crtc_mode_changed(struct kunit *test) */ static void drm_test_check_output_bpc_crtc_mode_not_changed(struct kunit *test) { + struct drm_connector_hdmi_funcs hdmi_funcs = dummy_connector_hdmi_funcs; struct drm_atomic_helper_connector_hdmi_priv *priv; struct drm_modeset_acquire_ctx ctx; struct drm_connector_state *old_conn_state; @@ -1078,10 +1072,9 @@ static void drm_test_check_output_bpc_crtc_mode_not_changed(struct kunit *test) struct drm_crtc *crtc; int ret; + hdmi_funcs.max_bpc = 10; priv = drm_kunit_helper_connector_hdmi_init_with_edid_funcs(test, - BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444), - 10, - &dummy_connector_hdmi_funcs, + &hdmi_funcs, test_edid_hdmi_1080p_rgb_yuv_dc_max_200mhz); KUNIT_ASSERT_NOT_NULL(test, priv); @@ -1145,6 +1138,7 @@ static void drm_test_check_output_bpc_crtc_mode_not_changed(struct kunit *test) */ static void drm_test_check_output_bpc_dvi(struct kunit *test) { + struct drm_connector_hdmi_funcs hdmi_funcs = dummy_connector_hdmi_funcs; struct drm_atomic_helper_connector_hdmi_priv *priv; struct drm_modeset_acquire_ctx ctx; struct drm_connector_state *conn_state; @@ -1155,12 +1149,12 @@ static void drm_test_check_output_bpc_dvi(struct kunit *test) struct drm_crtc *crtc; int ret; + hdmi_funcs.max_bpc = 12; + hdmi_funcs.supported_formats = BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444) | + BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR422) | + BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR444); priv = drm_kunit_helper_connector_hdmi_init_with_edid_funcs(test, - BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444) | - BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR422) | - BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR444), - 12, - &dummy_connector_hdmi_funcs, + &hdmi_funcs, test_edid_dvi_1080p); KUNIT_ASSERT_NOT_NULL(test, priv); @@ -1213,8 +1207,6 @@ static void drm_test_check_tmds_char_rate_rgb_8bpc(struct kunit *test) int ret; priv = drm_kunit_helper_connector_hdmi_init_with_edid_funcs(test, - BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444), - 8, &dummy_connector_hdmi_funcs, test_edid_hdmi_1080p_rgb_max_200mhz); KUNIT_ASSERT_NOT_NULL(test, priv); @@ -1258,6 +1250,7 @@ static void drm_test_check_tmds_char_rate_rgb_8bpc(struct kunit *test) */ static void drm_test_check_tmds_char_rate_rgb_10bpc(struct kunit *test) { + struct drm_connector_hdmi_funcs hdmi_funcs = dummy_connector_hdmi_funcs; struct drm_atomic_helper_connector_hdmi_priv *priv; struct drm_modeset_acquire_ctx ctx; struct drm_connector_state *conn_state; @@ -1267,10 +1260,9 @@ static void drm_test_check_tmds_char_rate_rgb_10bpc(struct kunit *test) struct drm_crtc *crtc; int ret; + hdmi_funcs.max_bpc = 10; priv = drm_kunit_helper_connector_hdmi_init_with_edid_funcs(test, - BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444), - 10, - &dummy_connector_hdmi_funcs, + &hdmi_funcs, test_edid_hdmi_1080p_rgb_yuv_dc_max_340mhz); KUNIT_ASSERT_NOT_NULL(test, priv); @@ -1313,6 +1305,7 @@ static void drm_test_check_tmds_char_rate_rgb_10bpc(struct kunit *test) */ static void drm_test_check_tmds_char_rate_rgb_12bpc(struct kunit *test) { + struct drm_connector_hdmi_funcs hdmi_funcs = dummy_connector_hdmi_funcs; struct drm_atomic_helper_connector_hdmi_priv *priv; struct drm_modeset_acquire_ctx ctx; struct drm_connector_state *conn_state; @@ -1322,10 +1315,9 @@ static void drm_test_check_tmds_char_rate_rgb_12bpc(struct kunit *test) struct drm_crtc *crtc; int ret; + hdmi_funcs.max_bpc = 12; priv = drm_kunit_helper_connector_hdmi_init_with_edid_funcs(test, - BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444), - 12, - &dummy_connector_hdmi_funcs, + &hdmi_funcs, test_edid_hdmi_1080p_rgb_yuv_dc_max_340mhz); KUNIT_ASSERT_NOT_NULL(test, priv); @@ -1381,9 +1373,7 @@ static void drm_test_check_hdmi_funcs_reject_rate(struct kunit *test) struct drm_crtc *crtc; int ret; - priv = drm_kunit_helper_connector_hdmi_init(test, - BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444), - 8); + priv = drm_kunit_helper_connector_hdmi_init(test); KUNIT_ASSERT_NOT_NULL(test, priv); drm = &priv->drm; @@ -1438,6 +1428,7 @@ static void drm_test_check_hdmi_funcs_reject_rate(struct kunit *test) */ static void drm_test_check_max_tmds_rate_bpc_fallback_rgb(struct kunit *test) { + struct drm_connector_hdmi_funcs hdmi_funcs = dummy_connector_hdmi_funcs; struct drm_atomic_helper_connector_hdmi_priv *priv; struct drm_modeset_acquire_ctx ctx; struct drm_connector_state *conn_state; @@ -1449,10 +1440,9 @@ static void drm_test_check_max_tmds_rate_bpc_fallback_rgb(struct kunit *test) struct drm_crtc *crtc; int ret; + hdmi_funcs.max_bpc = 12; priv = drm_kunit_helper_connector_hdmi_init_with_edid_funcs(test, - BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444), - 12, - &dummy_connector_hdmi_funcs, + &hdmi_funcs, test_edid_hdmi_1080p_rgb_yuv_dc_max_200mhz); KUNIT_ASSERT_NOT_NULL(test, priv); @@ -1512,6 +1502,7 @@ static void drm_test_check_max_tmds_rate_bpc_fallback_rgb(struct kunit *test) */ static void drm_test_check_max_tmds_rate_bpc_fallback_yuv420(struct kunit *test) { + struct drm_connector_hdmi_funcs hdmi_funcs = dummy_connector_hdmi_funcs; struct drm_atomic_helper_connector_hdmi_priv *priv; struct drm_modeset_acquire_ctx ctx; struct drm_connector_state *conn_state; @@ -1523,11 +1514,11 @@ static void drm_test_check_max_tmds_rate_bpc_fallback_yuv420(struct kunit *test) struct drm_crtc *crtc; int ret; + hdmi_funcs.max_bpc = 12; + hdmi_funcs.supported_formats = BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444) | + BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR420); priv = drm_kunit_helper_connector_hdmi_init_with_edid_funcs(test, - BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444) | - BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR420), - 12, - &dummy_connector_hdmi_funcs, + &hdmi_funcs, test_edid_hdmi_1080p_rgb_yuv_4k_yuv420_dc_max_200mhz); KUNIT_ASSERT_NOT_NULL(test, priv); @@ -1588,6 +1579,7 @@ static void drm_test_check_max_tmds_rate_bpc_fallback_yuv420(struct kunit *test) */ static void drm_test_check_max_tmds_rate_bpc_fallback_ignore_yuv422(struct kunit *test) { + struct drm_connector_hdmi_funcs hdmi_funcs = dummy_connector_hdmi_funcs; struct drm_atomic_helper_connector_hdmi_priv *priv; struct drm_modeset_acquire_ctx ctx; struct drm_connector_state *conn_state; @@ -1599,12 +1591,12 @@ static void drm_test_check_max_tmds_rate_bpc_fallback_ignore_yuv422(struct kunit struct drm_crtc *crtc; int ret; + hdmi_funcs.max_bpc = 12; + hdmi_funcs.supported_formats = BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444) | + BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR422) | + BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR444); priv = drm_kunit_helper_connector_hdmi_init_with_edid_funcs(test, - BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444) | - BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR422) | - BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR444), - 12, - &dummy_connector_hdmi_funcs, + &hdmi_funcs, test_edid_hdmi_1080p_rgb_yuv_dc_max_200mhz); KUNIT_ASSERT_NOT_NULL(test, priv); @@ -1669,6 +1661,7 @@ static void drm_test_check_max_tmds_rate_bpc_fallback_ignore_yuv422(struct kunit */ static void drm_test_check_max_tmds_rate_bpc_fallback_ignore_yuv420(struct kunit *test) { + struct drm_connector_hdmi_funcs hdmi_funcs = dummy_connector_hdmi_funcs; struct drm_atomic_helper_connector_hdmi_priv *priv; struct drm_modeset_acquire_ctx ctx; struct drm_connector_state *conn_state; @@ -1680,11 +1673,11 @@ static void drm_test_check_max_tmds_rate_bpc_fallback_ignore_yuv420(struct kunit struct drm_crtc *crtc; int ret; + hdmi_funcs.max_bpc = 12; + hdmi_funcs.supported_formats = BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444) | + BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR420); priv = drm_kunit_helper_connector_hdmi_init_with_edid_funcs(test, - BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444) | - BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR420), - 12, - &dummy_connector_hdmi_funcs, + &hdmi_funcs, test_edid_hdmi_4k_rgb_yuv420_dc_max_340mhz); KUNIT_ASSERT_NOT_NULL(test, priv); @@ -1740,6 +1733,7 @@ static void drm_test_check_max_tmds_rate_bpc_fallback_ignore_yuv420(struct kunit */ static void drm_test_check_driver_unsupported_fallback_yuv420(struct kunit *test) { + struct drm_connector_hdmi_funcs hdmi_funcs = dummy_connector_hdmi_funcs; struct drm_atomic_helper_connector_hdmi_priv *priv; struct drm_modeset_acquire_ctx ctx; struct drm_connector_state *conn_state; @@ -1752,10 +1746,9 @@ static void drm_test_check_driver_unsupported_fallback_yuv420(struct kunit *test struct drm_crtc *crtc; int ret; + hdmi_funcs.max_bpc = 12; priv = drm_kunit_helper_connector_hdmi_init_with_edid_funcs(test, - BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444), - 12, - &dummy_connector_hdmi_funcs, + &hdmi_funcs, test_edid_hdmi_1080p_rgb_yuv_4k_yuv420_dc_max_200mhz); KUNIT_ASSERT_NOT_NULL(test, priv); @@ -1826,6 +1819,7 @@ static void drm_test_check_driver_unsupported_fallback_yuv420(struct kunit *test */ static void drm_test_check_output_bpc_format_vic_1(struct kunit *test) { + struct drm_connector_hdmi_funcs hdmi_funcs = dummy_connector_hdmi_funcs; struct drm_atomic_helper_connector_hdmi_priv *priv; struct drm_modeset_acquire_ctx ctx; struct drm_connector_state *conn_state; @@ -1837,12 +1831,12 @@ static void drm_test_check_output_bpc_format_vic_1(struct kunit *test) struct drm_crtc *crtc; int ret; + hdmi_funcs.max_bpc = 12; + hdmi_funcs.supported_formats = BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444) | + BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR422) | + BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR444); priv = drm_kunit_helper_connector_hdmi_init_with_edid_funcs(test, - BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444) | - BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR422) | - BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR444), - 12, - &dummy_connector_hdmi_funcs, + &hdmi_funcs, test_edid_hdmi_1080p_rgb_yuv_dc_max_200mhz); KUNIT_ASSERT_NOT_NULL(test, priv); @@ -1897,6 +1891,7 @@ static void drm_test_check_output_bpc_format_vic_1(struct kunit *test) */ static void drm_test_check_output_bpc_format_driver_rgb_only(struct kunit *test) { + struct drm_connector_hdmi_funcs hdmi_funcs = dummy_connector_hdmi_funcs; struct drm_atomic_helper_connector_hdmi_priv *priv; struct drm_modeset_acquire_ctx ctx; struct drm_connector_state *conn_state; @@ -1908,10 +1903,9 @@ static void drm_test_check_output_bpc_format_driver_rgb_only(struct kunit *test) struct drm_crtc *crtc; int ret; + hdmi_funcs.max_bpc = 12; priv = drm_kunit_helper_connector_hdmi_init_with_edid_funcs(test, - BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444), - 12, - &dummy_connector_hdmi_funcs, + &hdmi_funcs, test_edid_hdmi_1080p_rgb_yuv_dc_max_200mhz); KUNIT_ASSERT_NOT_NULL(test, priv); @@ -1970,6 +1964,7 @@ static void drm_test_check_output_bpc_format_driver_rgb_only(struct kunit *test) */ static void drm_test_check_output_bpc_format_display_rgb_only(struct kunit *test) { + struct drm_connector_hdmi_funcs hdmi_funcs = dummy_connector_hdmi_funcs; struct drm_atomic_helper_connector_hdmi_priv *priv; struct drm_modeset_acquire_ctx ctx; struct drm_connector_state *conn_state; @@ -1981,12 +1976,12 @@ static void drm_test_check_output_bpc_format_display_rgb_only(struct kunit *test struct drm_crtc *crtc; int ret; + hdmi_funcs.max_bpc = 12; + hdmi_funcs.supported_formats = BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444) | + BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR422) | + BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR444); priv = drm_kunit_helper_connector_hdmi_init_with_edid_funcs(test, - BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444) | - BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR422) | - BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR444), - 12, - &dummy_connector_hdmi_funcs, + &hdmi_funcs, test_edid_hdmi_1080p_rgb_max_200mhz); KUNIT_ASSERT_NOT_NULL(test, priv); @@ -2058,8 +2053,6 @@ static void drm_test_check_output_bpc_format_driver_8bpc_only(struct kunit *test int ret; priv = drm_kunit_helper_connector_hdmi_init_with_edid_funcs(test, - BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444), - 8, &dummy_connector_hdmi_funcs, test_edid_hdmi_1080p_rgb_yuv_dc_max_340mhz); KUNIT_ASSERT_NOT_NULL(test, priv); @@ -2112,6 +2105,7 @@ static void drm_test_check_output_bpc_format_driver_8bpc_only(struct kunit *test */ static void drm_test_check_output_bpc_format_display_8bpc_only(struct kunit *test) { + struct drm_connector_hdmi_funcs hdmi_funcs = dummy_connector_hdmi_funcs; struct drm_atomic_helper_connector_hdmi_priv *priv; struct drm_modeset_acquire_ctx ctx; struct drm_connector_state *conn_state; @@ -2123,12 +2117,12 @@ static void drm_test_check_output_bpc_format_display_8bpc_only(struct kunit *tes struct drm_crtc *crtc; int ret; + hdmi_funcs.max_bpc = 12; + hdmi_funcs.supported_formats = BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444) | + BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR422) | + BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR444); priv = drm_kunit_helper_connector_hdmi_init_with_edid_funcs(test, - BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444) | - BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR422) | - BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR444), - 12, - &dummy_connector_hdmi_funcs, + &hdmi_funcs, test_edid_hdmi_1080p_rgb_max_340mhz); KUNIT_ASSERT_NOT_NULL(test, priv); @@ -2187,9 +2181,7 @@ static void drm_test_check_disable_connector(struct kunit *test) struct drm_crtc *crtc; int ret; - priv = drm_kunit_helper_connector_hdmi_init(test, - BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444), - 8); + priv = drm_kunit_helper_connector_hdmi_init(test); KUNIT_ASSERT_NOT_NULL(test, priv); drm_modeset_acquire_init(&ctx, 0); @@ -2256,6 +2248,7 @@ struct color_format_test_param { */ static void drm_test_check_hdmi_color_format(struct kunit *test) { + struct drm_connector_hdmi_funcs hdmi_funcs = dummy_connector_hdmi_funcs; const struct color_format_test_param *param = test->param_value; struct drm_atomic_helper_connector_hdmi_priv *priv; struct drm_connector_state *conn_state; @@ -2266,13 +2259,13 @@ static void drm_test_check_hdmi_color_format(struct kunit *test) struct drm_display_mode *preferred; int ret; + hdmi_funcs.max_bpc = 12; + hdmi_funcs.supported_formats = BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444) | + BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR422) | + BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR420) | + BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR444); priv = drm_kunit_helper_connector_hdmi_init_with_edid_funcs(test, - BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444) | - BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR422) | - BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR420) | - BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR444), - 12, - &dummy_connector_hdmi_funcs, + &hdmi_funcs, test_edid_hdmi_4k_rgb_yuv420_dc_max_340mhz); KUNIT_ASSERT_NOT_NULL(test, priv); @@ -2364,6 +2357,7 @@ KUNIT_ARRAY_PARAM_DESC(check_hdmi_color_format, hdmi_color_format_params, desc); */ static void drm_test_check_hdmi_color_format_420_only(struct kunit *test) { + struct drm_connector_hdmi_funcs hdmi_funcs = dummy_connector_hdmi_funcs; const struct color_format_test_param *param = test->param_value; struct drm_atomic_helper_connector_hdmi_priv *priv; struct drm_connector_state *conn_state; @@ -2373,13 +2367,13 @@ static void drm_test_check_hdmi_color_format_420_only(struct kunit *test) struct drm_display_mode *dank; int ret; + hdmi_funcs.max_bpc = 12; + hdmi_funcs.supported_formats = BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444) | + BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR422) | + BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR420) | + BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR444); priv = drm_kunit_helper_connector_hdmi_init_with_edid_funcs(test, - BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444) | - BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR422) | - BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR420) | - BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR444), - 12, - &dummy_connector_hdmi_funcs, + &hdmi_funcs, test_edid_hdmi_1080p_rgb_yuv_4k_yuv420_dc_max_200mhz); KUNIT_ASSERT_NOT_NULL(test, priv); @@ -2507,9 +2501,7 @@ static void drm_test_check_broadcast_rgb_value(struct kunit *test) struct drm_connector_state *conn_state; struct drm_connector *conn; - priv = drm_kunit_helper_connector_hdmi_init(test, - BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444), - 8); + priv = drm_kunit_helper_connector_hdmi_init(test); KUNIT_ASSERT_NOT_NULL(test, priv); conn = &priv->connector; @@ -2529,9 +2521,7 @@ static void drm_test_check_bpc_8_value(struct kunit *test) struct drm_connector_state *conn_state; struct drm_connector *conn; - priv = drm_kunit_helper_connector_hdmi_init(test, - BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444), - 8); + priv = drm_kunit_helper_connector_hdmi_init(test); KUNIT_ASSERT_NOT_NULL(test, priv); conn = &priv->connector; @@ -2549,13 +2539,15 @@ static void drm_test_check_bpc_8_value(struct kunit *test) */ static void drm_test_check_bpc_10_value(struct kunit *test) { + struct drm_connector_hdmi_funcs hdmi_funcs = dummy_connector_hdmi_funcs; struct drm_atomic_helper_connector_hdmi_priv *priv; struct drm_connector_state *conn_state; struct drm_connector *conn; - priv = drm_kunit_helper_connector_hdmi_init(test, - BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444), - 10); + hdmi_funcs.max_bpc = 10; + priv = drm_kunit_helper_connector_hdmi_init_with_edid_funcs(test, + &hdmi_funcs, + test_edid_hdmi_1080p_rgb_max_200mhz); KUNIT_ASSERT_NOT_NULL(test, priv); conn = &priv->connector; @@ -2573,13 +2565,15 @@ static void drm_test_check_bpc_10_value(struct kunit *test) */ static void drm_test_check_bpc_12_value(struct kunit *test) { + struct drm_connector_hdmi_funcs hdmi_funcs = dummy_connector_hdmi_funcs; struct drm_atomic_helper_connector_hdmi_priv *priv; struct drm_connector_state *conn_state; struct drm_connector *conn; - priv = drm_kunit_helper_connector_hdmi_init(test, - BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444), - 12); + hdmi_funcs.max_bpc = 12; + priv = drm_kunit_helper_connector_hdmi_init_with_edid_funcs(test, + &hdmi_funcs, + test_edid_hdmi_1080p_rgb_max_200mhz); KUNIT_ASSERT_NOT_NULL(test, priv); conn = &priv->connector; @@ -2595,15 +2589,17 @@ static void drm_test_check_bpc_12_value(struct kunit *test) */ static void drm_test_check_format_value(struct kunit *test) { + struct drm_connector_hdmi_funcs hdmi_funcs = dummy_connector_hdmi_funcs; struct drm_atomic_helper_connector_hdmi_priv *priv; struct drm_connector_state *conn_state; struct drm_connector *conn; - priv = drm_kunit_helper_connector_hdmi_init(test, - BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444) | - BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR422) | - BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR444), - 8); + hdmi_funcs.supported_formats = BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444) | + BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR422) | + BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR444); + priv = drm_kunit_helper_connector_hdmi_init_with_edid_funcs(test, + &hdmi_funcs, + test_edid_hdmi_1080p_rgb_max_200mhz); KUNIT_ASSERT_NOT_NULL(test, priv); conn = &priv->connector; @@ -2617,15 +2613,18 @@ static void drm_test_check_format_value(struct kunit *test) */ static void drm_test_check_tmds_char_value(struct kunit *test) { + struct drm_connector_hdmi_funcs hdmi_funcs = dummy_connector_hdmi_funcs; struct drm_atomic_helper_connector_hdmi_priv *priv; struct drm_connector_state *conn_state; struct drm_connector *conn; - priv = drm_kunit_helper_connector_hdmi_init(test, - BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444) | - BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR422) | - BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR444), - 12); + hdmi_funcs.max_bpc = 12; + hdmi_funcs.supported_formats = BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444) | + BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR422) | + BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR444); + priv = drm_kunit_helper_connector_hdmi_init_with_edid_funcs(test, + &hdmi_funcs, + test_edid_hdmi_1080p_rgb_max_200mhz); KUNIT_ASSERT_NOT_NULL(test, priv); conn = &priv->connector; @@ -2659,9 +2658,7 @@ static void drm_test_check_mode_valid(struct kunit *test) struct drm_connector *conn; struct drm_display_mode *preferred; - priv = drm_kunit_helper_connector_hdmi_init(test, - BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444), - 8); + priv = drm_kunit_helper_connector_hdmi_init(test); KUNIT_ASSERT_NOT_NULL(test, priv); conn = &priv->connector; @@ -2684,8 +2681,6 @@ static void drm_test_check_mode_valid_reject_rate(struct kunit *test) struct drm_display_mode *preferred; priv = drm_kunit_helper_connector_hdmi_init_with_edid_funcs(test, - BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444), - 8, &reject_100mhz_connector_hdmi_funcs, test_edid_hdmi_1080p_rgb_max_200mhz); KUNIT_ASSERT_NOT_NULL(test, priv); @@ -2716,8 +2711,6 @@ static void drm_test_check_mode_valid_reject(struct kunit *test) int ret; priv = drm_kunit_helper_connector_hdmi_init_with_edid_funcs(test, - BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444), - 8, &reject_connector_hdmi_funcs, no_edid); KUNIT_ASSERT_NOT_NULL(test, priv); @@ -2746,8 +2739,6 @@ static void drm_test_check_mode_valid_reject_max_clock(struct kunit *test) struct drm_display_mode *preferred; priv = drm_kunit_helper_connector_hdmi_init_with_edid_funcs(test, - BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444), - 8, &dummy_connector_hdmi_funcs, test_edid_hdmi_1080p_rgb_max_100mhz); KUNIT_ASSERT_NOT_NULL(test, priv); @@ -2769,15 +2760,15 @@ static void drm_test_check_mode_valid_reject_max_clock(struct kunit *test) */ static void drm_test_check_mode_valid_yuv420_only_max_clock(struct kunit *test) { + struct drm_connector_hdmi_funcs hdmi_funcs = dummy_connector_hdmi_funcs; struct drm_atomic_helper_connector_hdmi_priv *priv; struct drm_display_mode *dank; struct drm_connector *conn; + hdmi_funcs.supported_formats = BIT(HDMI_COLORSPACE_RGB) | + BIT(HDMI_COLORSPACE_YUV420); priv = drm_kunit_helper_connector_hdmi_init_with_edid_funcs(test, - BIT(HDMI_COLORSPACE_RGB) | - BIT(HDMI_COLORSPACE_YUV420), - 8, - &dummy_connector_hdmi_funcs, + &hdmi_funcs, test_edid_hdmi_1080p_rgb_yuv_4k_yuv420_dc_max_200mhz); KUNIT_ASSERT_NOT_NULL(test, priv); @@ -2809,8 +2800,6 @@ drm_test_check_mode_valid_reject_yuv420_only_connector(struct kunit *test) struct drm_connector *conn; priv = drm_kunit_helper_connector_hdmi_init_with_edid_funcs(test, - BIT(HDMI_COLORSPACE_RGB), - 8, &dummy_connector_hdmi_funcs, test_edid_hdmi_1080p_rgb_yuv_4k_yuv420_dc_max_200mhz); KUNIT_ASSERT_NOT_NULL(test, priv); @@ -2835,8 +2824,6 @@ drm_test_check_mode_valid_accept_yuv420_also_connector_rgb(struct kunit *test) struct drm_connector *conn; priv = drm_kunit_helper_connector_hdmi_init_with_edid_funcs(test, - BIT(HDMI_COLORSPACE_RGB), - 8, &dummy_connector_hdmi_funcs, test_edid_hdmi_4k_rgb_yuv420_dc_max_340mhz); KUNIT_ASSERT_NOT_NULL(test, priv); @@ -2885,8 +2872,6 @@ static void drm_test_check_infoframes(struct kunit *test) int ret; priv = drm_kunit_helper_connector_hdmi_init_with_edid_funcs(test, - BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444), - 8, &dummy_connector_hdmi_funcs, test_edid_hdmi_1080p_rgb_max_200mhz); KUNIT_ASSERT_NOT_NULL(test, priv); @@ -2960,6 +2945,11 @@ static int reject_infoframe_write_infoframe(struct drm_connector *connector, } static const struct drm_connector_hdmi_funcs reject_avi_infoframe_hdmi_funcs = { + .vendor = "Vendor", + .product = "Product", + .supported_hdmi_ver = HDMI_VERSION_1_4, + .supported_formats = BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444), + .max_bpc = 8, .avi = { .clear_infoframe = accept_infoframe_clear_infoframe, .write_infoframe = reject_infoframe_write_infoframe, @@ -2988,8 +2978,6 @@ static void drm_test_check_reject_avi_infoframe(struct kunit *test) int ret; priv = drm_kunit_helper_connector_hdmi_init_with_edid_funcs(test, - BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444), - 8, &reject_avi_infoframe_hdmi_funcs, test_edid_hdmi_1080p_rgb_max_200mhz); KUNIT_ASSERT_NOT_NULL(test, priv); @@ -3059,6 +3047,11 @@ static void drm_test_check_reject_avi_infoframe(struct kunit *test) } static const struct drm_connector_hdmi_funcs reject_hdr_infoframe_hdmi_funcs = { + .vendor = "Vendor", + .product = "Product", + .supported_hdmi_ver = HDMI_VERSION_1_4, + .supported_formats = BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444), + .max_bpc = 8, .avi = { .clear_infoframe = accept_infoframe_clear_infoframe, .write_infoframe = accept_infoframe_write_infoframe, @@ -3092,8 +3085,6 @@ static void drm_test_check_reject_hdr_infoframe_bpc_8(struct kunit *test) int ret; priv = drm_kunit_helper_connector_hdmi_init_with_edid_funcs(test, - BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444), - 8, &reject_hdr_infoframe_hdmi_funcs, test_edid_hdmi_1080p_rgb_max_200mhz_hdr); KUNIT_ASSERT_NOT_NULL(test, priv); @@ -3190,6 +3181,7 @@ static void drm_test_check_reject_hdr_infoframe_bpc_8(struct kunit *test) */ static void drm_test_check_reject_hdr_infoframe_bpc_10(struct kunit *test) { + struct drm_connector_hdmi_funcs hdmi_funcs = reject_hdr_infoframe_hdmi_funcs; struct drm_atomic_helper_connector_hdmi_priv *priv; struct drm_modeset_acquire_ctx ctx; struct drm_atomic_commit *state; @@ -3205,10 +3197,9 @@ static void drm_test_check_reject_hdr_infoframe_bpc_10(struct kunit *test) bool replaced; int ret; + hdmi_funcs.max_bpc = 10; priv = drm_kunit_helper_connector_hdmi_init_with_edid_funcs(test, - BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444), - 10, - &reject_hdr_infoframe_hdmi_funcs, + &hdmi_funcs, test_edid_hdmi_1080p_rgb_max_200mhz_hdr); KUNIT_ASSERT_NOT_NULL(test, priv); @@ -3307,6 +3298,11 @@ static void drm_test_check_reject_hdr_infoframe_bpc_10(struct kunit *test) } static const struct drm_connector_hdmi_funcs reject_audio_infoframe_hdmi_funcs = { + .vendor = "Vendor", + .product = "Product", + .supported_hdmi_ver = HDMI_VERSION_1_4, + .supported_formats = BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444), + .max_bpc = 8, .avi = { .clear_infoframe = accept_infoframe_clear_infoframe, .write_infoframe = accept_infoframe_write_infoframe, @@ -3341,8 +3337,6 @@ static void drm_test_check_reject_audio_infoframe(struct kunit *test) int ret; priv = drm_kunit_helper_connector_hdmi_init_with_edid_funcs(test, - BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444), - 8, &reject_audio_infoframe_hdmi_funcs, test_edid_hdmi_1080p_rgb_max_200mhz); KUNIT_ASSERT_NOT_NULL(test, priv); From patchwork Fri Jul 31 16:20:11 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Ciocaltea X-Patchwork-Id: 2874 Return-Path: X-Original-To: noreply@patchwork.local Delivered-To: noreply@patchwork.local Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114]) by mxe881.netcup.net (Postfix) with ESMTPS id 328AF1C236B for ; Fri, 31 Jul 2026 18:45:04 +0200 (CEST) Authentication-Results: mxe881; dkim=pass header.d=collabora.com; spf=pass (sender IP is 172.105.105.114) smtp.mailfrom=linux-sunxi+bounces-24878-noreply=patchwork.local@lists.linux.dev smtp.helo=tor.lore.kernel.org Received-SPF: pass (mxe881: domain of lists.linux.dev designates 172.105.105.114 as permitted sender) client-ip=172.105.105.114; envelope-from=linux-sunxi+bounces-24878-noreply=patchwork.local@lists.linux.dev; helo=tor.lore.kernel.org; Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by tor.lore.kernel.org (Postfix) with ESMTP id 471E03040C5C for ; Fri, 31 Jul 2026 16:27:30 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EF8F846F485; Fri, 31 Jul 2026 16:20:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="gsBsKEyr" X-Original-To: linux-sunxi@lists.linux.dev Received: from bali.collaboradmins.com (bali.collaboradmins.com [148.251.105.195]) (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 4D5AB46C849 for ; Fri, 31 Jul 2026 16:20:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.251.105.195 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785514823; cv=none; b=IKC5StmQI/O4FBobm4LxLp75ngDIaNLWb8OEOqj0x54lNkXJ6frx69vmWdbgqhWZwz4+wEudYPrGeCuBATPEClBU/PJ/vgipwk+vCqayF5xeejIbprWySWWA0of3P8CDfgu45vQU9ABBrMadXGoEsrzMB+LTU1arSma2NzMc0go= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785514823; c=relaxed/simple; bh=kA6nVSOFOk0yymzKaCCJLaqlyDMieIsqeSwOvsCsQw8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=YG2VCTrxdNkzPOaTdy4vPVelgNobuwI2kWRw+QgZxXk2/HJtChmSf5xapFoQzNeoPI5W/MUviAs+xJJwbF2Rfk69hpiROz3zua9ULCKwqZGV1XftCZ6Ul2ZgPAvCXP7fqXk4BWWc7/kLHcKW3bFKNs5Wvf2Q4CbdryIWVKOcGR0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=gsBsKEyr; arc=none smtp.client-ip=148.251.105.195 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1785514800; bh=kA6nVSOFOk0yymzKaCCJLaqlyDMieIsqeSwOvsCsQw8=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=gsBsKEyrH+QYLVtyIIhw4WsfchROQj9KLHlsFV16a+zYXPiYch02urhgW+dCB6eRP L8PuUyaHvVDzoaFbi2Atg/pHvQohR2mlEfB3FfqZQY7BJJicfFiHSy9Uc8DE1KHctF AQqmRplXx6o46QmVkwPp/EAp7ggn1jwXFGFnr5EEWYCLw1psNl2U1A8tcyWi243p0Z YgIyL3VYtSsfIGcbnmRk+FImjMHIRZrrSihkWdsy5rxvHxHdSl3N/ejenV2tZL4ZtT 3F5ikocxfwCKkmgsLTqMJ07Qs2036jCCSqur/DJunzoj5a8zExUaV8qUuAZ3MnGzG3 MtvgZSJ+fvB+A== Received: from localhost (unknown [100.64.0.241]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange secp256r1 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: cristicc) by bali.collaboradmins.com (Postfix) with ESMTPSA id 3E30D17E093E; Fri, 31 Jul 2026 18:20:00 +0200 (CEST) From: Cristian Ciocaltea Date: Fri, 31 Jul 2026 19:20:11 +0300 Subject: [PATCH v10 64/69] drm/tests: hdmi_state_helper: Add connector-provided max_tmds_char_rate coverage Precedence: bulk X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20260731-dw-hdmi-qp-scramb-v10-64-294364b2cf15@collabora.com> References: <20260731-dw-hdmi-qp-scramb-v10-0-294364b2cf15@collabora.com> In-Reply-To: <20260731-dw-hdmi-qp-scramb-v10-0-294364b2cf15@collabora.com> To: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Luca Ceresoli , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Chen-Yu Tsai , Samuel Holland , Dave Stevenson , =?utf-8?q?Ma=C3=ADra_Canal?= , Raspberry Pi Kernel Maintenance , Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Andy Yan , Algea Cao , Daniel Stone , Liu Ying , Phong LE Cc: kernel@collabora.com, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-rockchip@lists.infradead.org X-Mailer: b4 0.15.2 X-MORS-Enabled: yes X-MORS-DOMAIN: patchwork.local X-MORS-HOSTING: hosting172546 X-MORS-USER: hosting172546 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= Test the hdmi_clock_valid() logic that rejects modes whose TMDS character rate exceeds connector->hdmi.max_tmds_char_rate. Exercise both an explicit limit set through drm_connector_hdmi_funcs' supported_tmds_char_rate and the limit inferred from supported_hdmi_ver. Also verify that a driver hook can further restrict the connector limit. Signed-off-by: Cristian Ciocaltea --- drivers/gpu/drm/tests/drm_hdmi_state_helper_test.c | 116 +++++++++++++++++++++ 1 file changed, 116 insertions(+) diff --git a/drivers/gpu/drm/tests/drm_hdmi_state_helper_test.c b/drivers/gpu/drm/tests/drm_hdmi_state_helper_test.c index f35dc31326bc..6d648332aa15 100644 --- a/drivers/gpu/drm/tests/drm_hdmi_state_helper_test.c +++ b/drivers/gpu/drm/tests/drm_hdmi_state_helper_test.c @@ -190,6 +190,32 @@ static const struct drm_connector_hdmi_funcs reject_100mhz_connector_hdmi_funcs }, }; +static enum drm_mode_status +accept_any_connector_tmds_char_rate_valid(const struct drm_connector *connector, + const struct drm_display_mode *mode, + unsigned long long tmds_rate) +{ + return MODE_OK; +} + +static const struct drm_connector_hdmi_funcs reject_over_165mhz_connector_hdmi_funcs = { + .vendor = "Vendor", + .product = "Product", + .supported_hdmi_ver = HDMI_VERSION_1_3, + .supported_tmds_char_rate = HDMI_1_0_TMDS_CHAR_RATE_MAX_HZ, + .supported_formats = BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444), + .max_bpc = 8, + .tmds_char_rate_valid = accept_any_connector_tmds_char_rate_valid, + .avi = { + .clear_infoframe = accept_infoframe_clear_infoframe, + .write_infoframe = accept_infoframe_write_infoframe, + }, + .hdmi = { + .clear_infoframe = accept_infoframe_clear_infoframe, + .write_infoframe = accept_infoframe_write_infoframe, + }, +}; + static int dummy_connector_get_modes(struct drm_connector *connector) { struct drm_atomic_helper_connector_hdmi_priv *priv = @@ -2753,6 +2779,93 @@ static void drm_test_check_mode_valid_reject_max_clock(struct kunit *test) KUNIT_EXPECT_EQ(test, preferred->clock, 25200); } +/* + * Test that the max_tmds_char_rate inferred from caps.supported_hdmi_ver + * is applied as a mode-filtering limit: with an HDMI 1.3 connector and no + * driver hook, drm_hdmi_connector_mode_valid() will reject modes whose TMDS + * character rate exceeds 340 MHz, even though the sink itself advertises + * a higher limit (600 MHz). + */ +static void +drm_test_check_mode_valid_reject_inferred_max_tmds_char_rate(struct kunit *test) +{ + struct drm_connector_hdmi_funcs hdmi_funcs = dummy_connector_hdmi_funcs; + struct drm_atomic_helper_connector_hdmi_priv *priv; + struct drm_display_mode *preferred; + + hdmi_funcs.supported_hdmi_ver = HDMI_VERSION_1_3; + + priv = drm_kunit_helper_connector_hdmi_init_with_edid_funcs(test, &hdmi_funcs, + test_edid_hdmi_4k_rgb_yuv420_dc_max_600mhz); + KUNIT_ASSERT_NOT_NULL(test, priv); + + KUNIT_ASSERT_EQ(test, priv->connector.hdmi.max_tmds_char_rate, + HDMI_1_3_TMDS_CHAR_RATE_MAX_HZ); + + preferred = find_preferred_mode(&priv->connector); + KUNIT_ASSERT_NOT_NULL(test, preferred); + KUNIT_EXPECT_EQ(test, preferred->hdisplay, 2560); + KUNIT_EXPECT_EQ(test, preferred->vdisplay, 1600); + KUNIT_EXPECT_EQ(test, preferred->clock, 268500); +} + +/* + * Test that a connector-provided max_tmds_char_rate limit (165 MHz) takes + * precedence over a permissive .tmds_char_rate_valid() driver hook and + * drm_hdmi_connector_mode_valid() will reject modes whose computed TMDS + * character exceeds the connector limit. + */ +static void +drm_test_check_mode_valid_connector_max_tmds_char_rate_precedes_driver_hook(struct kunit *test) +{ + struct drm_atomic_helper_connector_hdmi_priv *priv; + struct drm_display_mode *preferred; + + priv = drm_kunit_helper_connector_hdmi_init_with_edid_funcs(test, + &reject_over_165mhz_connector_hdmi_funcs, + test_edid_hdmi_4k_rgb_yuv420_dc_max_600mhz); + KUNIT_ASSERT_NOT_NULL(test, priv); + + KUNIT_ASSERT_EQ(test, priv->connector.hdmi.max_tmds_char_rate, + HDMI_1_0_TMDS_CHAR_RATE_MAX_HZ); + + preferred = find_preferred_mode(&priv->connector); + KUNIT_ASSERT_NOT_NULL(test, preferred); + KUNIT_EXPECT_EQ(test, preferred->hdisplay, 2048); + KUNIT_EXPECT_EQ(test, preferred->vdisplay, 1152); + KUNIT_EXPECT_EQ(test, preferred->clock, 162000); +} + +/* + * Test that a connector-provided max_tmds_char_rate (165 MHz) can be further + * limited by a more restrictive (100 MHz) .tmds_char_rate_valid() driver hook + * and drm_hdmi_connector_mode_valid() will reject modes whose computed TMDS + * character exceeds the hook limit. + */ +static void +drm_test_check_mode_valid_driver_hook_limits_connector_max_tmds_char_rate(struct kunit *test) +{ + struct drm_connector_hdmi_funcs hdmi_funcs = reject_100mhz_connector_hdmi_funcs; + struct drm_atomic_helper_connector_hdmi_priv *priv; + struct drm_display_mode *preferred; + + hdmi_funcs.supported_hdmi_ver = HDMI_VERSION_1_3; + hdmi_funcs.supported_tmds_char_rate = HDMI_1_0_TMDS_CHAR_RATE_MAX_HZ; + + priv = drm_kunit_helper_connector_hdmi_init_with_edid_funcs(test, &hdmi_funcs, + test_edid_hdmi_4k_rgb_yuv420_dc_max_600mhz); + KUNIT_ASSERT_NOT_NULL(test, priv); + + KUNIT_ASSERT_EQ(test, priv->connector.hdmi.max_tmds_char_rate, + HDMI_1_0_TMDS_CHAR_RATE_MAX_HZ); + + preferred = find_preferred_mode(&priv->connector); + KUNIT_ASSERT_NOT_NULL(test, preferred); + KUNIT_EXPECT_EQ(test, preferred->hdisplay, 1440); + KUNIT_EXPECT_EQ(test, preferred->vdisplay, 900); + KUNIT_EXPECT_EQ(test, preferred->clock, 88750); +} + /* * Test that drm_hdmi_connector_mode_valid() will accept modes that require a * 4:2:0 chroma subsampling, even if said mode would violate maximum clock @@ -2843,6 +2956,9 @@ static struct kunit_case drm_atomic_helper_connector_hdmi_mode_valid_tests[] = { KUNIT_CASE(drm_test_check_mode_valid_reject), KUNIT_CASE(drm_test_check_mode_valid_reject_rate), KUNIT_CASE(drm_test_check_mode_valid_reject_max_clock), + KUNIT_CASE(drm_test_check_mode_valid_reject_inferred_max_tmds_char_rate), + KUNIT_CASE(drm_test_check_mode_valid_connector_max_tmds_char_rate_precedes_driver_hook), + KUNIT_CASE(drm_test_check_mode_valid_driver_hook_limits_connector_max_tmds_char_rate), KUNIT_CASE(drm_test_check_mode_valid_yuv420_only_max_clock), KUNIT_CASE(drm_test_check_mode_valid_reject_yuv420_only_connector), KUNIT_CASE(drm_test_check_mode_valid_accept_yuv420_also_connector_rgb), From patchwork Fri Jul 31 16:20:12 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Ciocaltea X-Patchwork-Id: 2873 Return-Path: X-Original-To: noreply@patchwork.local Delivered-To: noreply@patchwork.local Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114]) by mxe881.netcup.net (Postfix) with ESMTPS id 134FF1C230A for ; Fri, 31 Jul 2026 18:44:37 +0200 (CEST) Authentication-Results: mxe881; dkim=pass header.d=collabora.com; spf=pass (sender IP is 172.105.105.114) smtp.mailfrom=linux-sunxi+bounces-24875-noreply=patchwork.local@lists.linux.dev smtp.helo=tor.lore.kernel.org Received-SPF: pass (mxe881: domain of lists.linux.dev designates 172.105.105.114 as permitted sender) client-ip=172.105.105.114; envelope-from=linux-sunxi+bounces-24875-noreply=patchwork.local@lists.linux.dev; helo=tor.lore.kernel.org; Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by tor.lore.kernel.org (Postfix) with ESMTP id 2FA573030243 for ; Fri, 31 Jul 2026 16:27:00 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 37CD746EC72; Fri, 31 Jul 2026 16:20:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="p9XQARIx" X-Original-To: linux-sunxi@lists.linux.dev Received: from bali.collaboradmins.com (bali.collaboradmins.com [148.251.105.195]) (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 4BA7546C846 for ; Fri, 31 Jul 2026 16:20:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.251.105.195 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785514820; cv=none; b=fQEOF26VUvR4W5tfAnN0ipy/STKjDKqx43q4YgUkxhGeu0sr6afBBkeaPtxTGRQ7tq6QYlvgFa84l/dIVfM1vSjcaW+K0NPrzdXozhNLW4tdjsmvz2B9YfrDx26888mIUcAUNw5qUaZsV3Gf8WX5vVkJXQTUVnx0wpwJUCQhHTk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785514820; c=relaxed/simple; bh=vWcJ/JgrICjAc8uhqU0IXmoYxp/H9UrDLzNmmi7RCMs=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=dS13OyNgSDDtbDpJ2WMhZ1G2xnS8VcP/wkcaVtwiKtQHkTPSkD5IGi67QsjpGirGPD/+xuPxXSVYM8ohOe5PdQV4wbrgRKTWVAOQ5cFJKxQalc2WyfkdH/pFHtCfjF3Zqe3zFTv+uo6UFSwuZq2xpn2QS/dkHJfvDL5rdxpExp4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=p9XQARIx; arc=none smtp.client-ip=148.251.105.195 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1785514801; bh=vWcJ/JgrICjAc8uhqU0IXmoYxp/H9UrDLzNmmi7RCMs=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=p9XQARIxBBnMZPKg8/va8IlWbRR50o3FETfmVCCp8aHR0YPN7W3AhIPJ6aR8N61tF AbopA7VeDxkf1MgYvERrjrlbZfXvZoQcwvKPdnznlmidnQ2GwRcYcNzaSr7hw5+8pB 3e9LxwO1fHMWxgQSbr3SXd2QvNP+CB2KZ+wD1QMVv9a3NzwIfKcq8m8qHRDcCJ57bl NJFhOXvc0QQfBSBdtZFOmWevxWiuUz3+MU9tJ/Z/xOTgOuuocImp5LFjdACqr3c9W+ OICIbkuYPxOeCytKyxajMknIP9UQn2WFjNwbfUBMwVB0h3cLfknlIrq9Ds3Z4PruSO rAjdKF54OypVw== Received: from localhost (unknown [100.64.0.241]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange secp256r1 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: cristicc) by bali.collaboradmins.com (Postfix) with ESMTPSA id E149F17E098E; Fri, 31 Jul 2026 18:20:00 +0200 (CEST) From: Cristian Ciocaltea Date: Fri, 31 Jul 2026 19:20:12 +0300 Subject: [PATCH v10 65/69] drm/tests: hdmi_state_helper: Cover source-side scrambling decision Precedence: bulk X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20260731-dw-hdmi-qp-scramb-v10-65-294364b2cf15@collabora.com> References: <20260731-dw-hdmi-qp-scramb-v10-0-294364b2cf15@collabora.com> In-Reply-To: <20260731-dw-hdmi-qp-scramb-v10-0-294364b2cf15@collabora.com> To: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Luca Ceresoli , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Chen-Yu Tsai , Samuel Holland , Dave Stevenson , =?utf-8?q?Ma=C3=ADra_Canal?= , Raspberry Pi Kernel Maintenance , Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Andy Yan , Algea Cao , Daniel Stone , Liu Ying , Phong LE Cc: kernel@collabora.com, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-rockchip@lists.infradead.org X-Mailer: b4 0.15.2 X-MORS-Enabled: yes X-MORS-DOMAIN: patchwork.local X-MORS-HOSTING: hosting172546 X-MORS-USER: hosting172546 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= Add a couple of atomic-check cases that initialise an HDMI 2.0 connector, so the core infers the scrambler support and the 600 MHz TMDS limit, and assert that conn_state->hdmi.scrambler_needed stays clear for a 1080p@60 CEA mode (~148.5 MHz TMDS) and is set for the 4K@60 RGB preferred mode (~594 MHz TMDS), straddling the 340 MHz threshold. Signed-off-by: Cristian Ciocaltea --- drivers/gpu/drm/tests/drm_hdmi_state_helper_test.c | 151 +++++++++++++++++++++ 1 file changed, 151 insertions(+) diff --git a/drivers/gpu/drm/tests/drm_hdmi_state_helper_test.c b/drivers/gpu/drm/tests/drm_hdmi_state_helper_test.c index 6d648332aa15..68b442c32a2a 100644 --- a/drivers/gpu/drm/tests/drm_hdmi_state_helper_test.c +++ b/drivers/gpu/drm/tests/drm_hdmi_state_helper_test.c @@ -216,6 +216,34 @@ static const struct drm_connector_hdmi_funcs reject_over_165mhz_connector_hdmi_f }, }; +static int accept_scrambler_enable(struct drm_connector *connector) +{ + return 0; +} + +static int accept_scrambler_disable(struct drm_connector *connector) +{ + return 0; +} + +static const struct drm_connector_hdmi_funcs scrambler_connector_hdmi_funcs = { + .vendor = "Vendor", + .product = "Product", + .supported_hdmi_ver = HDMI_VERSION_2_0, + .supported_formats = BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444), + .max_bpc = 8, + .scrambler_enable = accept_scrambler_enable, + .scrambler_disable = accept_scrambler_disable, + .avi = { + .clear_infoframe = accept_infoframe_clear_infoframe, + .write_infoframe = accept_infoframe_write_infoframe, + }, + .hdmi = { + .clear_infoframe = accept_infoframe_clear_infoframe, + .write_infoframe = accept_infoframe_write_infoframe, + }, +}; + static int dummy_connector_get_modes(struct drm_connector *connector) { struct drm_atomic_helper_connector_hdmi_priv *priv = @@ -2254,6 +2282,127 @@ static void drm_test_check_disable_connector(struct kunit *test) drm_modeset_acquire_fini(&ctx); } +/* + * Test that on an HDMI connector with source+sink scrambling support, driving + * a sub-340 MHz CEA mode, we end up with scrambler_needed cleared. + */ +static void drm_test_check_scrambler_needed_low_rate(struct kunit *test) +{ + struct drm_atomic_helper_connector_hdmi_priv *priv; + struct drm_modeset_acquire_ctx ctx; + struct drm_connector_state *conn_state; + struct drm_display_info *info; + struct drm_display_mode *low_rate_mode; + struct drm_connector *conn; + struct drm_device *drm; + struct drm_crtc *crtc; + unsigned long long rate; + int ret; + + priv = drm_kunit_helper_connector_hdmi_init_with_edid_funcs(test, + &scrambler_connector_hdmi_funcs, + test_edid_hdmi_4k_rgb_yuv420_dc_max_600mhz); + KUNIT_ASSERT_NOT_NULL(test, priv); + + drm = &priv->drm; + crtc = priv->crtc; + conn = &priv->connector; + info = &conn->display_info; + KUNIT_ASSERT_TRUE(test, drm_connector_hdmi_scrambler_supported(conn)); + KUNIT_ASSERT_TRUE(test, info->is_hdmi); + KUNIT_ASSERT_TRUE(test, info->hdmi.scdc.supported); + KUNIT_ASSERT_TRUE(test, info->hdmi.scdc.scrambling.supported); + + low_rate_mode = drm_kunit_display_mode_from_cea_vic(test, drm, 16); + KUNIT_ASSERT_NOT_NULL(test, low_rate_mode); + + rate = drm_hdmi_compute_mode_clock(low_rate_mode, 8, DRM_OUTPUT_COLOR_FORMAT_RGB444); + KUNIT_ASSERT_LT(test, rate, HDMI_1_3_TMDS_CHAR_RATE_MAX_HZ); + + drm_modeset_acquire_init(&ctx, 0); + +retry_conn_enable: + ret = drm_kunit_helper_enable_crtc_connector(test, drm, crtc, conn, + low_rate_mode, &ctx); + if (ret == -EDEADLK) { + ret = drm_modeset_backoff(&ctx); + if (!ret) + goto retry_conn_enable; + } + KUNIT_ASSERT_EQ(test, ret, 0); + + conn_state = conn->state; + KUNIT_ASSERT_NOT_NULL(test, conn_state); + + KUNIT_EXPECT_LE(test, conn_state->hdmi.tmds_char_rate, + HDMI_1_3_TMDS_CHAR_RATE_MAX_HZ); + KUNIT_EXPECT_FALSE(test, conn_state->hdmi.scrambler_needed); + + drm_modeset_drop_locks(&ctx); + drm_modeset_acquire_fini(&ctx); +} + +/* + * Test that on an HDMI connector with source+sink scrambling support, driving + * the 4K@60 RGB preferred mode (~594 MHz TMDS, above the 340 MHz threshold), + * we end up with scrambler_needed set. + */ +static void drm_test_check_scrambler_needed_high_rate(struct kunit *test) +{ + struct drm_atomic_helper_connector_hdmi_priv *priv; + struct drm_modeset_acquire_ctx ctx; + struct drm_connector_state *conn_state; + struct drm_display_info *info; + struct drm_display_mode *preferred; + struct drm_connector *conn; + struct drm_device *drm; + struct drm_crtc *crtc; + unsigned long long rate; + int ret; + + priv = drm_kunit_helper_connector_hdmi_init_with_edid_funcs(test, + &scrambler_connector_hdmi_funcs, + test_edid_hdmi_4k_rgb_yuv420_dc_max_600mhz); + KUNIT_ASSERT_NOT_NULL(test, priv); + + drm = &priv->drm; + crtc = priv->crtc; + conn = &priv->connector; + info = &conn->display_info; + KUNIT_ASSERT_TRUE(test, drm_connector_hdmi_scrambler_supported(conn)); + KUNIT_ASSERT_TRUE(test, info->is_hdmi); + KUNIT_ASSERT_TRUE(test, info->hdmi.scdc.supported); + KUNIT_ASSERT_TRUE(test, info->hdmi.scdc.scrambling.supported); + + preferred = find_preferred_mode(conn); + KUNIT_ASSERT_NOT_NULL(test, preferred); + + rate = drm_hdmi_compute_mode_clock(preferred, 8, DRM_OUTPUT_COLOR_FORMAT_RGB444); + KUNIT_ASSERT_GT(test, rate, HDMI_1_3_TMDS_CHAR_RATE_MAX_HZ); + + drm_modeset_acquire_init(&ctx, 0); + +retry_conn_enable: + ret = drm_kunit_helper_enable_crtc_connector(test, drm, crtc, conn, + preferred, &ctx); + if (ret == -EDEADLK) { + ret = drm_modeset_backoff(&ctx); + if (!ret) + goto retry_conn_enable; + } + KUNIT_ASSERT_EQ(test, ret, 0); + + conn_state = conn->state; + KUNIT_ASSERT_NOT_NULL(test, conn_state); + + KUNIT_EXPECT_GT(test, conn_state->hdmi.tmds_char_rate, + HDMI_1_3_TMDS_CHAR_RATE_MAX_HZ); + KUNIT_EXPECT_TRUE(test, conn_state->hdmi.scrambler_needed); + + drm_modeset_drop_locks(&ctx); + drm_modeset_acquire_fini(&ctx); +} + struct color_format_test_param { enum drm_connector_color_format fmt; enum drm_output_color_format expected; @@ -2496,6 +2645,8 @@ static struct kunit_case drm_atomic_helper_connector_hdmi_check_tests[] = { KUNIT_CASE(drm_test_check_tmds_char_rate_rgb_8bpc), KUNIT_CASE(drm_test_check_tmds_char_rate_rgb_10bpc), KUNIT_CASE(drm_test_check_tmds_char_rate_rgb_12bpc), + KUNIT_CASE(drm_test_check_scrambler_needed_low_rate), + KUNIT_CASE(drm_test_check_scrambler_needed_high_rate), KUNIT_CASE_PARAM(drm_test_check_hdmi_color_format, check_hdmi_color_format_gen_params), KUNIT_CASE_PARAM(drm_test_check_hdmi_color_format_420_only, From patchwork Fri Jul 31 16:20:13 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Ciocaltea X-Patchwork-Id: 2865 Return-Path: X-Original-To: noreply@patchwork.local Delivered-To: noreply@patchwork.local Received: from sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74]) by mxe881.netcup.net (Postfix) with ESMTPS id 71DB51C22FA for ; Fri, 31 Jul 2026 18:41:31 +0200 (CEST) Authentication-Results: mxe881; dkim=pass header.d=collabora.com; spf=pass (sender IP is 172.232.135.74) smtp.mailfrom=linux-sunxi+bounces-24870-noreply=patchwork.local@lists.linux.dev smtp.helo=sto.lore.kernel.org Received-SPF: pass (mxe881: domain of lists.linux.dev designates 172.232.135.74 as permitted sender) client-ip=172.232.135.74; envelope-from=linux-sunxi+bounces-24870-noreply=patchwork.local@lists.linux.dev; helo=sto.lore.kernel.org; Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by sto.lore.kernel.org (Postfix) with ESMTP id 366923131825 for ; Fri, 31 Jul 2026 16:26:13 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A327346D2AC; Fri, 31 Jul 2026 16:20:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="m8DFbOHE" X-Original-To: linux-sunxi@lists.linux.dev Received: from bali.collaboradmins.com (bali.collaboradmins.com [148.251.105.195]) (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 552D346C84E for ; Fri, 31 Jul 2026 16:20:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.251.105.195 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785514814; cv=none; b=kGw897u7mdxbqId8SqDEGaoYu/9tq+li5SMHVjIErrPGaECHj2Lg2JCttz4qMnIJBMJau6eOTMoOYO7SBbCVQz12LdFtiYZFEx/fI1qE9wiL9yVH6ACdik29456B/rECLv4KJ/BTdr9ooWaL9RZmc0GqjOqZcXJ/+iLbAPQ/BE8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785514814; c=relaxed/simple; bh=kOveINEPDFE/jpZ1VqhFveSV7JndBzIfgD4lhHc2Xo8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=iGgUknWOCTmaKjTY+thuZcJIhUv6fptMtmwLo+sndgT4N2bcNcNS06AJ60XUWsKbqzBZiONMT4dJuKyLehNHJqpbGWhvf+9tEZEd/idSEUELsjhjyb6FY5MFaO/wdD2FnIKafUTNza/Zjp19j0wJZk4ZBvOxNIZ1ckeg8lZq7D4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=m8DFbOHE; arc=none smtp.client-ip=148.251.105.195 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1785514801; bh=kOveINEPDFE/jpZ1VqhFveSV7JndBzIfgD4lhHc2Xo8=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=m8DFbOHEzohSYO8ghsln1aKvFG4vYuqTVR9UJvs4pq9rrLSEuhF3YtvhRhSJB/IUa 6rmYffFPV5hwtmRhSY8B5BhaxLkPofyj132CkAZtT+/XpohuJGCyvEZPYPa9+Wrtnp 5Wx+urHWE93QSFQVCii4XutprFif2/Ig6GPocW3SoazXMpR0++VJ5cBSmHngN0vNPM aoBiB0tmrXqCNYYv08pTcwnE8Su02BW5ty7aes9n8am30ZB5ekG2pa2kqv7d1oU8HE 7Zamw8BrsGv3e2R7OAaA2Ee4gDbDlzpWnOknPkqUe7CLCnM/Q4RG2XKD2PZBBiePN5 8NRzH35MjWRNA== Received: from localhost (unknown [100.64.0.241]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange secp256r1 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: cristicc) by bali.collaboradmins.com (Postfix) with ESMTPSA id 9230D17E0B18; Fri, 31 Jul 2026 18:20:01 +0200 (CEST) From: Cristian Ciocaltea Date: Fri, 31 Jul 2026 19:20:13 +0300 Subject: [PATCH v10 66/69] drm/connector: Remove drmm_connector_hdmi_ini2() Precedence: bulk X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20260731-dw-hdmi-qp-scramb-v10-66-294364b2cf15@collabora.com> References: <20260731-dw-hdmi-qp-scramb-v10-0-294364b2cf15@collabora.com> In-Reply-To: <20260731-dw-hdmi-qp-scramb-v10-0-294364b2cf15@collabora.com> To: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Luca Ceresoli , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Chen-Yu Tsai , Samuel Holland , Dave Stevenson , =?utf-8?q?Ma=C3=ADra_Canal?= , Raspberry Pi Kernel Maintenance , Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Andy Yan , Algea Cao , Daniel Stone , Liu Ying , Phong LE Cc: kernel@collabora.com, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-rockchip@lists.infradead.org, Diederik de Haas X-Mailer: b4 0.15.2 X-Rspamd-Server: rspamd-worker-8404 X-Spamd-Result: default: False [-2.16 / 15.00]; BAYES_HAM(-5.50)[100.00%]; RBL_SENDERSCORE(2.00)[172.232.135.74:from]; SUSPICIOUS_RECIPS(1.50)[]; MAILLIST(-0.15)[generic]; BAD_REP_POLICIES(0.10)[]; MIME_GOOD(-0.10)[text/plain]; HAS_LIST_UNSUB(-0.01)[]; RCVD_COUNT_FIVE(0.00)[5]; ARC_ALLOW(0.00)[subspace.kernel.org:s=arc-20240116:i=1]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_TWELVE(0.00)[31]; PRECEDENCE_BULK(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[sto.lore.kernel.org:rdns,sto.lore.kernel.org:helo,cknow-tech.com:email,collabora.com:email,collabora.com:dkim]; TAGGED_RCPT(0.00)[]; FORGED_SENDER_MAILLIST(0.00)[]; R_DKIM_ALLOW(0.00)[collabora.com:s=mail]; ASN(0.00)[asn:63949, ipnet:172.232.128.0/19, country:SG]; DKIM_TRACE(0.00)[collabora.com:+]; DMARC_POLICY_ALLOW(0.00)[collabora.com,none]; R_SPF_ALLOW(0.00)[+ip4:172.232.135.74:c]; TO_DN_SOME(0.00)[]; FROM_NEQ_ENVFROM(0.00)[cristian.ciocaltea@collabora.com,linux-sunxi@lists.linux.dev]; FREEMAIL_TO(0.00)[intel.com,linaro.org,kernel.org,ideasonboard.com,kwiboo.se,gmail.com,bootlin.com,linux.intel.com,suse.de,ffwll.ch,sholland.org,raspberrypi.com,igalia.com,rock-chips.com,sntech.de,collabora.com,nxp.com,baylibre.com]; MIME_TRACE(0.00)[0:+]; TAGGED_FROM(0.00)[bounces-24870-noreply=patchwork.local]; FORGED_RECIPIENTS_MAILLIST(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[] X-Rspamd-Queue-Id: 71DB51C22FA X-MORS-Enabled: yes X-MORS-DOMAIN: patchwork.local X-MORS-HOSTING: hosting172546 X-MORS-USER: hosting172546 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= All callers have been converted to the new drmm_connector_hdmi_init() signature. Remove the transitional drmm_connector_hdmi_ini2() function, its declaration, its EXPORT_SYMBOL() and its kernel-doc. Tested-by: Diederik de Haas # NanoPC-T6 LTS, Rock 5B Signed-off-by: Cristian Ciocaltea --- drivers/gpu/drm/drm_connector.c | 106 ---------------------------------------- include/drm/drm_connector.h | 9 ---- 2 files changed, 115 deletions(-) diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c index a18410faf040..b2e8d99c0e9a 100644 --- a/drivers/gpu/drm/drm_connector.c +++ b/drivers/gpu/drm/drm_connector.c @@ -696,112 +696,6 @@ int drmm_connector_hdmi_init(struct drm_device *dev, } EXPORT_SYMBOL(drmm_connector_hdmi_init); -/** - * drmm_connector_hdmi_ini2 - Init a preallocated HDMI connector - * @dev: DRM device - * @connector: A pointer to the HDMI connector to init - * @vendor: HDMI Controller Vendor name - * @product: HDMI Controller Product name - * @funcs: callbacks for this connector - * @hdmi_funcs: HDMI-related callbacks for this connector - * @connector_type: user visible type of the connector - * @ddc: optional pointer to the associated ddc adapter - * @supported_formats: Bitmask of @drm_output_color_format listing supported output formats - * @max_bpc: Maximum bits per char the HDMI connector supports - * - * Initialises a preallocated HDMI connector. Connectors can be - * subclassed as part of driver connector objects. - * - * Cleanup is automatically handled with a call to - * drm_connector_cleanup() in a DRM-managed action. - * - * The connector structure should be allocated with drmm_kzalloc(). - * - * The @drm_connector_funcs.destroy hook must be NULL. - * - * Returns: - * Zero on success, error code on failure. - */ -int drmm_connector_hdmi_ini2(struct drm_device *dev, - struct drm_connector *connector, - const char *vendor, const char *product, - const struct drm_connector_funcs *funcs, - const struct drm_connector_hdmi_funcs *hdmi_funcs, - int connector_type, - struct i2c_adapter *ddc, - unsigned long supported_formats, - unsigned int max_bpc) -{ - int ret; - - if (!vendor || !product) - return -EINVAL; - - if ((strlen(vendor) > DRM_CONNECTOR_HDMI_VENDOR_LEN) || - (strlen(product) > DRM_CONNECTOR_HDMI_PRODUCT_LEN)) - return -EINVAL; - - if (!(connector_type == DRM_MODE_CONNECTOR_HDMIA || - connector_type == DRM_MODE_CONNECTOR_HDMIB)) - return -EINVAL; - - if (!supported_formats || !(supported_formats & BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444))) - return -EINVAL; - - if (connector->ycbcr_420_allowed != !!(supported_formats & BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR420))) - return -EINVAL; - - if (!(max_bpc == 8 || max_bpc == 10 || max_bpc == 12)) - return -EINVAL; - - if (!hdmi_funcs->avi.clear_infoframe || - !hdmi_funcs->avi.write_infoframe || - !hdmi_funcs->hdmi.clear_infoframe || - !hdmi_funcs->hdmi.write_infoframe) - return -EINVAL; - - ret = drmm_connector_init(dev, connector, funcs, connector_type, ddc); - if (ret) - return ret; - - connector->hdmi.supported_formats = supported_formats; - strtomem_pad(connector->hdmi.vendor, vendor, 0); - strtomem_pad(connector->hdmi.product, product, 0); - - /* - * drm_connector_attach_max_bpc_property() requires the - * connector to have a state. - */ - if (connector->funcs->atomic_create_state) { - struct drm_connector_state *state; - - state = connector->funcs->atomic_create_state(connector); - if (IS_ERR(state)) - return PTR_ERR(state); - - connector->state = state; - } else if (connector->funcs->reset) { - connector->funcs->reset(connector); - if (!connector->state) - return -ENOMEM; - } - - drm_connector_attach_max_bpc_property(connector, 8, max_bpc); - connector->max_bpc = max_bpc; - - if (max_bpc > 8) - drm_connector_attach_hdr_output_metadata_property(connector); - - ret = drm_connector_attach_color_format_property(connector, supported_formats); - if (ret) - return ret; - - connector->hdmi.funcs = hdmi_funcs; - - return 0; -} -EXPORT_SYMBOL(drmm_connector_hdmi_ini2); - /** * drm_connector_attach_edid_property - attach edid property. * @connector: the connector diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h index 89a140d6f064..2ad8d1611e84 100644 --- a/include/drm/drm_connector.h +++ b/include/drm/drm_connector.h @@ -2676,15 +2676,6 @@ int drmm_connector_hdmi_init(struct drm_device *dev, const struct drm_connector_hdmi_funcs *hdmi_funcs, int connector_type, struct i2c_adapter *ddc); -int drmm_connector_hdmi_ini2(struct drm_device *dev, - struct drm_connector *connector, - const char *vendor, const char *product, - const struct drm_connector_funcs *funcs, - const struct drm_connector_hdmi_funcs *hdmi_funcs, - int connector_type, - struct i2c_adapter *ddc, - unsigned long supported_formats, - unsigned int max_bpc); void drm_connector_attach_edid_property(struct drm_connector *connector); int drm_connector_register(struct drm_connector *connector); int drm_connector_dynamic_register(struct drm_connector *connector); From patchwork Fri Jul 31 16:20:14 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Ciocaltea X-Patchwork-Id: 2886 Return-Path: X-Original-To: noreply@patchwork.local Delivered-To: noreply@patchwork.local Received: from sin.lore.kernel.org (sin.lore.kernel.org [104.64.211.4]) by mxe881.netcup.net (Postfix) with ESMTPS id 7A03B1C093B for ; Fri, 31 Jul 2026 19:08:11 +0200 (CEST) Authentication-Results: mxe881; dkim=pass header.d=collabora.com; spf=pass (sender IP is 104.64.211.4) smtp.mailfrom=linux-sunxi+bounces-24877-noreply=patchwork.local@lists.linux.dev smtp.helo=sin.lore.kernel.org Received-SPF: pass (mxe881: domain of lists.linux.dev designates 104.64.211.4 as permitted sender) client-ip=104.64.211.4; envelope-from=linux-sunxi+bounces-24877-noreply=patchwork.local@lists.linux.dev; helo=sin.lore.kernel.org; Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by sin.lore.kernel.org (Postfix) with ESMTP id 4CB8331013C1 for ; Fri, 31 Jul 2026 16:27:03 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2FAF746EC69; Fri, 31 Jul 2026 16:20:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="mvemhppV" X-Original-To: linux-sunxi@lists.linux.dev Received: from bali.collaboradmins.com (bali.collaboradmins.com [148.251.105.195]) (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 4A01846D083 for ; Fri, 31 Jul 2026 16:20:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.251.105.195 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785514820; cv=none; b=tQJzvAJSgf48cl8eGmYzKcIuXWn22LMuZQnbXMfEyISQt/a0rSpPZohgiwLmOwdjU7IfB732FAuznjR6Cza4yeLeWqDo2CzIFnpIwQKoWDQsnBIhMn/ukaO28w2De/6HYyjP5ZirBAZ5XxwR0MFK7w7FDekcRDEFFhuC50TJqHc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785514820; c=relaxed/simple; bh=MH/ZHTbxAU/pfRYI8iynv05E3beofFeSEJS/oxNVJv8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=r5kqxlF3FPhXWROV6Z//i0I2ovKA4fHayx0AUoNA/OJma8ph5V2VU2vdBR0Je7JzYKz2dnMIohuufhpjMMEbbEhjvVEKO4KD59rT4MYYXPc1zDLFjGVlxrSafL1KK/B4P2mOqxue6f34s7+CE1dhUsSRV91cXOuX50OnlXGKE5M= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=mvemhppV; arc=none smtp.client-ip=148.251.105.195 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1785514802; bh=MH/ZHTbxAU/pfRYI8iynv05E3beofFeSEJS/oxNVJv8=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=mvemhppV2VEH18QNjNAF2n+Rb8qZb/hZ7IifFbqEYd3cOKS2FcPuVuiVvkJRc8wRR XWjhjyqirGUOrGcETm247YpEvOfrAJze3yAq2i3oQaumGrJu4QV+G805e8kbXGPcoz WFUh/YWkI2WyF0nP7lBMJZNmhZz0LWbnTCrw4c8My4N8KER5ce/LJV6/883XijFnKn SrWYiar2HkrnTRLW+Ycowr2vLoDNarPAHaAtDGdhy+stM7kZZNsZ0wjrowtG/do8dq G1D/ceVGXENgDDIyWnEFWugjSr1cGCDq/BQiieFoCzZwdl8rNMg/nJsJ5Ubr9TupI1 DUX9U0D/qHsag== Received: from localhost (unknown [100.64.0.241]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange secp256r1 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: cristicc) by bali.collaboradmins.com (Postfix) with ESMTPSA id 441B917E0B79; Fri, 31 Jul 2026 18:20:02 +0200 (CEST) From: Cristian Ciocaltea Date: Fri, 31 Jul 2026 19:20:14 +0300 Subject: [PATCH v10 67/69] drm/connector: Drop redundant hdmi vendor/product fields Precedence: bulk X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20260731-dw-hdmi-qp-scramb-v10-67-294364b2cf15@collabora.com> References: <20260731-dw-hdmi-qp-scramb-v10-0-294364b2cf15@collabora.com> In-Reply-To: <20260731-dw-hdmi-qp-scramb-v10-0-294364b2cf15@collabora.com> To: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Luca Ceresoli , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Chen-Yu Tsai , Samuel Holland , Dave Stevenson , =?utf-8?q?Ma=C3=ADra_Canal?= , Raspberry Pi Kernel Maintenance , Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Andy Yan , Algea Cao , Daniel Stone , Liu Ying , Phong LE Cc: kernel@collabora.com, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-rockchip@lists.infradead.org, Diederik de Haas X-Mailer: b4 0.15.2 X-Rspamd-Server: rspamd-worker-8404 X-Spamd-Result: default: False [-2.16 / 15.00]; BAYES_HAM(-5.50)[100.00%]; RBL_SENDERSCORE(2.00)[104.64.211.4:from]; SUSPICIOUS_RECIPS(1.50)[]; MAILLIST(-0.15)[generic]; BAD_REP_POLICIES(0.10)[]; MIME_GOOD(-0.10)[text/plain]; HAS_LIST_UNSUB(-0.01)[]; RCVD_COUNT_FIVE(0.00)[5]; ARC_ALLOW(0.00)[subspace.kernel.org:s=arc-20240116:i=1]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_TWELVE(0.00)[31]; PRECEDENCE_BULK(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[cknow-tech.com:email,sin.lore.kernel.org:rdns,sin.lore.kernel.org:helo,collabora.com:email,collabora.com:dkim]; TAGGED_RCPT(0.00)[]; FORGED_SENDER_MAILLIST(0.00)[]; R_DKIM_ALLOW(0.00)[collabora.com:s=mail]; ASN(0.00)[asn:63949, ipnet:104.64.192.0/19, country:SG]; DKIM_TRACE(0.00)[collabora.com:+]; DMARC_POLICY_ALLOW(0.00)[collabora.com,none]; R_SPF_ALLOW(0.00)[+ip4:104.64.211.4:c]; TO_DN_SOME(0.00)[]; FROM_NEQ_ENVFROM(0.00)[cristian.ciocaltea@collabora.com,linux-sunxi@lists.linux.dev]; FREEMAIL_TO(0.00)[intel.com,linaro.org,kernel.org,ideasonboard.com,kwiboo.se,gmail.com,bootlin.com,linux.intel.com,suse.de,ffwll.ch,sholland.org,raspberrypi.com,igalia.com,rock-chips.com,sntech.de,collabora.com,nxp.com,baylibre.com]; MIME_TRACE(0.00)[0:+]; TAGGED_FROM(0.00)[bounces-24877-noreply=patchwork.local]; FORGED_RECIPIENTS_MAILLIST(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[] X-Rspamd-Queue-Id: 7A03B1C093B X-MORS-Enabled: yes X-MORS-DOMAIN: patchwork.local X-MORS-HOSTING: hosting172546 X-MORS-USER: hosting172546 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= Now that all users migrated to the new drmm_connector_hdmi_init() signature, vendor and product are provided through struct drm_connector_hdmi_funcs, a reference to which is already stored in drm_connector_hdmi. Drop the redundant fields from drm_connector_hdmi and point its users to hdmi.funcs->vendor and hdmi.funcs->product instead. This allows simplifying the related connector registration tests by getting rid of the now unnecessary KUNIT_EXPECT_MEMEQ() checks. Tested-by: Diederik de Haas # NanoPC-T6 LTS, Rock 5B Signed-off-by: Cristian Ciocaltea --- drivers/gpu/drm/display/drm_hdmi_state_helper.c | 4 +-- drivers/gpu/drm/drm_connector.c | 4 --- drivers/gpu/drm/tests/drm_connector_test.c | 41 +++---------------------- include/drm/drm_connector.h | 14 ++------- 4 files changed, 8 insertions(+), 55 deletions(-) diff --git a/drivers/gpu/drm/display/drm_hdmi_state_helper.c b/drivers/gpu/drm/display/drm_hdmi_state_helper.c index 04c9e06b9dc1..83a8fcb41343 100644 --- a/drivers/gpu/drm/display/drm_hdmi_state_helper.c +++ b/drivers/gpu/drm/display/drm_hdmi_state_helper.c @@ -784,8 +784,8 @@ static int hdmi_generate_spd_infoframe(const struct drm_connector *connector, return 0; ret = hdmi_spd_infoframe_init(frame, - connector->hdmi.vendor, - connector->hdmi.product); + connector->hdmi.funcs->vendor, + connector->hdmi.funcs->product); if (ret) return ret; diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c index b2e8d99c0e9a..f5f38dc4bfa6 100644 --- a/drivers/gpu/drm/drm_connector.c +++ b/drivers/gpu/drm/drm_connector.c @@ -656,10 +656,6 @@ int drmm_connector_hdmi_init(struct drm_device *dev, connector->hdmi.max_tmds_char_rate = hdmi_funcs->supported_tmds_char_rate; } - /* TODO: remove after conversion to new drmm_connector_hdmi_init() */ - strtomem_pad(connector->hdmi.vendor, hdmi_funcs->vendor, 0); - strtomem_pad(connector->hdmi.product, hdmi_funcs->product, 0); - /* * drm_connector_attach_max_bpc_property() requires the * connector to have a state. diff --git a/drivers/gpu/drm/tests/drm_connector_test.c b/drivers/gpu/drm/tests/drm_connector_test.c index 3d8500ad8be9..42f804500de6 100644 --- a/drivers/gpu/drm/tests/drm_connector_test.c +++ b/drivers/gpu/drm/tests/drm_connector_test.c @@ -771,14 +771,11 @@ static void drm_test_connector_hdmi_init_null_product(struct kunit *test) /* * Test that the registration of a connector with a valid, shorter than - * the max length, product name succeeds, and is stored padded with 0. + * the max length, product name succeeds. */ static void drm_test_connector_hdmi_init_product_valid(struct kunit *test) { struct drm_connector_init_priv *priv = test->priv; - const unsigned char expected_product[DRM_CONNECTOR_HDMI_PRODUCT_LEN] = { - 'P', 'r', 'o', 'd', - }; int ret; priv->hdmi_funcs = dummy_hdmi_funcs; @@ -793,25 +790,15 @@ static void drm_test_connector_hdmi_init_product_valid(struct kunit *test) DRM_MODE_CONNECTOR_HDMIA, &priv->ddc); KUNIT_EXPECT_EQ(test, ret, 0); - KUNIT_EXPECT_MEMEQ(test, - priv->connector.hdmi.product, - expected_product, - sizeof(priv->connector.hdmi.product)); } /* * Test that the registration of a connector with a valid, at max - * length, product name succeeds, and is stored padded without any - * trailing \0. + * length, product name succeeds. */ static void drm_test_connector_hdmi_init_product_length_exact(struct kunit *test) { struct drm_connector_init_priv *priv = test->priv; - const unsigned char expected_product[DRM_CONNECTOR_HDMI_PRODUCT_LEN] = { - 'P', 'r', 'o', 'd', 'u', 'c', 't', - 'P', 'r', 'o', 'd', 'u', 'c', 't', - 'P', 'r', - }; int ret; priv->hdmi_funcs = dummy_hdmi_funcs; @@ -826,10 +813,6 @@ static void drm_test_connector_hdmi_init_product_length_exact(struct kunit *test DRM_MODE_CONNECTOR_HDMIA, &priv->ddc); KUNIT_EXPECT_EQ(test, ret, 0); - KUNIT_EXPECT_MEMEQ(test, - priv->connector.hdmi.product, - expected_product, - sizeof(priv->connector.hdmi.product)); } /* @@ -857,14 +840,11 @@ static void drm_test_connector_hdmi_init_product_length_too_long(struct kunit *t /* * Test that the registration of a connector with a vendor name smaller - * than the maximum length succeeds, and is stored padded with zeros. + * than the maximum length succeeds. */ static void drm_test_connector_hdmi_init_vendor_valid(struct kunit *test) { struct drm_connector_init_priv *priv = test->priv; - const char expected_vendor[DRM_CONNECTOR_HDMI_VENDOR_LEN] = { - 'V', 'e', 'n', 'd', - }; int ret; priv->hdmi_funcs = dummy_hdmi_funcs; @@ -879,24 +859,15 @@ static void drm_test_connector_hdmi_init_vendor_valid(struct kunit *test) DRM_MODE_CONNECTOR_HDMIA, &priv->ddc); KUNIT_EXPECT_EQ(test, ret, 0); - KUNIT_EXPECT_MEMEQ(test, - priv->connector.hdmi.vendor, - expected_vendor, - sizeof(priv->connector.hdmi.vendor)); } /* * Test that the registration of a connector with a vendor name at the - * maximum length succeeds, and is stored padded without the trailing - * zero. + * maximum length succeeds. */ static void drm_test_connector_hdmi_init_vendor_length_exact(struct kunit *test) { struct drm_connector_init_priv *priv = test->priv; - const char expected_vendor[DRM_CONNECTOR_HDMI_VENDOR_LEN] = { - 'V', 'e', 'n', 'd', 'o', 'r', - 'V', 'e', - }; int ret; priv->hdmi_funcs = dummy_hdmi_funcs; @@ -911,10 +882,6 @@ static void drm_test_connector_hdmi_init_vendor_length_exact(struct kunit *test) DRM_MODE_CONNECTOR_HDMIA, &priv->ddc); KUNIT_EXPECT_EQ(test, ret, 0); - KUNIT_EXPECT_MEMEQ(test, - priv->connector.hdmi.vendor, - expected_vendor, - sizeof(priv->connector.hdmi.vendor)); } /* diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h index 2ad8d1611e84..f7627de624de 100644 --- a/include/drm/drm_connector.h +++ b/include/drm/drm_connector.h @@ -1418,11 +1418,13 @@ struct drm_connector_infoframe_funcs { * and controller capabilities */ struct drm_connector_hdmi_funcs { +#define DRM_CONNECTOR_HDMI_VENDOR_LEN 8 /** * @vendor: HDMI Controller Vendor name. */ const char *vendor; +#define DRM_CONNECTOR_HDMI_PRODUCT_LEN 16 /** * @product: HDMI Controller Product name */ @@ -2123,18 +2125,6 @@ struct drm_connector_hdmi_audio { * struct drm_connector_hdmi - DRM Connector HDMI-related structure */ struct drm_connector_hdmi { -#define DRM_CONNECTOR_HDMI_VENDOR_LEN 8 - /** - * @vendor: HDMI Controller Vendor Name - */ - unsigned char vendor[DRM_CONNECTOR_HDMI_VENDOR_LEN] __nonstring; - -#define DRM_CONNECTOR_HDMI_PRODUCT_LEN 16 - /** - * @product: HDMI Controller Product Name - */ - unsigned char product[DRM_CONNECTOR_HDMI_PRODUCT_LEN] __nonstring; - /** * @supported_formats: Bitmask of @drm_output_color_format * supported by the controller. From patchwork Fri Jul 31 16:20:15 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Ciocaltea X-Patchwork-Id: 2869 Return-Path: X-Original-To: noreply@patchwork.local Delivered-To: noreply@patchwork.local Received: from sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74]) by mxe881.netcup.net (Postfix) with ESMTPS id A14DF1C2304 for ; Fri, 31 Jul 2026 18:42:53 +0200 (CEST) Authentication-Results: mxe881; dkim=pass header.d=collabora.com; spf=pass (sender IP is 172.232.135.74) smtp.mailfrom=linux-sunxi+bounces-24879-noreply=patchwork.local@lists.linux.dev smtp.helo=sto.lore.kernel.org Received-SPF: pass (mxe881: domain of lists.linux.dev designates 172.232.135.74 as permitted sender) client-ip=172.232.135.74; envelope-from=linux-sunxi+bounces-24879-noreply=patchwork.local@lists.linux.dev; helo=sto.lore.kernel.org; Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by sto.lore.kernel.org (Postfix) with ESMTP id 5F08E313F9EB for ; Fri, 31 Jul 2026 16:27:39 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 27DFA46F4A3; Fri, 31 Jul 2026 16:20:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="eKzk6vye" X-Original-To: linux-sunxi@lists.linux.dev Received: from bali.collaboradmins.com (bali.collaboradmins.com [148.251.105.195]) (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 618EC4582EA for ; Fri, 31 Jul 2026 16:20:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.251.105.195 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785514825; cv=none; b=o6LRDDqGzHkyj7lKVUvEPVM4DkuKS/wz8TBCXKSfqmvPy1n1I82GUrKqRM6N3xGT+plOYTsnVamz3MI/FhSmma0YavZTp4FTMqlVwNu66A2A2o3ZFUgkMGUzRo60Mu2VhGpbfOyFhBk3/jBlQoYbCx/iunrHLOcQIBk/OKSvhEw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785514825; c=relaxed/simple; bh=MQdOVA/KEPfHsOiZ2rC34pKBO1gpeVvQA+uY+o5VdNY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=NGNizRqZblr333FQWT3/Tcp/Faqwv8Lz2c/qealettUKHNeZaUC5jgehJxkc28qmLoh3dVZfHQ1M/0O2GDhKquMzddIUtNRFw2FdYuDcJgvwjNihSZLWAev136fChARjq71658WQgfDbeTrmmwFhgOtlMfOBE9ESxh1ihT/iUS4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=eKzk6vye; arc=none smtp.client-ip=148.251.105.195 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1785514803; bh=MQdOVA/KEPfHsOiZ2rC34pKBO1gpeVvQA+uY+o5VdNY=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=eKzk6vyeyqD8l88eWaxN2HRRTCyXrbj+ObYgBuqzvXVheOg8SS6tgRx/a7bidt+7G j1rdiyQayOMK4p1dyadG+dt301zdBl9rMQJMZgI5v1Ah0NrC+JGFSnHvBMjEAv6Qng 0HQO/PGA6iMleLGiQuvXy4ljBs3ijZNYYnco/vwva0wBkqG9rW0Z8VCXFhHgoSjpaz pw0QGgUiMkxAvc0ZCgYlCRpsroCrHmxWhLP1gmCvmgrc8s0oS0jVp5MbX9vOQkvYul 0Pddcw/S3EZZaIWR1IrY5OjgdMLgyDEHEz3/r7JKYsgurMQnNAdIbbKJ6bvFN1VgeJ 3yUDvFB8pRrig== Received: from localhost (unknown [100.64.0.241]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange secp256r1 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: cristicc) by bali.collaboradmins.com (Postfix) with ESMTPSA id 00AC617E0B82; Fri, 31 Jul 2026 18:20:03 +0200 (CEST) From: Cristian Ciocaltea Date: Fri, 31 Jul 2026 19:20:15 +0300 Subject: [PATCH v10 68/69] drm/connector: Drop redundant hdmi supported_formats field Precedence: bulk X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20260731-dw-hdmi-qp-scramb-v10-68-294364b2cf15@collabora.com> References: <20260731-dw-hdmi-qp-scramb-v10-0-294364b2cf15@collabora.com> In-Reply-To: <20260731-dw-hdmi-qp-scramb-v10-0-294364b2cf15@collabora.com> To: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Luca Ceresoli , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Chen-Yu Tsai , Samuel Holland , Dave Stevenson , =?utf-8?q?Ma=C3=ADra_Canal?= , Raspberry Pi Kernel Maintenance , Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Andy Yan , Algea Cao , Daniel Stone , Liu Ying , Phong LE Cc: kernel@collabora.com, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-rockchip@lists.infradead.org, Diederik de Haas X-Mailer: b4 0.15.2 X-MORS-Enabled: yes X-MORS-DOMAIN: patchwork.local X-MORS-HOSTING: hosting172546 X-MORS-USER: hosting172546 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= Now that all users migrated to the new drmm_connector_hdmi_init() signature, supported_formats is provided through struct drm_connector_hdmi_funcs, a reference to which is already stored in drm_connector_hdmi. Drop the redundant field from drm_connector_hdmi and point its users to hdmi.funcs->supported_formats instead. Tested-by: Diederik de Haas # NanoPC-T6 LTS, Rock 5B Signed-off-by: Cristian Ciocaltea Reviewed-by: Maxime Ripard --- drivers/gpu/drm/display/drm_hdmi_state_helper.c | 3 ++- drivers/gpu/drm/drm_connector.c | 3 --- include/drm/drm_connector.h | 6 ------ 3 files changed, 2 insertions(+), 10 deletions(-) diff --git a/drivers/gpu/drm/display/drm_hdmi_state_helper.c b/drivers/gpu/drm/display/drm_hdmi_state_helper.c index 83a8fcb41343..c5496641a2f3 100644 --- a/drivers/gpu/drm/display/drm_hdmi_state_helper.c +++ b/drivers/gpu/drm/display/drm_hdmi_state_helper.c @@ -426,7 +426,8 @@ sink_supports_format_bpc(const struct drm_connector *connector, return false; } - if (!(connector->hdmi.supported_formats & BIT(format))) { + if (!connector->hdmi.funcs || + !(connector->hdmi.funcs->supported_formats & BIT(format))) { drm_dbg_kms(dev, "%s format unsupported by the connector.\n", drm_hdmi_connector_get_output_format_name(format)); return false; diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c index f5f38dc4bfa6..293b2823475d 100644 --- a/drivers/gpu/drm/drm_connector.c +++ b/drivers/gpu/drm/drm_connector.c @@ -610,9 +610,6 @@ int drmm_connector_hdmi_init(struct drm_device *dev, if (ret) return ret; - /* TODO: remove after conversion to new drmm_connector_hdmi_init() */ - connector->hdmi.supported_formats = hdmi_funcs->supported_formats; - /* * The supported HDMI version can be used to determinate the maximum * TMDS character rate allowed by the specification. Some controllers, diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h index f7627de624de..75bd9ac03571 100644 --- a/include/drm/drm_connector.h +++ b/include/drm/drm_connector.h @@ -2125,12 +2125,6 @@ struct drm_connector_hdmi_audio { * struct drm_connector_hdmi - DRM Connector HDMI-related structure */ struct drm_connector_hdmi { - /** - * @supported_formats: Bitmask of @drm_output_color_format - * supported by the controller. - */ - unsigned long supported_formats; - /** * @max_tmds_char_rate: Maximum TMDS character rate, in Hz, * supported by the controller. From patchwork Fri Jul 31 16:20:16 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Ciocaltea X-Patchwork-Id: 2885 Return-Path: X-Original-To: noreply@patchwork.local Delivered-To: noreply@patchwork.local Received: from sin.lore.kernel.org (sin.lore.kernel.org [104.64.211.4]) by mxe881.netcup.net (Postfix) with ESMTPS id 928091C0251 for ; Fri, 31 Jul 2026 19:08:09 +0200 (CEST) Authentication-Results: mxe881; dkim=pass header.d=collabora.com; spf=pass (sender IP is 104.64.211.4) smtp.mailfrom=linux-sunxi+bounces-24876-noreply=patchwork.local@lists.linux.dev smtp.helo=sin.lore.kernel.org Received-SPF: pass (mxe881: domain of lists.linux.dev designates 104.64.211.4 as permitted sender) client-ip=104.64.211.4; envelope-from=linux-sunxi+bounces-24876-noreply=patchwork.local@lists.linux.dev; helo=sin.lore.kernel.org; Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by sin.lore.kernel.org (Postfix) with ESMTP id 82C5331007DA for ; Fri, 31 Jul 2026 16:27:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2E7A74508EB; Fri, 31 Jul 2026 16:20:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="qzzSuHhH" X-Original-To: linux-sunxi@lists.linux.dev Received: from bali.collaboradmins.com (bali.collaboradmins.com [148.251.105.195]) (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 6608E46C851 for ; Fri, 31 Jul 2026 16:20:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.251.105.195 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785514820; cv=none; b=EnE8ubN/8mGbbA+oGT/45mhPWm17S+CC0l2mfEXl/QxrvrYpDFkj7zudT4qAp7qKdkYsQ7H6VA8PcmwyCqWRZRmYbQZ1GNG92cGbqKsfu4gDDYsNLRGnryjBMN/kMcrs83xcLFkBxbgZ3RKZGz2Y0yXYKRvfQBETgKCxdAg2mLY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785514820; c=relaxed/simple; bh=anZYZ7yEJJr+RFy3nqLwYzOV6L9Uj+UtOgmMLRpsr3o=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=nDdj3igrbfenyZruKq+CmDRfr3SzODmQqxe/oHOMsVp1S4Y2hOWMDb7uaWRMzxihS9z82yajx1gyQDAfMJAlRo/wNnKG2AIqqoFTMZvuXMpB8wyHw9+BXiabMigbnhcaKcGHgmMkj8HJV9QfgYuRjzB0SJ4NumpPMju4EiYYuXE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=qzzSuHhH; arc=none smtp.client-ip=148.251.105.195 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1785514803; bh=anZYZ7yEJJr+RFy3nqLwYzOV6L9Uj+UtOgmMLRpsr3o=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=qzzSuHhHTqHAYGCtiCISlU2GIZoJ6K8YPdWC668t77q5yGwOqy2LPXCULADOvM2LT 1EcbZpdSklzdzf88BLSp9Hy/3bYP4T7dEwUVMNTsAJ/WfofHkz1tAj7AxTnx2iO4tz aJBuWxmPH1O+QzUQEraPCMmsKnKUX2GE8arrFuXHHnoMKu6VPcIhkXM9m4pofdBGMl 1lQCXcMgWbd/EZ63mcr0qcfxzF1fUStLfwiOKl87ZGuZXwjtYe8x8W81hs5QkIhw/B Ee6Suurozk8QakEpf6Ba2AyC5qJ4PTki3E/LLTPPmeTk8fAj1kRHe5UW7sCqy5anOW AJ2QvC9Od/waw== Received: from localhost (unknown [100.64.0.241]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange secp256r1 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: cristicc) by bali.collaboradmins.com (Postfix) with ESMTPSA id A72A117E0B89; Fri, 31 Jul 2026 18:20:03 +0200 (CEST) From: Cristian Ciocaltea Date: Fri, 31 Jul 2026 19:20:16 +0300 Subject: [PATCH v10 69/69] drm/connector: Drop redundant max_bpc field Precedence: bulk X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20260731-dw-hdmi-qp-scramb-v10-69-294364b2cf15@collabora.com> References: <20260731-dw-hdmi-qp-scramb-v10-0-294364b2cf15@collabora.com> In-Reply-To: <20260731-dw-hdmi-qp-scramb-v10-0-294364b2cf15@collabora.com> To: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Luca Ceresoli , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Chen-Yu Tsai , Samuel Holland , Dave Stevenson , =?utf-8?q?Ma=C3=ADra_Canal?= , Raspberry Pi Kernel Maintenance , Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Andy Yan , Algea Cao , Daniel Stone , Liu Ying , Phong LE Cc: kernel@collabora.com, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-rockchip@lists.infradead.org, Diederik de Haas X-Mailer: b4 0.15.2 X-Rspamd-Server: rspamd-worker-8404 X-Spamd-Result: default: False [-2.16 / 15.00]; BAYES_HAM(-5.50)[100.00%]; RBL_SENDERSCORE(2.00)[104.64.211.4:from]; SUSPICIOUS_RECIPS(1.50)[]; MAILLIST(-0.15)[generic]; BAD_REP_POLICIES(0.10)[]; MIME_GOOD(-0.10)[text/plain]; HAS_LIST_UNSUB(-0.01)[]; R_DKIM_ALLOW(0.00)[collabora.com:s=mail]; ARC_ALLOW(0.00)[subspace.kernel.org:s=arc-20240116:i=1]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_TWELVE(0.00)[31]; PRECEDENCE_BULK(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[cknow-tech.com:email,collabora.com:email,collabora.com:dkim,sin.lore.kernel.org:rdns,sin.lore.kernel.org:helo]; TAGGED_RCPT(0.00)[]; FORGED_SENDER_MAILLIST(0.00)[]; RCVD_COUNT_FIVE(0.00)[5]; ASN(0.00)[asn:63949, ipnet:104.64.192.0/19, country:SG]; DKIM_TRACE(0.00)[collabora.com:+]; DMARC_POLICY_ALLOW(0.00)[collabora.com,none]; R_SPF_ALLOW(0.00)[+ip4:104.64.211.4]; TO_DN_SOME(0.00)[]; FROM_NEQ_ENVFROM(0.00)[cristian.ciocaltea@collabora.com,linux-sunxi@lists.linux.dev]; FREEMAIL_TO(0.00)[intel.com,linaro.org,kernel.org,ideasonboard.com,kwiboo.se,gmail.com,bootlin.com,linux.intel.com,suse.de,ffwll.ch,sholland.org,raspberrypi.com,igalia.com,rock-chips.com,sntech.de,collabora.com,nxp.com,baylibre.com]; MIME_TRACE(0.00)[0:+]; TAGGED_FROM(0.00)[bounces-24876-noreply=patchwork.local]; FORGED_RECIPIENTS_MAILLIST(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[] X-Rspamd-Queue-Id: 928091C0251 X-MORS-Enabled: yes X-MORS-DOMAIN: patchwork.local X-MORS-HOSTING: hosting172546 X-MORS-USER: hosting172546 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= Now that all users migrated to the new drmm_connector_hdmi_init() signature, max_bpc is provided through struct drm_connector_hdmi_funcs, a reference to which is already stored in drm_connector_hdmi. Drop the redundant connector->max_bpc field and point its users to hdmi.funcs->max_bpc instead. Tested-by: Diederik de Haas # NanoPC-T6 LTS, Rock 5B Signed-off-by: Cristian Ciocaltea Reviewed-by: Maxime Ripard --- drivers/gpu/drm/display/drm_hdmi_state_helper.c | 6 +++--- drivers/gpu/drm/drm_connector.c | 2 -- include/drm/drm_connector.h | 5 ----- 3 files changed, 3 insertions(+), 10 deletions(-) diff --git a/drivers/gpu/drm/display/drm_hdmi_state_helper.c b/drivers/gpu/drm/display/drm_hdmi_state_helper.c index c5496641a2f3..53057ef80e45 100644 --- a/drivers/gpu/drm/display/drm_hdmi_state_helper.c +++ b/drivers/gpu/drm/display/drm_hdmi_state_helper.c @@ -319,7 +319,7 @@ void __drm_atomic_helper_connector_hdmi_state_init(struct drm_connector *connector, struct drm_connector_state *new_conn_state) { - unsigned int max_bpc = connector->max_bpc; + unsigned int max_bpc = connector->hdmi.funcs ? connector->hdmi.funcs->max_bpc : 0; new_conn_state->max_bpc = max_bpc; new_conn_state->max_requested_bpc = max_bpc; @@ -678,7 +678,7 @@ hdmi_compute_config(const struct drm_connector *connector, { unsigned int max_bpc = clamp_t(unsigned int, conn_state->max_bpc, - 8, connector->max_bpc); + 8, connector->hdmi.funcs->max_bpc); enum drm_output_color_format fmt; int ret; @@ -811,7 +811,7 @@ static int hdmi_generate_hdr_infoframe(const struct drm_connector *connector, if (!connector->hdmi.funcs->hdr_drm.write_infoframe) return 0; - if (connector->max_bpc < 10) + if (connector->hdmi.funcs->max_bpc < 10) return 0; if (!conn_state->hdr_output_metadata) diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c index 293b2823475d..38d9f977338c 100644 --- a/drivers/gpu/drm/drm_connector.c +++ b/drivers/gpu/drm/drm_connector.c @@ -672,8 +672,6 @@ int drmm_connector_hdmi_init(struct drm_device *dev, } drm_connector_attach_max_bpc_property(connector, 8, hdmi_funcs->max_bpc); - /* TODO: remove after conversion to new drmm_connector_hdmi_init() */ - connector->max_bpc = hdmi_funcs->max_bpc; if (hdmi_funcs->max_bpc > 8) drm_connector_attach_hdr_output_metadata_property(connector); diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h index 75bd9ac03571..5e0d65adb244 100644 --- a/include/drm/drm_connector.h +++ b/include/drm/drm_connector.h @@ -2391,11 +2391,6 @@ struct drm_connector { */ struct drm_property_blob *path_blob_ptr; - /** - * @max_bpc: Maximum bits per color channel the connector supports. - */ - unsigned int max_bpc; - /** * @max_bpc_property: Default connector property for the max bpc to be * driven out of the connector.