Skip to contentSkip to conversation

drm/i915: fix sanitize_enable_ppgtt for full PPGTT

PATCH In review Jesse Barnes 2 participants 3 messages Jun 25, 2014 – Jun 26, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/i915: fix sanitize_enable_ppgtt for full PPGTT

Apparently trinary logic is hard. We were falling through all the forced cases and simply enabling aliasing PPGTT or not based on hardware, rather than full PPGTT if available.

References: https://bugs.freedesktop.org/show_bug.cgi?id=80083

---
 drivers/gpu/drm/i915/i915_gem_gtt.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/i915_gem_gtt.c +7 -1
index a4153ee..86521a7 100644
@@ -69,7 +69,13 @@ static int sanitize_enable_ppgtt(struct drm_device *dev, int enable_ppgtt)
 		return 0;
 	}
 
-	return HAS_ALIASING_PPGTT(dev) ? 1 : 0;
+	/* Fall through to auto-detect */
+	if (HAS_PPGTT(dev))
+		return 2;
+	else if (HAS_ALIASING_PPGTT(dev))
+		return 1;
+
+	return 0;
 }
 
 
Signature · 1 line
1.9.1
#1 lore raw
Quoted 16 lines · Jesse Barnes

Apparently trinary logic is hard. We were falling through all the forced cases and simply enabling aliasing PPGTT or not based on hardware, rather than full PPGTT if available.

References: https://bugs.freedesktop.org/show_bug.cgi?id=80083

---
 drivers/gpu/drm/i915/i915_gem_gtt.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/i915_gem_gtt.c +0 -0
index a4153ee..86521a7 100644
@@ -69,7 +69,13 @@ static int sanitize_enable_ppgtt(struct drm_device *dev, int enable_ppgtt)
 		return 0;

drivers/gpu/drm/i915/i915_gem_gtt.c static int sanitize_enable_ppgtt(struct drm_device *dev, int enable_ppgtt) · line 78

Quoted 10 lines
drivers/gpu/drm/i915/i915_gem_gtt.c +7 -1
 	}
 
-	return HAS_ALIASING_PPGTT(dev) ? 1 : 0;
+	/* Fall through to auto-detect */
+	if (HAS_PPGTT(dev))
+		return 2;
+	else if (HAS_ALIASING_PPGTT(dev))
+		return 1;
+
+	return 0;

I don't get it. This would just enable full ppgtt by default. But full ppgtt is still a bit broken so I don't think we want this.

The dmesg in the bug shows that ppgtt was forced off by the PCI revision check, so that part seems to have worked. Looks like the tests doesn't expect the batches to be accepted by the kernel, but the cmd parser is bypassed when ppgtt is disabled, so the test fails.

Signature · 2 lines
Ville Syrjälä
Intel OTC
#2 lore raw
Quoted 31 lines · On Thu, 26 Jun 2014 17:59:48 +0300 Ville Syrjälä…
Quoted 16 lines · Jesse Barnes

Apparently trinary logic is hard. We were falling through all the forced cases and simply enabling aliasing PPGTT or not based on hardware, rather than full PPGTT if available.

References: https://bugs.freedesktop.org/show_bug.cgi?id=80083

---
 drivers/gpu/drm/i915/i915_gem_gtt.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/i915_gem_gtt.c +0 -0
index a4153ee..86521a7 100644
@@ -69,7 +69,13 @@ static int sanitize_enable_ppgtt(struct drm_device *dev, int enable_ppgtt)
 		return 0;

drivers/gpu/drm/i915/i915_gem_gtt.c static int sanitize_enable_ppgtt(struct drm_device *dev, int enable_ppgtt) · line 78

Quoted 10 lines
drivers/gpu/drm/i915/i915_gem_gtt.c +7 -1
 	}
 
-	return HAS_ALIASING_PPGTT(dev) ? 1 : 0;
+	/* Fall through to auto-detect */
+	if (HAS_PPGTT(dev))
+		return 2;
+	else if (HAS_ALIASING_PPGTT(dev))
+		return 1;
+
+	return 0;

I don't get it. This would just enable full ppgtt by default. But full ppgtt is still a bit broken so I don't think we want this.

Quoted 4 lines

The dmesg in the bug shows that ppgtt was forced off by the PCI revision check, so that part seems to have worked. Looks like the tests doesn't expect the batches to be accepted by the kernel, but the cmd parser is bypassed when ppgtt is disabled, so the test fails.

Yeah and I was testing on a platform that had PPGTT support, and figured I had screwed up the PPGTT enable. But I guess not, and we can expect these tests to fail until we have the command parser enabled everywhere.

Signature · 5 lines
Jesse Barnes, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx