Skip to content

Commit 4de141b

Browse files
Roman Lialexdeucher
authored andcommitted
drm/amd/display: Fix HPD after gpu reset
[Why] DC is not using amdgpu_irq_get/put to manage the HPD interrupt refcounts. So when amdgpu_irq_gpu_reset_resume_helper() reprograms all of the IRQs, HPD gets disabled. [How] Use amdgpu_irq_get/put() for HPD init/fini in DM in order to sync refcounts Cc: Mario Limonciello <[email protected]> Cc: Alex Deucher <[email protected]> Reviewed-by: Mario Limonciello <[email protected]> Reviewed-by: Aurabindo Pillai <[email protected]> Signed-off-by: Roman Li <[email protected]> Signed-off-by: Zaeem Mohamed <[email protected]> Tested-by: Daniel Wheeler <[email protected]> Signed-off-by: Alex Deucher <[email protected]> (cherry picked from commit f3dde2f) Cc: [email protected]
1 parent b5f7242 commit 4de141b

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_irq.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -894,6 +894,7 @@ void amdgpu_dm_hpd_init(struct amdgpu_device *adev)
894894
struct drm_device *dev = adev_to_drm(adev);
895895
struct drm_connector *connector;
896896
struct drm_connector_list_iter iter;
897+
int i;
897898

898899
drm_connector_list_iter_begin(dev, &iter);
899900
drm_for_each_connector_iter(connector, &iter) {
@@ -920,6 +921,12 @@ void amdgpu_dm_hpd_init(struct amdgpu_device *adev)
920921
}
921922
}
922923
drm_connector_list_iter_end(&iter);
924+
925+
/* Update reference counts for HPDs */
926+
for (i = DC_IRQ_SOURCE_HPD1; i <= adev->mode_info.num_hpd; i++) {
927+
if (amdgpu_irq_get(adev, &adev->hpd_irq, i - DC_IRQ_SOURCE_HPD1))
928+
drm_err(dev, "DM_IRQ: Failed get HPD for source=%d)!\n", i);
929+
}
923930
}
924931

925932
/**
@@ -935,6 +942,7 @@ void amdgpu_dm_hpd_fini(struct amdgpu_device *adev)
935942
struct drm_device *dev = adev_to_drm(adev);
936943
struct drm_connector *connector;
937944
struct drm_connector_list_iter iter;
945+
int i;
938946

939947
drm_connector_list_iter_begin(dev, &iter);
940948
drm_for_each_connector_iter(connector, &iter) {
@@ -960,4 +968,10 @@ void amdgpu_dm_hpd_fini(struct amdgpu_device *adev)
960968
}
961969
}
962970
drm_connector_list_iter_end(&iter);
971+
972+
/* Update reference counts for HPDs */
973+
for (i = DC_IRQ_SOURCE_HPD1; i <= adev->mode_info.num_hpd; i++) {
974+
if (amdgpu_irq_put(adev, &adev->hpd_irq, i - DC_IRQ_SOURCE_HPD1))
975+
drm_err(dev, "DM_IRQ: Failed put HPD for source=%d!\n", i);
976+
}
963977
}

0 commit comments

Comments
 (0)