aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2010-11-29 13:00:23 -0500
committerChris Wilson <chris@chris-wilson.co.uk>2010-11-29 13:45:01 -0500
commitc5d1b51d3559664920136b45f4d2366ed9a9e8be (patch)
tree0ff3983cb395dc5bd0de1684a60647977b35ea91
parentde18a29e0fa3904894b4e02fae0e712cd43f740c (diff)
drm/i915: Clear pfit registers when not used by any outputs
... otherwise the panel-fitter may be left enabled with random settings and cause unintended filtering (i.e. blurring of native modes on external panels). Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=31942 Reported-and-tested-by: Ben Kohler <bkohler@gmail.com> Tested-by: Ciprian Docan <docan@eden.rutgers.edu> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--drivers/gpu/drm/i915/intel_display.c7
-rw-r--r--drivers/gpu/drm/i915/intel_drv.h2
-rw-r--r--drivers/gpu/drm/i915/intel_lvds.c19
3 files changed, 17 insertions, 11 deletions
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index bee24b1a58e8..255b52ee0091 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -5336,9 +5336,14 @@ static void intel_setup_outputs(struct drm_device *dev)
5336 struct drm_i915_private *dev_priv = dev->dev_private; 5336 struct drm_i915_private *dev_priv = dev->dev_private;
5337 struct intel_encoder *encoder; 5337 struct intel_encoder *encoder;
5338 bool dpd_is_edp = false; 5338 bool dpd_is_edp = false;
5339 bool has_lvds = false;
5339 5340
5340 if (IS_MOBILE(dev) && !IS_I830(dev)) 5341 if (IS_MOBILE(dev) && !IS_I830(dev))
5341 intel_lvds_init(dev); 5342 has_lvds = intel_lvds_init(dev);
5343 if (!has_lvds && !HAS_PCH_SPLIT(dev)) {
5344 /* disable the panel fitter on everything but LVDS */
5345 I915_WRITE(PFIT_CONTROL, 0);
5346 }
5342 5347
5343 if (HAS_PCH_SPLIT(dev)) { 5348 if (HAS_PCH_SPLIT(dev)) {
5344 dpd_is_edp = intel_dpd_is_edp(dev); 5349 dpd_is_edp = intel_dpd_is_edp(dev);
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
index 21551fe74541..e52c6125bb1f 100644
--- a/drivers/gpu/drm/i915/intel_drv.h
+++ b/drivers/gpu/drm/i915/intel_drv.h
@@ -237,7 +237,7 @@ extern bool intel_sdvo_init(struct drm_device *dev, int output_device);
237extern void intel_dvo_init(struct drm_device *dev); 237extern void intel_dvo_init(struct drm_device *dev);
238extern void intel_tv_init(struct drm_device *dev); 238extern void intel_tv_init(struct drm_device *dev);
239extern void intel_mark_busy(struct drm_device *dev, struct drm_gem_object *obj); 239extern void intel_mark_busy(struct drm_device *dev, struct drm_gem_object *obj);
240extern void intel_lvds_init(struct drm_device *dev); 240extern bool intel_lvds_init(struct drm_device *dev);
241extern void intel_dp_init(struct drm_device *dev, int dp_reg); 241extern void intel_dp_init(struct drm_device *dev, int dp_reg);
242void 242void
243intel_dp_set_m_n(struct drm_crtc *crtc, struct drm_display_mode *mode, 243intel_dp_set_m_n(struct drm_crtc *crtc, struct drm_display_mode *mode,
diff --git a/drivers/gpu/drm/i915/intel_lvds.c b/drivers/gpu/drm/i915/intel_lvds.c
index 4324a326f98e..f79327fc6653 100644
--- a/drivers/gpu/drm/i915/intel_lvds.c
+++ b/drivers/gpu/drm/i915/intel_lvds.c
@@ -837,7 +837,7 @@ static bool intel_lvds_ddc_probe(struct drm_device *dev, u8 pin)
837 * 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
838 * modes we can display on the LVDS panel (if present). 838 * modes we can display on the LVDS panel (if present).
839 */ 839 */
840void intel_lvds_init(struct drm_device *dev) 840bool intel_lvds_init(struct drm_device *dev)
841{ 841{
842 struct drm_i915_private *dev_priv = dev->dev_private; 842 struct drm_i915_private *dev_priv = dev->dev_private;
843 struct intel_lvds *intel_lvds; 843 struct intel_lvds *intel_lvds;
@@ -853,37 +853,37 @@ void intel_lvds_init(struct drm_device *dev)
853 853
854 /* Skip init on machines we know falsely report LVDS */ 854 /* Skip init on machines we know falsely report LVDS */
855 if (dmi_check_system(intel_no_lvds)) 855 if (dmi_check_system(intel_no_lvds))
856 return; 856 return false;
857 857
858 pin = GMBUS_PORT_PANEL; 858 pin = GMBUS_PORT_PANEL;
859 if (!lvds_is_present_in_vbt(dev, &pin)) { 859 if (!lvds_is_present_in_vbt(dev, &pin)) {
860 DRM_DEBUG_KMS("LVDS is not present in VBT\n"); 860 DRM_DEBUG_KMS("LVDS is not present in VBT\n");
861 return; 861 return false;
862 } 862 }
863 863
864 if (HAS_PCH_SPLIT(dev)) { 864 if (HAS_PCH_SPLIT(dev)) {
865 if ((I915_READ(PCH_LVDS) & LVDS_DETECTED) == 0) 865 if ((I915_READ(PCH_LVDS) & LVDS_DETECTED) == 0)
866 return; 866 return false;
867 if (dev_priv->edp.support) { 867 if (dev_priv->edp.support) {
868 DRM_DEBUG_KMS("disable LVDS for eDP support\n"); 868 DRM_DEBUG_KMS("disable LVDS for eDP support\n");
869 return; 869 return false;
870 } 870 }
871 } 871 }
872 872
873 if (!intel_lvds_ddc_probe(dev, pin)) { 873 if (!intel_lvds_ddc_probe(dev, pin)) {
874 DRM_DEBUG_KMS("LVDS did not respond to DDC probe\n"); 874 DRM_DEBUG_KMS("LVDS did not respond to DDC probe\n");
875 return; 875 return false;
876 } 876 }
877 877
878 intel_lvds = kzalloc(sizeof(struct intel_lvds), GFP_KERNEL); 878 intel_lvds = kzalloc(sizeof(struct intel_lvds), GFP_KERNEL);
879 if (!intel_lvds) { 879 if (!intel_lvds) {
880 return; 880 return false;
881 } 881 }
882 882
883 intel_connector = kzalloc(sizeof(struct intel_connector), GFP_KERNEL); 883 intel_connector = kzalloc(sizeof(struct intel_connector), GFP_KERNEL);
884 if (!intel_connector) { 884 if (!intel_connector) {
885 kfree(intel_lvds); 885 kfree(intel_lvds);
886 return; 886 return false;
887 } 887 }
888 888
889 if (!HAS_PCH_SPLIT(dev)) { 889 if (!HAS_PCH_SPLIT(dev)) {
@@ -1026,7 +1026,7 @@ out:
1026 /* keep the LVDS connector */ 1026 /* keep the LVDS connector */
1027 dev_priv->int_lvds_connector = connector; 1027 dev_priv->int_lvds_connector = connector;
1028 drm_sysfs_connector_add(connector); 1028 drm_sysfs_connector_add(connector);
1029 return; 1029 return true;
1030 1030
1031failed: 1031failed:
1032 DRM_DEBUG_KMS("No LVDS modes found, disabling.\n"); 1032 DRM_DEBUG_KMS("No LVDS modes found, disabling.\n");
@@ -1034,4 +1034,5 @@ failed:
1034 drm_encoder_cleanup(encoder); 1034 drm_encoder_cleanup(encoder);
1035 kfree(intel_lvds); 1035 kfree(intel_lvds);
1036 kfree(intel_connector); 1036 kfree(intel_connector);
1037 return false;
1037} 1038}