drm/i915/gtt: Reference mappable_end variable from pointer
Subsystems (2)
Joonas Lahtinen
maintainerPATCH 1/3 drm/i915/gtt: Reference mappable_end variable from pointer
Reference variable value from pointer, not assumed pointer destination.
Since:
commit c44ef60e437019b8ca1dab8b4d2e8761fd4ce1e9
Author: Mika Kuoppala <[email protected]> Date: Thu Jun 25 18:35:05 2015 +0300
drm/i915/gtt: Allow >= 4GB sizes for vm.
--- drivers/gpu/drm/i915/i915_gem_gtt.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/gpu/drm/i915/i915_gem_gtt.c +1 -2
@@ -3103,8 +3103,7 @@ static int gen6_gmch_probe(struct drm_device *dev,* a coarse sanity check. */ if ((*mappable_end < (64 <<20 ) || (*mappable_end > (512 <<20 )))) { -DRM_ERROR ("Unknown GMADR size (%llx)\n" , - dev_priv->gtt.mappable_end); +DRM_ERROR ("Unknown GMADR size (%llx)\n" , *mappable_end);return -ENXIO ; }
Signature · 6 lines
2.5.0 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Joonas Lahtinen
maintainerPATCH 2/3 drm/i915: Rename dev_priv->gtt to dev_priv->ggtt
Refer to Global GTT consistencly as GGTT, thus rename dev_priv->gtt to dev_priv->ggtt and struct i915_gtt to struct i915_ggtt.
Fix a couple of whitespace problems while at it.
--- drivers/gpu/drm/i915/i915_debugfs.c | 8 +- drivers/gpu/drm/i915/i915_dma.c | 18 ++-- drivers/gpu/drm/i915/i915_drv.h | 4 +- drivers/gpu/drm/i915/i915_gem.c | 16 ++-- drivers/gpu/drm/i915/i915_gem_context.c | 2 +- drivers/gpu/drm/i915/i915_gem_execbuffer.c | 6 +- drivers/gpu/drm/i915/i915_gem_gtt.c | 147 ++++++++++++++--------------- drivers/gpu/drm/i915/i915_gem_gtt.h | 9 +- drivers/gpu/drm/i915/i915_gem_stolen.c | 50 +++++----- drivers/gpu/drm/i915/i915_gpu_error.c | 10 +- drivers/gpu/drm/i915/i915_vgpu.c | 14 +-- drivers/gpu/drm/i915/intel_display.c | 4 +- drivers/gpu/drm/i915/intel_fbc.c | 4 +- drivers/gpu/drm/i915/intel_fbdev.c | 6 +- drivers/gpu/drm/i915/intel_overlay.c | 4 +- drivers/gpu/drm/i915/intel_pm.c | 10 +- drivers/gpu/drm/i915/intel_ringbuffer.c | 2 +- 17 files changed, 156 insertions(+), 158 deletions(-)
drivers/gpu/drm/i915/i915_debugfs.c +4 -4
@@ -203,7 +203,7 @@ static int i915_gem_object_list_info(struct seq_file *m, void *data)struct list_head *head;struct drm_device *dev = node->minor->dev;struct drm_i915_private *dev_priv = dev->dev_private; -struct i915_address_space *vm = &dev_priv->gtt.base; +struct i915_address_space *vm = &dev_priv->ggtt.base;struct i915_vma *vma;u64 total_obj_size, total_gtt_size;int count, ret;
@@ -433,7 +433,7 @@ static int i915_gem_object_info(struct seq_file *m, void* data)u32 count, mappable_count, purgeable_count;u64 size, mappable_size, purgeable_size;struct drm_i915_gem_object *obj; -struct i915_address_space *vm = &dev_priv->gtt.base; +struct i915_address_space *vm = &dev_priv->ggtt.base;struct drm_file *file;struct i915_vma *vma;int ret;
@@ -492,8 +492,8 @@ static int i915_gem_object_info(struct seq_file *m, void* data) count, size);seq_printf (m,"%llu [%llu] gtt total\n" , - dev_priv->gtt.base.total, - (u64 )dev_priv->gtt.mappable_end - dev_priv->gtt.base.start); + dev_priv->ggtt.base.total, + (u64 )dev_priv->ggtt.mappable_end - dev_priv->ggtt.base.start);seq_putc (m,'\n' );print_batch_pool_stats (m, dev_priv);
drivers/gpu/drm/i915/i915_dma.c +9 -9
@@ -491,8 +491,8 @@ static int i915_kick_out_firmware_fb(struct drm_i915_private *dev_priv)if (!ap)return -ENOMEM ; - ap->ranges[0 ].base = dev_priv->gtt.mappable_base; - ap->ranges[0 ].size = dev_priv->gtt.mappable_end; + ap->ranges[0 ].base = dev_priv->ggtt.mappable_base; + ap->ranges[0 ].size = dev_priv->ggtt.mappable_end; primary = pdev->resource[PCI_ROM_RESOURCE ].flags &IORESOURCE_ROM_SHADOW ;
@@ -1172,17 +1172,17 @@ static int i915_driver_init_hw(struct drm_i915_private *dev_priv)if (IS_BROADWATER (dev) ||IS_CRESTLINE (dev))dma_set_coherent_mask (&dev->pdev->dev,DMA_BIT_MASK (32 )); - aperture_size = dev_priv->gtt.mappable_end; + aperture_size = dev_priv->ggtt.mappable_end; - dev_priv->gtt.mappable = -io_mapping_create_wc (dev_priv->gtt.mappable_base, + dev_priv->ggtt.mappable = +io_mapping_create_wc (dev_priv->ggtt.mappable_base, aperture_size); -if (dev_priv->gtt.mappable ==NULL ) { +if (dev_priv->ggtt.mappable ==NULL ) { ret = -EIO ; goto out_gtt; } - dev_priv->gtt.mtrr =arch_phys_wc_add (dev_priv->gtt.mappable_base, + dev_priv->ggtt.mtrr =arch_phys_wc_add (dev_priv->ggtt.mappable_base, aperture_size); pm_qos_add_request(&dev_priv->pm_qos, PM_QOS_CPU_DMA_LATENCY,
@@ -1230,8 +1230,8 @@ static void i915_driver_cleanup_hw(struct drm_i915_private *dev_priv)pci_disable_msi (dev->pdev);pm_qos_remove_request (&dev_priv->pm_qos); -arch_phys_wc_del (dev_priv->gtt.mtrr); -io_mapping_free (dev_priv->gtt.mappable); +arch_phys_wc_del (dev_priv->ggtt.mtrr); +io_mapping_free (dev_priv->ggtt.mappable);i915_global_gtt_cleanup (dev); }
drivers/gpu/drm/i915/i915_drv.h +2 -2
@@ -1810,7 +1810,7 @@ struct drm_i915_private {struct drm_atomic_state *modeset_restore_state;struct list_head vm_list;/* Global list of all address spaces */ -struct i915_gtt gtt;/* VM representing the global address space */ +struct i915_ggtt ggtt;/* VM representing the global address space */ struct i915_gem_mm mm;DECLARE_HASHTABLE (mm_structs,7 );
@@ -3126,7 +3126,7 @@ bool i915_gem_obj_is_pinned(struct drm_i915_gem_object *obj);/* Some GGTT VM helpers */ #define i915_obj_to_ggtt (obj) \ - (&((struct drm_i915_private *)(obj)->base.dev->dev_private)->gtt.base) + (&((struct drm_i915_private *)(obj)->base.dev->dev_private)->ggtt.base)static inline struct i915_hw_ppgtt *i915_vm_to_ppgtt (struct i915_address_space *vm)
drivers/gpu/drm/i915/i915_gem.c +8 -8
@@ -132,7 +132,7 @@ i915_gem_get_aperture_ioctl(struct drm_device *dev, void *data, {struct drm_i915_private *dev_priv = dev->dev_private;struct drm_i915_gem_get_aperture *args = data; -struct i915_gtt *ggtt = &dev_priv->gtt; +struct i915_ggtt *ggtt = &dev_priv->ggtt;struct i915_vma *vma;size_t pinned;
@@ -146,7 +146,7 @@ i915_gem_get_aperture_ioctl(struct drm_device *dev, void *data, pinned += vma->node.size;mutex_unlock (&dev->struct_mutex); - args->aper_size = dev_priv->gtt.base.total; + args->aper_size = dev_priv->ggtt.base.total; args->aper_available_size = args->aper_size - pinned;return 0 ;
@@ -807,7 +807,7 @@ i915_gem_gtt_pwrite_fast(struct drm_device *dev,* source page isn't available. Return the error and we'll * retry in the slow path. */ -if (fast_user_write (dev_priv->gtt.mappable, page_base, +if (fast_user_write (dev_priv->ggtt.mappable, page_base, page_offset, user_data, page_length)) { ret = -EFAULT ; goto out_flush;
@@ -1827,7 +1827,7 @@ int i915_gem_fault(struct vm_area_struct *vma, struct vm_fault *vmf) }/* Use a partial view if the object is bigger than the aperture. */ -if (obj->base.size >= dev_priv->gtt.mappable_end && +if (obj->base.size >= dev_priv->ggtt.mappable_end && obj->tiling_mode ==I915_TILING_NONE ) {static const unsigned int chunk_size =256 ;// 1 MiB
@@ -1855,7 +1855,7 @@ int i915_gem_fault(struct vm_area_struct *vma, struct vm_fault *vmf) goto unpin;/* Finally, remap it using the new GTT offset */ - pfn = dev_priv->gtt.mappable_base + + pfn = dev_priv->ggtt.mappable_base +i915_gem_obj_ggtt_offset_view (obj, &view); pfn >>=PAGE_SHIFT ;
@@ -3513,7 +3513,7 @@ i915_gem_object_bind_to_vm(struct drm_i915_gem_object *obj, start = flags &PIN_OFFSET_BIAS ? flags &PIN_OFFSET_MASK :0 ; end = vm->total;if (flags &PIN_MAPPABLE ) - end =min_t (u64, end, dev_priv->gtt.mappable_end); + end =min_t (u64, end, dev_priv->ggtt.mappable_end);if (flags &PIN_ZONE_4G ) end =min_t (u64, end, (1ULL <<32 ) -PAGE_SIZE );
@@ -3774,7 +3774,7 @@ i915_gem_object_set_to_gtt_domain(struct drm_i915_gem_object *obj, bool write) vma =i915_gem_obj_to_ggtt (obj);if (vma &&drm_mm_node_allocated (&vma->node) && !obj->active)list_move_tail (&vma->vm_link, - &to_i915 (obj->base.dev)->gtt.base.inactive_list); + &to_i915 (obj->base.dev)->ggtt.base.inactive_list);return 0 ; }
@@ -4211,7 +4211,7 @@ void __i915_vma_set_map_and_fenceable(struct i915_vma *vma) (vma->node.start & (fence_alignment - 1)) == 0); mappable = (vma->node.start + fence_size <= -to_i915 (obj->base.dev)->gtt.mappable_end); +to_i915 (obj->base.dev)->ggtt.mappable_end); obj->map_and_fenceable = mappable && fenceable; }
drivers/gpu/drm/i915/i915_gem_context.c +1 -1
@@ -945,7 +945,7 @@ int i915_gem_context_getparam_ioctl(struct drm_device *dev, void *data,else if (to_i915 (dev)->mm.aliasing_ppgtt) args->value =to_i915 (dev)->mm.aliasing_ppgtt->base.total;else - args->value =to_i915 (dev)->gtt.base.total; + args->value =to_i915 (dev)->ggtt.base.total;break ;default : ret = -EINVAL ;
drivers/gpu/drm/i915/i915_gem_execbuffer.c +3 -3
@@ -330,7 +330,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->gtt.mappable, + reloc_page =io_mapping_map_atomic_wc (dev_priv->ggtt.mappable, offset &PAGE_MASK );iowrite32 (lower_32_bits (delta), reloc_page +offset_in_page (offset));
@@ -340,7 +340,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->gtt.mappable, +io_mapping_map_atomic_wc (dev_priv->ggtt.mappable, offset); }
@@ -1504,7 +1504,7 @@ i915_gem_do_execbuffer(struct drm_device *dev, void *data,if (ctx->ppgtt) vm = &ctx->ppgtt->base;else - vm = &dev_priv->gtt.base; + vm = &dev_priv->ggtt.base;memset (¶ms_master,0x00 ,sizeof (params_master));
drivers/gpu/drm/i915/i915_gem_gtt.c +73 -74
345 lines not on this page · raw message
drivers/gpu/drm/i915/i915_gem_gtt.h +4 -5
@@ -339,7 +339,7 @@ struct i915_address_space {* and correct (in cases like swizzling). That region is referred to as GMADR in * the spec. */ -struct i915_gtt { +struct i915_ggtt {struct i915_address_space base;size_t stolen_size;/* Total size of stolen memory */
@@ -357,10 +357,9 @@ struct i915_gtt {int mtrr; -/* global gtt ops */ -int (*gtt_probe)(struct drm_device *dev,u64 *gtt_total, -size_t *stolen,phys_addr_t *mappable_base, -u64 *mappable_end); +int (*probe)(struct drm_device *dev,u64 *gtt_total, +size_t *stolen,phys_addr_t *mappable_base, +u64 *mappable_end); };struct i915_hw_ppgtt {
drivers/gpu/drm/i915/i915_gem_stolen.c +25 -25
173 lines not on this page · raw message
drivers/gpu/drm/i915/i915_gpu_error.c +5 -5
@@ -653,7 +653,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->gtt.mappable_end); + reloc_offset + num_pages *PAGE_SIZE <= dev_priv->ggtt.mappable_end);/* Cannot access stolen address directly, try to use the aperture */ if (src->stolen) {
@@ -663,7 +663,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->gtt.mappable_end) +if (reloc_offset + num_pages *PAGE_SIZE > dev_priv->ggtt.mappable_end) goto unwind; }
@@ -689,7 +689,7 @@ i915_error_object_create(struct drm_i915_private *dev_priv,* captures what the GPU read. */ - s =io_mapping_map_atomic_wc (dev_priv->gtt.mappable, + s =io_mapping_map_atomic_wc (dev_priv->ggtt.mappable, reloc_offset);memcpy_fromio (d, s,PAGE_SIZE );io_mapping_unmap_atomic (s);
@@ -722,7 +722,7 @@ unwind:return NULL ; }#define i915_error_ggtt_object_create (dev_priv, src) \ - i915_error_object_create((dev_priv), (src), &(dev_priv)->gtt.base) + i915_error_object_create((dev_priv), (src), &(dev_priv)->ggtt.base)static void capture_bo (struct drm_i915_error_buffer *err,struct i915_vma *vma)
@@ -1038,7 +1038,7 @@ static void i915_gem_record_rings(struct drm_device *dev, vm = request->ctx && request->ctx->ppgtt ? &request->ctx->ppgtt->base : - &dev_priv->gtt.base; + &dev_priv->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 +7 -7
@@ -181,7 +181,7 @@ 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->gtt.base; +struct i915_address_space *ggtt_vm = &dev_priv->ggtt.base;unsigned long ggtt_vm_end = ggtt_vm->start + ggtt_vm->total;unsigned long mappable_base, mappable_size, mappable_end;
@@ -203,18 +203,18 @@ int intel_vgt_balloon(struct drm_device *dev) unmappable_base, unmappable_size / 1024);if (mappable_base < ggtt_vm->start || - mappable_end > dev_priv->gtt.mappable_end || - unmappable_base < dev_priv->gtt.mappable_end || + mappable_end > dev_priv->ggtt.mappable_end || + unmappable_base < dev_priv->ggtt.mappable_end || unmappable_end > ggtt_vm_end) {DRM_ERROR ("Invalid ballooning configuration!\n" );return -EINVAL ; }/* Unmappable graphic memory ballooning */ -if (unmappable_base > dev_priv->gtt.mappable_end) { +if (unmappable_base > dev_priv->ggtt.mappable_end) { ret =vgt_balloon_space (&ggtt_vm->mm, &bl_info.space[2 ], - dev_priv->gtt.mappable_end, + dev_priv->ggtt.mappable_end, unmappable_base);if (ret)
@@ -244,11 +244,11 @@ int intel_vgt_balloon(struct drm_device *dev) goto err; } -if (mappable_end < dev_priv->gtt.mappable_end) { +if (mappable_end < dev_priv->ggtt.mappable_end) { ret =vgt_balloon_space (&ggtt_vm->mm, &bl_info.space[1 ], mappable_end, - dev_priv->gtt.mappable_end); + dev_priv->ggtt.mappable_end);if (ret) goto err;
drivers/gpu/drm/i915/intel_display.c +2 -2
@@ -2503,7 +2503,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->gtt.stolen_usable_size) +if (size_aligned *2 > dev_priv->ggtt.stolen_usable_size)return false;mutex_lock (&dev->struct_mutex);
@@ -15339,7 +15339,7 @@ void intel_modeset_init(struct drm_device *dev) dev->mode_config.cursor_height =MAX_CURSOR_HEIGHT ; } - dev->mode_config.fb_base = dev_priv->gtt.mappable_base; + dev->mode_config.fb_base = dev_priv->ggtt.mappable_base; DRM_DEBUG_KMS("%d display pipe%s available.\n", INTEL_INFO(dev)->num_pipes,
drivers/gpu/drm/i915/intel_fbc.c +2 -2
@@ -516,9 +516,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->gtt.stolen_size -8 *1024 *1024 ; + end = dev_priv->ggtt.stolen_size -8 *1024 *1024 ;else - end = dev_priv->gtt.stolen_usable_size; + end = dev_priv->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 +3 -3
@@ -146,7 +146,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->gtt.stolen_usable_size) +if (size *2 < dev_priv->ggtt.stolen_usable_size) obj =i915_gem_object_create_stolen (dev, size);if (obj ==NULL ) obj =i915_gem_alloc_object (dev, size);
@@ -244,13 +244,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->gtt.mappable_end; + info->apertures->ranges[0 ].size = dev_priv->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->gtt.mappable_base +i915_gem_obj_ggtt_offset (obj), +ioremap_wc (dev_priv->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 +2 -2
@@ -196,7 +196,7 @@ intel_overlay_map_regs(struct intel_overlay *overlay)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->gtt.mappable, + regs =io_mapping_map_wc (dev_priv->ggtt.mappable,i915_gem_obj_ggtt_offset (overlay->reg_bo));return regs;
@@ -1490,7 +1490,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->gtt.mappable, + regs =io_mapping_map_atomic_wc (dev_priv->ggtt.mappable,i915_gem_obj_ggtt_offset (overlay->reg_bo));return regs;
drivers/gpu/drm/i915/intel_pm.c +5 -5
@@ -4644,9 +4644,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->gtt.stolen_reserved_base) && - (rc6_ctx_base +PAGE_SIZE <= dev_priv->gtt.stolen_reserved_base + - dev_priv->gtt.stolen_reserved_size))) { +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))) {DRM_DEBUG_KMS ("RC6 Base address not as expected.\n" ); enable_rc6 = false; }
@@ -5291,7 +5291,7 @@ static void cherryview_setup_pctx(struct drm_device *dev) {struct drm_i915_private *dev_priv = dev->dev_private;unsigned long pctx_paddr, paddr; -struct i915_gtt *gtt = &dev_priv->gtt; +struct i915_ggtt *ggtt = &dev_priv->ggtt;u32 pcbr;int pctx_size =32 *1024 ;
@@ -5299,7 +5299,7 @@ static void cherryview_setup_pctx(struct drm_device *dev)if ((pcbr >>VLV_PCBR_ADDR_SHIFT ) ==0 ) {DRM_DEBUG_DRIVER ("BIOS didn't set up PCBR, fixing up\n" ); paddr = (dev_priv->mm.stolen_base + - (gtt->stolen_size - pctx_size)); + (ggtt->stolen_size - pctx_size)); pctx_paddr = (paddr & (~4095 ));I915_WRITE (VLV_PCBR , pctx_paddr);
drivers/gpu/drm/i915/intel_ringbuffer.c +1 -1
@@ -2134,7 +2134,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->gtt.mappable_base + + ringbuf->virtual_start =ioremap_wc (dev_priv->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.0 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 2/3] drm/i915: Rename dev_priv->gtt to dev_priv->ggtt
Quoted 2 lines · Joonas Lahtinen
Refer to Global GTT consistencly as GGTT, thus rename
dev_priv->gtttodev_priv->ggttand structi915_gttto structi915_ggtt.
Simple enough mechanical sed, and ggtt is a good name with ggtt vs ppgtt nomenclature.
-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
maintainerPATCH 3/3 drm/i915/gtt: Clean up GGTT probing code
In reply to Joonas LahtinenUse less pointers with the probing code, making it much less confusing to read.
--- drivers/gpu/drm/i915/i915_gem_gtt.c | 100 ++++++++++++++++-------------------- drivers/gpu/drm/i915/i915_gem_gtt.h | 5 +- 2 files changed, 46 insertions(+), 59 deletions(-)
drivers/gpu/drm/i915/i915_gem_gtt.c +44 -56
@@ -3034,20 +3034,16 @@ static void chv_setup_private_ppat(struct drm_i915_private *dev_priv)I915_WRITE (GEN8_PRIVATE_PAT_HI , pat >>32 ); } -static int gen8_gmch_probe (struct drm_device *dev, -u64 *gtt_total, -size_t *stolen, -phys_addr_t *mappable_base, -u64 *mappable_end) +static int gen8_gmch_probe (struct i915_ggtt *ggtt) { +struct drm_device *dev = ggtt->base.dev;struct drm_i915_private *dev_priv = dev->dev_private; -u64 gtt_size;u16 snb_gmch_ctl;int ret;/* TODO: We're not aware of mappable constraints on gen8 yet */ - *mappable_base =pci_resource_start (dev->pdev,2 ); - *mappable_end =pci_resource_len (dev->pdev,2 ); + ggtt->mappable_base =pci_resource_start (dev->pdev,2 ); + ggtt->mappable_end =pci_resource_len (dev->pdev,2 );if (!pci_set_dma_mask (dev->pdev,DMA_BIT_MASK (39 )))pci_set_consistent_dma_mask (dev->pdev,DMA_BIT_MASK (39 ));
@@ -3055,55 +3051,51 @@ static int gen8_gmch_probe(struct drm_device *dev,pci_read_config_word (dev->pdev,SNB_GMCH_CTRL , &snb_gmch_ctl);if (INTEL_INFO (dev)->gen >=9 ) { - *stolen =gen9_get_stolen_size (snb_gmch_ctl); - gtt_size =gen8_get_total_gtt_size (snb_gmch_ctl); + ggtt->stolen_size =gen9_get_stolen_size (snb_gmch_ctl); + ggtt->size =gen8_get_total_gtt_size (snb_gmch_ctl); }else if (IS_CHERRYVIEW (dev)) { - *stolen =chv_get_stolen_size (snb_gmch_ctl); - gtt_size =chv_get_total_gtt_size (snb_gmch_ctl); + ggtt->stolen_size =chv_get_stolen_size (snb_gmch_ctl); + ggtt->size =chv_get_total_gtt_size (snb_gmch_ctl); }else { - *stolen =gen8_get_stolen_size (snb_gmch_ctl); - gtt_size =gen8_get_total_gtt_size (snb_gmch_ctl); + ggtt->stolen_size =gen8_get_stolen_size (snb_gmch_ctl); + ggtt->size =gen8_get_total_gtt_size (snb_gmch_ctl); } - *gtt_total = (gtt_size /sizeof (gen8_pte_t)) <<PAGE_SHIFT ; + ggtt->base.total = (ggtt->size /sizeof (gen8_pte_t)) <<PAGE_SHIFT ;if (IS_CHERRYVIEW (dev) ||IS_BROXTON (dev))chv_setup_private_ppat (dev_priv);else bdw_setup_private_ppat (dev_priv); - ret =ggtt_probe_common (dev, gtt_size); - - dev_priv->ggtt.base.clear_range = gen8_ggtt_clear_range; - dev_priv->ggtt.base.insert_entries = gen8_ggtt_insert_entries; - dev_priv->ggtt.base.bind_vma = ggtt_bind_vma; - dev_priv->ggtt.base.unbind_vma = ggtt_unbind_vma; + ret =ggtt_probe_common (dev, ggtt->size); + ggtt->base.clear_range = gen8_ggtt_clear_range;if (IS_CHERRYVIEW (dev_priv)) - dev_priv->ggtt.base.insert_entries = gen8_ggtt_insert_entries__BKL; + ggtt->base.insert_entries = gen8_ggtt_insert_entries__BKL; +else + ggtt->base.insert_entries = gen8_ggtt_insert_entries; + ggtt->base.bind_vma = ggtt_bind_vma; + ggtt->base.unbind_vma = ggtt_unbind_vma; +return ret; } -static int gen6_gmch_probe (struct drm_device *dev, -u64 *gtt_total, -size_t *stolen, -phys_addr_t *mappable_base, -u64 *mappable_end) +static int gen6_gmch_probe (struct i915_ggtt *ggtt) { -struct drm_i915_private *dev_priv = dev->dev_private; -unsigned int gtt_size; +struct drm_device *dev = ggtt->base.dev;u16 snb_gmch_ctl;int ret; - *mappable_base =pci_resource_start (dev->pdev,2 ); - *mappable_end =pci_resource_len (dev->pdev,2 ); + ggtt->mappable_base =pci_resource_start (dev->pdev,2 ); + ggtt->mappable_end =pci_resource_len (dev->pdev,2 );/* 64/512MB is the current min/max we actually know of, but this is just * a coarse sanity check. */ -if ((*mappable_end < (64 <<20 ) || (*mappable_end > (512 <<20 )))) { -DRM_ERROR ("Unknown GMADR size (%llx)\n" , *mappable_end); +if ((ggtt->mappable_end < (64 <<20 ) || (ggtt->mappable_end > (512 <<20 )))) { +DRM_ERROR ("Unknown GMADR size (%llx)\n" , ggtt->mappable_end);return -ENXIO ; }
@@ -3111,17 +3103,16 @@ static int gen6_gmch_probe(struct drm_device *dev,pci_set_consistent_dma_mask (dev->pdev,DMA_BIT_MASK (40 ));pci_read_config_word (dev->pdev,SNB_GMCH_CTRL , &snb_gmch_ctl); - *stolen =gen6_get_stolen_size (snb_gmch_ctl); - - gtt_size =gen6_get_total_gtt_size (snb_gmch_ctl); - *gtt_total = (gtt_size /sizeof (gen6_pte_t)) <<PAGE_SHIFT ; + ggtt->stolen_size =gen6_get_stolen_size (snb_gmch_ctl); + ggtt->size =gen6_get_total_gtt_size (snb_gmch_ctl); + ggtt->base.total = (ggtt->size /sizeof (gen6_pte_t)) <<PAGE_SHIFT ; - ret =ggtt_probe_common (dev, gtt_size); + ret =ggtt_probe_common (dev, ggtt->size); - dev_priv->ggtt.base.clear_range = gen6_ggtt_clear_range; - dev_priv->ggtt.base.insert_entries = gen6_ggtt_insert_entries; - dev_priv->ggtt.base.bind_vma = ggtt_bind_vma; - dev_priv->ggtt.base.unbind_vma = ggtt_unbind_vma; + ggtt->base.clear_range = gen6_ggtt_clear_range; + ggtt->base.insert_entries = gen6_ggtt_insert_entries; + ggtt->base.bind_vma = ggtt_bind_vma; + ggtt->base.unbind_vma = ggtt_unbind_vma;return ret; }
@@ -3134,12 +3125,9 @@ static void gen6_gmch_remove(struct i915_address_space *vm)free_scratch_page (vm->dev, vm->scratch_page); } -static int i915_gmch_probe (struct drm_device *dev, -u64 *gtt_total, -size_t *stolen, -phys_addr_t *mappable_base, -u64 *mappable_end) +static int i915_gmch_probe (struct i915_ggtt *ggtt) { +struct drm_device *dev = ggtt->base.dev;struct drm_i915_private *dev_priv = dev->dev_private;int ret;
@@ -3149,15 +3137,16 @@ static int i915_gmch_probe(struct drm_device *dev,return -EIO ; } -intel_gtt_get (gtt_total, stolen, mappable_base, mappable_end); +intel_gtt_get (&ggtt->base.total, &ggtt->stolen_size, + &ggtt->mappable_base, &ggtt->mappable_end); - dev_priv->ggtt.do_idle_maps =needs_idle_maps (dev_priv->dev); - dev_priv->ggtt.base.insert_entries = i915_ggtt_insert_entries; - dev_priv->ggtt.base.clear_range = i915_ggtt_clear_range; - dev_priv->ggtt.base.bind_vma = ggtt_bind_vma; - dev_priv->ggtt.base.unbind_vma = ggtt_unbind_vma; + ggtt->do_idle_maps =needs_idle_maps (dev_priv->dev); + ggtt->base.insert_entries = i915_ggtt_insert_entries; + ggtt->base.clear_range = i915_ggtt_clear_range; + ggtt->base.bind_vma = ggtt_bind_vma; + ggtt->base.unbind_vma = ggtt_unbind_vma; -if (unlikely (dev_priv->ggtt.do_idle_maps)) +if (unlikely (ggtt->do_idle_maps))DRM_INFO ("applying Ironlake quirks for intel_iommu\n" );return 0 ;
@@ -3198,8 +3187,7 @@ int i915_gem_gtt_init(struct drm_device *dev) ggtt->base.dev = dev; ggtt->base.is_ggtt = true; - ret = ggtt->probe (dev, &ggtt->base.total, &ggtt->stolen_size, - &ggtt->mappable_base, &ggtt->mappable_end); + ret = ggtt->probe (ggtt);if (ret)return ret;
drivers/gpu/drm/i915/i915_gem_gtt.h +2 -3
@@ -346,6 +346,7 @@ struct i915_ggtt {size_t stolen_usable_size;/* Total size minus BIOS reserved */ size_t stolen_reserved_base;size_t stolen_reserved_size; +size_t size;/* Total size of Global GTT */ u64 mappable_end;/* End offset that we can CPU map */ struct io_mapping *mappable;/* Mapping to our CPU mappable region */ phys_addr_t mappable_base;/* PA of our GMADR */
@@ -357,9 +358,7 @@ struct i915_ggtt {int mtrr; -int (*probe)(struct drm_device *dev,u64 *gtt_total, -size_t *stolen,phys_addr_t *mappable_base, -u64 *mappable_end); +int (*probe)(struct i915_ggtt *ggtt); };struct i915_hw_ppgtt {
Signature · 6 lines
2.5.0 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 3/3] drm/i915/gtt: Clean up GGTT probing code
Quoted 5 lines · Joonas Lahtinen
Use less pointers with the probing code, making it much less confusing to read.
Cc Mika Kuoppala <[email protected]>Signed-off-by Joonas Lahtinen <[email protected]>
Reasonable first step. I have something very similar sitting around waiting for a good home. Next couple of steps would be to eliminate the use-once vfunc and rearrange the device detection.
-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 4 lines · Joonas Lahtinen
Reference variable value from pointer, not assumed pointer destination.
Since:
Quoted 8 lines
commit
c44ef60e437019b8ca1dab8b4d2e8761fd4ce1e9Author: Mika Kuoppala <[email protected]> Date: Thu Jun 25 18:35:05 2015 +0300drm/i915/gtt: Allow >= 4GB sizes for vm.
Cc Mika Kuoppala <[email protected]>Signed-off-by Joonas Lahtinen <[email protected]>
That reminds, could you pull
https://cgit.freedesktop.org/~ickle/linux-2.6/commit/?h=breadcrumbs&id=8ecc77b5864d4911e9fb9b92be8b2e98c3f2261f
[drm/i915: Codify our assumption that the Global GTT is <= 4GiB]
into this series?
-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 14 lines · Chris Wilson
Quoted 5 lines · Joonas Lahtinen
Reference variable value from pointer, not assumed pointer destination.
Since:
Quoted 8 lines
commit
c44ef60e437019b8ca1dab8b4d2e8761fd4ce1e9
Author: Mika Kuoppala <[email protected]> Date: Thu Jun 25 18:35:05 2015 +0300drm/i915/gtt: Allow >= 4GB sizes for vm.
Cc Mika Kuoppala <[email protected]>Signed-off-by Joonas Lahtinen <[email protected]>
Quoted 8 lines
Reviewed-by Chris Wilson <[email protected]>That reminds, could you pull
https://cgit.freedesktop.org/~ickle/linux-2.6/commit/?h=breadcrumbs&id=8ecc77b5864d4911e9fb9b92be8b2e98c3f2261f
[drm/i915: Codify our assumption that the Global GTT is <= 4GiB]into this series?
Done, sent series v2 with one typo fix and that patch rebased (and tweaked 1ull -> 1ULL).
So if somebody would review the new patch, we're good to merge.
Regards, Joonas
Quoted 2 lines
-Chris
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 22 lines · Joonas Lahtinen
Quoted 21 lines · Chris Wilson
Quoted 5 lines · Joonas Lahtinen
Reference variable value from pointer, not assumed pointer destination.
Since:
Quoted 8 lines
commit
c44ef60e437019b8ca1dab8b4d2e8761fd4ce1e9
Author: Mika Kuoppala <[email protected]> Date: Thu Jun 25 18:35:05 2015 +0300drm/i915/gtt: Allow >= 4GB sizes for vm.
Cc Mika Kuoppala <[email protected]>Signed-off-by Joonas Lahtinen <[email protected]>Reviewed-by Chris Wilson <[email protected]>That reminds, could you pull
https://cgit.freedesktop.org/~ickle/linux-2.6/commit/?h=breadcrumbs&id=8ecc77b5864d4911e9fb9b92be8b2e98c3f2261f
[drm/i915: Codify our assumption that the Global GTT is <= 4GiB]
Quoted 6 lines
Quoted 1 line
into this series?
Done, sent series v2 with one typo fix and that patch rebased (and tweaked 1ull -> 1ULL).
So if somebody would review the new patch, we're good to merge.
Patch is wrong Chris, you can review it, and then push the entire pile
Congrats to volunteering ;-)
-Daniel
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 23 lines · Daniel Vetter
Quoted 22 lines · Joonas Lahtinen
Quoted 21 lines · Chris Wilson
Quoted 5 lines · Joonas Lahtinen
Reference variable value from pointer, not assumed pointer destination.
Since:
Quoted 8 lines
commit
c44ef60e437019b8ca1dab8b4d2e8761fd4ce1e9
Author: Mika Kuoppala <[email protected]> Date: Thu Jun 25 18:35:05 2015 +0300drm/i915/gtt: Allow >= 4GB sizes for vm.
Cc Mika Kuoppala <[email protected]>Signed-off-by Joonas Lahtinen <[email protected]>Reviewed-by Chris Wilson <[email protected]>That reminds, could you pull
https://cgit.freedesktop.org/~ickle/linux-2.6/commit/?h=breadcrumbs&id=8ecc77b5864d4911e9fb9b92be8b2e98c3f2261f
[drm/i915: Codify our assumption that the Global GTT is <= 4GiB]
Quoted 8 lines
Quoted 6 lines
Quoted 1 line
into this series?
Done, sent series v2 with one typo fix and that patch rebased (and tweaked 1ull -> 1ULL).
So if somebody would review the new patch, we're good to merge.
Patch is wrong Chris, you can review it, and then push the entire pile
Which patch? The only one outstanding is my suggestion to add the WARN. -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 26 lines · Chris Wilson
Quoted 25 lines · Daniel Vetter
Quoted 24 lines · Joonas Lahtinen
Quoted 22 lines · Chris Wilson
Quoted 5 lines · Joonas Lahtinen
Reference variable value from pointer, not assumed pointer destination.
Since:
Quoted 8 lines
commit
c44ef60e437019b8ca1dab8b4d2e8761fd4ce1e9
Author: Mika Kuoppala <[email protected]> Date: Thu Jun 25 18:35:05 2015 +0300drm/i915/gtt: Allow >= 4GB sizes for vm.
Cc Mika Kuoppala <[email protected]>Signed-off-by Joonas Lahtinen <[email protected]>Reviewed-by Chris Wilson <[email protected]>That reminds, could you pull
https://cgit.freedesktop.org/~ickle/linux-2.6/commit/?h=breadcrumbs&id=8ecc77b5864d4911e9fb9b92be8b2e98c3f2261f
[drm/i915: Codify our assumption that the Global GTT is <= 4GiB]into this series?
Quoted 8 lines
Quoted 6 lines
Quoted 4 lines
Done, sent series v2 with one typo fix and that patch rebased (and tweaked 1ull -> 1ULL).
So if somebody would review the new patch, we're good to merge.
Patch is wrong Chris, you can review it, and then push the entire pile
Which patch? The only one outstanding is my suggestion to add the WARN.
s/wrong/from/ ... I can't type :( And yeah I missed that it landed already ;-)
Cheers, Daniel
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ 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/3] drm/i915/gtt: Reference mappable_end variable from pointer
In reply to Joonas Lahtinen== Series Details ==
== Series Details ==
Series: series starting with [1/3] drm/i915/gtt: Reference mappable_end variable from pointer
URL : https://patchwork.freedesktop.org/series/4618/
State : warning
== Summary ==
Series 4618v1 Series without cover letter
http://patchwork.freedesktop.org/api/1.0/series/4618/revisions/1/mbox/
Test gem_sync:
Subgroup basic-bsd:
dmesg-fail -> PASS (ilk-hp8440p)
Test kms_flip:
Subgroup basic-flip-vs-modeset:
pass -> DMESG-WARN (ilk-hp8440p) UNSTABLE
Subgroup basic-flip-vs-wf_vblank:
dmesg-warn -> PASS (hsw-brixbox)
Subgroup basic-plain-flip:
pass -> DMESG-WARN (skl-nuci5)
pass -> DMESG-WARN (hsw-brixbox)
Test kms_pipe_crc_basic:
Subgroup read-crc-pipe-b:
pass -> DMESG-WARN (hsw-brixbox)
Subgroup suspend-read-crc-pipe-a:
skip -> PASS (hsw-gt2)
Subgroup suspend-read-crc-pipe-c:
skip -> PASS (hsw-gt2)bdw-nuci7 total:194 pass:181 dwarn:1 dfail:0 fail:0 skip:12 bdw-ultra total:194 pass:172 dwarn:1 dfail:0 fail:0 skip:21 bsw-nuc-2 total:194 pass:156 dwarn:1 dfail:0 fail:0 skip:37 hsw-brixbox total:194 pass:169 dwarn:3 dfail:0 fail:0 skip:22 hsw-gt2 total:194 pass:176 dwarn:1 dfail:0 fail:0 skip:17 ilk-hp8440p total:194 pass:129 dwarn:2 dfail:0 fail:0 skip:63 ivb-t430s total:194 pass:168 dwarn:1 dfail:0 fail:0 skip:25 skl-i5k-2 total:194 pass:170 dwarn:1 dfail:0 fail:0 skip:23 skl-i7k-2 total:194 pass:170 dwarn:1 dfail:0 fail:0 skip:23 skl-nuci5 total:194 pass:181 dwarn:2 dfail:0 fail:0 skip:11 snb-dellxps total:194 pass:158 dwarn:2 dfail:0 fail:0 skip:34
Results at /archive/results/CI_IGT_test/Patchwork_1640/
5eae5b23e137dee059f6a9a104ce59a0552ddaa8 drm-intel-nightly: 2016y-03m-18d-10h-29m-49s UTC integration manifest c27fbdad28f945be9aede4a72fac18993981fa5c drm/i915/gtt: Clean up GGTT probing code d347579298226bbde0ce88b8799891ed1fe52cbd drm/i915: Rename dev_priv->gtt to dev_priv->ggtt 7f677773b76cdc4c681e2a8f3e616d68cdf597d6 drm/i915/gtt: Reference mappable_end variable from pointer
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx