drm/msm/dp: reuse generic HDMI codec implementation
PATCH v7 1/1 drm/msm/dp: reuse generic HDMI codec implementation
From: Dmitry Baryshkov <[email protected]>
The MSM DisplayPort driver implements several HDMI codec functions in the driver, e.g. it manually manages HDMI codec device registration, returning ELD and plugged_cb support. In order to reduce code duplication reuse drm_hdmi_audio_* helpers and drm_bridge_connector integration.
---
A lot of DisplayPort bridges use HDMI Codec in order to provide audio support. Present DRM HDMI Audio support has been written with the HDMI and in particular DRM HDMI Connector framework support, however those audio helpers can be easily reused for DisplayPort drivers too.
Patches by Hermes Wu that targeted implementing HDMI Audio support in the iTE IT6506 driver pointed out the necessity of allowing one to use generic audio helpers for DisplayPort drivers, as otherwise each driver has to manually (and correctly) implement the get_eld() and plugged_cb support.
Implement necessary integration in drm_bridge_connector and provide an
example implementation in the msm/dp driver.
---
Changes in v7:
- Dropped applied patches
- Link to v6: https://lore.kernel.org/r/[email protected]
Changes in v6:
- Added DRM_BRIDGE_OP_DP_AUDIO and separate set of DisplayPort audio callbacks to the drm_bridge interface (Maxime)
- Link to v5: https://lore.kernel.org/r/[email protected]
Changes in v5:
- Rebased on top of linux-next, also handling HDMI audio piece of the
MSM HDMI driver.
- Link to v4: https://lore.kernel.org/r/[email protected]
Changes in v4:
- Rebased on linux-next, adding DRM_BRIDGE_OP_HDMI_AUDIO to Synopsys QP
HDMI driver.
- Drop outdated comment regarding subconnector from the commit message.
- Link to v3: https://lore.kernel.org/r/[email protected]
Changes in v3:
- Dropped DRM_BRIDGE_OP_DisplayPort, added DRM_BRIDGE_OP_HDMI_AUDIO (Laurent, Maxime)
- Dropped the subconnector patch (again)
- Link to v2: https://lore.kernel.org/r/[email protected]
Changes in v2:
- Added drm_connector_attach_dp_subconnector_property() patches
- Link to v1: https://lore.kernel.org/r/[email protected]
--- drivers/gpu/drm/msm/Kconfig | 1 + drivers/gpu/drm/msm/dp/dp_audio.c | 131 ++++-------------------------------- drivers/gpu/drm/msm/dp/dp_audio.h | 27 ++------ drivers/gpu/drm/msm/dp/dp_display.c | 28 ++------ drivers/gpu/drm/msm/dp/dp_display.h | 6 -- drivers/gpu/drm/msm/dp/dp_drm.c | 8 +++ 6 files changed, 31 insertions(+), 170 deletions(-)
drivers/gpu/drm/msm/Kconfig +1 -0
@@ -104,6 +104,7 @@ config DRM_MSM_DPU config DRM_MSM_DP bool "Enable DisplayPort support in MSM DRM driver" depends on DRM_MSM + select DRM_DISPLAY_HDMI_AUDIO_HELPER select RATIONAL default y help
drivers/gpu/drm/msm/dp/dp_audio.c +12 -119
186 lines not on this page · raw message
drivers/gpu/drm/msm/dp/dp_audio.h +6 -21
@@ -35,23 +35,6 @@ struct msm_dp_audio {struct msm_dp_audio *msm_dp_audio_get (struct platform_device *pdev,struct msm_dp_catalog *catalog); -/** -* msm_dp_register_audio_driver() -* -* Registers DP device with hdmi_codec interface. -* -* @dev: DP device instance. -* @msm_dp_audio: an instance of msm_dp_audio module. -* -* -* Returns the error code in case of failure, otherwise -* zero on success. -*/ -int msm_dp_register_audio_driver (struct device *dev, -struct msm_dp_audio *msm_dp_audio); - -void msm_dp_unregister_audio_driver (struct device *dev,struct msm_dp_audio *msm_dp_audio); -/** * msm_dp_audio_put() *
@@ -61,10 +44,12 @@ void msm_dp_unregister_audio_driver(struct device *dev, struct msm_dp_audio *msm*/ void msm_dp_audio_put (struct msm_dp_audio *msm_dp_audio); -int msm_dp_audio_hw_params (struct device *dev, -void *data, -struct hdmi_codec_daifmt *daifmt, -struct hdmi_codec_params *params); +int msm_dp_audio_prepare (struct drm_connector *connector, +struct drm_bridge *bridge, +struct hdmi_codec_daifmt *daifmt, +struct hdmi_codec_params *params); +void msm_dp_audio_shutdown (struct drm_connector *connector, +struct drm_bridge *bridge);#endif /* _DP_AUDIO_H_ */
drivers/gpu/drm/msm/dp/dp_display.c +4 -24
@@ -13,6 +13,7 @@#include <linux/delay.h> #include <linux/string_choices.h> #include <drm/display/drm_dp_aux_bus.h> +#include <drm/display/drm_hdmi_audio_helper.h> #include <drm/drm_edid.h> #include "msm_drv.h"
@@ -288,13 +289,6 @@ static int msm_dp_display_bind(struct device *dev, struct device *master, goto end; } - - rc =msm_dp_register_audio_driver (dev, dp->audio); -if (rc) { -DRM_ERROR ("Audio registration Dp failed\n" ); - goto end; - } - rc =msm_dp_hpd_event_thread_start (dp);if (rc) {DRM_ERROR ("Event thread create failed\n" );
@@ -316,7 +310,6 @@ static void msm_dp_display_unbind(struct device *dev, struct device *master,of_dp_aux_depopulate_bus (dp->aux); -msm_dp_unregister_audio_driver (dev, dp->audio);msm_dp_aux_unregister (dp->aux); dp->drm_dev =NULL ; dp->aux->drm_dev =NULL ;
@@ -626,9 +619,9 @@ static void msm_dp_display_handle_plugged_change(struct msm_dp *msm_dp_display, struct msm_dp_display_private, msm_dp_display);/* notify audio subsystem only if sink supports audio */ -if (msm_dp_display->plugged_cb && msm_dp_display->codec_dev && - dp->audio_supported) - msm_dp_display->plugged_cb (msm_dp_display->codec_dev, plugged); +if (dp->audio_supported) +drm_connector_hdmi_audio_plugged_notify (msm_dp_display->connector, + plugged); }static int msm_dp_hpd_unplug_handle (struct msm_dp_display_private *dp,u32 data)
@@ -907,19 +900,6 @@ static int msm_dp_display_disable(struct msm_dp_display_private *dp)return 0 ; } -int msm_dp_display_set_plugged_cb (struct msm_dp *msm_dp_display, -hdmi_codec_plugged_cb fn,struct device *codec_dev) -{ -bool plugged; - - msm_dp_display->plugged_cb = fn; - msm_dp_display->codec_dev = codec_dev; - plugged = msm_dp_display->link_ready; -msm_dp_display_handle_plugged_change (msm_dp_display, plugged); - -return 0 ; -} -/** * msm_dp_bridge_mode_valid - callback to determine if specified mode is valid * @bridge: Pointer to drm bridge structure
drivers/gpu/drm/msm/dp/dp_display.h +0 -6
@@ -7,7 +7,6 @@#define _DP_DISPLAY_H_#include "dp_panel.h" -#include <sound/hdmi-codec.h> #include "disp/msm_disp_snapshot.h" #define DP_MAX_PIXEL_CLK_KHZ 675000
@@ -15,7 +14,6 @@struct msm_dp {struct drm_device *drm_dev;struct platform_device *pdev; -struct device *codec_dev;struct drm_connector *connector;struct drm_bridge *next_bridge;bool link_ready;
@@ -25,14 +23,10 @@ struct msm_dp {bool is_edp;bool internal_hpd; -hdmi_codec_plugged_cb plugged_cb; -struct msm_dp_audio *msm_dp_audio;bool psr_supported; }; -int msm_dp_display_set_plugged_cb (struct msm_dp *msm_dp_display, -hdmi_codec_plugged_cb fn,struct device *codec_dev);int msm_dp_display_get_modes (struct msm_dp *msm_dp_display);bool msm_dp_display_check_video_test (struct msm_dp *msm_dp_display);int msm_dp_display_get_test_bpp (struct msm_dp *msm_dp_display);
drivers/gpu/drm/msm/dp/dp_drm.c +8 -0
@@ -12,6 +12,7 @@#include "msm_drv.h" #include "msm_kms.h" +#include "dp_audio.h" #include "dp_drm.h" /**
@@ -114,6 +115,9 @@ static const struct drm_bridge_funcs msm_dp_bridge_ops = { .hpd_disable = msm_dp_bridge_hpd_disable, .hpd_notify = msm_dp_bridge_hpd_notify, .debugfs_init = msm_dp_bridge_debugfs_init, + + .dp_audio_prepare = msm_dp_audio_prepare, + .dp_audio_shutdown = msm_dp_audio_shutdown, }; static int msm_edp_bridge_atomic_check(struct drm_bridge *drm_bridge,
@@ -320,9 +324,13 @@ int msm_dp_bridge_init(struct msm_dp *msm_dp_display, struct drm_device *dev,*/ if (!msm_dp_display->is_edp) { bridge->ops = +DRM_BRIDGE_OP_DP_AUDIO |DRM_BRIDGE_OP_DETECT |DRM_BRIDGE_OP_HPD |DRM_BRIDGE_OP_MODES ; + bridge->hdmi_audio_dev = &msm_dp_display->pdev->dev; + bridge->hdmi_audio_max_i2s_playback_channels =8 ; + bridge->hdmi_audio_dai_port =-1 ; } rc =devm_drm_bridge_add (dev->dev, bridge);
---
base-commit: 6ac908f24cd7ddae52c496bbc888e97ee7b033ac
change-id: 20250206-dp-hdmi-audio-15d9fdbebb9f
Best regards,
Signature · 1 line
Dmitry Baryshkov <[email protected]>
Quoted 54 lines · Dmitry Baryshkov
From: Dmitry Baryshkov <[email protected]>
The MSM DisplayPort driver implements several HDMI codec functions in the driver, e.g. it manually manages HDMI codec device registration, returning ELD and
plugged_cbsupport. In order to reduce code duplication reuse drm_hdmi_audio_* helpers anddrm_bridge_connectorintegration.Signed-off-by Dmitry Baryshkov <[email protected]>Signed-off-by Dmitry Baryshkov <[email protected]>---
A lot of DisplayPort bridges use HDMI Codec in order to provide audio support. Present DRM HDMI Audio support has been written with the HDMI and in particular DRM HDMI Connector framework support, however those audio helpers can be easily reused for DisplayPort drivers too.Patches by Hermes Wu that targeted implementing HDMI Audio support in the iTE IT6506 driver pointed out the necessity of allowing one to use generic audio helpers for DisplayPort drivers, as otherwise each driver has to manually (and correctly) implement the
get_eld()andplugged_cbsupport.Implement necessary integration in
drm_bridge_connectorand provide an
example implementation in the msm/dp driver.
---
Changes in v7:
- Dropped applied patches
- Link to v6: https://lore.kernel.org/r/[email protected]Changes in v6:
- AddedDRM_BRIDGE_OP_DP_AUDIOand separate set of DisplayPort audio callbacks to thedrm_bridgeinterface (Maxime)
- Link to v5: https://lore.kernel.org/r/[email protected]Changes in v5:
- Rebased on top of linux-next, also handling HDMI audio piece of the
MSM HDMI driver.
- Link to v4: https://lore.kernel.org/r/[email protected]Changes in v4:
- Rebased on linux-next, addingDRM_BRIDGE_OP_HDMI_AUDIOto Synopsys QP
HDMI driver.
- Drop outdated comment regarding subconnector from the commit message.
- Link to v3: https://lore.kernel.org/r/[email protected]Changes in v3:
- DroppedDRM_BRIDGE_OP_DisplayPort, addedDRM_BRIDGE_OP_HDMI_AUDIO(Laurent, Maxime)
- Dropped the subconnector patch (again)
- Link to v2: https://lore.kernel.org/r/[email protected]Changes in v2:
- Addeddrm_connector_attach_dp_subconnector_property()patches
- Link to v1: https://lore.kernel.org/r/[email protected]
Quoted 9 lines
--- drivers/gpu/drm/msm/Kconfig | 1 + drivers/gpu/drm/msm/dp/dp_audio.c | 131 ++++-------------------------------- drivers/gpu/drm/msm/dp/dp_audio.h | 27 ++------ drivers/gpu/drm/msm/dp/dp_display.c | 28 ++------ drivers/gpu/drm/msm/dp/dp_display.h | 6 -- drivers/gpu/drm/msm/dp/dp_drm.c | 8 +++ 6 files changed, 31 insertions(+), 170 deletions(-)
Looks fine to me, just one question, please confirm if DP audio was re-verified after this change.
Thanks
Abhinav
Quoted 67 lines · Abhinav Kumar
Quoted 54 lines · Dmitry Baryshkov
From: Dmitry Baryshkov <[email protected]>
The MSM DisplayPort driver implements several HDMI codec functions in the driver, e.g. it manually manages HDMI codec device registration, returning ELD and
plugged_cbsupport. In order to reduce code duplication reuse drm_hdmi_audio_* helpers anddrm_bridge_connectorintegration.Signed-off-by Dmitry Baryshkov <[email protected]>Signed-off-by Dmitry Baryshkov <[email protected]>---
A lot of DisplayPort bridges use HDMI Codec in order to provide audio support. Present DRM HDMI Audio support has been written with the HDMI and in particular DRM HDMI Connector framework support, however those audio helpers can be easily reused for DisplayPort drivers too.Patches by Hermes Wu that targeted implementing HDMI Audio support in the iTE IT6506 driver pointed out the necessity of allowing one to use generic audio helpers for DisplayPort drivers, as otherwise each driver has to manually (and correctly) implement the
get_eld()andplugged_cbsupport.Implement necessary integration in
drm_bridge_connectorand provide an
example implementation in the msm/dp driver.
---
Changes in v7:
- Dropped applied patches
- Link to v6: https://lore.kernel.org/r/[email protected]Changes in v6:
- AddedDRM_BRIDGE_OP_DP_AUDIOand separate set of DisplayPort audio callbacks to thedrm_bridgeinterface (Maxime)
- Link to v5: https://lore.kernel.org/r/[email protected]Changes in v5:
- Rebased on top of linux-next, also handling HDMI audio piece of the
MSM HDMI driver.
- Link to v4: https://lore.kernel.org/r/[email protected]Changes in v4:
- Rebased on linux-next, addingDRM_BRIDGE_OP_HDMI_AUDIOto Synopsys QP
HDMI driver.
- Drop outdated comment regarding subconnector from the commit message.
- Link to v3: https://lore.kernel.org/r/[email protected]Changes in v3:
- DroppedDRM_BRIDGE_OP_DisplayPort, addedDRM_BRIDGE_OP_HDMI_AUDIO(Laurent, Maxime)
- Dropped the subconnector patch (again)
- Link to v2: https://lore.kernel.org/r/[email protected]Changes in v2:
- Addeddrm_connector_attach_dp_subconnector_property()patches
- Link to v1: https://lore.kernel.org/r/[email protected]Quoted 9 lines
--- drivers/gpu/drm/msm/Kconfig | 1 + drivers/gpu/drm/msm/dp/dp_audio.c | 131 ++++-------------------------------- drivers/gpu/drm/msm/dp/dp_audio.h | 27 ++------ drivers/gpu/drm/msm/dp/dp_display.c | 28 ++------ drivers/gpu/drm/msm/dp/dp_display.h | 6 -- drivers/gpu/drm/msm/dp/dp_drm.c | 8 +++ 6 files changed, 31 insertions(+), 170 deletions(-)
Quoted 2 lines
Looks fine to me, just one question, please confirm if DP audio was re-verified after this change.
Yes
Signature · 2 lines
With best wishes Dmitry
Abhinav Kumar
Reviewed-byQuoted 68 lines · Dmitry Baryshkov
Quoted 67 lines · Abhinav Kumar
Quoted 63 lines · Dmitry Baryshkov
From: Dmitry Baryshkov <[email protected]>
The MSM DisplayPort driver implements several HDMI codec functions in the driver, e.g. it manually manages HDMI codec device registration, returning ELD and
plugged_cbsupport. In order to reduce code duplication reuse drm_hdmi_audio_* helpers anddrm_bridge_connectorintegration.Signed-off-by Dmitry Baryshkov <[email protected]>Signed-off-by Dmitry Baryshkov <[email protected]>---
A lot of DisplayPort bridges use HDMI Codec in order to provide audio support. Present DRM HDMI Audio support has been written with the HDMI and in particular DRM HDMI Connector framework support, however those audio helpers can be easily reused for DisplayPort drivers too.Patches by Hermes Wu that targeted implementing HDMI Audio support in the iTE IT6506 driver pointed out the necessity of allowing one to use generic audio helpers for DisplayPort drivers, as otherwise each driver has to manually (and correctly) implement the
get_eld()andplugged_cbsupport.Implement necessary integration in
drm_bridge_connectorand provide an
example implementation in the msm/dp driver.
---
Changes in v7:
- Dropped applied patches
- Link to v6: https://lore.kernel.org/r/[email protected]Changes in v6:
- AddedDRM_BRIDGE_OP_DP_AUDIOand separate set of DisplayPort audio callbacks to thedrm_bridgeinterface (Maxime)
- Link to v5: https://lore.kernel.org/r/[email protected]Changes in v5:
- Rebased on top of linux-next, also handling HDMI audio piece of the
MSM HDMI driver.
- Link to v4: https://lore.kernel.org/r/[email protected]Changes in v4:
- Rebased on linux-next, addingDRM_BRIDGE_OP_HDMI_AUDIOto Synopsys QP
HDMI driver.
- Drop outdated comment regarding subconnector from the commit message.
- Link to v3: https://lore.kernel.org/r/[email protected]Changes in v3:
- DroppedDRM_BRIDGE_OP_DisplayPort, addedDRM_BRIDGE_OP_HDMI_AUDIO(Laurent, Maxime)
- Dropped the subconnector patch (again)
- Link to v2: https://lore.kernel.org/r/[email protected]Changes in v2:
- Addeddrm_connector_attach_dp_subconnector_property()patches
- Link to v1: https://lore.kernel.org/r/[email protected]--- drivers/gpu/drm/msm/Kconfig | 1 + drivers/gpu/drm/msm/dp/dp_audio.c | 131 ++++-------------------------------- drivers/gpu/drm/msm/dp/dp_audio.h | 27 ++------ drivers/gpu/drm/msm/dp/dp_display.c | 28 ++------ drivers/gpu/drm/msm/dp/dp_display.h | 6 -- drivers/gpu/drm/msm/dp/dp_drm.c | 8 +++ 6 files changed, 31 insertions(+), 170 deletions(-)
Quoted 5 lines
Quoted 2 lines
Looks fine to me, just one question, please confirm if DP audio was re-verified after this change.
Yes
Thanks for confirming,
Dmitry Baryshkov
AppliedQuoted 8 lines · Dmitry Baryshkov
The MSM DisplayPort driver implements several HDMI codec functions in the driver, e.g. it manually manages HDMI codec device registration, returning ELD and
plugged_cbsupport. In order to reduce code duplication reuse drm_hdmi_audio_* helpers anddrm_bridge_connectorintegration.[...]
Applied, thanks!
[1/1] drm/msm/dp: reuse generic HDMI codec implementation
https://gitlab.freedesktop.org/lumag/msm/-/commit/98a8920e7b07
Best regards,
Signature · 1 line
Dmitry Baryshkov <[email protected]>
Quoted 54 lines · Dmitry Baryshkov
From: Dmitry Baryshkov <[email protected]>
The MSM DisplayPort driver implements several HDMI codec functions in the driver, e.g. it manually manages HDMI codec device registration, returning ELD and
plugged_cbsupport. In order to reduce code duplication reuse drm_hdmi_audio_* helpers anddrm_bridge_connectorintegration.Signed-off-by Dmitry Baryshkov <[email protected]>Signed-off-by Dmitry Baryshkov <[email protected]>---
A lot of DisplayPort bridges use HDMI Codec in order to provide audio support. Present DRM HDMI Audio support has been written with the HDMI and in particular DRM HDMI Connector framework support, however those audio helpers can be easily reused for DisplayPort drivers too.Patches by Hermes Wu that targeted implementing HDMI Audio support in the iTE IT6506 driver pointed out the necessity of allowing one to use generic audio helpers for DisplayPort drivers, as otherwise each driver has to manually (and correctly) implement the
get_eld()andplugged_cbsupport.Implement necessary integration in
drm_bridge_connectorand provide an
example implementation in the msm/dp driver.
---
Changes in v7:
- Dropped applied patches
- Link to v6: https://lore.kernel.org/r/[email protected]Changes in v6:
- AddedDRM_BRIDGE_OP_DP_AUDIOand separate set of DisplayPort audio callbacks to thedrm_bridgeinterface (Maxime)
- Link to v5: https://lore.kernel.org/r/[email protected]Changes in v5:
- Rebased on top of linux-next, also handling HDMI audio piece of the
MSM HDMI driver.
- Link to v4: https://lore.kernel.org/r/[email protected]Changes in v4:
- Rebased on linux-next, addingDRM_BRIDGE_OP_HDMI_AUDIOto Synopsys QP
HDMI driver.
- Drop outdated comment regarding subconnector from the commit message.
- Link to v3: https://lore.kernel.org/r/[email protected]Changes in v3:
- DroppedDRM_BRIDGE_OP_DisplayPort, addedDRM_BRIDGE_OP_HDMI_AUDIO(Laurent, Maxime)
- Dropped the subconnector patch (again)
- Link to v2: https://lore.kernel.org/r/[email protected]Changes in v2:
- Addeddrm_connector_attach_dp_subconnector_property()patches
- Link to v1: https://lore.kernel.org/r/[email protected]
Quoted 9 lines
--- drivers/gpu/drm/msm/Kconfig | 1 + drivers/gpu/drm/msm/dp/dp_audio.c | 131 ++++-------------------------------- drivers/gpu/drm/msm/dp/dp_audio.h | 27 ++------ drivers/gpu/drm/msm/dp/dp_display.c | 28 ++------ drivers/gpu/drm/msm/dp/dp_display.h | 6 -- drivers/gpu/drm/msm/dp/dp_drm.c | 8 +++ 6 files changed, 31 insertions(+), 170 deletions(-)
This change breaks DP audio on the qcs6490 platform, tested on kernel next-20250528.
[ 0.368035] [drm:dpu_kms_hw_init:1173] dpu hardware revision:0x70020000 [ 0.369359] hdmi-audio-codec hdmi-audio-codec.0.auto: hdmi_codec_probe: dai_count 0 [ 0.369362] hdmi-audio-codec hdmi-audio-codec.0.auto: hdmi_codec_probe: Missing hw_params [ 0.369364] hdmi-audio-codec hdmi-audio-codec.0.auto: hdmi_codec_probe: Invalid parameters [ 0.369366] hdmi-audio-codec hdmi-audio-codec.0.auto: probe with driver hdmi-audio-codec failed with error -22 [ 0.370536] [drm] Initialized msm 1.12.0 for ae01000.display-controller on minor 0
Manually reverting this change solves the problem.
Signature · 2 lines
Best regards, Xilin Wu <[email protected]>
Quoted 65 lines · Xilin Wu
Quoted 54 lines · Dmitry Baryshkov
From: Dmitry Baryshkov <[email protected]>
The MSM DisplayPort driver implements several HDMI codec functions in the driver, e.g. it manually manages HDMI codec device registration, returning ELD and
plugged_cbsupport. In order to reduce code duplication reuse drm_hdmi_audio_* helpers anddrm_bridge_connectorintegration.Signed-off-by Dmitry Baryshkov <[email protected]>Signed-off-by Dmitry Baryshkov <[email protected]>---
A lot of DisplayPort bridges use HDMI Codec in order to provide audio support. Present DRM HDMI Audio support has been written with the HDMI and in particular DRM HDMI Connector framework support, however those audio helpers can be easily reused for DisplayPort drivers too.Patches by Hermes Wu that targeted implementing HDMI Audio support in the iTE IT6506 driver pointed out the necessity of allowing one to use generic audio helpers for DisplayPort drivers, as otherwise each driver has to manually (and correctly) implement the
get_eld()andplugged_cbsupport.Implement necessary integration in
drm_bridge_connectorand provide an
example implementation in the msm/dp driver.
---
Changes in v7:
- Dropped applied patches
- Link to v6: https://lore.kernel.org/r/[email protected]Changes in v6:
- AddedDRM_BRIDGE_OP_DP_AUDIOand separate set of DisplayPort audio callbacks to thedrm_bridgeinterface (Maxime)
- Link to v5: https://lore.kernel.org/r/[email protected]Changes in v5:
- Rebased on top of linux-next, also handling HDMI audio piece of the
MSM HDMI driver.
- Link to v4: https://lore.kernel.org/r/[email protected]Changes in v4:
- Rebased on linux-next, addingDRM_BRIDGE_OP_HDMI_AUDIOto Synopsys QP
HDMI driver.
- Drop outdated comment regarding subconnector from the commit message.
- Link to v3: https://lore.kernel.org/r/[email protected]Changes in v3:
- DroppedDRM_BRIDGE_OP_DisplayPort, addedDRM_BRIDGE_OP_HDMI_AUDIO(Laurent, Maxime)
- Dropped the subconnector patch (again)
- Link to v2: https://lore.kernel.org/r/[email protected]Changes in v2:
- Addeddrm_connector_attach_dp_subconnector_property()patches
- Link to v1: https://lore.kernel.org/r/[email protected]Quoted 9 lines
--- drivers/gpu/drm/msm/Kconfig | 1 + drivers/gpu/drm/msm/dp/dp_audio.c | 131 ++++-------------------------------- drivers/gpu/drm/msm/dp/dp_audio.h | 27 ++------ drivers/gpu/drm/msm/dp/dp_display.c | 28 ++------ drivers/gpu/drm/msm/dp/dp_display.h | 6 -- drivers/gpu/drm/msm/dp/dp_drm.c | 8 +++ 6 files changed, 31 insertions(+), 170 deletions(-)
Quoted 2 lines
This change breaks DP audio on the qcs6490 platform, tested on kernel next-20250528.
I can not confirm this issue here (though I tested it on a different hardware). Do you have any patches on top of linux-next?
Quoted 11 lines
[ 0.368035] [drm:dpu_kms_hw_init:1173] dpu hardware revision:0x70020000 [ 0.369359] hdmi-audio-codec hdmi-audio-codec.0.auto: hdmi_codec_probe: dai_count 0 [ 0.369362] hdmi-audio-codec hdmi-audio-codec.0.auto: hdmi_codec_probe: Missing hw_params [ 0.369364] hdmi-audio-codec hdmi-audio-codec.0.auto: hdmi_codec_probe: Invalid parameters [ 0.369366] hdmi-audio-codec hdmi-audio-codec.0.auto: probe with driver hdmi-audio-codec failed with error -22 [ 0.370536] [drm] Initialized msm 1.12.0 for ae01000.display-controller
Quoted 3 lines
on minor 0
Manually reverting this change solves the problem.
It is suspicious, since dai_count can not be 0. We set hdmi_audio_max_i2s_playback_channels to 8, which in turn should set the hdmi_codec_pdata.i2s to 1.
Quoted 4 lines
Signature · 3 lines
-- Best regards, Xilin Wu <[email protected]>
Signature · 2 lines
With best wishes Dmitry
Quoted 66 lines · Dmitry Baryshkov
Quoted 65 lines · Xilin Wu
Quoted 63 lines · Dmitry Baryshkov
From: Dmitry Baryshkov <[email protected]>
The MSM DisplayPort driver implements several HDMI codec functions in the driver, e.g. it manually manages HDMI codec device registration, returning ELD and
plugged_cbsupport. In order to reduce code duplication reuse drm_hdmi_audio_* helpers anddrm_bridge_connectorintegration.Signed-off-by Dmitry Baryshkov <[email protected]>Signed-off-by Dmitry Baryshkov <[email protected]>---
A lot of DisplayPort bridges use HDMI Codec in order to provide audio support. Present DRM HDMI Audio support has been written with the HDMI and in particular DRM HDMI Connector framework support, however those audio helpers can be easily reused for DisplayPort drivers too.Patches by Hermes Wu that targeted implementing HDMI Audio support in the iTE IT6506 driver pointed out the necessity of allowing one to use generic audio helpers for DisplayPort drivers, as otherwise each driver has to manually (and correctly) implement the
get_eld()andplugged_cbsupport.Implement necessary integration in
drm_bridge_connectorand provide an
example implementation in the msm/dp driver.
---
Changes in v7:
- Dropped applied patches
- Link to v6: https://lore.kernel.org/r/[email protected]Changes in v6:
- AddedDRM_BRIDGE_OP_DP_AUDIOand separate set of DisplayPort audio callbacks to thedrm_bridgeinterface (Maxime)
- Link to v5: https://lore.kernel.org/r/[email protected]Changes in v5:
- Rebased on top of linux-next, also handling HDMI audio piece of the
MSM HDMI driver.
- Link to v4: https://lore.kernel.org/r/[email protected]Changes in v4:
- Rebased on linux-next, addingDRM_BRIDGE_OP_HDMI_AUDIOto Synopsys QP
HDMI driver.
- Drop outdated comment regarding subconnector from the commit message.
- Link to v3: https://lore.kernel.org/r/[email protected]Changes in v3:
- DroppedDRM_BRIDGE_OP_DisplayPort, addedDRM_BRIDGE_OP_HDMI_AUDIO(Laurent, Maxime)
- Dropped the subconnector patch (again)
- Link to v2: https://lore.kernel.org/r/[email protected]Changes in v2:
- Addeddrm_connector_attach_dp_subconnector_property()patches
- Link to v1: https://lore.kernel.org/r/[email protected]--- drivers/gpu/drm/msm/Kconfig | 1 + drivers/gpu/drm/msm/dp/dp_audio.c | 131 ++++-------------------------------- drivers/gpu/drm/msm/dp/dp_audio.h | 27 ++------ drivers/gpu/drm/msm/dp/dp_display.c | 28 ++------ drivers/gpu/drm/msm/dp/dp_display.h | 6 -- drivers/gpu/drm/msm/dp/dp_drm.c | 8 +++ 6 files changed, 31 insertions(+), 170 deletions(-)
Quoted 6 lines
Quoted 2 lines
This change breaks DP audio on the qcs6490 platform, tested on kernel next-20250528.
I can not confirm this issue here (though I tested it on a different hardware). Do you have any patches on top of linux-next?
I have this patch series applied, but I don't think it could be relevant:
[PATCH v4 0/8] Enable audio on qcs6490-RB3Gen2 and qcm6490-idp boards
https://lore.kernel.org/all/[email protected]/
Quoted 13 lines
Quoted 13 lines
[ 0.368035] [drm:dpu_kms_hw_init:1173] dpu hardware revision:0x70020000 [ 0.369359] hdmi-audio-codec hdmi-audio-codec.0.auto: hdmi_codec_probe: dai_count 0 [ 0.369362] hdmi-audio-codec hdmi-audio-codec.0.auto: hdmi_codec_probe: Missing hw_params [ 0.369364] hdmi-audio-codec hdmi-audio-codec.0.auto: hdmi_codec_probe: Invalid parameters [ 0.369366] hdmi-audio-codec hdmi-audio-codec.0.auto: probe with driver hdmi-audio-codec failed with error -22 [ 0.370536] [drm] Initialized msm 1.12.0 for ae01000.display-controlleron minor 0
Quoted 6 lines
Quoted 1 line
Manually reverting this change solves the problem.
It is suspicious, since
dai_countcan not be 0. We sethdmi_audio_max_i2s_playback_channelsto 8, which in turn should set the hdmi_codec_pdata.i2s to 1.
It suddenly comes to my mind that I'm using a kernel with everything compiled as builtin. Could that be a possible issue?
Signature · 2 lines
Best regards, Xilin Wu <[email protected]>
Quoted 94 lines · Xilin Wu
Quoted 66 lines · Dmitry Baryshkov
Quoted 65 lines · Xilin Wu
Quoted 63 lines · Dmitry Baryshkov
From: Dmitry Baryshkov <[email protected]>
The MSM DisplayPort driver implements several HDMI codec functions in the driver, e.g. it manually manages HDMI codec device registration, returning ELD and
plugged_cbsupport. In order to reduce code duplication reuse drm_hdmi_audio_* helpers anddrm_bridge_connectorintegration.Signed-off-by Dmitry Baryshkov <[email protected]>Signed-off-by Dmitry Baryshkov <[email protected]>---
A lot of DisplayPort bridges use HDMI Codec in order to provide audio support. Present DRM HDMI Audio support has been written with the HDMI and in particular DRM HDMI Connector framework support, however those audio helpers can be easily reused for DisplayPort drivers too.Patches by Hermes Wu that targeted implementing HDMI Audio support in the iTE IT6506 driver pointed out the necessity of allowing one to use generic audio helpers for DisplayPort drivers, as otherwise each driver has to manually (and correctly) implement the
get_eld()andplugged_cbsupport.Implement necessary integration in
drm_bridge_connectorand provide an
example implementation in the msm/dp driver.
---
Changes in v7:
- Dropped applied patches
- Link to v6: https://lore.kernel.org/r/[email protected]Changes in v6:
- AddedDRM_BRIDGE_OP_DP_AUDIOand separate set of DisplayPort audio callbacks to thedrm_bridgeinterface (Maxime)
- Link to v5: https://lore.kernel.org/r/[email protected]Changes in v5:
- Rebased on top of linux-next, also handling HDMI audio piece of the
MSM HDMI driver.
- Link to v4: https://lore.kernel.org/r/[email protected]Changes in v4:
- Rebased on linux-next, addingDRM_BRIDGE_OP_HDMI_AUDIOto Synopsys QP
HDMI driver.
- Drop outdated comment regarding subconnector from the commit message.
- Link to v3: https://lore.kernel.org/r/[email protected]Changes in v3:
- DroppedDRM_BRIDGE_OP_DisplayPort, addedDRM_BRIDGE_OP_HDMI_AUDIO(Laurent, Maxime)
- Dropped the subconnector patch (again)
- Link to v2: https://lore.kernel.org/r/[email protected]Changes in v2:
- Addeddrm_connector_attach_dp_subconnector_property()patches
- Link to v1: https://lore.kernel.org/r/[email protected]--- drivers/gpu/drm/msm/Kconfig | 1 + drivers/gpu/drm/msm/dp/dp_audio.c | 131 ++++-------------------------------- drivers/gpu/drm/msm/dp/dp_audio.h | 27 ++------ drivers/gpu/drm/msm/dp/dp_display.c | 28 ++------ drivers/gpu/drm/msm/dp/dp_display.h | 6 -- drivers/gpu/drm/msm/dp/dp_drm.c | 8 +++ 6 files changed, 31 insertions(+), 170 deletions(-)Quoted 6 lines
Quoted 2 lines
This change breaks DP audio on the qcs6490 platform, tested on kernel next-20250528.
I can not confirm this issue here (though I tested it on a different hardware). Do you have any patches on top of linux-next?
I have this patch series applied, but I don't think it could be relevant:
[PATCH v4 0/8] Enable audio on qcs6490-RB3Gen2 and qcm6490-idp boards
https://lore.kernel.org/all/[email protected]/Quoted 15 lines
Quoted 14 lines
[ 0.368035] [drm:dpu_kms_hw_init:1173] dpu hardware revision:0x70020000 [ 0.369359] hdmi-audio-codec hdmi-audio-codec.0.auto: hdmi_codec_probe: dai_count 0 [ 0.369362] hdmi-audio-codec hdmi-audio-codec.0.auto: hdmi_codec_probe: Missing hw_params [ 0.369364] hdmi-audio-codec hdmi-audio-codec.0.auto: hdmi_codec_probe: Invalid parameters [ 0.369366] hdmi-audio-codec hdmi-audio-codec.0.auto: probe with driver hdmi-audio-codec failed with error -22 [ 0.370536] [drm] Initialized msm 1.12.0 for ae01000.display-controlleron minor 0
Manually reverting this change solves the problem.
Quoted 7 lines
Quoted 4 lines
It is suspicious, since
dai_countcan not be 0. We sethdmi_audio_max_i2s_playback_channelsto 8, which in turn should set the hdmi_codec_pdata.i2s to 1.It suddenly comes to my mind that I'm using a kernel with everything compiled as builtin. Could that be a possible issue?
What kernel args are you using? Do you have any kernel debug options enabled in the .config? I've tested the kernel on RB3 Gen2 and I still can not confirm the issue (I'm also using an all-in kernel)
I've verified that on a running system I'm getting three HDMI audio codecs (one from LT9611UXC and two from DP controllers). Each of them binds immediately to the driver with no issues observed.
Signature · 2 lines
With best wishes Dmitry
Quoted 78 lines · Xilin Wu
Quoted 54 lines · Dmitry Baryshkov
From: Dmitry Baryshkov <[email protected]>
The MSM DisplayPort driver implements several HDMI codec functions in the driver, e.g. it manually manages HDMI codec device registration, returning ELD and
plugged_cbsupport. In order to reduce code duplication reuse drm_hdmi_audio_* helpers anddrm_bridge_connectorintegration.Signed-off-by Dmitry Baryshkov <[email protected]>Signed-off-by Dmitry Baryshkov <[email protected]>---
A lot of DisplayPort bridges use HDMI Codec in order to provide audio support. Present DRM HDMI Audio support has been written with the HDMI and in particular DRM HDMI Connector framework support, however those audio helpers can be easily reused for DisplayPort drivers too.Patches by Hermes Wu that targeted implementing HDMI Audio support in the iTE IT6506 driver pointed out the necessity of allowing one to use generic audio helpers for DisplayPort drivers, as otherwise each driver has to manually (and correctly) implement the
get_eld()andplugged_cbsupport.Implement necessary integration in
drm_bridge_connectorand provide an
example implementation in the msm/dp driver.
---
Changes in v7:
- Dropped applied patches
- Link to v6: https://lore.kernel.org/r/[email protected]Changes in v6:
- AddedDRM_BRIDGE_OP_DP_AUDIOand separate set of DisplayPort audio callbacks to thedrm_bridgeinterface (Maxime)
- Link to v5: https://lore.kernel.org/r/[email protected]Changes in v5:
- Rebased on top of linux-next, also handling HDMI audio piece of the
MSM HDMI driver.
- Link to v4: https://lore.kernel.org/r/[email protected]Changes in v4:
- Rebased on linux-next, addingDRM_BRIDGE_OP_HDMI_AUDIOto Synopsys QP
HDMI driver.
- Drop outdated comment regarding subconnector from the commit message.
- Link to v3: https://lore.kernel.org/r/[email protected]Changes in v3:
- DroppedDRM_BRIDGE_OP_DisplayPort, addedDRM_BRIDGE_OP_HDMI_AUDIO(Laurent, Maxime)
- Dropped the subconnector patch (again)
- Link to v2: https://lore.kernel.org/r/[email protected]Changes in v2:
- Addeddrm_connector_attach_dp_subconnector_property()patches
- Link to v1: https://lore.kernel.org/r/[email protected]Quoted 9 lines
--- drivers/gpu/drm/msm/Kconfig | 1 + drivers/gpu/drm/msm/dp/dp_audio.c | 131 ++++-------------------------------- drivers/gpu/drm/msm/dp/dp_audio.h | 27 ++------ drivers/gpu/drm/msm/dp/dp_display.c | 28 ++------ drivers/gpu/drm/msm/dp/dp_display.h | 6 -- drivers/gpu/drm/msm/dp/dp_drm.c | 8 +++ 6 files changed, 31 insertions(+), 170 deletions(-)This change breaks DP audio on the qcs6490 platform, tested on kernel next-20250528.
[ 0.368035] [drm:dpu_kms_hw_init:1173] dpu hardware revision:0x70020000 [ 0.369359] hdmi-audio-codec hdmi-audio-codec.0.auto: hdmi_codec_probe: dai_count 0 [ 0.369362] hdmi-audio-codec hdmi-audio-codec.0.auto: hdmi_codec_probe: Missing hw_params [ 0.369364] hdmi-audio-codec hdmi-audio-codec.0.auto: hdmi_codec_probe: Invalid parameters [ 0.369366] hdmi-audio-codec hdmi-audio-codec.0.auto: probe with driver hdmi-audio-codec failed with error -22 [ 0.370536] [drm] Initialized msm 1.12.0 for ae01000.display-controller
Quoted 4 lines
on minor 0
Manually reverting this change solves the problem.
Try applying the following patch, the current code in next/mainline is broken and de-references some wrong memory. Probably pure luck that it ever worked during testing. :/
https://lore.kernel.org/dri-devel/[email protected]/
Thanks,
Stephan
Hi Dmitry,
Quoted 7 lines · Dmitry Baryshkov
From: Dmitry Baryshkov <[email protected]>
The MSM DisplayPort driver implements several HDMI codec functions in the driver, e.g. it manually manages HDMI codec device registration, returning ELD and
plugged_cbsupport. In order to reduce code duplication reuse drm_hdmi_audio_* helpers anddrm_bridge_connectorintegration.
A bit late, but it appears that since 6.16 kernel (incl. 6.17) DP audio is broken on qcm6490-fairphone-fp5 (which is using the Elite audio architecture, not Audioreach).
Git bisect is pointing to this patch:
98a8920e7b07641eb1996b3c39b9ce27fc05dbb9 is the first bad commit commit 98a8920e7b07641eb1996b3c39b9ce27fc05dbb9
Author: Dmitry Baryshkov <[email protected]>
Date: Fri May 2 01:41:42 2025 +0300
drm/msm/dp: reuse generic HDMI codec implementation
It's specifically failing with these errors:
[ 177.380809] qcom-q6afe aprsvc:service:4:4: AFE enable for port 0x6020 failed -110 [ 177.380851] q6afe-dai 3700000.remoteproc:glink-edge:apr:service@4:dais: fail to start AFE port 68 [ 177.380865] q6afe-dai 3700000.remoteproc:glink-edge:apr:service@4:dais: ASoC error (-110): at snd_soc_dai_prepare() on DISPLAY_PORT_RX_0 [ 177.437004] qcom-q6afe aprsvc:service:4:4: cmd = 0x100e5 returned error = 0x9 [ 177.437294] qcom-q6afe aprsvc:service:4:4: DSP returned error[9] [ 177.437312] qcom-q6afe aprsvc:service:4:4: AFE enable for port 0x6020 failed -22 [ 177.437332] q6afe-dai 3700000.remoteproc:glink-edge:apr:service@4:dais: fail to start AFE port 68 [ 177.437343] q6afe-dai 3700000.remoteproc:glink-edge:apr:service@4:dais: ASoC error (-22): at snd_soc_dai_prepare() on DISPLAY_PORT_RX_0
Do you have an idea?
Regards
Luca
Quoted 453 lines
Signed-off-by Dmitry Baryshkov <[email protected]>Signed-off-by Dmitry Baryshkov <[email protected]>---
A lot of DisplayPort bridges use HDMI Codec in order to provide audio support. Present DRM HDMI Audio support has been written with the HDMI and in particular DRM HDMI Connector framework support, however those audio helpers can be easily reused for DisplayPort drivers too.Patches by Hermes Wu that targeted implementing HDMI Audio support in the iTE IT6506 driver pointed out the necessity of allowing one to use generic audio helpers for DisplayPort drivers, as otherwise each driver has to manually (and correctly) implement the
get_eld()andplugged_cbsupport.Implement necessary integration in
drm_bridge_connectorand provide an
example implementation in the msm/dp driver.
---
Changes in v7:
- Dropped applied patches
- Link to v6: https://lore.kernel.org/r/[email protected]Changes in v6:
- AddedDRM_BRIDGE_OP_DP_AUDIOand separate set of DisplayPort audio callbacks to thedrm_bridgeinterface (Maxime)
- Link to v5: https://lore.kernel.org/r/[email protected]Changes in v5:
- Rebased on top of linux-next, also handling HDMI audio piece of the
MSM HDMI driver.
- Link to v4: https://lore.kernel.org/r/[email protected]Changes in v4:
- Rebased on linux-next, addingDRM_BRIDGE_OP_HDMI_AUDIOto Synopsys QP
HDMI driver.
- Drop outdated comment regarding subconnector from the commit message.
- Link to v3: https://lore.kernel.org/r/[email protected]Changes in v3:
- DroppedDRM_BRIDGE_OP_DisplayPort, addedDRM_BRIDGE_OP_HDMI_AUDIO(Laurent, Maxime)
- Dropped the subconnector patch (again)
- Link to v2: https://lore.kernel.org/r/[email protected]Changes in v2:
- Addeddrm_connector_attach_dp_subconnector_property()patches
- Link to v1: https://lore.kernel.org/r/[email protected]--- drivers/gpu/drm/msm/Kconfig | 1 + drivers/gpu/drm/msm/dp/dp_audio.c | 131 ++++-------------------------------- drivers/gpu/drm/msm/dp/dp_audio.h | 27 ++------ drivers/gpu/drm/msm/dp/dp_display.c | 28 ++------ drivers/gpu/drm/msm/dp/dp_display.h | 6 -- drivers/gpu/drm/msm/dp/dp_drm.c | 8 +++ 6 files changed, 31 insertions(+), 170 deletions(-)drivers/gpu/drm/msm/Kconfig +1
-0@@ -104,6 +104,7 @@ config DRM_MSM_DPU config DRM_MSM_DP bool "Enable DisplayPort support in MSM DRM driver" depends on DRM_MSM + select DRM_DISPLAY_HDMI_AUDIO_HELPER select RATIONAL default y helpdrivers/gpu/drm/msm/dp/dp_audio.c +12
-119@@ -13,13 +13,13 @@#include "dp_catalog.h" #include "dp_audio.h" +#include "dp_drm.h" #include "dp_panel.h" #include "dp_reg.h" #include "dp_display.h" #include "dp_utils.h" struct msm_dp_audio_private { -struct platform_device *audio_pdev;struct platform_device *pdev;struct drm_device *drm_dev;struct msm_dp_catalog *catalog;@@ -160,24 +160,11 @@ static void msm_dp_audio_enable(struct msm_dp_audio_private *audio, bool enable)msm_dp_catalog_audio_enable (catalog, enable); } -static struct msm_dp_audio_private *msm_dp_audio_get_data (struct platform_device *pdev) +static struct msm_dp_audio_private *msm_dp_audio_get_data (struct msm_dp *msm_dp_display) {struct msm_dp_audio *msm_dp_audio; -struct msm_dp *msm_dp_display; - -if (!pdev) { -DRM_ERROR ("invalid input\n" ); -return ERR_PTR (-ENODEV ); - } - - msm_dp_display =platform_get_drvdata (pdev); -if (!msm_dp_display) { -DRM_ERROR ("invalid input\n" ); -return ERR_PTR (-ENODEV ); - } msm_dp_audio = msm_dp_display->msm_dp_audio; -if (!msm_dp_audio) {DRM_ERROR ("invalid msm_dp_audio data\n" );return ERR_PTR (-EINVAL );@@ -186,68 +173,16 @@ static struct msm_dp_audio_private *msm_dp_audio_get_data(struct platform_device return container_of(msm_dp_audio, struct msm_dp_audio_private, msm_dp_audio); } -static int msm_dp_audio_hook_plugged_cb (struct device *dev,void *data, -hdmi_codec_plugged_cb fn, -struct device *codec_dev) -{ - -struct platform_device *pdev; -struct msm_dp *msm_dp_display; - - pdev =to_platform_device (dev); -if (!pdev) { -pr_err ("invalid input\n" ); -return -ENODEV ; - } - - msm_dp_display =platform_get_drvdata (pdev); -if (!msm_dp_display) { -pr_err ("invalid input\n" ); -return -ENODEV ; - } - -return msm_dp_display_set_plugged_cb (msm_dp_display, fn, codec_dev); -} - -static int msm_dp_audio_get_eld (struct device *dev, -void *data,uint8_t *buf,size_t len) -{ -struct platform_device *pdev; -struct msm_dp *msm_dp_display; - - pdev =to_platform_device (dev); - -if (!pdev) { -DRM_ERROR ("invalid input\n" ); -return -ENODEV ; - } - - msm_dp_display =platform_get_drvdata (pdev); -if (!msm_dp_display) { -DRM_ERROR ("invalid input\n" ); -return -ENODEV ; - } - -mutex_lock (&msm_dp_display->connector->eld_mutex); -memcpy (buf, msm_dp_display->connector->eld, -min (sizeof (msm_dp_display->connector->eld), len)); -mutex_unlock (&msm_dp_display->connector->eld_mutex); - -return 0 ; -} - -int msm_dp_audio_hw_params (struct device *dev, -void *data, -struct hdmi_codec_daifmt *daifmt, -struct hdmi_codec_params *params) +int msm_dp_audio_prepare (struct drm_connector *connector, +struct drm_bridge *bridge, +struct hdmi_codec_daifmt *daifmt, +struct hdmi_codec_params *params) {int rc =0 ;struct msm_dp_audio_private *audio; -struct platform_device *pdev;struct msm_dp *msm_dp_display; - pdev =to_platform_device (dev); - msm_dp_display =platform_get_drvdata (pdev); + msm_dp_display =to_dp_bridge (bridge)->msm_dp_display;/* * there could be cases where sound card can be opened even @@ -262,7 +197,7 @@ int msm_dp_audio_hw_params(struct device *dev, goto end; } - audio =msm_dp_audio_get_data (pdev); + audio =msm_dp_audio_get_data (msm_dp_display);if (IS_ERR (audio)) { rc =PTR_ERR (audio); goto end;@@ -281,15 +216,14 @@ int msm_dp_audio_hw_params(struct device *dev,return rc; } -static void msm_dp_audio_shutdown (struct device *dev,void *data) +void msm_dp_audio_shutdown (struct drm_connector *connector, +struct drm_bridge *bridge) {struct msm_dp_audio_private *audio; -struct platform_device *pdev;struct msm_dp *msm_dp_display; - pdev =to_platform_device (dev); - msm_dp_display =platform_get_drvdata (pdev); - audio =msm_dp_audio_get_data (pdev); + msm_dp_display =to_dp_bridge (bridge)->msm_dp_display; + audio =msm_dp_audio_get_data (msm_dp_display);if (IS_ERR (audio)) {DRM_ERROR ("failed to get audio data\n" );return ;@@ -311,47 +245,6 @@ static void msm_dp_audio_shutdown(struct device *dev, void *data)msm_dp_display_signal_audio_complete (msm_dp_display); } -static const struct hdmi_codec_ops msm_dp_audio_codec_ops = { - .hw_params = msm_dp_audio_hw_params, - .audio_shutdown = msm_dp_audio_shutdown, - .get_eld = msm_dp_audio_get_eld, - .hook_plugged_cb = msm_dp_audio_hook_plugged_cb, -}; - -static struct hdmi_codec_pdata codec_data = { - .ops = &msm_dp_audio_codec_ops, - .max_i2s_channels =8 , - .i2s =1 , -}; - -void msm_dp_unregister_audio_driver (struct device *dev,struct msm_dp_audio *msm_dp_audio) -{ -struct msm_dp_audio_private *audio_priv; - - audio_priv = container_of(msm_dp_audio, struct msm_dp_audio_private, msm_dp_audio); - -if (audio_priv->audio_pdev) { -platform_device_unregister (audio_priv->audio_pdev); - audio_priv->audio_pdev =NULL ; - } -} - -int msm_dp_register_audio_driver (struct device *dev, -struct msm_dp_audio *msm_dp_audio) -{ -struct msm_dp_audio_private *audio_priv; - - audio_priv =container_of (msm_dp_audio, - struct msm_dp_audio_private, msm_dp_audio); - - audio_priv->audio_pdev =platform_device_register_data (dev, -HDMI_CODEC_DRV_NAME , -PLATFORM_DEVID_AUTO , - &codec_data, -sizeof (codec_data)); -return PTR_ERR_OR_ZERO (audio_priv->audio_pdev); -} -struct msm_dp_audio *msm_dp_audio_get (struct platform_device *pdev,struct msm_dp_catalog *catalog) {drivers/gpu/drm/msm/dp/dp_audio.h +6
-21@@ -35,23 +35,6 @@ struct msm_dp_audio {struct msm_dp_audio *msm_dp_audio_get (struct platform_device *pdev,struct msm_dp_catalog *catalog); -/** -* msm_dp_register_audio_driver() -* -* Registers DP device with hdmi_codec interface. -* -* @dev: DP device instance. -* @msm_dp_audio: an instance of msm_dp_audio module. -* -* -* Returns the error code in case of failure, otherwise -* zero on success. -*/ -int msm_dp_register_audio_driver (struct device *dev, -struct msm_dp_audio *msm_dp_audio); - -void msm_dp_unregister_audio_driver (struct device *dev,struct msm_dp_audio *msm_dp_audio); -/** * msm_dp_audio_put() * @@ -61,10 +44,12 @@ void msm_dp_unregister_audio_driver(struct device *dev, struct msm_dp_audio *msm*/ void msm_dp_audio_put (struct msm_dp_audio *msm_dp_audio); -int msm_dp_audio_hw_params (struct device *dev, -void *data, -struct hdmi_codec_daifmt *daifmt, -struct hdmi_codec_params *params); +int msm_dp_audio_prepare (struct drm_connector *connector, +struct drm_bridge *bridge, +struct hdmi_codec_daifmt *daifmt, +struct hdmi_codec_params *params); +void msm_dp_audio_shutdown (struct drm_connector *connector, +struct drm_bridge *bridge);#endif /* _DP_AUDIO_H_ */ drivers/gpu/drm/msm/dp/dp_display.c +4
-24@@ -13,6 +13,7 @@#include <linux/delay.h> #include <linux/string_choices.h> #include <drm/display/drm_dp_aux_bus.h> +#include <drm/display/drm_hdmi_audio_helper.h> #include <drm/drm_edid.h> #include "msm_drv.h" @@ -288,13 +289,6 @@ static int msm_dp_display_bind(struct device *dev, struct device *master, goto end; } - - rc =msm_dp_register_audio_driver (dev, dp->audio); -if (rc) { -DRM_ERROR ("Audio registration Dp failed\n" ); - goto end; - } - rc =msm_dp_hpd_event_thread_start (dp);if (rc) {DRM_ERROR ("Event thread create failed\n" );@@ -316,7 +310,6 @@ static void msm_dp_display_unbind(struct device *dev, struct device *master,of_dp_aux_depopulate_bus (dp->aux); -msm_dp_unregister_audio_driver (dev, dp->audio);msm_dp_aux_unregister (dp->aux); dp->drm_dev =NULL ; dp->aux->drm_dev =NULL ;@@ -626,9 +619,9 @@ static void msm_dp_display_handle_plugged_change(struct msm_dp *msm_dp_display, struct msm_dp_display_private, msm_dp_display);/* notify audio subsystem only if sink supports audio */ -if (msm_dp_display->plugged_cb && msm_dp_display->codec_dev && - dp->audio_supported) - msm_dp_display->plugged_cb (msm_dp_display->codec_dev, plugged); +if (dp->audio_supported) +drm_connector_hdmi_audio_plugged_notify (msm_dp_display->connector, + plugged); }static int msm_dp_hpd_unplug_handle (struct msm_dp_display_private *dp,u32 data)@@ -907,19 +900,6 @@ static int msm_dp_display_disable(struct msm_dp_display_private *dp)return 0 ; } -int msm_dp_display_set_plugged_cb (struct msm_dp *msm_dp_display, -hdmi_codec_plugged_cb fn,struct device *codec_dev) -{ -bool plugged; - - msm_dp_display->plugged_cb = fn; - msm_dp_display->codec_dev = codec_dev; - plugged = msm_dp_display->link_ready; -msm_dp_display_handle_plugged_change (msm_dp_display, plugged); - -return 0 ; -} -/** * msm_dp_bridge_mode_valid - callback to determine if specified mode is valid * @bridge: Pointer to drm bridge structure drivers/gpu/drm/msm/dp/dp_display.h +0
-6@@ -7,7 +7,6 @@#define _DP_DISPLAY_H_#include "dp_panel.h" -#include <sound/hdmi-codec.h> #include "disp/msm_disp_snapshot.h" #define DP_MAX_PIXEL_CLK_KHZ 675000@@ -15,7 +14,6 @@struct msm_dp {struct drm_device *drm_dev;struct platform_device *pdev; -struct device *codec_dev;struct drm_connector *connector;struct drm_bridge *next_bridge;bool link_ready;@@ -25,14 +23,10 @@ struct msm_dp {bool is_edp;bool internal_hpd; -hdmi_codec_plugged_cb plugged_cb; -struct msm_dp_audio *msm_dp_audio;bool psr_supported; }; -int msm_dp_display_set_plugged_cb (struct msm_dp *msm_dp_display, -hdmi_codec_plugged_cb fn,struct device *codec_dev);int msm_dp_display_get_modes (struct msm_dp *msm_dp_display);bool msm_dp_display_check_video_test (struct msm_dp *msm_dp_display);int msm_dp_display_get_test_bpp (struct msm_dp *msm_dp_display);drivers/gpu/drm/msm/dp/dp_drm.c +8
-1@@ -12,6 +12,7 @@#include "msm_drv.h" #include "msm_kms.h" +#include "dp_audio.h" #include "dp_drm.h" /** @@ -114,6 +115,9 @@ static const struct drm_bridge_funcs msm_dp_bridge_ops = { .hpd_disable = msm_dp_bridge_hpd_disable, .hpd_notify = msm_dp_bridge_hpd_notify, .debugfs_init = msm_dp_bridge_debugfs_init, + + .dp_audio_prepare = msm_dp_audio_prepare, + .dp_audio_shutdown = msm_dp_audio_shutdown, }; static int msm_edp_bridge_atomic_check(struct drm_bridge *drm_bridge,@@ -320,9 +324,13 @@ int msm_dp_bridge_init(struct msm_dp *msm_dp_display, struct drm_device *dev,*/ if (!msm_dp_display->is_edp) { bridge->ops = +DRM_BRIDGE_OP_DP_AUDIO |DRM_BRIDGE_OP_DETECT |DRM_BRIDGE_OP_HPD |DRM_BRIDGE_OP_MODES ; + bridge->hdmi_audio_dev = &msm_dp_display->pdev->dev; + bridge->hdmi_audio_max_i2s_playback_channels =8 ; + bridge->hdmi_audio_dai_port =-1 ; } rc =devm_drm_bridge_add (dev->dev, bridge); ---base-commit:
6ac908f24cd7ddae52c496bbc888e97ee7b033ac
change-id: 20250206-dp-hdmi-audio-15d9fdbebb9fBest regards,
Quoted 35 lines · Luca Weiss
Hi Dmitry,
Quoted 7 lines · Dmitry Baryshkov
From: Dmitry Baryshkov <[email protected]>
The MSM DisplayPort driver implements several HDMI codec functions in the driver, e.g. it manually manages HDMI codec device registration, returning ELD and
plugged_cbsupport. In order to reduce code duplication reuse drm_hdmi_audio_* helpers anddrm_bridge_connectorintegration.A bit late, but it appears that since 6.16 kernel (incl. 6.17) DP audio is broken on qcm6490-fairphone-fp5 (which is using the Elite audio architecture, not Audioreach).
Git bisect is pointing to this patch:
98a8920e7b07641eb1996b3c39b9ce27fc05dbb9is the first bad commit commit98a8920e7b07641eb1996b3c39b9ce27fc05dbb9
Author: Dmitry Baryshkov <[email protected]>
Date: Fri May 2 01:41:42 2025 +0300drm/msm/dp: reuse generic HDMI codec implementation
It's specifically failing with these errors:
[ 177.380809] qcom-q6afe aprsvc:service:4:4: AFE enable for port 0x6020 failed -110 [ 177.380851] q6afe-dai 3700000.remoteproc:glink-edge:apr:service@4:dais: fail to start AFE port 68 [ 177.380865] q6afe-dai 3700000.remoteproc:glink-edge:apr:service@4:dais: ASoC error (-110): at snd_soc_dai_prepare() on DISPLAY_PORT_RX_0 [ 177.437004] qcom-q6afe aprsvc:service:4:4: cmd = 0x100e5 returned error = 0x9 [ 177.437294] qcom-q6afe aprsvc:service:4:4: DSP returned error[9] [ 177.437312] qcom-q6afe aprsvc:service:4:4: AFE enable for port 0x6020 failed -22 [ 177.437332] q6afe-dai 3700000.remoteproc:glink-edge:apr:service@4:dais: fail to start AFE port 68 [ 177.437343] q6afe-dai 3700000.remoteproc:glink-edge:apr:service@4:dais: ASoC error (-22): at snd_soc_dai_prepare() on DISPLAY_PORT_RX_0
Quoted 1 line
Do you have an idea?
Dmitry pointed me to this patch on IRC which does fix the problem described above.
https://lore.kernel.org/linux-arm-msm/[email protected]/
Regards
Luca
Quoted 457 lines
Regards
LucaQuoted 453 lines
Signed-off-by Dmitry Baryshkov <[email protected]>Signed-off-by Dmitry Baryshkov <[email protected]>---
A lot of DisplayPort bridges use HDMI Codec in order to provide audio support. Present DRM HDMI Audio support has been written with the HDMI and in particular DRM HDMI Connector framework support, however those audio helpers can be easily reused for DisplayPort drivers too.Patches by Hermes Wu that targeted implementing HDMI Audio support in the iTE IT6506 driver pointed out the necessity of allowing one to use generic audio helpers for DisplayPort drivers, as otherwise each driver has to manually (and correctly) implement the
get_eld()andplugged_cbsupport.Implement necessary integration in
drm_bridge_connectorand provide an
example implementation in the msm/dp driver.
---
Changes in v7:
- Dropped applied patches
- Link to v6: https://lore.kernel.org/r/[email protected]Changes in v6:
- AddedDRM_BRIDGE_OP_DP_AUDIOand separate set of DisplayPort audio callbacks to thedrm_bridgeinterface (Maxime)
- Link to v5: https://lore.kernel.org/r/[email protected]Changes in v5:
- Rebased on top of linux-next, also handling HDMI audio piece of the
MSM HDMI driver.
- Link to v4: https://lore.kernel.org/r/[email protected]Changes in v4:
- Rebased on linux-next, addingDRM_BRIDGE_OP_HDMI_AUDIOto Synopsys QP
HDMI driver.
- Drop outdated comment regarding subconnector from the commit message.
- Link to v3: https://lore.kernel.org/r/[email protected]Changes in v3:
- DroppedDRM_BRIDGE_OP_DisplayPort, addedDRM_BRIDGE_OP_HDMI_AUDIO(Laurent, Maxime)
- Dropped the subconnector patch (again)
- Link to v2: https://lore.kernel.org/r/[email protected]Changes in v2:
- Addeddrm_connector_attach_dp_subconnector_property()patches
- Link to v1: https://lore.kernel.org/r/[email protected]--- drivers/gpu/drm/msm/Kconfig | 1 + drivers/gpu/drm/msm/dp/dp_audio.c | 131 ++++-------------------------------- drivers/gpu/drm/msm/dp/dp_audio.h | 27 ++------ drivers/gpu/drm/msm/dp/dp_display.c | 28 ++------ drivers/gpu/drm/msm/dp/dp_display.h | 6 -- drivers/gpu/drm/msm/dp/dp_drm.c | 8 +++ 6 files changed, 31 insertions(+), 170 deletions(-)drivers/gpu/drm/msm/Kconfig +1
-0@@ -104,6 +104,7 @@ config DRM_MSM_DPU config DRM_MSM_DP bool "Enable DisplayPort support in MSM DRM driver" depends on DRM_MSM + select DRM_DISPLAY_HDMI_AUDIO_HELPER select RATIONAL default y helpdrivers/gpu/drm/msm/dp/dp_audio.c +12
-119@@ -13,13 +13,13 @@#include "dp_catalog.h" #include "dp_audio.h" +#include "dp_drm.h" #include "dp_panel.h" #include "dp_reg.h" #include "dp_display.h" #include "dp_utils.h" struct msm_dp_audio_private { -struct platform_device *audio_pdev;struct platform_device *pdev;struct drm_device *drm_dev;struct msm_dp_catalog *catalog;@@ -160,24 +160,11 @@ static void msm_dp_audio_enable(struct msm_dp_audio_private *audio, bool enable)msm_dp_catalog_audio_enable (catalog, enable); } -static struct msm_dp_audio_private *msm_dp_audio_get_data (struct platform_device *pdev) +static struct msm_dp_audio_private *msm_dp_audio_get_data (struct msm_dp *msm_dp_display) {struct msm_dp_audio *msm_dp_audio; -struct msm_dp *msm_dp_display; - -if (!pdev) { -DRM_ERROR ("invalid input\n" ); -return ERR_PTR (-ENODEV ); - } - - msm_dp_display =platform_get_drvdata (pdev); -if (!msm_dp_display) { -DRM_ERROR ("invalid input\n" ); -return ERR_PTR (-ENODEV ); - } msm_dp_audio = msm_dp_display->msm_dp_audio; -if (!msm_dp_audio) {DRM_ERROR ("invalid msm_dp_audio data\n" );return ERR_PTR (-EINVAL );@@ -186,68 +173,16 @@ static struct msm_dp_audio_private *msm_dp_audio_get_data(struct platform_device return container_of(msm_dp_audio, struct msm_dp_audio_private, msm_dp_audio); } -static int msm_dp_audio_hook_plugged_cb (struct device *dev,void *data, -hdmi_codec_plugged_cb fn, -struct device *codec_dev) -{ - -struct platform_device *pdev; -struct msm_dp *msm_dp_display; - - pdev =to_platform_device (dev); -if (!pdev) { -pr_err ("invalid input\n" ); -return -ENODEV ; - } - - msm_dp_display =platform_get_drvdata (pdev); -if (!msm_dp_display) { -pr_err ("invalid input\n" ); -return -ENODEV ; - } - -return msm_dp_display_set_plugged_cb (msm_dp_display, fn, codec_dev); -} - -static int msm_dp_audio_get_eld (struct device *dev, -void *data,uint8_t *buf,size_t len) -{ -struct platform_device *pdev; -struct msm_dp *msm_dp_display; - - pdev =to_platform_device (dev); - -if (!pdev) { -DRM_ERROR ("invalid input\n" ); -return -ENODEV ; - } - - msm_dp_display =platform_get_drvdata (pdev); -if (!msm_dp_display) { -DRM_ERROR ("invalid input\n" ); -return -ENODEV ; - } - -mutex_lock (&msm_dp_display->connector->eld_mutex); -memcpy (buf, msm_dp_display->connector->eld, -min (sizeof (msm_dp_display->connector->eld), len)); -mutex_unlock (&msm_dp_display->connector->eld_mutex); - -return 0 ; -} - -int msm_dp_audio_hw_params (struct device *dev, -void *data, -struct hdmi_codec_daifmt *daifmt, -struct hdmi_codec_params *params) +int msm_dp_audio_prepare (struct drm_connector *connector, +struct drm_bridge *bridge, +struct hdmi_codec_daifmt *daifmt, +struct hdmi_codec_params *params) {int rc =0 ;struct msm_dp_audio_private *audio; -struct platform_device *pdev;struct msm_dp *msm_dp_display; - pdev =to_platform_device (dev); - msm_dp_display =platform_get_drvdata (pdev); + msm_dp_display =to_dp_bridge (bridge)->msm_dp_display;/* * there could be cases where sound card can be opened even @@ -262,7 +197,7 @@ int msm_dp_audio_hw_params(struct device *dev, goto end; } - audio =msm_dp_audio_get_data (pdev); + audio =msm_dp_audio_get_data (msm_dp_display);if (IS_ERR (audio)) { rc =PTR_ERR (audio); goto end;@@ -281,15 +216,14 @@ int msm_dp_audio_hw_params(struct device *dev,return rc; } -static void msm_dp_audio_shutdown (struct device *dev,void *data) +void msm_dp_audio_shutdown (struct drm_connector *connector, +struct drm_bridge *bridge) {struct msm_dp_audio_private *audio; -struct platform_device *pdev;struct msm_dp *msm_dp_display; - pdev =to_platform_device (dev); - msm_dp_display =platform_get_drvdata (pdev); - audio =msm_dp_audio_get_data (pdev); + msm_dp_display =to_dp_bridge (bridge)->msm_dp_display; + audio =msm_dp_audio_get_data (msm_dp_display);if (IS_ERR (audio)) {DRM_ERROR ("failed to get audio data\n" );return ;@@ -311,47 +245,6 @@ static void msm_dp_audio_shutdown(struct device *dev, void *data)msm_dp_display_signal_audio_complete (msm_dp_display); } -static const struct hdmi_codec_ops msm_dp_audio_codec_ops = { - .hw_params = msm_dp_audio_hw_params, - .audio_shutdown = msm_dp_audio_shutdown, - .get_eld = msm_dp_audio_get_eld, - .hook_plugged_cb = msm_dp_audio_hook_plugged_cb, -}; - -static struct hdmi_codec_pdata codec_data = { - .ops = &msm_dp_audio_codec_ops, - .max_i2s_channels =8 , - .i2s =1 , -}; - -void msm_dp_unregister_audio_driver (struct device *dev,struct msm_dp_audio *msm_dp_audio) -{ -struct msm_dp_audio_private *audio_priv; - - audio_priv = container_of(msm_dp_audio, struct msm_dp_audio_private, msm_dp_audio); - -if (audio_priv->audio_pdev) { -platform_device_unregister (audio_priv->audio_pdev); - audio_priv->audio_pdev =NULL ; - } -} - -int msm_dp_register_audio_driver (struct device *dev, -struct msm_dp_audio *msm_dp_audio) -{ -struct msm_dp_audio_private *audio_priv; - - audio_priv =container_of (msm_dp_audio, - struct msm_dp_audio_private, msm_dp_audio); - - audio_priv->audio_pdev =platform_device_register_data (dev, -HDMI_CODEC_DRV_NAME , -PLATFORM_DEVID_AUTO , - &codec_data, -sizeof (codec_data)); -return PTR_ERR_OR_ZERO (audio_priv->audio_pdev); -} -struct msm_dp_audio *msm_dp_audio_get (struct platform_device *pdev,struct msm_dp_catalog *catalog) {drivers/gpu/drm/msm/dp/dp_audio.h +6
-21@@ -35,23 +35,6 @@ struct msm_dp_audio {struct msm_dp_audio *msm_dp_audio_get (struct platform_device *pdev,struct msm_dp_catalog *catalog); -/** -* msm_dp_register_audio_driver() -* -* Registers DP device with hdmi_codec interface. -* -* @dev: DP device instance. -* @msm_dp_audio: an instance of msm_dp_audio module. -* -* -* Returns the error code in case of failure, otherwise -* zero on success. -*/ -int msm_dp_register_audio_driver (struct device *dev, -struct msm_dp_audio *msm_dp_audio); - -void msm_dp_unregister_audio_driver (struct device *dev,struct msm_dp_audio *msm_dp_audio); -/** * msm_dp_audio_put() * @@ -61,10 +44,12 @@ void msm_dp_unregister_audio_driver(struct device *dev, struct msm_dp_audio *msm*/ void msm_dp_audio_put (struct msm_dp_audio *msm_dp_audio); -int msm_dp_audio_hw_params (struct device *dev, -void *data, -struct hdmi_codec_daifmt *daifmt, -struct hdmi_codec_params *params); +int msm_dp_audio_prepare (struct drm_connector *connector, +struct drm_bridge *bridge, +struct hdmi_codec_daifmt *daifmt, +struct hdmi_codec_params *params); +void msm_dp_audio_shutdown (struct drm_connector *connector, +struct drm_bridge *bridge);#endif /* _DP_AUDIO_H_ */ drivers/gpu/drm/msm/dp/dp_display.c +4
-24@@ -13,6 +13,7 @@#include <linux/delay.h> #include <linux/string_choices.h> #include <drm/display/drm_dp_aux_bus.h> +#include <drm/display/drm_hdmi_audio_helper.h> #include <drm/drm_edid.h> #include "msm_drv.h" @@ -288,13 +289,6 @@ static int msm_dp_display_bind(struct device *dev, struct device *master, goto end; } - - rc =msm_dp_register_audio_driver (dev, dp->audio); -if (rc) { -DRM_ERROR ("Audio registration Dp failed\n" ); - goto end; - } - rc =msm_dp_hpd_event_thread_start (dp);if (rc) {DRM_ERROR ("Event thread create failed\n" );@@ -316,7 +310,6 @@ static void msm_dp_display_unbind(struct device *dev, struct device *master,of_dp_aux_depopulate_bus (dp->aux); -msm_dp_unregister_audio_driver (dev, dp->audio);msm_dp_aux_unregister (dp->aux); dp->drm_dev =NULL ; dp->aux->drm_dev =NULL ;@@ -626,9 +619,9 @@ static void msm_dp_display_handle_plugged_change(struct msm_dp *msm_dp_display, struct msm_dp_display_private, msm_dp_display);/* notify audio subsystem only if sink supports audio */ -if (msm_dp_display->plugged_cb && msm_dp_display->codec_dev && - dp->audio_supported) - msm_dp_display->plugged_cb (msm_dp_display->codec_dev, plugged); +if (dp->audio_supported) +drm_connector_hdmi_audio_plugged_notify (msm_dp_display->connector, + plugged); }static int msm_dp_hpd_unplug_handle (struct msm_dp_display_private *dp,u32 data)@@ -907,19 +900,6 @@ static int msm_dp_display_disable(struct msm_dp_display_private *dp)return 0 ; } -int msm_dp_display_set_plugged_cb (struct msm_dp *msm_dp_display, -hdmi_codec_plugged_cb fn,struct device *codec_dev) -{ -bool plugged; - - msm_dp_display->plugged_cb = fn; - msm_dp_display->codec_dev = codec_dev; - plugged = msm_dp_display->link_ready; -msm_dp_display_handle_plugged_change (msm_dp_display, plugged); - -return 0 ; -} -/** * msm_dp_bridge_mode_valid - callback to determine if specified mode is valid * @bridge: Pointer to drm bridge structure drivers/gpu/drm/msm/dp/dp_display.h +0
-6@@ -7,7 +7,6 @@#define _DP_DISPLAY_H_#include "dp_panel.h" -#include <sound/hdmi-codec.h> #include "disp/msm_disp_snapshot.h" #define DP_MAX_PIXEL_CLK_KHZ 675000@@ -15,7 +14,6 @@struct msm_dp {struct drm_device *drm_dev;struct platform_device *pdev; -struct device *codec_dev;struct drm_connector *connector;struct drm_bridge *next_bridge;bool link_ready;@@ -25,14 +23,10 @@ struct msm_dp {bool is_edp;bool internal_hpd; -hdmi_codec_plugged_cb plugged_cb; -struct msm_dp_audio *msm_dp_audio;bool psr_supported; }; -int msm_dp_display_set_plugged_cb (struct msm_dp *msm_dp_display, -hdmi_codec_plugged_cb fn,struct device *codec_dev);int msm_dp_display_get_modes (struct msm_dp *msm_dp_display);bool msm_dp_display_check_video_test (struct msm_dp *msm_dp_display);int msm_dp_display_get_test_bpp (struct msm_dp *msm_dp_display);drivers/gpu/drm/msm/dp/dp_drm.c +8
-1@@ -12,6 +12,7 @@#include "msm_drv.h" #include "msm_kms.h" +#include "dp_audio.h" #include "dp_drm.h" /** @@ -114,6 +115,9 @@ static const struct drm_bridge_funcs msm_dp_bridge_ops = { .hpd_disable = msm_dp_bridge_hpd_disable, .hpd_notify = msm_dp_bridge_hpd_notify, .debugfs_init = msm_dp_bridge_debugfs_init, + + .dp_audio_prepare = msm_dp_audio_prepare, + .dp_audio_shutdown = msm_dp_audio_shutdown, }; static int msm_edp_bridge_atomic_check(struct drm_bridge *drm_bridge,@@ -320,9 +324,13 @@ int msm_dp_bridge_init(struct msm_dp *msm_dp_display, struct drm_device *dev,*/ if (!msm_dp_display->is_edp) { bridge->ops = +DRM_BRIDGE_OP_DP_AUDIO |DRM_BRIDGE_OP_DETECT |DRM_BRIDGE_OP_HPD |DRM_BRIDGE_OP_MODES ; + bridge->hdmi_audio_dev = &msm_dp_display->pdev->dev; + bridge->hdmi_audio_max_i2s_playback_channels =8 ; + bridge->hdmi_audio_dai_port =-1 ; } rc =devm_drm_bridge_add (dev->dev, bridge); ---base-commit:
6ac908f24cd7ddae52c496bbc888e97ee7b033ac
change-id: 20250206-dp-hdmi-audio-15d9fdbebb9fBest regards,
Quoted 36 lines · Luca Weiss
Quoted 35 lines · Luca Weiss
Hi Dmitry,
Quoted 7 lines · Dmitry Baryshkov
From: Dmitry Baryshkov <[email protected]>
The MSM DisplayPort driver implements several HDMI codec functions in the driver, e.g. it manually manages HDMI codec device registration, returning ELD and
plugged_cbsupport. In order to reduce code duplication reuse drm_hdmi_audio_* helpers anddrm_bridge_connectorintegration.A bit late, but it appears that since 6.16 kernel (incl. 6.17) DP audio is broken on qcm6490-fairphone-fp5 (which is using the Elite audio architecture, not Audioreach).
Git bisect is pointing to this patch:
98a8920e7b07641eb1996b3c39b9ce27fc05dbb9is the first bad commit commit98a8920e7b07641eb1996b3c39b9ce27fc05dbb9
Author: Dmitry Baryshkov <[email protected]>
Date: Fri May 2 01:41:42 2025 +0300drm/msm/dp: reuse generic HDMI codec implementation
It's specifically failing with these errors:
[ 177.380809] qcom-q6afe aprsvc:service:4:4: AFE enable for port 0x6020 failed -110 [ 177.380851] q6afe-dai 3700000.remoteproc:glink-edge:apr:service@4:dais: fail to start AFE port 68 [ 177.380865] q6afe-dai 3700000.remoteproc:glink-edge:apr:service@4:dais: ASoC error (-110): at snd_soc_dai_prepare() on DISPLAY_PORT_RX_0 [ 177.437004] qcom-q6afe aprsvc:service:4:4: cmd = 0x100e5 returned error = 0x9 [ 177.437294] qcom-q6afe aprsvc:service:4:4: DSP returned error[9] [ 177.437312] qcom-q6afe aprsvc:service:4:4: AFE enable for port 0x6020 failed -22 [ 177.437332] q6afe-dai 3700000.remoteproc:glink-edge:apr:service@4:dais: fail to start AFE port 68 [ 177.437343] q6afe-dai 3700000.remoteproc:glink-edge:apr:service@4:dais: ASoC error (-22): at snd_soc_dai_prepare() on DISPLAY_PORT_RX_0
Quoted 6 lines
Quoted 1 line
Do you have an idea?
Dmitry pointed me to this patch on IRC which does fix the problem described above.
I have been waiting for Srini to respond to the quetions that I have asked in response to those emails. If he doesn't respond in a sensible timeframe, I think, we should pick that patch.
Signature · 2 lines
With best wishes Dmitry