Skip to contentSkip to conversation

drm/i915: enable MI_WTF bit; I mean MI_FLUSH

PATCH In review Ben Widawsky 3 participants 4 messages Jan 19, 2012

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

PATCH 1/1 drm/i915: enable MI_WTF bit; I mean MI_FLUSH

We've seen a few patches now which switch the flush enable bit from bit 11 to bit 12 (as the documentation suggests it should be). However this turned out to be problematic for us.

The simulator has shed some light for us. It's not bit 11, and it's not bit 12; it's both. Instead of renaming the bits according to the docs since we're still really not sure, I've decided to just make the MI_FLUSH_ENABLE be both bits. As an aside, the simulator still makes a distinction for these two bits, however the error message doesn't seem to.

I don't believe this is actually required for the simulator to be function, but it does produce an annoying error message every time MI_FLUSH is used without this.

---
 drivers/gpu/drm/i915/i915_reg.h         |    2 +-
 drivers/gpu/drm/i915/intel_ringbuffer.c |    3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/i915_reg.h +1 -1
index 771a058..a161ad8 100644
@@ -391,7 +391,7 @@
 
 #define MI_MODE		0x0209c
 # define VS_TIMER_DISPATCH				(1 << 6)
-# define MI_FLUSH_ENABLE				(1 << 11)
+# define MI_FLUSH_ENABLE				(3 << 11)
 
 #define GFX_MODE	0x02520
 #define GFX_MODE_GEN7	0x0229c
drivers/gpu/drm/i915/intel_ringbuffer.c +2 -1
index ca70e2f..e0837fd 100644
@@ -399,8 +399,9 @@ static int init_render_ring(struct intel_ring_buffer *ring)
 
 	if (INTEL_INFO(dev)->gen > 3) {
 		int mode = VS_TIMER_DISPATCH << 16 | VS_TIMER_DISPATCH;
-		if (IS_GEN6(dev) || IS_GEN7(dev))
+		if (IS_GEN6(dev) || IS_GEN7(dev)) {
 			mode |= MI_FLUSH_ENABLE << 16 | MI_FLUSH_ENABLE;
+		}
 		I915_WRITE(MI_MODE, mode);
 		if (IS_GEN7(dev))
 			I915_WRITE(GFX_MODE_GEN7,
Signature · 1 line
1.7.8.3
#1 lore raw

PATCH 1/1 drm/i915: enable MI_WTF bit; I mean MI_FLUSH

We've seen a few patches now which switch the flush enable bit from bit 11 to bit 12 (as the documentation suggests it should be). However this turned out to be problematic for us.

The simulator has shed some light for us. It's not bit 11, and it's not bit 12; it's both. Instead of renaming the bits according to the docs since we're still really not sure, I've decided to just make the MI_FLUSH_ENABLE be both bits. As an aside, the simulator still makes a distinction for these two bits, however the error message doesn't seem to.

I don't believe this is actually required for the simulator to be function, but it does produce an annoying error message every time MI_FLUSH is used without this.

v2: The first version had an old hunk in it.

---
 drivers/gpu/drm/i915/i915_reg.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/gpu/drm/i915/i915_reg.h +1 -1
index 771a058..a161ad8 100644
@@ -391,7 +391,7 @@
 
 #define MI_MODE		0x0209c
 # define VS_TIMER_DISPATCH				(1 << 6)
-# define MI_FLUSH_ENABLE				(1 << 11)
+# define MI_FLUSH_ENABLE				(3 << 11)
 
 #define GFX_MODE	0x02520
 #define GFX_MODE_GEN7	0x0229c
Signature · 1 line
1.7.8.3
#2 lore raw
Quoted 11 lines · Ben Widawsky

We've seen a few patches now which switch the flush enable bit from bit 11 to bit 12 (as the documentation suggests it should be). However this turned out to be problematic for us.

The simulator has shed some light for us. It's not bit 11, and it's not bit 12; it's both. Instead of renaming the bits according to the docs since we're still really not sure, I've decided to just make the MI_FLUSH_ENABLE be both bits. As an aside, the simulator still makes a distinction for these two bits, however the error message doesn't seem to.

Quoted 3 lines

I don't believe this is actually required for the simulator to be function, but it does produce an annoying error message every time MI_FLUSH is used without this.

As were changing this to a value that is still inconsistent with the specs, can we please put a note here as to why this value was chosen and caveat lector.
-Chris

Signature · 1 line
Chris Wilson, Intel Open Source Technology Centre
#3 lore raw
In reply to Ben Widawsky
Quoted 11 lines · Ben Widawsky

We've seen a few patches now which switch the flush enable bit from bit 11 to bit 12 (as the documentation suggests it should be). However this turned out to be problematic for us.

The simulator has shed some light for us. It's not bit 11, and it's not bit 12; it's both. Instead of renaming the bits according to the docs since we're still really not sure, I've decided to just make the MI_FLUSH_ENABLE be both bits. As an aside, the simulator still makes a distinction for these two bits, however the error message doesn't seem to.

Quoted 5 lines

I don't believe this is actually required for the simulator to be function, but it does produce an annoying error message every time MI_FLUSH is used without this.

Because HAS seems to only be able to run ivb fulsim: Have you checked snb fulsim source for this warning and it's also there? Your changelog is also silent on how well this works on real hw, can you clarify?

Last but not least, please add a small comment to the #define explaining what's going on.

Cheers, Daniel

Signature · 3 lines
Daniel Vetter
Mail: [email protected]
Mobile: +41 (0)79 365 57 48