@@ -877,20 +877,23 @@ static void output_poll_execute(struct work_struct *work)
mutex_lock(&dev->mode_config.mutex);
list_for_each_entry(connector, &dev->mode_config.connector_list, head) {
- /* if this is HPD or polled don't check it -
+ /* if this is HPD, or otherwise non-polled, don't check it -
TV out for instance */
if (!connector->polled)
continue;
- else if (connector->polled & (DRM_CONNECTOR_POLL_CONNECT | DRM_CONNECTOR_POLL_DISCONNECT))
- repoll = true;
+ repoll = true;
old_status = connector->status;
/* if we are connected and don't want to poll for disconnect
skip it */
if (old_status == connector_status_connected &&
- !(connector->polled & DRM_CONNECTOR_POLL_DISCONNECT) &&
- !(connector->polled & DRM_CONNECTOR_POLL_HPD))
+ !(connector->polled & DRM_CONNECTOR_POLL_DISCONNECT))
+ continue;
+
+ /* and vice versa */
+ if (old_status == connector_status_disconnected &&
+ !(connector->polled & DRM_CONNECTOR_POLL_CONNECT))
continue;
connector->status = connector->funcs->detect(connector, false);
@@ -583,9 +583,7 @@ void intel_crt_init(struct drm_device *dev)
drm_sysfs_connector_add(connector);
- if (I915_HAS_HOTPLUG(dev))
- connector->polled = DRM_CONNECTOR_POLL_HPD;
- else
+ if (!I915_HAS_HOTPLUG(dev))
connector->polled = DRM_CONNECTOR_POLL_CONNECT;
/*
@@ -1984,8 +1984,6 @@ intel_dp_init(struct drm_device *dev, int output_reg)
drm_connector_init(dev, connector, &intel_dp_connector_funcs, type);
drm_connector_helper_add(connector, &intel_dp_connector_helper_funcs);
- connector->polled = DRM_CONNECTOR_POLL_HPD;
-
if (output_reg == DP_B || output_reg == PCH_DP_B)
intel_encoder->clone_mask = (1 << INTEL_DP_B_CLONE_BIT);
else if (output_reg == DP_C || output_reg == PCH_DP_C)
@@ -508,7 +508,6 @@ void intel_hdmi_init(struct drm_device *dev, int sdvox_reg)
intel_encoder->type = INTEL_OUTPUT_HDMI;
- connector->polled = DRM_CONNECTOR_POLL_HPD;
connector->interlace_allowed = 0;
connector->doublescan_allowed = 0;
intel_encoder->crtc_mask = (1 << 0) | (1 << 1);
@@ -1246,7 +1246,7 @@ intel_tv_detect_type (struct intel_tv *intel_tv,
int type;
/* Disable TV interrupts around load detect or we'll recurse */
- if (connector->polled & DRM_CONNECTOR_POLL_HPD) {
+ if (connector->polled == 0) {
spin_lock_irqsave(&dev_priv->irq_lock, irqflags);
i915_disable_pipestat(dev_priv, 0,
PIPE_HOTPLUG_INTERRUPT_ENABLE |
@@ -1309,7 +1309,7 @@ intel_tv_detect_type (struct intel_tv *intel_tv,
I915_WRITE(TV_CTL, save_tv_ctl);
/* Restore interrupt config */
- if (connector->polled & DRM_CONNECTOR_POLL_HPD) {
+ if (connector->polled == 0) {
spin_lock_irqsave(&dev_priv->irq_lock, irqflags);
i915_enable_pipestat(dev_priv, 0,
PIPE_HOTPLUG_INTERRUPT_ENABLE |
@@ -890,9 +890,7 @@ nouveau_connector_create(struct drm_device *dev, int index)
DRM_MODE_DITHERING_ON : DRM_MODE_DITHERING_OFF);
if (connector->connector_type != DRM_MODE_CONNECTOR_LVDS) {
- if (dev_priv->card_type >= NV_50)
- connector->polled = DRM_CONNECTOR_POLL_HPD;
- else
+ if (dev_priv->card_type < NV_50)
connector->polled = DRM_CONNECTOR_POLL_CONNECT;
}
break;
@@ -1763,8 +1763,7 @@ radeon_add_atom_connector(struct drm_device *dev,
if (radeon_connector->hpd.hpd == RADEON_HPD_NONE) {
if (i2c_bus->valid)
connector->polled = DRM_CONNECTOR_POLL_CONNECT;
- } else
- connector->polled = DRM_CONNECTOR_POLL_HPD;
+ }
connector->display_info.subpixel_order = subpixel_order;
drm_sysfs_connector_add(connector);
@@ -1923,8 +1922,7 @@ radeon_add_legacy_connector(struct drm_device *dev,
if (radeon_connector->hpd.hpd == RADEON_HPD_NONE) {
if (i2c_bus->valid)
connector->polled = DRM_CONNECTOR_POLL_CONNECT;
- } else
- connector->polled = DRM_CONNECTOR_POLL_HPD;
+ }
connector->display_info.subpixel_order = subpixel_order;
drm_sysfs_connector_add(connector);
if (connector_type == DRM_MODE_CONNECTOR_LVDS) {
@@ -458,8 +458,6 @@ enum drm_connector_force {
};
/* should we poll this connector for connects and disconnects */
-/* hot plug detectable */
-#define DRM_CONNECTOR_POLL_HPD (1 << 0)
/* poll for connections */
#define DRM_CONNECTOR_POLL_CONNECT (1 << 1)
/* can cleanly poll for disconnections without flickering the screen */
This was just confusing. ->polled just means which directions you want to poll for changes, regardless of whether you can get HPD interrupts for them. Signed-off-by: Adam Jackson <ajax@redhat.com> --- Kind of an RFC patch, and I've not tested it yet, but it certainly makes more sense to read this way. drivers/gpu/drm/drm_crtc_helper.c | 13 ++++++++----- drivers/gpu/drm/i915/intel_crt.c | 4 +--- drivers/gpu/drm/i915/intel_dp.c | 2 -- drivers/gpu/drm/i915/intel_hdmi.c | 1 - drivers/gpu/drm/i915/intel_tv.c | 4 ++-- drivers/gpu/drm/nouveau/nouveau_connector.c | 4 +--- drivers/gpu/drm/radeon/radeon_connectors.c | 6 ++---- include/drm/drm_crtc.h | 2 -- 8 files changed, 14 insertions(+), 22 deletions(-)