diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2010-09-14 06:07:23 -0400 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2010-09-14 06:38:48 -0400 |
commit | 930a9e283516a3a3595c0c515113f1b78d07f695 (patch) | |
tree | b527736ae76d678f8791755be28a250a6e2593bc /drivers/gpu | |
parent | a41ceb1c17af06a17c0d88e987215ef20b93c471 (diff) |
drm: Use a nondestructive mode for output detect when polling (v2)
v2: Julien Cristau pointed out that @nondestructive results in
double-negatives and confusion when trying to interpret the parameter,
so use @force instead. Much easier to type as well. ;-)
And fix the miscompilation of vmgfx reported by Sedat Dilek.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: stable@kernel.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/drm/drm_crtc_helper.c | 4 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/intel_crt.c | 5 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/intel_dp.c | 3 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/intel_dvo.c | 3 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/intel_hdmi.c | 3 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/intel_lvds.c | 5 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/intel_sdvo.c | 5 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/intel_tv.c | 5 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_connector.c | 8 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_connectors.c | 15 | ||||
-rw-r--r-- | drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c | 6 |
11 files changed, 24 insertions, 38 deletions
diff --git a/drivers/gpu/drm/drm_crtc_helper.c b/drivers/gpu/drm/drm_crtc_helper.c index fb6b70fc6572..dcbeb98f195a 100644 --- a/drivers/gpu/drm/drm_crtc_helper.c +++ b/drivers/gpu/drm/drm_crtc_helper.c | |||
@@ -103,7 +103,7 @@ int drm_helper_probe_single_connector_modes(struct drm_connector *connector, | |||
103 | if (connector->funcs->force) | 103 | if (connector->funcs->force) |
104 | connector->funcs->force(connector); | 104 | connector->funcs->force(connector); |
105 | } else { | 105 | } else { |
106 | connector->status = connector->funcs->detect(connector, false); | 106 | connector->status = connector->funcs->detect(connector, true); |
107 | drm_kms_helper_poll_enable(dev); | 107 | drm_kms_helper_poll_enable(dev); |
108 | } | 108 | } |
109 | 109 | ||
@@ -866,7 +866,7 @@ static void output_poll_execute(struct work_struct *work) | |||
866 | !(connector->polled & DRM_CONNECTOR_POLL_HPD)) | 866 | !(connector->polled & DRM_CONNECTOR_POLL_HPD)) |
867 | continue; | 867 | continue; |
868 | 868 | ||
869 | status = connector->funcs->detect(connector, true); | 869 | status = connector->funcs->detect(connector, false); |
870 | if (old_status != status) | 870 | if (old_status != status) |
871 | changed = true; | 871 | changed = true; |
872 | } | 872 | } |
diff --git a/drivers/gpu/drm/i915/intel_crt.c b/drivers/gpu/drm/i915/intel_crt.c index 0350e5d711f8..a02a8df73727 100644 --- a/drivers/gpu/drm/i915/intel_crt.c +++ b/drivers/gpu/drm/i915/intel_crt.c | |||
@@ -401,8 +401,7 @@ intel_crt_load_detect(struct drm_crtc *crtc, struct intel_encoder *intel_encoder | |||
401 | } | 401 | } |
402 | 402 | ||
403 | static enum drm_connector_status | 403 | static enum drm_connector_status |
404 | intel_crt_detect(struct drm_connector *connector, | 404 | intel_crt_detect(struct drm_connector *connector, bool force) |
405 | bool nondestructive) | ||
406 | { | 405 | { |
407 | struct drm_device *dev = connector->dev; | 406 | struct drm_device *dev = connector->dev; |
408 | struct drm_encoder *encoder = intel_attached_encoder(connector); | 407 | struct drm_encoder *encoder = intel_attached_encoder(connector); |
@@ -421,7 +420,7 @@ intel_crt_detect(struct drm_connector *connector, | |||
421 | if (intel_crt_detect_ddc(encoder)) | 420 | if (intel_crt_detect_ddc(encoder)) |
422 | return connector_status_connected; | 421 | return connector_status_connected; |
423 | 422 | ||
424 | if (nondestructive) | 423 | if (!force) |
425 | return connector->status; | 424 | return connector->status; |
426 | 425 | ||
427 | /* for pre-945g platforms use load detect */ | 426 | /* for pre-945g platforms use load detect */ |
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c index e1a2a05fb838..1a51ee07de3e 100644 --- a/drivers/gpu/drm/i915/intel_dp.c +++ b/drivers/gpu/drm/i915/intel_dp.c | |||
@@ -1386,8 +1386,7 @@ ironlake_dp_detect(struct drm_connector *connector) | |||
1386 | * \return false if DP port is disconnected. | 1386 | * \return false if DP port is disconnected. |
1387 | */ | 1387 | */ |
1388 | static enum drm_connector_status | 1388 | static enum drm_connector_status |
1389 | intel_dp_detect(struct drm_connector *connector, | 1389 | intel_dp_detect(struct drm_connector *connector, bool force) |
1390 | bool nondestructive) | ||
1391 | { | 1390 | { |
1392 | struct drm_encoder *encoder = intel_attached_encoder(connector); | 1391 | struct drm_encoder *encoder = intel_attached_encoder(connector); |
1393 | struct intel_dp *intel_dp = enc_to_intel_dp(encoder); | 1392 | struct intel_dp *intel_dp = enc_to_intel_dp(encoder); |
diff --git a/drivers/gpu/drm/i915/intel_dvo.c b/drivers/gpu/drm/i915/intel_dvo.c index f0de1addf8a4..7c9ec1472d46 100644 --- a/drivers/gpu/drm/i915/intel_dvo.c +++ b/drivers/gpu/drm/i915/intel_dvo.c | |||
@@ -222,8 +222,7 @@ static void intel_dvo_mode_set(struct drm_encoder *encoder, | |||
222 | * Unimplemented. | 222 | * Unimplemented. |
223 | */ | 223 | */ |
224 | static enum drm_connector_status | 224 | static enum drm_connector_status |
225 | intel_dvo_detect(struct drm_connector *connector, | 225 | intel_dvo_detect(struct drm_connector *connector, bool force) |
226 | bool nondestructive) | ||
227 | { | 226 | { |
228 | struct drm_encoder *encoder = intel_attached_encoder(connector); | 227 | struct drm_encoder *encoder = intel_attached_encoder(connector); |
229 | struct intel_dvo *intel_dvo = enc_to_intel_dvo(encoder); | 228 | struct intel_dvo *intel_dvo = enc_to_intel_dvo(encoder); |
diff --git a/drivers/gpu/drm/i915/intel_hdmi.c b/drivers/gpu/drm/i915/intel_hdmi.c index 2ea123d8d22b..926934a482ec 100644 --- a/drivers/gpu/drm/i915/intel_hdmi.c +++ b/drivers/gpu/drm/i915/intel_hdmi.c | |||
@@ -139,8 +139,7 @@ static bool intel_hdmi_mode_fixup(struct drm_encoder *encoder, | |||
139 | } | 139 | } |
140 | 140 | ||
141 | static enum drm_connector_status | 141 | static enum drm_connector_status |
142 | intel_hdmi_detect(struct drm_connector *connector, | 142 | intel_hdmi_detect(struct drm_connector *connector, bool force) |
143 | bool nondestructive) | ||
144 | { | 143 | { |
145 | struct drm_encoder *encoder = intel_attached_encoder(connector); | 144 | struct drm_encoder *encoder = intel_attached_encoder(connector); |
146 | struct intel_hdmi *intel_hdmi = enc_to_intel_hdmi(encoder); | 145 | struct intel_hdmi *intel_hdmi = enc_to_intel_hdmi(encoder); |
diff --git a/drivers/gpu/drm/i915/intel_lvds.c b/drivers/gpu/drm/i915/intel_lvds.c index fb1bed8f4071..6ec39a86ed06 100644 --- a/drivers/gpu/drm/i915/intel_lvds.c +++ b/drivers/gpu/drm/i915/intel_lvds.c | |||
@@ -446,8 +446,7 @@ static void intel_lvds_mode_set(struct drm_encoder *encoder, | |||
446 | * needed, using lid status notification from the input layer. | 446 | * needed, using lid status notification from the input layer. |
447 | */ | 447 | */ |
448 | static enum drm_connector_status | 448 | static enum drm_connector_status |
449 | intel_lvds_detect(struct drm_connector *connector, | 449 | intel_lvds_detect(struct drm_connector *connector, bool force) |
450 | bool nondestructive) | ||
451 | { | 450 | { |
452 | struct drm_device *dev = connector->dev; | 451 | struct drm_device *dev = connector->dev; |
453 | enum drm_connector_status status = connector_status_connected; | 452 | enum drm_connector_status status = connector_status_connected; |
@@ -543,7 +542,7 @@ static int intel_lid_notify(struct notifier_block *nb, unsigned long val, | |||
543 | */ | 542 | */ |
544 | if (connector) | 543 | if (connector) |
545 | connector->status = connector->funcs->detect(connector, | 544 | connector->status = connector->funcs->detect(connector, |
546 | true); | 545 | false); |
547 | 546 | ||
548 | /* Don't force modeset on machines where it causes a GPU lockup */ | 547 | /* Don't force modeset on machines where it causes a GPU lockup */ |
549 | if (dmi_check_system(intel_no_modeset_on_lid)) | 548 | if (dmi_check_system(intel_no_modeset_on_lid)) |
diff --git a/drivers/gpu/drm/i915/intel_sdvo.c b/drivers/gpu/drm/i915/intel_sdvo.c index db6b6d4b8fae..e8e902d614ed 100644 --- a/drivers/gpu/drm/i915/intel_sdvo.c +++ b/drivers/gpu/drm/i915/intel_sdvo.c | |||
@@ -1417,7 +1417,7 @@ intel_analog_is_connected(struct drm_device *dev) | |||
1417 | if (!analog_connector) | 1417 | if (!analog_connector) |
1418 | return false; | 1418 | return false; |
1419 | 1419 | ||
1420 | if (analog_connector->funcs->detect(analog_connector, true) == | 1420 | if (analog_connector->funcs->detect(analog_connector, false) == |
1421 | connector_status_disconnected) | 1421 | connector_status_disconnected) |
1422 | return false; | 1422 | return false; |
1423 | 1423 | ||
@@ -1487,8 +1487,7 @@ intel_sdvo_hdmi_sink_detect(struct drm_connector *connector) | |||
1487 | } | 1487 | } |
1488 | 1488 | ||
1489 | static enum drm_connector_status | 1489 | static enum drm_connector_status |
1490 | intel_sdvo_detect(struct drm_connector *connector, | 1490 | intel_sdvo_detect(struct drm_connector *connector, bool force) |
1491 | bool nondestructive) | ||
1492 | { | 1491 | { |
1493 | uint16_t response; | 1492 | uint16_t response; |
1494 | struct drm_encoder *encoder = intel_attached_encoder(connector); | 1493 | struct drm_encoder *encoder = intel_attached_encoder(connector); |
diff --git a/drivers/gpu/drm/i915/intel_tv.c b/drivers/gpu/drm/i915/intel_tv.c index d20b550c0f55..4a117e318a73 100644 --- a/drivers/gpu/drm/i915/intel_tv.c +++ b/drivers/gpu/drm/i915/intel_tv.c | |||
@@ -1341,8 +1341,7 @@ static void intel_tv_find_better_format(struct drm_connector *connector) | |||
1341 | * we have a pipe programmed in order to probe the TV. | 1341 | * we have a pipe programmed in order to probe the TV. |
1342 | */ | 1342 | */ |
1343 | static enum drm_connector_status | 1343 | static enum drm_connector_status |
1344 | intel_tv_detect(struct drm_connector *connector, | 1344 | intel_tv_detect(struct drm_connector *connector, bool force) |
1345 | bool nondestructive) | ||
1346 | { | 1345 | { |
1347 | struct drm_display_mode mode; | 1346 | struct drm_display_mode mode; |
1348 | struct drm_encoder *encoder = intel_attached_encoder(connector); | 1347 | struct drm_encoder *encoder = intel_attached_encoder(connector); |
@@ -1354,7 +1353,7 @@ intel_tv_detect(struct drm_connector *connector, | |||
1354 | 1353 | ||
1355 | if (encoder->crtc && encoder->crtc->enabled) { | 1354 | if (encoder->crtc && encoder->crtc->enabled) { |
1356 | type = intel_tv_detect_type(intel_tv); | 1355 | type = intel_tv_detect_type(intel_tv); |
1357 | } else if (nondestructive) { | 1356 | } else if (force) { |
1358 | struct drm_crtc *crtc; | 1357 | struct drm_crtc *crtc; |
1359 | int dpms_mode; | 1358 | int dpms_mode; |
1360 | 1359 | ||
diff --git a/drivers/gpu/drm/nouveau/nouveau_connector.c b/drivers/gpu/drm/nouveau/nouveau_connector.c index 67d515cb67e0..87186a4bbf03 100644 --- a/drivers/gpu/drm/nouveau/nouveau_connector.c +++ b/drivers/gpu/drm/nouveau/nouveau_connector.c | |||
@@ -168,8 +168,7 @@ nouveau_connector_set_encoder(struct drm_connector *connector, | |||
168 | } | 168 | } |
169 | 169 | ||
170 | static enum drm_connector_status | 170 | static enum drm_connector_status |
171 | nouveau_connector_detect(struct drm_connector *connector, | 171 | nouveau_connector_detect(struct drm_connector *connector, bool force) |
172 | bool nondestructive) | ||
173 | { | 172 | { |
174 | struct drm_device *dev = connector->dev; | 173 | struct drm_device *dev = connector->dev; |
175 | struct nouveau_connector *nv_connector = nouveau_connector(connector); | 174 | struct nouveau_connector *nv_connector = nouveau_connector(connector); |
@@ -247,8 +246,7 @@ detect_analog: | |||
247 | } | 246 | } |
248 | 247 | ||
249 | static enum drm_connector_status | 248 | static enum drm_connector_status |
250 | nouveau_connector_detect_lvds(struct drm_connector *connector, | 249 | nouveau_connector_detect_lvds(struct drm_connector *connector, bool force) |
251 | bool nondestructive) | ||
252 | { | 250 | { |
253 | struct drm_device *dev = connector->dev; | 251 | struct drm_device *dev = connector->dev; |
254 | struct drm_nouveau_private *dev_priv = dev->dev_private; | 252 | struct drm_nouveau_private *dev_priv = dev->dev_private; |
@@ -269,7 +267,7 @@ nouveau_connector_detect_lvds(struct drm_connector *connector, | |||
269 | 267 | ||
270 | /* Try retrieving EDID via DDC */ | 268 | /* Try retrieving EDID via DDC */ |
271 | if (!dev_priv->vbios.fp_no_ddc) { | 269 | if (!dev_priv->vbios.fp_no_ddc) { |
272 | status = nouveau_connector_detect(connector, nondestructive); | 270 | status = nouveau_connector_detect(connector, force); |
273 | if (status == connector_status_connected) | 271 | if (status == connector_status_connected) |
274 | goto out; | 272 | goto out; |
275 | } | 273 | } |
diff --git a/drivers/gpu/drm/radeon/radeon_connectors.c b/drivers/gpu/drm/radeon/radeon_connectors.c index 31d309a8e75b..ecc1a8fafbfd 100644 --- a/drivers/gpu/drm/radeon/radeon_connectors.c +++ b/drivers/gpu/drm/radeon/radeon_connectors.c | |||
@@ -482,8 +482,7 @@ static int radeon_lvds_mode_valid(struct drm_connector *connector, | |||
482 | } | 482 | } |
483 | 483 | ||
484 | static enum drm_connector_status | 484 | static enum drm_connector_status |
485 | radeon_lvds_detect(struct drm_connector *connector, | 485 | radeon_lvds_detect(struct drm_connector *connector, bool force) |
486 | bool nondestructive) | ||
487 | { | 486 | { |
488 | struct radeon_connector *radeon_connector = to_radeon_connector(connector); | 487 | struct radeon_connector *radeon_connector = to_radeon_connector(connector); |
489 | struct drm_encoder *encoder = radeon_best_single_encoder(connector); | 488 | struct drm_encoder *encoder = radeon_best_single_encoder(connector); |
@@ -597,8 +596,7 @@ static int radeon_vga_mode_valid(struct drm_connector *connector, | |||
597 | } | 596 | } |
598 | 597 | ||
599 | static enum drm_connector_status | 598 | static enum drm_connector_status |
600 | radeon_vga_detect(struct drm_connector *connector, | 599 | radeon_vga_detect(struct drm_connector *connector, bool force) |
601 | bool nondestructive) | ||
602 | { | 600 | { |
603 | struct radeon_connector *radeon_connector = to_radeon_connector(connector); | 601 | struct radeon_connector *radeon_connector = to_radeon_connector(connector); |
604 | struct drm_encoder *encoder; | 602 | struct drm_encoder *encoder; |
@@ -696,8 +694,7 @@ static int radeon_tv_mode_valid(struct drm_connector *connector, | |||
696 | } | 694 | } |
697 | 695 | ||
698 | static enum drm_connector_status | 696 | static enum drm_connector_status |
699 | radeon_tv_detect(struct drm_connector *connector, | 697 | radeon_tv_detect(struct drm_connector *connector, bool force) |
700 | bool nondestructive) | ||
701 | { | 698 | { |
702 | struct drm_encoder *encoder; | 699 | struct drm_encoder *encoder; |
703 | struct drm_encoder_helper_funcs *encoder_funcs; | 700 | struct drm_encoder_helper_funcs *encoder_funcs; |
@@ -755,8 +752,7 @@ static int radeon_dvi_get_modes(struct drm_connector *connector) | |||
755 | * if its shared we have to set the other connector to disconnected. | 752 | * if its shared we have to set the other connector to disconnected. |
756 | */ | 753 | */ |
757 | static enum drm_connector_status | 754 | static enum drm_connector_status |
758 | radeon_dvi_detect(struct drm_connector *connector, | 755 | radeon_dvi_detect(struct drm_connector *connector, bool force) |
759 | bool nondestructive) | ||
760 | { | 756 | { |
761 | struct radeon_connector *radeon_connector = to_radeon_connector(connector); | 757 | struct radeon_connector *radeon_connector = to_radeon_connector(connector); |
762 | struct drm_encoder *encoder = NULL; | 758 | struct drm_encoder *encoder = NULL; |
@@ -981,8 +977,7 @@ static int radeon_dp_get_modes(struct drm_connector *connector) | |||
981 | } | 977 | } |
982 | 978 | ||
983 | static enum drm_connector_status | 979 | static enum drm_connector_status |
984 | radeon_dp_detect(struct drm_connector *connector, | 980 | radeon_dp_detect(struct drm_connector *connector, bool force) |
985 | bool nondestructive) | ||
986 | { | 981 | { |
987 | struct radeon_connector *radeon_connector = to_radeon_connector(connector); | 982 | struct radeon_connector *radeon_connector = to_radeon_connector(connector); |
988 | enum drm_connector_status ret = connector_status_disconnected; | 983 | enum drm_connector_status ret = connector_status_disconnected; |
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c b/drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c index a527c91c0ba6..7083b1a24df3 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c | |||
@@ -336,7 +336,7 @@ static void vmw_ldu_connector_restore(struct drm_connector *connector) | |||
336 | 336 | ||
337 | static enum drm_connector_status | 337 | static enum drm_connector_status |
338 | vmw_ldu_connector_detect(struct drm_connector *connector, | 338 | vmw_ldu_connector_detect(struct drm_connector *connector, |
339 | bool nondestructive) | 339 | bool force) |
340 | { | 340 | { |
341 | if (vmw_connector_to_ldu(connector)->pref_active) | 341 | if (vmw_connector_to_ldu(connector)->pref_active) |
342 | return connector_status_connected; | 342 | return connector_status_connected; |
@@ -517,7 +517,7 @@ static int vmw_ldu_init(struct vmw_private *dev_priv, unsigned unit) | |||
517 | 517 | ||
518 | drm_connector_init(dev, connector, &vmw_legacy_connector_funcs, | 518 | drm_connector_init(dev, connector, &vmw_legacy_connector_funcs, |
519 | DRM_MODE_CONNECTOR_LVDS); | 519 | DRM_MODE_CONNECTOR_LVDS); |
520 | connector->status = vmw_ldu_connector_detect(connector); | 520 | connector->status = vmw_ldu_connector_detect(connector, true); |
521 | 521 | ||
522 | drm_encoder_init(dev, encoder, &vmw_legacy_encoder_funcs, | 522 | drm_encoder_init(dev, encoder, &vmw_legacy_encoder_funcs, |
523 | DRM_MODE_ENCODER_LVDS); | 523 | DRM_MODE_ENCODER_LVDS); |
@@ -611,7 +611,7 @@ int vmw_kms_ldu_update_layout(struct vmw_private *dev_priv, unsigned num, | |||
611 | ldu->pref_height = 600; | 611 | ldu->pref_height = 600; |
612 | ldu->pref_active = false; | 612 | ldu->pref_active = false; |
613 | } | 613 | } |
614 | con->status = vmw_ldu_connector_detect(con); | 614 | con->status = vmw_ldu_connector_detect(con, true); |
615 | } | 615 | } |
616 | 616 | ||
617 | mutex_unlock(&dev->mode_config.mutex); | 617 | mutex_unlock(&dev->mode_config.mutex); |