Skip to content

Commit 29ac4c3

Browse files
alexdeuchergregkh
authored andcommitted
drm/radeon/kms: set HPD polarity in hpd_init()
commit 64912e9 upstream. Polarity needs to be set accordingly to connector status (connected or disconnected). Set it up in hpd_init() so first hotplug works reliably no matter what is the initial set of connector. hpd_init() also covers resume so HPD will work correctly after resume as well. Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Cc: Jerome Glisse <j.glisse@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
1 parent 55fe133 commit 29ac4c3

5 files changed

Lines changed: 12 additions & 11 deletions

File tree

‎drivers/gpu/drm/radeon/evergreen.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,7 @@ void evergreen_hpd_init(struct radeon_device *rdev)
353353
default:
354354
break;
355355
}
356+
radeon_hpd_set_polarity(rdev, radeon_connector->hpd.hpd);
356357
}
357358
if (rdev->irq.installed)
358359
evergreen_irq_set(rdev);

‎drivers/gpu/drm/radeon/r100.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -434,6 +434,7 @@ void r100_hpd_init(struct radeon_device *rdev)
434434
default:
435435
break;
436436
}
437+
radeon_hpd_set_polarity(rdev, radeon_connector->hpd.hpd);
437438
}
438439
if (rdev->irq.installed)
439440
r100_irq_set(rdev);

‎drivers/gpu/drm/radeon/r600.c‎

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -762,13 +762,14 @@ void r600_hpd_init(struct radeon_device *rdev)
762762
struct drm_device *dev = rdev->ddev;
763763
struct drm_connector *connector;
764764

765-
if (ASIC_IS_DCE3(rdev)) {
766-
u32 tmp = DC_HPDx_CONNECTION_TIMER(0x9c4) | DC_HPDx_RX_INT_TIMER(0xfa);
767-
if (ASIC_IS_DCE32(rdev))
768-
tmp |= DC_HPDx_EN;
765+
list_for_each_entry(connector, &dev->mode_config.connector_list, head) {
766+
struct radeon_connector *radeon_connector = to_radeon_connector(connector);
767+
768+
if (ASIC_IS_DCE3(rdev)) {
769+
u32 tmp = DC_HPDx_CONNECTION_TIMER(0x9c4) | DC_HPDx_RX_INT_TIMER(0xfa);
770+
if (ASIC_IS_DCE32(rdev))
771+
tmp |= DC_HPDx_EN;
769772

770-
list_for_each_entry(connector, &dev->mode_config.connector_list, head) {
771-
struct radeon_connector *radeon_connector = to_radeon_connector(connector);
772773
switch (radeon_connector->hpd.hpd) {
773774
case RADEON_HPD_1:
774775
WREG32(DC_HPD1_CONTROL, tmp);
@@ -798,10 +799,7 @@ void r600_hpd_init(struct radeon_device *rdev)
798799
default:
799800
break;
800801
}
801-
}
802-
} else {
803-
list_for_each_entry(connector, &dev->mode_config.connector_list, head) {
804-
struct radeon_connector *radeon_connector = to_radeon_connector(connector);
802+
} else {
805803
switch (radeon_connector->hpd.hpd) {
806804
case RADEON_HPD_1:
807805
WREG32(DC_HOT_PLUG_DETECT1_CONTROL, DC_HOT_PLUG_DETECTx_EN);
@@ -819,6 +817,7 @@ void r600_hpd_init(struct radeon_device *rdev)
819817
break;
820818
}
821819
}
820+
radeon_hpd_set_polarity(rdev, radeon_connector->hpd.hpd);
822821
}
823822
if (rdev->irq.installed)
824823
r600_irq_set(rdev);

‎drivers/gpu/drm/radeon/radeon_connectors.c‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1790,7 +1790,6 @@ radeon_add_atom_connector(struct drm_device *dev,
17901790
connector->polled = DRM_CONNECTOR_POLL_CONNECT;
17911791
} else
17921792
connector->polled = DRM_CONNECTOR_POLL_HPD;
1793-
radeon_hpd_set_polarity(rdev, radeon_connector->hpd.hpd);
17941793

17951794
connector->display_info.subpixel_order = subpixel_order;
17961795
drm_sysfs_connector_add(connector);

‎drivers/gpu/drm/radeon/rs600.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,7 @@ void rs600_hpd_init(struct radeon_device *rdev)
287287
default:
288288
break;
289289
}
290+
radeon_hpd_set_polarity(rdev, radeon_connector->hpd.hpd);
290291
}
291292
if (rdev->irq.installed)
292293
rs600_irq_set(rdev);

0 commit comments

Comments
 (0)