diff options
Diffstat (limited to 'drivers/gpu/drm/i915/intel_dp.c')
-rw-r--r-- | drivers/gpu/drm/i915/intel_dp.c | 45 |
1 files changed, 15 insertions, 30 deletions
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c index f9f2f7df6ee3..34ac746334b3 100644 --- a/drivers/gpu/drm/i915/intel_dp.c +++ b/drivers/gpu/drm/i915/intel_dp.c | |||
@@ -685,7 +685,7 @@ intel_dp_i2c_init(struct intel_dp *intel_dp, | |||
685 | return ret; | 685 | return ret; |
686 | } | 686 | } |
687 | 687 | ||
688 | static bool | 688 | bool |
689 | intel_dp_mode_fixup(struct drm_encoder *encoder, | 689 | intel_dp_mode_fixup(struct drm_encoder *encoder, |
690 | const struct drm_display_mode *mode, | 690 | const struct drm_display_mode *mode, |
691 | struct drm_display_mode *adjusted_mode) | 691 | struct drm_display_mode *adjusted_mode) |
@@ -2110,7 +2110,7 @@ intel_dp_handle_test_request(struct intel_dp *intel_dp) | |||
2110 | * 4. Check link status on receipt of hot-plug interrupt | 2110 | * 4. Check link status on receipt of hot-plug interrupt |
2111 | */ | 2111 | */ |
2112 | 2112 | ||
2113 | static void | 2113 | void |
2114 | intel_dp_check_link_status(struct intel_dp *intel_dp) | 2114 | intel_dp_check_link_status(struct intel_dp *intel_dp) |
2115 | { | 2115 | { |
2116 | struct intel_encoder *intel_encoder = &dp_to_dig_port(intel_dp)->base; | 2116 | struct intel_encoder *intel_encoder = &dp_to_dig_port(intel_dp)->base; |
@@ -2469,7 +2469,7 @@ intel_dp_destroy(struct drm_connector *connector) | |||
2469 | kfree(connector); | 2469 | kfree(connector); |
2470 | } | 2470 | } |
2471 | 2471 | ||
2472 | static void intel_dp_encoder_destroy(struct drm_encoder *encoder) | 2472 | void intel_dp_encoder_destroy(struct drm_encoder *encoder) |
2473 | { | 2473 | { |
2474 | struct intel_digital_port *intel_dig_port = enc_to_dig_port(encoder); | 2474 | struct intel_digital_port *intel_dig_port = enc_to_dig_port(encoder); |
2475 | struct intel_dp *intel_dp = &intel_dig_port->dp; | 2475 | struct intel_dp *intel_dp = &intel_dig_port->dp; |
@@ -2489,12 +2489,6 @@ static const struct drm_encoder_helper_funcs intel_dp_helper_funcs = { | |||
2489 | .disable = intel_encoder_noop, | 2489 | .disable = intel_encoder_noop, |
2490 | }; | 2490 | }; |
2491 | 2491 | ||
2492 | static const struct drm_encoder_helper_funcs intel_dp_helper_funcs_hsw = { | ||
2493 | .mode_fixup = intel_dp_mode_fixup, | ||
2494 | .mode_set = intel_ddi_mode_set, | ||
2495 | .disable = intel_encoder_noop, | ||
2496 | }; | ||
2497 | |||
2498 | static const struct drm_connector_funcs intel_dp_connector_funcs = { | 2492 | static const struct drm_connector_funcs intel_dp_connector_funcs = { |
2499 | .dpms = intel_connector_dpms, | 2493 | .dpms = intel_connector_dpms, |
2500 | .detect = intel_dp_detect, | 2494 | .detect = intel_dp_detect, |
@@ -2690,7 +2684,7 @@ intel_dp_init_panel_power_sequencer(struct drm_device *dev, | |||
2690 | I915_READ(PCH_PP_DIVISOR)); | 2684 | I915_READ(PCH_PP_DIVISOR)); |
2691 | } | 2685 | } |
2692 | 2686 | ||
2693 | static void | 2687 | void |
2694 | intel_dp_init_connector(struct intel_digital_port *intel_dig_port, | 2688 | intel_dp_init_connector(struct intel_digital_port *intel_dig_port, |
2695 | struct intel_connector *intel_connector) | 2689 | struct intel_connector *intel_connector) |
2696 | { | 2690 | { |
@@ -2723,8 +2717,11 @@ intel_dp_init_connector(struct intel_digital_port *intel_dig_port, | |||
2723 | type = DRM_MODE_CONNECTOR_eDP; | 2717 | type = DRM_MODE_CONNECTOR_eDP; |
2724 | intel_encoder->type = INTEL_OUTPUT_EDP; | 2718 | intel_encoder->type = INTEL_OUTPUT_EDP; |
2725 | } else { | 2719 | } else { |
2720 | /* The intel_encoder->type value may be INTEL_OUTPUT_UNKNOWN for | ||
2721 | * DDI or INTEL_OUTPUT_DISPLAYPORT for the older gens, so don't | ||
2722 | * rewrite it. | ||
2723 | */ | ||
2726 | type = DRM_MODE_CONNECTOR_DisplayPort; | 2724 | type = DRM_MODE_CONNECTOR_DisplayPort; |
2727 | intel_encoder->type = INTEL_OUTPUT_DISPLAYPORT; | ||
2728 | } | 2725 | } |
2729 | 2726 | ||
2730 | drm_connector_init(dev, connector, &intel_dp_connector_funcs, type); | 2727 | drm_connector_init(dev, connector, &intel_dp_connector_funcs, type); |
@@ -2869,30 +2866,18 @@ intel_dp_init(struct drm_device *dev, int output_reg, enum port port) | |||
2869 | 2866 | ||
2870 | drm_encoder_init(dev, &intel_encoder->base, &intel_dp_enc_funcs, | 2867 | drm_encoder_init(dev, &intel_encoder->base, &intel_dp_enc_funcs, |
2871 | DRM_MODE_ENCODER_TMDS); | 2868 | DRM_MODE_ENCODER_TMDS); |
2869 | drm_encoder_helper_add(&intel_encoder->base, &intel_dp_helper_funcs); | ||
2872 | 2870 | ||
2873 | if (IS_HASWELL(dev)) { | 2871 | intel_encoder->enable = intel_enable_dp; |
2874 | drm_encoder_helper_add(&intel_encoder->base, | 2872 | intel_encoder->pre_enable = intel_pre_enable_dp; |
2875 | &intel_dp_helper_funcs_hsw); | 2873 | intel_encoder->disable = intel_disable_dp; |
2876 | 2874 | intel_encoder->post_disable = intel_post_disable_dp; | |
2877 | intel_encoder->enable = intel_enable_ddi; | 2875 | intel_encoder->get_hw_state = intel_dp_get_hw_state; |
2878 | intel_encoder->pre_enable = intel_ddi_pre_enable; | ||
2879 | intel_encoder->disable = intel_disable_ddi; | ||
2880 | intel_encoder->post_disable = intel_ddi_post_disable; | ||
2881 | intel_encoder->get_hw_state = intel_ddi_get_hw_state; | ||
2882 | } else { | ||
2883 | drm_encoder_helper_add(&intel_encoder->base, | ||
2884 | &intel_dp_helper_funcs); | ||
2885 | |||
2886 | intel_encoder->enable = intel_enable_dp; | ||
2887 | intel_encoder->pre_enable = intel_pre_enable_dp; | ||
2888 | intel_encoder->disable = intel_disable_dp; | ||
2889 | intel_encoder->post_disable = intel_post_disable_dp; | ||
2890 | intel_encoder->get_hw_state = intel_dp_get_hw_state; | ||
2891 | } | ||
2892 | 2876 | ||
2893 | intel_dig_port->port = port; | 2877 | intel_dig_port->port = port; |
2894 | intel_dig_port->dp.output_reg = output_reg; | 2878 | intel_dig_port->dp.output_reg = output_reg; |
2895 | 2879 | ||
2880 | intel_encoder->type = INTEL_OUTPUT_DISPLAYPORT; | ||
2896 | intel_encoder->crtc_mask = (1 << 0) | (1 << 1) | (1 << 2); | 2881 | intel_encoder->crtc_mask = (1 << 0) | (1 << 1) | (1 << 2); |
2897 | intel_encoder->cloneable = false; | 2882 | intel_encoder->cloneable = false; |
2898 | intel_encoder->hot_plug = intel_dp_hot_plug; | 2883 | intel_encoder->hot_plug = intel_dp_hot_plug; |