[Intel-gfx] [PATCH 02/11] drm/i915: track tlb invalidate GFX_MODE state
Eric Anholt
eric at anholt.net
Wed Feb 15 20:36:10 CET 2012
On Tue, 14 Feb 2012 22:09:09 +0100, Ben Widawsky <ben at bwidawsk.net> wrote:
> This is needed for an upcoming workaround.
>
> Signed-off-by: Ben Widawsky <ben at bwidawsk.net>
> ---
> drivers/gpu/drm/i915/intel_ringbuffer.c | 4 ++++
> drivers/gpu/drm/i915/intel_ringbuffer.h | 5 +++++
> 2 files changed, 9 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.c b/drivers/gpu/drm/i915/intel_ringbuffer.c
> index 4956f1b..411a0e5 100644
> --- a/drivers/gpu/drm/i915/intel_ringbuffer.c
> +++ b/drivers/gpu/drm/i915/intel_ringbuffer.c
> @@ -412,6 +412,10 @@ static int init_render_ring(struct intel_ring_buffer *ring)
> return ret;
> }
>
> + if (INTEL_INFO(dev)->gen == 6)
> + ring->itlb_before_ctx_switch =
> + !!(I915_READ(GFX_MODE) & GFX_TLB_INVALIDATE_ALWAYS);
> +
> if (INTEL_INFO(dev)->gen >= 6) {
> I915_WRITE(INSTPM,
> INSTPM_FORCE_ORDERING << 16 | INSTPM_FORCE_ORDERING);
> diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.h b/drivers/gpu/drm/i915/intel_ringbuffer.h
> index c8b9cc0..fad4251 100644
> --- a/drivers/gpu/drm/i915/intel_ringbuffer.h
> +++ b/drivers/gpu/drm/i915/intel_ringbuffer.h
> @@ -110,6 +110,11 @@ struct intel_ring_buffer {
> wait_queue_head_t irq_queue;
> drm_local_map_t map;
>
> + /**
> + * Do an explicit TLB flush before MI_SET_CONTEXT
> + */
> + bool itlb_before_ctx_switch;
> +
> void *private;
> };
I really wanted to see the consumer of this when trying to review this
code. They weren't logically separate -- this is to implement a quoted
piece of spec in the later commit.
(What I was trying to figure out was whether this was needed for gen7.
It looks like it is not required).
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/intel-gfx/attachments/20120215/7e1f73f6/attachment.sig>
More information about the Intel-gfx
mailing list