forked from mirrors/linux
		
	drm/i915: fix i915 running as dom0 under Xen
Commit920cf41949("drm/i915: Introduce an internal allocator for disposable private objects") introduced a regression for the kernel running as Xen dom0: when switching to graphics mode a GPU HANG occurred. Reason seems to be a missing adaption similar to that done in commit7453c549f5("swiotlb: Export swiotlb_max_segment to users") to i915_gem_object_get_pages_internal(). So limit the maximum page order to be used according to the maximum swiotlb segment size instead to the complete swiotlb size. Fixes:920cf41949("drm/i915: Introduce an internal allocator for disposable private objects") Signed-off-by: Juergen Gross <jgross@suse.com> Link: http://patchwork.freedesktop.org/patch/msgid/20170202094711.939-1-jgross@suse.com Cc: Chris Wilson <chris@chris-wilson.co.uk> Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com> Cc: Daniel Vetter <daniel.vetter@intel.com> Cc: Jani Nikula <jani.nikula@linux.intel.com> Cc: intel-gfx@lists.freedesktop.org Cc: <drm-intel-fixes@lists.freedesktop.org> # v4.10-rc1+ Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
		
							parent
							
								
									37255d8d3f
								
							
						
					
					
						commit
						5584f1b1d7
					
				
					 1 changed files with 10 additions and 2 deletions
				
			
		| 
						 | 
				
			
			@ -68,8 +68,16 @@ i915_gem_object_get_pages_internal(struct drm_i915_gem_object *obj)
 | 
			
		|||
 | 
			
		||||
	max_order = MAX_ORDER;
 | 
			
		||||
#ifdef CONFIG_SWIOTLB
 | 
			
		||||
	if (swiotlb_nr_tbl()) /* minimum max swiotlb size is IO_TLB_SEGSIZE */
 | 
			
		||||
		max_order = min(max_order, ilog2(IO_TLB_SEGPAGES));
 | 
			
		||||
	if (swiotlb_nr_tbl()) {
 | 
			
		||||
		unsigned int max_segment;
 | 
			
		||||
 | 
			
		||||
		max_segment = swiotlb_max_segment();
 | 
			
		||||
		if (max_segment) {
 | 
			
		||||
			max_segment = max_t(unsigned int, max_segment,
 | 
			
		||||
					    PAGE_SIZE) >> PAGE_SHIFT;
 | 
			
		||||
			max_order = min(max_order, ilog2(max_segment));
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
	gfp = GFP_KERNEL | __GFP_HIGHMEM | __GFP_RECLAIMABLE;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in a new issue