mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git
synced 2026-04-25 00:52:45 -04:00
drm/i915: Treat WC a separate cache domain
When discussing a new WC mmap, we based the interface upon the assumption that GTT was fully coherent. How naive! Commits3b5724d702("drm/i915: Wait for writes through the GTT to land before reading back") anded4596ea99("drm/i915/guc: WA to address the Ringbuffer coherency issue") demonstrate that writes through the GTT are indeed delayed and may be overtaken by direct WC access. To be safe, if userspace is mixing WC mmaps with other potential GTT access (pwrite, GTT mmaps) it should use set_domain(WC). Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=96563 Testcase: igt/gem_pwrite/small-gtt* Testcase: igt/drv_selftest/coherency Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com> Link: http://patchwork.freedesktop.org/patch/msgid/20170412110111.26626-2-chris@chris-wilson.co.uk
This commit is contained in:
@@ -359,12 +359,16 @@ static int guc_log_runtime_create(struct intel_guc *guc)
|
||||
void *vaddr;
|
||||
struct rchan *guc_log_relay_chan;
|
||||
size_t n_subbufs, subbuf_size;
|
||||
int ret = 0;
|
||||
int ret;
|
||||
|
||||
lockdep_assert_held(&dev_priv->drm.struct_mutex);
|
||||
|
||||
GEM_BUG_ON(guc_log_has_runtime(guc));
|
||||
|
||||
ret = i915_gem_object_set_to_wc_domain(guc->log.vma->obj, true);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
/* Create a WC (Uncached for read) vmalloc mapping of log
|
||||
* buffer pages, so that we can directly get the data
|
||||
* (up-to-date) from memory.
|
||||
|
||||
Reference in New Issue
Block a user