From fb218f2027048e199a76cccb9a131b2afd48ccbe Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Thu, 2 Jan 2020 13:17:06 +0000 Subject: drm/i915/gt: Discard stale context state from across idling Before we idle, on parking, we switch to the kernel context such that we have a scratch context loaded while the GPU idle, protecting any precious user state. Be paranoid and assume that the idle state may have been trashed, and reset the kernel_context image after idling. Signed-off-by: Chris Wilson Cc: Imre Deak Reviewed-by: Matthew Auld Reviewed-by: Mika Kuoppala Link: https://patchwork.freedesktop.org/patch/msgid/20200102131707.1463945-4-chris@chris-wilson.co.uk --- drivers/gpu/drm/i915/gt/mock_engine.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'drivers/gpu/drm/i915/gt/mock_engine.c') diff --git a/drivers/gpu/drm/i915/gt/mock_engine.c b/drivers/gpu/drm/i915/gt/mock_engine.c index 4e1eafa94be9..d0e68ce9aa51 100644 --- a/drivers/gpu/drm/i915/gt/mock_engine.c +++ b/drivers/gpu/drm/i915/gt/mock_engine.c @@ -152,6 +152,10 @@ static int mock_context_pin(struct intel_context *ce) return intel_context_active_acquire(ce); } +static void mock_context_reset(struct intel_context *ce) +{ +} + static const struct intel_context_ops mock_context_ops = { .alloc = mock_context_alloc, @@ -161,6 +165,7 @@ static const struct intel_context_ops mock_context_ops = { .enter = intel_context_enter_engine, .exit = intel_context_exit_engine, + .reset = mock_context_reset, .destroy = mock_context_destroy, }; -- cgit v1.2.3-59-g8ed1b