diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2010-09-12 20:16:10 -0400 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2010-09-13 05:25:26 -0400 |
commit | e9e331a8abeece1565d383510ed985945132ffe3 (patch) | |
tree | f35a5f938e1eda21f99d1fbdb3d85b7923417791 /drivers/gpu/drm/i915/intel_overlay.c | |
parent | 6edc3242e35f03990e362e7c115e722717f0f7a7 (diff) |
drm/i915/lvds: Ensure panel is unlocked for Ironlake or the panel fitter
Commit 77d07fd9d73ef28689737c0952dbd5d6a5017743 introduced a regression
where by not waiting for the panel to be turned off, left the panel and
PLL registers locked across the modeset. Thus the panel remaining blank.
As pointed out by Daniel Vetter, when testing LVDS it helps to open the
laptop and look at the actual panel you are purporting to test.
A second issue with the patch was that in order to modify the panel
fitter before gen5, the pipe and the panel must have be completely
powered down. So we wait.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'drivers/gpu/drm/i915/intel_overlay.c')
-rw-r--r-- | drivers/gpu/drm/i915/intel_overlay.c | 33 |
1 files changed, 30 insertions, 3 deletions
diff --git a/drivers/gpu/drm/i915/intel_overlay.c b/drivers/gpu/drm/i915/intel_overlay.c index 9dcddfc8394c..3dff16118ee5 100644 --- a/drivers/gpu/drm/i915/intel_overlay.c +++ b/drivers/gpu/drm/i915/intel_overlay.c | |||
@@ -1050,6 +1050,33 @@ static int check_overlay_src(struct drm_device *dev, | |||
1050 | return 0; | 1050 | return 0; |
1051 | } | 1051 | } |
1052 | 1052 | ||
1053 | /** | ||
1054 | * Return the pipe currently connected to the panel fitter, | ||
1055 | * or -1 if the panel fitter is not present or not in use | ||
1056 | */ | ||
1057 | static int intel_panel_fitter_pipe(struct drm_device *dev) | ||
1058 | { | ||
1059 | struct drm_i915_private *dev_priv = dev->dev_private; | ||
1060 | u32 pfit_control; | ||
1061 | |||
1062 | /* i830 doesn't have a panel fitter */ | ||
1063 | if (IS_I830(dev)) | ||
1064 | return -1; | ||
1065 | |||
1066 | pfit_control = I915_READ(PFIT_CONTROL); | ||
1067 | |||
1068 | /* See if the panel fitter is in use */ | ||
1069 | if ((pfit_control & PFIT_ENABLE) == 0) | ||
1070 | return -1; | ||
1071 | |||
1072 | /* 965 can place panel fitter on either pipe */ | ||
1073 | if (IS_I965G(dev)) | ||
1074 | return (pfit_control >> 29) & 0x3; | ||
1075 | |||
1076 | /* older chips can only use pipe 1 */ | ||
1077 | return 1; | ||
1078 | } | ||
1079 | |||
1053 | int intel_overlay_put_image(struct drm_device *dev, void *data, | 1080 | int intel_overlay_put_image(struct drm_device *dev, void *data, |
1054 | struct drm_file *file_priv) | 1081 | struct drm_file *file_priv) |
1055 | { | 1082 | { |
@@ -1124,9 +1151,9 @@ int intel_overlay_put_image(struct drm_device *dev, void *data, | |||
1124 | overlay->crtc = crtc; | 1151 | overlay->crtc = crtc; |
1125 | crtc->overlay = overlay; | 1152 | crtc->overlay = overlay; |
1126 | 1153 | ||
1127 | if (intel_panel_fitter_pipe(dev) == crtc->pipe | 1154 | /* line too wide, i.e. one-line-mode */ |
1128 | /* and line to wide, i.e. one-line-mode */ | 1155 | if (mode->hdisplay > 1024 && |
1129 | && mode->hdisplay > 1024) { | 1156 | intel_panel_fitter_pipe(dev) == crtc->pipe) { |
1130 | overlay->pfit_active = 1; | 1157 | overlay->pfit_active = 1; |
1131 | update_pfit_vscale_ratio(overlay); | 1158 | update_pfit_vscale_ratio(overlay); |
1132 | } else | 1159 | } else |