summaryrefslogtreecommitdiff
path: root/sys/dev/pci/drm
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2013-12-01 14:23:49 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2013-12-01 14:23:49 +0000
commit44397257e02f0e5d2622eb7c937786c6b4da3c29 (patch)
tree00032d9166e6d7734ef126b29f591eb0c315845a /sys/dev/pci/drm
parentc84305d50839a8c215774a6f12c647ee78fe3715 (diff)
drm/i915: Fix write-read race with multiple rings
From Chris Wilson caf40bcc8f6751b723f0ec78e2f67beb771bfb68 in ubuntu 3.8 02978ff57a5bdfbf703d2bc5a4d933a53ede3144 in mainline linux
Diffstat (limited to 'sys/dev/pci/drm')
-rw-r--r--sys/dev/pci/drm/i915/i915_gem.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/dev/pci/drm/i915/i915_gem.c b/sys/dev/pci/drm/i915/i915_gem.c
index 4743a6a6b1a..7b37fb7e895 100644
--- a/sys/dev/pci/drm/i915/i915_gem.c
+++ b/sys/dev/pci/drm/i915/i915_gem.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: i915_gem.c,v 1.52 2013/12/01 12:58:33 kettenis Exp $ */
+/* $OpenBSD: i915_gem.c,v 1.53 2013/12/01 14:23:48 kettenis Exp $ */
/*
* Copyright (c) 2008-2009 Owain G. Ainsworth <oga@openbsd.org>
*
@@ -2020,6 +2020,10 @@ i915_gem_object_move_to_active(struct drm_i915_gem_object *obj,
u32 seqno = intel_ring_get_seqno(ring);
BUG_ON(ring == NULL);
+ if (obj->ring != ring && obj->last_write_seqno) {
+ /* Keep the seqno relative to the current ring */
+ obj->last_write_seqno = seqno;
+ }
obj->ring = ring;
/* Add a reference if we're newly entering the active list. */