drm/i915: Rename the gtt_list to global_list
Since it will be used for the global bound/unbound list with full PPGTT, this helps clarify things for upcoming code rework. Recommended-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Ben Widawsky <ben@bwidawsk.net> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
This commit is contained in:
		
					parent
					
						
							
								401c29f607
							
						
					
				
			
			
				commit
				
					
						35c20a60c7
					
				
			
		
					 6 changed files with 25 additions and 23 deletions
				
			
		| 
						 | 
					@ -215,7 +215,7 @@ static int i915_gem_object_info(struct seq_file *m, void* data)
 | 
				
			||||||
		   dev_priv->mm.object_memory);
 | 
							   dev_priv->mm.object_memory);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	size = count = mappable_size = mappable_count = 0;
 | 
						size = count = mappable_size = mappable_count = 0;
 | 
				
			||||||
	count_objects(&dev_priv->mm.bound_list, gtt_list);
 | 
						count_objects(&dev_priv->mm.bound_list, global_list);
 | 
				
			||||||
	seq_printf(m, "%u [%u] objects, %zu [%zu] bytes in gtt\n",
 | 
						seq_printf(m, "%u [%u] objects, %zu [%zu] bytes in gtt\n",
 | 
				
			||||||
		   count, mappable_count, size, mappable_size);
 | 
							   count, mappable_count, size, mappable_size);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -230,7 +230,7 @@ static int i915_gem_object_info(struct seq_file *m, void* data)
 | 
				
			||||||
		   count, mappable_count, size, mappable_size);
 | 
							   count, mappable_count, size, mappable_size);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	size = count = purgeable_size = purgeable_count = 0;
 | 
						size = count = purgeable_size = purgeable_count = 0;
 | 
				
			||||||
	list_for_each_entry(obj, &dev_priv->mm.unbound_list, gtt_list) {
 | 
						list_for_each_entry(obj, &dev_priv->mm.unbound_list, global_list) {
 | 
				
			||||||
		size += obj->base.size, ++count;
 | 
							size += obj->base.size, ++count;
 | 
				
			||||||
		if (obj->madv == I915_MADV_DONTNEED)
 | 
							if (obj->madv == I915_MADV_DONTNEED)
 | 
				
			||||||
			purgeable_size += obj->base.size, ++purgeable_count;
 | 
								purgeable_size += obj->base.size, ++purgeable_count;
 | 
				
			||||||
| 
						 | 
					@ -238,7 +238,7 @@ static int i915_gem_object_info(struct seq_file *m, void* data)
 | 
				
			||||||
	seq_printf(m, "%u unbound objects, %zu bytes\n", count, size);
 | 
						seq_printf(m, "%u unbound objects, %zu bytes\n", count, size);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	size = count = mappable_size = mappable_count = 0;
 | 
						size = count = mappable_size = mappable_count = 0;
 | 
				
			||||||
	list_for_each_entry(obj, &dev_priv->mm.bound_list, gtt_list) {
 | 
						list_for_each_entry(obj, &dev_priv->mm.bound_list, global_list) {
 | 
				
			||||||
		if (obj->fault_mappable) {
 | 
							if (obj->fault_mappable) {
 | 
				
			||||||
			size += obj->gtt_space->size;
 | 
								size += obj->gtt_space->size;
 | 
				
			||||||
			++count;
 | 
								++count;
 | 
				
			||||||
| 
						 | 
					@ -283,7 +283,7 @@ static int i915_gem_gtt_info(struct seq_file *m, void* data)
 | 
				
			||||||
		return ret;
 | 
							return ret;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	total_obj_size = total_gtt_size = count = 0;
 | 
						total_obj_size = total_gtt_size = count = 0;
 | 
				
			||||||
	list_for_each_entry(obj, &dev_priv->mm.bound_list, gtt_list) {
 | 
						list_for_each_entry(obj, &dev_priv->mm.bound_list, global_list) {
 | 
				
			||||||
		if (list == PINNED_LIST && obj->pin_count == 0)
 | 
							if (list == PINNED_LIST && obj->pin_count == 0)
 | 
				
			||||||
			continue;
 | 
								continue;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1944,7 +1944,8 @@ i915_drop_caches_set(void *data, u64 val)
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (val & DROP_UNBOUND) {
 | 
						if (val & DROP_UNBOUND) {
 | 
				
			||||||
		list_for_each_entry_safe(obj, next, &dev_priv->mm.unbound_list, gtt_list)
 | 
							list_for_each_entry_safe(obj, next, &dev_priv->mm.unbound_list,
 | 
				
			||||||
 | 
										 global_list)
 | 
				
			||||||
			if (obj->pages_pin_count == 0) {
 | 
								if (obj->pages_pin_count == 0) {
 | 
				
			||||||
				ret = i915_gem_object_put_pages(obj);
 | 
									ret = i915_gem_object_put_pages(obj);
 | 
				
			||||||
				if (ret)
 | 
									if (ret)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1154,7 +1154,7 @@ struct drm_i915_gem_object {
 | 
				
			||||||
	struct drm_mm_node *gtt_space;
 | 
						struct drm_mm_node *gtt_space;
 | 
				
			||||||
	/** Stolen memory for this object, instead of being backed by shmem. */
 | 
						/** Stolen memory for this object, instead of being backed by shmem. */
 | 
				
			||||||
	struct drm_mm_node *stolen;
 | 
						struct drm_mm_node *stolen;
 | 
				
			||||||
	struct list_head gtt_list;
 | 
						struct list_head global_list;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	/** This object's place on the active/inactive lists */
 | 
						/** This object's place on the active/inactive lists */
 | 
				
			||||||
	struct list_head ring_list;
 | 
						struct list_head ring_list;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -179,7 +179,7 @@ i915_gem_get_aperture_ioctl(struct drm_device *dev, void *data,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	pinned = 0;
 | 
						pinned = 0;
 | 
				
			||||||
	mutex_lock(&dev->struct_mutex);
 | 
						mutex_lock(&dev->struct_mutex);
 | 
				
			||||||
	list_for_each_entry(obj, &dev_priv->mm.bound_list, gtt_list)
 | 
						list_for_each_entry(obj, &dev_priv->mm.bound_list, global_list)
 | 
				
			||||||
		if (obj->pin_count)
 | 
							if (obj->pin_count)
 | 
				
			||||||
			pinned += obj->gtt_space->size;
 | 
								pinned += obj->gtt_space->size;
 | 
				
			||||||
	mutex_unlock(&dev->struct_mutex);
 | 
						mutex_unlock(&dev->struct_mutex);
 | 
				
			||||||
| 
						 | 
					@ -1679,7 +1679,7 @@ i915_gem_object_put_pages(struct drm_i915_gem_object *obj)
 | 
				
			||||||
	/* ->put_pages might need to allocate memory for the bit17 swizzle
 | 
						/* ->put_pages might need to allocate memory for the bit17 swizzle
 | 
				
			||||||
	 * array, hence protect them from being reaped by removing them from gtt
 | 
						 * array, hence protect them from being reaped by removing them from gtt
 | 
				
			||||||
	 * lists early. */
 | 
						 * lists early. */
 | 
				
			||||||
	list_del(&obj->gtt_list);
 | 
						list_del(&obj->global_list);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	ops->put_pages(obj);
 | 
						ops->put_pages(obj);
 | 
				
			||||||
	obj->pages = NULL;
 | 
						obj->pages = NULL;
 | 
				
			||||||
| 
						 | 
					@ -1699,7 +1699,7 @@ __i915_gem_shrink(struct drm_i915_private *dev_priv, long target,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	list_for_each_entry_safe(obj, next,
 | 
						list_for_each_entry_safe(obj, next,
 | 
				
			||||||
				 &dev_priv->mm.unbound_list,
 | 
									 &dev_priv->mm.unbound_list,
 | 
				
			||||||
				 gtt_list) {
 | 
									 global_list) {
 | 
				
			||||||
		if ((i915_gem_object_is_purgeable(obj) || !purgeable_only) &&
 | 
							if ((i915_gem_object_is_purgeable(obj) || !purgeable_only) &&
 | 
				
			||||||
		    i915_gem_object_put_pages(obj) == 0) {
 | 
							    i915_gem_object_put_pages(obj) == 0) {
 | 
				
			||||||
			count += obj->base.size >> PAGE_SHIFT;
 | 
								count += obj->base.size >> PAGE_SHIFT;
 | 
				
			||||||
| 
						 | 
					@ -1736,7 +1736,8 @@ i915_gem_shrink_all(struct drm_i915_private *dev_priv)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	i915_gem_evict_everything(dev_priv->dev);
 | 
						i915_gem_evict_everything(dev_priv->dev);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	list_for_each_entry_safe(obj, next, &dev_priv->mm.unbound_list, gtt_list)
 | 
						list_for_each_entry_safe(obj, next, &dev_priv->mm.unbound_list,
 | 
				
			||||||
 | 
									 global_list)
 | 
				
			||||||
		i915_gem_object_put_pages(obj);
 | 
							i915_gem_object_put_pages(obj);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1861,7 +1862,7 @@ i915_gem_object_get_pages(struct drm_i915_gem_object *obj)
 | 
				
			||||||
	if (ret)
 | 
						if (ret)
 | 
				
			||||||
		return ret;
 | 
							return ret;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	list_add_tail(&obj->gtt_list, &dev_priv->mm.unbound_list);
 | 
						list_add_tail(&obj->global_list, &dev_priv->mm.unbound_list);
 | 
				
			||||||
	return 0;
 | 
						return 0;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -2514,7 +2515,7 @@ i915_gem_object_unbind(struct drm_i915_gem_object *obj)
 | 
				
			||||||
	i915_gem_object_unpin_pages(obj);
 | 
						i915_gem_object_unpin_pages(obj);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	list_del(&obj->mm_list);
 | 
						list_del(&obj->mm_list);
 | 
				
			||||||
	list_move_tail(&obj->gtt_list, &dev_priv->mm.unbound_list);
 | 
						list_move_tail(&obj->global_list, &dev_priv->mm.unbound_list);
 | 
				
			||||||
	/* Avoid an unnecessary call to unbind on rebind. */
 | 
						/* Avoid an unnecessary call to unbind on rebind. */
 | 
				
			||||||
	obj->map_and_fenceable = true;
 | 
						obj->map_and_fenceable = true;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -2922,7 +2923,7 @@ static void i915_gem_verify_gtt(struct drm_device *dev)
 | 
				
			||||||
	struct drm_i915_gem_object *obj;
 | 
						struct drm_i915_gem_object *obj;
 | 
				
			||||||
	int err = 0;
 | 
						int err = 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	list_for_each_entry(obj, &dev_priv->mm.gtt_list, gtt_list) {
 | 
						list_for_each_entry(obj, &dev_priv->mm.gtt_list, global_list) {
 | 
				
			||||||
		if (obj->gtt_space == NULL) {
 | 
							if (obj->gtt_space == NULL) {
 | 
				
			||||||
			printk(KERN_ERR "object found on GTT list with no space reserved\n");
 | 
								printk(KERN_ERR "object found on GTT list with no space reserved\n");
 | 
				
			||||||
			err++;
 | 
								err++;
 | 
				
			||||||
| 
						 | 
					@ -3046,7 +3047,7 @@ search_free:
 | 
				
			||||||
		return ret;
 | 
							return ret;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	list_move_tail(&obj->gtt_list, &dev_priv->mm.bound_list);
 | 
						list_move_tail(&obj->global_list, &dev_priv->mm.bound_list);
 | 
				
			||||||
	list_add_tail(&obj->mm_list, &dev_priv->mm.inactive_list);
 | 
						list_add_tail(&obj->mm_list, &dev_priv->mm.inactive_list);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	obj->gtt_space = node;
 | 
						obj->gtt_space = node;
 | 
				
			||||||
| 
						 | 
					@ -3760,7 +3761,7 @@ void i915_gem_object_init(struct drm_i915_gem_object *obj,
 | 
				
			||||||
			  const struct drm_i915_gem_object_ops *ops)
 | 
								  const struct drm_i915_gem_object_ops *ops)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	INIT_LIST_HEAD(&obj->mm_list);
 | 
						INIT_LIST_HEAD(&obj->mm_list);
 | 
				
			||||||
	INIT_LIST_HEAD(&obj->gtt_list);
 | 
						INIT_LIST_HEAD(&obj->global_list);
 | 
				
			||||||
	INIT_LIST_HEAD(&obj->ring_list);
 | 
						INIT_LIST_HEAD(&obj->ring_list);
 | 
				
			||||||
	INIT_LIST_HEAD(&obj->exec_list);
 | 
						INIT_LIST_HEAD(&obj->exec_list);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -4507,10 +4508,10 @@ i915_gem_inactive_shrink(struct shrinker *shrinker, struct shrink_control *sc)
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	cnt = 0;
 | 
						cnt = 0;
 | 
				
			||||||
	list_for_each_entry(obj, &dev_priv->mm.unbound_list, gtt_list)
 | 
						list_for_each_entry(obj, &dev_priv->mm.unbound_list, global_list)
 | 
				
			||||||
		if (obj->pages_pin_count == 0)
 | 
							if (obj->pages_pin_count == 0)
 | 
				
			||||||
			cnt += obj->base.size >> PAGE_SHIFT;
 | 
								cnt += obj->base.size >> PAGE_SHIFT;
 | 
				
			||||||
	list_for_each_entry(obj, &dev_priv->mm.inactive_list, gtt_list)
 | 
						list_for_each_entry(obj, &dev_priv->mm.inactive_list, global_list)
 | 
				
			||||||
		if (obj->pin_count == 0 && obj->pages_pin_count == 0)
 | 
							if (obj->pin_count == 0 && obj->pages_pin_count == 0)
 | 
				
			||||||
			cnt += obj->base.size >> PAGE_SHIFT;
 | 
								cnt += obj->base.size >> PAGE_SHIFT;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -439,7 +439,7 @@ void i915_gem_restore_gtt_mappings(struct drm_device *dev)
 | 
				
			||||||
	dev_priv->gtt.gtt_clear_range(dev, dev_priv->gtt.start / PAGE_SIZE,
 | 
						dev_priv->gtt.gtt_clear_range(dev, dev_priv->gtt.start / PAGE_SIZE,
 | 
				
			||||||
				      dev_priv->gtt.total / PAGE_SIZE);
 | 
									      dev_priv->gtt.total / PAGE_SIZE);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	list_for_each_entry(obj, &dev_priv->mm.bound_list, gtt_list) {
 | 
						list_for_each_entry(obj, &dev_priv->mm.bound_list, global_list) {
 | 
				
			||||||
		i915_gem_clflush_object(obj);
 | 
							i915_gem_clflush_object(obj);
 | 
				
			||||||
		i915_gem_gtt_bind_object(obj, obj->cache_level);
 | 
							i915_gem_gtt_bind_object(obj, obj->cache_level);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
| 
						 | 
					@ -631,7 +631,7 @@ void i915_gem_setup_global_gtt(struct drm_device *dev,
 | 
				
			||||||
		dev_priv->mm.gtt_space.color_adjust = i915_gtt_color_adjust;
 | 
							dev_priv->mm.gtt_space.color_adjust = i915_gtt_color_adjust;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	/* Mark any preallocated objects as occupied */
 | 
						/* Mark any preallocated objects as occupied */
 | 
				
			||||||
	list_for_each_entry(obj, &dev_priv->mm.bound_list, gtt_list) {
 | 
						list_for_each_entry(obj, &dev_priv->mm.bound_list, global_list) {
 | 
				
			||||||
		DRM_DEBUG_KMS("reserving preallocated space: %x + %zx\n",
 | 
							DRM_DEBUG_KMS("reserving preallocated space: %x + %zx\n",
 | 
				
			||||||
			      obj->gtt_offset, obj->base.size);
 | 
								      obj->gtt_offset, obj->base.size);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -383,7 +383,7 @@ i915_gem_object_create_stolen_for_preallocated(struct drm_device *dev,
 | 
				
			||||||
	obj->gtt_offset = gtt_offset;
 | 
						obj->gtt_offset = gtt_offset;
 | 
				
			||||||
	obj->has_global_gtt_mapping = 1;
 | 
						obj->has_global_gtt_mapping = 1;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	list_add_tail(&obj->gtt_list, &dev_priv->mm.bound_list);
 | 
						list_add_tail(&obj->global_list, &dev_priv->mm.bound_list);
 | 
				
			||||||
	list_add_tail(&obj->mm_list, &dev_priv->mm.inactive_list);
 | 
						list_add_tail(&obj->mm_list, &dev_priv->mm.inactive_list);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	return obj;
 | 
						return obj;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1656,7 +1656,7 @@ static u32 capture_pinned_bo(struct drm_i915_error_buffer *err,
 | 
				
			||||||
	struct drm_i915_gem_object *obj;
 | 
						struct drm_i915_gem_object *obj;
 | 
				
			||||||
	int i = 0;
 | 
						int i = 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	list_for_each_entry(obj, head, gtt_list) {
 | 
						list_for_each_entry(obj, head, global_list) {
 | 
				
			||||||
		if (obj->pin_count == 0)
 | 
							if (obj->pin_count == 0)
 | 
				
			||||||
			continue;
 | 
								continue;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1798,7 +1798,7 @@ static void i915_gem_record_active_context(struct intel_ring_buffer *ring,
 | 
				
			||||||
	if (ring->id != RCS || !error->ccid)
 | 
						if (ring->id != RCS || !error->ccid)
 | 
				
			||||||
		return;
 | 
							return;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	list_for_each_entry(obj, &dev_priv->mm.bound_list, gtt_list) {
 | 
						list_for_each_entry(obj, &dev_priv->mm.bound_list, global_list) {
 | 
				
			||||||
		if ((error->ccid & PAGE_MASK) == obj->gtt_offset) {
 | 
							if ((error->ccid & PAGE_MASK) == obj->gtt_offset) {
 | 
				
			||||||
			ering->ctx = i915_error_object_create_sized(dev_priv,
 | 
								ering->ctx = i915_error_object_create_sized(dev_priv,
 | 
				
			||||||
								    obj, 1);
 | 
													    obj, 1);
 | 
				
			||||||
| 
						 | 
					@ -1935,7 +1935,7 @@ static void i915_capture_error_state(struct drm_device *dev)
 | 
				
			||||||
	list_for_each_entry(obj, &dev_priv->mm.active_list, mm_list)
 | 
						list_for_each_entry(obj, &dev_priv->mm.active_list, mm_list)
 | 
				
			||||||
		i++;
 | 
							i++;
 | 
				
			||||||
	error->active_bo_count = i;
 | 
						error->active_bo_count = i;
 | 
				
			||||||
	list_for_each_entry(obj, &dev_priv->mm.bound_list, gtt_list)
 | 
						list_for_each_entry(obj, &dev_priv->mm.bound_list, global_list)
 | 
				
			||||||
		if (obj->pin_count)
 | 
							if (obj->pin_count)
 | 
				
			||||||
			i++;
 | 
								i++;
 | 
				
			||||||
	error->pinned_bo_count = i - error->active_bo_count;
 | 
						error->pinned_bo_count = i - error->active_bo_count;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue