diff options
Diffstat (limited to 'drivers/gpu/drm/i915/intel_ringbuffer.c')
-rw-r--r-- | drivers/gpu/drm/i915/intel_ringbuffer.c | 40 |
1 files changed, 22 insertions, 18 deletions
diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.c b/drivers/gpu/drm/i915/intel_ringbuffer.c index 86604dd1c5a5..472939f5c18f 100644 --- a/drivers/gpu/drm/i915/intel_ringbuffer.c +++ b/drivers/gpu/drm/i915/intel_ringbuffer.c | |||
@@ -1707,9 +1707,29 @@ static int switch_context(struct i915_request *rq) | |||
1707 | } | 1707 | } |
1708 | 1708 | ||
1709 | if (ppgtt) { | 1709 | if (ppgtt) { |
1710 | ret = engine->emit_flush(rq, EMIT_INVALIDATE); | ||
1711 | if (ret) | ||
1712 | goto err_mm; | ||
1713 | |||
1710 | ret = flush_pd_dir(rq); | 1714 | ret = flush_pd_dir(rq); |
1711 | if (ret) | 1715 | if (ret) |
1712 | goto err_mm; | 1716 | goto err_mm; |
1717 | |||
1718 | /* | ||
1719 | * Not only do we need a full barrier (post-sync write) after | ||
1720 | * invalidating the TLBs, but we need to wait a little bit | ||
1721 | * longer. Whether this is merely delaying us, or the | ||
1722 | * subsequent flush is a key part of serialising with the | ||
1723 | * post-sync op, this extra pass appears vital before a | ||
1724 | * mm switch! | ||
1725 | */ | ||
1726 | ret = engine->emit_flush(rq, EMIT_INVALIDATE); | ||
1727 | if (ret) | ||
1728 | goto err_mm; | ||
1729 | |||
1730 | ret = engine->emit_flush(rq, EMIT_FLUSH); | ||
1731 | if (ret) | ||
1732 | goto err_mm; | ||
1713 | } | 1733 | } |
1714 | 1734 | ||
1715 | if (ctx->remap_slice) { | 1735 | if (ctx->remap_slice) { |
@@ -1947,7 +1967,7 @@ static void gen6_bsd_submit_request(struct i915_request *request) | |||
1947 | intel_uncore_forcewake_put(dev_priv, FORCEWAKE_ALL); | 1967 | intel_uncore_forcewake_put(dev_priv, FORCEWAKE_ALL); |
1948 | } | 1968 | } |
1949 | 1969 | ||
1950 | static int emit_mi_flush_dw(struct i915_request *rq, u32 flags) | 1970 | static int mi_flush_dw(struct i915_request *rq, u32 flags) |
1951 | { | 1971 | { |
1952 | u32 cmd, *cs; | 1972 | u32 cmd, *cs; |
1953 | 1973 | ||
@@ -1985,23 +2005,7 @@ static int emit_mi_flush_dw(struct i915_request *rq, u32 flags) | |||
1985 | 2005 | ||
1986 | static int gen6_flush_dw(struct i915_request *rq, u32 mode, u32 invflags) | 2006 | static int gen6_flush_dw(struct i915_request *rq, u32 mode, u32 invflags) |
1987 | { | 2007 | { |
1988 | int err; | 2008 | return mi_flush_dw(rq, mode & EMIT_INVALIDATE ? invflags : 0); |
1989 | |||
1990 | /* | ||
1991 | * Not only do we need a full barrier (post-sync write) after | ||
1992 | * invalidating the TLBs, but we need to wait a little bit | ||
1993 | * longer. Whether this is merely delaying us, or the | ||
1994 | * subsequent flush is a key part of serialising with the | ||
1995 | * post-sync op, this extra pass appears vital before a | ||
1996 | * mm switch! | ||
1997 | */ | ||
1998 | if (mode & EMIT_INVALIDATE) { | ||
1999 | err = emit_mi_flush_dw(rq, invflags); | ||
2000 | if (err) | ||
2001 | return err; | ||
2002 | } | ||
2003 | |||
2004 | return emit_mi_flush_dw(rq, 0); | ||
2005 | } | 2009 | } |
2006 | 2010 | ||
2007 | static int gen6_bsd_ring_flush(struct i915_request *rq, u32 mode) | 2011 | static int gen6_bsd_ring_flush(struct i915_request *rq, u32 mode) |