aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Barnes <jbarnes@virtuousgeek.org>2009-12-02 16:42:53 -0500
committerEric Anholt <eric@anholt.net>2009-12-07 15:06:00 -0500
commit22fd0fab3b512b5fcb4fd0b0668deeaa701511f9 (patch)
treee9f3ba5c2d11dc567bf86633d4d9db5ab8232b63
parent6e36595a2131e7ed5ee2674be54b2713ba7f0490 (diff)
drm/i915: pageflip fixes
This patch brings the tree up to date with some fixes that were in a more recent version of the page flipping patch you applied. It fixes pre-965 flip support, removes a leftover hack that forced alignment, and initializes the pipe & plane CRTC mappings. Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org> Signed-off-by: Eric Anholt <eric@anholt.net>
-rw-r--r--drivers/gpu/drm/i915/intel_display.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 65b76fffd9e3..22dcd0851637 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -1213,7 +1213,6 @@ intel_pin_and_fence_fb_obj(struct drm_device *dev, struct drm_gem_object *obj)
1213 BUG(); 1213 BUG();
1214 } 1214 }
1215 1215
1216 alignment = 256 * 1024;
1217 ret = i915_gem_object_pin(obj, alignment); 1216 ret = i915_gem_object_pin(obj, alignment);
1218 if (ret != 0) 1217 if (ret != 0)
1219 return ret; 1218 return ret;
@@ -4227,8 +4226,13 @@ static int intel_crtc_page_flip(struct drm_crtc *crtc,
4227 OUT_RING(MI_DISPLAY_FLIP | 4226 OUT_RING(MI_DISPLAY_FLIP |
4228 MI_DISPLAY_FLIP_PLANE(intel_crtc->plane)); 4227 MI_DISPLAY_FLIP_PLANE(intel_crtc->plane));
4229 OUT_RING(fb->pitch); 4228 OUT_RING(fb->pitch);
4230 OUT_RING(obj_priv->gtt_offset | obj_priv->tiling_mode); 4229 if (IS_I965G(dev)) {
4231 OUT_RING((fb->width << 16) | fb->height); 4230 OUT_RING(obj_priv->gtt_offset | obj_priv->tiling_mode);
4231 OUT_RING((fb->width << 16) | fb->height);
4232 } else {
4233 OUT_RING(obj_priv->gtt_offset);
4234 OUT_RING(MI_NOOP);
4235 }
4232 ADVANCE_LP_RING(); 4236 ADVANCE_LP_RING();
4233 4237
4234 mutex_unlock(&dev->struct_mutex); 4238 mutex_unlock(&dev->struct_mutex);
@@ -4258,6 +4262,7 @@ static const struct drm_crtc_funcs intel_crtc_funcs = {
4258 4262
4259static void intel_crtc_init(struct drm_device *dev, int pipe) 4263static void intel_crtc_init(struct drm_device *dev, int pipe)
4260{ 4264{
4265 drm_i915_private_t *dev_priv = dev->dev_private;
4261 struct intel_crtc *intel_crtc; 4266 struct intel_crtc *intel_crtc;
4262 int i; 4267 int i;
4263 4268
@@ -4284,6 +4289,11 @@ static void intel_crtc_init(struct drm_device *dev, int pipe)
4284 intel_crtc->plane = ((pipe == 0) ? 1 : 0); 4289 intel_crtc->plane = ((pipe == 0) ? 1 : 0);
4285 } 4290 }
4286 4291
4292 BUG_ON(pipe >= ARRAY_SIZE(dev_priv->plane_to_crtc_mapping) ||
4293 dev_priv->plane_to_crtc_mapping[intel_crtc->plane] != NULL);
4294 dev_priv->plane_to_crtc_mapping[intel_crtc->plane] = &intel_crtc->base;
4295 dev_priv->pipe_to_crtc_mapping[intel_crtc->pipe] = &intel_crtc->base;
4296
4287 intel_crtc->cursor_addr = 0; 4297 intel_crtc->cursor_addr = 0;
4288 intel_crtc->dpms_mode = DRM_MODE_DPMS_OFF; 4298 intel_crtc->dpms_mode = DRM_MODE_DPMS_OFF;
4289 drm_crtc_helper_add(&intel_crtc->base, &intel_helper_funcs); 4299 drm_crtc_helper_add(&intel_crtc->base, &intel_helper_funcs);