mirror of
				https://github.com/tiagovignatti/intel-gpu-tools.git
				synced 2025-11-03 19:47:15 +00:00 
			
		
		
		
	lib: Apply magic clflush serialisation
On Baytrail, Braswell and Atoms beyond we see an issue where the mfence is insufficient to force the cacheline to be coherent (i.e. such that writes from the GPU are visible by the CPU after the call to clflush). A second clflush is ordered with an earlier clflush to the same address and this appears sufficient to give the coherency required for GPU/CPU interop. Testcase: igt/gem_exec_flush Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Akash Goel <akash.goel@intel.com>
This commit is contained in:
		
							parent
							
								
									ef3f61a6d3
								
							
						
					
					
						commit
						b481705208
					
				@ -425,6 +425,7 @@ void igt_clflush_range(void *addr, int size)
 | 
				
			|||||||
	__builtin_ia32_mfence();
 | 
						__builtin_ia32_mfence();
 | 
				
			||||||
	for (; p < end; p += clflush_size)
 | 
						for (; p < end; p += clflush_size)
 | 
				
			||||||
		__builtin_ia32_clflush(p);
 | 
							__builtin_ia32_clflush(p);
 | 
				
			||||||
 | 
						__builtin_ia32_clflush(end - 1); /* magic serialisation for byt+ */
 | 
				
			||||||
	__builtin_ia32_mfence();
 | 
						__builtin_ia32_mfence();
 | 
				
			||||||
#else
 | 
					#else
 | 
				
			||||||
	fprintf(stderr, "igt_clflush_range() unsupported\n");
 | 
						fprintf(stderr, "igt_clflush_range() unsupported\n");
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user