drm/i915: Rename GGTT init functions
Subsystems (2)
Joonas Lahtinen
maintainerPATCH 1/2 drm/i915: Rename GGTT init functions
Rename and document the GGTT init functions to give a better idea of the context where they are called from.
i915_gem_gtt_init => i915_init_ggtt_hwi915_gem_init_global_gtt => i915_gem_init_ggtti915_global_gtt_cleanup => i915_cleanup_ggtt_hw
--- drivers/gpu/drm/i915/i915_dma.c | 14 +++++++------- drivers/gpu/drm/i915/i915_gem.c | 2 +- drivers/gpu/drm/i915/i915_gem_gtt.c | 18 +++++++++++++++--- drivers/gpu/drm/i915/i915_gem_gtt.h | 7 +++---- 4 files changed, 26 insertions(+), 15 deletions(-)
drivers/gpu/drm/i915/i915_dma.c +7 -7
@@ -1180,7 +1180,7 @@ static int i915_driver_init_hw(struct drm_i915_private *dev_priv)intel_device_info_runtime_init (dev); - ret =i915_gem_gtt_init (dev); + ret =i915_init_ggtt_hw (dev);if (ret)return ret;
@@ -1189,13 +1189,13 @@ static int i915_driver_init_hw(struct drm_i915_private *dev_priv) ret =i915_kick_out_firmware_fb (dev_priv);if (ret) {DRM_ERROR ("failed to remove conflicting framebuffer drivers\n" ); - goto out_gtt; + goto out_ggtt; } ret =i915_kick_out_vgacon (dev_priv);if (ret) {DRM_ERROR ("failed to remove conflicting VGA console\n" ); - goto out_gtt; + goto out_ggtt; }pci_set_master (dev->pdev);
@@ -1222,7 +1222,7 @@ static int i915_driver_init_hw(struct drm_i915_private *dev_priv) aperture_size);if (dev_priv->ggtt.mappable ==NULL ) { ret = -EIO ; - goto out_gtt; + goto out_ggtt; } dev_priv->ggtt.mtrr = arch_phys_wc_add(dev_priv->ggtt.mappable_base,
@@ -1255,8 +1255,8 @@ static int i915_driver_init_hw(struct drm_i915_private *dev_priv)return 0 ; -out_gtt: -i915_global_gtt_cleanup (dev); +out_ggtt: +i915_cleanup_ggtt_hw (dev);return ret; }
@@ -1275,7 +1275,7 @@ static void i915_driver_cleanup_hw(struct drm_i915_private *dev_priv)pm_qos_remove_request (&dev_priv->pm_qos);arch_phys_wc_del (dev_priv->ggtt.mtrr);io_mapping_free (dev_priv->ggtt.mappable); -i915_global_gtt_cleanup (dev); +i915_cleanup_ggtt_hw (dev); }/**
drivers/gpu/drm/i915/i915_gem.c +1 -1
@@ -4972,7 +4972,7 @@ int i915_gem_init(struct drm_device *dev)if (ret) goto out_unlock; -i915_gem_init_global_gtt (dev); +i915_gem_init_ggtt (dev); ret =i915_gem_context_init (dev);if (ret)
drivers/gpu/drm/i915/i915_gem_gtt.c +15 -3
@@ -2808,7 +2808,11 @@ static int i915_gem_setup_global_gtt(struct drm_device *dev,return 0 ; } -void i915_gem_init_global_gtt (struct drm_device *dev) +/** +* i915_gem_init_ggtt - Initialize GEM for Global GTT +* @dev: DRM device +*/ +void i915_gem_init_ggtt (struct drm_device *dev) {struct drm_i915_private *dev_priv = dev->dev_private;u64 gtt_size, mappable_size;
@@ -2819,7 +2823,11 @@ void i915_gem_init_global_gtt(struct drm_device *dev)i915_gem_setup_global_gtt (dev,0 , mappable_size, gtt_size); } -void i915_global_gtt_cleanup (struct drm_device *dev) +/** +* i915_cleanup_ggtt_hw - Clean up GGTT hardware initialization +* @dev: DRM device +*/ +void i915_cleanup_ggtt_hw (struct drm_device *dev) {struct drm_i915_private *dev_priv = dev->dev_private;struct i915_address_space *vm = &dev_priv->ggtt.base;
@@ -3157,7 +3165,11 @@ static void i915_gmch_remove(struct i915_address_space *vm)intel_gmch_remove (); } -int i915_gem_gtt_init (struct drm_device *dev) +/** +* i915_init_ggtt_hw - Initialize GGTT hardware +* @dev: DRM device +*/ +int i915_init_ggtt_hw (struct drm_device *dev) {struct drm_i915_private *dev_priv = dev->dev_private;struct i915_ggtt *ggtt = &dev_priv->ggtt;
drivers/gpu/drm/i915/i915_gem_gtt.h +3 -4
@@ -513,10 +513,9 @@ i915_page_dir_dma_addr(const struct i915_hw_ppgtt *ppgtt, const unsigned n)px_dma (ppgtt->base.scratch_pd); } -int i915_gem_gtt_init (struct drm_device *dev); -void i915_gem_init_global_gtt (struct drm_device *dev); -void i915_global_gtt_cleanup (struct drm_device *dev); - +int i915_init_ggtt_hw (struct drm_device *dev); +void i915_gem_init_ggtt (struct drm_device *dev); +void i915_cleanup_ggtt_hw (struct drm_device *dev);int i915_ppgtt_init (struct drm_device *dev,struct i915_hw_ppgtt *ppgtt);int i915_ppgtt_init_hw (struct drm_device *dev);
Signature · 6 lines
2.5.5 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Joonas Lahtinen
maintainerPATCH 2/2 drm/i915: Refer to GGTT VM consistently
Refer to the GGTT VM consistently as "ggtt_vm" instead of just "ggtt", "vm" or indirectly through other variables like "dev_priv->ggtt.base" to avoid confusion with the i915_ggtt object itself and PPGTT VMs.
As a bonus gets rid of the long-standing i915_obj_to_ggtt vs. i915_gem_obj_to_ggtt conflict, due to the other becoming i915_obj_to_ggtt_vm!
--- drivers/gpu/drm/i915/i915_debugfs.c | 16 ++-- drivers/gpu/drm/i915/i915_drv.h | 6 +- drivers/gpu/drm/i915/i915_gem.c | 19 ++--- drivers/gpu/drm/i915/i915_gem_gtt.c | 131 +++++++++++++++++---------------- drivers/gpu/drm/i915/i915_gem_stolen.c | 10 +-- 5 files changed, 94 insertions(+), 88 deletions(-)
drivers/gpu/drm/i915/i915_debugfs.c +8 -8
@@ -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->ggtt.base; +struct i915_address_space *ggtt_vm = &dev_priv->ggtt.base;struct i915_vma *vma;u64 total_obj_size, total_gtt_size;int count, ret;
@@ -216,11 +216,11 @@ static int i915_gem_object_list_info(struct seq_file *m, void *data)switch (list) {case ACTIVE_LIST :seq_puts (m,"Active:\n" ); - head = &vm->active_list; + head = &ggtt_vm->active_list;break ;case INACTIVE_LIST :seq_puts (m,"Inactive:\n" ); - head = &vm->inactive_list; + head = &ggtt_vm->inactive_list;break ;default :mutex_unlock (&dev->struct_mutex);
@@ -430,10 +430,11 @@ static int i915_gem_object_info(struct seq_file *m, void* data)struct drm_info_node *node = m->private;struct drm_device *dev = node->minor->dev;struct drm_i915_private *dev_priv = dev->dev_private; +struct i915_ggtt *ggtt = &dev_priv->ggtt; +struct i915_address_space *ggtt_vm = &ggtt->base;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->ggtt.base;struct drm_file *file;struct i915_vma *vma;int ret;
@@ -452,12 +453,12 @@ static int i915_gem_object_info(struct seq_file *m, void* data) count, mappable_count, size, mappable_size); size = count = mappable_size = mappable_count =0 ; -count_vmas (&vm->active_list, vm_link); +count_vmas (&ggtt_vm->active_list, vm_link);seq_printf (m," %u [%u] active objects, %llu [%llu] bytes\n" , count, mappable_count, size, mappable_size); size = count = mappable_size = mappable_count =0 ; -count_vmas (&vm->inactive_list, vm_link); +count_vmas (&ggtt_vm->inactive_list, vm_link);seq_printf (m," %u [%u] inactive objects, %llu [%llu] bytes\n" , count, mappable_count, size, mappable_size);
@@ -492,8 +493,7 @@ static int i915_gem_object_info(struct seq_file *m, void* data) count, size);seq_printf (m,"%llu [%llu] gtt total\n" , - dev_priv->ggtt.base.total, - (u64 )dev_priv->ggtt.mappable_end - dev_priv->ggtt.base.start); + ggtt_vm->total, ggtt->mappable_end - ggtt_vm->start);seq_putc (m,'\n' );print_batch_pool_stats (m, dev_priv);
drivers/gpu/drm/i915/i915_drv.h +3 -3
@@ -3137,7 +3137,7 @@ i915_gem_obj_to_ggtt(struct drm_i915_gem_object *obj)bool i915_gem_obj_is_pinned (struct drm_i915_gem_object *obj);/* Some GGTT VM helpers */ -#define i915_obj_to_ggtt (obj) \ +#define i915_obj_to_ggtt_vm (obj) \ (&((struct drm_i915_private *)(obj)->base.dev->dev_private)->ggtt.base) static inline struct i915_hw_ppgtt *
@@ -3156,7 +3156,7 @@ static inline bool i915_gem_obj_ggtt_bound(struct drm_i915_gem_object *obj)static inline unsigned long i915_gem_obj_ggtt_size (struct drm_i915_gem_object *obj) { -return i915_gem_obj_size (obj,i915_obj_to_ggtt (obj)); +return i915_gem_obj_size (obj,i915_obj_to_ggtt_vm (obj)); } static inline int __must_check
@@ -3164,7 +3164,7 @@ i915_gem_obj_ggtt_pin(struct drm_i915_gem_object *obj,uint32_t alignment, unsigned flags) { - return i915_gem_object_pin(obj, i915_obj_to_ggtt(obj), + return i915_gem_object_pin(obj, i915_obj_to_ggtt_vm(obj), alignment, flags | PIN_GLOBAL); }
drivers/gpu/drm/i915/i915_gem.c +10 -9
@@ -133,6 +133,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_ggtt *ggtt = &dev_priv->ggtt; +struct i915_address_space *ggtt_vm = &ggtt->base;struct i915_vma *vma;size_t pinned;
@@ -146,7 +147,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->ggtt.base.total; + args->aper_size = ggtt_vm->total; args->aper_available_size = args->aper_size - pinned;return 0 ;
@@ -3772,7 +3773,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)->ggtt.base.inactive_list); + &i915_obj_to_ggtt_vm (obj)->inactive_list);return 0 ; }
@@ -4309,7 +4310,7 @@ i915_gem_object_ggtt_pin(struct drm_i915_gem_object *obj,if (WARN_ONCE (!view,"no view specified" ))return -EINVAL ; -return i915_gem_object_do_pin (obj,i915_obj_to_ggtt (obj), view, +return i915_gem_object_do_pin (obj,i915_obj_to_ggtt_vm (obj), view, alignment, flags |PIN_GLOBAL ); }
@@ -4621,14 +4622,14 @@ struct i915_vma *i915_gem_obj_to_vma(struct drm_i915_gem_object *obj,struct i915_vma *i915_gem_obj_to_ggtt_view (struct drm_i915_gem_object *obj,const struct i915_ggtt_view *view) { -struct i915_address_space *ggtt =i915_obj_to_ggtt (obj); +struct i915_address_space *ggtt_vm =i915_obj_to_ggtt_vm (obj);struct i915_vma *vma;if (WARN_ONCE (!view,"no view specified" ))return ERR_PTR (-EINVAL );list_for_each_entry (vma, &obj->vma_list, obj_link) -if (vma->vm == ggtt && +if (vma->vm == ggtt_vm &&i915_ggtt_view_equal (&vma->ggtt_view, view))return vma;return NULL ;
@@ -5221,11 +5222,11 @@ u64 i915_gem_obj_offset(struct drm_i915_gem_object *o,u64 i915_gem_obj_ggtt_offset_view (struct drm_i915_gem_object *o,const struct i915_ggtt_view *view) { -struct i915_address_space *ggtt =i915_obj_to_ggtt (o); +struct i915_address_space *ggtt_vm =i915_obj_to_ggtt_vm (o);struct i915_vma *vma;list_for_each_entry (vma, &o->vma_list, obj_link) -if (vma->vm == ggtt && +if (vma->vm == ggtt_vm &&i915_ggtt_view_equal (&vma->ggtt_view, view))return vma->node.start;
@@ -5252,11 +5253,11 @@ bool i915_gem_obj_bound(struct drm_i915_gem_object *o,bool i915_gem_obj_ggtt_bound_view (struct drm_i915_gem_object *o,const struct i915_ggtt_view *view) { -struct i915_address_space *ggtt =i915_obj_to_ggtt (o); +struct i915_address_space *ggtt_vm =i915_obj_to_ggtt_vm (o);struct i915_vma *vma;list_for_each_entry (vma, &o->vma_list, obj_link) -if (vma->vm == ggtt && +if (vma->vm == ggtt_vm &&i915_ggtt_view_equal (&vma->ggtt_view, view) &&drm_mm_node_allocated (&vma->node))return true;
drivers/gpu/drm/i915/i915_gem_gtt.c +68 -63
339 lines not on this page · raw message
drivers/gpu/drm/i915/i915_gem_stolen.c +5 -5
@@ -629,7 +629,7 @@ i915_gem_object_create_stolen_for_preallocated(struct drm_device *dev, u32 size) {struct drm_i915_private *dev_priv = dev->dev_private; -struct i915_address_space *ggtt = &dev_priv->ggtt.base; +struct i915_address_space *ggtt_vm = &dev_priv->ggtt.base;struct drm_i915_gem_object *obj;struct drm_mm_node *stolen;struct i915_vma *vma;
@@ -675,7 +675,7 @@ i915_gem_object_create_stolen_for_preallocated(struct drm_device *dev,if (gtt_offset ==I915_GTT_OFFSET_NONE )return obj; - vma =i915_gem_obj_lookup_or_create_vma (obj, ggtt); + vma =i915_gem_obj_lookup_or_create_vma (obj, ggtt_vm);if (IS_ERR (vma)) { ret =PTR_ERR (vma); goto err;
@@ -688,8 +688,8 @@ i915_gem_object_create_stolen_for_preallocated(struct drm_device *dev,*/ vma->node.start = gtt_offset; vma->node.size = size; -if (drm_mm_initialized (&ggtt->mm)) { - ret =drm_mm_reserve_node (&ggtt->mm, &vma->node); +if (drm_mm_initialized (&ggtt_vm->mm)) { + ret =drm_mm_reserve_node (&ggtt_vm->mm, &vma->node);if (ret) {DRM_DEBUG_KMS ("failed to allocate stolen GTT space\n" ); goto err;
@@ -697,7 +697,7 @@ i915_gem_object_create_stolen_for_preallocated(struct drm_device *dev, vma->bound |=GLOBAL_BIND ;__i915_vma_set_map_and_fenceable (vma); -list_add_tail (&vma->vm_link, &ggtt->inactive_list); +list_add_tail (&vma->vm_link, &ggtt_vm->inactive_list); }list_add_tail (&obj->global_list, &dev_priv->mm.bound_list);
Signature · 6 lines
2.5.5 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Joonas Lahtinen
maintainerPATCH v2 1/1 drm/i915: Refer to GGTT VM consistently
Refer to the GGTT VM consistently as "ggtt_vm" instead of just "ggtt", "vm" or indirectly through other variables like "dev_priv->ggtt.base" to avoid confusion with the i915_ggtt object itself and PPGTT VMs.
As a bonus gets rid of the long-standing i915_obj_to_ggtt vs. i915_gem_obj_to_ggtt conflict, due to the other becoming i915_obj_to_ggtt_vm!
v2:
- Added some more after grepping sources with Chris
--- drivers/gpu/drm/i915/i915_debugfs.c | 16 ++-- drivers/gpu/drm/i915/i915_drv.h | 6 +- drivers/gpu/drm/i915/i915_gem.c | 23 +++--- drivers/gpu/drm/i915/i915_gem_gtt.c | 141 +++++++++++++++++---------------- drivers/gpu/drm/i915/i915_gem_stolen.c | 10 +-- 5 files changed, 100 insertions(+), 96 deletions(-)
drivers/gpu/drm/i915/i915_debugfs.c +8 -8
@@ -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->ggtt.base; +struct i915_address_space *ggtt_vm = &dev_priv->ggtt.base;struct i915_vma *vma;u64 total_obj_size, total_gtt_size;int count, ret;
@@ -216,11 +216,11 @@ static int i915_gem_object_list_info(struct seq_file *m, void *data)switch (list) {case ACTIVE_LIST :seq_puts (m,"Active:\n" ); - head = &vm->active_list; + head = &ggtt_vm->active_list;break ;case INACTIVE_LIST :seq_puts (m,"Inactive:\n" ); - head = &vm->inactive_list; + head = &ggtt_vm->inactive_list;break ;default :mutex_unlock (&dev->struct_mutex);
@@ -430,10 +430,11 @@ static int i915_gem_object_info(struct seq_file *m, void* data)struct drm_info_node *node = m->private;struct drm_device *dev = node->minor->dev;struct drm_i915_private *dev_priv = dev->dev_private; +struct i915_ggtt *ggtt = &dev_priv->ggtt; +struct i915_address_space *ggtt_vm = &ggtt->base;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->ggtt.base;struct drm_file *file;struct i915_vma *vma;int ret;
@@ -452,12 +453,12 @@ static int i915_gem_object_info(struct seq_file *m, void* data) count, mappable_count, size, mappable_size); size = count = mappable_size = mappable_count =0 ; -count_vmas (&vm->active_list, vm_link); +count_vmas (&ggtt_vm->active_list, vm_link);seq_printf (m," %u [%u] active objects, %llu [%llu] bytes\n" , count, mappable_count, size, mappable_size); size = count = mappable_size = mappable_count =0 ; -count_vmas (&vm->inactive_list, vm_link); +count_vmas (&ggtt_vm->inactive_list, vm_link);seq_printf (m," %u [%u] inactive objects, %llu [%llu] bytes\n" , count, mappable_count, size, mappable_size);
@@ -492,8 +493,7 @@ static int i915_gem_object_info(struct seq_file *m, void* data) count, size);seq_printf (m,"%llu [%llu] gtt total\n" , - dev_priv->ggtt.base.total, - (u64 )dev_priv->ggtt.mappable_end - dev_priv->ggtt.base.start); + ggtt_vm->total, ggtt->mappable_end - ggtt_vm->start);seq_putc (m,'\n' );print_batch_pool_stats (m, dev_priv);
drivers/gpu/drm/i915/i915_drv.h +3 -3
@@ -3137,7 +3137,7 @@ i915_gem_obj_to_ggtt(struct drm_i915_gem_object *obj)bool i915_gem_obj_is_pinned (struct drm_i915_gem_object *obj);/* Some GGTT VM helpers */ -#define i915_obj_to_ggtt (obj) \ +#define i915_obj_to_ggtt_vm (obj) \ (&((struct drm_i915_private *)(obj)->base.dev->dev_private)->ggtt.base) static inline struct i915_hw_ppgtt *
@@ -3156,7 +3156,7 @@ static inline bool i915_gem_obj_ggtt_bound(struct drm_i915_gem_object *obj)static inline unsigned long i915_gem_obj_ggtt_size (struct drm_i915_gem_object *obj) { -return i915_gem_obj_size (obj,i915_obj_to_ggtt (obj)); +return i915_gem_obj_size (obj,i915_obj_to_ggtt_vm (obj)); } static inline int __must_check
@@ -3164,7 +3164,7 @@ i915_gem_obj_ggtt_pin(struct drm_i915_gem_object *obj,uint32_t alignment, unsigned flags) { - return i915_gem_object_pin(obj, i915_obj_to_ggtt(obj), + return i915_gem_object_pin(obj, i915_obj_to_ggtt_vm(obj), alignment, flags | PIN_GLOBAL); }
drivers/gpu/drm/i915/i915_gem.c +12 -11
@@ -133,20 +133,21 @@ 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_ggtt *ggtt = &dev_priv->ggtt; +struct i915_address_space *ggtt_vm = &ggtt->base;struct i915_vma *vma;size_t pinned; pinned =0 ;mutex_lock (&dev->struct_mutex); -list_for_each_entry (vma, &ggtt->base.active_list, vm_link) +list_for_each_entry (vma, &ggtt_vm->active_list, vm_link)if (vma->pin_count) pinned += vma->node.size; -list_for_each_entry (vma, &ggtt->base.inactive_list, vm_link) +list_for_each_entry (vma, &ggtt_vm->inactive_list, vm_link)if (vma->pin_count) pinned += vma->node.size;mutex_unlock (&dev->struct_mutex); - args->aper_size = dev_priv->ggtt.base.total; + args->aper_size = ggtt_vm->total; args->aper_available_size = args->aper_size - pinned;return 0 ;
@@ -3772,7 +3773,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)->ggtt.base.inactive_list); + &i915_obj_to_ggtt_vm (obj)->inactive_list);return 0 ; }
@@ -4309,7 +4310,7 @@ i915_gem_object_ggtt_pin(struct drm_i915_gem_object *obj,if (WARN_ONCE (!view,"no view specified" ))return -EINVAL ; -return i915_gem_object_do_pin (obj,i915_obj_to_ggtt (obj), view, +return i915_gem_object_do_pin (obj,i915_obj_to_ggtt_vm (obj), view, alignment, flags |PIN_GLOBAL ); }
@@ -4621,14 +4622,14 @@ struct i915_vma *i915_gem_obj_to_vma(struct drm_i915_gem_object *obj,struct i915_vma *i915_gem_obj_to_ggtt_view (struct drm_i915_gem_object *obj,const struct i915_ggtt_view *view) { -struct i915_address_space *ggtt =i915_obj_to_ggtt (obj); +struct i915_address_space *ggtt_vm =i915_obj_to_ggtt_vm (obj);struct i915_vma *vma;if (WARN_ONCE (!view,"no view specified" ))return ERR_PTR (-EINVAL );list_for_each_entry (vma, &obj->vma_list, obj_link) -if (vma->vm == ggtt && +if (vma->vm == ggtt_vm &&i915_ggtt_view_equal (&vma->ggtt_view, view))return vma;return NULL ;
@@ -5221,11 +5222,11 @@ u64 i915_gem_obj_offset(struct drm_i915_gem_object *o,u64 i915_gem_obj_ggtt_offset_view (struct drm_i915_gem_object *o,const struct i915_ggtt_view *view) { -struct i915_address_space *ggtt =i915_obj_to_ggtt (o); +struct i915_address_space *ggtt_vm =i915_obj_to_ggtt_vm (o);struct i915_vma *vma;list_for_each_entry (vma, &o->vma_list, obj_link) -if (vma->vm == ggtt && +if (vma->vm == ggtt_vm &&i915_ggtt_view_equal (&vma->ggtt_view, view))return vma->node.start;
@@ -5252,11 +5253,11 @@ bool i915_gem_obj_bound(struct drm_i915_gem_object *o,bool i915_gem_obj_ggtt_bound_view (struct drm_i915_gem_object *o,const struct i915_ggtt_view *view) { -struct i915_address_space *ggtt =i915_obj_to_ggtt (o); +struct i915_address_space *ggtt_vm =i915_obj_to_ggtt_vm (o);struct i915_vma *vma;list_for_each_entry (vma, &o->vma_list, obj_link) -if (vma->vm == ggtt && +if (vma->vm == ggtt_vm &&i915_ggtt_view_equal (&vma->ggtt_view, view) &&drm_mm_node_allocated (&vma->node))return true;
drivers/gpu/drm/i915/i915_gem_gtt.c +72 -69
359 lines not on this page · raw message
drivers/gpu/drm/i915/i915_gem_stolen.c +5 -5
@@ -629,7 +629,7 @@ i915_gem_object_create_stolen_for_preallocated(struct drm_device *dev, u32 size) {struct drm_i915_private *dev_priv = dev->dev_private; -struct i915_address_space *ggtt = &dev_priv->ggtt.base; +struct i915_address_space *ggtt_vm = &dev_priv->ggtt.base;struct drm_i915_gem_object *obj;struct drm_mm_node *stolen;struct i915_vma *vma;
@@ -675,7 +675,7 @@ i915_gem_object_create_stolen_for_preallocated(struct drm_device *dev,if (gtt_offset ==I915_GTT_OFFSET_NONE )return obj; - vma =i915_gem_obj_lookup_or_create_vma (obj, ggtt); + vma =i915_gem_obj_lookup_or_create_vma (obj, ggtt_vm);if (IS_ERR (vma)) { ret =PTR_ERR (vma); goto err;
@@ -688,8 +688,8 @@ i915_gem_object_create_stolen_for_preallocated(struct drm_device *dev,*/ vma->node.start = gtt_offset; vma->node.size = size; -if (drm_mm_initialized (&ggtt->mm)) { - ret =drm_mm_reserve_node (&ggtt->mm, &vma->node); +if (drm_mm_initialized (&ggtt_vm->mm)) { + ret =drm_mm_reserve_node (&ggtt_vm->mm, &vma->node);if (ret) {DRM_DEBUG_KMS ("failed to allocate stolen GTT space\n" ); goto err;
@@ -697,7 +697,7 @@ i915_gem_object_create_stolen_for_preallocated(struct drm_device *dev, vma->bound |=GLOBAL_BIND ;__i915_vma_set_map_and_fenceable (vma); -list_add_tail (&vma->vm_link, &ggtt->inactive_list); +list_add_tail (&vma->vm_link, &ggtt_vm->inactive_list); }list_add_tail (&obj->global_list, &dev_priv->mm.bound_list);
Signature · 6 lines
2.5.5 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 2/2] drm/i915: Refer to GGTT VM consistently
In reply to Joonas LahtinenQuoted 3 lines · Joonas Lahtinen
Refer to the GGTT VM consistently as "
ggtt_vm" instead of just "ggtt", "vm" or indirectly through other variables like "dev_priv->ggtt.base" to avoid confusion with thei915_ggttobject itself and PPGTT VMs.
On the one hand, yes it seems more fitting to call it ggtt_vm. On the other, we've been pretty consistent in calling the address space ggtt! And I like the look of ggtt far more than ggtt_vm. Killing off more mixed dev_priv->ggtt.base and ggtt pointer usage is definitely good though. But I'm ambivalent about the whole.
-Chris
Signature · 5 lines
Chris Wilson, Intel Open Source Technology Centre _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Joonas Lahtinen
maintainerRe: [PATCH 2/2] drm/i915: Refer to GGTT VM consistently
Quoted 10 lines · Chris Wilson
Quoted 4 lines · Joonas Lahtinen
Refer to the GGTT VM consistently as "
ggtt_vm" instead of just "ggtt", "vm" or indirectly through other variables like "dev_priv->ggtt.base" to avoid confusion with thei915_ggttobject itself and PPGTT VMs.On the one hand, yes it seems more fitting to call it
ggtt_vm. On the other, we've been pretty consistent in calling the address space ggtt! And I like the look of ggtt far more thanggtt_vm. Killing off more mixeddev_priv->ggtt.baseand ggtt pointer usage is definitely good though. But I'm ambivalent about the whole.
Right, ppgtt->base is also being used quite some so I guess you're right. I'll reroll the patches to get rid of ggtt_vm's everywhere and use ggtt->base. (I myself hate the convention, but lets stick to one convention).
Regards, Joonas
Quoted 2 lines
-Chris
Signature · 7 lines
Joonas Lahtinen Open Source Technology Center Intel Corporation _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Joonas Lahtinen
maintainerPATCH v3 1/1 drm/i915: Refer to GGTT VM consistently
In reply to Chris WilsonRefer to the GGTT VM consistently as "ggtt->base" instead of just "ggtt", "vm" or indirectly through other variables like "dev_priv->ggtt.base" to avoid confusion with the i915_ggtt object itself and PPGTT VMs.
As a bonus gets rid of the long-standing i915_obj_to_ggtt vs. i915_gem_obj_to_ggtt conflict, due to removal of i915_obj_to_ggtt!
v2:
- Added some more after grepping sources with Chris
v3:
- Refer to GGTT VM through ggtt->base consistently instead of ggtt_vm
--- drivers/gpu/drm/i915/i915_debugfs.c | 15 +++--- drivers/gpu/drm/i915/i915_drv.h | 15 ++++-- drivers/gpu/drm/i915/i915_gem.c | 31 ++++++++---- drivers/gpu/drm/i915/i915_gem_gtt.c | 93 +++++++++++++++++----------------- drivers/gpu/drm/i915/i915_gem_stolen.c | 10 ++-- drivers/gpu/drm/i915/i915_vgpu.c | 24 ++++----- 6 files changed, 102 insertions(+), 86 deletions(-)
drivers/gpu/drm/i915/i915_debugfs.c +7 -8
@@ -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->ggtt.base; +struct i915_ggtt *ggtt = &dev_priv->ggtt;struct i915_vma *vma;u64 total_obj_size, total_gtt_size;int count, ret;
@@ -216,11 +216,11 @@ static int i915_gem_object_list_info(struct seq_file *m, void *data)switch (list) {case ACTIVE_LIST :seq_puts (m,"Active:\n" ); - head = &vm->active_list; + head = &ggtt->base.active_list;break ;case INACTIVE_LIST :seq_puts (m,"Inactive:\n" ); - head = &vm->inactive_list; + head = &ggtt->base.inactive_list;break ;default :mutex_unlock (&dev->struct_mutex);
@@ -430,10 +430,10 @@ static int i915_gem_object_info(struct seq_file *m, void* data)struct drm_info_node *node = m->private;struct drm_device *dev = node->minor->dev;struct drm_i915_private *dev_priv = dev->dev_private; +struct i915_ggtt *ggtt = &dev_priv->ggtt;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->ggtt.base;struct drm_file *file;struct i915_vma *vma;int ret;
@@ -452,12 +452,12 @@ static int i915_gem_object_info(struct seq_file *m, void* data) count, mappable_count, size, mappable_size); size = count = mappable_size = mappable_count =0 ; -count_vmas (&vm->active_list, vm_link); +count_vmas (&ggtt->base.active_list, vm_link);seq_printf (m," %u [%u] active objects, %llu [%llu] bytes\n" , count, mappable_count, size, mappable_size); size = count = mappable_size = mappable_count =0 ; -count_vmas (&vm->inactive_list, vm_link); +count_vmas (&ggtt->base.inactive_list, vm_link);seq_printf (m," %u [%u] inactive objects, %llu [%llu] bytes\n" , count, mappable_count, size, mappable_size);
@@ -492,8 +492,7 @@ static int i915_gem_object_info(struct seq_file *m, void* data) count, size);seq_printf (m,"%llu [%llu] gtt total\n" , - dev_priv->ggtt.base.total, - (u64 )dev_priv->ggtt.mappable_end - dev_priv->ggtt.base.start); + ggtt->base.total, ggtt->mappable_end - ggtt->base.start);seq_putc (m,'\n' );print_batch_pool_stats (m, dev_priv);
drivers/gpu/drm/i915/i915_drv.h +10 -5
@@ -3147,9 +3147,6 @@ i915_gem_obj_to_ggtt(struct drm_i915_gem_object *obj)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)->ggtt.base) -static inline struct i915_hw_ppgtt *i915_vm_to_ppgtt (struct i915_address_space *vm) {
@@ -3166,7 +3163,11 @@ static inline bool i915_gem_obj_ggtt_bound(struct drm_i915_gem_object *obj)static inline unsigned long i915_gem_obj_ggtt_size (struct drm_i915_gem_object *obj) { -return i915_gem_obj_size (obj,i915_obj_to_ggtt (obj)); +struct drm_device *dev = obj->base.dev; +struct drm_i915_private *dev_priv = dev->dev_private; +struct i915_ggtt *ggtt = &dev_priv->ggtt; + +return i915_gem_obj_size (obj, &ggtt->base); } static inline int __must_check
@@ -3174,7 +3175,11 @@ i915_gem_obj_ggtt_pin(struct drm_i915_gem_object *obj, uint32_t alignment, unsigned flags) { - return i915_gem_object_pin(obj, i915_obj_to_ggtt(obj), +struct drm_device *dev = obj->base.dev; +struct drm_i915_private *dev_priv = dev->dev_private; +struct i915_ggtt *ggtt = &dev_priv->ggtt; + +return i915_gem_object_pin (obj, &ggtt->base, alignment, flags |PIN_GLOBAL ); }
drivers/gpu/drm/i915/i915_gem.c +22 -9
@@ -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->ggtt.base.total; + args->aper_size = ggtt->base.total; args->aper_available_size = args->aper_size - pinned;return 0 ;
@@ -3712,6 +3712,9 @@ i915_gem_object_flush_cpu_write_domain(struct drm_i915_gem_object *obj)int i915_gem_object_set_to_gtt_domain (struct drm_i915_gem_object *obj,bool write) { +struct drm_device *dev = obj->base.dev; +struct drm_i915_private *dev_priv = dev->dev_private; +struct i915_ggtt *ggtt = &dev_priv->ggtt;uint32_t old_write_domain, old_read_domains;struct i915_vma *vma;int ret;
@@ -3766,7 +3769,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)->ggtt.base.inactive_list); + &ggtt->base.inactive_list);return 0 ; }
@@ -4297,9 +4300,13 @@ i915_gem_object_ggtt_pin(struct drm_i915_gem_object *obj, uint32_t alignment, uint64_t flags) { +struct drm_device *dev = obj->base.dev; +struct drm_i915_private *dev_priv = dev->dev_private; +struct i915_ggtt *ggtt = &dev_priv->ggtt; +BUG_ON (!view); -return i915_gem_object_do_pin (obj,i915_obj_to_ggtt (obj), view, +return i915_gem_object_do_pin (obj, &ggtt->base, view, alignment, flags |PIN_GLOBAL ); }
@@ -4611,13 +4618,15 @@ struct i915_vma *i915_gem_obj_to_vma(struct drm_i915_gem_object *obj,struct i915_vma *i915_gem_obj_to_ggtt_view (struct drm_i915_gem_object *obj,const struct i915_ggtt_view *view) { -struct i915_address_space *ggtt =i915_obj_to_ggtt (obj); +struct drm_device *dev = obj->base.dev; +struct drm_i915_private *dev_priv = dev->dev_private; +struct i915_ggtt *ggtt = &dev_priv->ggtt;struct i915_vma *vma;BUG_ON (!view);list_for_each_entry (vma, &obj->vma_list, obj_link) -if (vma->vm == ggtt && +if (vma->vm == &ggtt->base &&i915_ggtt_view_equal (&vma->ggtt_view, view))return vma;return NULL ;
@@ -5210,11 +5219,13 @@ u64 i915_gem_obj_offset(struct drm_i915_gem_object *o,u64 i915_gem_obj_ggtt_offset_view (struct drm_i915_gem_object *o,const struct i915_ggtt_view *view) { -struct i915_address_space *ggtt =i915_obj_to_ggtt (o); +struct drm_device *dev = o->base.dev; +struct drm_i915_private *dev_priv = dev->dev_private; +struct i915_ggtt *ggtt = &dev_priv->ggtt;struct i915_vma *vma;list_for_each_entry (vma, &o->vma_list, obj_link) -if (vma->vm == ggtt && +if (vma->vm == &ggtt->base &&i915_ggtt_view_equal (&vma->ggtt_view, view))return vma->node.start;
@@ -5241,11 +5252,13 @@ bool i915_gem_obj_bound(struct drm_i915_gem_object *o,bool i915_gem_obj_ggtt_bound_view (struct drm_i915_gem_object *o,const struct i915_ggtt_view *view) { -struct i915_address_space *ggtt =i915_obj_to_ggtt (o); +struct drm_device *dev = o->base.dev; +struct drm_i915_private *dev_priv = dev->dev_private; +struct i915_ggtt *ggtt = &dev_priv->ggtt;struct i915_vma *vma;list_for_each_entry (vma, &o->vma_list, obj_link) -if (vma->vm == ggtt && +if (vma->vm == &ggtt->base &&i915_ggtt_view_equal (&vma->ggtt_view, view) &&drm_mm_node_allocated (&vma->node))return true;
drivers/gpu/drm/i915/i915_gem_gtt.c +46 -47
274 lines not on this page · raw message
drivers/gpu/drm/i915/i915_gem_stolen.c +5 -5
@@ -629,7 +629,7 @@ i915_gem_object_create_stolen_for_preallocated(struct drm_device *dev, u32 size) {struct drm_i915_private *dev_priv = dev->dev_private; -struct i915_address_space *ggtt = &dev_priv->ggtt.base; +struct i915_ggtt *ggtt = &dev_priv->ggtt;struct drm_i915_gem_object *obj;struct drm_mm_node *stolen;struct i915_vma *vma;
@@ -675,7 +675,7 @@ i915_gem_object_create_stolen_for_preallocated(struct drm_device *dev,if (gtt_offset ==I915_GTT_OFFSET_NONE )return obj; - vma =i915_gem_obj_lookup_or_create_vma (obj, ggtt); + vma =i915_gem_obj_lookup_or_create_vma (obj, &ggtt->base);if (IS_ERR (vma)) { ret =PTR_ERR (vma); goto err;
@@ -688,8 +688,8 @@ i915_gem_object_create_stolen_for_preallocated(struct drm_device *dev,*/ vma->node.start = gtt_offset; vma->node.size = size; -if (drm_mm_initialized (&ggtt->mm)) { - ret =drm_mm_reserve_node (&ggtt->mm, &vma->node); +if (drm_mm_initialized (&ggtt->base.mm)) { + ret =drm_mm_reserve_node (&ggtt->base.mm, &vma->node);if (ret) {DRM_DEBUG_KMS ("failed to allocate stolen GTT space\n" ); goto err;
@@ -697,7 +697,7 @@ i915_gem_object_create_stolen_for_preallocated(struct drm_device *dev, vma->bound |=GLOBAL_BIND ;__i915_vma_set_map_and_fenceable (vma); -list_add_tail (&vma->vm_link, &ggtt->inactive_list); +list_add_tail (&vma->vm_link, &ggtt->base.inactive_list); }list_add_tail (&obj->global_list, &dev_priv->mm.bound_list);
drivers/gpu/drm/i915/i915_vgpu.c +12 -12
@@ -181,8 +181,8 @@ static int vgt_balloon_space(struct drm_mm *mm,int intel_vgt_balloon (struct drm_device *dev) {struct drm_i915_private *dev_priv =to_i915 (dev); -struct i915_address_space *ggtt_vm = &dev_priv->ggtt.base; -unsigned long ggtt_vm_end = ggtt_vm->start + ggtt_vm->total; +struct i915_ggtt *ggtt = &dev_priv->ggtt; +unsigned long ggtt_end = ggtt->base.start + ggtt->base.total;unsigned long mappable_base, mappable_size, mappable_end;unsigned long unmappable_base, unmappable_size, unmappable_end;
@@ -202,17 +202,17 @@ int intel_vgt_balloon(struct drm_device *dev)DRM_INFO ("Unmappable graphic memory: base 0x%lx size %ldKiB\n" , unmappable_base, unmappable_size /1024 ); -if (mappable_base < ggtt_vm->start || +if (mappable_base < ggtt->base.start || mappable_end > dev_priv->ggtt.mappable_end || unmappable_base < dev_priv->ggtt.mappable_end || - unmappable_end > ggtt_vm_end) { + unmappable_end > ggtt_end) {DRM_ERROR ("Invalid ballooning configuration!\n" );return -EINVAL ; }/* Unmappable graphic memory ballooning */ if (unmappable_base > dev_priv->ggtt.mappable_end) { - ret =vgt_balloon_space (&ggtt_vm->mm, + ret =vgt_balloon_space (&ggtt->base.mm, &bl_info.space[2 ], dev_priv->ggtt.mappable_end, unmappable_base);
@@ -225,27 +225,27 @@ int intel_vgt_balloon(struct drm_device *dev)* No need to partition out the last physical page, * because it is reserved to the guard page. */ -if (unmappable_end < ggtt_vm_end -PAGE_SIZE ) { - ret =vgt_balloon_space (&ggtt_vm->mm, +if (unmappable_end < ggtt_end -PAGE_SIZE ) { + ret =vgt_balloon_space (&ggtt->base.mm, &bl_info.space[3 ], unmappable_end, - ggtt_vm_end -PAGE_SIZE ); + ggtt_end -PAGE_SIZE );if (ret) goto err; }/* Mappable graphic memory ballooning */ -if (mappable_base > ggtt_vm->start) { - ret =vgt_balloon_space (&ggtt_vm->mm, +if (mappable_base > ggtt->base.start) { + ret =vgt_balloon_space (&ggtt->base.mm, &bl_info.space[0 ], - ggtt_vm->start, mappable_base); + ggtt->base.start, mappable_base);if (ret) goto err; }if (mappable_end < dev_priv->ggtt.mappable_end) { - ret =vgt_balloon_space (&ggtt_vm->mm, + ret =vgt_balloon_space (&ggtt->base.mm, &bl_info.space[1 ], mappable_end, dev_priv->ggtt.mappable_end);
Signature · 6 lines
2.5.5 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Joonas Lahtinen
maintainerPATCH v4 1/1 drm/i915: Refer to GGTT {,VM} consistently
In reply to Chris WilsonRefer to the GGTT VM consistently as "ggtt->base" instead of just "ggtt", "vm" or indirectly through other variables like "dev_priv->ggtt.base" to avoid confusion with the i915_ggtt object itself and PPGTT VMs.
Refer to the GGTT as "ggtt" instead of indirectly through chaining.
As a bonus gets rid of the long-standing i915_obj_to_ggtt vs. i915_gem_obj_to_ggtt conflict, due to removal of i915_obj_to_ggtt!
v2:
- Added some more after grepping sources with Chris
v3:
- Refer to GGTT VM through ggtt->base consistently instead of ggtt_vm (Chris)
v4:
- Convert all dev_priv->ggtt->foo accesses to ggtt->foo.
--- drivers/gpu/drm/i915/i915_debugfs.c | 19 ++-- drivers/gpu/drm/i915/i915_dma.c | 21 ++-- drivers/gpu/drm/i915/i915_drv.h | 13 ++- drivers/gpu/drm/i915/i915_gem.c | 50 ++++++--- drivers/gpu/drm/i915/i915_gem_execbuffer.c | 12 +- drivers/gpu/drm/i915/i915_gem_gtt.c | 170 +++++++++++++++-------------- drivers/gpu/drm/i915/i915_gem_gtt.h | 2 +- drivers/gpu/drm/i915/i915_gem_stolen.c | 98 +++++++++-------- drivers/gpu/drm/i915/i915_gpu_error.c | 12 +- drivers/gpu/drm/i915/i915_vgpu.c | 36 +++--- drivers/gpu/drm/i915/intel_display.c | 8 +- drivers/gpu/drm/i915/intel_fbc.c | 5 +- drivers/gpu/drm/i915/intel_fbdev.c | 10 +- drivers/gpu/drm/i915/intel_overlay.c | 10 +- drivers/gpu/drm/i915/intel_pm.c | 13 ++- drivers/gpu/drm/i915/intel_ringbuffer.c | 3 +- 16 files changed, 264 insertions(+), 218 deletions(-)
drivers/gpu/drm/i915/i915_debugfs.c +9 -10
@@ -202,8 +202,8 @@ static int i915_gem_object_list_info(struct seq_file *m, void *data)uintptr_t list = (uintptr_t ) node->info_ent->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->ggtt.base; +struct drm_i915_private *dev_priv =to_i915 (dev); +struct i915_ggtt *ggtt = &dev_priv->ggtt;struct i915_vma *vma;u64 total_obj_size, total_gtt_size;int count, ret;
@@ -216,11 +216,11 @@ static int i915_gem_object_list_info(struct seq_file *m, void *data)switch (list) {case ACTIVE_LIST :seq_puts (m,"Active:\n" ); - head = &vm->active_list; + head = &ggtt->base.active_list;break ;case INACTIVE_LIST :seq_puts (m,"Inactive:\n" ); - head = &vm->inactive_list; + head = &ggtt->base.inactive_list;break ;default :mutex_unlock (&dev->struct_mutex);
@@ -429,11 +429,11 @@ static int i915_gem_object_info(struct seq_file *m, void* data) {struct drm_info_node *node = m->private;struct drm_device *dev = node->minor->dev; -struct drm_i915_private *dev_priv = dev->dev_private; +struct drm_i915_private *dev_priv =to_i915 (dev); +struct i915_ggtt *ggtt = &dev_priv->ggtt;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->ggtt.base;struct drm_file *file;struct i915_vma *vma;int ret;
@@ -452,12 +452,12 @@ static int i915_gem_object_info(struct seq_file *m, void* data) count, mappable_count, size, mappable_size); size = count = mappable_size = mappable_count =0 ; -count_vmas (&vm->active_list, vm_link); +count_vmas (&ggtt->base.active_list, vm_link);seq_printf (m," %u [%u] active objects, %llu [%llu] bytes\n" , count, mappable_count, size, mappable_size); size = count = mappable_size = mappable_count =0 ; -count_vmas (&vm->inactive_list, vm_link); +count_vmas (&ggtt->base.inactive_list, vm_link);seq_printf (m," %u [%u] inactive objects, %llu [%llu] bytes\n" , count, mappable_count, size, mappable_size);
@@ -492,8 +492,7 @@ static int i915_gem_object_info(struct seq_file *m, void* data) count, size);seq_printf (m,"%llu [%llu] gtt total\n" , - dev_priv->ggtt.base.total, - (u64 )dev_priv->ggtt.mappable_end - dev_priv->ggtt.base.start); + ggtt->base.total, ggtt->mappable_end - ggtt->base.start);seq_putc (m,'\n' );print_batch_pool_stats (m, dev_priv);
drivers/gpu/drm/i915/i915_dma.c +12 -9
@@ -527,6 +527,7 @@ static int i915_kick_out_firmware_fb(struct drm_i915_private *dev_priv) {struct apertures_struct *ap;struct pci_dev *pdev = dev_priv->dev->pdev; +struct i915_ggtt *ggtt = &dev_priv->ggtt;bool primary;int ret;
@@ -534,8 +535,8 @@ static int i915_kick_out_firmware_fb(struct drm_i915_private *dev_priv)if (!ap)return -ENOMEM ; - ap->ranges[0 ].base = dev_priv->ggtt.mappable_base; - ap->ranges[0 ].size = dev_priv->ggtt.mappable_end; + ap->ranges[0 ].base = ggtt->mappable_base; + ap->ranges[0 ].size = ggtt->mappable_end; primary = pdev->resource[PCI_ROM_RESOURCE ].flags &IORESOURCE_ROM_SHADOW ;
@@ -1170,6 +1171,7 @@ static void i915_driver_cleanup_mmio(struct drm_i915_private *dev_priv)static int i915_driver_init_hw (struct drm_i915_private *dev_priv) {struct drm_device *dev = dev_priv->dev; +struct i915_ggtt *ggtt = &dev_priv->ggtt;uint32_t aperture_size;int ret;
@@ -1213,17 +1215,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->ggtt.mappable_end; + aperture_size = ggtt->mappable_end; - dev_priv->ggtt.mappable = -io_mapping_create_wc (dev_priv->ggtt.mappable_base, + ggtt->mappable = +io_mapping_create_wc (ggtt->mappable_base, aperture_size); -if (dev_priv->ggtt.mappable ==NULL ) { +if (ggtt->mappable ==NULL ) { ret = -EIO ; goto out_ggtt; } - dev_priv->ggtt.mtrr =arch_phys_wc_add (dev_priv->ggtt.mappable_base, + ggtt->mtrr =arch_phys_wc_add (ggtt->mappable_base, aperture_size); pm_qos_add_request(&dev_priv->pm_qos, PM_QOS_CPU_DMA_LATENCY,
@@ -1266,13 +1268,14 @@ out_ggtt:static void i915_driver_cleanup_hw (struct drm_i915_private *dev_priv) {struct drm_device *dev = dev_priv->dev; +struct i915_ggtt *ggtt = &dev_priv->ggtt;if (dev->pdev->msi_enabled)pci_disable_msi (dev->pdev);pm_qos_remove_request (&dev_priv->pm_qos); -arch_phys_wc_del (dev_priv->ggtt.mtrr); -io_mapping_free (dev_priv->ggtt.mappable); +arch_phys_wc_del (ggtt->mtrr); +io_mapping_free (ggtt->mappable);i915_ggtt_cleanup_hw (dev); }
drivers/gpu/drm/i915/i915_drv.h +8 -5
@@ -3147,9 +3147,6 @@ i915_gem_obj_to_ggtt(struct drm_i915_gem_object *obj)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)->ggtt.base) -static inline struct i915_hw_ppgtt *i915_vm_to_ppgtt (struct i915_address_space *vm) {
@@ -3166,7 +3163,10 @@ static inline bool i915_gem_obj_ggtt_bound(struct drm_i915_gem_object *obj)static inline unsigned long i915_gem_obj_ggtt_size (struct drm_i915_gem_object *obj) { -return i915_gem_obj_size (obj,i915_obj_to_ggtt (obj)); +struct drm_i915_private *dev_priv =to_i915 (obj->base.dev); +struct i915_ggtt *ggtt = &dev_priv->ggtt; + +return i915_gem_obj_size (obj, &ggtt->base); } static inline int __must_check
@@ -3174,7 +3174,10 @@ i915_gem_obj_ggtt_pin(struct drm_i915_gem_object *obj, uint32_t alignment, unsigned flags) { - return i915_gem_object_pin(obj, i915_obj_to_ggtt(obj), +struct drm_i915_private *dev_priv =to_i915 (obj->base.dev); +struct i915_ggtt *ggtt = &dev_priv->ggtt; + +return i915_gem_object_pin (obj, &ggtt->base, alignment, flags |PIN_GLOBAL ); }
drivers/gpu/drm/i915/i915_gem.c +32 -18
154 lines not on this page · raw message
drivers/gpu/drm/i915/i915_gem_execbuffer.c +7 -5
@@ -313,7 +313,8 @@ relocate_entry_gtt(struct drm_i915_gem_object *obj, uint64_t target_offset) {struct drm_device *dev = obj->base.dev; -struct drm_i915_private *dev_priv = dev->dev_private; +struct drm_i915_private *dev_priv =to_i915 (dev); +struct i915_ggtt *ggtt = &dev_priv->ggtt;uint64_t delta =relocation_target (reloc, target_offset);uint64_t offset;void __iomem *reloc_page;
@@ -330,7 +331,7 @@ relocate_entry_gtt(struct drm_i915_gem_object *obj,/* Map the page containing the relocation we're going to perform. */ offset =i915_gem_obj_ggtt_offset (obj); offset += reloc->offset; - reloc_page =io_mapping_map_atomic_wc (dev_priv->ggtt.mappable, + reloc_page =io_mapping_map_atomic_wc (ggtt->mappable, offset &PAGE_MASK );iowrite32 (lower_32_bits (delta), reloc_page +offset_in_page (offset));
@@ -340,7 +341,7 @@ relocate_entry_gtt(struct drm_i915_gem_object *obj,if (offset_in_page (offset) ==0 ) {io_mapping_unmap_atomic (reloc_page); reloc_page = -io_mapping_map_atomic_wc (dev_priv->ggtt.mappable, +io_mapping_map_atomic_wc (ggtt->mappable, offset); }
@@ -1431,7 +1432,8 @@ i915_gem_do_execbuffer(struct drm_device *dev, void *data,struct drm_i915_gem_execbuffer2 *args, struct drm_i915_gem_exec_object2 *exec) { - struct drm_i915_private *dev_priv = dev->dev_private; + struct drm_i915_private *dev_priv = to_i915(dev); +struct i915_ggtt *ggtt = &dev_priv->ggtt;struct drm_i915_gem_request *req =NULL ;struct eb_vmas *eb;struct drm_i915_gem_object *batch_obj;
@@ -1504,7 +1506,7 @@ i915_gem_do_execbuffer(struct drm_device *dev, void *data,if (ctx->ppgtt) vm = &ctx->ppgtt->base;else - vm = &dev_priv->ggtt.base; + vm = &ggtt->base;memset (¶ms_master,0x00 ,sizeof (params_master));
drivers/gpu/drm/i915/i915_gem_gtt.c +89 -81
460 lines not on this page · raw message
drivers/gpu/drm/i915/i915_gem_gtt.h +1 -1
@@ -42,7 +42,7 @@ typedef uint64_t gen8_pde_t;typedef uint64_t gen8_ppgtt_pdpe_t ;typedef uint64_t gen8_ppgtt_pml4e_t ; -#define gtt_total_entries (gtt) ((gtt).base.total >> PAGE_SHIFT) +#define ggtt_total_entries (ggtt) ((ggtt)->base.total >> PAGE_SHIFT)/* gen6-hsw has bit 11-4 for physical addr bit 39-32 */ #define GEN6_GTT_ADDR_ENCODE (addr) ((addr) | (((addr) >> 28) & 0xff0))
drivers/gpu/drm/i915/i915_gem_stolen.c +52 -46
261 lines not on this page · raw message
drivers/gpu/drm/i915/i915_gpu_error.c +7 -5
@@ -627,6 +627,7 @@ i915_error_object_create(struct drm_i915_private *dev_priv,struct drm_i915_gem_object *src, struct i915_address_space *vm) { + struct i915_ggtt *ggtt = &dev_priv->ggtt;struct drm_i915_error_object *dst;struct i915_vma *vma =NULL ;int num_pages;
@@ -653,7 +654,7 @@ i915_error_object_create(struct drm_i915_private *dev_priv, vma =i915_gem_obj_to_ggtt (src); use_ggtt = (src->cache_level ==I915_CACHE_NONE && vma && (vma->bound &GLOBAL_BIND ) && - reloc_offset + num_pages *PAGE_SIZE <= dev_priv->ggtt.mappable_end); + reloc_offset + num_pages *PAGE_SIZE <= ggtt->mappable_end);/* Cannot access stolen address directly, try to use the aperture */ if (src->stolen) {
@@ -663,7 +664,7 @@ i915_error_object_create(struct drm_i915_private *dev_priv, goto unwind; reloc_offset =i915_gem_obj_ggtt_offset (src); -if (reloc_offset + num_pages *PAGE_SIZE > dev_priv->ggtt.mappable_end) +if (reloc_offset + num_pages *PAGE_SIZE > ggtt->mappable_end) goto unwind; }
@@ -689,7 +690,7 @@ i915_error_object_create(struct drm_i915_private *dev_priv,* captures what the GPU read. */ - s =io_mapping_map_atomic_wc (dev_priv->ggtt.mappable, + s =io_mapping_map_atomic_wc (ggtt->mappable, reloc_offset);memcpy_fromio (d, s,PAGE_SIZE );io_mapping_unmap_atomic (s);
@@ -1015,7 +1016,8 @@ static void i915_gem_record_active_context(struct intel_engine_cs *engine,static void i915_gem_record_rings (struct drm_device *dev,struct drm_i915_error_state *error) { -struct drm_i915_private *dev_priv = dev->dev_private; +struct drm_i915_private *dev_priv =to_i915 (dev); +struct i915_ggtt *ggtt = &dev_priv->ggtt;struct drm_i915_gem_request *request;int i, count;
@@ -1038,7 +1040,7 @@ static void i915_gem_record_rings(struct drm_device *dev, vm = request->ctx && request->ctx->ppgtt ? &request->ctx->ppgtt->base : - &dev_priv->ggtt.base; + &ggtt->base;/* We need to copy these to an anonymous buffer * as the simplest method to avoid being overwritten
drivers/gpu/drm/i915/i915_vgpu.c +18 -18
@@ -181,8 +181,8 @@ static int vgt_balloon_space(struct drm_mm *mm,int intel_vgt_balloon (struct drm_device *dev) {struct drm_i915_private *dev_priv =to_i915 (dev); -struct i915_address_space *ggtt_vm = &dev_priv->ggtt.base; -unsigned long ggtt_vm_end = ggtt_vm->start + ggtt_vm->total; +struct i915_ggtt *ggtt = &dev_priv->ggtt; +unsigned long ggtt_end = ggtt->base.start + ggtt->base.total;unsigned long mappable_base, mappable_size, mappable_end;unsigned long unmappable_base, unmappable_size, unmappable_end;
@@ -202,19 +202,19 @@ int intel_vgt_balloon(struct drm_device *dev)DRM_INFO ("Unmappable graphic memory: base 0x%lx size %ldKiB\n" , unmappable_base, unmappable_size /1024 ); -if (mappable_base < ggtt_vm->start || - mappable_end > dev_priv->ggtt.mappable_end || - unmappable_base < dev_priv->ggtt.mappable_end || - unmappable_end > ggtt_vm_end) { +if (mappable_base < ggtt->base.start || + mappable_end > ggtt->mappable_end || + unmappable_base < ggtt->mappable_end || + unmappable_end > ggtt_end) {DRM_ERROR ("Invalid ballooning configuration!\n" );return -EINVAL ; }/* Unmappable graphic memory ballooning */ -if (unmappable_base > dev_priv->ggtt.mappable_end) { - ret =vgt_balloon_space (&ggtt_vm->mm, +if (unmappable_base > ggtt->mappable_end) { + ret =vgt_balloon_space (&ggtt->base.mm, &bl_info.space[2 ], - dev_priv->ggtt.mappable_end, + ggtt->mappable_end, unmappable_base);if (ret)
@@ -225,30 +225,30 @@ int intel_vgt_balloon(struct drm_device *dev)* No need to partition out the last physical page, * because it is reserved to the guard page. */ -if (unmappable_end < ggtt_vm_end -PAGE_SIZE ) { - ret =vgt_balloon_space (&ggtt_vm->mm, +if (unmappable_end < ggtt_end -PAGE_SIZE ) { + ret =vgt_balloon_space (&ggtt->base.mm, &bl_info.space[3 ], unmappable_end, - ggtt_vm_end -PAGE_SIZE ); + ggtt_end -PAGE_SIZE );if (ret) goto err; }/* Mappable graphic memory ballooning */ -if (mappable_base > ggtt_vm->start) { - ret =vgt_balloon_space (&ggtt_vm->mm, +if (mappable_base > ggtt->base.start) { + ret =vgt_balloon_space (&ggtt->base.mm, &bl_info.space[0 ], - ggtt_vm->start, mappable_base); + ggtt->base.start, mappable_base);if (ret) goto err; } -if (mappable_end < dev_priv->ggtt.mappable_end) { - ret =vgt_balloon_space (&ggtt_vm->mm, +if (mappable_end < ggtt->mappable_end) { + ret =vgt_balloon_space (&ggtt->base.mm, &bl_info.space[1 ], mappable_end, - dev_priv->ggtt.mappable_end); + ggtt->mappable_end);if (ret) goto err;
drivers/gpu/drm/i915/intel_display.c +5 -3
@@ -2444,6 +2444,7 @@ intel_alloc_initial_plane_obj(struct intel_crtc *crtc, {struct drm_device *dev = crtc->base.dev;struct drm_i915_private *dev_priv =to_i915 (dev); +struct i915_ggtt *ggtt = &dev_priv->ggtt;struct drm_i915_gem_object *obj =NULL ;struct drm_mode_fb_cmd2 mode_cmd = {0 };struct drm_framebuffer *fb = &plane_config->fb->base;
@@ -2459,7 +2460,7 @@ intel_alloc_initial_plane_obj(struct intel_crtc *crtc,/* If the FB is too big, just don't use it since fbdev is not very * important and we should probably use that space with FBC or other * features. */ -if (size_aligned *2 > dev_priv->ggtt.stolen_usable_size) +if (size_aligned *2 > ggtt->stolen_usable_size)return false;mutex_lock (&dev->struct_mutex);
@@ -15298,7 +15299,8 @@ fail:void intel_modeset_init (struct drm_device *dev) { -struct drm_i915_private *dev_priv = dev->dev_private; +struct drm_i915_private *dev_priv =to_i915 (dev); +struct i915_ggtt *ggtt = &dev_priv->ggtt;int sprite, ret;enum pipe pipe;struct intel_crtc *crtc;
@@ -15362,7 +15364,7 @@ void intel_modeset_init(struct drm_device *dev) dev->mode_config.cursor_height =MAX_CURSOR_HEIGHT ; } - dev->mode_config.fb_base = dev_priv->ggtt.mappable_base; + dev->mode_config.fb_base = ggtt->mappable_base; DRM_DEBUG_KMS("%d display pipe%s available.\n", INTEL_INFO(dev)->num_pipes,
drivers/gpu/drm/i915/intel_fbc.c +3 -2
@@ -506,6 +506,7 @@ static int find_compression_threshold(struct drm_i915_private *dev_priv, int size, int fb_cpp) { +struct i915_ggtt *ggtt = &dev_priv->ggtt;int compression_threshold =1 ;int ret;u64 end;
@@ -516,9 +517,9 @@ static int find_compression_threshold(struct drm_i915_private *dev_priv,* underruns, even if that range is not reserved by the BIOS. */ if (IS_BROADWELL (dev_priv) ||IS_SKYLAKE (dev_priv) ||IS_KABYLAKE (dev_priv)) - end = dev_priv->ggtt.stolen_size -8 *1024 *1024 ; + end = ggtt->stolen_size -8 *1024 *1024 ;else - end = dev_priv->ggtt.stolen_usable_size; + end = ggtt->stolen_usable_size;/* HACK: This code depends on what we will do in *_enable_fbc. If that * code changes, this code needs to change as well.
drivers/gpu/drm/i915/intel_fbdev.c +6 -4
@@ -122,6 +122,7 @@ static int intelfb_alloc(struct drm_fb_helper *helper,struct drm_framebuffer *fb;struct drm_device *dev = helper->dev;struct drm_i915_private *dev_priv =to_i915 (dev); +struct i915_ggtt *ggtt = &dev_priv->ggtt;struct drm_mode_fb_cmd2 mode_cmd = {};struct drm_i915_gem_object *obj =NULL ;int size, ret;
@@ -146,7 +147,7 @@ static int intelfb_alloc(struct drm_fb_helper *helper,/* If the FB is too big, just don't use it since fbdev is not very * important and we should probably use that space with FBC or other * features. */ -if (size *2 < dev_priv->ggtt.stolen_usable_size) +if (size *2 < ggtt->stolen_usable_size) obj =i915_gem_object_create_stolen (dev, size);if (obj ==NULL ) obj =i915_gem_alloc_object (dev, size);
@@ -181,7 +182,8 @@ static int intelfb_create(struct drm_fb_helper *helper, container_of(helper, struct intel_fbdev, helper);struct intel_framebuffer *intel_fb = ifbdev->fb;struct drm_device *dev = helper->dev; -struct drm_i915_private *dev_priv = dev->dev_private; +struct drm_i915_private *dev_priv =to_i915 (dev); +struct i915_ggtt *ggtt = &dev_priv->ggtt;struct fb_info *info;struct drm_framebuffer *fb;struct drm_i915_gem_object *obj;
@@ -244,13 +246,13 @@ static int intelfb_create(struct drm_fb_helper *helper,/* setup aperture base/size for vesafb takeover */ info->apertures->ranges[0 ].base = dev->mode_config.fb_base; - info->apertures->ranges[0 ].size = dev_priv->ggtt.mappable_end; + info->apertures->ranges[0 ].size = ggtt->mappable_end; info->fix.smem_start = dev->mode_config.fb_base +i915_gem_obj_ggtt_offset (obj); info->fix.smem_len = size; info->screen_base = -ioremap_wc (dev_priv->ggtt.mappable_base +i915_gem_obj_ggtt_offset (obj), +ioremap_wc (ggtt->mappable_base +i915_gem_obj_ggtt_offset (obj), size);if (!info->screen_base) {DRM_ERROR ("Failed to remap framebuffer into virtual memory\n" );
drivers/gpu/drm/i915/intel_overlay.c +6 -4
@@ -190,13 +190,14 @@ struct intel_overlay {static struct overlay_registers __iomem *intel_overlay_map_regs (struct intel_overlay *overlay) { -struct drm_i915_private *dev_priv = overlay->dev->dev_private; +struct drm_i915_private *dev_priv =to_i915 (overlay->dev); +struct i915_ggtt *ggtt = &dev_priv->ggtt;struct overlay_registers __iomem *regs;if (OVERLAY_NEEDS_PHYSICAL (overlay->dev)) regs = (struct overlay_registers __iomem *)overlay->reg_bo->phys_handle->vaddr;else - regs =io_mapping_map_wc (dev_priv->ggtt.mappable, + regs =io_mapping_map_wc (ggtt->mappable,i915_gem_obj_ggtt_offset (overlay->reg_bo));return regs;
@@ -1481,7 +1482,8 @@ struct intel_overlay_error_state {static struct overlay_registers __iomem *intel_overlay_map_regs_atomic (struct intel_overlay *overlay) { -struct drm_i915_private *dev_priv = overlay->dev->dev_private; +struct drm_i915_private *dev_priv =to_i915 (overlay->dev); +struct i915_ggtt *ggtt = &dev_priv->ggtt;struct overlay_registers __iomem *regs;if (OVERLAY_NEEDS_PHYSICAL (overlay->dev))
@@ -1490,7 +1492,7 @@ intel_overlay_map_regs_atomic(struct intel_overlay *overlay) regs = (struct overlay_registers __iomem *) overlay->reg_bo->phys_handle->vaddr; else - regs =io_mapping_map_atomic_wc (dev_priv->ggtt.mappable, + regs =io_mapping_map_atomic_wc (ggtt->mappable,i915_gem_obj_ggtt_offset (overlay->reg_bo));return regs;
drivers/gpu/drm/i915/intel_pm.c +7 -6
@@ -4630,7 +4630,8 @@ static void intel_print_rc6_info(struct drm_device *dev, u32 mode)static bool bxt_check_bios_rc6_setup (const struct drm_device *dev) { -struct drm_i915_private *dev_priv = dev->dev_private; +struct drm_i915_private *dev_priv =to_i915 (dev); +struct i915_ggtt *ggtt = &dev_priv->ggtt;bool enable_rc6 = true;unsigned long rc6_ctx_base;
@@ -4644,9 +4645,9 @@ static bool bxt_check_bios_rc6_setup(const struct drm_device *dev)* for this check. */ rc6_ctx_base =I915_READ (RC6_CTX_BASE ) &RC6_CTX_BASE_MASK ; -if (!((rc6_ctx_base >= dev_priv->ggtt.stolen_reserved_base) && - (rc6_ctx_base +PAGE_SIZE <= dev_priv->ggtt.stolen_reserved_base + - dev_priv->ggtt.stolen_reserved_size))) { +if (!((rc6_ctx_base >= ggtt->stolen_reserved_base) && + (rc6_ctx_base +PAGE_SIZE <= ggtt->stolen_reserved_base + + ggtt->stolen_reserved_size))) {DRM_DEBUG_KMS ("RC6 Base address not as expected.\n" ); enable_rc6 = false; }
@@ -5287,9 +5288,9 @@ static void cherryview_check_pctx(struct drm_i915_private *dev_priv)static void cherryview_setup_pctx (struct drm_device *dev) { -struct drm_i915_private *dev_priv = dev->dev_private; -unsigned long pctx_paddr, paddr; +struct drm_i915_private *dev_priv =to_i915 (dev);struct i915_ggtt *ggtt = &dev_priv->ggtt; +unsigned long pctx_paddr, paddr;u32 pcbr;int pctx_size =32 *1024 ;
drivers/gpu/drm/i915/intel_ringbuffer.c +2 -1
@@ -2111,6 +2111,7 @@ int intel_pin_and_map_ringbuffer_obj(struct drm_device *dev, struct intel_ringbuffer *ringbuf) {struct drm_i915_private *dev_priv =to_i915 (dev); +struct i915_ggtt *ggtt = &dev_priv->ggtt;struct drm_i915_gem_object *obj = ringbuf->obj;int ret;
@@ -2144,7 +2145,7 @@ int intel_pin_and_map_ringbuffer_obj(struct drm_device *dev,/* Access through the GTT requires the device to be awake. */ assert_rpm_wakelock_held (dev_priv); - ringbuf->virtual_start =ioremap_wc (dev_priv->ggtt.mappable_base + + ringbuf->virtual_start =ioremap_wc (ggtt->mappable_base +i915_gem_obj_ggtt_offset (obj), ringbuf->size);if (ringbuf->virtual_start ==NULL ) {i915_gem_object_ggtt_unpin (obj);
Signature · 6 lines
2.5.5 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH v4] drm/i915: Refer to GGTT {, VM} consistently
Quoted 15 lines · Joonas Lahtinen
Refer to the GGTT VM consistently as "
ggtt->base" instead of just "ggtt", "vm" or indirectly through other variables like "dev_priv->ggtt.base" to avoid confusion with thei915_ggttobject itself and PPGTT VMs.Refer to the GGTT as "ggtt" instead of indirectly through chaining.
As a bonus gets rid of the long-standing
i915_obj_to_ggttvs.i915_gem_obj_to_ggttconflict, due to removal ofi915_obj_to_ggtt!v2:
- Added some more after grepping sources with Chrisv3:
- Refer to GGTT VM throughggtt->baseconsistently instead ofggtt_vm(Chris)
Quoted 7 lines
v4:
- Convert alldev_priv->ggtt->fooaccesses toggtt->foo.Cc Tvrtko Ursulin <[email protected]>Cc Mika Kuoppala <[email protected]>Cc Chris Wilson <[email protected]>Signed-off-by Joonas Lahtinen <[email protected]>
It pains me to see changes to code I've deleted, but nevertheless the consistency looks good.
-Chris
Signature · 5 lines
Chris Wilson, Intel Open Source Technology Centre _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✗ Fi.CI.BAT: warning for series starting with [1/2] drm/i915: Rename GGTT init functions
In reply to Joonas Lahtinen== Series Details ==
== Series Details ==
Series: series starting with [1/2] drm/i915: Rename GGTT init functions
URL : https://patchwork.freedesktop.org/series/4790/
State : warning
== Summary ==
Series 4790v1 Series without cover letter
http://patchwork.freedesktop.org/api/1.0/series/4790/revisions/1/mbox/
Test pm_rpm:
Subgroup basic-pci-d3-state:
pass -> DMESG-WARN (bsw-nuc-2)
Subgroup basic-rte:
dmesg-warn -> PASS (bsw-nuc-2)bdw-nuci7 total:192 pass:180 dwarn:0 dfail:0 fail:0 skip:12 bdw-ultra total:192 pass:171 dwarn:0 dfail:0 fail:0 skip:21 bsw-nuc-2 total:192 pass:154 dwarn:1 dfail:0 fail:0 skip:37 byt-nuc total:192 pass:156 dwarn:1 dfail:0 fail:0 skip:35 hsw-brixbox total:192 pass:170 dwarn:0 dfail:0 fail:0 skip:22 hsw-gt2 total:192 pass:175 dwarn:0 dfail:0 fail:0 skip:17 ilk-hp8440p total:192 pass:129 dwarn:0 dfail:0 fail:0 skip:63 ivb-t430s total:192 pass:167 dwarn:0 dfail:0 fail:0 skip:25 skl-i7k-2 total:192 pass:169 dwarn:0 dfail:0 fail:0 skip:23 skl-nuci5 total:192 pass:181 dwarn:0 dfail:0 fail:0 skip:11 snb-dellxps total:192 pass:158 dwarn:0 dfail:0 fail:0 skip:34 snb-x220t total:192 pass:158 dwarn:0 dfail:0 fail:1 skip:33
Results at /archive/results/CI_IGT_test/Patchwork_1686/
6f788978796a35996bea8795db70f9c4194b70a2 drm-intel-nightly: 2016y-03m-23d-12h-24m-24s UTC integration manifest 0176f29b5f03e5d118e6ab54f8e4a9c2c7e2b29b drm/i915: Refer to GGTT VM consistently 44b1748e65d11fba34dee96d9cb2c0a8403b9dbb drm/i915: Rename GGTT init functions
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✗ Fi.CI.BAT: failure for series starting with [1/2] drm/i915: Rename GGTT init functions (rev2)
In reply to Joonas Lahtinen== Series Details ==
== Series Details ==
Series: series starting with [1/2] drm/i915: Rename GGTT init functions (rev2)
URL : https://patchwork.freedesktop.org/series/4790/
State : failure
== Summary ==
Series 4790v2 Series without cover letter
http://patchwork.freedesktop.org/api/1.0/series/4790/revisions/2/mbox/
Test drv_module_reload_basic:
pass -> INCOMPLETE (hsw-brixbox)
Test gem_exec_suspend:
Subgroup basic-s3:
pass -> DMESG-WARN (bsw-nuc-2)
Test kms_flip:
Subgroup basic-flip-vs-modeset:
pass -> DMESG-WARN (ilk-hp8440p) UNSTABLE
Test kms_force_connector_basic:
Subgroup force-load-detect:
pass -> SKIP (ivb-t430s)bdw-nuci7 total:192 pass:180 dwarn:0 dfail:0 fail:0 skip:12 bdw-ultra total:192 pass:171 dwarn:0 dfail:0 fail:0 skip:21 bsw-nuc-2 total:192 pass:153 dwarn:2 dfail:0 fail:0 skip:37 byt-nuc total:192 pass:156 dwarn:1 dfail:0 fail:0 skip:35 hsw-brixbox total:27 pass:22 dwarn:0 dfail:0 fail:0 skip:4 hsw-gt2 total:192 pass:175 dwarn:0 dfail:0 fail:0 skip:17 ilk-hp8440p total:192 pass:128 dwarn:1 dfail:0 fail:0 skip:63 ivb-t430s total:192 pass:166 dwarn:0 dfail:0 fail:0 skip:26 skl-i7k-2 total:192 pass:169 dwarn:0 dfail:0 fail:0 skip:23 skl-nuci5 total:192 pass:181 dwarn:0 dfail:0 fail:0 skip:11 snb-dellxps total:192 pass:158 dwarn:0 dfail:0 fail:0 skip:34 snb-x220t total:192 pass:158 dwarn:0 dfail:0 fail:1 skip:33
Results at /archive/results/CI_IGT_test/Patchwork_1687/
6f788978796a35996bea8795db70f9c4194b70a2 drm-intel-nightly: 2016y-03m-23d-12h-24m-24s UTC integration manifest acba08ac676ac7da3e5079d973304d2f49b0aa3a drm/i915: Refer to GGTT VM consistently 11b5b3ffc7cb36a1fb999304998d5bc19782d4f9 drm/i915: Rename GGTT init functions
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 8 lines · Joonas Lahtinen
[ text/plain ]
Rename and document the GGTT init functions to give a better idea of the context where they are called from.
i915_gem_gtt_init=>i915_init_ggtt_hwi915_gem_init_global_gtt=>i915_gem_init_ggtti915_global_gtt_cleanup=>i915_cleanup_ggtt_hw
Me likes. The cognitive burden is heavy enough for someone wandering around in this territory. This clears things up.
Now if we would have glossary.txt...
Thanks,
-Mika
Quoted 145 lines
Cc Tvrtko Ursulin <[email protected]>Cc Mika Kuoppala <[email protected]>Acked-by Chris Wilson <[email protected]>Signed-off-by Joonas Lahtinen <[email protected]>--- drivers/gpu/drm/i915/i915_dma.c | 14 +++++++------- drivers/gpu/drm/i915/i915_gem.c | 2 +- drivers/gpu/drm/i915/i915_gem_gtt.c | 18 +++++++++++++++--- drivers/gpu/drm/i915/i915_gem_gtt.h | 7 +++---- 4 files changed, 26 insertions(+), 15 deletions(-)drivers/gpu/drm/i915/i915_dma.c +7
-7@@ -1180,7 +1180,7 @@ static int i915_driver_init_hw(struct drm_i915_private *dev_priv)intel_device_info_runtime_init (dev); - ret =i915_gem_gtt_init (dev); + ret =i915_init_ggtt_hw (dev);if (ret)return ret;@@ -1189,13 +1189,13 @@ static int i915_driver_init_hw(struct drm_i915_private *dev_priv) ret =i915_kick_out_firmware_fb (dev_priv);if (ret) {DRM_ERROR ("failed to remove conflicting framebuffer drivers\n" ); - goto out_gtt; + goto out_ggtt; } ret =i915_kick_out_vgacon (dev_priv);if (ret) {DRM_ERROR ("failed to remove conflicting VGA console\n" ); - goto out_gtt; + goto out_ggtt; }pci_set_master (dev->pdev);@@ -1222,7 +1222,7 @@ static int i915_driver_init_hw(struct drm_i915_private *dev_priv) aperture_size);if (dev_priv->ggtt.mappable ==NULL ) { ret = -EIO ; - goto out_gtt; + goto out_ggtt; } dev_priv->ggtt.mtrr = arch_phys_wc_add(dev_priv->ggtt.mappable_base,@@ -1255,8 +1255,8 @@ static int i915_driver_init_hw(struct drm_i915_private *dev_priv)return 0 ; -out_gtt: -i915_global_gtt_cleanup (dev); +out_ggtt: +i915_cleanup_ggtt_hw (dev);return ret; }@@ -1275,7 +1275,7 @@ static void i915_driver_cleanup_hw(struct drm_i915_private *dev_priv)pm_qos_remove_request (&dev_priv->pm_qos);arch_phys_wc_del (dev_priv->ggtt.mtrr);io_mapping_free (dev_priv->ggtt.mappable); -i915_global_gtt_cleanup (dev); +i915_cleanup_ggtt_hw (dev); }/** drivers/gpu/drm/i915/i915_gem.c +1
-1@@ -4972,7 +4972,7 @@ int i915_gem_init(struct drm_device *dev)if (ret) goto out_unlock; -i915_gem_init_global_gtt (dev); +i915_gem_init_ggtt (dev); ret =i915_gem_context_init (dev);if (ret)drivers/gpu/drm/i915/i915_gem_gtt.c +15
-3@@ -2808,7 +2808,11 @@ static int i915_gem_setup_global_gtt(struct drm_device *dev,return 0 ; } -void i915_gem_init_global_gtt (struct drm_device *dev) +/** +* i915_gem_init_ggtt - Initialize GEM for Global GTT +* @dev: DRM device +*/ +void i915_gem_init_ggtt (struct drm_device *dev) {struct drm_i915_private *dev_priv = dev->dev_private;u64 gtt_size, mappable_size;@@ -2819,7 +2823,11 @@ void i915_gem_init_global_gtt(struct drm_device *dev)i915_gem_setup_global_gtt (dev,0 , mappable_size, gtt_size); } -void i915_global_gtt_cleanup (struct drm_device *dev) +/** +* i915_cleanup_ggtt_hw - Clean up GGTT hardware initialization +* @dev: DRM device +*/ +void i915_cleanup_ggtt_hw (struct drm_device *dev) {struct drm_i915_private *dev_priv = dev->dev_private;struct i915_address_space *vm = &dev_priv->ggtt.base;@@ -3157,7 +3165,11 @@ static void i915_gmch_remove(struct i915_address_space *vm)intel_gmch_remove (); } -int i915_gem_gtt_init (struct drm_device *dev) +/** +* i915_init_ggtt_hw - Initialize GGTT hardware +* @dev: DRM device +*/ +int i915_init_ggtt_hw (struct drm_device *dev) {struct drm_i915_private *dev_priv = dev->dev_private;struct i915_ggtt *ggtt = &dev_priv->ggtt;drivers/gpu/drm/i915/i915_gem_gtt.h +3
-4@@ -513,10 +513,9 @@ i915_page_dir_dma_addr(const struct i915_hw_ppgtt *ppgtt, const unsigned n)px_dma (ppgtt->base.scratch_pd); } -int i915_gem_gtt_init (struct drm_device *dev); -void i915_gem_init_global_gtt (struct drm_device *dev); -void i915_global_gtt_cleanup (struct drm_device *dev); - +int i915_init_ggtt_hw (struct drm_device *dev); +void i915_gem_init_ggtt (struct drm_device *dev); +void i915_cleanup_ggtt_hw (struct drm_device *dev);int i915_ppgtt_init (struct drm_device *dev,struct i915_hw_ppgtt *ppgtt);int i915_ppgtt_init_hw (struct drm_device *dev);Signature · 1 line
2.5.5
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 4 lines · Joonas Lahtinen
Rename and document the GGTT init functions to give a better idea of the context where they are called from.
i915_gem_gtt_init=>i915_init_ggtt_hw
Seems to me i915_ggtt_init_hw would match existing practices better.
Quoted 153 lines
i915_gem_init_global_gtt=>i915_gem_init_ggtti915_global_gtt_cleanup=>i915_cleanup_ggtt_hwCc Tvrtko Ursulin <[email protected]>Cc Mika Kuoppala <[email protected]>Acked-by Chris Wilson <[email protected]>Signed-off-by Joonas Lahtinen <[email protected]>--- drivers/gpu/drm/i915/i915_dma.c | 14 +++++++------- drivers/gpu/drm/i915/i915_gem.c | 2 +- drivers/gpu/drm/i915/i915_gem_gtt.c | 18 +++++++++++++++--- drivers/gpu/drm/i915/i915_gem_gtt.h | 7 +++---- 4 files changed, 26 insertions(+), 15 deletions(-)drivers/gpu/drm/i915/i915_dma.c +7
-7@@ -1180,7 +1180,7 @@ static int i915_driver_init_hw(struct drm_i915_private *dev_priv)intel_device_info_runtime_init (dev); - ret =i915_gem_gtt_init (dev); + ret =i915_init_ggtt_hw (dev);if (ret)return ret;@@ -1189,13 +1189,13 @@ static int i915_driver_init_hw(struct drm_i915_private *dev_priv) ret =i915_kick_out_firmware_fb (dev_priv);if (ret) {DRM_ERROR ("failed to remove conflicting framebuffer drivers\n" ); - goto out_gtt; + goto out_ggtt; } ret =i915_kick_out_vgacon (dev_priv);if (ret) {DRM_ERROR ("failed to remove conflicting VGA console\n" ); - goto out_gtt; + goto out_ggtt; }pci_set_master (dev->pdev);@@ -1222,7 +1222,7 @@ static int i915_driver_init_hw(struct drm_i915_private *dev_priv) aperture_size);if (dev_priv->ggtt.mappable ==NULL ) { ret = -EIO ; - goto out_gtt; + goto out_ggtt; } dev_priv->ggtt.mtrr = arch_phys_wc_add(dev_priv->ggtt.mappable_base,@@ -1255,8 +1255,8 @@ static int i915_driver_init_hw(struct drm_i915_private *dev_priv)return 0 ; -out_gtt: -i915_global_gtt_cleanup (dev); +out_ggtt: +i915_cleanup_ggtt_hw (dev);return ret; }@@ -1275,7 +1275,7 @@ static void i915_driver_cleanup_hw(struct drm_i915_private *dev_priv)pm_qos_remove_request (&dev_priv->pm_qos);arch_phys_wc_del (dev_priv->ggtt.mtrr);io_mapping_free (dev_priv->ggtt.mappable); -i915_global_gtt_cleanup (dev); +i915_cleanup_ggtt_hw (dev); }/** drivers/gpu/drm/i915/i915_gem.c +1
-1@@ -4972,7 +4972,7 @@ int i915_gem_init(struct drm_device *dev)if (ret) goto out_unlock; -i915_gem_init_global_gtt (dev); +i915_gem_init_ggtt (dev); ret =i915_gem_context_init (dev);if (ret)drivers/gpu/drm/i915/i915_gem_gtt.c +15
-3@@ -2808,7 +2808,11 @@ static int i915_gem_setup_global_gtt(struct drm_device *dev,return 0 ; } -void i915_gem_init_global_gtt (struct drm_device *dev) +/** +* i915_gem_init_ggtt - Initialize GEM for Global GTT +* @dev: DRM device +*/ +void i915_gem_init_ggtt (struct drm_device *dev) {struct drm_i915_private *dev_priv = dev->dev_private;u64 gtt_size, mappable_size;@@ -2819,7 +2823,11 @@ void i915_gem_init_global_gtt(struct drm_device *dev)i915_gem_setup_global_gtt (dev,0 , mappable_size, gtt_size); } -void i915_global_gtt_cleanup (struct drm_device *dev) +/** +* i915_cleanup_ggtt_hw - Clean up GGTT hardware initialization +* @dev: DRM device +*/ +void i915_cleanup_ggtt_hw (struct drm_device *dev) {struct drm_i915_private *dev_priv = dev->dev_private;struct i915_address_space *vm = &dev_priv->ggtt.base;@@ -3157,7 +3165,11 @@ static void i915_gmch_remove(struct i915_address_space *vm)intel_gmch_remove (); } -int i915_gem_gtt_init (struct drm_device *dev) +/** +* i915_init_ggtt_hw - Initialize GGTT hardware +* @dev: DRM device +*/ +int i915_init_ggtt_hw (struct drm_device *dev) {struct drm_i915_private *dev_priv = dev->dev_private;struct i915_ggtt *ggtt = &dev_priv->ggtt;drivers/gpu/drm/i915/i915_gem_gtt.h +3
-4@@ -513,10 +513,9 @@ i915_page_dir_dma_addr(const struct i915_hw_ppgtt *ppgtt, const unsigned n)px_dma (ppgtt->base.scratch_pd); } -int i915_gem_gtt_init (struct drm_device *dev); -void i915_gem_init_global_gtt (struct drm_device *dev); -void i915_global_gtt_cleanup (struct drm_device *dev); - +int i915_init_ggtt_hw (struct drm_device *dev); +void i915_gem_init_ggtt (struct drm_device *dev); +void i915_cleanup_ggtt_hw (struct drm_device *dev);int i915_ppgtt_init (struct drm_device *dev,struct i915_hw_ppgtt *ppgtt);int i915_ppgtt_init_hw (struct drm_device *dev);Signature · 6 lines
2.5.5 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 6 lines
Ville Syrjälä Intel OTC _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 9 lines · Ville Syrjälä
[ text/plain ]
Quoted 4 lines · Joonas Lahtinen
Rename and document the GGTT init functions to give a better idea of the context where they are called from.
i915_gem_gtt_init=>i915_init_ggtt_hwSeems to me
i915_ggtt_init_hwwould match existing practices better.
There is also some gravity towards putting the verb first. In gem side atleast.
-Mika
Quoted 149 lines
Quoted 149 lines
i915_gem_init_global_gtt=>i915_gem_init_ggtti915_global_gtt_cleanup=>i915_cleanup_ggtt_hwCc Tvrtko Ursulin <[email protected]>Cc Mika Kuoppala <[email protected]>Acked-by Chris Wilson <[email protected]>Signed-off-by Joonas Lahtinen <[email protected]>--- drivers/gpu/drm/i915/i915_dma.c | 14 +++++++------- drivers/gpu/drm/i915/i915_gem.c | 2 +- drivers/gpu/drm/i915/i915_gem_gtt.c | 18 +++++++++++++++--- drivers/gpu/drm/i915/i915_gem_gtt.h | 7 +++---- 4 files changed, 26 insertions(+), 15 deletions(-)drivers/gpu/drm/i915/i915_dma.c +7
-7@@ -1180,7 +1180,7 @@ static int i915_driver_init_hw(struct drm_i915_private *dev_priv)intel_device_info_runtime_init (dev); - ret =i915_gem_gtt_init (dev); + ret =i915_init_ggtt_hw (dev);if (ret)return ret;@@ -1189,13 +1189,13 @@ static int i915_driver_init_hw(struct drm_i915_private *dev_priv) ret =i915_kick_out_firmware_fb (dev_priv);if (ret) {DRM_ERROR ("failed to remove conflicting framebuffer drivers\n" ); - goto out_gtt; + goto out_ggtt; } ret =i915_kick_out_vgacon (dev_priv);if (ret) {DRM_ERROR ("failed to remove conflicting VGA console\n" ); - goto out_gtt; + goto out_ggtt; }pci_set_master (dev->pdev);@@ -1222,7 +1222,7 @@ static int i915_driver_init_hw(struct drm_i915_private *dev_priv) aperture_size);if (dev_priv->ggtt.mappable ==NULL ) { ret = -EIO ; - goto out_gtt; + goto out_ggtt; } dev_priv->ggtt.mtrr = arch_phys_wc_add(dev_priv->ggtt.mappable_base,@@ -1255,8 +1255,8 @@ static int i915_driver_init_hw(struct drm_i915_private *dev_priv)return 0 ; -out_gtt: -i915_global_gtt_cleanup (dev); +out_ggtt: +i915_cleanup_ggtt_hw (dev);return ret; }@@ -1275,7 +1275,7 @@ static void i915_driver_cleanup_hw(struct drm_i915_private *dev_priv)pm_qos_remove_request (&dev_priv->pm_qos);arch_phys_wc_del (dev_priv->ggtt.mtrr);io_mapping_free (dev_priv->ggtt.mappable); -i915_global_gtt_cleanup (dev); +i915_cleanup_ggtt_hw (dev); }/** drivers/gpu/drm/i915/i915_gem.c +1
-1@@ -4972,7 +4972,7 @@ int i915_gem_init(struct drm_device *dev)if (ret) goto out_unlock; -i915_gem_init_global_gtt (dev); +i915_gem_init_ggtt (dev); ret =i915_gem_context_init (dev);if (ret)drivers/gpu/drm/i915/i915_gem_gtt.c +15
-3@@ -2808,7 +2808,11 @@ static int i915_gem_setup_global_gtt(struct drm_device *dev,return 0 ; } -void i915_gem_init_global_gtt (struct drm_device *dev) +/** +* i915_gem_init_ggtt - Initialize GEM for Global GTT +* @dev: DRM device +*/ +void i915_gem_init_ggtt (struct drm_device *dev) {struct drm_i915_private *dev_priv = dev->dev_private;u64 gtt_size, mappable_size;@@ -2819,7 +2823,11 @@ void i915_gem_init_global_gtt(struct drm_device *dev)i915_gem_setup_global_gtt (dev,0 , mappable_size, gtt_size); } -void i915_global_gtt_cleanup (struct drm_device *dev) +/** +* i915_cleanup_ggtt_hw - Clean up GGTT hardware initialization +* @dev: DRM device +*/ +void i915_cleanup_ggtt_hw (struct drm_device *dev) {struct drm_i915_private *dev_priv = dev->dev_private;struct i915_address_space *vm = &dev_priv->ggtt.base;@@ -3157,7 +3165,11 @@ static void i915_gmch_remove(struct i915_address_space *vm)intel_gmch_remove (); } -int i915_gem_gtt_init (struct drm_device *dev) +/** +* i915_init_ggtt_hw - Initialize GGTT hardware +* @dev: DRM device +*/ +int i915_init_ggtt_hw (struct drm_device *dev) {struct drm_i915_private *dev_priv = dev->dev_private;struct i915_ggtt *ggtt = &dev_priv->ggtt;drivers/gpu/drm/i915/i915_gem_gtt.h +3
-4@@ -513,10 +513,9 @@ i915_page_dir_dma_addr(const struct i915_hw_ppgtt *ppgtt, const unsigned n)px_dma (ppgtt->base.scratch_pd); } -int i915_gem_gtt_init (struct drm_device *dev); -void i915_gem_init_global_gtt (struct drm_device *dev); -void i915_global_gtt_cleanup (struct drm_device *dev); - +int i915_init_ggtt_hw (struct drm_device *dev); +void i915_gem_init_ggtt (struct drm_device *dev); +void i915_cleanup_ggtt_hw (struct drm_device *dev);int i915_ppgtt_init (struct drm_device *dev,struct i915_hw_ppgtt *ppgtt);int i915_ppgtt_init_hw (struct drm_device *dev);Signature · 1 line
2.5.5
Quoted 12 lines
Quoted 4 lines
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfxSignature · 6 lines
Ville Syrjälä Intel OTC _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 7 lines · Mika Kuoppala
Quoted 5 lines · Ville Syrjälä
[ text/plain ]
Quoted 3 lines · Joonas Lahtinen
Rename and document the GGTT init functions to give a better idea of the context where they are called from.
Quoted 7 lines
Quoted 4 lines
Quoted 1 line
i915_gem_gtt_init=>i915_init_ggtt_hwSeems to me
i915_ggtt_init_hwwould match existing practices better.There is also some gravity towards putting the verb first. In gem side atleast.
At least in this case ggtt_init_hw would match ppgtt_init_hw, which seems like a nice thing.
Quoted 165 lines
-Mika
Quoted 161 lines
Quoted 153 lines
i915_gem_init_global_gtt=>i915_gem_init_ggtti915_global_gtt_cleanup=>i915_cleanup_ggtt_hwCc Tvrtko Ursulin <[email protected]>Cc Mika Kuoppala <[email protected]>Acked-by Chris Wilson <[email protected]>Signed-off-by Joonas Lahtinen <[email protected]>--- drivers/gpu/drm/i915/i915_dma.c | 14 +++++++------- drivers/gpu/drm/i915/i915_gem.c | 2 +- drivers/gpu/drm/i915/i915_gem_gtt.c | 18 +++++++++++++++--- drivers/gpu/drm/i915/i915_gem_gtt.h | 7 +++---- 4 files changed, 26 insertions(+), 15 deletions(-)drivers/gpu/drm/i915/i915_dma.c +7
-7@@ -1180,7 +1180,7 @@ static int i915_driver_init_hw(struct drm_i915_private *dev_priv)intel_device_info_runtime_init (dev); - ret =i915_gem_gtt_init (dev); + ret =i915_init_ggtt_hw (dev);if (ret)return ret;@@ -1189,13 +1189,13 @@ static int i915_driver_init_hw(struct drm_i915_private *dev_priv) ret =i915_kick_out_firmware_fb (dev_priv);if (ret) {DRM_ERROR ("failed to remove conflicting framebuffer drivers\n" ); - goto out_gtt; + goto out_ggtt; } ret =i915_kick_out_vgacon (dev_priv);if (ret) {DRM_ERROR ("failed to remove conflicting VGA console\n" ); - goto out_gtt; + goto out_ggtt; }pci_set_master (dev->pdev);@@ -1222,7 +1222,7 @@ static int i915_driver_init_hw(struct drm_i915_private *dev_priv) aperture_size);if (dev_priv->ggtt.mappable ==NULL ) { ret = -EIO ; - goto out_gtt; + goto out_ggtt; } dev_priv->ggtt.mtrr = arch_phys_wc_add(dev_priv->ggtt.mappable_base,@@ -1255,8 +1255,8 @@ static int i915_driver_init_hw(struct drm_i915_private *dev_priv)return 0 ; -out_gtt: -i915_global_gtt_cleanup (dev); +out_ggtt: +i915_cleanup_ggtt_hw (dev);return ret; }@@ -1275,7 +1275,7 @@ static void i915_driver_cleanup_hw(struct drm_i915_private *dev_priv)pm_qos_remove_request (&dev_priv->pm_qos);arch_phys_wc_del (dev_priv->ggtt.mtrr);io_mapping_free (dev_priv->ggtt.mappable); -i915_global_gtt_cleanup (dev); +i915_cleanup_ggtt_hw (dev); }/** drivers/gpu/drm/i915/i915_gem.c +1
-1@@ -4972,7 +4972,7 @@ int i915_gem_init(struct drm_device *dev)if (ret) goto out_unlock; -i915_gem_init_global_gtt (dev); +i915_gem_init_ggtt (dev); ret =i915_gem_context_init (dev);if (ret)drivers/gpu/drm/i915/i915_gem_gtt.c +15
-3@@ -2808,7 +2808,11 @@ static int i915_gem_setup_global_gtt(struct drm_device *dev,return 0 ; } -void i915_gem_init_global_gtt (struct drm_device *dev) +/** +* i915_gem_init_ggtt - Initialize GEM for Global GTT +* @dev: DRM device +*/ +void i915_gem_init_ggtt (struct drm_device *dev) {struct drm_i915_private *dev_priv = dev->dev_private;u64 gtt_size, mappable_size;@@ -2819,7 +2823,11 @@ void i915_gem_init_global_gtt(struct drm_device *dev)i915_gem_setup_global_gtt (dev,0 , mappable_size, gtt_size); } -void i915_global_gtt_cleanup (struct drm_device *dev) +/** +* i915_cleanup_ggtt_hw - Clean up GGTT hardware initialization +* @dev: DRM device +*/ +void i915_cleanup_ggtt_hw (struct drm_device *dev) {struct drm_i915_private *dev_priv = dev->dev_private;struct i915_address_space *vm = &dev_priv->ggtt.base;@@ -3157,7 +3165,11 @@ static void i915_gmch_remove(struct i915_address_space *vm)intel_gmch_remove (); } -int i915_gem_gtt_init (struct drm_device *dev) +/** +* i915_init_ggtt_hw - Initialize GGTT hardware +* @dev: DRM device +*/ +int i915_init_ggtt_hw (struct drm_device *dev) {struct drm_i915_private *dev_priv = dev->dev_private;struct i915_ggtt *ggtt = &dev_priv->ggtt;drivers/gpu/drm/i915/i915_gem_gtt.h +3
-4@@ -513,10 +513,9 @@ i915_page_dir_dma_addr(const struct i915_hw_ppgtt *ppgtt, const unsigned n)px_dma (ppgtt->base.scratch_pd); } -int i915_gem_gtt_init (struct drm_device *dev); -void i915_gem_init_global_gtt (struct drm_device *dev); -void i915_global_gtt_cleanup (struct drm_device *dev); - +int i915_init_ggtt_hw (struct drm_device *dev); +void i915_gem_init_ggtt (struct drm_device *dev); +void i915_cleanup_ggtt_hw (struct drm_device *dev);int i915_ppgtt_init (struct drm_device *dev,struct i915_hw_ppgtt *ppgtt);int i915_ppgtt_init_hw (struct drm_device *dev);Signature · 6 lines
2.5.5 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfxSignature · 6 lines
Ville Syrjälä Intel OTC _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 6 lines
Ville Syrjälä Intel OTC _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 10 lines · Ville Syrjälä
Quoted 9 lines · Mika Kuoppala
Quoted 7 lines · Ville Syrjälä
[ text/plain ]
Quoted 4 lines · Joonas Lahtinen
Rename and document the GGTT init functions to give a better idea of the context where they are called from.
i915_gem_gtt_init=>i915_init_ggtt_hw
Quoted 8 lines
Quoted 5 lines
Quoted 2 lines
Seems to me
i915_ggtt_init_hwwould match existing practices better.There is also some gravity towards putting the verb first. In gem side atleast.
At least in this case
ggtt_init_hwwould matchppgtt_init_hw, which seems like a nice thing.
It would also help with the plan to tag the init_hw phases consistently. -Chris
Signature · 5 lines
Chris Wilson, Intel Open Source Technology Centre _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Joonas Lahtinen
maintainerQuoted 11 lines · Ville Syrjälä
Quoted 10 lines · Mika Kuoppala
Quoted 7 lines · Ville Syrjälä
[ text/plain ]
Quoted 4 lines · Joonas Lahtinen
Rename and document the GGTT init functions to give a better idea of the context where they are called from.
Quoted 8 lines
Quoted 5 lines
Quoted 3 lines
Quoted 1 line
i915_gem_gtt_init=>i915_init_ggtt_hwSeems to me
i915_ggtt_init_hwwould match existing practices better.There is also some gravity towards putting the verb first. In gem side atleast.
At least in this case
ggtt_init_hwwould matchppgtt_init_hw, which seems like a nice thing.
Right, I have changed the order quite a few times already. If it's i915_init_* (like i915_init_userptr), will be easier to grep.
Adding Chris here as we discussed this yesterday. His idea is that logic should be action_feature and object_verb, init_some_thingamagic, vs object_destroy.
Whatever we decide on, we should drop a small note at kerneldoc.
Regards, Joonas
Signature · 7 lines
Joonas Lahtinen Open Source Technology Center Intel Corporation _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 21 lines · Joonas Lahtinen
Quoted 11 lines · Ville Syrjälä
Quoted 10 lines · Mika Kuoppala
Quoted 7 lines · Ville Syrjälä
[ text/plain ]
Quoted 4 lines · Joonas Lahtinen
Rename and document the GGTT init functions to give a better idea of the context where they are called from.
Quoted 8 lines
Quoted 5 lines
Quoted 3 lines
Quoted 1 line
i915_gem_gtt_init=>i915_init_ggtt_hwSeems to me
i915_ggtt_init_hwwould match existing practices better.There is also some gravity towards putting the verb first. In gem side atleast.
At least in this case
ggtt_init_hwwould matchppgtt_init_hw, which seems like a nice thing.
Quoted 6 lines
Right, I have changed the order quite a few times already. If it's i915_init_* (like
i915_init_userptr), will be easier to grep.Adding Chris here as we discussed this yesterday. His idea is that logic should be
action_featureandobject_verb,init_some_thingamagic, vsobject_destroy.
Reasonable enough, as long as we can tell what's a feature and what's an object. A totally RPN scheme would be even clearer, since we would then treat features as objects (and actions are verbs), yielding:
i915_userptr_init()i915_engine_setup()i915_object_destroy()
and the like. That would require:
i915_gem_init_global_gtt => i915_gem_ggtt_initi915_gem_gtt_init => i915_ggtt_hw_initi915_global_gtt_cleanup => i915_ggtt_hw_cleanup
and
i915_pggtt_init()i915_pggtt_hw_init()
and perhaps
i915_context_allocate()i915_hw_ctx_init()i915_hw_ctx_pin_and_map()i915_context_free()
What do people think counts as "features" in Chris' scheme?
Quoted 3 lines
Whatever we decide on, we should drop a small note at kerneldoc.
Regards, Joonas
And perhaps we should have a list of preferred verbs with sensible meaning, e.g. "allocate" or "create", "init" or "setup", "free" or "release" or "destroy", etc?
.Dave.
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 22 lines · Dave Gordon
Quoted 21 lines · Joonas Lahtinen
Quoted 19 lines · Ville Syrjälä
Quoted 7 lines · Mika Kuoppala
Quoted 4 lines · Ville Syrjälä
[ text/plain ]
Quoted 1 line · Joonas Lahtinen
Quoted 8 lines
Quoted 6 lines
Quoted 4 lines
Rename and document the GGTT init functions to give a better idea of the context where they are called from.
i915_gem_gtt_init=>i915_init_ggtt_hwSeems to me
i915_ggtt_init_hwwould match existing practices better.There is also some gravity towards putting the verb first. In gem side atleast.
At least in this case
ggtt_init_hwwould matchppgtt_init_hw, which seems like a nice thing.
Quoted 6 lines
Quoted 6 lines
Right, I have changed the order quite a few times already. If it's i915_init_* (like
i915_init_userptr), will be easier to grep.Adding Chris here as we discussed this yesterday. His idea is that logic should be
action_featureandobject_verb,init_some_thingamagic, vsobject_destroy.
I said object_verb[_phase]. On reflection I mean object_verb_adverb
Quoted 8 lines
Reasonable enough, as long as we can tell what's a feature and what's an object. A totally RPN scheme would be even clearer, since we would then treat features as objects (and actions are verbs), yielding:
i915_userptr_init()i915_engine_setup()i915_object_destroy()
If those objects exist, yes. e.g userptr doesn't, but intel_engine does. Hence i915_gem_init_userptr() and it should have been intel_render_engine_init (oh well).
Quoted 5 lines
and the like. That would require:
i915_gem_init_global_gtt=>i915_gem_ggtt_initi915_gem_gtt_init=>i915_ggtt_hw_initi915_global_gtt_cleanup=>i915_ggtt_hw_cleanup
Not quite. init_hw is the verb (or rather verb_adverb).
Into that if an object doesn't exist such as stolen or userptr, then that pattern doesn't hold and we use the parent as the actor (subject) and move stolen after the verb (so it describes the verb, because to call it the object would be confusing!).
Along those lines it is why I like i915_init_hw, i915_init_mmio etc over i915_hw_init, i915_mmio_init as then it clear that the verb is init and we are describing what phase of init we are in (and that we are operating at the driver level).
Quoted 5 lines
and
i915_pggtt_init()i915_pggtt_hw_init()
Quoted 8 lines
and perhaps
i915_context_allocate()i915_hw_ctx_init()i915_hw_ctx_pin_and_map()i915_context_free()What do people think counts as "features" in Chris' scheme?
Not features, objects, which is quite easy to define as anything that has a class^W struct.
-Chris
Signature · 5 lines
Chris Wilson, Intel Open Source Technology Centre _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Joonas Lahtinen
maintainerQuoted 6 lines · Mika Kuoppala
Quoted 4 lines · Ville Syrjälä
[ text/plain ]
Quoted 1 line · Joonas Lahtinen
Quoted 9 lines
Quoted 6 lines
Quoted 4 lines
Rename and document the GGTT init functions to give a better idea of the context where they are called from.
i915_gem_gtt_init=>i915_init_ggtt_hwSeems to me
i915_ggtt_init_hwwould match existing practices better.There is also some gravity towards putting the verb first. In gem side atleast.
When one excludes i915_gem_init_* functions there are not so many left (0).
So I will change it as suggested by Ville (and Daniel too).
Regards, Joonas
Quoted 158 lines
-Mika
Quoted 155 lines
Quoted 155 lines
i915_gem_init_global_gtt=>i915_gem_init_ggtti915_global_gtt_cleanup=>i915_cleanup_ggtt_hwCc Tvrtko Ursulin <[email protected]>Cc Mika Kuoppala <[email protected]>Acked-by Chris Wilson <[email protected]>Signed-off-by Joonas Lahtinen <[email protected]>---
drivers/gpu/drm/i915/i915_dma.c | 14 +++++++------- drivers/gpu/drm/i915/i915_gem.c | 2 +-drivers/gpu/drm/i915/i915_gem_gtt.c| 18 +++++++++++++++---drivers/gpu/drm/i915/i915_gem_gtt.h| 7 +++----4 files changed, 26 insertions(+), 15 deletions(-)drivers/gpu/drm/i915/i915_dma.c +0
-0@@ -1180,7 +1180,7 @@ static int i915_driver_init_hw(struct drm_i915_private *dev_priv)
intel_device_info_runtime_init(dev);drivers/gpu/drm/i915/i915_dma.c +1
-1- ret =i915_gem_gtt_init (dev); + ret =i915_init_ggtt_hw (dev);if (ret)
return ret;drivers/gpu/drm/i915/i915_dma.c +1
-1@@ -1189,13 +1189,13 @@ static int i915_driver_init_hw(struct drm_i915_private *dev_priv) ret = i915_kick_out_firmware_fb(dev_priv); if (ret) { DRM_ERROR("failed to remove conflicting framebuffer drivers\n"); - goto out_gtt; + goto out_ggtt; }
ret =i915_kick_out_vgacon(dev_priv);
if (ret) {
DRM_ERROR("failed to remove conflicting VGA console\n");drivers/gpu/drm/i915/i915_dma.c +1
-1- goto out_gtt; + goto out_ggtt;}
pci_set_master(dev->pdev);drivers/gpu/drm/i915/i915_dma.c +1
-1@@ -1222,7 +1222,7 @@ static int i915_driver_init_hw(struct drm_i915_private *dev_priv) aperture_size); if (dev_priv->ggtt.mappable == NULL) { ret = -EIO; - goto out_gtt; + goto out_ggtt; }
dev_priv->ggtt.mtrr= arch_phys_wc_add(dev_priv->ggtt.mappable_base,drivers/gpu/drm/i915/i915_dma.c +0
-0@@ -1255,8 +1255,8 @@ static int i915_driver_init_hw(struct drm_i915_private *dev_priv)
return 0;drivers/gpu/drm/i915/i915_dma.c +2
-2-out_gtt: -i915_global_gtt_cleanup (dev); +out_ggtt: +i915_cleanup_ggtt_hw (dev);
return ret;
}drivers/gpu/drm/i915/i915_dma.c +1
-1@@ -1275,7 +1275,7 @@ static void i915_driver_cleanup_hw(struct drm_i915_private *dev_priv) pm_qos_remove_request(&dev_priv->pm_qos); arch_phys_wc_del(dev_priv->ggtt.mtrr); io_mapping_free(dev_priv->ggtt.mappable); -i915_global_gtt_cleanup (dev); +i915_cleanup_ggtt_hw (dev); }
/**drivers/gpu/drm/i915/i915_gem.c +0
-0@@ -4972,7 +4972,7 @@ int i915_gem_init(struct drm_device *dev) if (ret) goto out_unlock;drivers/gpu/drm/i915/i915_gem.c +1
-1-i915_gem_init_global_gtt (dev); +i915_gem_init_ggtt (dev);
ret =i915_gem_context_init(dev);
if (ret)drivers/gpu/drm/i915/i915_gem_gtt.c +0
-0@@ -2808,7 +2808,11 @@ static int i915_gem_setup_global_gtt(struct drm_device *dev, return 0; }drivers/gpu/drm/i915/i915_gem_gtt.c +5
-1-void i915_gem_init_global_gtt (struct drm_device *dev) +/** +* i915_gem_init_ggtt - Initialize GEM for Global GTT +* @dev: DRM device +*/ +void i915_gem_init_ggtt (struct drm_device *dev){
structdrm_i915_private*dev_priv=dev->dev_private; u64gtt_size,mappable_size;drivers/gpu/drm/i915/i915_gem_gtt.c +0
-0@@ -2819,7 +2823,11 @@ void i915_gem_init_global_gtt(struct drm_device *dev) i915_gem_setup_global_gtt(dev, 0, mappable_size, gtt_size); }drivers/gpu/drm/i915/i915_gem_gtt.c +5
-1-void i915_global_gtt_cleanup (struct drm_device *dev) +/** +* i915_cleanup_ggtt_hw - Clean up GGTT hardware initialization +* @dev: DRM device +*/ +void i915_cleanup_ggtt_hw (struct drm_device *dev){
structdrm_i915_private*dev_priv=dev->dev_private; structi915_address_space*vm =&dev_priv->ggtt.base;drivers/gpu/drm/i915/i915_gem_gtt.c +0
-0@@ -3157,7 +3165,11 @@ static void i915_gmch_remove(struct i915_address_space *vm) intel_gmch_remove(); }drivers/gpu/drm/i915/i915_gem_gtt.c +5
-1-int i915_gem_gtt_init (struct drm_device *dev) +/** +* i915_init_ggtt_hw - Initialize GGTT hardware +* @dev: DRM device +*/ +int i915_init_ggtt_hw (struct drm_device *dev){
structdrm_i915_private*dev_priv=dev->dev_private; structi915_ggtt*ggtt =&dev_priv->ggtt;drivers/gpu/drm/i915/i915_gem_gtt.h +0
-0@@ -513,10 +513,9 @@ i915_page_dir_dma_addr(const struct i915_hw_ppgtt *ppgtt, const unsigned n) px_dma(ppgtt->base.scratch_pd); }drivers/gpu/drm/i915/i915_gem_gtt.h +3
-4-int i915_gem_gtt_init (struct drm_device *dev); -void i915_gem_init_global_gtt (struct drm_device *dev); -void i915_global_gtt_cleanup (struct drm_device *dev); - +int i915_init_ggtt_hw (struct drm_device *dev); +void i915_gem_init_ggtt (struct drm_device *dev); +void i915_cleanup_ggtt_hw (struct drm_device *dev);
inti915_ppgtt_init(struct drm_device *dev, struct i915_hw_ppgtt *ppgtt); inti915_ppgtt_init_hw(struct drm_device *dev);
--
2.5.5_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 7 lines
Joonas Lahtinen Open Source Technology Center Intel Corporation _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Joonas Lahtinen
maintainerPATCH v2 1/1 drm/i915: Rename GGTT init functions
In reply to Mika KuoppalaRename and document the GGTT init functions to give a better idea of the context where they are called from.
i915_gem_gtt_init => i915_ggtt_init_hwi915_gem_init_global_gtt => i915_gem_init_ggtti915_global_gtt_cleanup => i915_ggtt_cleanup_hw
--- drivers/gpu/drm/i915/i915_dma.c | 14 +++++++------- drivers/gpu/drm/i915/i915_gem.c | 2 +- drivers/gpu/drm/i915/i915_gem_gtt.c | 18 +++++++++++++++--- drivers/gpu/drm/i915/i915_gem_gtt.h | 7 +++---- 4 files changed, 26 insertions(+), 15 deletions(-)
drivers/gpu/drm/i915/i915_dma.c +7 -7
@@ -1180,7 +1180,7 @@ static int i915_driver_init_hw(struct drm_i915_private *dev_priv)intel_device_info_runtime_init (dev); - ret =i915_gem_gtt_init (dev); + ret =i915_ggtt_init_hw (dev);if (ret)return ret;
@@ -1189,13 +1189,13 @@ static int i915_driver_init_hw(struct drm_i915_private *dev_priv) ret =i915_kick_out_firmware_fb (dev_priv);if (ret) {DRM_ERROR ("failed to remove conflicting framebuffer drivers\n" ); - goto out_gtt; + goto out_ggtt; } ret =i915_kick_out_vgacon (dev_priv);if (ret) {DRM_ERROR ("failed to remove conflicting VGA console\n" ); - goto out_gtt; + goto out_ggtt; }pci_set_master (dev->pdev);
@@ -1222,7 +1222,7 @@ static int i915_driver_init_hw(struct drm_i915_private *dev_priv) aperture_size);if (dev_priv->ggtt.mappable ==NULL ) { ret = -EIO ; - goto out_gtt; + goto out_ggtt; } dev_priv->ggtt.mtrr = arch_phys_wc_add(dev_priv->ggtt.mappable_base,
@@ -1255,8 +1255,8 @@ static int i915_driver_init_hw(struct drm_i915_private *dev_priv)return 0 ; -out_gtt: -i915_global_gtt_cleanup (dev); +out_ggtt: +i915_ggtt_cleanup_hw (dev);return ret; }
@@ -1275,7 +1275,7 @@ static void i915_driver_cleanup_hw(struct drm_i915_private *dev_priv)pm_qos_remove_request (&dev_priv->pm_qos);arch_phys_wc_del (dev_priv->ggtt.mtrr);io_mapping_free (dev_priv->ggtt.mappable); -i915_global_gtt_cleanup (dev); +i915_ggtt_cleanup_hw (dev); }/**
drivers/gpu/drm/i915/i915_gem.c +1 -1
@@ -4967,7 +4967,7 @@ int i915_gem_init(struct drm_device *dev)if (ret) goto out_unlock; -i915_gem_init_global_gtt (dev); +i915_gem_init_ggtt (dev); ret =i915_gem_context_init (dev);if (ret)
drivers/gpu/drm/i915/i915_gem_gtt.c +15 -3
@@ -2804,7 +2804,11 @@ static int i915_gem_setup_global_gtt(struct drm_device *dev,return 0 ; } -void i915_gem_init_global_gtt (struct drm_device *dev) +/** +* i915_gem_init_ggtt - Initialize GEM for Global GTT +* @dev: DRM device +*/ +void i915_gem_init_ggtt (struct drm_device *dev) {struct drm_i915_private *dev_priv = dev->dev_private;u64 gtt_size, mappable_size;
@@ -2815,7 +2819,11 @@ void i915_gem_init_global_gtt(struct drm_device *dev)i915_gem_setup_global_gtt (dev,0 , mappable_size, gtt_size); } -void i915_global_gtt_cleanup (struct drm_device *dev) +/** +* i915_ggtt_cleanup_hw - Clean up GGTT hardware initialization +* @dev: DRM device +*/ +void i915_ggtt_cleanup_hw (struct drm_device *dev) {struct drm_i915_private *dev_priv = dev->dev_private;struct i915_address_space *vm = &dev_priv->ggtt.base;
@@ -3153,7 +3161,11 @@ static void i915_gmch_remove(struct i915_address_space *vm)intel_gmch_remove (); } -int i915_gem_gtt_init (struct drm_device *dev) +/** +* i915_ggtt_init_hw - Initialize GGTT hardware +* @dev: DRM device +*/ +int i915_ggtt_init_hw (struct drm_device *dev) {struct drm_i915_private *dev_priv = dev->dev_private;struct i915_ggtt *ggtt = &dev_priv->ggtt;
drivers/gpu/drm/i915/i915_gem_gtt.h +3 -4
@@ -513,10 +513,9 @@ i915_page_dir_dma_addr(const struct i915_hw_ppgtt *ppgtt, const unsigned n)px_dma (ppgtt->base.scratch_pd); } -int i915_gem_gtt_init (struct drm_device *dev); -void i915_gem_init_global_gtt (struct drm_device *dev); -void i915_global_gtt_cleanup (struct drm_device *dev); - +int i915_ggtt_init_hw (struct drm_device *dev); +void i915_gem_init_ggtt (struct drm_device *dev); +void i915_ggtt_cleanup_hw (struct drm_device *dev);int i915_ppgtt_init (struct drm_device *dev,struct i915_hw_ppgtt *ppgtt);int i915_ppgtt_init_hw (struct drm_device *dev);
Signature · 6 lines
2.5.5 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Joonas Lahtinen
maintainerQuoted 11 lines · Joonas Lahtinen
Rename and document the GGTT init functions to give a better idea of the context where they are called from.
i915_gem_gtt_init=>i915_ggtt_init_hwi915_gem_init_global_gtt=>i915_gem_init_ggtti915_global_gtt_cleanup=>i915_ggtt_cleanup_hwCc Tvrtko Ursulin <[email protected]>Cc Mika Kuoppala <[email protected]>Cc Ville Syrjälä <[email protected]>Acked-by Chris Wilson <[email protected]>
Chris, accidentally did not remove you A-b for v2. You can retake your position here.
This is the best balance between general naming logic and consistency with ppgtt I could come up. How about I merge this?
Regards, Joonas
Quoted 8 lines
Signed-off-by Joonas Lahtinen <[email protected]>---
drivers/gpu/drm/i915/i915_dma.c | 14 +++++++------- drivers/gpu/drm/i915/i915_gem.c | 2 +-drivers/gpu/drm/i915/i915_gem_gtt.c| 18 +++++++++++++++---drivers/gpu/drm/i915/i915_gem_gtt.h| 7 +++----4 files changed, 26 insertions(+), 15 deletions(-)
Signature · 8 lines
Joonas Lahtinen Open Source Technology Center Intel Corporation _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 13 lines · Joonas Lahtinen
Quoted 11 lines · Joonas Lahtinen
Rename and document the GGTT init functions to give a better idea of the context where they are called from.
i915_gem_gtt_init=>i915_ggtt_init_hwi915_gem_init_global_gtt=>i915_gem_init_ggtti915_global_gtt_cleanup=>i915_ggtt_cleanup_hwCc Tvrtko Ursulin <[email protected]>Cc Mika Kuoppala <[email protected]>Cc Ville Syrjälä <[email protected]>Acked-by Chris Wilson <[email protected]>
Quoted 5 lines
Chris, accidentally did not remove you A-b for v2. You can retake your position here.
This is the best balance between general naming logic and consistency with ppgtt I could come up. How about I merge this?
I don't have any better names to suggest, and the init_hw should help a lot. Go for it.
-Chris
Signature · 5 lines
Chris Wilson, Intel Open Source Technology Centre _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Chris Wilson
Reviewed-byQuoted 14 lines · Chris Wilson
Quoted 13 lines · Joonas Lahtinen
Quoted 11 lines · Joonas Lahtinen
Rename and document the GGTT init functions to give a better idea of the context where they are called from.
i915_gem_gtt_init=>i915_ggtt_init_hwi915_gem_init_global_gtt=>i915_gem_init_ggtti915_global_gtt_cleanup=>i915_ggtt_cleanup_hwCc Tvrtko Ursulin <[email protected]>Cc Mika Kuoppala <[email protected]>Cc Ville Syrjälä <[email protected]>Acked-by Chris Wilson <[email protected]>
Quoted 8 lines
Quoted 5 lines
Chris, accidentally did not remove you A-b for v2. You can retake your position here.
This is the best balance between general naming logic and consistency with ppgtt I could come up. How about I merge this?
I don't have any better names to suggest, and the
init_hwshould help a lot. Go for it.
-Chris
Signature · 5 lines
Chris Wilson, Intel Open Source Technology Centre _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 17 lines · Chris Wilson
Quoted 16 lines · Chris Wilson
Quoted 14 lines · Joonas Lahtinen
Quoted 12 lines · Joonas Lahtinen
Rename and document the GGTT init functions to give a better idea of the context where they are called from.
i915_gem_gtt_init=>i915_ggtt_init_hwi915_gem_init_global_gtt=>i915_gem_init_ggtti915_global_gtt_cleanup=>i915_ggtt_cleanup_hwCc Tvrtko Ursulin <[email protected]>Cc Mika Kuoppala <[email protected]>Cc Ville Syrjälä <[email protected]>Acked-by Chris Wilson <[email protected]>
Quoted 8 lines
Quoted 7 lines
Quoted 5 lines
Chris, accidentally did not remove you A-b for v2. You can retake your position here.
This is the best balance between general naming logic and consistency with ppgtt I could come up. How about I merge this?
I don't have any better names to suggest, and the
init_hwshould help a lot. Go for it.Reviewed-by Chris Wilson <[email protected]>
Merged, thanks for review and comments everyone.
Quoted 2 lines
-Chris
Signature · 7 lines
Joonas Lahtinen Open Source Technology Center Intel Corporation _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✗ Fi.CI.BAT: warning for series starting with [v2] drm/i915: Rename GGTT init functions (rev3)
In reply to Joonas Lahtinen== Series Details ==
== Series Details ==
Series: series starting with [v2] drm/i915: Rename GGTT init functions (rev3)
URL : https://patchwork.freedesktop.org/series/4790/
State : warning
== Summary ==
Series 4790v3 Series without cover letter
http://patchwork.freedesktop.org/api/1.0/series/4790/revisions/3/mbox/
Test gem_exec_basic:
Subgroup gtt-blt:
pass -> DMESG-WARN (bsw-nuc-2)
Test pm_rpm:
Subgroup basic-rte:
pass -> DMESG-WARN (bsw-nuc-2)bdw-nuci7 total:192 pass:179 dwarn:0 dfail:0 fail:1 skip:12 bdw-ultra total:192 pass:170 dwarn:0 dfail:0 fail:1 skip:21 bsw-nuc-2 total:192 pass:153 dwarn:2 dfail:0 fail:0 skip:37 byt-nuc total:192 pass:156 dwarn:1 dfail:0 fail:0 skip:35 hsw-brixbox total:192 pass:170 dwarn:0 dfail:0 fail:0 skip:22 hsw-gt2 total:192 pass:175 dwarn:0 dfail:0 fail:0 skip:17 ivb-t430s total:192 pass:167 dwarn:0 dfail:0 fail:0 skip:25 skl-i7k-2 total:192 pass:169 dwarn:0 dfail:0 fail:0 skip:23 skl-nuci5 total:192 pass:181 dwarn:0 dfail:0 fail:0 skip:11 snb-dellxps total:192 pass:158 dwarn:0 dfail:0 fail:0 skip:34 snb-x220t total:192 pass:158 dwarn:0 dfail:0 fail:1 skip:33
Results at /archive/results/CI_IGT_test/Patchwork_1712/
f5d413cccefa1f93d64c34f357151d42add63a84 drm-intel-nightly: 2016y-03m-24d-14h-34m-29s UTC integration manifest 9a1fb4808f9bc1219d05bf79c4a90079c246e7ed drm/i915: Refer to GGTT VM consistently 4351646d82c63100310f5d4e437c2f8a4435c9a7 drm/i915: Rename GGTT init functions
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Joonas Lahtinen
maintainerRe: ✗ Fi.CI.BAT: warning for series starting with [v2] drm/i915: Rename GGTT init functions (rev3)
Quoted 6 lines · Patchwork
== Series Details ==
Series: series starting with [v2] drm/i915: Rename GGTT init functions (rev3) URL : https://patchwork.freedesktop.org/series/4790/
State : warning
Quoted 8 lines
== Summary ==
Series 4790v3 Series without cover letter
http://patchwork.freedesktop.org/api/1.0/series/4790/revisions/3/mbox/Test
gem_exec_basic:
Subgroup gtt-blt:
pass -> DMESG-WARN (bsw-nuc-2)
[drm:intel_runtime_suspend [i915]] *ERROR* Unclaimed access detected prior to suspending
Problem in BSW/BYT runtime PM, reported at:
https://bugs.freedesktop.org/show_bug.cgi?id=94164
Quoted 3 lines
Test
pm_rpm:
Subgroup basic-rte:
pass -> DMESG-WARN (bsw-nuc-2)
"====================================================== [ INFO: possible circular locking dependency detected ] 4.5.0-gfxbench+ #1 Not tainted
-------------------------------------------------------
gem_exec_basic/5896 is trying to acquire lock:
(&dev->struct_mutex){+.+.+.}, at: [<ffffffff81514ea1>] drm_gem_mmap+0x1a1/0x270
but task is already holding lock:
(&mm->mmap_sem){++++++}, at: [<ffffffff8117d8c4>] vm_mmap_pgoff+0x44/0xa0
which lock already depends on the new lock."
Lockdep issue (completely unrelated to renaming functions :P), this whole chain causing multiple splats is being worked on. Opened a bug to track this specific warn:
https://bugs.freedesktop.org/show_bug.cgi?id=94759
Regards, Joonas
Quoted 19 lines
bdw-nuci7 total:192 pass:179 dwarn:0 dfail:0 fail:1 skip:12 bdw-ultra total:192 pass:170 dwarn:0 dfail:0 fail:1 skip:21 bsw-nuc-2 total:192 pass:153 dwarn:2 dfail:0 fail:0 skip:37 byt-nuc total:192 pass:156 dwarn:1 dfail:0 fail:0 skip:35 hsw-brixbox total:192 pass:170 dwarn:0 dfail:0 fail:0 skip:22 hsw-gt2 total:192 pass:175 dwarn:0 dfail:0 fail:0 skip:17 ivb-t430s total:192 pass:167 dwarn:0 dfail:0 fail:0 skip:25 skl-i7k-2 total:192 pass:169 dwarn:0 dfail:0 fail:0 skip:23 skl-nuci5 total:192 pass:181 dwarn:0 dfail:0 fail:0 skip:11 snb-dellxps total:192 pass:158 dwarn:0 dfail:0 fail:0 skip:34 snb-x220t total:192 pass:158 dwarn:0 dfail:0 fail:1 skip:33
Results at /archive/results/CI_IGT_test/Patchwork_1712/
f5d413cccefa1f93d64c34f357151d42add63a84drm-intel-nightly: 2016y-03m-24d-14h-34m-29s UTC integration manifest9a1fb4808f9bc1219d05bf79c4a90079c246e7eddrm/i915: Refer to GGTT VM consistently4351646d82c63100310f5d4e437c2f8a4435c9a7drm/i915: Rename GGTT init functions
Signature · 7 lines
Joonas Lahtinen Open Source Technology Center Intel Corporation _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✗ Fi.CI.BAT: warning for series starting with [v2] drm/i915: Rename GGTT init functions (rev5)
In reply to Joonas Lahtinen== Series Details ==
== Series Details ==
Series: series starting with [v2] drm/i915: Rename GGTT init functions (rev5)
URL : https://patchwork.freedesktop.org/series/4790/
State : warning
== Summary ==
Series 4790v5 Series without cover letter
http://patchwork.freedesktop.org/api/1.0/series/4790/revisions/5/mbox/
Test gem_mmap_gtt:
Subgroup basic-read-no-prefault:
pass -> DMESG-WARN (bsw-nuc-2)
Test kms_pipe_crc_basic:
Subgroup suspend-read-crc-pipe-c:
dmesg-warn -> PASS (bsw-nuc-2)bdw-nuci7 total:196 pass:184 dwarn:0 dfail:0 fail:0 skip:12 bdw-ultra total:196 pass:175 dwarn:0 dfail:0 fail:0 skip:21 bsw-nuc-2 total:196 pass:158 dwarn:1 dfail:0 fail:0 skip:37 hsw-brixbox total:196 pass:174 dwarn:0 dfail:0 fail:0 skip:22 hsw-gt2 total:21 pass:19 dwarn:0 dfail:0 fail:0 skip:1 skl-i7k-2 total:196 pass:173 dwarn:0 dfail:0 fail:0 skip:23 skl-nuci5 total:196 pass:185 dwarn:0 dfail:0 fail:0 skip:11 snb-dellxps total:27 pass:23 dwarn:0 dfail:0 fail:0 skip:3
Results at /archive/results/CI_IGT_test/Patchwork_1757/
03c0f854e93263563f559d2bc8e47fb51adae697 drm-intel-nightly: 2016y-03m-31d-10h-50m-15s UTC integration manifest 5061b7bad84ec0d6047783dc1a23f1e592e7d5d8 drm/i915: Refer to GGTT {,VM} consistently
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Joonas Lahtinen
maintainerRe: ✗ Fi.CI.BAT: warning for series starting with [v2] drm/i915: Rename GGTT init functions (rev5)
Quoted 11 lines · Patchwork
== Series Details ==
Series: series starting with [v2] drm/i915: Rename GGTT init functions (rev5) URL : https://patchwork.freedesktop.org/series/4790/
State : warning== Summary ==
Series 4790v5 Series without cover letter
http://patchwork.freedesktop.org/api/1.0/series/4790/revisions/5/mbox/
Quoted 6 lines
Test
gem_mmap_gtt:
Subgroup basic-read-no-prefault:
pass -> DMESG-WARN (bsw-nuc-2) Testkms_pipe_crc_basic:
Subgroup suspend-read-crc-pipe-c:
dmesg-warn -> PASS (bsw-nuc-2)
This is the kernfs lockdep warn (awaiting comments from upstream maintainers):
https://bugs.freedesktop.org/show_bug.cgi?id=94759
So I'm merging this other patch too as it was supposed to be NOOP too (just renames).
Regards, Joonas
Quoted 15 lines
bdw-nuci7 total:196 pass:184 dwarn:0 dfail:0 fail:0 skip:12 bdw-ultra total:196 pass:175 dwarn:0 dfail:0 fail:0 skip:21 bsw-nuc-2 total:196 pass:158 dwarn:1 dfail:0 fail:0 skip:37 hsw-brixbox total:196 pass:174 dwarn:0 dfail:0 fail:0 skip:22 hsw-gt2 total:21 pass:19 dwarn:0 dfail:0 fail:0 skip:1 skl-i7k-2 total:196 pass:173 dwarn:0 dfail:0 fail:0 skip:23 skl-nuci5 total:196 pass:185 dwarn:0 dfail:0 fail:0 skip:11 snb-dellxps total:27 pass:23 dwarn:0 dfail:0 fail:0 skip:3
Results at /archive/results/CI_IGT_test/Patchwork_1757/
03c0f854e93263563f559d2bc8e47fb51adae697drm-intel-nightly: 2016y-03m-31d-10h-50m-15s UTC integration manifest5061b7bad84ec0d6047783dc1a23f1e592e7d5d8drm/i915: Refer to GGTT {,VM} consistently
Signature · 7 lines
Joonas Lahtinen Open Source Technology Center Intel Corporation _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx