diff options
Diffstat (limited to 'drivers/gpu/drm/i915/intel_lvds.c')
-rw-r--r-- | drivers/gpu/drm/i915/intel_lvds.c | 35 |
1 files changed, 21 insertions, 14 deletions
diff --git a/drivers/gpu/drm/i915/intel_lvds.c b/drivers/gpu/drm/i915/intel_lvds.c index f1a649990ea9..f79327fc6653 100644 --- a/drivers/gpu/drm/i915/intel_lvds.c +++ b/drivers/gpu/drm/i915/intel_lvds.c | |||
@@ -481,11 +481,8 @@ static int intel_lvds_get_modes(struct drm_connector *connector) | |||
481 | struct drm_device *dev = connector->dev; | 481 | struct drm_device *dev = connector->dev; |
482 | struct drm_display_mode *mode; | 482 | struct drm_display_mode *mode; |
483 | 483 | ||
484 | if (intel_lvds->edid) { | 484 | if (intel_lvds->edid) |
485 | drm_mode_connector_update_edid_property(connector, | ||
486 | intel_lvds->edid); | ||
487 | return drm_add_edid_modes(connector, intel_lvds->edid); | 485 | return drm_add_edid_modes(connector, intel_lvds->edid); |
488 | } | ||
489 | 486 | ||
490 | mode = drm_mode_duplicate(dev, intel_lvds->fixed_mode); | 487 | mode = drm_mode_duplicate(dev, intel_lvds->fixed_mode); |
491 | if (mode == 0) | 488 | if (mode == 0) |
@@ -840,7 +837,7 @@ static bool intel_lvds_ddc_probe(struct drm_device *dev, u8 pin) | |||
840 | * Create the connector, register the LVDS DDC bus, and try to figure out what | 837 | * Create the connector, register the LVDS DDC bus, and try to figure out what |
841 | * modes we can display on the LVDS panel (if present). | 838 | * modes we can display on the LVDS panel (if present). |
842 | */ | 839 | */ |
843 | void intel_lvds_init(struct drm_device *dev) | 840 | bool intel_lvds_init(struct drm_device *dev) |
844 | { | 841 | { |
845 | struct drm_i915_private *dev_priv = dev->dev_private; | 842 | struct drm_i915_private *dev_priv = dev->dev_private; |
846 | struct intel_lvds *intel_lvds; | 843 | struct intel_lvds *intel_lvds; |
@@ -856,37 +853,37 @@ void intel_lvds_init(struct drm_device *dev) | |||
856 | 853 | ||
857 | /* Skip init on machines we know falsely report LVDS */ | 854 | /* Skip init on machines we know falsely report LVDS */ |
858 | if (dmi_check_system(intel_no_lvds)) | 855 | if (dmi_check_system(intel_no_lvds)) |
859 | return; | 856 | return false; |
860 | 857 | ||
861 | pin = GMBUS_PORT_PANEL; | 858 | pin = GMBUS_PORT_PANEL; |
862 | if (!lvds_is_present_in_vbt(dev, &pin)) { | 859 | if (!lvds_is_present_in_vbt(dev, &pin)) { |
863 | DRM_DEBUG_KMS("LVDS is not present in VBT\n"); | 860 | DRM_DEBUG_KMS("LVDS is not present in VBT\n"); |
864 | return; | 861 | return false; |
865 | } | 862 | } |
866 | 863 | ||
867 | if (HAS_PCH_SPLIT(dev)) { | 864 | if (HAS_PCH_SPLIT(dev)) { |
868 | if ((I915_READ(PCH_LVDS) & LVDS_DETECTED) == 0) | 865 | if ((I915_READ(PCH_LVDS) & LVDS_DETECTED) == 0) |
869 | return; | 866 | return false; |
870 | if (dev_priv->edp.support) { | 867 | if (dev_priv->edp.support) { |
871 | DRM_DEBUG_KMS("disable LVDS for eDP support\n"); | 868 | DRM_DEBUG_KMS("disable LVDS for eDP support\n"); |
872 | return; | 869 | return false; |
873 | } | 870 | } |
874 | } | 871 | } |
875 | 872 | ||
876 | if (!intel_lvds_ddc_probe(dev, pin)) { | 873 | if (!intel_lvds_ddc_probe(dev, pin)) { |
877 | DRM_DEBUG_KMS("LVDS did not respond to DDC probe\n"); | 874 | DRM_DEBUG_KMS("LVDS did not respond to DDC probe\n"); |
878 | return; | 875 | return false; |
879 | } | 876 | } |
880 | 877 | ||
881 | intel_lvds = kzalloc(sizeof(struct intel_lvds), GFP_KERNEL); | 878 | intel_lvds = kzalloc(sizeof(struct intel_lvds), GFP_KERNEL); |
882 | if (!intel_lvds) { | 879 | if (!intel_lvds) { |
883 | return; | 880 | return false; |
884 | } | 881 | } |
885 | 882 | ||
886 | intel_connector = kzalloc(sizeof(struct intel_connector), GFP_KERNEL); | 883 | intel_connector = kzalloc(sizeof(struct intel_connector), GFP_KERNEL); |
887 | if (!intel_connector) { | 884 | if (!intel_connector) { |
888 | kfree(intel_lvds); | 885 | kfree(intel_lvds); |
889 | return; | 886 | return false; |
890 | } | 887 | } |
891 | 888 | ||
892 | if (!HAS_PCH_SPLIT(dev)) { | 889 | if (!HAS_PCH_SPLIT(dev)) { |
@@ -939,7 +936,16 @@ void intel_lvds_init(struct drm_device *dev) | |||
939 | */ | 936 | */ |
940 | intel_lvds->edid = drm_get_edid(connector, | 937 | intel_lvds->edid = drm_get_edid(connector, |
941 | &dev_priv->gmbus[pin].adapter); | 938 | &dev_priv->gmbus[pin].adapter); |
942 | 939 | if (intel_lvds->edid) { | |
940 | if (drm_add_edid_modes(connector, | ||
941 | intel_lvds->edid)) { | ||
942 | drm_mode_connector_update_edid_property(connector, | ||
943 | intel_lvds->edid); | ||
944 | } else { | ||
945 | kfree(intel_lvds->edid); | ||
946 | intel_lvds->edid = NULL; | ||
947 | } | ||
948 | } | ||
943 | if (!intel_lvds->edid) { | 949 | if (!intel_lvds->edid) { |
944 | /* Didn't get an EDID, so | 950 | /* Didn't get an EDID, so |
945 | * Set wide sync ranges so we get all modes | 951 | * Set wide sync ranges so we get all modes |
@@ -1020,7 +1026,7 @@ out: | |||
1020 | /* keep the LVDS connector */ | 1026 | /* keep the LVDS connector */ |
1021 | dev_priv->int_lvds_connector = connector; | 1027 | dev_priv->int_lvds_connector = connector; |
1022 | drm_sysfs_connector_add(connector); | 1028 | drm_sysfs_connector_add(connector); |
1023 | return; | 1029 | return true; |
1024 | 1030 | ||
1025 | failed: | 1031 | failed: |
1026 | DRM_DEBUG_KMS("No LVDS modes found, disabling.\n"); | 1032 | DRM_DEBUG_KMS("No LVDS modes found, disabling.\n"); |
@@ -1028,4 +1034,5 @@ failed: | |||
1028 | drm_encoder_cleanup(encoder); | 1034 | drm_encoder_cleanup(encoder); |
1029 | kfree(intel_lvds); | 1035 | kfree(intel_lvds); |
1030 | kfree(intel_connector); | 1036 | kfree(intel_connector); |
1037 | return false; | ||
1031 | } | 1038 | } |