public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915: Quietly reject attempts to create non-pagealigned stolen objects
@ 2014-12-10  8:17 Chris Wilson
  2014-12-10 10:23 ` Daniel Vetter
  2014-12-10 15:04 ` shuang.he
  0 siblings, 2 replies; 12+ messages in thread
From: Chris Wilson @ 2014-12-10  8:17 UTC (permalink / raw)
  To: intel-gfx; +Cc: Chris Wilson, stable

This added as a BUG_ON as it considered that no one would ever request
an unaligned object. However, it turns out that some BIOSes will
allocate a scanout that is offset from 0 and not aligned to a page
boundary, and we were passing this through and hitting the BUG_ON during
boot.

Quietly reject such a request to reserve the unaligned stolen object and
let the boot continue, restoring previous behaviour (i.e. no BIOS
framebuffer preservation).

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=86883
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: stable@vger.kernel.org
---
 drivers/gpu/drm/i915/i915_gem_stolen.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_gem_stolen.c b/drivers/gpu/drm/i915/i915_gem_stolen.c
index 5c616ec2c5c8..a3bc0fa07c6c 100644
--- a/drivers/gpu/drm/i915/i915_gem_stolen.c
+++ b/drivers/gpu/drm/i915/i915_gem_stolen.c
@@ -646,13 +646,15 @@ i915_gem_object_create_stolen_for_preallocated(struct drm_device *dev,
 	DRM_DEBUG_KMS("creating preallocated stolen object: stolen_offset=%x, gtt_offset=%x, size=%x\n",
 			stolen_offset, gtt_offset, size);
 
-	/* KISS and expect everything to be page-aligned */
-	BUG_ON(stolen_offset & 4095);
-	BUG_ON(size & 4095);
-
 	if (WARN_ON(size == 0))
 		return NULL;
 
+	/* KISS and expect everything to be GTT page-aligned */
+	if ((stolen_offset | size) & 4095) {
+		DRM_DEBUG_KMS("request for unaligned stolen object, denied\n");
+		return NULL;
+	}
+
 	stolen = kzalloc(sizeof(*stolen), GFP_KERNEL);
 	if (!stolen)
 		return NULL;
-- 
2.1.3

^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2015-02-10 12:34 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-10  8:17 [PATCH] drm/i915: Quietly reject attempts to create non-pagealigned stolen objects Chris Wilson
2014-12-10 10:23 ` Daniel Vetter
2014-12-10 11:13   ` [Intel-gfx] " Chris Wilson
2014-12-10 13:53     ` Daniel Vetter
2014-12-10 14:53       ` Ville Syrjälä
2014-12-19 12:09         ` [Intel-gfx] " Ander Conselvan de Oliveira
2014-12-19 14:18           ` Ville Syrjälä
2015-01-21 17:45   ` Jani Nikula
2015-01-21 18:13     ` Daniel Vetter
2015-01-21 22:22       ` [Intel-gfx] " Chris Wilson
2015-02-10 12:34         ` Jani Nikula
2014-12-10 15:04 ` shuang.he

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox