AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] drm/amd/display: Fix HPD consideration for VGA/LVDS connectors on DCE
@ 2026-08-21 21:50 Timur Kristóf
  2026-08-21 21:50 ` [PATCH 2/2] drm/amd/display: Log details when failing to register HPD IRQ Timur Kristóf
  2026-08-21 22:03 ` [PATCH 1/2] drm/amd/display: Fix HPD consideration for VGA/LVDS connectors on DCE Mario Limonciello
  0 siblings, 2 replies; 4+ messages in thread
From: Timur Kristóf @ 2026-08-21 21:50 UTC (permalink / raw)
  To: amd-gfx, Alexander.Deucher, Natalie Vock, Mario Limonciello,
	Tvrtko Ursulin, Melissa Wen, harry.wentland, Leo Li, Ivan Lipski,
	Alex Hung
  Cc: Timur Kristóf, Dmytro Laktyushkin, Roman Li

After a refactor that landed in Linux 7.0,
DC now crashes when it is initialized on GPUs
that have a VGA or LVDS connector. This is because
these connectors have no HPD so the hpd_gpio is NULL
and therefore DC takes the code path meant for
DCN 4.2+ which sets irq_source_hpd = 255 that
causes the subsequent code to try to register
the HPD interrupt, which fails, and causes
a crash.

This commit should be backported to Linux 7.0 and newer.

Cc: Dmytro Laktyushkin <dmytro.laktyushkin@amd.com>
Cc: Roman Li <roman.li@amd.com>
Closes: https://gitlab.freedesktop.org/drm/amd/-/work_items/5490
Fixes: def3488eb0fd ("drm/amd/display: refactor HPD to increase flexibility")
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
---
 drivers/gpu/drm/amd/display/dc/link/link_factory.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/display/dc/link/link_factory.c b/drivers/gpu/drm/amd/display/dc/link/link_factory.c
index 8560ee727bfa..a83693ea43c0 100644
--- a/drivers/gpu/drm/amd/display/dc/link/link_factory.c
+++ b/drivers/gpu/drm/amd/display/dc/link/link_factory.c
@@ -643,7 +643,7 @@ static bool construct_phy(struct dc_link *link,
 
 		DC_LOG_DC("BIOS object table - hpd_gpio id: %d", enc_init_data.hpd_gpio->id);
 		DC_LOG_DC("BIOS object table - hpd_gpio en: %d", enc_init_data.hpd_gpio->en);
-	} else {
+	} else if (link->ctx->dce_version > DCN_VERSION_4_01) {
 		struct graphics_object_hpd_info hpd_info;
 
 		if (link->ctx->dc_bios->funcs->get_hpd_info(link->ctx->dc_bios, link->link_id, &hpd_info) == BP_RESULT_OK) {
-- 
2.55.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/2] drm/amd/display: Log details when failing to register HPD IRQ
  2026-08-21 21:50 [PATCH 1/2] drm/amd/display: Fix HPD consideration for VGA/LVDS connectors on DCE Timur Kristóf
@ 2026-08-21 21:50 ` Timur Kristóf
  2026-08-21 22:02   ` Mario Limonciello
  2026-08-21 22:03 ` [PATCH 1/2] drm/amd/display: Fix HPD consideration for VGA/LVDS connectors on DCE Mario Limonciello
  1 sibling, 1 reply; 4+ messages in thread
From: Timur Kristóf @ 2026-08-21 21:50 UTC (permalink / raw)
  To: amd-gfx, Alexander.Deucher, Natalie Vock, Mario Limonciello,
	Tvrtko Ursulin, Melissa Wen, harry.wentland, Leo Li, Ivan Lipski,
	Alex Hung
  Cc: Timur Kristóf

This should help diagnose HPD IRQ related issues in the future.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_irq.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_irq.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_irq.c
index 9be63996b062..d0239a3de2e1 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_irq.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_irq.c
@@ -1735,7 +1735,9 @@ int amdgpu_dm_register_hpd_handlers(struct amdgpu_device *adev)
 			if (int_params.irq_source == DC_IRQ_SOURCE_INVALID ||
 				int_params.irq_source  < DC_IRQ_SOURCE_HPD1 ||
 				int_params.irq_source  > DC_IRQ_SOURCE_HPD6) {
-				drm_err(adev_to_drm(adev), "Failed to register hpd irq!\n");
+				drm_err(adev_to_drm(adev),
+					"Failed to register hpd irq %u for %s!\n",
+					int_params.irq_source, connector->name);
 				return -EINVAL;
 			}
 
@@ -1753,7 +1755,9 @@ int amdgpu_dm_register_hpd_handlers(struct amdgpu_device *adev)
 			if (int_params.irq_source == DC_IRQ_SOURCE_INVALID ||
 				int_params.irq_source  < DC_IRQ_SOURCE_HPD1RX ||
 				int_params.irq_source  > DC_IRQ_SOURCE_HPD6RX) {
-				drm_err(adev_to_drm(adev), "Failed to register hpd rx irq!\n");
+				drm_err(adev_to_drm(adev),
+					"Failed to register hpd rx irq %u for %s!\n",
+					int_params.irq_source, connector->name);
 				return -EINVAL;
 			}
 
-- 
2.55.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 2/2] drm/amd/display: Log details when failing to register HPD IRQ
  2026-08-21 21:50 ` [PATCH 2/2] drm/amd/display: Log details when failing to register HPD IRQ Timur Kristóf
@ 2026-08-21 22:02   ` Mario Limonciello
  0 siblings, 0 replies; 4+ messages in thread
From: Mario Limonciello @ 2026-08-21 22:02 UTC (permalink / raw)
  To: Timur Kristóf, amd-gfx, Alexander.Deucher, Natalie Vock,
	Tvrtko Ursulin, Melissa Wen, harry.wentland, Leo Li, Ivan Lipski,
	Alex Hung



On 8/21/26 16:50, Timur Kristóf wrote:
> This should help diagnose HPD IRQ related issues in the future.
> 
> Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Mario Limonciello (AMD) <superm1@kernel.org>

I'll get this committed to amd-staging-drm-next.

> ---
>   drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_irq.c | 8 ++++++--
>   1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_irq.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_irq.c
> index 9be63996b062..d0239a3de2e1 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_irq.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_irq.c
> @@ -1735,7 +1735,9 @@ int amdgpu_dm_register_hpd_handlers(struct amdgpu_device *adev)
>   			if (int_params.irq_source == DC_IRQ_SOURCE_INVALID ||
>   				int_params.irq_source  < DC_IRQ_SOURCE_HPD1 ||
>   				int_params.irq_source  > DC_IRQ_SOURCE_HPD6) {
> -				drm_err(adev_to_drm(adev), "Failed to register hpd irq!\n");
> +				drm_err(adev_to_drm(adev),
> +					"Failed to register hpd irq %u for %s!\n",
> +					int_params.irq_source, connector->name);
>   				return -EINVAL;
>   			}
>   
> @@ -1753,7 +1755,9 @@ int amdgpu_dm_register_hpd_handlers(struct amdgpu_device *adev)
>   			if (int_params.irq_source == DC_IRQ_SOURCE_INVALID ||
>   				int_params.irq_source  < DC_IRQ_SOURCE_HPD1RX ||
>   				int_params.irq_source  > DC_IRQ_SOURCE_HPD6RX) {
> -				drm_err(adev_to_drm(adev), "Failed to register hpd rx irq!\n");
> +				drm_err(adev_to_drm(adev),
> +					"Failed to register hpd rx irq %u for %s!\n",
> +					int_params.irq_source, connector->name);
>   				return -EINVAL;
>   			}
>   


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/2] drm/amd/display: Fix HPD consideration for VGA/LVDS connectors on DCE
  2026-08-21 21:50 [PATCH 1/2] drm/amd/display: Fix HPD consideration for VGA/LVDS connectors on DCE Timur Kristóf
  2026-08-21 21:50 ` [PATCH 2/2] drm/amd/display: Log details when failing to register HPD IRQ Timur Kristóf
@ 2026-08-21 22:03 ` Mario Limonciello
  1 sibling, 0 replies; 4+ messages in thread
From: Mario Limonciello @ 2026-08-21 22:03 UTC (permalink / raw)
  To: Timur Kristóf, amd-gfx, Alexander.Deucher, Natalie Vock,
	Tvrtko Ursulin, Melissa Wen, harry.wentland, Leo Li, Ivan Lipski,
	Alex Hung
  Cc: Dmytro Laktyushkin, Roman Li



On 8/21/26 16:50, Timur Kristóf wrote:
> After a refactor that landed in Linux 7.0,
> DC now crashes when it is initialized on GPUs
> that have a VGA or LVDS connector. This is because
> these connectors have no HPD so the hpd_gpio is NULL
> and therefore DC takes the code path meant for
> DCN 4.2+ which sets irq_source_hpd = 255 that
> causes the subsequent code to try to register
> the HPD interrupt, which fails, and causes
> a crash.
> 
> This commit should be backported to Linux 7.0 and newer.
Unfortunately 7.0.y is EoL.  But we'll get it in 7.1.y and later.

> 
> Cc: Dmytro Laktyushkin <dmytro.laktyushkin@amd.com>
> Cc: Roman Li <roman.li@amd.com>
> Closes: https://gitlab.freedesktop.org/drm/amd/-/work_items/5490
> Fixes: def3488eb0fd ("drm/amd/display: refactor HPD to increase flexibility")
> Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>

Reviewed-by: Mario Limonciello (AMD) <superm1@kernel.org>

I'll get this committed to amd-staging-drm-next.
> ---
>   drivers/gpu/drm/amd/display/dc/link/link_factory.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/amd/display/dc/link/link_factory.c b/drivers/gpu/drm/amd/display/dc/link/link_factory.c
> index 8560ee727bfa..a83693ea43c0 100644
> --- a/drivers/gpu/drm/amd/display/dc/link/link_factory.c
> +++ b/drivers/gpu/drm/amd/display/dc/link/link_factory.c
> @@ -643,7 +643,7 @@ static bool construct_phy(struct dc_link *link,
>   
>   		DC_LOG_DC("BIOS object table - hpd_gpio id: %d", enc_init_data.hpd_gpio->id);
>   		DC_LOG_DC("BIOS object table - hpd_gpio en: %d", enc_init_data.hpd_gpio->en);
> -	} else {
> +	} else if (link->ctx->dce_version > DCN_VERSION_4_01) {
>   		struct graphics_object_hpd_info hpd_info;
>   
>   		if (link->ctx->dc_bios->funcs->get_hpd_info(link->ctx->dc_bios, link->link_id, &hpd_info) == BP_RESULT_OK) {


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-08-21 22:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-21 21:50 [PATCH 1/2] drm/amd/display: Fix HPD consideration for VGA/LVDS connectors on DCE Timur Kristóf
2026-08-21 21:50 ` [PATCH 2/2] drm/amd/display: Log details when failing to register HPD IRQ Timur Kristóf
2026-08-21 22:02   ` Mario Limonciello
2026-08-21 22:03 ` [PATCH 1/2] drm/amd/display: Fix HPD consideration for VGA/LVDS connectors on DCE Mario Limonciello

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox