diff mbox

[2/6] drm/i915/gtt: Don't restore the non-existent PDE for GGTT

Message ID 20180601093554.13083-2-chris@chris-wilson.co.uk (mailing list archive)
State New, archived
Headers show

Commit Message

Chris Wilson June 1, 2018, 9:35 a.m. UTC
On resume, we have to rewrite all the PDE entries for gen7 ppgtts. If we
switch on full-ppgtt, there is then one address space with no PDE, the
GGTT. Currently under aliasing-ppgtt, the GGTT address space does have
an associated ppgtt and so the restore works just fine. We would have a
similar problem if we tried disabling aliasing-ppgtt
(i915.enable_ppgtt=0). So skip the empty ppgtt, as being non-existent it
doesn't need restoring.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
---
 drivers/gpu/drm/i915/i915_gem_gtt.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Joonas Lahtinen June 1, 2018, 12:56 p.m. UTC | #1
On Fri, 2018-06-01 at 10:35 +0100, Chris Wilson wrote:
> On resume, we have to rewrite all the PDE entries for gen7 ppgtts. If we
> switch on full-ppgtt, there is then one address space with no PDE, the
> GGTT. Currently under aliasing-ppgtt, the GGTT address space does have
> an associated ppgtt and so the restore works just fine. We would have a
> similar problem if we tried disabling aliasing-ppgtt
> (i915.enable_ppgtt=0). So skip the empty ppgtt, as being non-existent it
> doesn't need restoring.
> 
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>

Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>

Regards, Joonas
Chris Wilson June 1, 2018, 1:55 p.m. UTC | #2
Quoting Joonas Lahtinen (2018-06-01 13:56:56)
> On Fri, 2018-06-01 at 10:35 +0100, Chris Wilson wrote:
> > On resume, we have to rewrite all the PDE entries for gen7 ppgtts. If we
> > switch on full-ppgtt, there is then one address space with no PDE, the
> > GGTT. Currently under aliasing-ppgtt, the GGTT address space does have
> > an associated ppgtt and so the restore works just fine. We would have a
> > similar problem if we tried disabling aliasing-ppgtt
> > (i915.enable_ppgtt=0). So skip the empty ppgtt, as being non-existent it
> > doesn't need restoring.
> > 
> > Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> > Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> 
> Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>

Pushed the first pair as simple standalone NULL pointer fixes. Thanks
for the review,
-Chris
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c b/drivers/gpu/drm/i915/i915_gem_gtt.c
index 344b572d0721..992efe1881c8 100644
--- a/drivers/gpu/drm/i915/i915_gem_gtt.c
+++ b/drivers/gpu/drm/i915/i915_gem_gtt.c
@@ -3665,6 +3665,8 @@  void i915_gem_restore_gtt_mappings(struct drm_i915_private *dev_priv)
 				ppgtt = dev_priv->mm.aliasing_ppgtt;
 			else
 				ppgtt = i915_vm_to_ppgtt(vm);
+			if (!ppgtt)
+				continue;
 
 			gen6_write_page_range(ppgtt, 0, ppgtt->base.total);
 		}