diff options
author | Daniel Vetter <daniel.vetter@ffwll.ch> | 2015-02-10 23:12:27 +0100 |
---|---|---|
committer | Jani Nikula <jani.nikula@intel.com> | 2015-02-24 15:51:19 +0200 |
commit | f37b5c2be8979993efee2da50b51126e3908eb8b (patch) | |
tree | 774853aa9ffe8b4c96a3afb62637df4d4bc1a31b /drivers/gpu/drm/i915/i915_gem_stolen.c | |
parent | 2dd2a883aad7c852400027c2261bcab69d9e238e (diff) | |
download | op-kernel-dev-f37b5c2be8979993efee2da50b51126e3908eb8b.zip op-kernel-dev-f37b5c2be8979993efee2da50b51126e3908eb8b.tar.gz |
drm/i915: Align initial plane backing objects correctly
Some bios really like to joke and start the planes at an offset ...
hooray!
Align start and end to fix this.
v2: Fixup calculation of size, spotted by Chris Wilson.
v3: Fix serious fumble I've just spotted.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=86883
Cc: stable@vger.kernel.org
Cc: Johannes W <jargon@molb.org>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Jani Nikula <jani.nikula@linux.intel.com>
Reported-and-tested-by: Johannes W <jargon@molb.org>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
[Jani: split WARN_ONs, rebase on v4.0-rc1]
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Diffstat (limited to 'drivers/gpu/drm/i915/i915_gem_stolen.c')
-rw-r--r-- | drivers/gpu/drm/i915/i915_gem_stolen.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem_stolen.c b/drivers/gpu/drm/i915/i915_gem_stolen.c index a204584..9c6f93e 100644 --- a/drivers/gpu/drm/i915/i915_gem_stolen.c +++ b/drivers/gpu/drm/i915/i915_gem_stolen.c @@ -485,10 +485,8 @@ i915_gem_object_create_stolen_for_preallocated(struct drm_device *dev, 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)) + if (WARN_ON(size == 0) || WARN_ON(size & 4095) || + WARN_ON(stolen_offset & 4095)) return NULL; stolen = kzalloc(sizeof(*stolen), GFP_KERNEL); |