diff options
author | Eric Anholt <eric@anholt.net> | 2010-04-02 18:24:27 -0400 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2010-04-12 12:23:30 -0400 |
commit | 6443170f6d862a1cc89e61e4bb2410b714b875f4 (patch) | |
tree | 17767306f21c95f066163d1d7df9c2a2e35bbbc9 /drivers/gpu/drm/i915/intel_sdvo.c | |
parent | 335af9a235a82842854b394507ab5e310d88be42 (diff) |
drm/i915: Remove dead KMS encoder save/restore code.
This was brought over from UMS, and used for a while until we decided
that drm_helper_resume_force_mode was easier and more reliable, since
it didn't require duplicating all the code deleted here. We just
forgot to delete all that junk for a while.
Diffstat (limited to 'drivers/gpu/drm/i915/intel_sdvo.c')
-rw-r--r-- | drivers/gpu/drm/i915/intel_sdvo.c | 161 |
1 files changed, 0 insertions, 161 deletions
diff --git a/drivers/gpu/drm/i915/intel_sdvo.c b/drivers/gpu/drm/i915/intel_sdvo.c index 097819c51a15..5534704c151a 100644 --- a/drivers/gpu/drm/i915/intel_sdvo.c +++ b/drivers/gpu/drm/i915/intel_sdvo.c | |||
@@ -129,11 +129,6 @@ struct intel_sdvo_priv { | |||
129 | /* Mac mini hack -- use the same DDC as the analog connector */ | 129 | /* Mac mini hack -- use the same DDC as the analog connector */ |
130 | struct i2c_adapter *analog_ddc_bus; | 130 | struct i2c_adapter *analog_ddc_bus; |
131 | 131 | ||
132 | int save_sdvo_mult; | ||
133 | u16 save_active_outputs; | ||
134 | struct intel_sdvo_dtd save_input_dtd_1, save_input_dtd_2; | ||
135 | struct intel_sdvo_dtd save_output_dtd[16]; | ||
136 | u32 save_SDVOX; | ||
137 | /* add the property for the SDVO-TV */ | 132 | /* add the property for the SDVO-TV */ |
138 | struct drm_property *left_property; | 133 | struct drm_property *left_property; |
139 | struct drm_property *right_property; | 134 | struct drm_property *right_property; |
@@ -562,17 +557,6 @@ static bool intel_sdvo_get_trained_inputs(struct intel_encoder *intel_encoder, b | |||
562 | return true; | 557 | return true; |
563 | } | 558 | } |
564 | 559 | ||
565 | static bool intel_sdvo_get_active_outputs(struct intel_encoder *intel_encoder, | ||
566 | u16 *outputs) | ||
567 | { | ||
568 | u8 status; | ||
569 | |||
570 | intel_sdvo_write_cmd(intel_encoder, SDVO_CMD_GET_ACTIVE_OUTPUTS, NULL, 0); | ||
571 | status = intel_sdvo_read_response(intel_encoder, outputs, sizeof(*outputs)); | ||
572 | |||
573 | return (status == SDVO_CMD_STATUS_SUCCESS); | ||
574 | } | ||
575 | |||
576 | static bool intel_sdvo_set_active_outputs(struct intel_encoder *intel_encoder, | 560 | static bool intel_sdvo_set_active_outputs(struct intel_encoder *intel_encoder, |
577 | u16 outputs) | 561 | u16 outputs) |
578 | { | 562 | { |
@@ -645,40 +629,6 @@ static bool intel_sdvo_set_target_output(struct intel_encoder *intel_encoder, | |||
645 | return (status == SDVO_CMD_STATUS_SUCCESS); | 629 | return (status == SDVO_CMD_STATUS_SUCCESS); |
646 | } | 630 | } |
647 | 631 | ||
648 | static bool intel_sdvo_get_timing(struct intel_encoder *intel_encoder, u8 cmd, | ||
649 | struct intel_sdvo_dtd *dtd) | ||
650 | { | ||
651 | u8 status; | ||
652 | |||
653 | intel_sdvo_write_cmd(intel_encoder, cmd, NULL, 0); | ||
654 | status = intel_sdvo_read_response(intel_encoder, &dtd->part1, | ||
655 | sizeof(dtd->part1)); | ||
656 | if (status != SDVO_CMD_STATUS_SUCCESS) | ||
657 | return false; | ||
658 | |||
659 | intel_sdvo_write_cmd(intel_encoder, cmd + 1, NULL, 0); | ||
660 | status = intel_sdvo_read_response(intel_encoder, &dtd->part2, | ||
661 | sizeof(dtd->part2)); | ||
662 | if (status != SDVO_CMD_STATUS_SUCCESS) | ||
663 | return false; | ||
664 | |||
665 | return true; | ||
666 | } | ||
667 | |||
668 | static bool intel_sdvo_get_input_timing(struct intel_encoder *intel_encoder, | ||
669 | struct intel_sdvo_dtd *dtd) | ||
670 | { | ||
671 | return intel_sdvo_get_timing(intel_encoder, | ||
672 | SDVO_CMD_GET_INPUT_TIMINGS_PART1, dtd); | ||
673 | } | ||
674 | |||
675 | static bool intel_sdvo_get_output_timing(struct intel_encoder *intel_encoder, | ||
676 | struct intel_sdvo_dtd *dtd) | ||
677 | { | ||
678 | return intel_sdvo_get_timing(intel_encoder, | ||
679 | SDVO_CMD_GET_OUTPUT_TIMINGS_PART1, dtd); | ||
680 | } | ||
681 | |||
682 | static bool intel_sdvo_set_timing(struct intel_encoder *intel_encoder, u8 cmd, | 632 | static bool intel_sdvo_set_timing(struct intel_encoder *intel_encoder, u8 cmd, |
683 | struct intel_sdvo_dtd *dtd) | 633 | struct intel_sdvo_dtd *dtd) |
684 | { | 634 | { |
@@ -766,23 +716,6 @@ static bool intel_sdvo_get_preferred_input_timing(struct intel_encoder *intel_en | |||
766 | return false; | 716 | return false; |
767 | } | 717 | } |
768 | 718 | ||
769 | static int intel_sdvo_get_clock_rate_mult(struct intel_encoder *intel_encoder) | ||
770 | { | ||
771 | u8 response, status; | ||
772 | |||
773 | intel_sdvo_write_cmd(intel_encoder, SDVO_CMD_GET_CLOCK_RATE_MULT, NULL, 0); | ||
774 | status = intel_sdvo_read_response(intel_encoder, &response, 1); | ||
775 | |||
776 | if (status != SDVO_CMD_STATUS_SUCCESS) { | ||
777 | DRM_DEBUG_KMS("Couldn't get SDVO clock rate multiplier\n"); | ||
778 | return SDVO_CLOCK_RATE_MULT_1X; | ||
779 | } else { | ||
780 | DRM_DEBUG_KMS("Current clock rate multiplier: %d\n", response); | ||
781 | } | ||
782 | |||
783 | return response; | ||
784 | } | ||
785 | |||
786 | static bool intel_sdvo_set_clock_rate_mult(struct intel_encoder *intel_encoder, u8 val) | 719 | static bool intel_sdvo_set_clock_rate_mult(struct intel_encoder *intel_encoder, u8 val) |
787 | { | 720 | { |
788 | u8 status; | 721 | u8 status; |
@@ -1356,98 +1289,6 @@ static void intel_sdvo_dpms(struct drm_encoder *encoder, int mode) | |||
1356 | return; | 1289 | return; |
1357 | } | 1290 | } |
1358 | 1291 | ||
1359 | static void intel_sdvo_save(struct drm_connector *connector) | ||
1360 | { | ||
1361 | struct drm_device *dev = connector->dev; | ||
1362 | struct drm_i915_private *dev_priv = dev->dev_private; | ||
1363 | struct intel_encoder *intel_encoder = to_intel_encoder(connector); | ||
1364 | struct intel_sdvo_priv *sdvo_priv = intel_encoder->dev_priv; | ||
1365 | int o; | ||
1366 | |||
1367 | sdvo_priv->save_sdvo_mult = intel_sdvo_get_clock_rate_mult(intel_encoder); | ||
1368 | intel_sdvo_get_active_outputs(intel_encoder, &sdvo_priv->save_active_outputs); | ||
1369 | |||
1370 | if (sdvo_priv->caps.sdvo_inputs_mask & 0x1) { | ||
1371 | intel_sdvo_set_target_input(intel_encoder, true, false); | ||
1372 | intel_sdvo_get_input_timing(intel_encoder, | ||
1373 | &sdvo_priv->save_input_dtd_1); | ||
1374 | } | ||
1375 | |||
1376 | if (sdvo_priv->caps.sdvo_inputs_mask & 0x2) { | ||
1377 | intel_sdvo_set_target_input(intel_encoder, false, true); | ||
1378 | intel_sdvo_get_input_timing(intel_encoder, | ||
1379 | &sdvo_priv->save_input_dtd_2); | ||
1380 | } | ||
1381 | |||
1382 | for (o = SDVO_OUTPUT_FIRST; o <= SDVO_OUTPUT_LAST; o++) | ||
1383 | { | ||
1384 | u16 this_output = (1 << o); | ||
1385 | if (sdvo_priv->caps.output_flags & this_output) | ||
1386 | { | ||
1387 | intel_sdvo_set_target_output(intel_encoder, this_output); | ||
1388 | intel_sdvo_get_output_timing(intel_encoder, | ||
1389 | &sdvo_priv->save_output_dtd[o]); | ||
1390 | } | ||
1391 | } | ||
1392 | if (sdvo_priv->is_tv) { | ||
1393 | /* XXX: Save TV format/enhancements. */ | ||
1394 | } | ||
1395 | |||
1396 | sdvo_priv->save_SDVOX = I915_READ(sdvo_priv->sdvo_reg); | ||
1397 | } | ||
1398 | |||
1399 | static void intel_sdvo_restore(struct drm_connector *connector) | ||
1400 | { | ||
1401 | struct drm_device *dev = connector->dev; | ||
1402 | struct intel_encoder *intel_encoder = to_intel_encoder(connector); | ||
1403 | struct intel_sdvo_priv *sdvo_priv = intel_encoder->dev_priv; | ||
1404 | int o; | ||
1405 | int i; | ||
1406 | bool input1, input2; | ||
1407 | u8 status; | ||
1408 | |||
1409 | intel_sdvo_set_active_outputs(intel_encoder, 0); | ||
1410 | |||
1411 | for (o = SDVO_OUTPUT_FIRST; o <= SDVO_OUTPUT_LAST; o++) | ||
1412 | { | ||
1413 | u16 this_output = (1 << o); | ||
1414 | if (sdvo_priv->caps.output_flags & this_output) { | ||
1415 | intel_sdvo_set_target_output(intel_encoder, this_output); | ||
1416 | intel_sdvo_set_output_timing(intel_encoder, &sdvo_priv->save_output_dtd[o]); | ||
1417 | } | ||
1418 | } | ||
1419 | |||
1420 | if (sdvo_priv->caps.sdvo_inputs_mask & 0x1) { | ||
1421 | intel_sdvo_set_target_input(intel_encoder, true, false); | ||
1422 | intel_sdvo_set_input_timing(intel_encoder, &sdvo_priv->save_input_dtd_1); | ||
1423 | } | ||
1424 | |||
1425 | if (sdvo_priv->caps.sdvo_inputs_mask & 0x2) { | ||
1426 | intel_sdvo_set_target_input(intel_encoder, false, true); | ||
1427 | intel_sdvo_set_input_timing(intel_encoder, &sdvo_priv->save_input_dtd_2); | ||
1428 | } | ||
1429 | |||
1430 | intel_sdvo_set_clock_rate_mult(intel_encoder, sdvo_priv->save_sdvo_mult); | ||
1431 | |||
1432 | if (sdvo_priv->is_tv) { | ||
1433 | /* XXX: Restore TV format/enhancements. */ | ||
1434 | } | ||
1435 | |||
1436 | intel_sdvo_write_sdvox(intel_encoder, sdvo_priv->save_SDVOX); | ||
1437 | |||
1438 | if (sdvo_priv->save_SDVOX & SDVO_ENABLE) | ||
1439 | { | ||
1440 | for (i = 0; i < 2; i++) | ||
1441 | intel_wait_for_vblank(dev); | ||
1442 | status = intel_sdvo_get_trained_inputs(intel_encoder, &input1, &input2); | ||
1443 | if (status == SDVO_CMD_STATUS_SUCCESS && !input1) | ||
1444 | DRM_DEBUG_KMS("First %s output reported failure to " | ||
1445 | "sync\n", SDVO_NAME(sdvo_priv)); | ||
1446 | } | ||
1447 | |||
1448 | intel_sdvo_set_active_outputs(intel_encoder, sdvo_priv->save_active_outputs); | ||
1449 | } | ||
1450 | |||
1451 | static int intel_sdvo_mode_valid(struct drm_connector *connector, | 1292 | static int intel_sdvo_mode_valid(struct drm_connector *connector, |
1452 | struct drm_display_mode *mode) | 1293 | struct drm_display_mode *mode) |
1453 | { | 1294 | { |
@@ -2119,8 +1960,6 @@ static const struct drm_encoder_helper_funcs intel_sdvo_helper_funcs = { | |||
2119 | 1960 | ||
2120 | static const struct drm_connector_funcs intel_sdvo_connector_funcs = { | 1961 | static const struct drm_connector_funcs intel_sdvo_connector_funcs = { |
2121 | .dpms = drm_helper_connector_dpms, | 1962 | .dpms = drm_helper_connector_dpms, |
2122 | .save = intel_sdvo_save, | ||
2123 | .restore = intel_sdvo_restore, | ||
2124 | .detect = intel_sdvo_detect, | 1963 | .detect = intel_sdvo_detect, |
2125 | .fill_modes = drm_helper_probe_single_connector_modes, | 1964 | .fill_modes = drm_helper_probe_single_connector_modes, |
2126 | .set_property = intel_sdvo_set_property, | 1965 | .set_property = intel_sdvo_set_property, |