[Intel-gfx] [Patch 2/5]: DRM/I915: Sync mode_valid/mode_set with intel video driver

yakui_zhao yakui.zhao at intel.com
Tue Mar 3 11:06:42 CET 2009


Subject: Patch DRM/I915: Sync mode_valid/mode_set with intel video driver
From: Zhao Yakui <yakui.zhao at intel.com>

Synchronize the function of mode_valid/mode_set with intel video driver

Signed-off-by: Zhao Yakui <yakui.zhao at intel.com>
---
 drivers/gpu/drm/i915/intel_crt.c |   20 ++++++++++++++++----
 1 file changed, 16 insertions(+), 4 deletions(-)

Index: linux-2.6/drivers/gpu/drm/i915/intel_crt.c
===================================================================
--- linux-2.6.orig/drivers/gpu/drm/i915/intel_crt.c	2009-03-03 18:00:44.000000000 +0800
+++ linux-2.6/drivers/gpu/drm/i915/intel_crt.c	2009-03-03 18:04:29.000000000 +0800
@@ -84,11 +84,20 @@
 static int intel_crt_mode_valid(struct drm_connector *connector,
 				struct drm_display_mode *mode)
 {
+	struct drm_device *drm_dev = connector->dev;
+	int max_clock = 0;
 	if (mode->flags & DRM_MODE_FLAG_DBLSCAN)
 		return MODE_NO_DBLESCAN;
 
-	if (mode->clock > 400000 || mode->clock < 25000)
-		return MODE_CLOCK_RANGE;
+	if (mode->clock < 25000)
+		return MODE_CLOCK_LOW;
+
+	if (!IS_I9XX(drm_dev))
+		max_clock = 350000;
+	else
+		max_clock = 400000;
+	if (mode->clock > max_clock)
+		return MODE_CLOCK_HIGH;
 
 	return MODE_OK;
 }
@@ -133,10 +142,13 @@
 	if (adjusted_mode->flags & DRM_MODE_FLAG_PVSYNC)
 		adpa |= ADPA_VSYNC_ACTIVE_HIGH;
 
-	if (intel_crtc->pipe == 0)
+	if (intel_crtc->pipe == 0) {
 		adpa |= ADPA_PIPE_A_SELECT;
-	else
+		I915_WRITE(BCLRPAT_A, 0);
+	} else {
 		adpa |= ADPA_PIPE_B_SELECT;
+		I915_WRITE(BCLRPAT_B, 0);
+	}
 
 	I915_WRITE(ADPA, adpa);
 }





More information about the Intel-gfx mailing list