mirror of
				https://github.com/tiagovignatti/intel-gpu-tools.git
				synced 2025-11-04 12:07:12 +00:00 
			
		
		
		
	tests/gem_exec_big: fixups
- don't emit a self-modifying batch, the kernel doesn't like those - also change the buffer size, to exercise all corner-cases of the sg_table stuff
This commit is contained in:
		
							parent
							
								
									fa6b0208ab
								
							
						
					
					
						commit
						1a83c0990a
					
				@ -64,7 +64,7 @@ static int exec(int fd, uint32_t handle, uint32_t reloc_ofs)
 | 
				
			|||||||
	gem_reloc[0].delta = 0;
 | 
						gem_reloc[0].delta = 0;
 | 
				
			||||||
	gem_reloc[0].target_handle = handle;
 | 
						gem_reloc[0].target_handle = handle;
 | 
				
			||||||
	gem_reloc[0].read_domains = I915_GEM_DOMAIN_RENDER;
 | 
						gem_reloc[0].read_domains = I915_GEM_DOMAIN_RENDER;
 | 
				
			||||||
	gem_reloc[0].write_domain = I915_GEM_DOMAIN_RENDER;
 | 
						gem_reloc[0].write_domain = 0;
 | 
				
			||||||
	gem_reloc[0].presumed_offset = 0;
 | 
						gem_reloc[0].presumed_offset = 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	gem_exec[0].handle = handle;
 | 
						gem_exec[0].handle = handle;
 | 
				
			||||||
@ -94,6 +94,7 @@ static int exec(int fd, uint32_t handle, uint32_t reloc_ofs)
 | 
				
			|||||||
	gem_sync(fd, handle);
 | 
						gem_sync(fd, handle);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	gem_read(fd, handle, reloc_ofs, &tmp, 4);
 | 
						gem_read(fd, handle, reloc_ofs, &tmp, 4);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	assert(tmp == gem_reloc[0].presumed_offset);
 | 
						assert(tmp == gem_reloc[0].presumed_offset);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	return ret;
 | 
						return ret;
 | 
				
			||||||
@ -105,15 +106,18 @@ int main(int argc, char **argv)
 | 
				
			|||||||
	uint32_t handle;
 | 
						uint32_t handle;
 | 
				
			||||||
	int fd;
 | 
						int fd;
 | 
				
			||||||
	uint32_t reloc_ofs;
 | 
						uint32_t reloc_ofs;
 | 
				
			||||||
 | 
						unsigned batch_size;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	fd = drm_open_any();
 | 
						fd = drm_open_any();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	handle = gem_create(fd, BATCH_SIZE);
 | 
						for (batch_size = BATCH_SIZE/4; batch_size <= BATCH_SIZE; batch_size += 4096) {
 | 
				
			||||||
	gem_write(fd, handle, 0, batch, sizeof(batch));
 | 
							handle = gem_create(fd, batch_size);
 | 
				
			||||||
 | 
							gem_write(fd, handle, 0, batch, sizeof(batch));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	for (reloc_ofs = 4096; reloc_ofs < BATCH_SIZE; reloc_ofs += 4096)
 | 
							for (reloc_ofs = 4096; reloc_ofs < batch_size; reloc_ofs += 4096)
 | 
				
			||||||
		if (exec(fd, handle, reloc_ofs))
 | 
								if (exec(fd, handle, reloc_ofs))
 | 
				
			||||||
			exit(1);
 | 
									exit(1);
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	gem_close(fd, handle);
 | 
						gem_close(fd, handle);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user