[Intel-gfx] [PATCH] drm/i915: fix screen blank issue in TV detect

Zhenyu Wang zhenyuw at linux.intel.com
Fri Sep 11 07:19:32 CEST 2009


In load time, this one trys to detect TV by current encoder state
instead of load-detect method. Because load-detect will set mode
which disable VGA mode entirely, but couldn't restore back later.
Destroy VGA mode which is the mode after system boot caused black
screen problem, although load fbcon or X later could setup the mode
on LVDS without problem.

That fixes screen blank issue seen on Macbook after boot and before
fbcon or X kicks in, actually this affects all laptops with TV out,
or without real port but our TV encoder probe fails to detect.

Signed-off-by: Zhenyu Wang <zhenyuw at linux.intel.com>
---
 drivers/gpu/drm/i915/intel_tv.c |   24 ++++++++++++++++++++++++
 1 files changed, 24 insertions(+), 0 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_tv.c b/drivers/gpu/drm/i915/intel_tv.c
index 5b1c9e9..edb4e6e 100644
--- a/drivers/gpu/drm/i915/intel_tv.c
+++ b/drivers/gpu/drm/i915/intel_tv.c
@@ -38,6 +38,11 @@
 #include "i915_drm.h"
 #include "i915_drv.h"
 
+/* 
+ * This shortcut TV detect in load time for checking current state only.
+ */
+static bool load_time_detect = true;
+
 enum tv_margin {
 	TV_MARGIN_LEFT, TV_MARGIN_TOP,
 	TV_MARGIN_RIGHT, TV_MARGIN_BOTTOM
@@ -1451,9 +1456,28 @@ intel_tv_detect(struct drm_connector *connector)
 	struct intel_output *intel_output = to_intel_output(connector);
 	struct intel_tv_priv *tv_priv = intel_output->dev_priv;
 	struct drm_encoder *encoder = &intel_output->enc;
+	struct drm_i915_private *dev_priv = connector->dev->dev_private;
 	int dpms_mode;
 	int type = tv_priv->type;
 
+	/* 
+	 * In driver load time, TV load detect will try to set mode, 
+	 * during which VGA mode will be disabled and never could be
+	 * restored later. This will blank screen which is in VGA mode
+	 * after boot.
+	 *
+	 * So here we only check current TV encoder state when loading.
+	 * Future TV detect for fbcon or X still work as before.
+	 *
+	 */
+	if (load_time_detect) {
+		load_time_detect = false;
+		if (!(I915_READ(TV_CTL) & TV_ENC_ENABLE))
+			return connector_status_disconnected;
+		else
+			return connector_status_connected;
+	}
+
 	mode = reported_modes[0];
 	drm_mode_set_crtcinfo(&mode, CRTC_INTERLACE_HALVE_V);
 
-- 
1.6.3.3




More information about the Intel-gfx mailing list