]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
drm/radeon/kms: set HPD polarity in hpd_init()
authorAlex Deucher <alexander.deucher@amd.com>
Thu, 3 Nov 2011 15:21:39 +0000 (11:21 -0400)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 11 Nov 2011 17:44:09 +0000 (09:44 -0800)
commit 64912e997f0fe13512e4c7b90e4f7c11cb922ab5 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>
drivers/gpu/drm/radeon/evergreen.c
drivers/gpu/drm/radeon/r100.c
drivers/gpu/drm/radeon/r600.c
drivers/gpu/drm/radeon/radeon_connectors.c
drivers/gpu/drm/radeon/rs600.c

index c4ffa14fb2f45ed09733cca219c54873f48d5a82..fb0a00a3e86fdad8df763de0d75dd4cfddd291ed 100644 (file)
@@ -353,6 +353,7 @@ void evergreen_hpd_init(struct radeon_device *rdev)
                default:
                        break;
                }
+               radeon_hpd_set_polarity(rdev, radeon_connector->hpd.hpd);
        }
        if (rdev->irq.installed)
                evergreen_irq_set(rdev);
index 7fcdbbbf297965044e550e611d8eb8b32a086051..c9a0dae481f12b048a0391f5f2e2e92de8f83927 100644 (file)
@@ -434,6 +434,7 @@ void r100_hpd_init(struct radeon_device *rdev)
                default:
                        break;
                }
+               radeon_hpd_set_polarity(rdev, radeon_connector->hpd.hpd);
        }
        if (rdev->irq.installed)
                r100_irq_set(rdev);
index 720dd99163f855feeb16b921f64f21fa38cc2971..9b62a97742a7e104eef9c08936cb5b26ab21f775 100644 (file)
@@ -762,13 +762,14 @@ void r600_hpd_init(struct radeon_device *rdev)
        struct drm_device *dev = rdev->ddev;
        struct drm_connector *connector;
 
-       if (ASIC_IS_DCE3(rdev)) {
-               u32 tmp = DC_HPDx_CONNECTION_TIMER(0x9c4) | DC_HPDx_RX_INT_TIMER(0xfa);
-               if (ASIC_IS_DCE32(rdev))
-                       tmp |= DC_HPDx_EN;
+       list_for_each_entry(connector, &dev->mode_config.connector_list, head) {
+               struct radeon_connector *radeon_connector = to_radeon_connector(connector);
+
+               if (ASIC_IS_DCE3(rdev)) {
+                       u32 tmp = DC_HPDx_CONNECTION_TIMER(0x9c4) | DC_HPDx_RX_INT_TIMER(0xfa);
+                       if (ASIC_IS_DCE32(rdev))
+                               tmp |= DC_HPDx_EN;
 
-               list_for_each_entry(connector, &dev->mode_config.connector_list, head) {
-                       struct radeon_connector *radeon_connector = to_radeon_connector(connector);
                        switch (radeon_connector->hpd.hpd) {
                        case RADEON_HPD_1:
                                WREG32(DC_HPD1_CONTROL, tmp);
@@ -798,10 +799,7 @@ void r600_hpd_init(struct radeon_device *rdev)
                        default:
                                break;
                        }
-               }
-       } else {
-               list_for_each_entry(connector, &dev->mode_config.connector_list, head) {
-                       struct radeon_connector *radeon_connector = to_radeon_connector(connector);
+               } else {
                        switch (radeon_connector->hpd.hpd) {
                        case RADEON_HPD_1:
                                WREG32(DC_HOT_PLUG_DETECT1_CONTROL, DC_HOT_PLUG_DETECTx_EN);
@@ -819,6 +817,7 @@ void r600_hpd_init(struct radeon_device *rdev)
                                break;
                        }
                }
+               radeon_hpd_set_polarity(rdev, radeon_connector->hpd.hpd);
        }
        if (rdev->irq.installed)
                r600_irq_set(rdev);
index 22ee3527cf1f181c8b96f6d536397e85aa43e683..ff6a2e0d9a250268948d98fb2d780b4e9689750c 100644 (file)
@@ -1790,7 +1790,6 @@ radeon_add_atom_connector(struct drm_device *dev,
                        connector->polled = DRM_CONNECTOR_POLL_CONNECT;
        } else
                connector->polled = DRM_CONNECTOR_POLL_HPD;
-       radeon_hpd_set_polarity(rdev, radeon_connector->hpd.hpd);
 
        connector->display_info.subpixel_order = subpixel_order;
        drm_sysfs_connector_add(connector);
index 4b5d0e6974a8f0b5b9abefd54e15404c9bb3f92a..29d85cf7fbbd5c7ca53f71e66bebc359ca13a5e2 100644 (file)
@@ -287,6 +287,7 @@ void rs600_hpd_init(struct radeon_device *rdev)
                default:
                        break;
                }
+               radeon_hpd_set_polarity(rdev, radeon_connector->hpd.hpd);
        }
        if (rdev->irq.installed)
                rs600_irq_set(rdev);