Skip to contentSkip to conversation

drm/display: generic HDMI CEC helpers

PATCH Applied Dmitry Baryshkov 6 participants 26 messages May 17, 2025 – Jul 18, 2025

Subsystems (4)

v6 of 7 Applied Latest is v7 →

lore
Share & tools
lore
#0 lore raw

v6 cover drm/display: generic HDMI CEC helpers

Currently it is next to impossible to implement CEC handling for the setup using drm_bridges and drm_bridge_connector: bridges don't have a hold of the connector at the proper time to be able to route CEC events.

At the same time it not very easy and obvious to get the CEC physical address handling correctly. Drivers handle it at various places, ending up with the slight differences in behaviour.

Follow up the HDMI Connector and HDMI Audio series and implement generic HDMI CEC set of helpers that link into the HDMI Connector and drm_bridge_connector frameworks and provide a way to implement CEC handling for HDMI bridges in an easy yet standard way.

Notes:
- the patchset was only compile-tested
- being an RFC some of the API functions and structures are left undocumented
- although the patchset provides drm_bridge / drm_bridge_connector API for working with CEC, there is no actual bridge that uses the API (yet)

- I'm pretty unhappy with the drm_bridge integration code, we end up duplicating wrappers for CEC functions instead of reusing the drm_connector wrapping functions. An easy way would be to map drm_bridge to the corresponding drm_connector, but that would either require a state or storing drm_connector inside a drm_bridge. Current code stores cec_adapter instead.

---
Changes in v6:
- Fixed vc4 to build with changed API (Maxime)
- Reworked helpers to use drmm to unregister CEC implementations
(Maxime)
- Expanded commit message to explain void *data design (Maxime)
- Dropped extra include of drm_connector.h from drm_hdmi_cec_helper.h
(Jani)
- Link to v5: https://lore.kernel.org/r/20250407-drm-hdmi-connector-cec-v5-0-04809b10d206@oss.qualcomm.com

Changes in v5:
- Fixed the check in adv7511_bridge_hdmi_tmds_char_rate_valid().
- Major rework of HDMI CEC to follow 'helpers' design. Implemented
generic data structures that can be used for both CEC notifiers and
CEC adapters (Maxime).
- Link to v4: https://lore.kernel.org/r/[email protected]

Changes in v4:
- Rebased on top of drm-misc-next + commit 78a5acf5433d ("drm/display:
hdmi: Do not read EDID on disconnected connectors")
- Moved 'select DRM_DISPLAY_HDMI_CEC_HELPER' under the
DRM_I2C_ADV7511_CEC symbol
- Fixed documentation for @hdmi_audio_i2s_formats to describe default
behaviour.
- Split drm_connector_cleanup() patch from the patch adding CEC-related
data structures (Maxime).
- Documented that CEC mutex protects all data fields in struct
drm_connector_cec (Maxime).
- Improved drm_connector_cec_funcs.unregister() documentation.
- Documented struct drm_connector_hdmi_cec_adapter_ops fields. Added a
note to the commit message on the difference between it and struct drm_connector_cec_funcs (Maxime).
- Fixed Kconfig dependencies.
- Link to v3: https://lore.kernel.org/r/[email protected]

Changes in v3:
- Moved default available_las setting to
drm_connector_hdmi_cec_register(), allowing drivers to pass 0 instead
of CEC_MAX_LOG_ADDRS.
- Reworked drm_bridge interface to store opaque pointer and interpret it
as drm_connector in CEC helpers code.
- Fixed EINVAL checks in drm_connector_hdmi_cec_register().
- Added the adv7511 patch, demonstrating CEC helpers for the DRM
bridges.
- Link to v2: https://lore.kernel.org/r/[email protected]

Changes in v2:
- Refactored CEC funcs, adding more wrappers to provide more consistent
interface (Maxime)
- Removed export of drm_connector_cec_unregister() (Maxime)
- Restored and rephrased comment in vc4_hdmi (Maxime)
- Squashed vc4 patches
- Link to v1: https://lore.kernel.org/r/[email protected]

---
Dmitry Baryshkov (10):
drm/bridge: move private data to the end of the struct drm/bridge: allow limiting I2S formats drm/connector: add CEC-related fields drm/display: move CEC_CORE selection to DRM_DISPLAY_HELPER drm/display: add CEC helpers code
drm/display: hdmi-state-helper: handle CEC physical address drm/vc4: hdmi: switch to generic CEC helpers drm/display: bridge-connector: hook in CEC notifier support drm/display: bridge-connector: handle CEC adapters drm/bridge: adv7511: switch to the HDMI connector helpers

 drivers/gpu/drm/bridge/adv7511/Kconfig             |   5 +-
 drivers/gpu/drm/bridge/adv7511/adv7511.h           |  52 ++--
 drivers/gpu/drm/bridge/adv7511/adv7511_audio.c     |  77 +----
 drivers/gpu/drm/bridge/adv7511/adv7511_cec.c       |  57 ++--
 drivers/gpu/drm/bridge/adv7511/adv7511_drv.c       | 345 +++++++++------------
 drivers/gpu/drm/bridge/adv7511/adv7533.c           |   4 -
 drivers/gpu/drm/display/Kconfig                    |  13 +-
 drivers/gpu/drm/display/Makefile                   |   4 +
 drivers/gpu/drm/display/drm_bridge_connector.c     | 108 +++++++
 drivers/gpu/drm/display/drm_hdmi_audio_helper.c    |   3 +
 drivers/gpu/drm/display/drm_hdmi_cec_helper.c      | 192 ++++++++++++
 .../gpu/drm/display/drm_hdmi_cec_notifier_helper.c |  64 ++++
 drivers/gpu/drm/display/drm_hdmi_state_helper.c    |   7 +-
 drivers/gpu/drm/drm_connector.c                    |  42 +++
 drivers/gpu/drm/vc4/Kconfig                        |   1 +
 drivers/gpu/drm/vc4/vc4_hdmi.c                     | 139 ++++-----
 drivers/gpu/drm/vc4/vc4_hdmi.h                     |   1 -
 include/drm/display/drm_hdmi_audio_helper.h        |   1 +
 include/drm/display/drm_hdmi_cec_helper.h          |  72 +++++
 include/drm/drm_bridge.h                           |  76 ++++-
 include/drm/drm_connector.h                        |  48 +++
 21 files changed, 880 insertions(+), 431 deletions(-)

---
base-commit: 3330b71caff6cdc387fdad68a895c9c81cc2f477
change-id: 20241223-drm-hdmi-connector-cec-34902ce847b7

Best regards,

Signature · 1 line
Dmitry Baryshkov <[email protected]>
#1 lore raw

PATCH v6 1/10 drm/bridge: move private data to the end of the struct

WHen adding HDMI fields I didn't notice the private: declaration for HPD fields. Move private fields to the end of the struct drm_bride to have clear distinction between private and public fields.

---
 include/drm/drm_bridge.h | 31 ++++++++++++++++---------------
 1 file changed, 16 insertions(+), 15 deletions(-)
include/drm/drm_bridge.h +16 -15
index 4e418a29a9ff9d014d6ac0910a5d9bcf7118195e..286f6fb3fe2b80f237db85dc8459430dc82337e2 100644
@@ -977,21 +977,6 @@ struct drm_bridge {
 	 * @ddc: Associated I2C adapter for DDC access, if any.
 	 */
 	struct i2c_adapter *ddc;
-	/** private: */
-	/**
-	 * @hpd_mutex: Protects the @hpd_cb and @hpd_data fields.
-	 */
-	struct mutex hpd_mutex;
-	/**
-	 * @hpd_cb: Hot plug detection callback, registered with
-	 * drm_bridge_hpd_enable().
-	 */
-	void (*hpd_cb)(void *data, enum drm_connector_status status);
-	/**
-	 * @hpd_data: Private data passed to the Hot plug detection callback
-	 * @hpd_cb.
-	 */
-	void *hpd_data;
 
 	/**
 	 * @vendor: Vendor of the product to be used for the SPD InfoFrame
@@ -1043,6 +1028,22 @@ struct drm_bridge {
 	 * not used.
 	 */
 	int hdmi_audio_dai_port;
+
+	/** private: */
+	/**
+	 * @hpd_mutex: Protects the @hpd_cb and @hpd_data fields.
+	 */
+	struct mutex hpd_mutex;
+	/**
+	 * @hpd_cb: Hot plug detection callback, registered with
+	 * drm_bridge_hpd_enable().
+	 */
+	void (*hpd_cb)(void *data, enum drm_connector_status status);
+	/**
+	 * @hpd_data: Private data passed to the Hot plug detection callback
+	 * @hpd_cb.
+	 */
+	void *hpd_data;
 };
 
 static inline struct drm_bridge *
Signature · 1 line
2.39.5
#2 lore raw

PATCH v6 2/10 drm/bridge: allow limiting I2S formats

In reply to Dmitry Baryshkov

By default HDMI codec registers all formats supported on the I2S bus. Allow bridges (and connectors) to limit the list of the PCM formats supported by the HDMI codec.

---
 drivers/gpu/drm/display/drm_bridge_connector.c  | 1 +
 drivers/gpu/drm/display/drm_hdmi_audio_helper.c | 3 +++
 drivers/gpu/drm/vc4/vc4_hdmi.c                  | 2 +-
 include/drm/display/drm_hdmi_audio_helper.h     | 1 +
 include/drm/drm_bridge.h                        | 8 ++++++++
 5 files changed, 14 insertions(+), 1 deletion(-)
drivers/gpu/drm/display/drm_bridge_connector.c +1 -0
index 7d2e499ea5dec2f710c1c67323bf9e6b177d3c9e..381a0f9d4259bf9f72d3a292b7dcc82e45c61bae 100644
@@ -717,6 +717,7 @@ struct drm_connector *drm_bridge_connector_init(struct drm_device *drm,
 		ret = drm_connector_hdmi_audio_init(connector, dev,
 						    &drm_bridge_connector_hdmi_audio_funcs,
 						    bridge->hdmi_audio_max_i2s_playback_channels,
+						    bridge->hdmi_audio_i2s_formats,
 						    bridge->hdmi_audio_spdif_playback,
 						    bridge->hdmi_audio_dai_port);
 		if (ret)
drivers/gpu/drm/display/drm_hdmi_audio_helper.c +3 -0
index 05afc9f0bdd6b6f00d74223a9d8875e6d16aea5f..21c93bdd8648cf70e691dbf0c92fae5823fd1828 100644
@@ -142,6 +142,7 @@ static const struct hdmi_codec_ops drm_connector_hdmi_audio_ops = {
  * @hdmi_codec_dev: device to be used as a parent for the HDMI Codec
  * @funcs: callbacks for this HDMI Codec
  * @max_i2s_playback_channels: maximum number of playback I2S channels
+ * @i2s_formats: set of I2S formats (use 0 for a bus-specific set)
  * @spdif_playback: set if HDMI codec has S/PDIF playback port
  * @dai_port: sound DAI port, -1 if it is not enabled
  *
@@ -154,6 +155,7 @@ int drm_connector_hdmi_audio_init(struct drm_connector *connector,
 				  struct device *hdmi_codec_dev,
 				  const struct drm_connector_hdmi_audio_funcs *funcs,
 				  unsigned int max_i2s_playback_channels,
+				  u64 i2s_formats,
 				  bool spdif_playback,
 				  int dai_port)
 {
@@ -161,6 +163,7 @@ int drm_connector_hdmi_audio_init(struct drm_connector *connector,
 		.ops = &drm_connector_hdmi_audio_ops,
 		.max_i2s_channels = max_i2s_playback_channels,
 		.i2s = !!max_i2s_playback_channels,
+		.i2s_formats = i2s_formats,
 		.spdif = spdif_playback,
 		.no_i2s_capture = true,
 		.no_spdif_capture = true,
drivers/gpu/drm/vc4/vc4_hdmi.c +1 -1
index a29a6ef266f9a5952af53030a9a2d313e2ecdfce..4797ed1c21f47992fe4d497d904ee31c824cd449 100644
@@ -562,7 +562,7 @@ static int vc4_hdmi_connector_init(struct drm_device *dev,
 
 	ret = drm_connector_hdmi_audio_init(connector, dev->dev,
 					    &vc4_hdmi_audio_funcs,
-					    8, false, -1);
+					    8, 0, false, -1);
 	if (ret)
 		return ret;
 
include/drm/display/drm_hdmi_audio_helper.h +1 -0
index c9a6faef4109f20ba79b610a9d5e8d5980efe2d1..44d910bdc72dd2fdbbe7ada65b67080d4a41e88b 100644
@@ -14,6 +14,7 @@ int drm_connector_hdmi_audio_init(struct drm_connector *connector,
 				  struct device *hdmi_codec_dev,
 				  const struct drm_connector_hdmi_audio_funcs *funcs,
 				  unsigned int max_i2s_playback_channels,
+				  u64 i2s_formats,
 				  bool spdif_playback,
 				  int sound_dai_port);
 void drm_connector_hdmi_audio_plugged_notify(struct drm_connector *connector,
include/drm/drm_bridge.h +8 -0
index 286f6fb3fe2b80f237db85dc8459430dc82337e2..db0d374d863b0b1f774d395743f1e29bb84e8937 100644
@@ -1016,6 +1016,14 @@ struct drm_bridge {
 	 */
 	int hdmi_audio_max_i2s_playback_channels;
 
+	/**
+	 * @hdmi_audio_i2s_formats: supported I2S formats, optional. The
+	 * default is to allow all formats supported by the corresponding I2S
+	 * bus driver. This is only used for bridges setting
+	 * @DRM_BRIDGE_OP_HDMI_AUDIO or @DRM_BRIDGE_OP_DP_AUDIO.
+	 */
+	u64 hdmi_audio_i2s_formats;
+
 	/**
 	 * @hdmi_audio_spdif_playback: set if this bridge has S/PDIF playback
 	 * port for @DRM_BRIDGE_OP_HDMI_AUDIO or @DRM_BRIDGE_OP_DP_AUDIO.
Signature · 1 line
2.39.5
#3 lore raw

PATCH v6 3/10 drm/connector: add CEC-related fields

In reply to Dmitry Baryshkov

As a preparation to adding HDMI CEC helper code, add CEC-related fields to the struct drm_connector. The callbacks abstract CEC infrastructure in order to support CEC adapters and CEC notifiers in a universal way.

CEC data is a void pointer as it allows us to make CEC data helper-specific. For example, currently it will be either cec_notifier or cec_adapter + drm_connector_hdmi_cec_funcs. Later cec-pin might store platform callbacks here. DP CEC might need to store AUX pointer, etc.

---
 drivers/gpu/drm/drm_connector.c | 42 ++++++++++++++++++++++++++++++++++++
 include/drm/drm_connector.h     | 48 +++++++++++++++++++++++++++++++++++++++++
 2 files changed, 90 insertions(+)
drivers/gpu/drm/drm_connector.c +42 -0
index 48b08c9611a7bc70e4d849ff33ecf1c9de3cf0ae..ba08fbd973829e49ea977251c4f0fb6d96ade631 100644
@@ -279,6 +279,7 @@ static int drm_connector_init_only(struct drm_device *dev,
 	INIT_LIST_HEAD(&connector->probed_modes);
 	INIT_LIST_HEAD(&connector->modes);
 	mutex_init(&connector->mutex);
+	mutex_init(&connector->cec.mutex);
 	mutex_init(&connector->eld_mutex);
 	mutex_init(&connector->edid_override_mutex);
 	mutex_init(&connector->hdmi.infoframes.lock);
@@ -701,6 +702,47 @@ static void drm_mode_remove(struct drm_connector *connector,
 	drm_mode_destroy(connector->dev, mode);
 }
 
+/**
+ * drm_connector_cec_phys_addr_invalidate - invalidate CEC physical address
+ * @connector: connector undergoing CEC operation
+ *
+ * Invalidated CEC physical address set for this DRM connector.
+ */
+void drm_connector_cec_phys_addr_invalidate(struct drm_connector *connector)
+{
+	mutex_lock(&connector->cec.mutex);
+
+	if (connector->cec.funcs &&
+	    connector->cec.funcs->phys_addr_invalidate)
+		connector->cec.funcs->phys_addr_invalidate(connector);
+
+	mutex_unlock(&connector->cec.mutex);
+}
+EXPORT_SYMBOL(drm_connector_cec_phys_addr_invalidate);
+
+
+/**
+ * drm_connector_cec_phys_addr_set - propagate CEC physical address
+ * @connector: connector undergoing CEC operation
+ *
+ * Propagate CEC physical address from the display_info to this DRM connector.
+ */
+void drm_connector_cec_phys_addr_set(struct drm_connector *connector)
+{
+	u16 addr;
+
+	mutex_lock(&connector->cec.mutex);
+
+	addr = connector->display_info.source_physical_address;
+
+	if (connector->cec.funcs &&
+	    connector->cec.funcs->phys_addr_set)
+		connector->cec.funcs->phys_addr_set(connector, addr);
+
+	mutex_unlock(&connector->cec.mutex);
+}
+EXPORT_SYMBOL(drm_connector_cec_phys_addr_set);
+
 /**
  * drm_connector_cleanup - cleans up an initialised connector
  * @connector: connector to cleanup
include/drm/drm_connector.h +48 -0

66 lines not on this page · raw message

Signature · 1 line
2.39.5
maintainer Reviewed-by on v6 3/10
#4 lore raw

Re: [PATCH v6 03/10] drm/connector: add CEC-related fields

Quoted 7 lines · Dmitry Baryshkov

As a preparation to adding HDMI CEC helper code, add CEC-related fields to the struct drm_connector. The callbacks abstract CEC infrastructure in order to support CEC adapters and CEC notifiers in a universal way.

CEC data is a void pointer as it allows us to make CEC data

[ ... ]

Thanks!
Maxime

#5 lore raw

PATCH v6 4/10 drm/display: move CEC_CORE selection to DRM_DISPLAY_HELPER

In reply to Dmitry Baryshkov

THe Kconfig symbol DRM_DISPLAY_DP_AUX_CEC is a boolean which simply toggles whether DP_AUX_CEC support should be built into the drm_display_helper (which can be eithera module or built-in into the kernel). If DRM_DISPLAY_DP_AUX_CEC is selected, then CEC_CORE is selected to be built-in into the kernel even if DRM_DISPLAY_HELPER is selected to be built as a module. Move CEC_CORE selection to the latter symbol in order to allow it to be built as a module.

---
 drivers/gpu/drm/display/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/display/Kconfig +1 -1
index 8d22b7627d41f7bc015decf24ae02a05bc00f055..3666e791d6d6eba58f095d7fb691de1fd0b95ed3 100644
@@ -8,6 +8,7 @@ config DRM_DISPLAY_DP_AUX_BUS
 config DRM_DISPLAY_HELPER
 	tristate
 	depends on DRM
+	select CEC_CORE if DRM_DISPLAY_DP_AUX_CEC
 	help
 	  DRM helpers for display adapters.
 
@@ -23,7 +24,6 @@ config DRM_BRIDGE_CONNECTOR
 config DRM_DISPLAY_DP_AUX_CEC
 	bool "Enable DisplayPort CEC-Tunneling-over-AUX HDMI support"
 	select DRM_DISPLAY_DP_HELPER
-	select CEC_CORE
 	help
 	  Choose this option if you want to enable HDMI CEC support for
 	  DisplayPort/USB-C to HDMI adapters.
Signature · 1 line
2.39.5
#6 lore raw

PATCH v6 5/10 drm/display: add CEC helpers code

In reply to Dmitry Baryshkov

Add generic CEC helpers to be used by HDMI drivers. Both notifier and and adapter are supported for registration. Once registered, the driver can call common set of functions to update physical address, to invalidate it or to unregister CEC data. Unlike drm_connector_cec_funcs (which provides interface common to all implementations, including, but not limited to the CEC adapter, CEC notifier, CEC pin-based adapter, etc) the struct drm_connector_hdmi_cec_adapter_ops provides callbacks specific to the CEC adapter implementations.

---
 drivers/gpu/drm/display/Kconfig                    |  12 +-
 drivers/gpu/drm/display/Makefile                   |   4 +
 drivers/gpu/drm/display/drm_hdmi_cec_helper.c      | 192 +++++++++++++++++++++
 .../gpu/drm/display/drm_hdmi_cec_notifier_helper.c |  64 +++++++
 include/drm/display/drm_hdmi_cec_helper.h          |  72 ++++++++
 5 files changed, 343 insertions(+), 1 deletion(-)
drivers/gpu/drm/display/Kconfig +11 -1
index 3666e791d6d6eba58f095d7fb691de1fd0b95ed3..6376ea01ec3093a72de25064e31223d2c9868ed7 100644
@@ -8,7 +8,7 @@ config DRM_DISPLAY_DP_AUX_BUS
 config DRM_DISPLAY_HELPER
 	tristate
 	depends on DRM
-	select CEC_CORE if DRM_DISPLAY_DP_AUX_CEC
+	select CEC_CORE if DRM_DISPLAY_DP_AUX_CEC || DRM_DISPLAY_HDMI_CEC_HELPER || CEC_NOTIFIER
 	help
 	  DRM helpers for display adapters.
 
@@ -82,6 +82,16 @@ config DRM_DISPLAY_HDMI_AUDIO_HELPER
 	  DRM display helpers for HDMI Audio functionality (generic HDMI Codec
 	  implementation).
 
+config DRM_DISPLAY_HDMI_CEC_HELPER
+	bool
+	help
+	  DRM display helpers for HDMI CEC implementation.
+
+config DRM_DISPLAY_HDMI_CEC_NOTIFIER_HELPER
+	def_bool CEC_NOTIFIER
+	help
+	  DRM display helpers for HDMI CEC notifiers implementation.
+
 config DRM_DISPLAY_HDMI_HELPER
 	bool
 	help
drivers/gpu/drm/display/Makefile +4 -0
index b17879b957d5401721396e247fa346387cf6c48a..0ff4a1ad0222078bf495175915007f1b1f903296 100644
@@ -16,6 +16,10 @@ drm_display_helper-$(CONFIG_DRM_DISPLAY_DSC_HELPER) += \
 drm_display_helper-$(CONFIG_DRM_DISPLAY_HDCP_HELPER) += drm_hdcp_helper.o
 drm_display_helper-$(CONFIG_DRM_DISPLAY_HDMI_AUDIO_HELPER) += \
 	drm_hdmi_audio_helper.o
+drm_display_helper-$(CONFIG_DRM_DISPLAY_HDMI_CEC_HELPER) += \
+	drm_hdmi_cec_helper.o
+drm_display_helper-$(CONFIG_DRM_DISPLAY_HDMI_CEC_NOTIFIER_HELPER) += \
+	drm_hdmi_cec_notifier_helper.o
 drm_display_helper-$(CONFIG_DRM_DISPLAY_HDMI_HELPER) += \
 	drm_hdmi_helper.o \
 	drm_scdc_helper.o
drivers/gpu/drm/display/drm_hdmi_cec_helper.c new file +192 -0

192 lines not on this page · raw message

drivers/gpu/drm/display/drm_hdmi_cec_notifier_helper.c new file +64 -0

64 lines not on this page · raw message

include/drm/display/drm_hdmi_cec_helper.h new file +72 -0

72 lines not on this page · raw message

Signature · 1 line
2.39.5
maintainer Reviewed-by on v6 5/10
#7 lore raw

Re: [PATCH v6 05/10] drm/display: add CEC helpers code

Quoted 7 lines · Dmitry Baryshkov

Add generic CEC helpers to be used by HDMI drivers. Both notifier and and adapter are supported for registration. Once registered, the driver can call common set of functions to update physical address, to invalidate it or to unregister CEC data. Unlike drm_connector_cec_funcs (which provides interface common to all implementations, including, but

[ ... ]

Thanks!
Maxime

#8 lore raw

PATCH v6 6/10 drm/display: hdmi-state-helper: handle CEC physical address

In reply to Dmitry Baryshkov

Call HDMI CEC helpers in order to update physical address of the adapter.

---
 drivers/gpu/drm/display/drm_hdmi_state_helper.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/gpu/drm/display/drm_hdmi_state_helper.c +5 -2
index d9d9948b29e9d5ef9bc9cc9108b3ace4aca2e3ae..bae7aa624f7db61cc7d5ff7a86a413938963543f 100644
@@ -6,6 +6,7 @@
 #include <drm/drm_print.h>
 
 #include <drm/display/drm_hdmi_audio_helper.h>
+#include <drm/display/drm_hdmi_cec_helper.h>
 #include <drm/display/drm_hdmi_helper.h>
 #include <drm/display/drm_hdmi_state_helper.h>
 
@@ -1081,9 +1082,10 @@ drm_atomic_helper_connector_hdmi_update(struct drm_connector *connector,
 	const struct drm_edid *drm_edid;
 
 	if (status == connector_status_disconnected) {
-		// TODO: also handle CEC and scramber, HDMI sink 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;
 	}
 
@@ -1097,8 +1099,9 @@ drm_atomic_helper_connector_hdmi_update(struct drm_connector *connector,
 	drm_edid_free(drm_edid);
 
 	if (status == connector_status_connected) {
-		// TODO: also handle CEC and scramber, HDMI sink is now 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);
 	}
 }
 
Signature · 1 line
2.39.5
#9 lore raw

PATCH v6 7/10 drm/vc4: hdmi: switch to generic CEC helpers

In reply to Dmitry Baryshkov

Switch VC4 driver to using CEC helpers code, simplifying hotplug and registration / cleanup. The existing vc4_hdmi_cec_release() is kept for now.

---
 drivers/gpu/drm/vc4/Kconfig    |   1 +
 drivers/gpu/drm/vc4/vc4_hdmi.c | 137 ++++++++++++++++-------------------------
 drivers/gpu/drm/vc4/vc4_hdmi.h |   1 -
 3 files changed, 55 insertions(+), 84 deletions(-)
drivers/gpu/drm/vc4/Kconfig +1 -0
index 123ab0ce178157c3b39466f87c7ac39c8470f329..bb8c40be325033632d3e94db87a16b03554ad3af 100644
@@ -35,6 +35,7 @@ config DRM_VC4_HDMI_CEC
 	bool "Broadcom VC4 HDMI CEC Support"
 	depends on DRM_VC4
 	select CEC_CORE
+	select DRM_DISPLAY_HDMI_CEC_HELPER
 	help
 	  Choose this option if you have a Broadcom VC4 GPU
 	  and want to use CEC.
drivers/gpu/drm/vc4/vc4_hdmi.c +54 -83

252 lines not on this page · raw message

drivers/gpu/drm/vc4/vc4_hdmi.h +0 -1
index a31157c99bee6b33527c4b558fc72fff65d2a278..8d069718df00d9afc13aadbb12648e2bb75a1721 100644
@@ -147,7 +147,6 @@ struct vc4_hdmi {
 	 */
 	bool disable_wifi_frequencies;
 
-	struct cec_adapter *cec_adap;
 	struct cec_msg cec_rx_msg;
 	bool cec_tx_ok;
 	bool cec_irq_was_rx;
Signature · 1 line
2.39.5
#11 lore raw

PATCH v6 8/10 drm/display: bridge-connector: hook in CEC notifier support

In reply to Dmitry Baryshkov

Allow HDMI DRM bridges to create CEC notifier. Physical address is handled automatically by drm_atomic_helper_connector_hdmi_hotplug() being called from .detect() path.

---
 drivers/gpu/drm/display/drm_bridge_connector.c | 24 ++++++++++++++++++++++++
 include/drm/drm_bridge.h                       | 11 +++++++++++
 2 files changed, 35 insertions(+)
drivers/gpu/drm/display/drm_bridge_connector.c +24 -0
index 381a0f9d4259bf9f72d3a292b7dcc82e45c61bae..0377dcd691a871643710d667248b05f8eb9e84d6 100644
@@ -20,6 +20,7 @@
 #include <drm/drm_print.h>
 #include <drm/drm_probe_helper.h>
 #include <drm/display/drm_hdmi_audio_helper.h>
+#include <drm/display/drm_hdmi_cec_helper.h>
 #include <drm/display/drm_hdmi_helper.h>
 #include <drm/display/drm_hdmi_state_helper.h>
 
@@ -113,6 +114,13 @@ struct drm_bridge_connector {
 	 * &DRM_BRIDGE_OP_DP_AUDIO).
 	 */
 	struct drm_bridge *bridge_dp_audio;
+	/**
+	 * @bridge_hdmi_cec:
+	 *
+	 * The bridge in the chain that implements CEC support, if any (see
+	 * DRM_BRIDGE_OP_HDMI_CEC_NOTIFIER).
+	 */
+	struct drm_bridge *bridge_hdmi_cec;
 };
 
 #define to_drm_bridge_connector(x) \
@@ -662,6 +670,13 @@ struct drm_connector *drm_bridge_connector_init(struct drm_device *drm,
 			bridge_connector->bridge_dp_audio = bridge;
 		}
 
+		if (bridge->ops & DRM_BRIDGE_OP_HDMI_CEC_NOTIFIER) {
+			if (bridge_connector->bridge_hdmi_cec)
+				return ERR_PTR(-EBUSY);
+
+			bridge_connector->bridge_hdmi_cec = bridge;
+		}
+
 		if (!drm_bridge_get_next_bridge(bridge))
 			connector_type = bridge->type;
 
@@ -724,6 +739,15 @@ struct drm_connector *drm_bridge_connector_init(struct drm_device *drm,
 			return ERR_PTR(ret);
 	}
 
+	if (bridge_connector->bridge_hdmi_cec &&
+	    bridge_connector->bridge_hdmi_cec->ops & DRM_BRIDGE_OP_HDMI_CEC_NOTIFIER) {
+		ret = drmm_connector_hdmi_cec_notifier_register(connector,
+								NULL,
+								bridge->hdmi_cec_dev);
+		if (ret)
+			return ERR_PTR(ret);
+	}
+
 	drm_connector_helper_add(connector, &drm_bridge_connector_helper_funcs);
 
 	if (bridge_connector->bridge_hpd)
include/drm/drm_bridge.h +11 -0
index db0d374d863b0b1f774d395743f1e29bb84e8937..0e5f6a007d536215bd50e11846433290c2060b9c 100644
@@ -907,6 +907,11 @@ enum drm_bridge_ops {
 	 * flag.
 	 */
 	DRM_BRIDGE_OP_DP_AUDIO = BIT(6),
+	/**
+	 * @DRM_BRIDGE_OP_HDMI_CEC_NOTIFIER: The bridge requires CEC notifier
+	 * to be present.
+	 */
+	DRM_BRIDGE_OP_HDMI_CEC_NOTIFIER = BIT(7),
 };
 
 /**
@@ -1003,6 +1008,12 @@ struct drm_bridge {
 	 */
 	unsigned int max_bpc;
 
+	/**
+	 * @hdmi_cec_dev: device to be used as a containing device for CEC
+	 * functions.
+	 */
+	struct device *hdmi_cec_dev;
+
 	/**
 	 * @hdmi_audio_dev: device to be used as a parent for the HDMI Codec if
 	 * either of @DRM_BRIDGE_OP_HDMI_AUDIO or @DRM_BRIDGE_OP_DP_AUDIO is set.
Signature · 1 line
2.39.5
reviewer
#12 lore raw

Re: [PATCH v6 08/10] drm/display: bridge-connector: hook in CEC notifier support

Hi Dmitry,

Quoted 7 lines · On Sat, 17 May 2025 04:59:44 +0300 Dmitry Baryshkov…

Allow HDMI DRM bridges to create CEC notifier. Physical address is handled automatically by drm_atomic_helper_connector_hdmi_hotplug() being called from .detect() path.

While working on drm_bridge_connector_init() for unrelated changes I stumbled upon something in this patch (now committed) which at a cursory look appears wrong to me. Even though I still haven't analyzed in depth I'm reporting it ASAP so you are aware and can either correct me or confirm there is a bug.

Quoted 15 lines
drivers/gpu/drm/display/drm_bridge_connector.c +7 -0
@@ -662,6 +670,13 @@ struct drm_connector *drm_bridge_connector_init(struct drm_device *drm,
 			bridge_connector->bridge_dp_audio = bridge;
 		}
 
+		if (bridge->ops & DRM_BRIDGE_OP_HDMI_CEC_NOTIFIER) {
+			if (bridge_connector->bridge_hdmi_cec)
+				return ERR_PTR(-EBUSY);
+
+			bridge_connector->bridge_hdmi_cec = bridge;
+		}
+
 		if (!drm_bridge_get_next_bridge(bridge))
 			connector_type = bridge->type;
 

drivers/gpu/drm/display/drm_bridge_connector.c struct drm_connector *drm_bridge_connector_init(struct drm_device *drm, · line 746

Quoted 8 lines
drivers/gpu/drm/display/drm_bridge_connector.c +5 -0
@@ -724,6 +739,15 @@ struct drm_connector *drm_bridge_connector_init(struct drm_device *drm,
 			return ERR_PTR(ret);
 	}
 
+	if (bridge_connector->bridge_hdmi_cec &&
+	    bridge_connector->bridge_hdmi_cec->ops & DRM_BRIDGE_OP_HDMI_CEC_NOTIFIER) {
+		ret = drmm_connector_hdmi_cec_notifier_register(connector,
+								NULL,
+								bridge->hdmi_cec_dev);

Here you are using the 'bridge' pointer, which is the variable used by the long drm_for_each_bridge_in_chain() loop at the function top. The same happens in the following patch. I am not sure this is what was intended, but I don't understand all the details of your series.

In an older patch [0] you had added a similar change, dereferencing the same 'bridge' variable after the drm_for_each_bridge_in_chain() loop. That was a bug fixed by a later patch [1].

Superficially this change (as well as patch 9) appears equally wrong.

Basically the value of 'bridge' here could be NULL or bridge_connector->bridge_hdmi, depending on the bridge_connector->bridge_hdmi value.

Is this the what you'd expect?

And if it is, what is the correct fix? Maybe:

ret = drmm_connector_hdmi_cec_notifier_register(connector,
NULL,
- bridge->hdmi_cec_dev);
+ bridge_connector->bridge_hdmi_cec->hdmi_cec_dev);

?

Removing unrelated lines, and adding a few comments, the code flow of the function is:

struct drm_connector *drm_bridge_connector_init(struct drm_device *drm,
struct drm_encoder *encoder)

{
	struct drm_bridge *bridge, *panel_bridge = NULL;

	drm_for_each_bridge_in_chain(encoder, bridge) {
		/* ...lots of stuff... */

		if (bridge->ops & DRM_BRIDGE_OP_HDMI_CEC_ADAPTER) {
			bridge_connector->bridge_hdmi_cec = bridge;
		}
	}

/* now bridge == NULL */

	if (bridge_connector->bridge_hdmi) {
		bridge = bridge_connector->bridge_hdmi;
	} else {
	}

/* now bridge can be NULL or bridge_connector->bridge_hdmi */

	if (bridge_connector->bridge_hdmi_audio ||
	    bridge_connector->bridge_dp_audio) {
		/* this is the code that got changed by [0] ad fixed by [1] */
		if (bridge_connector->bridge_hdmi_audio)
			bridge = bridge_connector->bridge_hdmi_audio;
		else
			bridge = bridge_connector->bridge_dp_audio;

		dev = bridge->hdmi_audio_dev;

		ret = drm_connector_hdmi_audio_init(connector, dev,
						    &drm_bridge_connector_hdmi_audio_funcs,
						    bridge->hdmi_audio_max_i2s_playback_channels,
						    bridge->hdmi_audio_i2s_formats,
						    bridge->hdmi_audio_spdif_playback,
						    bridge->hdmi_audio_dai_port);
	}

/* This is the code added by this patch */

	if (bridge_connector->bridge_hdmi_cec &&
	    bridge_connector->bridge_hdmi_cec->ops & DRM_BRIDGE_OP_HDMI_CEC_NOTIFIER) {
		ret = drmm_connector_hdmi_cec_notifier_register(connector,
								NULL,
								bridge->hdmi_cec_dev);
		if (ret)
			return ERR_PTR(ret);
	}

/* This is the code added by patch 09/10 */

	if (bridge_connector->bridge_hdmi_cec &&
	    bridge_connector->bridge_hdmi_cec->ops & DRM_BRIDGE_OP_HDMI_CEC_ADAPTER) {
		ret = drmm_connector_hdmi_cec_register(connector,
						       &drm_bridge_connector_hdmi_cec_funcs,
						       bridge->hdmi_cec_adapter_name,
						       bridge->hdmi_cec_available_las,
						       bridge->hdmi_cec_dev);
		if (ret)
			return ERR_PTR(ret);
	}
}

[0] https://cgit.freedesktop.org/drm-misc/commit/?id=231adeda9f67

    -> hunk @@ -641,11 +705,16 @@

[1] https://cgit.freedesktop.org/drm-misc/commit/?id=10357824151262636fda879845f8b64553541106

Best regards,
Luca

Signature · 3 lines
Luca Ceresoli, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#13 lore raw

Re: [PATCH v6 08/10] drm/display: bridge-connector: hook in CEC notifier support

Quoted 33 lines · Luca Ceresoli

Hi Dmitry,

Quoted 7 lines · On Sat, 17 May 2025 04:59:44 +0300 Dmitry Baryshkov…

Allow HDMI DRM bridges to create CEC notifier. Physical address is handled automatically by drm_atomic_helper_connector_hdmi_hotplug() being called from .detect() path.

While working on drm_bridge_connector_init() for unrelated changes I stumbled upon something in this patch (now committed) which at a cursory look appears wrong to me. Even though I still haven't analyzed in depth I'm reporting it ASAP so you are aware and can either correct me or confirm there is a bug.

Quoted 14 lines
drivers/gpu/drm/display/drm_bridge_connector.c +7 -0
@@ -662,6 +670,13 @@ struct drm_connector *drm_bridge_connector_init(struct drm_device *drm,
 			bridge_connector->bridge_dp_audio = bridge;
 		}
 
+		if (bridge->ops & DRM_BRIDGE_OP_HDMI_CEC_NOTIFIER) {
+			if (bridge_connector->bridge_hdmi_cec)
+				return ERR_PTR(-EBUSY);
+
+			bridge_connector->bridge_hdmi_cec = bridge;
+		}
+
 		if (!drm_bridge_get_next_bridge(bridge))
 			connector_type = bridge->type;
 
Quoted 6 lines

drivers/gpu/drm/display/drm_bridge_connector.c struct drm_connector *drm_bridge_connector_init(struct drm_device *drm, · line 743

Quoted 6 lines
drivers/gpu/drm/display/drm_bridge_connector.c +2 -0
@@ -724,6 +739,15 @@ struct drm_connector *drm_bridge_connector_init(struct drm_device *drm,
 			return ERR_PTR(ret);
 	}
 
+	if (bridge_connector->bridge_hdmi_cec &&
+	    bridge_connector->bridge_hdmi_cec->ops & DRM_BRIDGE_OP_HDMI_CEC_NOTIFIER) {

You are right, here it should be:

bridge = bridge_connector->bridge_hdmi_cec;

(and a similar change in the next if).

I'll send a patch.

Quoted 30 lines

drivers/gpu/drm/display/drm_bridge_connector.c struct drm_connector *drm_bridge_connector_init(struct drm_device *drm, · line 746

Quoted 3 lines
drivers/gpu/drm/display/drm_bridge_connector.c +3 -0
+		ret = drmm_connector_hdmi_cec_notifier_register(connector,
+								NULL,
+								bridge->hdmi_cec_dev);

Here you are using the 'bridge' pointer, which is the variable used by the long drm_for_each_bridge_in_chain() loop at the function top. The same happens in the following patch. I am not sure this is what was intended, but I don't understand all the details of your series.

In an older patch [0] you had added a similar change, dereferencing the same 'bridge' variable after the drm_for_each_bridge_in_chain() loop. That was a bug fixed by a later patch [1].

Superficially this change (as well as patch 9) appears equally wrong.

Basically the value of 'bridge' here could be NULL or bridge_connector->bridge_hdmi, depending on the bridge_connector->bridge_hdmi value.

Is this the what you'd expect?

And if it is, what is the correct fix? Maybe:

ret = drmm_connector_hdmi_cec_notifier_register(connector,
NULL,

(quoted diff) +1 -1
-						bridge->hdmi_cec_dev);
+						bridge_connector->bridge_hdmi_cec->hdmi_cec_dev);

?

[skipped]

Quoted 12 lines

[0] https://cgit.freedesktop.org/drm-misc/commit/?id=231adeda9f67

    -> hunk @@ -641,11 +705,16 @@

[1] https://cgit.freedesktop.org/drm-misc/commit/?id=10357824151262636fda879845f8b64553541106

Best regards,
Luca

Signature · 3 lines
Luca Ceresoli, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
Signature · 2 lines
With best wishes
Dmitry
#14 lore raw

PATCH v6 9/10 drm/display: bridge-connector: handle CEC adapters

In reply to Dmitry Baryshkov

Implement necessary glue code to let DRM bridge drivers to implement CEC adapters support.

---
 drivers/gpu/drm/display/Kconfig                |  1 +
 drivers/gpu/drm/display/drm_bridge_connector.c | 83 ++++++++++++++++++++++++++
 include/drm/drm_bridge.h                       | 26 ++++++++
 3 files changed, 110 insertions(+)
drivers/gpu/drm/display/Kconfig +1 -0
index 6376ea01ec3093a72de25064e31223d2c9868ed7..df09cf9a8ca19ea894d6f2fad68c0b191e81e3d0 100644
@@ -17,6 +17,7 @@ if DRM_DISPLAY_HELPER
 config DRM_BRIDGE_CONNECTOR
 	bool
 	select DRM_DISPLAY_HDMI_AUDIO_HELPER
+	select DRM_DISPLAY_HDMI_CEC_HELPER
 	select DRM_DISPLAY_HDMI_STATE_HELPER
 	help
 	  DRM connector implementation terminating DRM bridge chains.
drivers/gpu/drm/display/drm_bridge_connector.c +83 -0

101 lines not on this page · raw message

include/drm/drm_bridge.h +26 -0
index 0e5f6a007d536215bd50e11846433290c2060b9c..cc9f7df38102e3c43913b35312f0ed5c4d8a7bd0 100644
@@ -32,6 +32,7 @@
 #include <drm/drm_mode_object.h>
 #include <drm/drm_modes.h>
 
+struct cec_msg;
 struct device_node;
 
 struct drm_bridge;
@@ -737,6 +738,16 @@ struct drm_bridge_funcs {
 				      struct drm_bridge *bridge,
 				      bool enable, int direction);
 
+	int (*hdmi_cec_init)(struct drm_connector *connector,
+			     struct drm_bridge *bridge);
+
+	int (*hdmi_cec_enable)(struct drm_bridge *bridge, bool enable);
+
+	int (*hdmi_cec_log_addr)(struct drm_bridge *bridge, u8 logical_addr);
+
+	int (*hdmi_cec_transmit)(struct drm_bridge *bridge, u8 attempts,
+				 u32 signal_free_time, struct cec_msg *msg);
+
 	/**
 	 * @dp_audio_startup:
 	 *
@@ -912,6 +923,11 @@ enum drm_bridge_ops {
 	 * to be present.
 	 */
 	DRM_BRIDGE_OP_HDMI_CEC_NOTIFIER = BIT(7),
+	/**
+	 * @DRM_BRIDGE_OP_HDMI_CEC_ADAPTER: The bridge requires CEC notifier
+	 * to be present.
+	 */
+	DRM_BRIDGE_OP_HDMI_CEC_ADAPTER = BIT(8),
 };
 
 /**
@@ -1048,6 +1064,16 @@ struct drm_bridge {
 	 */
 	int hdmi_audio_dai_port;
 
+	/**
+	 * @hdmi_cec_adapter_name: the name of the adapter to register
+	 */
+	const char *hdmi_cec_adapter_name;
+
+	/**
+	 * @hdmi_cec_available_las: number of logical addresses, CEC_MAX_LOG_ADDRS if unset
+	 */
+	u8 hdmi_cec_available_las;
+
 	/** private: */
 	/**
 	 * @hpd_mutex: Protects the @hpd_cb and @hpd_data fields.
Signature · 1 line
2.39.5
#15 lore raw

PATCH v6 10/10 drm/bridge: adv7511: switch to the HDMI connector helpers

In reply to Dmitry Baryshkov

Rewrite the ADV7511 driver to use implementation provided by the DRM HDMI connector framework, including the Audio and CEC bits. Drop the in-bridge connector support and use drm_bridge_connector if the host requires the connector to be provided by the bridge.

Note: currently only AVI InfoFrames are supported. Existing driver doesn't support programming any other InfoFrames directly and Audio InfoFrame seems to be programmed using individual bits and pieces rather than programming it directly.

---
 drivers/gpu/drm/bridge/adv7511/Kconfig         |   5 +-
 drivers/gpu/drm/bridge/adv7511/adv7511.h       |  52 ++--
 drivers/gpu/drm/bridge/adv7511/adv7511_audio.c |  77 +-----
 drivers/gpu/drm/bridge/adv7511/adv7511_cec.c   |  57 ++--
 drivers/gpu/drm/bridge/adv7511/adv7511_drv.c   | 345 +++++++++++--------------
 drivers/gpu/drm/bridge/adv7511/adv7533.c       |   4 -
 6 files changed, 212 insertions(+), 328 deletions(-)
drivers/gpu/drm/bridge/adv7511/Kconfig +4 -1
index f46a5e26b5dd640670afa21802f9019d5c7439fb..59a5256ce8a6e16dfbf1848a7c85ac7d709a68ed 100644
@@ -5,6 +5,9 @@ config DRM_I2C_ADV7511
 	select DRM_KMS_HELPER
 	select REGMAP_I2C
 	select DRM_MIPI_DSI
+	select DRM_DISPLAY_HELPER
+	select DRM_BRIDGE_CONNECTOR
+	select DRM_DISPLAY_HDMI_STATE_HELPER
 	help
 	  Support for the Analog Devices ADV7511(W)/13/33/35 HDMI encoders.
 
@@ -19,7 +22,7 @@ config DRM_I2C_ADV7511_AUDIO
 config DRM_I2C_ADV7511_CEC
 	bool "ADV7511/33/35 HDMI CEC driver"
 	depends on DRM_I2C_ADV7511
-	select CEC_CORE
+	select DRM_DISPLAY_HDMI_CEC_HELPER
 	default y
 	help
 	  When selected the HDMI transmitter will support the CEC feature.
drivers/gpu/drm/bridge/adv7511/adv7511.h +28 -24

98 lines not on this page · raw message

drivers/gpu/drm/bridge/adv7511/adv7511_audio.c +11 -66

100 lines not on this page · raw message

drivers/gpu/drm/bridge/adv7511/adv7511_cec.c +22 -35

132 lines not on this page · raw message

drivers/gpu/drm/bridge/adv7511/adv7511_drv.c +147 -198

550 lines not on this page · raw message

drivers/gpu/drm/bridge/adv7511/adv7533.c +0 -4
index 122ad91e8a3293de1839cad061cd858d8046b675..b12d422343fc139e8d9b59a2ded60ce08ce43dc8 100644
@@ -106,10 +106,6 @@ enum drm_mode_status adv7533_mode_valid(struct adv7511 *adv,
 	struct mipi_dsi_device *dsi = adv->dsi;
 	u8 bpp = mipi_dsi_pixel_format_to_bpp(dsi->format);
 
-	/* Check max clock for either 7533 or 7535 */
-	if (mode->clock > adv->info->max_mode_clock_khz)
-		return MODE_CLOCK_HIGH;
-
 	/* Check max clock for each lane */
 	if (mode->clock * bpp > adv->info->max_lane_freq_khz * adv->num_dsi_lanes)
 		return MODE_CLOCK_HIGH;
Signature · 1 line
2.39.5
maintainer Reviewed-by on v6 10/10
#16 lore raw

Re: [PATCH v6 10/10] drm/bridge: adv7511: switch to the HDMI connector helpers

Quoted 7 lines · Dmitry Baryshkov

Rewrite the ADV7511 driver to use implementation provided by the DRM HDMI connector framework, including the Audio and CEC bits. Drop the in-bridge connector support and use drm_bridge_connector if the host requires the connector to be provided by the bridge.

[ ... ]

Thanks!
Maxime

#17 lore raw

Re: [PATCH v6 10/10] drm/bridge: adv7511: switch to the HDMI connector helpers

In reply to Dmitry Baryshkov
Quoted 4 lines · Dmitry Baryshkov

Rewrite the ADV7511 driver to use implementation provided by the DRM HDMI connector framework, including the Audio and CEC bits. Drop the in-bridge connector support and use drm_bridge_connector if the host requires the connector to be provided by the bridge.

In -next I'm seeing 96kHz playback to stop working in the ALSA pcm-test program on the avenger96 board:

# # default.time7.STM32AV96HDMI.0.0.PLAYBACK - 96kHz stereo large periods

# ok 7 # SKIP default.time7.STM32AV96HDMI.0.0.PLAYBACK
# # rate mismatch 96000 != 48000

Previously the test passed. There's also a lot of log spam introduced due to ELD not being available (nothing is plugged into the port on the board so this is correct, although I'm not sure the amount of logging is justified):

[   67.091889] hdmi-audio-codec hdmi-audio-codec.1.auto: HDMI: Unknown ELD version 0

which I imagine is what's triggering the failure for 96kHz. I didn't check into things but I'm guessing the drm_bridge_connector has more restrictive defaults than the in driver one and blocks 96kHz, I can't see any reference to sample rates in the deleted code.

Full log:

https://lava.sirena.org.uk/scheduler/job/1473785#L1435

A bisection points at this patch:

# bad: [bc6e0ba6c9bafa6241b05524b9829808056ac4ad] Add linux-next specific files for 20250613
# good: [afc47587aec9fbefabca94da7225f371d1f24ca5] Merge branch 'for-linux-next-fixes' of https://gitlab.freedesktop.org/drm/misc/kernel.git
# good: [2555a0fa42828dae32650b1234089d34297601cc] Merge branch 'main' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git
# good: [8a5a5cecb79058b608e5562d8998123a3adb313c] ASoC: tas2781: Move the "include linux/debugfs.h" into tas2781.h
# good: [a4eb71ff98c4792f441f108910bd829da7a04092] regulator: rpi-panel-v2: Fix missing OF dependency
# good: [6cafcc53eb5fffd9b9bdfde700bb9bad21e98ed3] spi: spi-mt65xx: Add support for MT6991 Dimensity 9400 SPI IPM
# good: [7e10d7242ea8a5947878880b912ffa5806520705] ASoC: ops: dynamically allocate struct snd_ctl_elem_value
# good: [d6fa0ca959db8efd4462d7beef4bdc5568640fd0] regulator: rpi-panel-v2: Add missing GPIOLIB dependency
# good: [d49305862fdc4d9ff1b1093b4ed7d8e0cb9971b4] regulator: rpi-panel-v2: Add regulator for 7" Raspberry Pi 720x1280
# good: [6ba68e5aa9d5d15c8877a655db279fcfc0b38b04] ASoC: renesas: msiof: Convert to <linux/spi/sh_msiof.h>
# good: [1f5cdb6ab45e1c06ae0953609acbb52f8946b3e8] ASoC: codecs: Add support for Richtek RTQ9124
# good: [c459262159f39e6e6336797feb975799344b749b] spi: spi-pci1xxxx: Add support for 25MHz Clock frequency in C0
# good: [548d770c330cd1027549947a6ea899c56b5bc4e4] regulator: pca9450: Add support for mode operations
# good: [03b778d1994827ea5cc971dbdfbb457bbb7bfa5d] ASOC: rockchip: Use helper function devm_clk_get_enabled()
# good: [267be32b0a7b70cc777f8a46f0904c92c0521d89] ASoC: remove component->id
# good: [f6f914893d478b7ba08e5c375de1ced16deb5e92] ASoC: dt-bindings: tas57xx: add tas5753 compatibility
# good: [111a2c8ab462d77d1519b71b46f13ae1b46920b4] ASoC: imx-card: Use helper function for_each_child_of_node_scoped()
# good: [c95e925daa434ee1a40a86aec6476ce588e4bd77] ASoC: Intel: avs: Add rt5640 machine board
# good: [3461a688e79ffc37c08b19015c90239025facd88] crypto: testmgr - remove crc32c context format test
# good: [9a30e332c36c52e92e5316b4a012d45284dedeb5] spi: spi-fsl-dspi: Enable support for S32G platforms
# good: [4965ef7ec15fd4b8f6f6bfb0f206e406ffdb6f6c] crypto: stm32 - remove crc32 and crc32c support
# good: [ac209bde018fd320b79976657a44c23113181af6] ASoC: tas2781: Drop the unnecessary symbol imply
# good: [ece5d881004f041c2e1493436409dbcbea3ad5f8] ASoC: codecs: wcd939x: Drop unused 'struct wcd939x_priv' fields
# good: [b9ecde0bcf6a99a3ff08496d4ba90a385ebbfd68] ASoC: codecs: wcd939x: Add VDD_PX supply
# good: [38903b792f65461c3ad1a10b07489e185be39123] crypto: inside-secure - remove crc32 support
# good: [e6e8897995a9e6028563ce36c27877e5478c8571] ASoC: qcom: sm8250: Add Fairphone 5 soundcard compatible
# good: [c8c4694ede7ed42d8d4db0e8927dea9839a3e248] regmap: kunit: Constify regmap_range_cfg array
# good: [7e17e80c3a7eb2734795f66ba946f933412d597f] Merge branch 'for-6.14/stack-order' into for-next
git bisect start 'bc6e0ba6c9bafa6241b05524b9829808056ac4ad' 'afc47587aec9fbefabca94da7225f371d1f24ca5' '2555a0fa42828dae32650b1234089d34297601cc' '8a5a5cecb79058b608e5562d8998123a3adb313c' 'a4eb71ff98c4792f441f108910bd829da7a04092' '6cafcc53eb5fffd9b9bdfde700bb9bad21e98ed3' '7e10d7242ea8a5947878880b912ffa5806520705' 'd6fa0ca959db8efd4462d7beef4bdc5568640fd0' 'd49305862fdc4d9ff1b1093b4ed7d8e0cb9971b4' '6ba68e5aa9d5d15c8877a655db279fcfc0b38b04' '1f5cdb6ab45e1c06ae0953609acbb52f8946b3e8' 'c459262159f39e6e6336797feb975799344b749b' '548d770c330cd1027549947a6ea899c56b5bc4e4' '03b778d1994827ea5cc971dbdfbb457bbb7bfa5d' '267be32b0a7b70cc777f8a46f0904c92c0521d89' 'f6f914893d478b7ba08e5c375de1ced16deb5e92' '111a2c8ab462d77d1519b71b46f13ae1b46920b4' 'c95e925daa434ee1a40a86aec6476ce588e4bd77' '3461a688e79ffc37c08b19015c90239025facd88' '9a30e332c36c52e92e5316b4a012d45284dedeb5' '4965ef7ec15fd4b8f6f6bfb0f206e406ffdb6f6c' 'ac209bde018fd320b79976657a44c23113181af6' 'ece5d881004f041c2e1493436409dbcbea3ad5f8' 'b9ecde0bcf6a99a3ff08496d4ba90a385ebbfd68' '38903b792f65461c3ad1a10b07489e185be39123' 'e6e8897995a9e6028563ce36c27877e5478c8571' 'c8c4694ede7ed42d8d4db0e8927dea9839a3e248' '7e17e80c3a7eb2734795f66ba946f933412d597f'

# test job: [2555a0fa42828dae32650b1234089d34297601cc] https://lava.sirena.org.uk/scheduler/job/1473852
# test job: [8a5a5cecb79058b608e5562d8998123a3adb313c] https://lava.sirena.org.uk/scheduler/job/1471730
# test job: [a4eb71ff98c4792f441f108910bd829da7a04092] https://lava.sirena.org.uk/scheduler/job/1468970
# test job: [6cafcc53eb5fffd9b9bdfde700bb9bad21e98ed3] https://lava.sirena.org.uk/scheduler/job/1468826
# test job: [7e10d7242ea8a5947878880b912ffa5806520705] https://lava.sirena.org.uk/scheduler/job/1465979
# test job: [d6fa0ca959db8efd4462d7beef4bdc5568640fd0] https://lava.sirena.org.uk/scheduler/job/1464722
# test job: [d49305862fdc4d9ff1b1093b4ed7d8e0cb9971b4] https://lava.sirena.org.uk/scheduler/job/1463087
# test job: [6ba68e5aa9d5d15c8877a655db279fcfc0b38b04] https://lava.sirena.org.uk/scheduler/job/1463358
# test job: [1f5cdb6ab45e1c06ae0953609acbb52f8946b3e8] https://lava.sirena.org.uk/scheduler/job/1462946
# test job: [c459262159f39e6e6336797feb975799344b749b] https://lava.sirena.org.uk/scheduler/job/1460673
# test job: [548d770c330cd1027549947a6ea899c56b5bc4e4] https://lava.sirena.org.uk/scheduler/job/1460099
# test job: [03b778d1994827ea5cc971dbdfbb457bbb7bfa5d] https://lava.sirena.org.uk/scheduler/job/1460832
# test job: [267be32b0a7b70cc777f8a46f0904c92c0521d89] https://lava.sirena.org.uk/scheduler/job/1460282
# test job: [f6f914893d478b7ba08e5c375de1ced16deb5e92] https://lava.sirena.org.uk/scheduler/job/1460225
# test job: [111a2c8ab462d77d1519b71b46f13ae1b46920b4] https://lava.sirena.org.uk/scheduler/job/1461355
# test job: [c95e925daa434ee1a40a86aec6476ce588e4bd77] https://lava.sirena.org.uk/scheduler/job/1460941
# test job: [3461a688e79ffc37c08b19015c90239025facd88] https://lava.sirena.org.uk/scheduler/job/1467196
# test job: [9a30e332c36c52e92e5316b4a012d45284dedeb5] https://lava.sirena.org.uk/scheduler/job/1461782
# test job: [4965ef7ec15fd4b8f6f6bfb0f206e406ffdb6f6c] https://lava.sirena.org.uk/scheduler/job/1467179
# test job: [ac209bde018fd320b79976657a44c23113181af6] https://lava.sirena.org.uk/scheduler/job/1460722
# test job: [ece5d881004f041c2e1493436409dbcbea3ad5f8] https://lava.sirena.org.uk/scheduler/job/1460323
# test job: [b9ecde0bcf6a99a3ff08496d4ba90a385ebbfd68] https://lava.sirena.org.uk/scheduler/job/1460237
# test job: [38903b792f65461c3ad1a10b07489e185be39123] https://lava.sirena.org.uk/scheduler/job/1467291
# test job: [e6e8897995a9e6028563ce36c27877e5478c8571] https://lava.sirena.org.uk/scheduler/job/1460745
# test job: [c8c4694ede7ed42d8d4db0e8927dea9839a3e248] https://lava.sirena.org.uk/scheduler/job/1461037
# test job: [7e17e80c3a7eb2734795f66ba946f933412d597f] https://lava.sirena.org.uk/scheduler/job/1466743
# test job: [bc6e0ba6c9bafa6241b05524b9829808056ac4ad] https://lava.sirena.org.uk/scheduler/job/1473785
# bad: [bc6e0ba6c9bafa6241b05524b9829808056ac4ad] Add linux-next specific files for 20250613
git bisect bad bc6e0ba6c9bafa6241b05524b9829808056ac4ad
# test job: [bbd6649089ac4a8f80ee112f6ac3d08f01a8a717] https://lava.sirena.org.uk/scheduler/job/1474393
# bad: [bbd6649089ac4a8f80ee112f6ac3d08f01a8a717] Merge branch 'for-linux-next' of https://gitlab.freedesktop.org/drm/i915/kernel
git bisect bad bbd6649089ac4a8f80ee112f6ac3d08f01a8a717
# test job: [c5b4393c5492555e35c08677a326c9c53b275abd] https://lava.sirena.org.uk/scheduler/job/1474545
# bad: [c5b4393c5492555e35c08677a326c9c53b275abd] drm/file: add client id to drm_file_error
git bisect bad c5b4393c5492555e35c08677a326c9c53b275abd
# test job: [33a46dab18c92da612778b115a600578fa4d42e1] https://lava.sirena.org.uk/scheduler/job/1474646
# bad: [33a46dab18c92da612778b115a600578fa4d42e1] drm/xe: Fix NPD when saving default context
git bisect bad 33a46dab18c92da612778b115a600578fa4d42e1
# test job: [3f08c356b881d3d6302de207a98ceec1c511159e] https://lava.sirena.org.uk/scheduler/job/1474667
# bad: [3f08c356b881d3d6302de207a98ceec1c511159e] panel/novatek-nt35510: Use refcounted allocation in place of devm_kzalloc()
git bisect bad 3f08c356b881d3d6302de207a98ceec1c511159e
# test job: [cb8d4323302c7ad6b8baa1f5ca29f6186b30f316] https://lava.sirena.org.uk/scheduler/job/1474692
# good: [cb8d4323302c7ad6b8baa1f5ca29f6186b30f316] dt-bindings: display: ti,am65x-dss: Add support for AM62L DSS
git bisect good cb8d4323302c7ad6b8baa1f5ca29f6186b30f316
# test job: [c53c3e87aeb7fc288dcb9dbdb22451e8721771e1] https://lava.sirena.org.uk/scheduler/job/1474709
# bad: [c53c3e87aeb7fc288dcb9dbdb22451e8721771e1] panel/himax-hx8394: Use refcounted allocation in place of devm_kzalloc()
git bisect bad c53c3e87aeb7fc288dcb9dbdb22451e8721771e1
# test job: [8b1a8f8b2002d31136d83e4d730b4cb41e9ee868] https://lava.sirena.org.uk/scheduler/job/1474722
# good: [8b1a8f8b2002d31136d83e4d730b4cb41e9ee868] drm/display: add CEC helpers code
git bisect good 8b1a8f8b2002d31136d83e4d730b4cb41e9ee868
# test job: [ae01d3183d2763ed27ab71f4ef5402b683d9ad8a] https://lava.sirena.org.uk/scheduler/job/1474737
# bad: [ae01d3183d2763ed27ab71f4ef5402b683d9ad8a] drm/bridge: adv7511: switch to the HDMI connector helpers
git bisect bad ae01d3183d2763ed27ab71f4ef5402b683d9ad8a
# test job: [65a2575a68e4ff03ba887b5aef679fc95405fcd2] https://lava.sirena.org.uk/scheduler/job/1474761
# good: [65a2575a68e4ff03ba887b5aef679fc95405fcd2] drm/display: bridge-connector: hook in CEC notifier support
git bisect good 65a2575a68e4ff03ba887b5aef679fc95405fcd2
# test job: [a74288c8ded7c34624e50b4aa8ca37ae6cc03df4] https://lava.sirena.org.uk/scheduler/job/1474772
# good: [a74288c8ded7c34624e50b4aa8ca37ae6cc03df4] drm/display: bridge-connector: handle CEC adapters
git bisect good a74288c8ded7c34624e50b4aa8ca37ae6cc03df4
# first bad commit: [ae01d3183d2763ed27ab71f4ef5402b683d9ad8a] drm/bridge: adv7511: switch to the HDMI connector helpers
author Applied
#18 lore raw

Re: (subset) [PATCH v6 00/10] drm/display: generic HDMI CEC helpers

In reply to Dmitry Baryshkov
Quoted 9 lines · Dmitry Baryshkov

Currently it is next to impossible to implement CEC handling for the setup using drm_bridges and drm_bridge_connector: bridges don't have a hold of the connector at the proper time to be able to route CEC events.

At the same time it not very easy and obvious to get the CEC physical address handling correctly. Drivers handle it at various places, ending up with the slight differences in behaviour.

[...]

Applied, thanks!

[01/10] drm/bridge: move private data to the end of the struct

        commit: fa3769e09be76142d51c617d7d0c72d9c725a49d
[02/10] drm/bridge: allow limiting I2S formats
        commit: d9f9bae6752f5a0280a80d1bc524cabd0d60c886
[03/10] drm/connector: add CEC-related fields
        commit: e72cd597c35012146bfe77b736a30fee3e77e61e
[04/10] drm/display: move CEC_CORE selection to DRM_DISPLAY_HELPER
        commit: bcc8553b6228d0387ff64978a03efa3c8983dd2f
[05/10] drm/display: add CEC helpers code
        commit: 8b1a8f8b2002d31136d83e4d730b4cb41e9ee868
[06/10] drm/display: hdmi-state-helper: handle CEC physical address
        commit: 603ce85427043ecb29ef737c1b350901ce3ebf09
[08/10] drm/display: bridge-connector: hook in CEC notifier support
        commit: 65a2575a68e4ff03ba887b5aef679fc95405fcd2
[09/10] drm/display: bridge-connector: handle CEC adapters
        commit: a74288c8ded7c34624e50b4aa8ca37ae6cc03df4
[10/10] drm/bridge: adv7511: switch to the HDMI connector helpers
        commit: ae01d3183d2763ed27ab71f4ef5402b683d9ad8a

Best regards,

Signature · 1 line
Dmitry Baryshkov <[email protected]>
#19 lore raw

RE: (subset) [PATCH v6 00/10] drm/display: generic HDMI CEC helpers

Hi Dmitry Baryshkov,

Thanks for the series.

Looks like, After this patch, when I change resolution using modetest it is not working. Monitor is showing out of range/No signal on RZ/V2L SMARC EVK connected to ADV7535.

Not sure, I am the only one facing this issue?

Modetest works fine with 6.15.0-rc6-next-20250516, where this patch series is not present.

Cheers,
Biju

Quoted 41 lines

-----Original Message-----
From: dri-devel <[email protected]> On Behalf Of Dmitry Baryshkov
Sent: 20 May 2025 23:40
Subject: Re: (subset) [PATCH v6 00/10] drm/display: generic HDMI CEC helpers

Quoted 9 lines · Dmitry Baryshkov

Currently it is next to impossible to implement CEC handling for the setup using drm_bridges and drm_bridge_connector: bridges don't have a hold of the connector at the proper time to be able to route CEC events.

At the same time it not very easy and obvious to get the CEC physical address handling correctly. Drivers handle it at various places, ending up with the slight differences in behaviour.

[...]

Applied, thanks!

[01/10] drm/bridge: move private data to the end of the struct

        commit: fa3769e09be76142d51c617d7d0c72d9c725a49d
[02/10] drm/bridge: allow limiting I2S formats
        commit: d9f9bae6752f5a0280a80d1bc524cabd0d60c886
[03/10] drm/connector: add CEC-related fields
        commit: e72cd597c35012146bfe77b736a30fee3e77e61e
[04/10] drm/display: move CEC_CORE selection to DRM_DISPLAY_HELPER
        commit: bcc8553b6228d0387ff64978a03efa3c8983dd2f
[05/10] drm/display: add CEC helpers code
        commit: 8b1a8f8b2002d31136d83e4d730b4cb41e9ee868
[06/10] drm/display: hdmi-state-helper: handle CEC physical address
        commit: 603ce85427043ecb29ef737c1b350901ce3ebf09
[08/10] drm/display: bridge-connector: hook in CEC notifier support
        commit: 65a2575a68e4ff03ba887b5aef679fc95405fcd2
[09/10] drm/display: bridge-connector: handle CEC adapters
        commit: a74288c8ded7c34624e50b4aa8ca37ae6cc03df4
[10/10] drm/bridge: adv7511: switch to the HDMI connector helpers
        commit: ae01d3183d2763ed27ab71f4ef5402b683d9ad8a

Best regards,
--
Dmitry Baryshkov <[email protected]>

#20 lore raw

Re: (subset) [PATCH v6 00/10] drm/display: generic HDMI CEC helpers

Hi Biju

Quoted 9 lines · Biju Das

Hi Dmitry Baryshkov,

Thanks for the series.

Looks like, After this patch, when I change resolution using modetest it is not working. Monitor is showing out of range/No signal on RZ/V2L SMARC EVK connected to ADV7535.

Not sure, I am the only one facing this issue?

I have been testing the series on db410c / adv7533, but something might have changed between the testing time and the present time. I will try checking it next week.

In the meantime, you can probably try comparing what gets programmed in adv7511_mode_set().

Quoted 49 lines

Modetest works fine with 6.15.0-rc6-next-20250516, where this patch series is not present.

Cheers,
Biju

Quoted 41 lines

-----Original Message-----
From: dri-devel <[email protected]> On Behalf Of Dmitry Baryshkov
Sent: 20 May 2025 23:40
Subject: Re: (subset) [PATCH v6 00/10] drm/display: generic HDMI CEC helpers

Quoted 9 lines · Dmitry Baryshkov

Currently it is next to impossible to implement CEC handling for the setup using drm_bridges and drm_bridge_connector: bridges don't have a hold of the connector at the proper time to be able to route CEC events.

At the same time it not very easy and obvious to get the CEC physical address handling correctly. Drivers handle it at various places, ending up with the slight differences in behaviour.

[...]

Applied, thanks!

[01/10] drm/bridge: move private data to the end of the struct

        commit: fa3769e09be76142d51c617d7d0c72d9c725a49d
[02/10] drm/bridge: allow limiting I2S formats
        commit: d9f9bae6752f5a0280a80d1bc524cabd0d60c886
[03/10] drm/connector: add CEC-related fields
        commit: e72cd597c35012146bfe77b736a30fee3e77e61e
[04/10] drm/display: move CEC_CORE selection to DRM_DISPLAY_HELPER
        commit: bcc8553b6228d0387ff64978a03efa3c8983dd2f
[05/10] drm/display: add CEC helpers code
        commit: 8b1a8f8b2002d31136d83e4d730b4cb41e9ee868
[06/10] drm/display: hdmi-state-helper: handle CEC physical address
        commit: 603ce85427043ecb29ef737c1b350901ce3ebf09
[08/10] drm/display: bridge-connector: hook in CEC notifier support
        commit: 65a2575a68e4ff03ba887b5aef679fc95405fcd2
[09/10] drm/display: bridge-connector: handle CEC adapters
        commit: a74288c8ded7c34624e50b4aa8ca37ae6cc03df4
[10/10] drm/bridge: adv7511: switch to the HDMI connector helpers
        commit: ae01d3183d2763ed27ab71f4ef5402b683d9ad8a

Best regards,
--
Dmitry Baryshkov <[email protected]>

Signature · 2 lines
With best wishes
Dmitry
#21 lore raw

RE: (subset) [PATCH v6 00/10] drm/display: generic HDMI CEC helpers

Hi Dmitry Baryshkov,

Quoted 16 lines

-----Original Message-----
From: Dmitry Baryshkov <[email protected]>
Sent: 23 May 2025 07:37
Subject: Re: (subset) [PATCH v6 00/10] drm/display: generic HDMI CEC helpers

Hi Biju

Quoted 8 lines · Biju Das

Hi Dmitry Baryshkov,

Thanks for the series.

Looks like, After this patch, when I change resolution using modetest it is not working. Monitor is showing out of range/No signal on RZ/V2L SMARC EVK connected to ADV7535.

Quoted 6 lines
Quoted 1 line

Not sure, I am the only one facing this issue?

I have been testing the series on db410c / adv7533, but something might have changed between the testing time and the present time. I will try checking it next week.

In the meantime, you can probably try comparing what gets programmed in adv7511_mode_set().

Sure, We are looking into this.

Cheers,
Biju

Quoted 57 lines
Quoted 52 lines

Modetest works fine with 6.15.0-rc6-next-20250516, where this patch series is not present.

Cheers,
Biju

Quoted 43 lines

-----Original Message-----
From: dri-devel <[email protected]> On Behalf Of Dmitry Baryshkov
Sent: 20 May 2025 23:40
Subject: Re: (subset) [PATCH v6 00/10] drm/display: generic HDMI CEC helpers

Quoted 9 lines · Dmitry Baryshkov

Currently it is next to impossible to implement CEC handling for
the setup using drm_bridges and drm_bridge_connector: bridges
don't have a hold of the connector at the proper time to be able to route CEC events.

At the same time it not very easy and obvious to get the CEC physical address handling correctly. Drivers handle it at various places, ending up with the slight differences in behaviour.

[...]

Applied, thanks!

[01/10] drm/bridge: move private data to the end of the struct

        commit: fa3769e09be76142d51c617d7d0c72d9c725a49d
[02/10] drm/bridge: allow limiting I2S formats
        commit: d9f9bae6752f5a0280a80d1bc524cabd0d60c886
[03/10] drm/connector: add CEC-related fields
        commit: e72cd597c35012146bfe77b736a30fee3e77e61e
[04/10] drm/display: move CEC_CORE selection to DRM_DISPLAY_HELPER
        commit: bcc8553b6228d0387ff64978a03efa3c8983dd2f
[05/10] drm/display: add CEC helpers code
        commit: 8b1a8f8b2002d31136d83e4d730b4cb41e9ee868
[06/10] drm/display: hdmi-state-helper: handle CEC physical address
        commit: 603ce85427043ecb29ef737c1b350901ce3ebf09
[08/10] drm/display: bridge-connector: hook in CEC notifier support
        commit: 65a2575a68e4ff03ba887b5aef679fc95405fcd2
[09/10] drm/display: bridge-connector: handle CEC adapters
        commit: a74288c8ded7c34624e50b4aa8ca37ae6cc03df4
[10/10] drm/bridge: adv7511: switch to the HDMI connector helpers
        commit: ae01d3183d2763ed27ab71f4ef5402b683d9ad8a

Best regards,
--
Dmitry Baryshkov <[email protected]>

--
With best wishes
Dmitry

#22 lore raw

Re: (subset) [PATCH v6 00/10] drm/display: generic HDMI CEC helpers

In reply to Dmitry Baryshkov

Hi Biju, Dmitry,
Thanks for your comments.

Quoted 12 lines · Dmitry Baryshkov

Hi Biju

Quoted 9 lines · Biju Das

Hi Dmitry Baryshkov,

Thanks for the series.

Looks like, After this patch, when I change resolution using modetest it is not working. Monitor is showing out of range/No signal on RZ/V2L SMARC EVK connected to ADV7535.

Not sure, I am the only one facing this issue?

I have the same issue using RZ/G3E Smark EVK connected to ADV7535. I found that switching back to the old:

- adv7511_mode_set()
- Using also old .mode_set = adv7511_bridge_mode_set,

Implementation fix the issue on my side.

Thanks & Regards,
Tommaso

Quoted 62 lines

I have been testing the series on db410c / adv7533, but something might have changed between the testing time and the present time. I will try checking it next week.

In the meantime, you can probably try comparing what gets programmed in adv7511_mode_set().

Quoted 49 lines

Modetest works fine with 6.15.0-rc6-next-20250516, where this patch series is not present.

Cheers,
Biju

Quoted 41 lines

-----Original Message-----
From: dri-devel <[email protected]> On Behalf Of Dmitry Baryshkov
Sent: 20 May 2025 23:40
Subject: Re: (subset) [PATCH v6 00/10] drm/display: generic HDMI CEC helpers

Quoted 9 lines · Dmitry Baryshkov

Currently it is next to impossible to implement CEC handling for the setup using drm_bridges and drm_bridge_connector: bridges don't have a hold of the connector at the proper time to be able to route CEC events.

At the same time it not very easy and obvious to get the CEC physical address handling correctly. Drivers handle it at various places, ending up with the slight differences in behaviour.

[...]

Applied, thanks!

[01/10] drm/bridge: move private data to the end of the struct

        commit: fa3769e09be76142d51c617d7d0c72d9c725a49d
[02/10] drm/bridge: allow limiting I2S formats
        commit: d9f9bae6752f5a0280a80d1bc524cabd0d60c886
[03/10] drm/connector: add CEC-related fields
        commit: e72cd597c35012146bfe77b736a30fee3e77e61e
[04/10] drm/display: move CEC_CORE selection to DRM_DISPLAY_HELPER
        commit: bcc8553b6228d0387ff64978a03efa3c8983dd2f
[05/10] drm/display: add CEC helpers code
        commit: 8b1a8f8b2002d31136d83e4d730b4cb41e9ee868
[06/10] drm/display: hdmi-state-helper: handle CEC physical address
        commit: 603ce85427043ecb29ef737c1b350901ce3ebf09
[08/10] drm/display: bridge-connector: hook in CEC notifier support
        commit: 65a2575a68e4ff03ba887b5aef679fc95405fcd2
[09/10] drm/display: bridge-connector: handle CEC adapters
        commit: a74288c8ded7c34624e50b4aa8ca37ae6cc03df4
[10/10] drm/bridge: adv7511: switch to the HDMI connector helpers
        commit: ae01d3183d2763ed27ab71f4ef5402b683d9ad8a

Best regards,
--
Dmitry Baryshkov <[email protected]>

Signature · 2 lines
With best wishes
Dmitry
#23 lore raw

Re: (subset) [PATCH v6 00/10] drm/display: generic HDMI CEC helpers

Hi Biju, Dmitry,

Quoted 17 lines · Tommaso Merciai

Hi Biju, Dmitry,
Thanks for your comments.

Quoted 12 lines · Dmitry Baryshkov

Hi Biju

Quoted 9 lines · Biju Das

Hi Dmitry Baryshkov,

Thanks for the series.

Looks like, After this patch, when I change resolution using modetest it is not working. Monitor is showing out of range/No signal on RZ/V2L SMARC EVK connected to ADV7535.

Not sure, I am the only one facing this issue?

Quoted 7 lines

I have the same issue using RZ/G3E Smark EVK connected to ADV7535. I found that switching back to the old:

- adv7511_mode_set()
- Using also old .mode_set = adv7511_bridge_mode_set,

Implementation fix the issue on my side.

Diving a bit on this issue I'm seeing the following:

root@smarc-rzg3e:~# modetest -M rzg2l-du -d -s HDMI-A-1:800x600-56.25@XR24
setting mode 800x600-56.25Hz on connectors HDMI-A-1, crtc 62
[   49.273134] adv7511_mode_set_old: drm_mode_vrefresh(mode) = 56
[   49.281006] rzg2l_mipi_dsi_atomic_enable: mode->clock: 36000
root@smarc-rzg3e:~# modetest -M rzg2l-du -d -s HDMI-A-1:800x600-56.25@XR24
setting mode 800x600-56.25Hz on connectors HDMI-A-1, crtc 62
[   74.076881] rzg2l_mipi_dsi_atomic_enable: mode->clock: 36000
[   74.092130] adv7511_mode_set: drm_mode_vrefresh(adj_mode) = 56

Same result but I think bad timing:

- old: adv7511_mode_set() is call before rzg2l_mipi_dsi_atomic_enable()
- new: adv7511_mode_set() is call after rzg2l_mipi_dsi_atomic_enable()

What do you think? Thanks in advance.

Thanks & Regards,
Tommaso

Quoted 67 lines

Thanks & Regards,
Tommaso

Quoted 62 lines

I have been testing the series on db410c / adv7533, but something might have changed between the testing time and the present time. I will try checking it next week.

In the meantime, you can probably try comparing what gets programmed in adv7511_mode_set().

Quoted 49 lines

Modetest works fine with 6.15.0-rc6-next-20250516, where this patch series is not present.

Cheers,
Biju

Quoted 41 lines

-----Original Message-----
From: dri-devel <[email protected]> On Behalf Of Dmitry Baryshkov
Sent: 20 May 2025 23:40
Subject: Re: (subset) [PATCH v6 00/10] drm/display: generic HDMI CEC helpers

Quoted 9 lines · Dmitry Baryshkov

Currently it is next to impossible to implement CEC handling for the setup using drm_bridges and drm_bridge_connector: bridges don't have a hold of the connector at the proper time to be able to route CEC events.

At the same time it not very easy and obvious to get the CEC physical address handling correctly. Drivers handle it at various places, ending up with the slight differences in behaviour.

[...]

Applied, thanks!

[01/10] drm/bridge: move private data to the end of the struct

        commit: fa3769e09be76142d51c617d7d0c72d9c725a49d
[02/10] drm/bridge: allow limiting I2S formats
        commit: d9f9bae6752f5a0280a80d1bc524cabd0d60c886
[03/10] drm/connector: add CEC-related fields
        commit: e72cd597c35012146bfe77b736a30fee3e77e61e
[04/10] drm/display: move CEC_CORE selection to DRM_DISPLAY_HELPER
        commit: bcc8553b6228d0387ff64978a03efa3c8983dd2f
[05/10] drm/display: add CEC helpers code
        commit: 8b1a8f8b2002d31136d83e4d730b4cb41e9ee868
[06/10] drm/display: hdmi-state-helper: handle CEC physical address
        commit: 603ce85427043ecb29ef737c1b350901ce3ebf09
[08/10] drm/display: bridge-connector: hook in CEC notifier support
        commit: 65a2575a68e4ff03ba887b5aef679fc95405fcd2
[09/10] drm/display: bridge-connector: handle CEC adapters
        commit: a74288c8ded7c34624e50b4aa8ca37ae6cc03df4
[10/10] drm/bridge: adv7511: switch to the HDMI connector helpers
        commit: ae01d3183d2763ed27ab71f4ef5402b683d9ad8a

Best regards,
--
Dmitry Baryshkov <[email protected]>

Signature · 2 lines
With best wishes
Dmitry
#24 lore raw

Re: (subset) [PATCH v6 00/10] drm/display: generic HDMI CEC helpers

Quoted 41 lines · Tommaso Merciai

Hi Biju, Dmitry,

Quoted 17 lines · Tommaso Merciai

Hi Biju, Dmitry,
Thanks for your comments.

Quoted 12 lines · Dmitry Baryshkov

Hi Biju

Quoted 9 lines · Biju Das

Hi Dmitry Baryshkov,

Thanks for the series.

Looks like, After this patch, when I change resolution using modetest it is not working. Monitor is showing out of range/No signal on RZ/V2L SMARC EVK connected to ADV7535.

Not sure, I am the only one facing this issue?

Quoted 7 lines

I have the same issue using RZ/G3E Smark EVK connected to ADV7535. I found that switching back to the old:

- adv7511_mode_set()
- Using also old .mode_set = adv7511_bridge_mode_set,

Implementation fix the issue on my side.

Diving a bit on this issue I'm seeing the following:

root@smarc-rzg3e:~# modetest -M rzg2l-du -d -s HDMI-A-1:800x600-56.25@XR24
setting mode 800x600-56.25Hz on connectors HDMI-A-1, crtc 62
[   49.273134] adv7511_mode_set_old: drm_mode_vrefresh(mode) = 56
[   49.281006] rzg2l_mipi_dsi_atomic_enable: mode->clock: 36000
root@smarc-rzg3e:~# modetest -M rzg2l-du -d -s HDMI-A-1:800x600-56.25@XR24
setting mode 800x600-56.25Hz on connectors HDMI-A-1, crtc 62
[   74.076881] rzg2l_mipi_dsi_atomic_enable: mode->clock: 36000
[   74.092130] adv7511_mode_set: drm_mode_vrefresh(adj_mode) = 56
Quoted 6 lines

Same result but I think bad timing:

- old: adv7511_mode_set() is call before rzg2l_mipi_dsi_atomic_enable()
- new: adv7511_mode_set() is call after rzg2l_mipi_dsi_atomic_enable()

What do you think? Thanks in advance.

It might be, we have had cases of such troubles with other bridges. Please send a patch, I'll ack / merge it.
Please add a comment before adv7511_mode_set() that it should not be merged to atomic_enable().

Quoted 71 lines

Thanks & Regards,
Tommaso

Quoted 67 lines

Thanks & Regards,
Tommaso

Quoted 62 lines

I have been testing the series on db410c / adv7533, but something might have changed between the testing time and the present time. I will try checking it next week.

In the meantime, you can probably try comparing what gets programmed in adv7511_mode_set().

Quoted 49 lines

Modetest works fine with 6.15.0-rc6-next-20250516, where this patch series is not present.

Cheers,
Biju

Quoted 41 lines

-----Original Message-----
From: dri-devel <[email protected]> On Behalf Of Dmitry Baryshkov
Sent: 20 May 2025 23:40
Subject: Re: (subset) [PATCH v6 00/10] drm/display: generic HDMI CEC helpers

Quoted 9 lines · Dmitry Baryshkov

Currently it is next to impossible to implement CEC handling for the setup using drm_bridges and drm_bridge_connector: bridges don't have a hold of the connector at the proper time to be able to route CEC events.

At the same time it not very easy and obvious to get the CEC physical address handling correctly. Drivers handle it at various places, ending up with the slight differences in behaviour.

[...]

Applied, thanks!

[01/10] drm/bridge: move private data to the end of the struct

        commit: fa3769e09be76142d51c617d7d0c72d9c725a49d
[02/10] drm/bridge: allow limiting I2S formats
        commit: d9f9bae6752f5a0280a80d1bc524cabd0d60c886
[03/10] drm/connector: add CEC-related fields
        commit: e72cd597c35012146bfe77b736a30fee3e77e61e
[04/10] drm/display: move CEC_CORE selection to DRM_DISPLAY_HELPER
        commit: bcc8553b6228d0387ff64978a03efa3c8983dd2f
[05/10] drm/display: add CEC helpers code
        commit: 8b1a8f8b2002d31136d83e4d730b4cb41e9ee868
[06/10] drm/display: hdmi-state-helper: handle CEC physical address
        commit: 603ce85427043ecb29ef737c1b350901ce3ebf09
[08/10] drm/display: bridge-connector: hook in CEC notifier support
        commit: 65a2575a68e4ff03ba887b5aef679fc95405fcd2
[09/10] drm/display: bridge-connector: handle CEC adapters
        commit: a74288c8ded7c34624e50b4aa8ca37ae6cc03df4
[10/10] drm/bridge: adv7511: switch to the HDMI connector helpers
        commit: ae01d3183d2763ed27ab71f4ef5402b683d9ad8a

Best regards,
--
Dmitry Baryshkov <[email protected]>

--
With best wishes
Dmitry

Signature · 2 lines
With best wishes
Dmitry
#25 lore raw

RE: (subset) [PATCH v6 00/10] drm/display: generic HDMI CEC helpers

In reply to Dmitry Baryshkov

Hi Dmitry Baryshkov,

Quoted 13 lines

-----Original Message-----
From: Dmitry Baryshkov <[email protected]>
Sent: 23 May 2025 07:37
Subject: Re: (subset) [PATCH v6 00/10] drm/display: generic HDMI CEC helpers

Hi Biju

Quoted 5 lines · Biju Das

Hi Dmitry Baryshkov,

Thanks for the series.

Quoted 7 lines
Quoted 4 lines

Looks like, After this patch, when I change resolution using modetest it is not working. Monitor is showing out of range/No signal on RZ/V2L SMARC EVK connected to ADV7535.

Not sure, I am the only one facing this issue?

I have been testing the series on db410c / adv7533, but something might have changed between the testing time and the present time. I will try checking it next week.

Have you tested HDMI with all the supported modes given from the EDID using modetest? Or tested just 1 native resolution?

Cheers,
Biju