All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Wilson <chris@chris-wilson.co.uk>
To: intel-gfx@lists.freedesktop.org
Cc: stable@kernel.org
Subject: [PATCH 07/11] drm/i915: Rebind bo if currently bound with incorrect alignment.
Date: Thu, 27 May 2010 13:18:18 +0100	[thread overview]
Message-ID: <1274962702-6530-8-git-send-email-chris@chris-wilson.co.uk> (raw)
In-Reply-To: <1274962702-6530-1-git-send-email-chris@chris-wilson.co.uk>

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
---
 drivers/gpu/drm/i915/i915_gem.c |   11 +++++++++++
 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 6425c2a..a5ca959 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)
 	BUG_ON(obj_priv->pin_count == DRM_I915_GEM_OBJECT_MAX_PIN_COUNT);
 
 	i915_verify_inactive(dev, __FILE__, __LINE__);
+
+	if (obj_priv->gtt_space != NULL) {
+		if (alignment == 0)
+			alignment = i915_gem_get_gtt_alignment(obj);
+		if (obj_priv->gtt_offset & (alignment - 1)) {
+			ret = i915_gem_object_unbind(obj);
+			if (ret)
+				return ret;
+		}
+	}
+
 	if (obj_priv->gtt_space == NULL) {
 		ret = i915_gem_object_bind_to_gtt(obj, alignment);
 		if (ret)
-- 
1.7.1

  parent reply	other threads:[~2010-05-27 12:18 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-27 12:18 A compendium of trivial patches Chris Wilson
2010-05-27 12:18 ` [PATCH 01/11] drm/i915: Only print an message if there was an error Chris Wilson
2010-05-27 12:18 ` [PATCH 02/11] drm/i915: Hold the spinlock whilst resetting unpin_work along error path Chris Wilson
2010-05-27 16:03   ` Jesse Barnes
2010-05-27 12:18 ` [PATCH 03/11] drm/i915: Avoid nesting of domain changes when setting display plane Chris Wilson
2010-05-27 12:18 ` [PATCH 04/11] drm/i915: Propagate error from unbinding an unfenceable object Chris Wilson
2010-05-27 16:05   ` Jesse Barnes
2010-05-27 16:32     ` Chris Wilson
2010-05-27 12:18 ` [PATCH 05/11] drm/i915: Only print "nothing to do" debug message as required Chris Wilson
2010-05-27 12:18 ` [PATCH 06/11] drm/i915: Include pitch in set_base debug statement Chris Wilson
2010-05-27 12:18 ` Chris Wilson [this message]
2010-05-27 12:18 ` [PATCH 08/11] drm/i915: Remove spurious warning "Failure to install fence" Chris Wilson
2010-05-27 12:18 ` [PATCH 09/11] drm/i915: Check error code whilst moving buffer to GTT domain Chris Wilson
2010-05-27 12:18 ` [PATCH 10/11] drm/i915: Reject bind_to_gtt() early if object > aperture Chris Wilson
2010-05-27 12:18 ` [PATCH 11/11] drm/i915: Cleanup after failed initialization of ringbuffers Chris Wilson
2010-05-28 18:01   ` Eric Anholt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1274962702-6530-8-git-send-email-chris@chris-wilson.co.uk \
    --to=chris@chris-wilson.co.uk \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=stable@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.