All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ben Widawsky <ben@bwidawsk.net>
To: intel-gfx@lists.freedesktop.org
Cc: Ben Widawsky <ben@bwidawsk.net>,
	Ben Widawsky <benjamin.widawsky@intel.com>
Subject: [PATCH 2/3] drm/i915: fix for when semaphore updates fail
Date: Wed, 11 Apr 2012 11:18:20 -0700	[thread overview]
Message-ID: <1334168301-4699-2-git-send-email-ben@bwidawsk.net> (raw)
In-Reply-To: <1334168301-4699-1-git-send-email-ben@bwidawsk.net>

This fixes a long standing issue where emitting the semaphore updates
may have failed, but we've already updated our internal data structure.

Reported-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Ben Widawsky <benjamin.widawsky@intel.com>
---
 drivers/gpu/drm/i915/i915_gem.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index 9fcdc9a..0115b12 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -2001,10 +2001,12 @@ i915_gem_object_sync(struct drm_i915_gem_object *obj,
 		seqno = request->seqno;
 	}
 
-	from->sync_seqno[idx] = seqno;
 
-	return to->sync_to(to, from, seqno - 1);
+	ret = to->sync_to(to, from, seqno - 1);
+	if (!ret)
+		from->sync_seqno[idx] = seqno;
 
+	return ret;
 }
 
 static void i915_gem_object_finish_gtt(struct drm_i915_gem_object *obj)
-- 
1.7.10

  reply	other threads:[~2012-04-11 18:19 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-11 18:18 [PATCH 1/3] drm/i915: i915_gem_object_sync must handle NULL Ben Widawsky
2012-04-11 18:18 ` Ben Widawsky [this message]
2012-04-11 18:42   ` [PATCH 2/3] drm/i915: fix for when semaphore updates fail Chris Wilson
2012-04-11 18:18 ` [PATCH 3/3] drm/i915: hide (seqno-1) in ringbuffer code Ben Widawsky
2012-04-11 18:43   ` Chris Wilson
2012-04-11 18:41 ` [PATCH 1/3] drm/i915: i915_gem_object_sync must handle NULL Chris Wilson
2012-04-11 19:01   ` Daniel Vetter

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=1334168301-4699-2-git-send-email-ben@bwidawsk.net \
    --to=ben@bwidawsk.net \
    --cc=benjamin.widawsky@intel.com \
    --cc=intel-gfx@lists.freedesktop.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.