| Message ID | 20260723-dw-hdmi-qp-scramb-v9-20-4fb12ea22ac9@collabora.com (mailing list archive) |
|---|---|
| State | New |
| Headers |
Return-Path: <linux-sunxi+bounces-24661-sunxi=pue.re@lists.linux.dev>
X-Original-To: noreply@patchwork.local
Delivered-To: noreply@patchwork.local
Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
by mxe881.netcup.net (Postfix) with ESMTPS id 509BE1C2B5B
for <noreply@patchwork.local>; Thu, 23 Jul 2026 03:41:28 +0200 (CEST)
Authentication-Results: mxe881;
dkim=pass header.d=collabora.com;
spf=pass (sender IP is 172.234.253.10)
smtp.mailfrom=linux-sunxi+bounces-24661-noreply=patchwork.local@lists.linux.dev
smtp.helo=sea.lore.kernel.org
Received-SPF: pass (mxe881: domain of lists.linux.dev designates
172.234.253.10 as permitted sender) client-ip=172.234.253.10;
envelope-from=linux-sunxi+bounces-24661-noreply=patchwork.local@lists.linux.dev;
helo=sea.lore.kernel.org;
Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org
[100.90.174.1])
by sea.lore.kernel.org (Postfix) with ESMTP id 9ECBD312D35D
for <noreply@patchwork.local>; Thu, 23 Jul 2026 01:35:56 +0000 (UTC)
Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
by smtp.subspace.kernel.org (Postfix) with ESMTP id 5E75F32E6B4;
Thu, 23 Jul 2026 01:35:20 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org;
dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com
header.b="BZytFqV/"
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 F2E9A31960A
for <linux-sunxi@lists.linux.dev>; Thu, 23 Jul 2026 01:35:17 +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=1784770520; cv=none;
b=eZP28zgLm7JIQn+wy+D/vRJ/QQb95rgDiedO05/fLCIXTtKB5LqqDUvZiOeVH+Ns7Uk9l/YNyNFeQNP8cmEC87rd8ivoM1So1PU+tGxsj43+QlFVOiX41V7kY1QFXYKCKy7c4rouUkEBrxnjPRc0tfmuL1BkDTtIhqbZxfkdHc0=
ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org;
s=arc-20240116; t=1784770520; c=relaxed/simple;
bh=2geCQNKhnwPXaJ/bHUlwxRKPeZYSVig3y46QWPBRk50=;
h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References:
In-Reply-To:To:Cc;
b=XO+rFYSf6F6r9qsr1vXAXhRzIxWxKg/wMe2TdZg93vRcom/HcfcT5JtpnJ963KiUhU8y7+5zMFfTuAriIr07EGQQwwxggjcVSffOhb5lYPJkDBlewugCSzw1H6sl8i3eKn51T/gEaNuMahBUc4fCW0he5/ZgLueOxSFiM8LKVDA=
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=BZytFqV/; 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=1784770516;
bh=2geCQNKhnwPXaJ/bHUlwxRKPeZYSVig3y46QWPBRk50=;
h=From:Date:Subject:References:In-Reply-To:To:Cc:From;
b=BZytFqV/0RBDH2izdzsIUK80Bjmokva2f8oiB8+Xpgs4+K/DcHTIcW6oXzxXc5J6b
9hwzK7zt4mNcjPHSUy0gvb2f5/7MnekUmTqtAstA21oEun8FheRn78dAc6WiRCbZIu
DqlXrygikif7kpMtm4uSUS2E9e66F/zLkypNth79eVGys+1ylnovXbkOoOBte3gpXl
uF3K39Tg3szNuLeeAmx7Hp620ptljfv5go4jVt+uSxRH5EjO+yWxlbXwl8K9RBt9u5
Hp/l9rznXkvGzTBlOOR5diS0m5GiRMu6bPdC3WzYe5PEBm12WbhmYX/3a2BBdy7K7i
AHPHqkQNUkCiQ==
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 0913117E124A;
Thu, 23 Jul 2026 03:35:16 +0200 (CEST)
From: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
Date: Thu, 23 Jul 2026 04:35:09 +0300
Subject: [PATCH v9 20/61] drm/bridge: dw-hdmi-qp: Provide
.{enable,disable}_hpd() PHY ops
Precedence: bulk
X-Mailing-List: linux-sunxi@lists.linux.dev
List-Id: <linux-sunxi.lists.linux.dev>
List-Subscribe: <mailto:linux-sunxi+subscribe@lists.linux.dev>
List-Unsubscribe: <mailto:linux-sunxi+unsubscribe@lists.linux.dev>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
Message-Id: <20260723-dw-hdmi-qp-scramb-v9-20-4fb12ea22ac9@collabora.com>
References: <20260723-dw-hdmi-qp-scramb-v9-0-4fb12ea22ac9@collabora.com>
In-Reply-To: <20260723-dw-hdmi-qp-scramb-v9-0-4fb12ea22ac9@collabora.com>
To: Andrzej Hajda <andrzej.hajda@intel.com>,
Neil Armstrong <neil.armstrong@linaro.org>, Robert Foss <rfoss@kernel.org>,
Laurent Pinchart <Laurent.pinchart@ideasonboard.com>,
Jonas Karlman <jonas@kwiboo.se>, Jernej Skrabec <jernej.skrabec@gmail.com>,
Luca Ceresoli <luca.ceresoli@bootlin.com>,
Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
Maxime Ripard <mripard@kernel.org>, Thomas Zimmermann <tzimmermann@suse.de>,
David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
Chen-Yu Tsai <wens@kernel.org>, Samuel Holland <samuel@sholland.org>,
Dave Stevenson <dave.stevenson@raspberrypi.com>,
=?utf-8?q?Ma=C3=ADra_Canal?= <mcanal@igalia.com>,
Raspberry Pi Kernel Maintenance <kernel-list@raspberrypi.com>,
Sandy Huang <hjc@rock-chips.com>,
=?utf-8?q?Heiko_St=C3=BCbner?= <heiko@sntech.de>,
Andy Yan <andy.yan@rock-chips.com>, Algea Cao <algea.cao@rock-chips.com>,
Daniel Stone <daniels@collabora.com>, Liu Ying <victor.liu@nxp.com>,
Phong LE <ple@baylibre.com>
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 <maud_spierings@hotmail.com>
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?=
|
| Series |
Add HDMI 2.0 support to DW HDMI QP TX
|
|
Commit Message
Cristian Ciocaltea
July 23, 2026, 1:35 a.m. UTC
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 <maud_spierings@hotmail.com> Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com> --- drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c | 18 ++++++++++++++++++ include/drm/bridge/dw_hdmi_qp.h | 2 ++ 2 files changed, 20 insertions(+)
Comments
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [Medium] The patch fails to achieve its stated goal of preventing premature HPD interrupt delivery because the underlying PHY driver was not updated and HPD remains statically armed.
- [Medium] The bridge implements `.hpd_enable` but never calls `drm_bridge_hpd_notify()`, bypassing the DRM core's hot-plug notification callback.
--
--- Patch [20]: [PATCH v9 20/61] drm/bridge: dw-hdmi-qp: Provide .{enable,disable}_hpd() PHY ops ---
commit 1e237fa22e4f4ffd6fd8e88a7191823f910b5d7a
Author: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
drm/bridge: dw-hdmi-qp: Provide .{enable,disable}_hpd() PHY ops
This commit implements the .hpd_enable() and .hpd_disable() bridge callbacks
for the dw-hdmi-qp driver and extends dw_hdmi_qp_phy_ops with corresponding
hooks. The goal is to allow the DRM core to control when HPD interrupts are
armed to prevent premature delivery.
> diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c
> index 7475b6b71836b..a0613f0d2ebcf 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);
> +}
[Severity: Medium]
The commit message states this change enables the DRM core to control when HPD
interrupts are armed to prevent premature interrupt delivery.
Does this actually prevent premature delivery? Looking at dw_hdmi_qp_init_hw(),
it still unconditionally calls the setup_hpd hook, which statically unmasks
the HPD interrupt before the DRM core assumes control.
Additionally, if the underlying PHY driver hasn't been updated to implement
these new enable_hpd/disable_hpd hooks, won't these callbacks just be silent
no-ops, leaving HPD statically armed?
[Severity: Medium]
By implementing .hpd_enable, the driver opts into the dynamic HPD
notification API.
This API contract expects the driver to call drm_bridge_hpd_notify() when an
HPD event occurs, so the DRM core can execute its registered callback. Since
dw-hdmi-qp.c neither calls drm_bridge_hpd_notify() nor provides a way for the
platform wrapper to trigger it, won't the DRM core's hot-plug notification
callback remain unexecuted?
[ ... ]
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 {