From 6574753e7d6af484c696b7bee194f1285079f179 Mon Sep 17 00:00:00 2001 From: Mika Kuoppala Date: Mon, 10 Mar 2014 18:51:47 +0200 Subject: [PATCH 1/3] drm/i915: Switch to fake context on older gens We have fake context, for hang_stats, in file_priv. If we 'switch' to this context, the related file descriptor gets correctly blamed if hang was introduced throught it. Signed-off-by: Mika Kuoppala --- drivers/gpu/drm/i915/i915_gem_context.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_gem_context.c b/drivers/gpu/drm/i915/i915_gem_context.c index ce41cff..b5a5837 100644 --- a/drivers/gpu/drm/i915/i915_gem_context.c +++ b/drivers/gpu/drm/i915/i915_gem_context.c @@ -775,9 +775,11 @@ int i915_switch_context(struct intel_ring_buffer *ring, BUG_ON(file && to == NULL); - /* We have the fake context, but don't supports switching. */ - if (!HAS_HW_CONTEXTS(ring->dev)) + /* We have the fake context */ + if (!HAS_HW_CONTEXTS(ring->dev)) { + ring->last_context = to; return 0; + } return do_switch(ring, to); } -- 1.7.9.5