aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c
diff options
context:
space:
mode:
authorLyude <cpaul@redhat.com>2016-06-24 17:54:32 -0400
committerAlex Deucher <alexander.deucher@amd.com>2016-07-07 15:06:07 -0400
commitb636a1b3d624b49b23cc1be2f9f6bcbb89aca855 (patch)
treeacea12472e03a15e91a1a363c4d26942f72757d8 /drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c
parent14ff8d48f2235295dfb3117693008e367b49cdb5 (diff)
drm/amdgpu: Poll for both connect/disconnect on analog connectors
DRM_CONNECTOR_POLL_CONNECT only enables polling for connections, not disconnections. Because of this, we end up losing hotplug polling for analog connectors once they get connected. Easy way to reproduce: - Grab a machine with an AMD GPU and a VGA port - Plug a monitor into the VGA port, wait for it to update the connector from disconnected to connected - Disconnect the monitor on VGA, a hotplug event is never sent for the removal of the connector. Originally, only using DRM_CONNECTOR_POLL_CONNECT might have been a good idea since doing VGA polling can sometimes result in having to mess with the DAC voltages to figure out whether or not there's actually something there since VGA doesn't have HPD. Doing this would have the potential of showing visible artifacts on the screen every time we ran a poll while a VGA display was connected. Luckily, amdgpu_vga_detect() only resorts to this sort of polling if the poll is forced, and DRM's polling helper doesn't force it's polls. Additionally, this removes some assignments to connector->polled that weren't actually doing anything. Cc: stable@vger.kernel.org Signed-off-by: Lyude <cpaul@redhat.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c
index cb07da41152b..ff0b55a65ca3 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c
@@ -1690,7 +1690,6 @@ amdgpu_connector_add(struct amdgpu_device *adev,
1690 DRM_MODE_SCALE_NONE); 1690 DRM_MODE_SCALE_NONE);
1691 /* no HPD on analog connectors */ 1691 /* no HPD on analog connectors */
1692 amdgpu_connector->hpd.hpd = AMDGPU_HPD_NONE; 1692 amdgpu_connector->hpd.hpd = AMDGPU_HPD_NONE;
1693 connector->polled = DRM_CONNECTOR_POLL_CONNECT;
1694 connector->interlace_allowed = true; 1693 connector->interlace_allowed = true;
1695 connector->doublescan_allowed = true; 1694 connector->doublescan_allowed = true;
1696 break; 1695 break;
@@ -1893,8 +1892,10 @@ amdgpu_connector_add(struct amdgpu_device *adev,
1893 } 1892 }
1894 1893
1895 if (amdgpu_connector->hpd.hpd == AMDGPU_HPD_NONE) { 1894 if (amdgpu_connector->hpd.hpd == AMDGPU_HPD_NONE) {
1896 if (i2c_bus->valid) 1895 if (i2c_bus->valid) {
1897 connector->polled = DRM_CONNECTOR_POLL_CONNECT; 1896 connector->polled = DRM_CONNECTOR_POLL_CONNECT |
1897 DRM_CONNECTOR_POLL_DISCONNECT;
1898 }
1898 } else 1899 } else
1899 connector->polled = DRM_CONNECTOR_POLL_HPD; 1900 connector->polled = DRM_CONNECTOR_POLL_HPD;
1900 1901