Skip to contentSkip to conversation

drm/i915: Enable full PPGTT on gen7

PATCH Applied Michel Thierry 4 participants 11 messages Sep 5, 2014 – Sep 9, 2014

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

PATCH 1/1 drm/i915: Enable full PPGTT on gen7

Use full PPGTT as the default option in gen7.
Note that aliasing PPGTT is the default option for gen8 (see HAS_PPGTT).

This may well come back to bite me later.

---
 drivers/gpu/drm/i915/i915_gem_gtt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/i915/i915_gem_gtt.c +1 -1
index fc46647..30ab56a 100644
@@ -59,7 +59,7 @@ static int sanitize_enable_ppgtt(struct drm_device *dev, int enable_ppgtt)
 		return 0;
 	}
 
-	return HAS_ALIASING_PPGTT(dev) ? 1 : 0;
+	return HAS_PPGTT(dev) ? 2 : HAS_ALIASING_PPGTT(dev) ? 1 : 0;
 }
 
 
Signature · 1 line
2.0.3
#1 lore raw
Quoted 6 lines · Michel Thierry

Use full PPGTT as the default option in gen7.
Note that aliasing PPGTT is the default option for gen8 (see HAS_PPGTT).

This may well come back to bite me later.

Queued for -next, thanks for the patch. And I've added a note that gen8 is blocked on execlists and other troubles for now.
-Daniel

Quoted 24 lines
---
 drivers/gpu/drm/i915/i915_gem_gtt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/i915/i915_gem_gtt.c +1 -1
index fc46647..30ab56a 100644
@@ -59,7 +59,7 @@ static int sanitize_enable_ppgtt(struct drm_device *dev, int enable_ppgtt)
 		return 0;
 	}
 
-	return HAS_ALIASING_PPGTT(dev) ? 1 : 0;
+	return HAS_PPGTT(dev) ? 2 : HAS_ALIASING_PPGTT(dev) ? 1 : 0;
 }
 
 
Signature · 6 lines
2.0.3

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
#2 lore raw
In reply to Michel Thierry
Quoted 4 lines · Michel Thierry

Use full PPGTT as the default option in gen7.
Note that aliasing PPGTT is the default option for gen8 (see HAS_PPGTT).

This may well come back to bite me later.

Indeed. So something I spotted was that bspec mentions that the per-ring PDE registers (RING_PP_DIR_DCLV and RING_PP_DIR_BASE) are stored in the logical context and so the registers are restored along with the context. If this is correct what happens when we switch logical contexts on RCS whilst we have active work on BCS etc? Does this mean that we have to serialise context switches across rings, or is my reading of the bspec false?
-Chris

Signature · 1 line
Chris Wilson, Intel Open Source Technology Centre
#3 lore raw
Quoted 6 lines · Chris Wilson
Quoted 4 lines · Michel Thierry

Use full PPGTT as the default option in gen7.
Note that aliasing PPGTT is the default option for gen8 (see HAS_PPGTT).

This may well come back to bite me later.

Quoted 7 lines

Indeed. So something I spotted was that bspec mentions that the per-ring PDE registers (RING_PP_DIR_DCLV and RING_PP_DIR_BASE) are stored in the logical context and so the registers are restored along with the context. If this is correct what happens when we switch logical contexts on RCS whilst we have active work on BCS etc? Does this mean that we have to serialise context switches across rings, or is my reading of the bspec false?

How does rcs PP_DIR_* affect bcs? Also IIRC that stuff is part of the execlist context which isn't saved/restored unless execlists are actually enabled. IIRC when I tried it, snb did reserve the space for that stuff in the context image but didn't save/restore it, but ivb+ didn't even reserve the space.

Signature · 2 lines
Ville Syrjälä
Intel OTC
#4 lore raw
Quoted 4 lines · Ville Syrjälä
Quoted 3 lines · Chris Wilson
Quoted 2 lines · Michel Thierry

Use full PPGTT as the default option in gen7.
Note that aliasing PPGTT is the default option for gen8 (see

HAS_PPGTT).

Quoted 12 lines
Quoted 5 lines
Quoted 2 lines

This may well come back to bite me later.

Indeed. So something I spotted was that bspec mentions that the per-ring PDE registers (RING_PP_DIR_DCLV and RING_PP_DIR_BASE) are stored in

the

Quoted 5 lines

logical context and so the registers are restored along with the context. If this is correct what happens when we switch logical contexts on RCS whilst we have active work on BCS etc? Does this mean that we have to serialise context switches across rings, or is my reading of the bspec false?

Quoted 6 lines

How does rcs PP_DIR_* affect bcs? Also IIRC that stuff is part of the execlist context which isn't saved/restored unless execlists are actually enabled. IIRC when I tried it, snb did reserve the space for that stuff in the context image but didn't save/restore it, but ivb+ didn't even reserve the space.

Yes, my understanding is that these registers are per engine, and bcs couldn't be affected by rcs.

-Michel

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

#5 lore raw
Quoted 21 lines · Michel
Quoted 4 lines · Ville Syrjälä
Quoted 3 lines · Chris Wilson
Quoted 2 lines · Michel Thierry

Use full PPGTT as the default option in gen7.
Note that aliasing PPGTT is the default option for gen8 (see

HAS_PPGTT).

Quoted 12 lines
Quoted 5 lines
Quoted 2 lines

This may well come back to bite me later.

Indeed. So something I spotted was that bspec mentions that the per-ring PDE registers (RING_PP_DIR_DCLV and RING_PP_DIR_BASE) are stored in

the

Quoted 5 lines

logical context and so the registers are restored along with the context. If this is correct what happens when we switch logical contexts on RCS whilst we have active work on BCS etc? Does this mean that we have to serialise context switches across rings, or is my reading of the bspec false?

Quoted 8 lines
Quoted 6 lines

How does rcs PP_DIR_* affect bcs? Also IIRC that stuff is part of the execlist context which isn't saved/restored unless execlists are actually enabled. IIRC when I tried it, snb did reserve the space for that stuff in the context image but didn't save/restore it, but ivb+ didn't even reserve the space.

Yes, my understanding is that these registers are per engine, and bcs couldn't be affected by rcs.

They are per-engine, but are they stored in the logical context (which is what bspec says afaict) and so reloaded with the wrong values when RCS executes MI_SET_CONTEXT? That is the question.
-Chris

Signature · 1 line
Chris Wilson, Intel Open Source Technology Centre
#6 lore raw
Quoted 28 lines · Chris Wilson
Quoted 27 lines · Michel
Quoted 4 lines · Ville Syrjälä
Quoted 3 lines · Chris Wilson
Quoted 2 lines · Michel Thierry

Use full PPGTT as the default option in gen7.
Note that aliasing PPGTT is the default option for gen8 (see

HAS_PPGTT).

Quoted 18 lines
Quoted 5 lines
Quoted 2 lines

This may well come back to bite me later.

Indeed. So something I spotted was that bspec mentions that the per-ring PDE registers (RING_PP_DIR_DCLV and RING_PP_DIR_BASE) are stored in

the

Quoted 5 lines

logical context and so the registers are restored along with the context. If this is correct what happens when we switch logical contexts on RCS whilst we have active work on BCS etc? Does this mean that we have to serialise context switches across rings, or is my reading of the bspec false?

How does rcs PP_DIR_* affect bcs? Also IIRC that stuff is part of the execlist context which isn't saved/restored unless execlists are actually enabled. IIRC when I tried it, snb did reserve the space for that stuff in the context image but didn't save/restore it, but ivb+ didn't even reserve the space.

Quoted 6 lines
Quoted 2 lines

Yes, my understanding is that these registers are per engine, and bcs couldn't be affected by rcs.

They are per-engine, but are they stored in the logical context (which is what bspec says afaict) and so reloaded with the wrong values when RCS executes MI_SET_CONTEXT? That is the question.

I don't see any !RCS PP_DIR_* registers listed in the execlist context. Also BSpec says that RCS PP_DIR_* registers are stored in the power context rather than the execlist context in ring buffer mode. BSpec is a bit thin on what happens to these registers on other engines eg. during rc6. I guess they must have their own power contexts.

Signature · 2 lines
Ville Syrjälä
Intel OTC
#7 lore raw
Quoted 36 lines · Ville Syrjälä
Quoted 28 lines · Chris Wilson
Quoted 27 lines · Michel
Quoted 4 lines · Ville Syrjälä
Quoted 3 lines · Chris Wilson
Quoted 2 lines · Michel Thierry

Use full PPGTT as the default option in gen7.
Note that aliasing PPGTT is the default option for gen8 (see

HAS_PPGTT).

Quoted 18 lines
Quoted 5 lines
Quoted 2 lines

This may well come back to bite me later.

Indeed. So something I spotted was that bspec mentions that the per-ring PDE registers (RING_PP_DIR_DCLV and RING_PP_DIR_BASE) are stored in

the

Quoted 5 lines

logical context and so the registers are restored along with the context. If this is correct what happens when we switch logical contexts on RCS whilst we have active work on BCS etc? Does this mean that we have to serialise context switches across rings, or is my reading of the bspec false?

How does rcs PP_DIR_* affect bcs? Also IIRC that stuff is part of the execlist context which isn't saved/restored unless execlists are actually enabled. IIRC when I tried it, snb did reserve the space for that stuff in the context image but didn't save/restore it, but ivb+ didn't even reserve the space.

Quoted 6 lines
Quoted 2 lines

Yes, my understanding is that these registers are per engine, and bcs couldn't be affected by rcs.

They are per-engine, but are they stored in the logical context (which is what bspec says afaict) and so reloaded with the wrong values when RCS executes MI_SET_CONTEXT? That is the question.

Quoted 5 lines

I don't see any !RCS PP_DIR_* registers listed in the execlist context. Also BSpec says that RCS PP_DIR_* registers are stored in the power context rather than the execlist context in ring buffer mode. BSpec is a bit thin on what happens to these registers on other engines eg. during rc6. I guess they must have their own power contexts.

Cool. I was read an old copy of the bspec offline, so hopefully I can just blame it on early cut'n'pasting.

I wrote igt/gem_ppgtt to try and race MI_SET_CONTEXT against a BCS workload and that seems fairly convincing that the PP_DIR registers are unaffected by the context restore.

Oh, wait. It just uses the default-context on each fd, i.e. doesn't actually perform the context restores. Will check back later... -Chris

Signature · 1 line
Chris Wilson, Intel Open Source Technology Centre
#8 lore raw
Quoted 46 lines · Chris Wilson
Quoted 36 lines · Ville Syrjälä
Quoted 28 lines · Chris Wilson
Quoted 27 lines · Michel
Quoted 4 lines · Ville Syrjälä
Quoted 3 lines · Chris Wilson
Quoted 2 lines · Michel Thierry

Use full PPGTT as the default option in gen7.
Note that aliasing PPGTT is the default option for gen8 (see

HAS_PPGTT).

Quoted 18 lines
Quoted 5 lines
Quoted 2 lines

This may well come back to bite me later.

Indeed. So something I spotted was that bspec mentions that the per-ring PDE registers (RING_PP_DIR_DCLV and RING_PP_DIR_BASE) are stored in

the

Quoted 5 lines

logical context and so the registers are restored along with the context. If this is correct what happens when we switch logical contexts on RCS whilst we have active work on BCS etc? Does this mean that we have to serialise context switches across rings, or is my reading of the bspec false?

How does rcs PP_DIR_* affect bcs? Also IIRC that stuff is part of the execlist context which isn't saved/restored unless execlists are actually enabled. IIRC when I tried it, snb did reserve the space for that stuff in the context image but didn't save/restore it, but ivb+ didn't even reserve the space.

Quoted 6 lines
Quoted 2 lines

Yes, my understanding is that these registers are per engine, and bcs couldn't be affected by rcs.

They are per-engine, but are they stored in the logical context (which is what bspec says afaict) and so reloaded with the wrong values when RCS executes MI_SET_CONTEXT? That is the question.

Quoted 5 lines

I don't see any !RCS PP_DIR_* registers listed in the execlist context. Also BSpec says that RCS PP_DIR_* registers are stored in the power context rather than the execlist context in ring buffer mode. BSpec is a bit thin on what happens to these registers on other engines eg. during rc6. I guess they must have their own power contexts.

Cool. I was read an old copy of the bspec offline, so hopefully I can just blame it on early cut'n'pasting.

Quoted 6 lines

I wrote igt/gem_ppgtt to try and race MI_SET_CONTEXT against a BCS workload and that seems fairly convincing that the PP_DIR registers are unaffected by the context restore.

Oh, wait. It just uses the default-context on each fd, i.e. doesn't actually perform the context restores. Will check back later...

We should throw a ->switch_mm on top of each context switch already to make sure the pp switch actually happened. So worst we do load the pp on rcs twicw and we could optimize that away if we just restore the context. -Daniel

Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
#9 lore raw
Quoted 7 lines · Daniel Vetter
Quoted 2 lines · Chris Wilson

Oh, wait. It just uses the default-context on each fd, i.e. doesn't actually perform the context restores. Will check back later...

We should throw a ->switch_mm on top of each context switch already to make sure the pp switch actually happened. So worst we do load the pp on rcs twicw and we could optimize that away if we just restore the context.

I just meant the test is not actually testing my theory that MI_SET_CONTEXT could interfere with the PP_DIR on other engines. -Chris

Signature · 1 line
Chris Wilson, Intel Open Source Technology Centre
#10 lore raw
In reply to Chris Wilson
Quoted 2 lines · Chris Wilson

Oh, wait. It just uses the default-context on each fd, i.e. doesn't actually perform the context restores. Will check back later...

A bit more experimentation (igt/gem_ppgtt/bcs-vs-rcs-ctxN) and I am happy that this was a non-issue.
-Chris

Signature · 1 line
Chris Wilson, Intel Open Source Technology Centre