[Intel-gfx] [PATCH 5/7] drm/i915: Set intel_connector->polled to DRM_CONNECTOR_POLL_HPD when appropriate
ville.syrjala at linux.intel.com
ville.syrjala at linux.intel.com
Fri Jan 9 04:21:16 PST 2015
From: Ville Syrjälä <ville.syrjala at linux.intel.com>
In order to toggle hpd support on/off per-connector during runtime, we
need to track the desired hpd state for each connector. Currently we're
being lazy and only setting up intel_connector->polled when we wish to
use polling instead of hpd, so a value of 0 can mean both "use hpd" and
"no hpd/polling whatsoever". Change things so that 0 actually means only
the latter, and a value of DRM_CONNECTOR_POLL_HPD will indicate that
we wish to use the hpd interrupt.
To do that we need to initiialize intel_connector->polled to
DRM_CONNECTOR_POLL_HPD for all hpd capable connectors.
Signed-off-by: Ville Syrjälä <ville.syrjala at linux.intel.com>
---
drivers/gpu/drm/i915/intel_crt.c | 4 +++-
drivers/gpu/drm/i915/intel_dp.c | 2 ++
drivers/gpu/drm/i915/intel_dp_mst.c | 2 ++
drivers/gpu/drm/i915/intel_hdmi.c | 2 ++
drivers/gpu/drm/i915/intel_sdvo.c | 1 +
5 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/i915/intel_crt.c b/drivers/gpu/drm/i915/intel_crt.c
index a9af9a4..a42d059 100644
--- a/drivers/gpu/drm/i915/intel_crt.c
+++ b/drivers/gpu/drm/i915/intel_crt.c
@@ -902,7 +902,9 @@ void intel_crt_init(struct drm_device *dev)
drm_connector_register(connector);
- if (!I915_HAS_HOTPLUG(dev))
+ if (I915_HAS_HOTPLUG(dev))
+ intel_connector->polled = DRM_CONNECTOR_POLL_HPD;
+ else
intel_connector->polled = DRM_CONNECTOR_POLL_CONNECT;
/*
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index 88d81a8..4d6af4c 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -5072,6 +5072,8 @@ intel_dp_init_connector(struct intel_digital_port *intel_dig_port,
BUG();
}
+ intel_connector->polled = DRM_CONNECTOR_POLL_HPD;
+
if (is_edp(intel_dp)) {
pps_lock(intel_dp);
intel_dp_init_panel_power_timestamps(intel_dp);
diff --git a/drivers/gpu/drm/i915/intel_dp_mst.c b/drivers/gpu/drm/i915/intel_dp_mst.c
index 7f8c6a6..831a2d9 100644
--- a/drivers/gpu/drm/i915/intel_dp_mst.c
+++ b/drivers/gpu/drm/i915/intel_dp_mst.c
@@ -407,6 +407,8 @@ static struct drm_connector *intel_dp_add_mst_connector(struct drm_dp_mst_topolo
intel_connector->mst_port = intel_dp;
intel_connector->port = port;
+ intel_connector->polled = DRM_CONNECTOR_POLL_HPD;
+
for (i = PIPE_A; i <= PIPE_C; i++) {
drm_mode_connector_attach_encoder(&intel_connector->base,
&intel_dp->mst_encoders[i]->base.base);
diff --git a/drivers/gpu/drm/i915/intel_hdmi.c b/drivers/gpu/drm/i915/intel_hdmi.c
index 3abc200..e59bc95 100644
--- a/drivers/gpu/drm/i915/intel_hdmi.c
+++ b/drivers/gpu/drm/i915/intel_hdmi.c
@@ -1687,6 +1687,8 @@ void intel_hdmi_init_connector(struct intel_digital_port *intel_dig_port,
BUG();
}
+ intel_connector->polled = DRM_CONNECTOR_POLL_HPD;
+
if (IS_VALLEYVIEW(dev)) {
intel_hdmi->write_infoframe = vlv_write_infoframe;
intel_hdmi->set_infoframes = vlv_set_infoframes;
diff --git a/drivers/gpu/drm/i915/intel_sdvo.c b/drivers/gpu/drm/i915/intel_sdvo.c
index 4e3d362..0ee0af7 100644
--- a/drivers/gpu/drm/i915/intel_sdvo.c
+++ b/drivers/gpu/drm/i915/intel_sdvo.c
@@ -2455,6 +2455,7 @@ intel_sdvo_dvi_init(struct intel_sdvo *intel_sdvo, int device)
*/
intel_encoder->hot_plug = intel_sdvo_enable_hotplug;
intel_sdvo_enable_hotplug(intel_encoder);
+ intel_connector->polled = DRM_CONNECTOR_POLL_HPD;
} else {
intel_connector->polled = DRM_CONNECTOR_POLL_CONNECT | DRM_CONNECTOR_POLL_DISCONNECT;
}
--
2.0.5
More information about the Intel-gfx
mailing list