]>
Commit | Line | Data |
---|---|---|
cf56c8b2 GKH |
1 | From 6c482c62a635aa4f534d2439fbf8afa37452b986 Mon Sep 17 00:00:00 2001 |
2 | From: =?UTF-8?q?Thomas=20Hellstr=C3=B6m?= <thomas.hellstrom@linux.intel.com> | |
3 | Date: Wed, 5 Oct 2022 14:11:59 +0200 | |
4 | Subject: drm/i915: Fix display problems after resume | |
5 | MIME-Version: 1.0 | |
6 | Content-Type: text/plain; charset=UTF-8 | |
7 | Content-Transfer-Encoding: 8bit | |
8 | ||
9 | From: Thomas Hellström <thomas.hellstrom@linux.intel.com> | |
10 | ||
11 | commit 6c482c62a635aa4f534d2439fbf8afa37452b986 upstream. | |
12 | ||
13 | Commit 39a2bd34c933 ("drm/i915: Use the vma resource as argument for gtt | |
14 | binding / unbinding") introduced a regression that due to the vma resource | |
15 | tracking of the binding state, dpt ptes were not correctly repopulated. | |
16 | Fix this by clearing the vma resource state before repopulating. | |
17 | The state will subsequently be restored by the bind_vma operation. | |
18 | ||
19 | Fixes: 39a2bd34c933 ("drm/i915: Use the vma resource as argument for gtt binding / unbinding") | |
20 | Signed-off-by: Thomas Hellström <thomas.hellstrom@linux.intel.com> | |
21 | Link: https://patchwork.freedesktop.org/patch/msgid/20220912121957.31310-1-thomas.hellstrom@linux.intel.com | |
22 | Cc: Matthew Auld <matthew.auld@intel.com> | |
23 | Cc: intel-gfx@lists.freedesktop.org | |
24 | Cc: <stable@vger.kernel.org> # v5.18+ | |
25 | Reported-and-tested-by: Kevin Boulain <kevinboulain@gmail.com> | |
26 | Tested-by: David de Sousa <davidesousa@gmail.com> | |
27 | Reviewed-by: Matthew Auld <matthew.auld@intel.com> | |
28 | Reviewed-by: Andrzej Hajda <andrzej.hajda@intel.com> | |
29 | Signed-off-by: Matthew Auld <matthew.auld@intel.com> | |
30 | Link: https://patchwork.freedesktop.org/patch/msgid/20221005121159.340245-1-thomas.hellstrom@linux.intel.com | |
31 | (cherry picked from commit bc2472538c0d1cce334ffc9e97df0614cd2b1469) | |
32 | Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> | |
33 | Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> | |
34 | --- | |
35 | drivers/gpu/drm/i915/gt/intel_ggtt.c | 8 +++++++- | |
36 | 1 file changed, 7 insertions(+), 1 deletion(-) | |
37 | ||
38 | --- a/drivers/gpu/drm/i915/gt/intel_ggtt.c | |
39 | +++ b/drivers/gpu/drm/i915/gt/intel_ggtt.c | |
40 | @@ -1267,10 +1267,16 @@ bool i915_ggtt_resume_vm(struct i915_add | |
41 | atomic_read(&vma->flags) & I915_VMA_BIND_MASK; | |
42 | ||
43 | GEM_BUG_ON(!was_bound); | |
44 | - if (!retained_ptes) | |
45 | + if (!retained_ptes) { | |
46 | + /* | |
47 | + * Clear the bound flags of the vma resource to allow | |
48 | + * ptes to be repopulated. | |
49 | + */ | |
50 | + vma->resource->bound_flags = 0; | |
51 | vma->ops->bind_vma(vm, NULL, vma->resource, | |
52 | obj ? obj->cache_level : 0, | |
53 | was_bound); | |
54 | + } | |
55 | if (obj) { /* only used during resume => exclusive access */ | |
56 | write_domain_objs |= fetch_and_zero(&obj->write_domain); | |
57 | obj->read_domains |= I915_GEM_DOMAIN_GTT; |