public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
* [PATCH v3] drm/i915: check that rpm ref is held when accessing ringbuf in stolen mem
@ 2016-01-27 15:43 daniele.ceraolospurio
  2016-01-27 16:39 ` Ville Syrjälä
                   ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: daniele.ceraolospurio @ 2016-01-27 15:43 UTC (permalink / raw)
  To: intel-gfx

From: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>

While running some tests on the scheduler patches with rpm enabled I
came across a corruption in the ringbuffer, which was root-caused to
the GPU being suspended while commands were being emitted to the
ringbuffer. The access to memory was failing because the GPU needs to
be awake when accessing stolen memory (where my ringbuffer was located).
Since we have this constraint it looks like a sensible idea to check
that we hold a refcount when we access the rungbuffer.

v2: move the check from ring_begin to ringbuffer iomap time (Chris)
v3: update comment (Chris)

Cc: John Harrison <John.C.Harrison@Intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
---
 drivers/gpu/drm/i915/intel_ringbuffer.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.c b/drivers/gpu/drm/i915/intel_ringbuffer.c
index 6f5b511..133321a 100644
--- a/drivers/gpu/drm/i915/intel_ringbuffer.c
+++ b/drivers/gpu/drm/i915/intel_ringbuffer.c
@@ -2119,6 +2119,9 @@ int intel_pin_and_map_ringbuffer_obj(struct drm_device *dev,
 			return ret;
 		}
 
+		/* Access through the GTT requires the device to be awake. */
+		assert_rpm_wakelock_held(dev_priv);
+
 		ringbuf->virtual_start = ioremap_wc(dev_priv->gtt.mappable_base +
 						    i915_gem_obj_ggtt_offset(obj), ringbuf->size);
 		if (ringbuf->virtual_start == NULL) {
-- 
1.9.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2016-02-10  7:56 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-01-27 15:43 [PATCH v3] drm/i915: check that rpm ref is held when accessing ringbuf in stolen mem daniele.ceraolospurio
2016-01-27 16:39 ` Ville Syrjälä
2016-01-28 10:55   ` Daniele Ceraolo Spurio
2016-01-28 11:45     ` Chris Wilson
2016-01-28 12:09       ` Ville Syrjälä
2016-01-28 12:30         ` Chris Wilson
2016-01-27 16:44 ` Chris Wilson
2016-02-10  7:56   ` Daniel Vetter
2016-01-28  9:58 ` ✓ Fi.CI.BAT: success for drm/i915: check that rpm ref is held when accessing ringbuf in stolen mem (rev2) Patchwork
2016-01-28 16:23 ` Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox