mirror of
				https://github.com/tiagovignatti/intel-gpu-tools.git
				synced 2025-11-04 12:07:12 +00:00 
			
		
		
		
	lib: Fix querying context GTT size
We need a new ioctl to find the correct GTT size to use when submitting execbuffers (as opposed to wishing to know the global GTT size). Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
		
							parent
							
								
									cd99ddead3
								
							
						
					
					
						commit
						a22719358d
					
				@ -1091,14 +1091,22 @@ uint64_t gem_aperture_size(int fd)
 | 
			
		||||
	static uint64_t aperture_size = 0;
 | 
			
		||||
 | 
			
		||||
	if (aperture_size == 0) {
 | 
			
		||||
		struct local_i915_gem_context_param p;
 | 
			
		||||
 | 
			
		||||
		memset(&p, 0, sizeof(p));
 | 
			
		||||
		p.param = 0x3;
 | 
			
		||||
		if (ioctl(fd, LOCAL_IOCTL_I915_GEM_CONTEXT_GETPARAM, &p) == 0) {
 | 
			
		||||
			aperture_size = p.value;
 | 
			
		||||
		} else {
 | 
			
		||||
			struct drm_i915_gem_get_aperture aperture;
 | 
			
		||||
 | 
			
		||||
			memset(&aperture, 0, sizeof(aperture));
 | 
			
		||||
			aperture.aper_size = 256*1024*1024;
 | 
			
		||||
		do_ioctl(fd, DRM_IOCTL_I915_GEM_GET_APERTURE, &aperture);
 | 
			
		||||
 | 
			
		||||
			do_ioctl(fd, DRM_IOCTL_I915_GEM_GET_APERTURE, &aperture);
 | 
			
		||||
			aperture_size =  aperture.aper_size;
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	return aperture_size;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user