Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/i915/selftests: Unconditionally do a chipset flush before emit_bb_start

Experience teaches us over and over again that coherency on Baytrail
requires the odd heavy hammer, and in particular clflush alone is not
enough to guarrantee that writes from the CPU are picked up by the CS.
Do as we do elsewhere and ensure we have an unconditional
i915_gem_chipset_flush() after writing to memory and submitting a batch
to HW.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107499
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Matthew Auld <matthew.auld@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180806144604.8346-1-chris@chris-wilson.co.uk

+6 -5
+6 -5
drivers/gpu/drm/i915/selftests/huge_pages.c
··· 906 906 if (IS_ERR(obj)) 907 907 return ERR_CAST(obj); 908 908 909 - cmd = i915_gem_object_pin_map(obj, I915_MAP_WB); 909 + err = i915_gem_object_set_to_wc_domain(obj, true); 910 + if (err) 911 + goto err; 912 + 913 + cmd = i915_gem_object_pin_map(obj, I915_MAP_WC); 910 914 if (IS_ERR(cmd)) { 911 915 err = PTR_ERR(cmd); 912 916 goto err; ··· 940 936 } 941 937 942 938 *cmd = MI_BATCH_BUFFER_END; 939 + i915_gem_chipset_flush(i915); 943 940 944 941 i915_gem_object_unpin_map(obj); 945 - 946 - err = i915_gem_object_set_to_gtt_domain(obj, false); 947 - if (err) 948 - goto err; 949 942 950 943 batch = i915_vma_instance(obj, vma->vm, NULL); 951 944 if (IS_ERR(batch)) {