Skip to contentSkip to conversation

FAILED: patch "[PATCH] drm/i915: Perform an invalidate prior to executing golden" failed to apply to 4.13-stable tree

PATCH [email protected] 1 participant 1 message Sep 4, 2017

Subsystems (3)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

The patch below does not apply to the 4.13-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.

thanks,

greg k-h

------------------ original commit in Linus's tree ------------------

Quoted 1 line

From 802673d66f8a6ded5d2689d597853c7bb3a70163 Mon Sep 17 00:00:00 2001

From: Chris Wilson <[email protected]>
Date: Tue, 8 Aug 2017 14:19:04 +0100
Subject: [PATCH] drm/i915: Perform an invalidate prior to executing golden
renderstate

As we may have just bound the renderstate into the GGTT for execution, we need to ensure that the GTT TLB are also flushed.

On snb-gt2, this would cause a random GPU hang at the start of a new context (e.g. boot) and on snb-gt1, it was causing the renderstate batch to take ~10s. It was the GPU hang that revealed the truth, as the CS gleefully executed beyond the end of the golden renderstate batch, a good indicator for a GTT TLB miss.

Fixes 20fe17aa52dc ("drm/i915: Remove redundant TLB invalidate on switching contexts")
Cc Mika Kuoppala <[email protected]>
Cc <[email protected]> # v4.12-rc1+
drivers/gpu/drm/i915/i915_gem_render_state.c +4 -0
index 7032c542a9b1..4dd4c2159a92 100644
@@ -242,6 +242,10 @@ int i915_gem_render_state_emit(struct drm_i915_gem_request *req)
 			goto err_unpin;
 	}
 
+	ret = req->engine->emit_flush(req, EMIT_INVALIDATE);
+	if (ret)
+		goto err_unpin;
+
 	ret = req->engine->emit_bb_start(req,
 					 so->batch_offset, so->batch_size,
 					 I915_DISPATCH_SECURE);