[Intel-gfx] [PATCH 41/76] drm/i915: rip out intel_dp->dpms_mode

Daniel Vetter daniel.vetter at ffwll.ch
Thu Jul 26 20:49:06 CEST 2012


We now track the connector state in encoder->connectors_active, and
because the DP output can't be cloned, that is sufficient to track the
link state. Hence use this instead of adding yet another modeset state
variable with dubious semantics at driver load and resume time.

Also, connectors_active should only ever be set when the encoder is
linked to a crtc, hence convert that crtc test into a WARN.

v2: Rebase on top of struct intel_dp moving.

v3: The rebase accidentally killed the newly-introduced intel_dp->port
Noticed by Paulo Zanoni.

Signed-Off-by: Daniel Vetter <daniel.vetter at ffwll.ch>
---
 drivers/gpu/drm/i915/intel_dp.c  |   11 ++---------
 drivers/gpu/drm/i915/intel_drv.h |    1 -
 2 files changed, 2 insertions(+), 10 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index aff262e..26fdeeb 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -1307,8 +1307,6 @@ static void intel_disable_dp(struct intel_encoder *encoder)
 	intel_dp_sink_dpms(intel_dp, DRM_MODE_DPMS_ON);
 	intel_dp_link_down(intel_dp);
 	ironlake_edp_panel_vdd_off(intel_dp, false);
-
-	intel_dp->dpms_mode = DRM_MODE_DPMS_OFF;
 }
 
 static void intel_enable_dp(struct intel_encoder *encoder)
@@ -1328,8 +1326,6 @@ static void intel_enable_dp(struct intel_encoder *encoder)
 	} else
 		ironlake_edp_panel_vdd_off(intel_dp, false);
 	ironlake_edp_backlight_on(intel_dp);
-
-	intel_dp->dpms_mode = DRM_MODE_DPMS_ON;
 }
 
 static void
@@ -1354,7 +1350,6 @@ intel_dp_dpms(struct drm_connector *connector, int mode)
 
 	if (mode != DRM_MODE_DPMS_ON) {
 		intel_encoder_dpms(&intel_dp->base, mode);
-		WARN_ON(intel_dp->dpms_mode != DRM_MODE_DPMS_OFF);
 
 		if (is_cpu_edp(intel_dp))
 			ironlake_edp_pll_off(&intel_dp->base.base);
@@ -1363,7 +1358,6 @@ intel_dp_dpms(struct drm_connector *connector, int mode)
 			ironlake_edp_pll_on(&intel_dp->base.base);
 
 		intel_encoder_dpms(&intel_dp->base, mode);
-		WARN_ON(intel_dp->dpms_mode != DRM_MODE_DPMS_ON);
 	}
 
 	intel_connector_check_state(to_intel_connector(connector));
@@ -2067,10 +2061,10 @@ intel_dp_check_link_status(struct intel_dp *intel_dp)
 	u8 sink_irq_vector;
 	u8 link_status[DP_LINK_STATUS_SIZE];
 
-	if (intel_dp->dpms_mode != DRM_MODE_DPMS_ON)
+	if (!intel_dp->base.connectors_active)
 		return;
 
-	if (!intel_dp->base.base.crtc)
+	if (WARN_ON(!intel_dp->base.base.crtc))
 		return;
 
 	/* Try to read receiver status if the link appears to be up */
@@ -2488,7 +2482,6 @@ intel_dp_init(struct drm_device *dev, int output_reg, enum port port)
 
 	intel_dp->output_reg = output_reg;
 	intel_dp->port = port;
-	intel_dp->dpms_mode = -1;
 
 	intel_connector = kzalloc(sizeof(struct intel_connector), GFP_KERNEL);
 	if (!intel_connector) {
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
index 63c643a..504048d 100644
--- a/drivers/gpu/drm/i915/intel_drv.h
+++ b/drivers/gpu/drm/i915/intel_drv.h
@@ -323,7 +323,6 @@ struct intel_dp {
 	enum hdmi_force_audio force_audio;
 	enum port port;
 	uint32_t color_range;
-	int dpms_mode;
 	uint8_t link_bw;
 	uint8_t lane_count;
 	uint8_t dpcd[DP_RECEIVER_CAP_SIZE];
-- 
1.7.10.4




More information about the Intel-gfx mailing list