aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/intel_lvds.c
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2012-11-26 11:22:09 -0500
committerDaniel Vetter <daniel.vetter@ffwll.ch>2012-11-29 06:25:06 -0500
commit1974cad0ee4ce84e5cb792e49c4f0d9421e0312c (patch)
tree19c853856eea3c9dee13e9462f9e4079279ed083 /drivers/gpu/drm/i915/intel_lvds.c
parenta210b028f07690c127733addbbe137e8f4cad30c (diff)
drm/i915: move is_dual_link_lvds to intel_lvds.c
Just a prep patch to make this a property of intel_lvds. Makes more sense, removes clutter from intel_display.c and eventually I want to move all the encoder special cases wrt clock handling to encoders anyway. v2: Add an intel_ prefixe to is_dual_link_lvds since it's non-static now. Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/i915/intel_lvds.c')
-rw-r--r--drivers/gpu/drm/i915/intel_lvds.c53
1 files changed, 53 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/intel_lvds.c b/drivers/gpu/drm/i915/intel_lvds.c
index b9a660a53677..4158a8839433 100644
--- a/drivers/gpu/drm/i915/intel_lvds.c
+++ b/drivers/gpu/drm/i915/intel_lvds.c
@@ -903,6 +903,59 @@ static bool lvds_is_present_in_vbt(struct drm_device *dev,
903 return false; 903 return false;
904} 904}
905 905
906static int intel_dual_link_lvds_callback(const struct dmi_system_id *id)
907{
908 DRM_INFO("Forcing lvds to dual link mode on %s\n", id->ident);
909 return 1;
910}
911
912static const struct dmi_system_id intel_dual_link_lvds[] = {
913 {
914 .callback = intel_dual_link_lvds_callback,
915 .ident = "Apple MacBook Pro (Core i5/i7 Series)",
916 .matches = {
917 DMI_MATCH(DMI_SYS_VENDOR, "Apple Inc."),
918 DMI_MATCH(DMI_PRODUCT_NAME, "MacBookPro8,2"),
919 },
920 },
921 { } /* terminating entry */
922};
923
924bool intel_is_dual_link_lvds(struct drm_device *dev)
925{
926 unsigned int val;
927 struct drm_i915_private *dev_priv = dev->dev_private;
928 u32 lvds_reg;
929
930 if (HAS_PCH_SPLIT(dev)) {
931 lvds_reg = PCH_LVDS;
932 } else {
933 lvds_reg = LVDS;
934 }
935
936 /* use the module option value if specified */
937 if (i915_lvds_channel_mode > 0)
938 return i915_lvds_channel_mode == 2;
939
940 if (dmi_check_system(intel_dual_link_lvds))
941 return true;
942
943 if (dev_priv->lvds_val)
944 val = dev_priv->lvds_val;
945 else {
946 /* BIOS should set the proper LVDS register value at boot, but
947 * in reality, it doesn't set the value when the lid is closed;
948 * we need to check "the value to be set" in VBT when LVDS
949 * register is uninitialized.
950 */
951 val = I915_READ(lvds_reg);
952 if (!(val & ~(LVDS_PIPE_MASK | LVDS_DETECTED)))
953 val = dev_priv->bios_lvds_val;
954 dev_priv->lvds_val = val;
955 }
956 return (val & LVDS_CLKB_POWER_MASK) == LVDS_CLKB_POWER_UP;
957}
958
906static bool intel_lvds_supported(struct drm_device *dev) 959static bool intel_lvds_supported(struct drm_device *dev)
907{ 960{
908 /* With the introduction of the PCH we gained a dedicated 961 /* With the introduction of the PCH we gained a dedicated