diff options
Diffstat (limited to 'drivers/gpu/drm/i915/intel_sdvo.c')
-rw-r--r-- | drivers/gpu/drm/i915/intel_sdvo.c | 56 |
1 files changed, 25 insertions, 31 deletions
diff --git a/drivers/gpu/drm/i915/intel_sdvo.c b/drivers/gpu/drm/i915/intel_sdvo.c index 701372e512a8..5805ec1aba12 100644 --- a/drivers/gpu/drm/i915/intel_sdvo.c +++ b/drivers/gpu/drm/i915/intel_sdvo.c | |||
@@ -105,11 +105,6 @@ struct intel_sdvo { | |||
105 | bool has_hdmi_audio; | 105 | bool has_hdmi_audio; |
106 | bool rgb_quant_range_selectable; | 106 | bool rgb_quant_range_selectable; |
107 | 107 | ||
108 | /** | ||
109 | * This is sdvo fixed pannel mode pointer | ||
110 | */ | ||
111 | struct drm_display_mode *sdvo_lvds_fixed_mode; | ||
112 | |||
113 | /* DDC bus used by this SDVO encoder */ | 108 | /* DDC bus used by this SDVO encoder */ |
114 | uint8_t ddc_bus; | 109 | uint8_t ddc_bus; |
115 | 110 | ||
@@ -765,10 +760,14 @@ intel_sdvo_create_preferred_input_timing(struct intel_sdvo *intel_sdvo, | |||
765 | args.height = height; | 760 | args.height = height; |
766 | args.interlace = 0; | 761 | args.interlace = 0; |
767 | 762 | ||
768 | if (IS_LVDS(intel_sdvo_connector) && | 763 | if (IS_LVDS(intel_sdvo_connector)) { |
769 | (intel_sdvo->sdvo_lvds_fixed_mode->hdisplay != width || | 764 | const struct drm_display_mode *fixed_mode = |
770 | intel_sdvo->sdvo_lvds_fixed_mode->vdisplay != height)) | 765 | intel_sdvo_connector->base.panel.fixed_mode; |
771 | args.scaled = 1; | 766 | |
767 | if (fixed_mode->hdisplay != width || | ||
768 | fixed_mode->vdisplay != height) | ||
769 | args.scaled = 1; | ||
770 | } | ||
772 | 771 | ||
773 | return intel_sdvo_set_value(intel_sdvo, | 772 | return intel_sdvo_set_value(intel_sdvo, |
774 | SDVO_CMD_CREATE_PREFERRED_INPUT_TIMING, | 773 | SDVO_CMD_CREATE_PREFERRED_INPUT_TIMING, |
@@ -1123,6 +1122,7 @@ static bool intel_sdvo_compute_config(struct intel_encoder *encoder, | |||
1123 | 1122 | ||
1124 | DRM_DEBUG_KMS("forcing bpc to 8 for SDVO\n"); | 1123 | DRM_DEBUG_KMS("forcing bpc to 8 for SDVO\n"); |
1125 | pipe_config->pipe_bpp = 8*3; | 1124 | pipe_config->pipe_bpp = 8*3; |
1125 | pipe_config->output_format = INTEL_OUTPUT_FORMAT_RGB; | ||
1126 | 1126 | ||
1127 | if (HAS_PCH_SPLIT(to_i915(encoder->base.dev))) | 1127 | if (HAS_PCH_SPLIT(to_i915(encoder->base.dev))) |
1128 | pipe_config->has_pch_encoder = true; | 1128 | pipe_config->has_pch_encoder = true; |
@@ -1144,7 +1144,7 @@ static bool intel_sdvo_compute_config(struct intel_encoder *encoder, | |||
1144 | pipe_config->sdvo_tv_clock = true; | 1144 | pipe_config->sdvo_tv_clock = true; |
1145 | } else if (IS_LVDS(intel_sdvo_connector)) { | 1145 | } else if (IS_LVDS(intel_sdvo_connector)) { |
1146 | if (!intel_sdvo_set_output_timings_from_mode(intel_sdvo, | 1146 | if (!intel_sdvo_set_output_timings_from_mode(intel_sdvo, |
1147 | intel_sdvo->sdvo_lvds_fixed_mode)) | 1147 | intel_sdvo_connector->base.panel.fixed_mode)) |
1148 | return false; | 1148 | return false; |
1149 | 1149 | ||
1150 | (void) intel_sdvo_get_preferred_input_mode(intel_sdvo, | 1150 | (void) intel_sdvo_get_preferred_input_mode(intel_sdvo, |
@@ -1301,7 +1301,7 @@ static void intel_sdvo_pre_enable(struct intel_encoder *intel_encoder, | |||
1301 | /* lvds has a special fixed output timing. */ | 1301 | /* lvds has a special fixed output timing. */ |
1302 | if (IS_LVDS(intel_sdvo_connector)) | 1302 | if (IS_LVDS(intel_sdvo_connector)) |
1303 | intel_sdvo_get_dtd_from_mode(&output_dtd, | 1303 | intel_sdvo_get_dtd_from_mode(&output_dtd, |
1304 | intel_sdvo->sdvo_lvds_fixed_mode); | 1304 | intel_sdvo_connector->base.panel.fixed_mode); |
1305 | else | 1305 | else |
1306 | intel_sdvo_get_dtd_from_mode(&output_dtd, mode); | 1306 | intel_sdvo_get_dtd_from_mode(&output_dtd, mode); |
1307 | if (!intel_sdvo_set_output_timing(intel_sdvo, &output_dtd)) | 1307 | if (!intel_sdvo_set_output_timing(intel_sdvo, &output_dtd)) |
@@ -1642,10 +1642,13 @@ intel_sdvo_mode_valid(struct drm_connector *connector, | |||
1642 | return MODE_CLOCK_HIGH; | 1642 | return MODE_CLOCK_HIGH; |
1643 | 1643 | ||
1644 | if (IS_LVDS(intel_sdvo_connector)) { | 1644 | if (IS_LVDS(intel_sdvo_connector)) { |
1645 | if (mode->hdisplay > intel_sdvo->sdvo_lvds_fixed_mode->hdisplay) | 1645 | const struct drm_display_mode *fixed_mode = |
1646 | intel_sdvo_connector->base.panel.fixed_mode; | ||
1647 | |||
1648 | if (mode->hdisplay > fixed_mode->hdisplay) | ||
1646 | return MODE_PANEL; | 1649 | return MODE_PANEL; |
1647 | 1650 | ||
1648 | if (mode->vdisplay > intel_sdvo->sdvo_lvds_fixed_mode->vdisplay) | 1651 | if (mode->vdisplay > fixed_mode->vdisplay) |
1649 | return MODE_PANEL; | 1652 | return MODE_PANEL; |
1650 | } | 1653 | } |
1651 | 1654 | ||
@@ -2058,14 +2061,6 @@ static int intel_sdvo_get_modes(struct drm_connector *connector) | |||
2058 | return !list_empty(&connector->probed_modes); | 2061 | return !list_empty(&connector->probed_modes); |
2059 | } | 2062 | } |
2060 | 2063 | ||
2061 | static void intel_sdvo_destroy(struct drm_connector *connector) | ||
2062 | { | ||
2063 | struct intel_sdvo_connector *intel_sdvo_connector = to_intel_sdvo_connector(connector); | ||
2064 | |||
2065 | drm_connector_cleanup(connector); | ||
2066 | kfree(intel_sdvo_connector); | ||
2067 | } | ||
2068 | |||
2069 | static int | 2064 | static int |
2070 | intel_sdvo_connector_atomic_get_property(struct drm_connector *connector, | 2065 | intel_sdvo_connector_atomic_get_property(struct drm_connector *connector, |
2071 | const struct drm_connector_state *state, | 2066 | const struct drm_connector_state *state, |
@@ -2228,7 +2223,7 @@ static const struct drm_connector_funcs intel_sdvo_connector_funcs = { | |||
2228 | .atomic_set_property = intel_sdvo_connector_atomic_set_property, | 2223 | .atomic_set_property = intel_sdvo_connector_atomic_set_property, |
2229 | .late_register = intel_sdvo_connector_register, | 2224 | .late_register = intel_sdvo_connector_register, |
2230 | .early_unregister = intel_sdvo_connector_unregister, | 2225 | .early_unregister = intel_sdvo_connector_unregister, |
2231 | .destroy = intel_sdvo_destroy, | 2226 | .destroy = intel_connector_destroy, |
2232 | .atomic_destroy_state = drm_atomic_helper_connector_destroy_state, | 2227 | .atomic_destroy_state = drm_atomic_helper_connector_destroy_state, |
2233 | .atomic_duplicate_state = intel_sdvo_connector_duplicate_state, | 2228 | .atomic_duplicate_state = intel_sdvo_connector_duplicate_state, |
2234 | }; | 2229 | }; |
@@ -2267,10 +2262,6 @@ static void intel_sdvo_enc_destroy(struct drm_encoder *encoder) | |||
2267 | { | 2262 | { |
2268 | struct intel_sdvo *intel_sdvo = to_sdvo(to_intel_encoder(encoder)); | 2263 | struct intel_sdvo *intel_sdvo = to_sdvo(to_intel_encoder(encoder)); |
2269 | 2264 | ||
2270 | if (intel_sdvo->sdvo_lvds_fixed_mode != NULL) | ||
2271 | drm_mode_destroy(encoder->dev, | ||
2272 | intel_sdvo->sdvo_lvds_fixed_mode); | ||
2273 | |||
2274 | i2c_del_adapter(&intel_sdvo->ddc); | 2265 | i2c_del_adapter(&intel_sdvo->ddc); |
2275 | intel_encoder_destroy(encoder); | 2266 | intel_encoder_destroy(encoder); |
2276 | } | 2267 | } |
@@ -2583,7 +2574,7 @@ intel_sdvo_tv_init(struct intel_sdvo *intel_sdvo, int type) | |||
2583 | return true; | 2574 | return true; |
2584 | 2575 | ||
2585 | err: | 2576 | err: |
2586 | intel_sdvo_destroy(connector); | 2577 | intel_connector_destroy(connector); |
2587 | return false; | 2578 | return false; |
2588 | } | 2579 | } |
2589 | 2580 | ||
@@ -2663,19 +2654,22 @@ intel_sdvo_lvds_init(struct intel_sdvo *intel_sdvo, int device) | |||
2663 | 2654 | ||
2664 | list_for_each_entry(mode, &connector->probed_modes, head) { | 2655 | list_for_each_entry(mode, &connector->probed_modes, head) { |
2665 | if (mode->type & DRM_MODE_TYPE_PREFERRED) { | 2656 | if (mode->type & DRM_MODE_TYPE_PREFERRED) { |
2666 | intel_sdvo->sdvo_lvds_fixed_mode = | 2657 | struct drm_display_mode *fixed_mode = |
2667 | drm_mode_duplicate(connector->dev, mode); | 2658 | drm_mode_duplicate(connector->dev, mode); |
2659 | |||
2660 | intel_panel_init(&intel_connector->panel, | ||
2661 | fixed_mode, NULL); | ||
2668 | break; | 2662 | break; |
2669 | } | 2663 | } |
2670 | } | 2664 | } |
2671 | 2665 | ||
2672 | if (!intel_sdvo->sdvo_lvds_fixed_mode) | 2666 | if (!intel_connector->panel.fixed_mode) |
2673 | goto err; | 2667 | goto err; |
2674 | 2668 | ||
2675 | return true; | 2669 | return true; |
2676 | 2670 | ||
2677 | err: | 2671 | err: |
2678 | intel_sdvo_destroy(connector); | 2672 | intel_connector_destroy(connector); |
2679 | return false; | 2673 | return false; |
2680 | } | 2674 | } |
2681 | 2675 | ||
@@ -2745,7 +2739,7 @@ static void intel_sdvo_output_cleanup(struct intel_sdvo *intel_sdvo) | |||
2745 | &dev->mode_config.connector_list, head) { | 2739 | &dev->mode_config.connector_list, head) { |
2746 | if (intel_attached_encoder(connector) == &intel_sdvo->base) { | 2740 | if (intel_attached_encoder(connector) == &intel_sdvo->base) { |
2747 | drm_connector_unregister(connector); | 2741 | drm_connector_unregister(connector); |
2748 | intel_sdvo_destroy(connector); | 2742 | intel_connector_destroy(connector); |
2749 | } | 2743 | } |
2750 | } | 2744 | } |
2751 | } | 2745 | } |