History

drm/i915: Fix up vma alignment to be u64

This is not the full fix, as we are required to percolate the u64 nature down through the drm_mm stack, but this is required now to prevent explosions due to mismatch between execbuf (eb_vma_misplaced) and vma binding (i915_vma_misplaced) - and reduces the risk of spurious changes as we adjust the vma interface in the next patches. v2: long long casts not required for u64 printk (%llx)

Chris Wilson committed 10 years ago

Commit 2ffffd01 parent e655bc33 files · +20 −21Browse files

Unified · Split

3 files
  1. drivers/gpu/drm/i915/i915_drv.h +6 −8
  2. drivers/gpu/drm/i915/i915_gem.c +11 −11
  3. drivers/gpu/drm/i915/i915_gem_evict.c +3 −2
drivers/gpu/drm/i915/i915_drv.h+6−8
@@ -3032,13 +3032,13 @@ void i915_gem_free_object(struct drm_gem_object *obj); · 3031 unmodified lines
30323032 int __must_check
30333033 i915_gem_object_pin(struct drm_i915_gem_object *obj,
30343034 struct i915_address_space *vm,
3035− uint32_t alignment,
3036− uint64_t flags);
3035+ u64 alignment,
3036+ u64 flags);
30373037 int __must_check
30383038 i915_gem_object_ggtt_pin(struct drm_i915_gem_object *obj,
30393039 const struct i915_ggtt_view *view,
3040− uint32_t alignment,
3041− uint64_t flags);
3040+ u64 alignment,
3041+ u64 flags);
30423042
30433043 int i915_vma_bind(struct i915_vma *vma, enum i915_cache_level cache_level,
30443044 u32 flags);
@@ -3398,11 +3398,9 @@ int i915_gem_context_reset_stats_ioctl(struct drm_device *dev, void *data, · 353 unmodified lines
33983398
33993399 /* i915_gem_evict.c */
34003400 int __must_check i915_gem_evict_something(struct i915_address_space *vm,
3401− int min_size,
3402− unsigned alignment,
3401+ u64 min_size, u64 alignment,
34033402 unsigned cache_level,
3404− unsigned long start,
3405− unsigned long end,
3403+ u64 start, u64 end,
34063404 unsigned flags);
34073405 int __must_check i915_gem_evict_for_vma(struct i915_vma *target);
34083406 int i915_gem_evict_vm(struct i915_address_space *vm, bool do_idle);
drivers/gpu/drm/i915/i915_gem.c+11−11
@@ -2963,8 +2963,8 @@ static struct i915_vma * · 2962 unmodified lines
29632963 i915_gem_object_bind_to_vm(struct drm_i915_gem_object *obj,
29642964 struct i915_address_space *vm,
29652965 const struct i915_ggtt_view *ggtt_view,
2966− unsigned alignment,
2967− uint64_t flags)
2966+ u64 alignment,
2967+ u64 flags)
29682968 {
29692969 struct drm_device *dev = obj->base.dev;
29702970 struct drm_i915_private *dev_priv = to_i915(dev);
@@ -3023,7 +3023,7 @@ i915_gem_object_bind_to_vm(struct drm_i915_gem_object *obj, · 52 unmodified lines
30233023 alignment = flags & PIN_MAPPABLE ? fence_alignment :
30243024 unfenced_alignment;
30253025 if (flags & PIN_MAPPABLE && alignment & (fence_alignment - 1)) {
3026− DRM_DEBUG("Invalid object (view type=%u) alignment requested %u\n",
3026+ DRM_DEBUG("Invalid object (view type=%u) alignment requested %llx\n",
30273027 ggtt_view ? ggtt_view->type : 0,
30283028 alignment);
30293029 return ERR_PTR(-EINVAL);
@@ -3678,7 +3678,7 @@ i915_gem_ring_throttle(struct drm_device *dev, struct drm_file *file) · 648 unmodified lines
36783678 }
36793679
36803680 static bool
3681−i915_vma_misplaced(struct i915_vma *vma, uint32_t alignment, uint64_t flags)
3681+i915_vma_misplaced(struct i915_vma *vma, u64 alignment, u64 flags)
36823682 {
36833683 struct drm_i915_gem_object *obj = vma->obj;
36843684
@@ -3727,8 +3727,8 @@ static int · 42 unmodified lines
37273727 i915_gem_object_do_pin(struct drm_i915_gem_object *obj,
37283728 struct i915_address_space *vm,
37293729 const struct i915_ggtt_view *ggtt_view,
3730− uint32_t alignment,
3731− uint64_t flags)
3730+ u64 alignment,
3731+ u64 flags)
37323732 {
37333733 struct drm_i915_private *dev_priv = to_i915(obj->base.dev);
37343734 struct i915_vma *vma;
@@ -3757,7 +3757,7 @@ i915_gem_object_do_pin(struct drm_i915_gem_object *obj, · 22 unmodified lines
37573757 if (i915_vma_misplaced(vma, alignment, flags)) {
37583758 WARN(vma->pin_count,
37593759 "bo is already pinned in %s with incorrect alignment:"
3760− " offset=%08x %08x, req.alignment=%x, req.map_and_fenceable=%d,"
3760+ " offset=%08x %08x, req.alignment=%llx, req.map_and_fenceable=%d,"
37613761 " obj->map_and_fenceable=%d\n",
37623762 ggtt_view ? "ggtt" : "ppgtt",
37633763 upper_32_bits(vma->node.start),
@@ -3798,8 +3798,8 @@ i915_gem_object_do_pin(struct drm_i915_gem_object *obj, · 34 unmodified lines
37983798 int
37993799 i915_gem_object_pin(struct drm_i915_gem_object *obj,
38003800 struct i915_address_space *vm,
3801− uint32_t alignment,
3802− uint64_t flags)
3801+ u64 alignment,
3802+ u64 flags)
38033803 {
38043804 return i915_gem_object_do_pin(obj, vm,
38053805 i915_is_ggtt(vm) ? &i915_ggtt_view_normal : NULL,
@@ -3809,8 +3809,8 @@ i915_gem_object_pin(struct drm_i915_gem_object *obj, · 3 unmodified lines
38093809 int
38103810 i915_gem_object_ggtt_pin(struct drm_i915_gem_object *obj,
38113811 const struct i915_ggtt_view *view,
3812− uint32_t alignment,
3813− uint64_t flags)
3812+ u64 alignment,
3813+ u64 flags)
38143814 {
38153815 struct drm_device *dev = obj->base.dev;
38163816 struct drm_i915_private *dev_priv = to_i915(dev);
drivers/gpu/drm/i915/i915_gem_evict.c+3−2
@@ -84,8 +84,9 @@ mark_free(struct i915_vma *vma, struct list_head *unwind) · 83 unmodified lines
8484 */
8585 int
8686 i915_gem_evict_something(struct i915_address_space *vm,
87− int min_size, unsigned alignment, unsigned cache_level,
88− unsigned long start, unsigned long end,
87+ u64 min_size, u64 alignment,
88+ unsigned cache_level,
89+ u64 start, u64 end,
8990 unsigned flags)
9091 {
9192 struct drm_i915_private *dev_priv = to_i915(vm->dev);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t