drm/i915: Use the correct scanout alignment for fbcon.
authorChris Wilson <chris@chris-wilson.co.uk>
Fri, 23 Jul 2010 22:32:05 +0000 (23:32 +0100)
committerEric Anholt <eric@anholt.net>
Mon, 26 Jul 2010 18:27:05 +0000 (11:27 -0700)
This fixes a potential modesetting error during boot with plymouth on
Broadwater and Crestline introduced with 9df47c. The framebuffer was
hard-coding an alignment of 64K, but the modesetting code required the
documented alignment of 128K. The result was that we would attempt to
unbind the pinned fbcon buffer, triggering an ERROR and ultimately
failing the mode change.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Eric Anholt <eric@anholt.net>
drivers/gpu/drm/i915/intel_display.c
drivers/gpu/drm/i915/intel_drv.h
drivers/gpu/drm/i915/intel_fb.c

index 6d5477c5df04323cb0b9da331fb35667bdb7fcae..a37d4cea98a6f006efdbe22d994c495348cd8cd2 100644 (file)
@@ -1255,7 +1255,7 @@ out_disable:
        }
 }
 
-static int
+int
 intel_pin_and_fence_fb_obj(struct drm_device *dev, struct drm_gem_object *obj)
 {
        struct drm_i915_gem_object *obj_priv = to_intel_bo(obj);
index 72206f37c4fb847c8d32d80c5c893fd3a68a5faa..2f7970be9051a2c5eb308b9a5a4eebc09e6b636c 100644 (file)
@@ -215,6 +215,9 @@ extern void intel_init_clock_gating(struct drm_device *dev);
 extern void ironlake_enable_drps(struct drm_device *dev);
 extern void ironlake_disable_drps(struct drm_device *dev);
 
+extern int intel_pin_and_fence_fb_obj(struct drm_device *dev,
+                                     struct drm_gem_object *obj);
+
 extern int intel_framebuffer_init(struct drm_device *dev,
                                  struct intel_framebuffer *ifb,
                                  struct drm_mode_fb_cmd *mode_cmd,
index c3c505244e07367c3a8a3cb17698d60ef5ce5407..0f4946a6057e566fe1a495af358ee7bb19341586 100644 (file)
@@ -98,7 +98,7 @@ static int intelfb_create(struct intel_fbdev *ifbdev,
 
        mutex_lock(&dev->struct_mutex);
 
-       ret = i915_gem_object_pin(fbo, 64*1024);
+       ret = intel_pin_and_fence_fb_obj(dev, fbo);
        if (ret) {
                DRM_ERROR("failed to pin fb: %d\n", ret);
                goto out_unref;