]> git.baikalelectronics.ru Git - kernel.git/commit
drm/i915: Use memcpy_from_wc for GPU error capture
authorChris Wilson <chris@chris-wilson.co.uk>
Tue, 6 Dec 2016 12:40:51 +0000 (12:40 +0000)
committerChris Wilson <chris@chris-wilson.co.uk>
Tue, 6 Dec 2016 14:23:16 +0000 (14:23 +0000)
commitfba48e239e217f7196d658dfddb22e44aca29a5c
tree071a7615ca693cf9f74533f5e8be1df9cf0b378e
parentb797c68a0b83185f8b1e83146359369ba7a6ee89
drm/i915: Use memcpy_from_wc for GPU error capture

On all platforms we now always read the contents of buffers via the GTT,
i.e. using WC cpu access. Reads are slow, but they can be accelerated
with an internal read buffer using sse4.1 (movntqda). This is our
i915_memcpy_from_wc() routine which also checks for sse4.1 support and
so we can fallback to using a regular slow memcpy if we need to.

When compressing the pages, the reads are currently done inside zlib's
fill_window() routine and so we must copy the page into a temporary
which is then already inside the CPU cache and fast for zlib's
compression. When not compressing the pages, we don't need a temporary
and can just use the accelerated read from WC into the destination.

v2: Use zstream locals to reduce diff and allocate the additional
temporary storage only if sse4.1 is supported.
v3: Use length=0 for the sse4.1 support check

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20161206124051.17040-1-chris@chris-wilson.co.uk
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
drivers/gpu/drm/i915/i915_gpu_error.c