Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915: enable MI_WTF bit; I mean MI_FLUSH
@ 2012-01-19  4:52 Ben Widawsky
  2012-01-19  4:55 ` Ben Widawsky
  2012-01-19 10:35 ` Daniel Vetter
  0 siblings, 2 replies; 4+ messages in thread
From: Ben Widawsky @ 2012-01-19  4:52 UTC (permalink / raw)
  To: daniel; +Cc: intel-gfx, 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.

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.

Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
---
 drivers/gpu/drm/i915/i915_reg.h         |    2 +-
 drivers/gpu/drm/i915/intel_ringbuffer.c |    3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
index 771a058..a161ad8 100644
--- a/drivers/gpu/drm/i915/i915_reg.h
+++ b/drivers/gpu/drm/i915/i915_reg.h
@@ -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
diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.c b/drivers/gpu/drm/i915/intel_ringbuffer.c
index ca70e2f..e0837fd 100644
--- a/drivers/gpu/drm/i915/intel_ringbuffer.c
+++ b/drivers/gpu/drm/i915/intel_ringbuffer.c
@@ -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,
-- 
1.7.8.3

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH] drm/i915: enable MI_WTF bit; I mean MI_FLUSH
  2012-01-19  4:52 [PATCH] drm/i915: enable MI_WTF bit; I mean MI_FLUSH Ben Widawsky
@ 2012-01-19  4:55 ` Ben Widawsky
  2012-01-19 10:33   ` Chris Wilson
  2012-01-19 10:35 ` Daniel Vetter
  1 sibling, 1 reply; 4+ messages in thread
From: Ben Widawsky @ 2012-01-19  4:55 UTC (permalink / raw)
  To: daniel; +Cc: intel-gfx, 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.

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.

Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
---
 drivers/gpu/drm/i915/i915_reg.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
index 771a058..a161ad8 100644
--- a/drivers/gpu/drm/i915/i915_reg.h
+++ b/drivers/gpu/drm/i915/i915_reg.h
@@ -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
-- 
1.7.8.3

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] drm/i915: enable MI_WTF bit; I mean MI_FLUSH
  2012-01-19  4:55 ` Ben Widawsky
@ 2012-01-19 10:33   ` Chris Wilson
  0 siblings, 0 replies; 4+ messages in thread
From: Chris Wilson @ 2012-01-19 10:33 UTC (permalink / raw)
  To: daniel; +Cc: intel-gfx, Ben Widawsky

On Wed, 18 Jan 2012 20:55:57 -0800, Ben Widawsky <ben@bwidawsk.net> wrote:
> 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.

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

-- 
Chris Wilson, Intel Open Source Technology Centre

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] drm/i915: enable MI_WTF bit; I mean MI_FLUSH
  2012-01-19  4:52 [PATCH] drm/i915: enable MI_WTF bit; I mean MI_FLUSH Ben Widawsky
  2012-01-19  4:55 ` Ben Widawsky
@ 2012-01-19 10:35 ` Daniel Vetter
  1 sibling, 0 replies; 4+ messages in thread
From: Daniel Vetter @ 2012-01-19 10:35 UTC (permalink / raw)
  To: Ben Widawsky; +Cc: intel-gfx

On Wed, Jan 18, 2012 at 08:52:42PM -0800, Ben Widawsky wrote:
> 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.
> 
> Signed-off-by: Ben Widawsky <ben@bwidawsk.net>

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
-- 
Daniel Vetter
Mail: daniel@ffwll.ch
Mobile: +41 (0)79 365 57 48

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-01-19 10:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-19  4:52 [PATCH] drm/i915: enable MI_WTF bit; I mean MI_FLUSH Ben Widawsky
2012-01-19  4:55 ` Ben Widawsky
2012-01-19 10:33   ` Chris Wilson
2012-01-19 10:35 ` Daniel Vetter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox