Skip to content

Commit 24e804b

Browse files
committed
drm/i915: rip out intel_dp->dpms_mode
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. Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org> Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
1 parent 84bb65b commit 24e804b

File tree

2 files changed

+2
-10
lines changed

2 files changed

+2
-10
lines changed

drivers/gpu/drm/i915/intel_dp.c

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1309,8 +1309,6 @@ static void intel_disable_dp(struct intel_encoder *encoder)
13091309
intel_dp_sink_dpms(intel_dp, DRM_MODE_DPMS_ON);
13101310
ironlake_edp_panel_off(intel_dp);
13111311
intel_dp_link_down(intel_dp);
1312-
1313-
intel_dp->dpms_mode = DRM_MODE_DPMS_OFF;
13141312
}
13151313

13161314
static void intel_enable_dp(struct intel_encoder *encoder)
@@ -1330,8 +1328,6 @@ static void intel_enable_dp(struct intel_encoder *encoder)
13301328
} else
13311329
ironlake_edp_panel_vdd_off(intel_dp, false);
13321330
ironlake_edp_backlight_on(intel_dp);
1333-
1334-
intel_dp->dpms_mode = DRM_MODE_DPMS_ON;
13351331
}
13361332

13371333
static void
@@ -1356,7 +1352,6 @@ intel_dp_dpms(struct drm_connector *connector, int mode)
13561352

13571353
if (mode != DRM_MODE_DPMS_ON) {
13581354
intel_encoder_dpms(&intel_dp->base, mode);
1359-
WARN_ON(intel_dp->dpms_mode != DRM_MODE_DPMS_OFF);
13601355

13611356
if (is_cpu_edp(intel_dp))
13621357
ironlake_edp_pll_off(&intel_dp->base.base);
@@ -1365,7 +1360,6 @@ intel_dp_dpms(struct drm_connector *connector, int mode)
13651360
ironlake_edp_pll_on(&intel_dp->base.base);
13661361

13671362
intel_encoder_dpms(&intel_dp->base, mode);
1368-
WARN_ON(intel_dp->dpms_mode != DRM_MODE_DPMS_ON);
13691363
}
13701364

13711365
intel_connector_check_state(to_intel_connector(connector));
@@ -2069,10 +2063,10 @@ intel_dp_check_link_status(struct intel_dp *intel_dp)
20692063
u8 sink_irq_vector;
20702064
u8 link_status[DP_LINK_STATUS_SIZE];
20712065

2072-
if (intel_dp->dpms_mode != DRM_MODE_DPMS_ON)
2066+
if (!intel_dp->base.connectors_active)
20732067
return;
20742068

2075-
if (!intel_dp->base.base.crtc)
2069+
if (WARN_ON(!intel_dp->base.base.crtc))
20762070
return;
20772071

20782072
/* Try to read receiver status if the link appears to be up */
@@ -2490,7 +2484,6 @@ intel_dp_init(struct drm_device *dev, int output_reg, enum port port)
24902484

24912485
intel_dp->output_reg = output_reg;
24922486
intel_dp->port = port;
2493-
intel_dp->dpms_mode = -1;
24942487

24952488
intel_connector = kzalloc(sizeof(struct intel_connector), GFP_KERNEL);
24962489
if (!intel_connector) {

drivers/gpu/drm/i915/intel_drv.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,6 @@ struct intel_dp {
324324
enum hdmi_force_audio force_audio;
325325
enum port port;
326326
uint32_t color_range;
327-
int dpms_mode;
328327
uint8_t link_bw;
329328
uint8_t lane_count;
330329
uint8_t dpcd[DP_RECEIVER_CAP_SIZE];

0 commit comments

Comments
 (0)