diff options
author | Zhao Yakui <yakui.zhao@intel.com> | 2009-03-03 05:06:42 -0500 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2009-03-27 18:12:10 -0400 |
commit | 6bcdcd9e3c09d133e3278edabebc314a2451b74a (patch) | |
tree | 775a5bed00a3c02c8d2d07284421bd9ddf4b1a5e /drivers/gpu | |
parent | ba01079c71559304771f9d741c9bbe8b2eac22a2 (diff) |
drm/i915: Sync mode_valid/mode_set with intel video driver
This covers:
Limit CRT DAC speed better.
and also clears the border color in case it's set to some garbage, which would
fix ugly outlines in the blank regions of the CRT.
Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
[anholt: replaced *drm_dev with *dev]
Signed-off-by: Eric Anholt <eric@anholt.net>
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/drm/i915/intel_crt.c | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/drivers/gpu/drm/i915/intel_crt.c b/drivers/gpu/drm/i915/intel_crt.c index dcaed3466e83..e58defa247d5 100644 --- a/drivers/gpu/drm/i915/intel_crt.c +++ b/drivers/gpu/drm/i915/intel_crt.c | |||
@@ -64,11 +64,21 @@ static void intel_crt_dpms(struct drm_encoder *encoder, int mode) | |||
64 | static int intel_crt_mode_valid(struct drm_connector *connector, | 64 | static int intel_crt_mode_valid(struct drm_connector *connector, |
65 | struct drm_display_mode *mode) | 65 | struct drm_display_mode *mode) |
66 | { | 66 | { |
67 | struct drm_device *dev = connector->dev; | ||
68 | |||
69 | int max_clock = 0; | ||
67 | if (mode->flags & DRM_MODE_FLAG_DBLSCAN) | 70 | if (mode->flags & DRM_MODE_FLAG_DBLSCAN) |
68 | return MODE_NO_DBLESCAN; | 71 | return MODE_NO_DBLESCAN; |
69 | 72 | ||
70 | if (mode->clock > 400000 || mode->clock < 25000) | 73 | if (mode->clock < 25000) |
71 | return MODE_CLOCK_RANGE; | 74 | return MODE_CLOCK_LOW; |
75 | |||
76 | if (!IS_I9XX(dev)) | ||
77 | max_clock = 350000; | ||
78 | else | ||
79 | max_clock = 400000; | ||
80 | if (mode->clock > max_clock) | ||
81 | return MODE_CLOCK_HIGH; | ||
72 | 82 | ||
73 | return MODE_OK; | 83 | return MODE_OK; |
74 | } | 84 | } |
@@ -113,10 +123,13 @@ static void intel_crt_mode_set(struct drm_encoder *encoder, | |||
113 | if (adjusted_mode->flags & DRM_MODE_FLAG_PVSYNC) | 123 | if (adjusted_mode->flags & DRM_MODE_FLAG_PVSYNC) |
114 | adpa |= ADPA_VSYNC_ACTIVE_HIGH; | 124 | adpa |= ADPA_VSYNC_ACTIVE_HIGH; |
115 | 125 | ||
116 | if (intel_crtc->pipe == 0) | 126 | if (intel_crtc->pipe == 0) { |
117 | adpa |= ADPA_PIPE_A_SELECT; | 127 | adpa |= ADPA_PIPE_A_SELECT; |
118 | else | 128 | I915_WRITE(BCLRPAT_A, 0); |
129 | } else { | ||
119 | adpa |= ADPA_PIPE_B_SELECT; | 130 | adpa |= ADPA_PIPE_B_SELECT; |
131 | I915_WRITE(BCLRPAT_B, 0); | ||
132 | } | ||
120 | 133 | ||
121 | I915_WRITE(ADPA, adpa); | 134 | I915_WRITE(ADPA, adpa); |
122 | } | 135 | } |