aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2010-05-27 08:18:18 -0400
committerEric Anholt <eric@anholt.net>2010-05-28 13:43:38 -0400
commitac0c6b5ad3b3b513e1057806d4b7627fcc0ecc27 (patch)
tree1085f046af6483d05b2bd6f3456881e534c1ea44
parenta7faf32d00529b9c501e37a31d4bf8acef4f8f59 (diff)
drm/i915: Rebind bo if currently bound with incorrect alignment.
Whilst pinning the buffer, check that that its current alignment matches the requested alignment. If it does not, rebind. This should clear up any final render errors whilst resuming, for reference: Bug 27070 - [i915] Page table errors with empty ringbuffer https://bugs.freedesktop.org/show_bug.cgi?id=27070 Bug 15502 - render error detected, EIR: 0x00000010 https://bugzilla.kernel.org/show_bug.cgi?id=15502 Bug 13844 - i915 error: "render error detected" https://bugzilla.kernel.org/show_bug.cgi?id=13844 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: stable@kernel.org Signed-off-by: Eric Anholt <eric@anholt.net>
-rw-r--r--drivers/gpu/drm/i915/i915_gem.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index 6425c2a4b11f..a5ca9599b232 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -4164,6 +4164,17 @@ i915_gem_object_pin(struct drm_gem_object *obj, uint32_t alignment)
4164 BUG_ON(obj_priv->pin_count == DRM_I915_GEM_OBJECT_MAX_PIN_COUNT); 4164 BUG_ON(obj_priv->pin_count == DRM_I915_GEM_OBJECT_MAX_PIN_COUNT);
4165 4165
4166 i915_verify_inactive(dev, __FILE__, __LINE__); 4166 i915_verify_inactive(dev, __FILE__, __LINE__);
4167
4168 if (obj_priv->gtt_space != NULL) {
4169 if (alignment == 0)
4170 alignment = i915_gem_get_gtt_alignment(obj);
4171 if (obj_priv->gtt_offset & (alignment - 1)) {
4172 ret = i915_gem_object_unbind(obj);
4173 if (ret)
4174 return ret;
4175 }
4176 }
4177
4167 if (obj_priv->gtt_space == NULL) { 4178 if (obj_priv->gtt_space == NULL) {
4168 ret = i915_gem_object_bind_to_gtt(obj, alignment); 4179 ret = i915_gem_object_bind_to_gtt(obj, alignment);
4169 if (ret) 4180 if (ret)