diff options
author | Francisco Jerez <currojerez@riseup.net> | 2016-01-13 21:59:39 -0500 |
---|---|---|
committer | Jani Nikula <jani.nikula@intel.com> | 2016-01-29 02:11:26 -0500 |
commit | 935a0ff0e1ea62a116848c0a187b13838f7b9cee (patch) | |
tree | 5398eb6bdc8437f56b35a4f45b4ed1abb470da98 | |
parent | 92e963f50fc74041b5e9e744c330dca48e04f08d (diff) |
drm/i915: Make sure DC writes are coherent on flush.
We need to set the DC FLUSH PIPE_CONTROL bit on Gen7+ to guarantee
that writes performed via the HDC are visible in memory. Fixes an
intermittent failure in a Piglit test that writes to a BO from a
shader using GL atomic counters (implemented as HDC untyped atomics)
and then expects the memory to read back the same value after mapping
it on the CPU.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91298
Tested-by: Mark Janes <mark.a.janes@intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Cc: stable@vger.kernel.org
Signed-off-by: Francisco Jerez <currojerez@riseup.net>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1452740379-3194-1-git-send-email-currojerez@riseup.net
(cherry picked from commit 965fd602a6436f689f4f2fe40a6789582778ccd5)
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
-rw-r--r-- | drivers/gpu/drm/i915/intel_lrc.c | 1 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/intel_ringbuffer.c | 2 |
2 files changed, 3 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/intel_lrc.c b/drivers/gpu/drm/i915/intel_lrc.c index 3aa614731d7e..f1fa756c5d5d 100644 --- a/drivers/gpu/drm/i915/intel_lrc.c +++ b/drivers/gpu/drm/i915/intel_lrc.c | |||
@@ -1707,6 +1707,7 @@ static int gen8_emit_flush_render(struct drm_i915_gem_request *request, | |||
1707 | if (flush_domains) { | 1707 | if (flush_domains) { |
1708 | flags |= PIPE_CONTROL_RENDER_TARGET_CACHE_FLUSH; | 1708 | flags |= PIPE_CONTROL_RENDER_TARGET_CACHE_FLUSH; |
1709 | flags |= PIPE_CONTROL_DEPTH_CACHE_FLUSH; | 1709 | flags |= PIPE_CONTROL_DEPTH_CACHE_FLUSH; |
1710 | flags |= PIPE_CONTROL_DC_FLUSH_ENABLE; | ||
1710 | flags |= PIPE_CONTROL_FLUSH_ENABLE; | 1711 | flags |= PIPE_CONTROL_FLUSH_ENABLE; |
1711 | } | 1712 | } |
1712 | 1713 | ||
diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.c b/drivers/gpu/drm/i915/intel_ringbuffer.c index 339701d7a9a5..40c6aff57256 100644 --- a/drivers/gpu/drm/i915/intel_ringbuffer.c +++ b/drivers/gpu/drm/i915/intel_ringbuffer.c | |||
@@ -331,6 +331,7 @@ gen7_render_ring_flush(struct drm_i915_gem_request *req, | |||
331 | if (flush_domains) { | 331 | if (flush_domains) { |
332 | flags |= PIPE_CONTROL_RENDER_TARGET_CACHE_FLUSH; | 332 | flags |= PIPE_CONTROL_RENDER_TARGET_CACHE_FLUSH; |
333 | flags |= PIPE_CONTROL_DEPTH_CACHE_FLUSH; | 333 | flags |= PIPE_CONTROL_DEPTH_CACHE_FLUSH; |
334 | flags |= PIPE_CONTROL_DC_FLUSH_ENABLE; | ||
334 | flags |= PIPE_CONTROL_FLUSH_ENABLE; | 335 | flags |= PIPE_CONTROL_FLUSH_ENABLE; |
335 | } | 336 | } |
336 | if (invalidate_domains) { | 337 | if (invalidate_domains) { |
@@ -403,6 +404,7 @@ gen8_render_ring_flush(struct drm_i915_gem_request *req, | |||
403 | if (flush_domains) { | 404 | if (flush_domains) { |
404 | flags |= PIPE_CONTROL_RENDER_TARGET_CACHE_FLUSH; | 405 | flags |= PIPE_CONTROL_RENDER_TARGET_CACHE_FLUSH; |
405 | flags |= PIPE_CONTROL_DEPTH_CACHE_FLUSH; | 406 | flags |= PIPE_CONTROL_DEPTH_CACHE_FLUSH; |
407 | flags |= PIPE_CONTROL_DC_FLUSH_ENABLE; | ||
406 | flags |= PIPE_CONTROL_FLUSH_ENABLE; | 408 | flags |= PIPE_CONTROL_FLUSH_ENABLE; |
407 | } | 409 | } |
408 | if (invalidate_domains) { | 410 | if (invalidate_domains) { |