* [PATCH RESEND] drm/i915: Fix display problems after resume
@ 2022-10-05 12:11 Thomas Hellström
2022-10-05 13:32 ` Matthew Auld
2022-10-10 7:44 ` [Intel-gfx] " Andrzej Hajda
0 siblings, 2 replies; 3+ messages in thread
From: Thomas Hellström @ 2022-10-05 12:11 UTC (permalink / raw)
To: intel-gfx
Cc: Thomas Hellström, Kevin Boulain, David de Sousa, dri-devel,
stable, Matthew Auld
Commit 39a2bd34c933 ("drm/i915: Use the vma resource as argument for gtt
binding / unbinding") introduced a regression that due to the vma resource
tracking of the binding state, dpt ptes were not correctly repopulated.
Fix this by clearing the vma resource state before repopulating.
The state will subsequently be restored by the bind_vma operation.
Fixes: 39a2bd34c933 ("drm/i915: Use the vma resource as argument for gtt binding / unbinding")
Signed-off-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220912121957.31310-1-thomas.hellstrom@linux.intel.com
Cc: Matthew Auld <matthew.auld@intel.com>
Cc: intel-gfx@lists.freedesktop.org
Cc: <stable@vger.kernel.org> # v5.18+
Reported-and-tested-by: Kevin Boulain <kevinboulain@gmail.com>
Tested-by: David de Sousa <davidesousa@gmail.com>
---
drivers/gpu/drm/i915/gt/intel_ggtt.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/i915/gt/intel_ggtt.c b/drivers/gpu/drm/i915/gt/intel_ggtt.c
index b31fe0fb013f..5c67e49aacf6 100644
--- a/drivers/gpu/drm/i915/gt/intel_ggtt.c
+++ b/drivers/gpu/drm/i915/gt/intel_ggtt.c
@@ -1275,10 +1275,16 @@ bool i915_ggtt_resume_vm(struct i915_address_space *vm)
atomic_read(&vma->flags) & I915_VMA_BIND_MASK;
GEM_BUG_ON(!was_bound);
- if (!retained_ptes)
+ if (!retained_ptes) {
+ /*
+ * Clear the bound flags of the vma resource to allow
+ * ptes to be repopulated.
+ */
+ vma->resource->bound_flags = 0;
vma->ops->bind_vma(vm, NULL, vma->resource,
obj ? obj->cache_level : 0,
was_bound);
+ }
if (obj) { /* only used during resume => exclusive access */
write_domain_objs |= fetch_and_zero(&obj->write_domain);
obj->read_domains |= I915_GEM_DOMAIN_GTT;
--
2.37.3
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH RESEND] drm/i915: Fix display problems after resume
2022-10-05 12:11 [PATCH RESEND] drm/i915: Fix display problems after resume Thomas Hellström
@ 2022-10-05 13:32 ` Matthew Auld
2022-10-10 7:44 ` [Intel-gfx] " Andrzej Hajda
1 sibling, 0 replies; 3+ messages in thread
From: Matthew Auld @ 2022-10-05 13:32 UTC (permalink / raw)
To: Thomas Hellström, intel-gfx
Cc: Kevin Boulain, David de Sousa, stable, dri-devel
Hi Thomas,
On 05/10/2022 13:11, Thomas Hellström wrote:
> Commit 39a2bd34c933 ("drm/i915: Use the vma resource as argument for gtt
> binding / unbinding") introduced a regression that due to the vma resource
> tracking of the binding state, dpt ptes were not correctly repopulated.
> Fix this by clearing the vma resource state before repopulating.
> The state will subsequently be restored by the bind_vma operation.
>
> Fixes: 39a2bd34c933 ("drm/i915: Use the vma resource as argument for gtt binding / unbinding")
> Signed-off-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
> Link: https://patchwork.freedesktop.org/patch/msgid/20220912121957.31310-1-thomas.hellstrom@linux.intel.com
> Cc: Matthew Auld <matthew.auld@intel.com>
> Cc: intel-gfx@lists.freedesktop.org
> Cc: <stable@vger.kernel.org> # v5.18+
> Reported-and-tested-by: Kevin Boulain <kevinboulain@gmail.com>
> Tested-by: David de Sousa <davidesousa@gmail.com>
Reviewed-by: Matthew Auld <matthew.auld@intel.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Intel-gfx] [PATCH RESEND] drm/i915: Fix display problems after resume
2022-10-05 12:11 [PATCH RESEND] drm/i915: Fix display problems after resume Thomas Hellström
2022-10-05 13:32 ` Matthew Auld
@ 2022-10-10 7:44 ` Andrzej Hajda
1 sibling, 0 replies; 3+ messages in thread
From: Andrzej Hajda @ 2022-10-10 7:44 UTC (permalink / raw)
To: Thomas Hellström, intel-gfx
Cc: Kevin Boulain, David de Sousa, stable, dri-devel, Matthew Auld
On 05.10.2022 14:11, Thomas Hellström wrote:
> Commit 39a2bd34c933 ("drm/i915: Use the vma resource as argument for gtt
> binding / unbinding") introduced a regression that due to the vma resource
> tracking of the binding state, dpt ptes were not correctly repopulated.
> Fix this by clearing the vma resource state before repopulating.
> The state will subsequently be restored by the bind_vma operation.
>
> Fixes: 39a2bd34c933 ("drm/i915: Use the vma resource as argument for gtt binding / unbinding")
> Signed-off-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
> Link: https://patchwork.freedesktop.org/patch/msgid/20220912121957.31310-1-thomas.hellstrom@linux.intel.com
> Cc: Matthew Auld <matthew.auld@intel.com>
> Cc: intel-gfx@lists.freedesktop.org
> Cc: <stable@vger.kernel.org> # v5.18+
> Reported-and-tested-by: Kevin Boulain <kevinboulain@gmail.com>
> Tested-by: David de Sousa <davidesousa@gmail.com>
> ---
> drivers/gpu/drm/i915/gt/intel_ggtt.c | 8 +++++++-
> 1 file changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/gt/intel_ggtt.c b/drivers/gpu/drm/i915/gt/intel_ggtt.c
> index b31fe0fb013f..5c67e49aacf6 100644
> --- a/drivers/gpu/drm/i915/gt/intel_ggtt.c
> +++ b/drivers/gpu/drm/i915/gt/intel_ggtt.c
> @@ -1275,10 +1275,16 @@ bool i915_ggtt_resume_vm(struct i915_address_space *vm)
> atomic_read(&vma->flags) & I915_VMA_BIND_MASK;
>
> GEM_BUG_ON(!was_bound);
> - if (!retained_ptes)
> + if (!retained_ptes) {
> + /*
> + * Clear the bound flags of the vma resource to allow
> + * ptes to be repopulated.
> + */
> + vma->resource->bound_flags = 0;
Personally I would put this at suspend path, if possible.
Anyway:
Reviewed-by: Andrzej Hajda <andrzej.hajda@intel.com>
Regards
Andrzej
> vma->ops->bind_vma(vm, NULL, vma->resource,
> obj ? obj->cache_level : 0,
> was_bound);
> + }
> if (obj) { /* only used during resume => exclusive access */
> write_domain_objs |= fetch_and_zero(&obj->write_domain);
> obj->read_domains |= I915_GEM_DOMAIN_GTT;
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-10-10 7:44 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-10-05 12:11 [PATCH RESEND] drm/i915: Fix display problems after resume Thomas Hellström
2022-10-05 13:32 ` Matthew Auld
2022-10-10 7:44 ` [Intel-gfx] " Andrzej Hajda
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox