Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 62106b4f authored by Joonas Lahtinen's avatar Joonas Lahtinen
Browse files

drm/i915: Rename dev_priv->gtt to dev_priv->ggtt



Refer to Global GTT consistently as GGTT, thus rename dev_priv->gtt
to dev_priv->ggtt and struct i915_gtt to struct i915_ggtt.

Fix a couple of whitespace problems while at it.

v2:
- Fix a typo in commit message.

Reviewed-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: default avatarJoonas Lahtinen <joonas.lahtinen@linux.intel.com>
parent dc3b04fb
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -203,7 +203,7 @@ static int i915_gem_object_list_info(struct seq_file *m, void *data)
	struct list_head *head;
	struct drm_device *dev = node->minor->dev;
	struct drm_i915_private *dev_priv = dev->dev_private;
	struct i915_address_space *vm = &dev_priv->gtt.base;
	struct i915_address_space *vm = &dev_priv->ggtt.base;
	struct i915_vma *vma;
	u64 total_obj_size, total_gtt_size;
	int count, ret;
@@ -433,7 +433,7 @@ static int i915_gem_object_info(struct seq_file *m, void* data)
	u32 count, mappable_count, purgeable_count;
	u64 size, mappable_size, purgeable_size;
	struct drm_i915_gem_object *obj;
	struct i915_address_space *vm = &dev_priv->gtt.base;
	struct i915_address_space *vm = &dev_priv->ggtt.base;
	struct drm_file *file;
	struct i915_vma *vma;
	int ret;
@@ -492,8 +492,8 @@ static int i915_gem_object_info(struct seq_file *m, void* data)
		   count, size);

	seq_printf(m, "%llu [%llu] gtt total\n",
		   dev_priv->gtt.base.total,
		   (u64)dev_priv->gtt.mappable_end - dev_priv->gtt.base.start);
		   dev_priv->ggtt.base.total,
		   (u64)dev_priv->ggtt.mappable_end - dev_priv->ggtt.base.start);

	seq_putc(m, '\n');
	print_batch_pool_stats(m, dev_priv);
+9 −9
Original line number Diff line number Diff line
@@ -491,8 +491,8 @@ static int i915_kick_out_firmware_fb(struct drm_i915_private *dev_priv)
	if (!ap)
		return -ENOMEM;

	ap->ranges[0].base = dev_priv->gtt.mappable_base;
	ap->ranges[0].size = dev_priv->gtt.mappable_end;
	ap->ranges[0].base = dev_priv->ggtt.mappable_base;
	ap->ranges[0].size = dev_priv->ggtt.mappable_end;

	primary =
		pdev->resource[PCI_ROM_RESOURCE].flags & IORESOURCE_ROM_SHADOW;
@@ -1172,17 +1172,17 @@ static int i915_driver_init_hw(struct drm_i915_private *dev_priv)
	if (IS_BROADWATER(dev) || IS_CRESTLINE(dev))
		dma_set_coherent_mask(&dev->pdev->dev, DMA_BIT_MASK(32));

	aperture_size = dev_priv->gtt.mappable_end;
	aperture_size = dev_priv->ggtt.mappable_end;

	dev_priv->gtt.mappable =
		io_mapping_create_wc(dev_priv->gtt.mappable_base,
	dev_priv->ggtt.mappable =
		io_mapping_create_wc(dev_priv->ggtt.mappable_base,
				     aperture_size);
	if (dev_priv->gtt.mappable == NULL) {
	if (dev_priv->ggtt.mappable == NULL) {
		ret = -EIO;
		goto out_gtt;
	}

	dev_priv->gtt.mtrr = arch_phys_wc_add(dev_priv->gtt.mappable_base,
	dev_priv->ggtt.mtrr = arch_phys_wc_add(dev_priv->ggtt.mappable_base,
					      aperture_size);

	pm_qos_add_request(&dev_priv->pm_qos, PM_QOS_CPU_DMA_LATENCY,
@@ -1230,8 +1230,8 @@ static void i915_driver_cleanup_hw(struct drm_i915_private *dev_priv)
		pci_disable_msi(dev->pdev);

	pm_qos_remove_request(&dev_priv->pm_qos);
	arch_phys_wc_del(dev_priv->gtt.mtrr);
	io_mapping_free(dev_priv->gtt.mappable);
	arch_phys_wc_del(dev_priv->ggtt.mtrr);
	io_mapping_free(dev_priv->ggtt.mappable);
	i915_global_gtt_cleanup(dev);
}

+2 −2
Original line number Diff line number Diff line
@@ -1810,7 +1810,7 @@ struct drm_i915_private {
	struct drm_atomic_state *modeset_restore_state;

	struct list_head vm_list; /* Global list of all address spaces */
	struct i915_gtt gtt; /* VM representing the global address space */
	struct i915_ggtt ggtt; /* VM representing the global address space */

	struct i915_gem_mm mm;
	DECLARE_HASHTABLE(mm_structs, 7);
@@ -3126,7 +3126,7 @@ bool i915_gem_obj_is_pinned(struct drm_i915_gem_object *obj);

/* Some GGTT VM helpers */
#define i915_obj_to_ggtt(obj) \
	(&((struct drm_i915_private *)(obj)->base.dev->dev_private)->gtt.base)
	(&((struct drm_i915_private *)(obj)->base.dev->dev_private)->ggtt.base)

static inline struct i915_hw_ppgtt *
i915_vm_to_ppgtt(struct i915_address_space *vm)
+8 −8
Original line number Diff line number Diff line
@@ -132,7 +132,7 @@ i915_gem_get_aperture_ioctl(struct drm_device *dev, void *data,
{
	struct drm_i915_private *dev_priv = dev->dev_private;
	struct drm_i915_gem_get_aperture *args = data;
	struct i915_gtt *ggtt = &dev_priv->gtt;
	struct i915_ggtt *ggtt = &dev_priv->ggtt;
	struct i915_vma *vma;
	size_t pinned;

@@ -146,7 +146,7 @@ i915_gem_get_aperture_ioctl(struct drm_device *dev, void *data,
			pinned += vma->node.size;
	mutex_unlock(&dev->struct_mutex);

	args->aper_size = dev_priv->gtt.base.total;
	args->aper_size = dev_priv->ggtt.base.total;
	args->aper_available_size = args->aper_size - pinned;

	return 0;
@@ -807,7 +807,7 @@ i915_gem_gtt_pwrite_fast(struct drm_device *dev,
		 * source page isn't available.  Return the error and we'll
		 * retry in the slow path.
		 */
		if (fast_user_write(dev_priv->gtt.mappable, page_base,
		if (fast_user_write(dev_priv->ggtt.mappable, page_base,
				    page_offset, user_data, page_length)) {
			ret = -EFAULT;
			goto out_flush;
@@ -1825,7 +1825,7 @@ int i915_gem_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
	}

	/* Use a partial view if the object is bigger than the aperture. */
	if (obj->base.size >= dev_priv->gtt.mappable_end &&
	if (obj->base.size >= dev_priv->ggtt.mappable_end &&
	    obj->tiling_mode == I915_TILING_NONE) {
		static const unsigned int chunk_size = 256; // 1 MiB

@@ -1853,7 +1853,7 @@ int i915_gem_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
		goto unpin;

	/* Finally, remap it using the new GTT offset */
	pfn = dev_priv->gtt.mappable_base +
	pfn = dev_priv->ggtt.mappable_base +
		i915_gem_obj_ggtt_offset_view(obj, &view);
	pfn >>= PAGE_SHIFT;

@@ -3511,7 +3511,7 @@ i915_gem_object_bind_to_vm(struct drm_i915_gem_object *obj,
	start = flags & PIN_OFFSET_BIAS ? flags & PIN_OFFSET_MASK : 0;
	end = vm->total;
	if (flags & PIN_MAPPABLE)
		end = min_t(u64, end, dev_priv->gtt.mappable_end);
		end = min_t(u64, end, dev_priv->ggtt.mappable_end);
	if (flags & PIN_ZONE_4G)
		end = min_t(u64, end, (1ULL << 32) - PAGE_SIZE);

@@ -3772,7 +3772,7 @@ i915_gem_object_set_to_gtt_domain(struct drm_i915_gem_object *obj, bool write)
	vma = i915_gem_obj_to_ggtt(obj);
	if (vma && drm_mm_node_allocated(&vma->node) && !obj->active)
		list_move_tail(&vma->vm_link,
			       &to_i915(obj->base.dev)->gtt.base.inactive_list);
			       &to_i915(obj->base.dev)->ggtt.base.inactive_list);

	return 0;
}
@@ -4209,7 +4209,7 @@ void __i915_vma_set_map_and_fenceable(struct i915_vma *vma)
		     (vma->node.start & (fence_alignment - 1)) == 0);

	mappable = (vma->node.start + fence_size <=
		    to_i915(obj->base.dev)->gtt.mappable_end);
		    to_i915(obj->base.dev)->ggtt.mappable_end);

	obj->map_and_fenceable = mappable && fenceable;
}
+1 −1
Original line number Diff line number Diff line
@@ -945,7 +945,7 @@ int i915_gem_context_getparam_ioctl(struct drm_device *dev, void *data,
		else if (to_i915(dev)->mm.aliasing_ppgtt)
			args->value = to_i915(dev)->mm.aliasing_ppgtt->base.total;
		else
			args->value = to_i915(dev)->gtt.base.total;
			args->value = to_i915(dev)->ggtt.base.total;
		break;
	default:
		ret = -EINVAL;
Loading