agp/intel: Rename intel-gtt symbols
Subsystems (3)
PATCH 1/2 agp/intel: Rename intel-gtt symbols
Exporting the symbols like intel_gtt_* creates some confusion inside i915 that has symbols named similarly. In an attempt to isolate platforms needing intel-gtt.ko, commit 7a5c922377b4 ("drm/i915/gt: Split intel-gtt functions by arch") moved way too much
inside gt/intel_gt_gmch.c, even the functions that don't callout to this module. Rename the symbols to make the separation clear.
--- drivers/char/agp/intel-gtt.c | 58 ++++++++++++------------- drivers/gpu/drm/i915/gt/intel_gt_gmch.c | 16 +++---- include/drm/intel-gtt.h | 24 +++++----- 3 files changed, 49 insertions(+), 49 deletions(-)
drivers/char/agp/intel-gtt.c +29 -29
@@ -744,7 +744,7 @@ static void i830_write_entry(dma_addr_t addr, unsigned int entry,writel_relaxed (addr | pte_flags, intel_private.gtt + entry); } -bool intel_enable_gtt (void ) +bool intel_gmch_enable_gtt (void ) {u8 __iomem *reg;
@@ -787,7 +787,7 @@ bool intel_enable_gtt(void)return true; } -EXPORT_SYMBOL (intel_enable_gtt); +EXPORT_SYMBOL (intel_gmch_enable_gtt);static int i830_setup (void ) {
@@ -821,8 +821,8 @@ static int intel_fake_agp_free_gatt_table(struct agp_bridge_data *bridge)static int intel_fake_agp_configure (void ) { -if (!intel_enable_gtt ()) -return -EIO ; +if (!intel_gmch_enable_gtt ()) +return -EIO ; intel_private.clear_fake_agp = true; agp_bridge->gart_bus_addr = intel_private.gma_bus_addr;
@@ -844,20 +844,20 @@ static bool i830_check_flags(unsigned int flags)return false; } -void intel_gtt_insert_page (dma_addr_t addr, -unsigned int pg, -unsigned int flags) +void intel_gmch_gtt_insert_page (dma_addr_t addr, +unsigned int pg, +unsigned int flags) { intel_private.driver->write_entry (addr, pg, flags);readl (intel_private.gtt + pg);if (intel_private.driver->chipset_flush) intel_private.driver->chipset_flush (); } -EXPORT_SYMBOL (intel_gtt_insert_page); +EXPORT_SYMBOL (intel_gmch_gtt_insert_page); -void intel_gtt_insert_sg_entries (struct sg_table *st, -unsigned int pg_start, -unsigned int flags) +void intel_gmch_gtt_insert_sg_entries (struct sg_table *st, +unsigned int pg_start, +unsigned int flags) {struct scatterlist *sg;unsigned int len, m;
@@ -879,13 +879,13 @@ void intel_gtt_insert_sg_entries(struct sg_table *st,if (intel_private.driver->chipset_flush) intel_private.driver->chipset_flush (); } -EXPORT_SYMBOL (intel_gtt_insert_sg_entries); +EXPORT_SYMBOL (intel_gmch_gtt_insert_sg_entries);#if IS_ENABLED (CONFIG_AGP_INTEL ) -static void intel_gtt_insert_pages (unsigned int first_entry, -unsigned int num_entries, -struct page **pages, -unsigned int flags) +static void intel_gmch_gtt_insert_pages (unsigned int first_entry, +unsigned int num_entries, +struct page **pages, +unsigned int flags) {int i, j;
@@ -905,7 +905,7 @@ static int intel_fake_agp_insert_entries(struct agp_memory *mem,if (intel_private.clear_fake_agp) {int start = intel_private.stolen_size /PAGE_SIZE ;int end = intel_private.gtt_mappable_entries; -intel_gtt_clear_range (start, end - start); +intel_gmch_gtt_clear_range (start, end - start); intel_private.clear_fake_agp = false; }
@@ -934,12 +934,12 @@ static int intel_fake_agp_insert_entries(struct agp_memory *mem,if (ret !=0 )return ret; -intel_gtt_insert_sg_entries (&st, pg_start, type); +intel_gmch_gtt_insert_sg_entries (&st, pg_start, type); mem->sg_list = st.sgl; mem->num_sg = st.nents; }else -intel_gtt_insert_pages (pg_start, mem->page_count, mem->pages, - type); +intel_gmch_gtt_insert_pages (pg_start, mem->page_count, mem->pages, + type); out: ret =0 ;
@@ -949,7 +949,7 @@ static int intel_fake_agp_insert_entries(struct agp_memory *mem, }#endif -void intel_gtt_clear_range (unsigned int first_entry,unsigned int num_entries) +void intel_gmch_gtt_clear_range (unsigned int first_entry,unsigned int num_entries) {unsigned int i;
@@ -959,7 +959,7 @@ void intel_gtt_clear_range(unsigned int first_entry, unsigned int num_entries) }wmb (); } -EXPORT_SYMBOL (intel_gtt_clear_range); +EXPORT_SYMBOL (intel_gmch_gtt_clear_range);#if IS_ENABLED (CONFIG_AGP_INTEL ) static int intel_fake_agp_remove_entries(struct agp_memory *mem,
@@ -968,7 +968,7 @@ static int intel_fake_agp_remove_entries(struct agp_memory *mem,if (mem->page_count ==0 )return 0 ; -intel_gtt_clear_range (pg_start, mem->page_count); +intel_gmch_gtt_clear_range (pg_start, mem->page_count);if (intel_private.needs_dmar) {intel_gtt_unmap_memory (mem->sg_list, mem->num_sg);
@@ -1431,22 +1431,22 @@ int intel_gmch_probe(struct pci_dev *bridge_pdev, struct pci_dev *gpu_pdev, }EXPORT_SYMBOL (intel_gmch_probe); -void intel_gtt_get (u64 *gtt_total, -phys_addr_t *mappable_base, -resource_size_t *mappable_end) +void intel_gmch_gtt_get (u64 *gtt_total, +phys_addr_t *mappable_base, +resource_size_t *mappable_end) { *gtt_total = intel_private.gtt_total_entries <<PAGE_SHIFT ; *mappable_base = intel_private.gma_bus_addr; *mappable_end = intel_private.gtt_mappable_entries <<PAGE_SHIFT ; } -EXPORT_SYMBOL (intel_gtt_get); +EXPORT_SYMBOL (intel_gmch_gtt_get); -void intel_gtt_chipset_flush (void ) +void intel_gmch_gtt_flush (void ) {if (intel_private.driver->chipset_flush) intel_private.driver->chipset_flush (); } -EXPORT_SYMBOL (intel_gtt_chipset_flush); +EXPORT_SYMBOL (intel_gmch_gtt_flush);void intel_gmch_remove (void ) {
drivers/gpu/drm/i915/gt/intel_gt_gmch.c +8 -8
@@ -134,7 +134,7 @@ static void gen5_ggtt_insert_page(struct i915_address_space *vm,unsigned int flags = (cache_level ==I915_CACHE_NONE ) ?AGP_USER_MEMORY :AGP_USER_CACHED_MEMORY ; -intel_gtt_insert_page (addr, offset >>PAGE_SHIFT , flags); +intel_gmch_gtt_insert_page (addr, offset >>PAGE_SHIFT , flags); } static void gen6_ggtt_insert_page(struct i915_address_space *vm,
@@ -175,8 +175,8 @@ static void gen5_ggtt_insert_entries(struct i915_address_space *vm,unsigned int flags = (cache_level ==I915_CACHE_NONE ) ?AGP_USER_MEMORY :AGP_USER_CACHED_MEMORY ; -intel_gtt_insert_sg_entries (vma_res->bi.pages, vma_res->start >>PAGE_SHIFT , - flags); +intel_gmch_gtt_insert_sg_entries (vma_res->bi.pages, vma_res->start >>PAGE_SHIFT , + flags); }/*
@@ -306,18 +306,18 @@ static void bxt_vtd_ggtt_insert_entries__BKL(struct i915_address_space *vm,void intel_gt_gmch_gen5_chipset_flush (struct intel_gt *gt) { -intel_gtt_chipset_flush (); +intel_gmch_gtt_flush (); }static void gmch_ggtt_invalidate (struct i915_ggtt *ggtt) { -intel_gtt_chipset_flush (); +intel_gmch_gtt_flush (); }static void gen5_ggtt_clear_range (struct i915_address_space *vm,u64 start,u64 length) { -intel_gtt_clear_range (start >>PAGE_SHIFT , length >>PAGE_SHIFT ); +intel_gmch_gtt_clear_range (start >>PAGE_SHIFT , length >>PAGE_SHIFT ); } static void gen6_ggtt_clear_range(struct i915_address_space *vm,
@@ -494,7 +494,7 @@ int intel_gt_gmch_gen5_probe(struct i915_ggtt *ggtt)return -EIO ; } -intel_gtt_get (&ggtt->vm.total, &gmadr_base, &ggtt->mappable_end); +intel_gmch_gtt_get (&ggtt->vm.total, &gmadr_base, &ggtt->mappable_end); ggtt->gmadr = (struct resource )DEFINE_RES_MEM (gmadr_base, ggtt->mappable_end);
@@ -647,7 +647,7 @@ int intel_gt_gmch_gen8_probe(struct i915_ggtt *ggtt)int intel_gt_gmch_gen5_enable_hw (struct drm_i915_private *i915) { -if (GRAPHICS_VER (i915) <6 && !intel_enable_gtt ()) +if (GRAPHICS_VER (i915) <6 && !intel_gmch_enable_gtt ())return -EIO ;return 0 ;
include/drm/intel-gtt.h +12 -12
@@ -10,24 +10,24 @@ struct agp_bridge_data;struct pci_dev ;struct sg_table ; -void intel_gtt_get (u64 *gtt_total, -phys_addr_t *mappable_base, -resource_size_t *mappable_end); +void intel_gmch_gtt_get (u64 *gtt_total, +phys_addr_t *mappable_base, +resource_size_t *mappable_end);int intel_gmch_probe (struct pci_dev *bridge_pdev,struct pci_dev *gpu_pdev,struct agp_bridge_data *bridge);void intel_gmch_remove (void ); -bool intel_enable_gtt (void ); +bool intel_gmch_enable_gtt (void ); -void intel_gtt_chipset_flush (void ); -void intel_gtt_insert_page (dma_addr_t addr, -unsigned int pg, -unsigned int flags); -void intel_gtt_insert_sg_entries (struct sg_table *st, -unsigned int pg_start, -unsigned int flags); -void intel_gtt_clear_range (unsigned int first_entry,unsigned int num_entries); +void intel_gmch_gtt_flush (void ); +void intel_gmch_gtt_insert_page (dma_addr_t addr, +unsigned int pg, +unsigned int flags); +void intel_gmch_gtt_insert_sg_entries (struct sg_table *st, +unsigned int pg_start, +unsigned int flags); +void intel_gmch_gtt_clear_range (unsigned int first_entry,unsigned int num_entries);/* Special gtt memory types */ #define AGP_DCACHE_MEMORY 1
Signature · 1 line
2.36.1
PATCH 2/2 drm/i915/gt: Re-do the intel-gtt split
Re-do what was attempted in commit 7a5c922377b4 ("drm/i915/gt: Split intel-gtt functions by arch"). The goal of that commit was to split the handlers for older hardware that depend on intel-gtt.ko so i915 can be built for non-x86 archs, after some more patches. Other archs do not need intel-gtt.ko.
Main issue with the previous approach: it moved all the hooks, including the gen8, which is used by all platforms gen8 and newer. Re-do the split moving only the handlers for gen < 6, which are the only ones calling out to the separate module.
--- drivers/gpu/drm/i915/Makefile | 2 +- drivers/gpu/drm/i915/gt/intel_ggtt.c | 559 +++++++++++++++++- drivers/gpu/drm/i915/gt/intel_ggtt_gmch.c | 132 +++++ drivers/gpu/drm/i915/gt/intel_ggtt_gmch.h | 27 + drivers/gpu/drm/i915/gt/intel_gt.c | 5 +- drivers/gpu/drm/i915/gt/intel_gt.h | 9 - drivers/gpu/drm/i915/gt/intel_gt_gmch.c | 654 ---------------------- drivers/gpu/drm/i915/gt/intel_gt_gmch.h | 46 -- drivers/gpu/drm/i915/gt/intel_gtt.h | 12 +- 9 files changed, 713 insertions(+), 733 deletions(-) create mode 100644 drivers/gpu/drm/i915/gt/intel_ggtt_gmch.c create mode 100644 drivers/gpu/drm/i915/gt/intel_ggtt_gmch.h delete mode 100644 drivers/gpu/drm/i915/gt/intel_gt_gmch.c delete mode 100644 drivers/gpu/drm/i915/gt/intel_gt_gmch.h
drivers/gpu/drm/i915/Makefile +1 -1
@@ -129,7 +129,7 @@ gt-y += \ gt/shmem_utils.o \ gt/sysfs_engines.o # x86 intel-gtt module support -gt-$(CONFIG_X86) += gt/intel_gt_gmch.o +gt-$(CONFIG_X86) += gt/intel_ggtt_gmch.o # autogenerated null render state gt-y += \ gt/gen6_renderstate.o \
drivers/gpu/drm/i915/gt/intel_ggtt.c +545 -14
617 lines not on this page · raw message
drivers/gpu/drm/i915/gt/intel_ggtt_gmch.c new file +132 -0
132 lines not on this page · raw message
drivers/gpu/drm/i915/gt/intel_ggtt_gmch.h new file +27 -0
@@ -0,0 +1,27 @@ +/* SPDX-License-Identifier: MIT */ +/* +* Copyright © 2022 Intel Corporation +*/ + +#ifndef __INTEL_GGTT_GMCH_H__ +#define __INTEL_GGTT_GMCH_H__ + +#include "intel_gtt.h" + +/* For x86 platforms */ +#if IS_ENABLED (CONFIG_X86 ) + +void intel_ggtt_gmch_flush (void ); +int intel_ggtt_gmch_enable_hw (struct drm_i915_private *i915); +int intel_ggtt_gmch_probe (struct i915_ggtt *ggtt); + +/* Stubs for non-x86 platforms */ +#else + +static inline void intel_ggtt_gmch_flush (void ) { } +static inline int intel_ggtt_gmch_enable_hw (struct drm_i915_private *i915) {return -ENODEV ; } +static inline int intel_ggtt_gmch_probe (struct i915_ggtt *ggtt) {return -ENODEV ; } + +#endif + +#endif /* __INTEL_GGTT_GMCH_H__ */
drivers/gpu/drm/i915/gt/intel_gt.c +3 -2
@@ -4,6 +4,7 @@*/ #include <drm/drm_managed.h> +#include <drm/intel-gtt.h> #include "gem/i915_gem_internal.h" #include "gem/i915_gem_lmem.h"
@@ -12,11 +13,11 @@#include "i915_drv.h" #include "intel_context.h" #include "intel_engine_regs.h" +#include "intel_ggtt_gmch.h" #include "intel_gt.h" #include "intel_gt_buffer_pool.h" #include "intel_gt_clock_utils.h" #include "intel_gt_debugfs.h" -#include "intel_gt_gmch.h" #include "intel_gt_pm.h" #include "intel_gt_regs.h" #include "intel_gt_requests.h"
@@ -480,7 +481,7 @@ void intel_gt_chipset_flush(struct intel_gt *gt) {wmb ();if (GRAPHICS_VER (gt->i915) <6 ) -intel_gt_gmch_gen5_chipset_flush (gt); +intel_ggtt_gmch_flush (); }void intel_gt_driver_register (struct intel_gt *gt)
drivers/gpu/drm/i915/gt/intel_gt.h +0 -9
@@ -13,13 +13,6 @@struct drm_i915_private ;struct drm_printer ; -struct insert_entries { -struct i915_address_space *vm; -struct i915_vma_resource *vma_res; -enum i915_cache_level level; -u32 flags; -}; -#define GT_TRACE (gt, fmt, ...) do { \ const struct intel_gt *gt__ __maybe_unused = (gt); \ GEM_TRACE("%s " fmt, dev_name(gt__->i915->drm.dev), \
@@ -125,6 +118,4 @@ void intel_gt_watchdog_work(struct work_struct *work);void intel_gt_invalidate_tlbs (struct intel_gt *gt); -struct resource intel_pci_resource (struct pci_dev *pdev,int bar); -#endif /* __INTEL_GT_H__ */
drivers/gpu/drm/i915/gt/intel_gt_gmch.c deleted +0 -654
654 lines not on this page · raw message
drivers/gpu/drm/i915/gt/intel_gt_gmch.h deleted +0 -46
46 lines not on this page · raw message
drivers/gpu/drm/i915/gt/intel_gtt.h +5 -7
@@ -548,14 +548,13 @@ i915_page_dir_dma_addr(const struct i915_ppgtt *ppgtt, const unsigned int n)void ppgtt_init (struct i915_ppgtt *ppgtt,struct intel_gt *gt,unsigned long lmem_pt_obj_flags); -void intel_ggtt_bind_vma (struct i915_address_space *vm, -struct i915_vm_pt_stash *stash, -struct i915_vma_resource *vma_res, -enum i915_cache_level cache_level, -u32 flags); +struct i915_vm_pt_stash *stash, +struct i915_vma_resource *vma_res, +enum i915_cache_level cache_level, +u32 flags);void intel_ggtt_unbind_vma (struct i915_address_space *vm, -struct i915_vma_resource *vma_res); +struct i915_vma_resource *vma_res);int i915_ggtt_probe_hw (struct drm_i915_private *i915);int i915_ggtt_init_hw (struct drm_i915_private *i915);
@@ -627,7 +626,6 @@ release_pd_entry(struct i915_page_directory * const pd,struct i915_page_table *const pt, const struct drm_i915_gem_object * const scratch);void gen6_ggtt_invalidate (struct i915_ggtt *ggtt); -void gen8_ggtt_invalidate (struct i915_ggtt *ggtt); void ppgtt_bind_vma(struct i915_address_space *vm, struct i915_vm_pt_stash *stash,
Signature · 1 line
2.36.1
Re: [PATCH 2/2] drm/i915/gt: Re-do the intel-gtt split
Quoted 10 lines · Lucas De Marchi
Re-do what was attempted in commit
7a5c922377b4("drm/i915/gt: Split intel-gtt functions by arch"). The goal of that commit was to split the handlers for older hardware that depend on intel-gtt.ko so i915 can be built for non-x86 archs, after some more patches. Other archs do not need intel-gtt.ko.Main issue with the previous approach: it moved all the hooks, including the gen8, which is used by all platforms gen8 and newer. Re-do the split moving only the handlers for gen < 6, which are the only ones calling out to the separate module.
Indeed way too much.. where I was looking at..
Quoted 815 lines
Signed-off-by Lucas De Marchi <[email protected]>--- drivers/gpu/drm/i915/Makefile | 2 +- drivers/gpu/drm/i915/gt/intel_ggtt.c | 559 +++++++++++++++++- drivers/gpu/drm/i915/gt/intel_ggtt_gmch.c | 132 +++++ drivers/gpu/drm/i915/gt/intel_ggtt_gmch.h | 27 + drivers/gpu/drm/i915/gt/intel_gt.c | 5 +- drivers/gpu/drm/i915/gt/intel_gt.h | 9 - drivers/gpu/drm/i915/gt/intel_gt_gmch.c | 654 ---------------------- drivers/gpu/drm/i915/gt/intel_gt_gmch.h | 46 -- drivers/gpu/drm/i915/gt/intel_gtt.h | 12 +- 9 files changed, 713 insertions(+), 733 deletions(-)create mode 100644
drivers/gpu/drm/i915/gt/intel_ggtt_gmch.ccreate mode 100644drivers/gpu/drm/i915/gt/intel_ggtt_gmch.hdelete mode 100644drivers/gpu/drm/i915/gt/intel_gt_gmch.cdelete mode 100644drivers/gpu/drm/i915/gt/intel_gt_gmch.hdrivers/gpu/drm/i915/Makefile +1
-1@@ -129,7 +129,7 @@ gt-y += \ gt/shmem_utils.o \ gt/sysfs_engines.o # x86 intel-gtt module support -gt-$(CONFIG_X86) += gt/intel_gt_gmch.o +gt-$(CONFIG_X86) += gt/intel_ggtt_gmch.o # autogenerated null render state gt-y += \ gt/gen6_renderstate.o \drivers/gpu/drm/i915/gt/intel_ggtt.c +545
-14@@ -3,16 +3,18 @@* Copyright © 2020 Intel Corporation */ -#include <linux/types.h> #include <asm/set_memory.h> #include <asm/smp.h> +#include <linux/types.h> +#include <linux/stop_machine.h> #include <drm/i915_drm.h> +#include <drm/intel-gtt.h> #include "gem/i915_gem_lmem.h" +#include "intel_ggtt_gmch.h" #include "intel_gt.h" -#include "intel_gt_gmch.h" #include "intel_gt_regs.h" #include "i915_drv.h" #include "i915_scatterlist.h" @@ -181,7 +183,7 @@ void gen6_ggtt_invalidate(struct i915_ggtt *ggtt)spin_unlock_irq (&uncore->lock); } -void gen8_ggtt_invalidate (struct i915_ggtt *ggtt) +static void gen8_ggtt_invalidate (struct i915_ggtt *ggtt) {struct intel_uncore *uncore = ggtt->vm.gt->uncore;@@ -218,11 +220,232 @@ u64 gen8_ggtt_pte_encode(dma_addr_t addr,return pte; } +static void gen8_set_pte (void __iomem *addr,gen8_pte_t pte) +{ +writeq (pte, addr); +} + +static void gen8_ggtt_insert_page (struct i915_address_space *vm, +dma_addr_t addr, +u64 offset, +enum i915_cache_level level, +u32 flags) +{ +struct i915_ggtt *ggtt =i915_vm_to_ggtt (vm); +gen8_pte_t __iomem *pte = + (gen8_pte_t __iomem *)ggtt->gsm + offset /I915_GTT_PAGE_SIZE ; + +gen8_set_pte (pte,gen8_ggtt_pte_encode (addr, level, flags)); + + ggtt->invalidate (ggtt); +} + +static void gen8_ggtt_insert_entries (struct i915_address_space *vm, +struct i915_vma_resource *vma_res, +enum i915_cache_level level, +u32 flags) +{ +const gen8_pte_t pte_encode =gen8_ggtt_pte_encode (0 , level, flags); +struct i915_ggtt *ggtt =i915_vm_to_ggtt (vm); +gen8_pte_t __iomem *gte; +gen8_pte_t __iomem *end; +struct sgt_iter iter; +dma_addr_t addr; + +/* +* Note that we ignore PTE_READ_ONLY here. The caller must be careful +* not to allow the user to override access to a read only page. +*/ + + gte = (gen8_pte_t __iomem *)ggtt->gsm; + gte += vma_res->start /I915_GTT_PAGE_SIZE ; + end = gte + vma_res->node_size /I915_GTT_PAGE_SIZE ; + +for_each_sgt_daddr (addr, iter, vma_res->bi.pages) +gen8_set_pte (gte++, pte_encode | addr); +GEM_BUG_ON (gte > end); + +/* Fill the allocated but "unused" space beyond the end of the buffer */ +while (gte < end) +gen8_set_pte (gte++, vm->scratch[0 ]->encode); + +/* +* We want to flush the TLBs only after we're certain all the PTE +* updates have finished. +*/ + ggtt->invalidate (ggtt); +} + +static void gen6_ggtt_insert_page (struct i915_address_space *vm, +dma_addr_t addr, +u64 offset, +enum i915_cache_level level, +u32 flags) +{ +struct i915_ggtt *ggtt =i915_vm_to_ggtt (vm); +gen6_pte_t __iomem *pte = + (gen6_pte_t __iomem *)ggtt->gsm + offset /I915_GTT_PAGE_SIZE ; + +iowrite32 (vm->pte_encode (addr, level, flags), pte); + + ggtt->invalidate (ggtt); +} + +/* +* Binds an object into the global gtt with the specified cache level. +* The object will be accessible to the GPU via commands whose operands +* reference offsets within the global GTT as well as accessible by the GPU +* through the GMADR mapped BAR (i915->mm.gtt->gtt). +*/ +static void gen6_ggtt_insert_entries (struct i915_address_space *vm, +struct i915_vma_resource *vma_res, +enum i915_cache_level level, +u32 flags) +{ +struct i915_ggtt *ggtt =i915_vm_to_ggtt (vm); +gen6_pte_t __iomem *gte; +gen6_pte_t __iomem *end; +struct sgt_iter iter; +dma_addr_t addr; + + gte = (gen6_pte_t __iomem *)ggtt->gsm; + gte += vma_res->start /I915_GTT_PAGE_SIZE ; + end = gte + vma_res->node_size /I915_GTT_PAGE_SIZE ; + +for_each_sgt_daddr (addr, iter, vma_res->bi.pages) +iowrite32 (vm->pte_encode (addr, level, flags), gte++); +GEM_BUG_ON (gte > end); + +/* Fill the allocated but "unused" space beyond the end of the buffer */ +while (gte < end) +iowrite32 (vm->scratch[0 ]->encode, gte++); + +/* +* We want to flush the TLBs only after we're certain all the PTE +* updates have finished. +*/ + ggtt->invalidate (ggtt); +} + +static void nop_clear_range (struct i915_address_space *vm, +u64 start,u64 length) +{ +} + +static void gen8_ggtt_clear_range (struct i915_address_space *vm, +u64 start,u64 length) +{ +struct i915_ggtt *ggtt =i915_vm_to_ggtt (vm); +unsigned int first_entry = start /I915_GTT_PAGE_SIZE ; +unsigned int num_entries = length /I915_GTT_PAGE_SIZE ; +const gen8_pte_t scratch_pte = vm->scratch[0 ]->encode; +gen8_pte_t __iomem *gtt_base = + (gen8_pte_t __iomem *)ggtt->gsm + first_entry; +const int max_entries =ggtt_total_entries (ggtt) - first_entry; +int i; + +if (WARN (num_entries > max_entries, +"First entry = %d; Num entries = %d (max=%d)\n" , + first_entry, num_entries, max_entries)) + num_entries = max_entries; + +for (i =0 ; i < num_entries; i++) +gen8_set_pte (>t_base[i], scratch_pte); +} + +static void bxt_vtd_ggtt_wa (struct i915_address_space *vm) +{ +/* +* Make sure the internal GAM fifo has been cleared of all GTT +* writes before exiting stop_machine(). This guarantees that +* any aperture accesses waiting to start in another process +* cannot back up behind the GTT writes causing a hang. +* The register can be any arbitrary GAM register. +*/ +intel_uncore_posting_read_fw (vm->gt->uncore,GFX_FLSH_CNTL_GEN6 ); +} + +struct insert_page { +struct i915_address_space *vm; +dma_addr_t addr; +u64 offset; +enum i915_cache_level level; +}; + +static int bxt_vtd_ggtt_insert_page__cb (void *_arg) +{ +struct insert_page *arg = _arg; + +gen8_ggtt_insert_page (arg->vm, arg->addr, arg->offset, arg->level,0 ); +bxt_vtd_ggtt_wa (arg->vm); + +return 0 ; +} + +static void bxt_vtd_ggtt_insert_page__BKL (struct i915_address_space *vm, +dma_addr_t addr, +u64 offset, +enum i915_cache_level level, +u32 unused) +{ +struct insert_page arg = { vm, addr, offset, level }; + +stop_machine (bxt_vtd_ggtt_insert_page__cb, &arg,NULL ); +} + +struct insert_entries { +struct i915_address_space *vm; +struct i915_vma_resource *vma_res; +enum i915_cache_level level; +u32 flags; +}; + +static int bxt_vtd_ggtt_insert_entries__cb (void *_arg) +{ +struct insert_entries *arg = _arg; + +gen8_ggtt_insert_entries (arg->vm, arg->vma_res, arg->level, arg->flags); +bxt_vtd_ggtt_wa (arg->vm); + +return 0 ; +} + +static void bxt_vtd_ggtt_insert_entries__BKL (struct i915_address_space *vm, +struct i915_vma_resource *vma_res, +enum i915_cache_level level, +u32 flags) +{ +struct insert_entries arg = { vm, vma_res, level, flags }; + +stop_machine (bxt_vtd_ggtt_insert_entries__cb, &arg,NULL ); +} + +static void gen6_ggtt_clear_range (struct i915_address_space *vm, +u64 start,u64 length) +{ +struct i915_ggtt *ggtt =i915_vm_to_ggtt (vm); +unsigned int first_entry = start /I915_GTT_PAGE_SIZE ; +unsigned int num_entries = length /I915_GTT_PAGE_SIZE ; +gen6_pte_t scratch_pte,__iomem *gtt_base = + (gen6_pte_t __iomem *)ggtt->gsm + first_entry; +const int max_entries =ggtt_total_entries (ggtt) - first_entry; +int i; + +if (WARN (num_entries > max_entries, +"First entry = %d; Num entries = %d (max=%d)\n" , + first_entry, num_entries, max_entries)) + num_entries = max_entries; + + scratch_pte = vm->scratch[0 ]->encode; +for (i =0 ; i < num_entries; i++) +iowrite32 (scratch_pte, >t_base[i]); +} +void intel_ggtt_bind_vma (struct i915_address_space *vm, -struct i915_vm_pt_stash *stash, -struct i915_vma_resource *vma_res, -enum i915_cache_level cache_level, -u32 flags) +struct i915_vm_pt_stash *stash, +struct i915_vma_resource *vma_res, +enum i915_cache_level cache_level, +u32 flags) {u32 pte_flags;@@ -243,7 +466,7 @@ void intel_ggtt_bind_vma(struct i915_address_space *vm, }void intel_ggtt_unbind_vma (struct i915_address_space *vm, -struct i915_vma_resource *vma_res) +struct i915_vma_resource *vma_res) { vm->clear_range (vm, vma_res->start, vma_res->vma_size); }@@ -560,12 +783,317 @@ void i915_ggtt_driver_late_release(struct drm_i915_private *i915)dma_resv_fini (&ggtt->vm._resv); } -struct resource intel_pci_resource (struct pci_dev *pdev,int bar) +static unsigned int gen6_get_total_gtt_size (u16 snb_gmch_ctl) +{ + snb_gmch_ctl >>=SNB_GMCH_GGMS_SHIFT ; + snb_gmch_ctl &=SNB_GMCH_GGMS_MASK ; +return snb_gmch_ctl <<20 ; +} + +static unsigned int gen8_get_total_gtt_size (u16 bdw_gmch_ctl) +{ + bdw_gmch_ctl >>=BDW_GMCH_GGMS_SHIFT ; + bdw_gmch_ctl &=BDW_GMCH_GGMS_MASK ; +if (bdw_gmch_ctl) + bdw_gmch_ctl =1 << bdw_gmch_ctl; + +#ifdef CONFIG_X86_32 +/* Limit 32b platforms to a 2GB GGTT: 4 << 20 / pte size * I915_GTT_PAGE_SIZE */ +if (bdw_gmch_ctl >4 ) + bdw_gmch_ctl =4 ; +#endif + +return bdw_gmch_ctl <<20 ; +} + +static unsigned int chv_get_total_gtt_size (u16 gmch_ctrl) +{ + gmch_ctrl >>=SNB_GMCH_GGMS_SHIFT ; + gmch_ctrl &=SNB_GMCH_GGMS_MASK ; + +if (gmch_ctrl) +return 1 << (20 + gmch_ctrl); + +return 0 ; +} + +static unsigned int gen6_gttmmadr_size (struct drm_i915_private *i915) +{ +/* +* GEN6: GTTMMADR size is 4MB and GTTADR starts at 2MB offset +* GEN8: GTTMMADR size is 16MB and GTTADR starts at 8MB offset +*/ +GEM_BUG_ON (GRAPHICS_VER (i915) <6 ); +return (GRAPHICS_VER (i915) <8 ) ?SZ_4M :SZ_16M ; +} + +static unsigned int gen6_gttadr_offset (struct drm_i915_private *i915) +{ +return gen6_gttmmadr_size (i915) /2 ; +} + +static int ggtt_probe_common (struct i915_ggtt *ggtt,u64 size) +{ +struct drm_i915_private *i915 = ggtt->vm.i915; +struct pci_dev *pdev =to_pci_dev (i915->drm.dev); +phys_addr_t phys_addr; +u32 pte_flags; +int ret; + +GEM_WARN_ON (pci_resource_len (pdev,0 ) !=gen6_gttmmadr_size (i915)); + phys_addr =pci_resource_start (pdev,0 ) +gen6_gttadr_offset (i915); + +/* +* On BXT+/ICL+ writes larger than 64 bit to the GTT pagetable range +* will be dropped. For WC mappings in general we have 64 byte burst +* writes when the WC buffer is flushed, so we can't use it, but have to +* resort to an uncached mapping. The WC issue is easily caught by the +* readback check when writing GTT PTE entries. +*/ +if (IS_GEN9_LP (i915) ||GRAPHICS_VER (i915) >=11 ) + ggtt->gsm =ioremap (phys_addr, size); +else + ggtt->gsm =ioremap_wc (phys_addr, size); +if (!ggtt->gsm) { +drm_err (&i915->drm,"Failed to map the ggtt page table\n" ); +return -ENOMEM ; + } + +kref_init (&ggtt->vm.resv_ref); + ret =setup_scratch_page (&ggtt->vm); +if (ret) { +drm_err (&i915->drm,"Scratch setup failed\n" ); +/* iounmap will also get called at remove, but meh */ +iounmap (ggtt->gsm); +return ret; + } + + pte_flags =0 ; +if (i915_gem_object_is_lmem (ggtt->vm.scratch[0 ])) + pte_flags |=PTE_LM ; + + ggtt->vm.scratch[0 ]->encode = + ggtt->vm.pte_encode (px_dma (ggtt->vm.scratch[0 ]), +I915_CACHE_NONE , pte_flags); + +return 0 ; +} + +static void gen6_gmch_remove (struct i915_address_space *vm) +{ +struct i915_ggtt *ggtt =i915_vm_to_ggtt (vm); + +iounmap (ggtt->gsm); +free_scratch (vm); +} + +static struct resource pci_resource (struct pci_dev *pdev,int bar) {return (struct resource )DEFINE_RES_MEM (pci_resource_start (pdev, bar),pci_resource_len (pdev, bar)); } +static int gen8_gmch_probe (struct i915_ggtt *ggtt) +{ +struct drm_i915_private *i915 = ggtt->vm.i915; +struct pci_dev *pdev =to_pci_dev (i915->drm.dev); +unsigned int size; +u16 snb_gmch_ctl; + +/* TODO: We're not aware of mappable constraints on gen8 yet */ +if (!HAS_LMEM (i915)) { + ggtt->gmadr =pci_resource (pdev,2 ); + ggtt->mappable_end =resource_size (&ggtt->gmadr); + } + +pci_read_config_word (pdev,SNB_GMCH_CTRL , &snb_gmch_ctl); +if (IS_CHERRYVIEW (i915)) + size =chv_get_total_gtt_size (snb_gmch_ctl); +else + size =gen8_get_total_gtt_size (snb_gmch_ctl); + + ggtt->vm.alloc_pt_dma = alloc_pt_dma; + ggtt->vm.alloc_scratch_dma = alloc_pt_dma; + ggtt->vm.lmem_pt_obj_flags =I915_BO_ALLOC_PM_EARLY ; + + ggtt->vm.total = (size /sizeof (gen8_pte_t)) *I915_GTT_PAGE_SIZE ; + ggtt->vm.cleanup = gen6_gmch_remove; + ggtt->vm.insert_page = gen8_ggtt_insert_page; + ggtt->vm.clear_range = nop_clear_range; +if (intel_scanout_needs_vtd_wa (i915)) + ggtt->vm.clear_range = gen8_ggtt_clear_range; + + ggtt->vm.insert_entries = gen8_ggtt_insert_entries; + +/* +* Serialize GTT updates with aperture access on BXT if VT-d is on, +* and always on CHV. +*/ +if (intel_vm_no_concurrent_access_wa (i915)) { + ggtt->vm.insert_entries = bxt_vtd_ggtt_insert_entries__BKL; + ggtt->vm.insert_page = bxt_vtd_ggtt_insert_page__BKL; + ggtt->vm.bind_async_flags = +I915_VMA_GLOBAL_BIND |I915_VMA_LOCAL_BIND ; + } + + ggtt->invalidate = gen8_ggtt_invalidate; + + ggtt->vm.vma_ops.bind_vma = intel_ggtt_bind_vma; + ggtt->vm.vma_ops.unbind_vma = intel_ggtt_unbind_vma; + + ggtt->vm.pte_encode = gen8_ggtt_pte_encode; + +setup_private_pat (ggtt->vm.gt->uncore); + +return ggtt_probe_common (ggtt, size); +} + +static u64 snb_pte_encode (dma_addr_t addr, +enum i915_cache_level level, +u32 flags) +{ +gen6_pte_t pte =GEN6_PTE_ADDR_ENCODE (addr) |GEN6_PTE_VALID ; + +switch (level) { +case I915_CACHE_L3_LLC : +case I915_CACHE_LLC : + pte |=GEN6_PTE_CACHE_LLC ; +break ; +case I915_CACHE_NONE : + pte |=GEN6_PTE_UNCACHED ; +break ; +default : +MISSING_CASE (level); + } + +return pte; +} + +static u64 ivb_pte_encode (dma_addr_t addr, +enum i915_cache_level level, +u32 flags) +{ +gen6_pte_t pte =GEN6_PTE_ADDR_ENCODE (addr) |GEN6_PTE_VALID ; + +switch (level) { +case I915_CACHE_L3_LLC : + pte |=GEN7_PTE_CACHE_L3_LLC ; +break ; +case I915_CACHE_LLC : + pte |=GEN6_PTE_CACHE_LLC ; +break ; +case I915_CACHE_NONE : + pte |=GEN6_PTE_UNCACHED ; +break ; +default : +MISSING_CASE (level); + } + +return pte; +} + +static u64 byt_pte_encode (dma_addr_t addr, +enum i915_cache_level level, +u32 flags) +{ +gen6_pte_t pte =GEN6_PTE_ADDR_ENCODE (addr) |GEN6_PTE_VALID ; + +if (!(flags &PTE_READ_ONLY )) + pte |=BYT_PTE_WRITEABLE ; + +if (level !=I915_CACHE_NONE ) + pte |=BYT_PTE_SNOOPED_BY_CPU_CACHES ; + +return pte; +} + +static u64 hsw_pte_encode (dma_addr_t addr, +enum i915_cache_level level, +u32 flags) +{ +gen6_pte_t pte =HSW_PTE_ADDR_ENCODE (addr) |GEN6_PTE_VALID ; + +if (level !=I915_CACHE_NONE ) + pte |=HSW_WB_LLC_AGE3 ; + +return pte; +} + +static u64 iris_pte_encode (dma_addr_t addr, +enum i915_cache_level level, +u32 flags) +{ +gen6_pte_t pte =HSW_PTE_ADDR_ENCODE (addr) |GEN6_PTE_VALID ; + +switch (level) { +case I915_CACHE_NONE : +break ; +case I915_CACHE_WT : + pte |=HSW_WT_ELLC_LLC_AGE3 ; +break ; +default : + pte |=HSW_WB_ELLC_LLC_AGE3 ; +break ; + } + +return pte; +} + +static int gen6_gmch_probe (struct i915_ggtt *ggtt) +{ +struct drm_i915_private *i915 = ggtt->vm.i915; +struct pci_dev *pdev =to_pci_dev (i915->drm.dev); +unsigned int size; +u16 snb_gmch_ctl; + + ggtt->gmadr =pci_resource (pdev,2 ); + ggtt->mappable_end =resource_size (&ggtt->gmadr); + +/* +* 64/512MB is the current min/max we actually know of, but this is +* just a coarse sanity check. +*/ +if (ggtt->mappable_end < (64 <<20 ) || + ggtt->mappable_end > (512 <<20 )) { +drm_err (&i915->drm,"Unknown GMADR size (%pa)\n" , + &ggtt->mappable_end); +return -ENXIO ; + } + +pci_read_config_word (pdev,SNB_GMCH_CTRL , &snb_gmch_ctl); + + size =gen6_get_total_gtt_size (snb_gmch_ctl); + ggtt->vm.total = (size /sizeof (gen6_pte_t)) *I915_GTT_PAGE_SIZE ; + + ggtt->vm.alloc_pt_dma = alloc_pt_dma; + ggtt->vm.alloc_scratch_dma = alloc_pt_dma; + + ggtt->vm.clear_range = nop_clear_range; +if (!HAS_FULL_PPGTT (i915) ||intel_scanout_needs_vtd_wa (i915)) + ggtt->vm.clear_range = gen6_ggtt_clear_range; + ggtt->vm.insert_page = gen6_ggtt_insert_page; + ggtt->vm.insert_entries = gen6_ggtt_insert_entries; + ggtt->vm.cleanup = gen6_gmch_remove; + + ggtt->invalidate = gen6_ggtt_invalidate; + +if (HAS_EDRAM (i915)) + ggtt->vm.pte_encode = iris_pte_encode; +else if (IS_HASWELL (i915)) + ggtt->vm.pte_encode = hsw_pte_encode; +else if (IS_VALLEYVIEW (i915)) + ggtt->vm.pte_encode = byt_pte_encode; +else if (GRAPHICS_VER (i915) >=7 ) + ggtt->vm.pte_encode = ivb_pte_encode; +else + ggtt->vm.pte_encode = snb_pte_encode; + + ggtt->vm.vma_ops.bind_vma = intel_ggtt_bind_vma; + ggtt->vm.vma_ops.unbind_vma = intel_ggtt_unbind_vma; + +return ggtt_probe_common (ggtt, size); +} +static int ggtt_probe_hw (struct i915_ggtt *ggtt,struct intel_gt *gt) {struct drm_i915_private *i915 = gt->i915;@@ -576,12 +1104,12 @@ static int ggtt_probe_hw(struct i915_ggtt *ggtt, struct intel_gt *gt) ggtt->vm.dma = i915->drm.dev;dma_resv_init (&ggtt->vm._resv); -if (GRAPHICS_VER (i915) <=5 ) - ret =intel_gt_gmch_gen5_probe (ggtt); +if (GRAPHICS_VER (i915) <6 ) + ret =intel_ggtt_gmch_probe (ggtt);else if (GRAPHICS_VER (i915) <8 ) - ret =intel_gt_gmch_gen6_probe (ggtt); + ret =gen6_gmch_probe (ggtt);else - ret =intel_gt_gmch_gen8_probe (ggtt); + ret =gen8_gmch_probe (ggtt);if (ret) {dma_resv_fini (&ggtt->vm._resv);return ret;@@ -635,7 +1163,10 @@ int i915_ggtt_probe_hw(struct drm_i915_private *i915)int i915_ggtt_enable_hw (struct drm_i915_private *i915) { -return intel_gt_gmch_gen5_enable_hw (i915); +if (GRAPHICS_VER (i915) <6 ) +return intel_ggtt_gmch_enable_hw (i915); + +return 0 ; }void i915_ggtt_enable_guc (struct i915_ggtt *ggtt)drivers/gpu/drm/i915/gt/intel_ggtt_gmch.c new file +132
-0@@ -0,0 +1,132 @@ +// SPDX-License-Identifier: MIT +/* +* Copyright © 2022 Intel Corporation +*/ + +#include "intel_ggtt_gmch.h" + +#include <drm/intel-gtt.h> +#include <drm/i915_drm.h> + +#include <linux/agp_backend.h> + +#include "i915_drv.h" +#include "i915_utils.h" +#include "intel_gtt.h" +#include "intel_gt_regs.h" +#include "intel_gt.h" + +static void gen5_ggtt_insert_page (struct i915_address_space *vm, +dma_addr_t addr, +u64 offset, +enum i915_cache_level cache_level, +u32 unused) +{ +unsigned int flags = (cache_level ==I915_CACHE_NONE ) ? +AGP_USER_MEMORY :AGP_USER_CACHED_MEMORY ; + +intel_gmch_gtt_insert_page (addr, offset >>PAGE_SHIFT , flags); +} + +static void gen5_ggtt_insert_entries (struct i915_address_space *vm, +struct i915_vma_resource *vma_res, +enum i915_cache_level cache_level, +u32 unused) +{ +unsigned int flags = (cache_level ==I915_CACHE_NONE ) ? +AGP_USER_MEMORY :AGP_USER_CACHED_MEMORY ; + +intel_gmch_gtt_insert_sg_entries (vma_res->bi.pages, vma_res->start >>PAGE_SHIFT , + flags); +} + +static void gen5_ggtt_invalidate (struct i915_ggtt *ggtt) +{ +intel_gmch_gtt_flush (); +} + +static void gen5_ggtt_clear_range (struct i915_address_space *vm, +u64 start,u64 length) +{ +intel_gmch_gtt_clear_range (start >>PAGE_SHIFT , length >>PAGE_SHIFT ); +} + +static void gen5_ggtt_remove (struct i915_address_space *vm) +{ +intel_gmch_remove (); +} + +/* +* Certain Gen5 chipsets require idling the GPU before unmapping anything from +* the GTT when VT-d is enabled. +*/ +static bool needs_idle_maps (struct drm_i915_private *i915) +{ +/* +* Query intel_iommu to see if we need the workaround. Presumably that +* was loaded first. +*/ +if (!i915_vtd_active (i915)) +return false; + +if (GRAPHICS_VER (i915) ==5 &&IS_MOBILE (i915)) +return true; + +return false; +} + +int intel_ggtt_gmch_probe (struct i915_ggtt *ggtt) +{ +struct drm_i915_private *i915 = ggtt->vm.i915; +phys_addr_t gmadr_base; +int ret; + + ret =intel_gmch_probe (i915->bridge_dev,to_pci_dev (i915->drm.dev),NULL ); +if (!ret) { +drm_err (&i915->drm,"failed to set up gmch\n" ); +return -EIO ; + } + +intel_gmch_gtt_get (&ggtt->vm.total, &gmadr_base, &ggtt->mappable_end); + + ggtt->gmadr = + (struct resource )DEFINE_RES_MEM (gmadr_base, ggtt->mappable_end); + + ggtt->vm.alloc_pt_dma = alloc_pt_dma; + ggtt->vm.alloc_scratch_dma = alloc_pt_dma; + +if (needs_idle_maps (i915)) { +drm_notice (&i915->drm, +"Flushing DMA requests before IOMMU unmaps; performance may be degraded\n" ); + ggtt->do_idle_maps = true; + } + + ggtt->vm.insert_page = gen5_ggtt_insert_page; + ggtt->vm.insert_entries = gen5_ggtt_insert_entries; + ggtt->vm.clear_range = gen5_ggtt_clear_range; + ggtt->vm.cleanup = gen5_ggtt_remove; + + ggtt->invalidate = gen5_ggtt_invalidate; + + ggtt->vm.vma_ops.bind_vma = intel_ggtt_bind_vma; + ggtt->vm.vma_ops.unbind_vma = intel_ggtt_unbind_vma; + +if (unlikely (ggtt->do_idle_maps)) +drm_notice (&i915->drm, +"Applying Ironlake quirks for intel_iommu\n" ); + +return 0 ; +} + +int intel_ggtt_gmch_enable_hw (struct drm_i915_private *i915) +{ +if (!intel_gmch_enable_gtt ()) +return -EIO ; + +return 0 ; +} + +void intel_ggtt_gmch_flush (void ) +{ +intel_gmch_gtt_flush (); +}drivers/gpu/drm/i915/gt/intel_ggtt_gmch.h new file +13
-0@@ -0,0 +1,27 @@ +/* SPDX-License-Identifier: MIT */ +/* +* Copyright © 2022 Intel Corporation +*/ + +#ifndef __INTEL_GGTT_GMCH_H__ +#define __INTEL_GGTT_GMCH_H__ + +#include "intel_gtt.h" + +/* For x86 platforms */ +#if IS_ENABLED (CONFIG_X86 ) +
drivers/gpu/drm/i915/gt/intel_ggtt_gmch.h line 23
Quoted 10 lines
drivers/gpu/drm/i915/gt/intel_ggtt_gmch.h new file +10
-0+void intel_ggtt_gmch_flush (void ); +int intel_ggtt_gmch_enable_hw (struct drm_i915_private *i915); +int intel_ggtt_gmch_probe (struct i915_ggtt *ggtt); + +/* Stubs for non-x86 platforms */ +#else + +static inline void intel_ggtt_gmch_flush (void ) { } +static inline int intel_ggtt_gmch_enable_hw (struct drm_i915_private *i915) {return -ENODEV ; } +static inline int intel_ggtt_gmch_probe (struct i915_ggtt *ggtt) {return -ENODEV ; }
Layer of abstraction looks good. Ack from me again, but this time round someone please provide a 2nd opinion.
Regards,
Tvrtko
Quoted 807 lines
drivers/gpu/drm/i915/gt/intel_ggtt_gmch.h new file +4
-0+ +#endif + +#endif /* __INTEL_GGTT_GMCH_H__ */ drivers/gpu/drm/i915/gt/intel_gt.c +3
-2@@ -4,6 +4,7 @@*/ #include <drm/drm_managed.h> +#include <drm/intel-gtt.h> #include "gem/i915_gem_internal.h" #include "gem/i915_gem_lmem.h" @@ -12,11 +13,11 @@#include "i915_drv.h" #include "intel_context.h" #include "intel_engine_regs.h" +#include "intel_ggtt_gmch.h" #include "intel_gt.h" #include "intel_gt_buffer_pool.h" #include "intel_gt_clock_utils.h" #include "intel_gt_debugfs.h" -#include "intel_gt_gmch.h" #include "intel_gt_pm.h" #include "intel_gt_regs.h" #include "intel_gt_requests.h" @@ -480,7 +481,7 @@ void intel_gt_chipset_flush(struct intel_gt *gt) {wmb ();if (GRAPHICS_VER (gt->i915) <6 ) -intel_gt_gmch_gen5_chipset_flush (gt); +intel_ggtt_gmch_flush (); }void intel_gt_driver_register (struct intel_gt *gt)drivers/gpu/drm/i915/gt/intel_gt.h +0
-9@@ -13,13 +13,6 @@struct drm_i915_private ;struct drm_printer ; -struct insert_entries { -struct i915_address_space *vm; -struct i915_vma_resource *vma_res; -enum i915_cache_level level; -u32 flags; -}; -#define GT_TRACE (gt, fmt, ...) do { \ const struct intel_gt *gt__ __maybe_unused = (gt); \ GEM_TRACE("%s " fmt, dev_name(gt__->i915->drm.dev), \@@ -125,6 +118,4 @@ void intel_gt_watchdog_work(struct work_struct *work);void intel_gt_invalidate_tlbs (struct intel_gt *gt); -struct resource intel_pci_resource (struct pci_dev *pdev,int bar); -#endif /* __INTEL_GT_H__ */ drivers/gpu/drm/i915/gt/intel_gt_gmch.c deleted +0
-654@@ -1,654 +0,0 @@ -// SPDX-License-Identifier: MIT -/* -* Copyright © 2022 Intel Corporation -*/ - -#include <drm/intel-gtt.h> -#include <drm/i915_drm.h> - -#include <linux/agp_backend.h> -#include <linux/stop_machine.h> - -#include "i915_drv.h" -#include "intel_gt_gmch.h" -#include "intel_gt_regs.h" -#include "intel_gt.h" -#include "i915_utils.h" - -#include "gen8_ppgtt.h" - -struct insert_page { -struct i915_address_space *vm; -dma_addr_t addr; -u64 offset; -enum i915_cache_level level; -}; - -static void gen8_set_pte (void __iomem *addr,gen8_pte_t pte) -{ -writeq (pte, addr); -} - -static void nop_clear_range (struct i915_address_space *vm, -u64 start,u64 length) -{ -} - -static u64 snb_pte_encode (dma_addr_t addr, -enum i915_cache_level level, -u32 flags) -{ -gen6_pte_t pte =GEN6_PTE_ADDR_ENCODE (addr) |GEN6_PTE_VALID ; - -switch (level) { -case I915_CACHE_L3_LLC : -case I915_CACHE_LLC : - pte |=GEN6_PTE_CACHE_LLC ; -break ; -case I915_CACHE_NONE : - pte |=GEN6_PTE_UNCACHED ; -break ; -default : -MISSING_CASE (level); - } - -return pte; -} - -static u64 ivb_pte_encode (dma_addr_t addr, -enum i915_cache_level level, -u32 flags) -{ -gen6_pte_t pte =GEN6_PTE_ADDR_ENCODE (addr) |GEN6_PTE_VALID ; - -switch (level) { -case I915_CACHE_L3_LLC : - pte |=GEN7_PTE_CACHE_L3_LLC ; -break ; -case I915_CACHE_LLC : - pte |=GEN6_PTE_CACHE_LLC ; -break ; -case I915_CACHE_NONE : - pte |=GEN6_PTE_UNCACHED ; -break ; -default : -MISSING_CASE (level); - } - -return pte; -} - -static u64 byt_pte_encode (dma_addr_t addr, -enum i915_cache_level level, -u32 flags) -{ -gen6_pte_t pte =GEN6_PTE_ADDR_ENCODE (addr) |GEN6_PTE_VALID ; - -if (!(flags &PTE_READ_ONLY )) - pte |=BYT_PTE_WRITEABLE ; - -if (level !=I915_CACHE_NONE ) - pte |=BYT_PTE_SNOOPED_BY_CPU_CACHES ; - -return pte; -} - -static u64 hsw_pte_encode (dma_addr_t addr, -enum i915_cache_level level, -u32 flags) -{ -gen6_pte_t pte =HSW_PTE_ADDR_ENCODE (addr) |GEN6_PTE_VALID ; - -if (level !=I915_CACHE_NONE ) - pte |=HSW_WB_LLC_AGE3 ; - -return pte; -} - -static u64 iris_pte_encode (dma_addr_t addr, -enum i915_cache_level level, -u32 flags) -{ -gen6_pte_t pte =HSW_PTE_ADDR_ENCODE (addr) |GEN6_PTE_VALID ; - -switch (level) { -case I915_CACHE_NONE : -break ; -case I915_CACHE_WT : - pte |=HSW_WT_ELLC_LLC_AGE3 ; -break ; -default : - pte |=HSW_WB_ELLC_LLC_AGE3 ; -break ; - } - -return pte; -} - -static void gen5_ggtt_insert_page (struct i915_address_space *vm, -dma_addr_t addr, -u64 offset, -enum i915_cache_level cache_level, -u32 unused) -{ -unsigned int flags = (cache_level ==I915_CACHE_NONE ) ? -AGP_USER_MEMORY :AGP_USER_CACHED_MEMORY ; - -intel_gmch_gtt_insert_page (addr, offset >>PAGE_SHIFT , flags); -} - -static void gen6_ggtt_insert_page (struct i915_address_space *vm, -dma_addr_t addr, -u64 offset, -enum i915_cache_level level, -u32 flags) -{ -struct i915_ggtt *ggtt =i915_vm_to_ggtt (vm); -gen6_pte_t __iomem *pte = - (gen6_pte_t __iomem *)ggtt->gsm + offset /I915_GTT_PAGE_SIZE ; - -iowrite32 (vm->pte_encode (addr, level, flags), pte); - - ggtt->invalidate (ggtt); -} - -static void gen8_ggtt_insert_page (struct i915_address_space *vm, -dma_addr_t addr, -u64 offset, -enum i915_cache_level level, -u32 flags) -{ -struct i915_ggtt *ggtt =i915_vm_to_ggtt (vm); -gen8_pte_t __iomem *pte = - (gen8_pte_t __iomem *)ggtt->gsm + offset /I915_GTT_PAGE_SIZE ; - -gen8_set_pte (pte,gen8_ggtt_pte_encode (addr, level, flags)); - - ggtt->invalidate (ggtt); -} - -static void gen5_ggtt_insert_entries (struct i915_address_space *vm, -struct i915_vma_resource *vma_res, -enum i915_cache_level cache_level, -u32 unused) -{ -unsigned int flags = (cache_level ==I915_CACHE_NONE ) ? -AGP_USER_MEMORY :AGP_USER_CACHED_MEMORY ; - -intel_gmch_gtt_insert_sg_entries (vma_res->bi.pages, vma_res->start >>PAGE_SHIFT , - flags); -} - -/* -* Binds an object into the global gtt with the specified cache level. -* The object will be accessible to the GPU via commands whose operands -* reference offsets within the global GTT as well as accessible by the GPU -* through the GMADR mapped BAR (i915->mm.gtt->gtt). -*/ -static void gen6_ggtt_insert_entries (struct i915_address_space *vm, -struct i915_vma_resource *vma_res, -enum i915_cache_level level, -u32 flags) -{ -struct i915_ggtt *ggtt =i915_vm_to_ggtt (vm); -gen6_pte_t __iomem *gte; -gen6_pte_t __iomem *end; -struct sgt_iter iter; -dma_addr_t addr; - - gte = (gen6_pte_t __iomem *)ggtt->gsm; - gte += vma_res->start /I915_GTT_PAGE_SIZE ; - end = gte + vma_res->node_size /I915_GTT_PAGE_SIZE ; - -for_each_sgt_daddr (addr, iter, vma_res->bi.pages) -iowrite32 (vm->pte_encode (addr, level, flags), gte++); -GEM_BUG_ON (gte > end); - -/* Fill the allocated but "unused" space beyond the end of the buffer */ -while (gte < end) -iowrite32 (vm->scratch[0 ]->encode, gte++); - -/* -* We want to flush the TLBs only after we're certain all the PTE -* updates have finished. -*/ - ggtt->invalidate (ggtt); -} - -static void gen8_ggtt_insert_entries (struct i915_address_space *vm, -struct i915_vma_resource *vma_res, -enum i915_cache_level level, -u32 flags) -{ -const gen8_pte_t pte_encode =gen8_ggtt_pte_encode (0 , level, flags); -struct i915_ggtt *ggtt =i915_vm_to_ggtt (vm); -gen8_pte_t __iomem *gte; -gen8_pte_t __iomem *end; -struct sgt_iter iter; -dma_addr_t addr; - -/* -* Note that we ignore PTE_READ_ONLY here. The caller must be careful -* not to allow the user to override access to a read only page. -*/ - - gte = (gen8_pte_t __iomem *)ggtt->gsm; - gte += vma_res->start /I915_GTT_PAGE_SIZE ; - end = gte + vma_res->node_size /I915_GTT_PAGE_SIZE ; - -for_each_sgt_daddr (addr, iter, vma_res->bi.pages) -gen8_set_pte (gte++, pte_encode | addr); -GEM_BUG_ON (gte > end); - -/* Fill the allocated but "unused" space beyond the end of the buffer */ -while (gte < end) -gen8_set_pte (gte++, vm->scratch[0 ]->encode); - -/* -* We want to flush the TLBs only after we're certain all the PTE -* updates have finished. -*/ - ggtt->invalidate (ggtt); -} - -static void bxt_vtd_ggtt_wa (struct i915_address_space *vm) -{ -/* -* Make sure the internal GAM fifo has been cleared of all GTT -* writes before exiting stop_machine(). This guarantees that -* any aperture accesses waiting to start in another process -* cannot back up behind the GTT writes causing a hang. -* The register can be any arbitrary GAM register. -*/ -intel_uncore_posting_read_fw (vm->gt->uncore,GFX_FLSH_CNTL_GEN6 ); -} - -static int bxt_vtd_ggtt_insert_page__cb (void *_arg) -{ -struct insert_page *arg = _arg; - -gen8_ggtt_insert_page (arg->vm, arg->addr, arg->offset, arg->level,0 ); -bxt_vtd_ggtt_wa (arg->vm); - -return 0 ; -} - -static void bxt_vtd_ggtt_insert_page__BKL (struct i915_address_space *vm, -dma_addr_t addr, -u64 offset, -enum i915_cache_level level, -u32 unused) -{ -struct insert_page arg = { vm, addr, offset, level }; - -stop_machine (bxt_vtd_ggtt_insert_page__cb, &arg,NULL ); -} - -static int bxt_vtd_ggtt_insert_entries__cb (void *_arg) -{ -struct insert_entries *arg = _arg; - -gen8_ggtt_insert_entries (arg->vm, arg->vma_res, arg->level, arg->flags); -bxt_vtd_ggtt_wa (arg->vm); - -return 0 ; -} - -static void bxt_vtd_ggtt_insert_entries__BKL (struct i915_address_space *vm, -struct i915_vma_resource *vma_res, -enum i915_cache_level level, -u32 flags) -{ -struct insert_entries arg = { vm, vma_res, level, flags }; - -stop_machine (bxt_vtd_ggtt_insert_entries__cb, &arg,NULL ); -} - -void intel_gt_gmch_gen5_chipset_flush (struct intel_gt *gt) -{ -intel_gmch_gtt_flush (); -} - -static void gmch_ggtt_invalidate (struct i915_ggtt *ggtt) -{ -intel_gmch_gtt_flush (); -} - -static void gen5_ggtt_clear_range (struct i915_address_space *vm, -u64 start,u64 length) -{ -intel_gmch_gtt_clear_range (start >>PAGE_SHIFT , length >>PAGE_SHIFT ); -} - -static void gen6_ggtt_clear_range (struct i915_address_space *vm, -u64 start,u64 length) -{ -struct i915_ggtt *ggtt =i915_vm_to_ggtt (vm); -unsigned int first_entry = start /I915_GTT_PAGE_SIZE ; -unsigned int num_entries = length /I915_GTT_PAGE_SIZE ; -gen6_pte_t scratch_pte,__iomem *gtt_base = - (gen6_pte_t __iomem *)ggtt->gsm + first_entry; -const int max_entries =ggtt_total_entries (ggtt) - first_entry; -int i; - -if (WARN (num_entries > max_entries, -"First entry = %d; Num entries = %d (max=%d)\n" , - first_entry, num_entries, max_entries)) - num_entries = max_entries; - - scratch_pte = vm->scratch[0 ]->encode; -for (i =0 ; i < num_entries; i++) -iowrite32 (scratch_pte, >t_base[i]); -} - -static void gen8_ggtt_clear_range (struct i915_address_space *vm, -u64 start,u64 length) -{ -struct i915_ggtt *ggtt =i915_vm_to_ggtt (vm); -unsigned int first_entry = start /I915_GTT_PAGE_SIZE ; -unsigned int num_entries = length /I915_GTT_PAGE_SIZE ; -const gen8_pte_t scratch_pte = vm->scratch[0 ]->encode; -gen8_pte_t __iomem *gtt_base = - (gen8_pte_t __iomem *)ggtt->gsm + first_entry; -const int max_entries =ggtt_total_entries (ggtt) - first_entry; -int i; - -if (WARN (num_entries > max_entries, -"First entry = %d; Num entries = %d (max=%d)\n" , - first_entry, num_entries, max_entries)) - num_entries = max_entries; - -for (i =0 ; i < num_entries; i++) -gen8_set_pte (>t_base[i], scratch_pte); -} - -static void gen5_gmch_remove (struct i915_address_space *vm) -{ -intel_gmch_remove (); -} - -static void gen6_gmch_remove (struct i915_address_space *vm) -{ -struct i915_ggtt *ggtt =i915_vm_to_ggtt (vm); - -iounmap (ggtt->gsm); -free_scratch (vm); -} - -/* -* Certain Gen5 chipsets require idling the GPU before -* unmapping anything from the GTT when VT-d is enabled. -*/ -static bool needs_idle_maps (struct drm_i915_private *i915) -{ -/* -* Query intel_iommu to see if we need the workaround. Presumably that -* was loaded first. -*/ -if (!i915_vtd_active (i915)) -return false; - -if (GRAPHICS_VER (i915) ==5 &&IS_MOBILE (i915)) -return true; - -if (GRAPHICS_VER (i915) ==12 ) -return true;/* XXX DMAR fault reason 7 */ - -return false; -} - -static unsigned int gen6_gttmmadr_size (struct drm_i915_private *i915) -{ -/* -* GEN6: GTTMMADR size is 4MB and GTTADR starts at 2MB offset -* GEN8: GTTMMADR size is 16MB and GTTADR starts at 8MB offset -*/ -GEM_BUG_ON (GRAPHICS_VER (i915) <6 ); -return (GRAPHICS_VER (i915) <8 ) ?SZ_4M :SZ_16M ; -} - -static unsigned int gen6_get_total_gtt_size (u16 snb_gmch_ctl) -{ - snb_gmch_ctl >>=SNB_GMCH_GGMS_SHIFT ; - snb_gmch_ctl &=SNB_GMCH_GGMS_MASK ; -return snb_gmch_ctl <<20 ; -} - -static unsigned int gen8_get_total_gtt_size (u16 bdw_gmch_ctl) -{ - bdw_gmch_ctl >>=BDW_GMCH_GGMS_SHIFT ; - bdw_gmch_ctl &=BDW_GMCH_GGMS_MASK ; -if (bdw_gmch_ctl) - bdw_gmch_ctl =1 << bdw_gmch_ctl; - -#ifdef CONFIG_X86_32 -/* Limit 32b platforms to a 2GB GGTT: 4 << 20 / pte size * I915_GTT_PAGE_SIZE */ -if (bdw_gmch_ctl >4 ) - bdw_gmch_ctl =4 ; -#endif - -return bdw_gmch_ctl <<20 ; -} - -static unsigned int gen6_gttadr_offset (struct drm_i915_private *i915) -{ -return gen6_gttmmadr_size (i915) /2 ; -} - -static int ggtt_probe_common (struct i915_ggtt *ggtt,u64 size) -{ -struct drm_i915_private *i915 = ggtt->vm.i915; -struct pci_dev *pdev =to_pci_dev (i915->drm.dev); -phys_addr_t phys_addr; -u32 pte_flags; -int ret; - -GEM_WARN_ON (pci_resource_len (pdev,0 ) !=gen6_gttmmadr_size (i915)); - phys_addr =pci_resource_start (pdev,0 ) +gen6_gttadr_offset (i915); - -/* -* On BXT+/ICL+ writes larger than 64 bit to the GTT pagetable range -* will be dropped. For WC mappings in general we have 64 byte burst -* writes when the WC buffer is flushed, so we can't use it, but have to -* resort to an uncached mapping. The WC issue is easily caught by the -* readback check when writing GTT PTE entries. -*/ -if (IS_GEN9_LP (i915) ||GRAPHICS_VER (i915) >=11 ) - ggtt->gsm =ioremap (phys_addr, size); -else - ggtt->gsm =ioremap_wc (phys_addr, size); -if (!ggtt->gsm) { -drm_err (&i915->drm,"Failed to map the ggtt page table\n" ); -return -ENOMEM ; - } - -kref_init (&ggtt->vm.resv_ref); - ret =setup_scratch_page (&ggtt->vm); -if (ret) { -drm_err (&i915->drm,"Scratch setup failed\n" ); -/* iounmap will also get called at remove, but meh */ -iounmap (ggtt->gsm); -return ret; - } - - pte_flags =0 ; -if (i915_gem_object_is_lmem (ggtt->vm.scratch[0 ])) - pte_flags |=PTE_LM ; - - ggtt->vm.scratch[0 ]->encode = - ggtt->vm.pte_encode (px_dma (ggtt->vm.scratch[0 ]), -I915_CACHE_NONE , pte_flags); - -return 0 ; -} - -int intel_gt_gmch_gen5_probe (struct i915_ggtt *ggtt) -{ -struct drm_i915_private *i915 = ggtt->vm.i915; -phys_addr_t gmadr_base; -int ret; - - ret =intel_gmch_probe (i915->bridge_dev,to_pci_dev (i915->drm.dev),NULL ); -if (!ret) { -drm_err (&i915->drm,"failed to set up gmch\n" ); -return -EIO ; - } - -intel_gmch_gtt_get (&ggtt->vm.total, &gmadr_base, &ggtt->mappable_end); - - ggtt->gmadr = - (struct resource )DEFINE_RES_MEM (gmadr_base, ggtt->mappable_end); - - ggtt->vm.alloc_pt_dma = alloc_pt_dma; - ggtt->vm.alloc_scratch_dma = alloc_pt_dma; - -if (needs_idle_maps (i915)) { -drm_notice (&i915->drm, -"Flushing DMA requests before IOMMU unmaps; performance may be degraded\n" ); - ggtt->do_idle_maps = true; - } - - ggtt->vm.insert_page = gen5_ggtt_insert_page; - ggtt->vm.insert_entries = gen5_ggtt_insert_entries; - ggtt->vm.clear_range = gen5_ggtt_clear_range; - ggtt->vm.cleanup = gen5_gmch_remove; - - ggtt->invalidate = gmch_ggtt_invalidate; - - ggtt->vm.vma_ops.bind_vma = intel_ggtt_bind_vma; - ggtt->vm.vma_ops.unbind_vma = intel_ggtt_unbind_vma; - -if (unlikely (ggtt->do_idle_maps)) -drm_notice (&i915->drm, -"Applying Ironlake quirks for intel_iommu\n" ); - -return 0 ; -} - -int intel_gt_gmch_gen6_probe (struct i915_ggtt *ggtt) -{ -struct drm_i915_private *i915 = ggtt->vm.i915; -struct pci_dev *pdev =to_pci_dev (i915->drm.dev); -unsigned int size; -u16 snb_gmch_ctl; - - ggtt->gmadr =intel_pci_resource (pdev,2 ); - ggtt->mappable_end =resource_size (&ggtt->gmadr); - -/* -* 64/512MB is the current min/max we actually know of, but this is -* just a coarse sanity check. -*/ -if (ggtt->mappable_end < (64 <<20 ) || ggtt->mappable_end > (512 <<20 )) { -drm_err (&i915->drm,"Unknown GMADR size (%pa)\n" , - &ggtt->mappable_end); -return -ENXIO ; - } - -pci_read_config_word (pdev,SNB_GMCH_CTRL , &snb_gmch_ctl); - - size =gen6_get_total_gtt_size (snb_gmch_ctl); - ggtt->vm.total = (size /sizeof (gen6_pte_t)) *I915_GTT_PAGE_SIZE ; - - ggtt->vm.alloc_pt_dma = alloc_pt_dma; - ggtt->vm.alloc_scratch_dma = alloc_pt_dma; - - ggtt->vm.clear_range = nop_clear_range; -if (!HAS_FULL_PPGTT (i915) ||intel_scanout_needs_vtd_wa (i915)) - ggtt->vm.clear_range = gen6_ggtt_clear_range; - ggtt->vm.insert_page = gen6_ggtt_insert_page; - ggtt->vm.insert_entries = gen6_ggtt_insert_entries; - ggtt->vm.cleanup = gen6_gmch_remove; - - ggtt->invalidate = gen6_ggtt_invalidate; - -if (HAS_EDRAM (i915)) - ggtt->vm.pte_encode = iris_pte_encode; -else if (IS_HASWELL (i915)) - ggtt->vm.pte_encode = hsw_pte_encode; -else if (IS_VALLEYVIEW (i915)) - ggtt->vm.pte_encode = byt_pte_encode; -else if (GRAPHICS_VER (i915) >=7 ) - ggtt->vm.pte_encode = ivb_pte_encode; -else - ggtt->vm.pte_encode = snb_pte_encode; - - ggtt->vm.vma_ops.bind_vma = intel_ggtt_bind_vma; - ggtt->vm.vma_ops.unbind_vma = intel_ggtt_unbind_vma; - -return ggtt_probe_common (ggtt, size); -} - -static unsigned int chv_get_total_gtt_size (u16 gmch_ctrl) -{ - gmch_ctrl >>=SNB_GMCH_GGMS_SHIFT ; - gmch_ctrl &=SNB_GMCH_GGMS_MASK ; - -if (gmch_ctrl) -return 1 << (20 + gmch_ctrl); - -return 0 ; -} - -int intel_gt_gmch_gen8_probe (struct i915_ggtt *ggtt) -{ -struct drm_i915_private *i915 = ggtt->vm.i915; -struct pci_dev *pdev =to_pci_dev (i915->drm.dev); -unsigned int size; -u16 snb_gmch_ctl; - -/* TODO: We're not aware of mappable constraints on gen8 yet */ -if (!HAS_LMEM (i915)) { - ggtt->gmadr =intel_pci_resource (pdev,2 ); - ggtt->mappable_end =resource_size (&ggtt->gmadr); - } - -pci_read_config_word (pdev,SNB_GMCH_CTRL , &snb_gmch_ctl); -if (IS_CHERRYVIEW (i915)) - size =chv_get_total_gtt_size (snb_gmch_ctl); -else - size =gen8_get_total_gtt_size (snb_gmch_ctl); - - ggtt->vm.alloc_pt_dma = alloc_pt_dma; - ggtt->vm.alloc_scratch_dma = alloc_pt_dma; - ggtt->vm.lmem_pt_obj_flags =I915_BO_ALLOC_PM_EARLY ; - - ggtt->vm.total = (size /sizeof (gen8_pte_t)) *I915_GTT_PAGE_SIZE ; - ggtt->vm.cleanup = gen6_gmch_remove; - ggtt->vm.insert_page = gen8_ggtt_insert_page; - ggtt->vm.clear_range = nop_clear_range; -if (intel_scanout_needs_vtd_wa (i915)) - ggtt->vm.clear_range = gen8_ggtt_clear_range; - - ggtt->vm.insert_entries = gen8_ggtt_insert_entries; - -/* -* Serialize GTT updates with aperture access on BXT if VT-d is on, -* and always on CHV. -*/ -if (intel_vm_no_concurrent_access_wa (i915)) { - ggtt->vm.insert_entries = bxt_vtd_ggtt_insert_entries__BKL; - ggtt->vm.insert_page = bxt_vtd_ggtt_insert_page__BKL; - ggtt->vm.bind_async_flags = -I915_VMA_GLOBAL_BIND |I915_VMA_LOCAL_BIND ; - } - - ggtt->invalidate = gen8_ggtt_invalidate; - - ggtt->vm.vma_ops.bind_vma = intel_ggtt_bind_vma; - ggtt->vm.vma_ops.unbind_vma = intel_ggtt_unbind_vma; - - ggtt->vm.pte_encode = gen8_ggtt_pte_encode; - -setup_private_pat (ggtt->vm.gt->uncore); - -return ggtt_probe_common (ggtt, size); -} - -int intel_gt_gmch_gen5_enable_hw (struct drm_i915_private *i915) -{ -if (GRAPHICS_VER (i915) <6 && !intel_gmch_enable_gtt ()) -return -EIO ; - -return 0 ; -}drivers/gpu/drm/i915/gt/intel_gt_gmch.h deleted +0
-46@@ -1,46 +0,0 @@ -/* SPDX-License-Identifier: MIT */ -/* -* Copyright © 2022 Intel Corporation -*/ - -#ifndef __INTEL_GT_GMCH_H__ -#define __INTEL_GT_GMCH_H__ - -#include "intel_gtt.h" - -/* For x86 platforms */ -#if IS_ENABLED (CONFIG_X86 ) -void intel_gt_gmch_gen5_chipset_flush (struct intel_gt *gt); -int intel_gt_gmch_gen6_probe (struct i915_ggtt *ggtt); -int intel_gt_gmch_gen8_probe (struct i915_ggtt *ggtt); -int intel_gt_gmch_gen5_probe (struct i915_ggtt *ggtt); -int intel_gt_gmch_gen5_enable_hw (struct drm_i915_private *i915); - -/* Stubs for non-x86 platforms */ -#else -static inline void intel_gt_gmch_gen5_chipset_flush (struct intel_gt *gt) -{ -} -static inline int intel_gt_gmch_gen5_probe (struct i915_ggtt *ggtt) -{ -/* No HW should be probed for this case yet, return fail */ -return -ENODEV ; -} -static inline int intel_gt_gmch_gen6_probe (struct i915_ggtt *ggtt) -{ -/* No HW should be probed for this case yet, return fail */ -return -ENODEV ; -} -static inline int intel_gt_gmch_gen8_probe (struct i915_ggtt *ggtt) -{ -/* No HW should be probed for this case yet, return fail */ -return -ENODEV ; -} -static inline int intel_gt_gmch_gen5_enable_hw (struct drm_i915_private *i915) -{ -/* No HW should be enabled for this case yet, return fail */ -return -ENODEV ; -} -#endif - -#endif /* __INTEL_GT_GMCH_H__ */ drivers/gpu/drm/i915/gt/intel_gtt.h +5
-7@@ -548,14 +548,13 @@ i915_page_dir_dma_addr(const struct i915_ppgtt *ppgtt, const unsigned int n)void ppgtt_init (struct i915_ppgtt *ppgtt,struct intel_gt *gt,unsigned long lmem_pt_obj_flags); -void intel_ggtt_bind_vma (struct i915_address_space *vm, -struct i915_vm_pt_stash *stash, -struct i915_vma_resource *vma_res, -enum i915_cache_level cache_level, -u32 flags); +struct i915_vm_pt_stash *stash, +struct i915_vma_resource *vma_res, +enum i915_cache_level cache_level, +u32 flags);void intel_ggtt_unbind_vma (struct i915_address_space *vm, -struct i915_vma_resource *vma_res); +struct i915_vma_resource *vma_res);int i915_ggtt_probe_hw (struct drm_i915_private *i915);int i915_ggtt_init_hw (struct drm_i915_private *i915);@@ -627,7 +626,6 @@ release_pd_entry(struct i915_page_directory * const pd,struct i915_page_table *const pt, const struct drm_i915_gem_object * const scratch);void gen6_ggtt_invalidate (struct i915_ggtt *ggtt); -void gen8_ggtt_invalidate (struct i915_ggtt *ggtt); void ppgtt_bind_vma(struct i915_address_space *vm, struct i915_vm_pt_stash *stash,
Re: [PATCH 2/2] drm/i915/gt: Re-do the intel-gtt split
In reply to Lucas De MarchiQuoted 434 lines · Lucas De Marchi
Re-do what was attempted in commit
7a5c922377b4("drm/i915/gt: Split intel-gtt functions by arch"). The goal of that commit was to split the handlers for older hardware that depend on intel-gtt.ko so i915 can be built for non-x86 archs, after some more patches. Other archs do not need intel-gtt.ko.Main issue with the previous approach: it moved all the hooks, including the gen8, which is used by all platforms gen8 and newer. Re-do the split moving only the handlers for gen < 6, which are the only ones calling out to the separate module.
Signed-off-by Lucas De Marchi <[email protected]>--- drivers/gpu/drm/i915/Makefile | 2 +- drivers/gpu/drm/i915/gt/intel_ggtt.c | 559 +++++++++++++++++- drivers/gpu/drm/i915/gt/intel_ggtt_gmch.c | 132 +++++ drivers/gpu/drm/i915/gt/intel_ggtt_gmch.h | 27 + drivers/gpu/drm/i915/gt/intel_gt.c | 5 +- drivers/gpu/drm/i915/gt/intel_gt.h | 9 - drivers/gpu/drm/i915/gt/intel_gt_gmch.c | 654 ---------------------- drivers/gpu/drm/i915/gt/intel_gt_gmch.h | 46 -- drivers/gpu/drm/i915/gt/intel_gtt.h | 12 +- 9 files changed, 713 insertions(+), 733 deletions(-) create mode 100644 drivers/gpu/drm/i915/gt/intel_ggtt_gmch.c create mode 100644 drivers/gpu/drm/i915/gt/intel_ggtt_gmch.h delete mode 100644 drivers/gpu/drm/i915/gt/intel_gt_gmch.c delete mode 100644 drivers/gpu/drm/i915/gt/intel_gt_gmch.hdrivers/gpu/drm/i915/Makefile +1
-1@@ -129,7 +129,7 @@ gt-y += \ gt/shmem_utils.o \ gt/sysfs_engines.o # x86 intel-gtt module support -gt-$(CONFIG_X86) += gt/intel_gt_gmch.o +gt-$(CONFIG_X86) += gt/intel_ggtt_gmch.o # autogenerated null render state gt-y += \ gt/gen6_renderstate.o \drivers/gpu/drm/i915/gt/intel_ggtt.c +336
-9@@ -3,16 +3,18 @@* Copyright © 2020 Intel Corporation */ -#include <linux/types.h> #include <asm/set_memory.h> #include <asm/smp.h> +#include <linux/types.h> +#include <linux/stop_machine.h> #include <drm/i915_drm.h> +#include <drm/intel-gtt.h> #include "gem/i915_gem_lmem.h" +#include "intel_ggtt_gmch.h" #include "intel_gt.h" -#include "intel_gt_gmch.h" #include "intel_gt_regs.h" #include "i915_drv.h" #include "i915_scatterlist.h" @@ -181,7 +183,7 @@ void gen6_ggtt_invalidate(struct i915_ggtt *ggtt)spin_unlock_irq (&uncore->lock); } -void gen8_ggtt_invalidate (struct i915_ggtt *ggtt) +static void gen8_ggtt_invalidate (struct i915_ggtt *ggtt) {struct intel_uncore *uncore = ggtt->vm.gt->uncore;@@ -218,11 +220,232 @@ u64 gen8_ggtt_pte_encode(dma_addr_t addr,return pte; } +static void gen8_set_pte (void __iomem *addr,gen8_pte_t pte) +{ +writeq (pte, addr); +} + +static void gen8_ggtt_insert_page (struct i915_address_space *vm, +dma_addr_t addr, +u64 offset, +enum i915_cache_level level, +u32 flags) +{ +struct i915_ggtt *ggtt =i915_vm_to_ggtt (vm); +gen8_pte_t __iomem *pte = + (gen8_pte_t __iomem *)ggtt->gsm + offset /I915_GTT_PAGE_SIZE ; + +gen8_set_pte (pte,gen8_ggtt_pte_encode (addr, level, flags)); + + ggtt->invalidate (ggtt); +} + +static void gen8_ggtt_insert_entries (struct i915_address_space *vm, +struct i915_vma_resource *vma_res, +enum i915_cache_level level, +u32 flags) +{ +const gen8_pte_t pte_encode =gen8_ggtt_pte_encode (0 , level, flags); +struct i915_ggtt *ggtt =i915_vm_to_ggtt (vm); +gen8_pte_t __iomem *gte; +gen8_pte_t __iomem *end; +struct sgt_iter iter; +dma_addr_t addr; + +/* +* Note that we ignore PTE_READ_ONLY here. The caller must be careful +* not to allow the user to override access to a read only page. +*/ + + gte = (gen8_pte_t __iomem *)ggtt->gsm; + gte += vma_res->start /I915_GTT_PAGE_SIZE ; + end = gte + vma_res->node_size /I915_GTT_PAGE_SIZE ; + +for_each_sgt_daddr (addr, iter, vma_res->bi.pages) +gen8_set_pte (gte++, pte_encode | addr); +GEM_BUG_ON (gte > end); + +/* Fill the allocated but "unused" space beyond the end of the buffer */ +while (gte < end) +gen8_set_pte (gte++, vm->scratch[0 ]->encode); + +/* +* We want to flush the TLBs only after we're certain all the PTE +* updates have finished. +*/ + ggtt->invalidate (ggtt); +} + +static void gen6_ggtt_insert_page (struct i915_address_space *vm, +dma_addr_t addr, +u64 offset, +enum i915_cache_level level, +u32 flags) +{ +struct i915_ggtt *ggtt =i915_vm_to_ggtt (vm); +gen6_pte_t __iomem *pte = + (gen6_pte_t __iomem *)ggtt->gsm + offset /I915_GTT_PAGE_SIZE ; + +iowrite32 (vm->pte_encode (addr, level, flags), pte); + + ggtt->invalidate (ggtt); +} + +/* +* Binds an object into the global gtt with the specified cache level. +* The object will be accessible to the GPU via commands whose operands +* reference offsets within the global GTT as well as accessible by the GPU +* through the GMADR mapped BAR (i915->mm.gtt->gtt). +*/ +static void gen6_ggtt_insert_entries (struct i915_address_space *vm, +struct i915_vma_resource *vma_res, +enum i915_cache_level level, +u32 flags) +{ +struct i915_ggtt *ggtt =i915_vm_to_ggtt (vm); +gen6_pte_t __iomem *gte; +gen6_pte_t __iomem *end; +struct sgt_iter iter; +dma_addr_t addr; + + gte = (gen6_pte_t __iomem *)ggtt->gsm; + gte += vma_res->start /I915_GTT_PAGE_SIZE ; + end = gte + vma_res->node_size /I915_GTT_PAGE_SIZE ; + +for_each_sgt_daddr (addr, iter, vma_res->bi.pages) +iowrite32 (vm->pte_encode (addr, level, flags), gte++); +GEM_BUG_ON (gte > end); + +/* Fill the allocated but "unused" space beyond the end of the buffer */ +while (gte < end) +iowrite32 (vm->scratch[0 ]->encode, gte++); + +/* +* We want to flush the TLBs only after we're certain all the PTE +* updates have finished. +*/ + ggtt->invalidate (ggtt); +} + +static void nop_clear_range (struct i915_address_space *vm, +u64 start,u64 length) +{ +} + +static void gen8_ggtt_clear_range (struct i915_address_space *vm, +u64 start,u64 length) +{ +struct i915_ggtt *ggtt =i915_vm_to_ggtt (vm); +unsigned int first_entry = start /I915_GTT_PAGE_SIZE ; +unsigned int num_entries = length /I915_GTT_PAGE_SIZE ; +const gen8_pte_t scratch_pte = vm->scratch[0 ]->encode; +gen8_pte_t __iomem *gtt_base = + (gen8_pte_t __iomem *)ggtt->gsm + first_entry; +const int max_entries =ggtt_total_entries (ggtt) - first_entry; +int i; + +if (WARN (num_entries > max_entries, +"First entry = %d; Num entries = %d (max=%d)\n" , + first_entry, num_entries, max_entries)) + num_entries = max_entries; + +for (i =0 ; i < num_entries; i++) +gen8_set_pte (>t_base[i], scratch_pte); +} + +static void bxt_vtd_ggtt_wa (struct i915_address_space *vm) +{ +/* +* Make sure the internal GAM fifo has been cleared of all GTT +* writes before exiting stop_machine(). This guarantees that +* any aperture accesses waiting to start in another process +* cannot back up behind the GTT writes causing a hang. +* The register can be any arbitrary GAM register. +*/ +intel_uncore_posting_read_fw (vm->gt->uncore,GFX_FLSH_CNTL_GEN6 ); +} + +struct insert_page { +struct i915_address_space *vm; +dma_addr_t addr; +u64 offset; +enum i915_cache_level level; +}; + +static int bxt_vtd_ggtt_insert_page__cb (void *_arg) +{ +struct insert_page *arg = _arg; + +gen8_ggtt_insert_page (arg->vm, arg->addr, arg->offset, arg->level,0 ); +bxt_vtd_ggtt_wa (arg->vm); + +return 0 ; +} + +static void bxt_vtd_ggtt_insert_page__BKL (struct i915_address_space *vm, +dma_addr_t addr, +u64 offset, +enum i915_cache_level level, +u32 unused) +{ +struct insert_page arg = { vm, addr, offset, level }; + +stop_machine (bxt_vtd_ggtt_insert_page__cb, &arg,NULL ); +} + +struct insert_entries { +struct i915_address_space *vm; +struct i915_vma_resource *vma_res; +enum i915_cache_level level; +u32 flags; +}; + +static int bxt_vtd_ggtt_insert_entries__cb (void *_arg) +{ +struct insert_entries *arg = _arg; + +gen8_ggtt_insert_entries (arg->vm, arg->vma_res, arg->level, arg->flags); +bxt_vtd_ggtt_wa (arg->vm); + +return 0 ; +} + +static void bxt_vtd_ggtt_insert_entries__BKL (struct i915_address_space *vm, +struct i915_vma_resource *vma_res, +enum i915_cache_level level, +u32 flags) +{ +struct insert_entries arg = { vm, vma_res, level, flags }; + +stop_machine (bxt_vtd_ggtt_insert_entries__cb, &arg,NULL ); +} + +static void gen6_ggtt_clear_range (struct i915_address_space *vm, +u64 start,u64 length) +{ +struct i915_ggtt *ggtt =i915_vm_to_ggtt (vm); +unsigned int first_entry = start /I915_GTT_PAGE_SIZE ; +unsigned int num_entries = length /I915_GTT_PAGE_SIZE ; +gen6_pte_t scratch_pte,__iomem *gtt_base = + (gen6_pte_t __iomem *)ggtt->gsm + first_entry; +const int max_entries =ggtt_total_entries (ggtt) - first_entry; +int i; + +if (WARN (num_entries > max_entries, +"First entry = %d; Num entries = %d (max=%d)\n" , + first_entry, num_entries, max_entries)) + num_entries = max_entries; + + scratch_pte = vm->scratch[0 ]->encode; +for (i =0 ; i < num_entries; i++) +iowrite32 (scratch_pte, >t_base[i]); +} +void intel_ggtt_bind_vma (struct i915_address_space *vm, -struct i915_vm_pt_stash *stash, -struct i915_vma_resource *vma_res, -enum i915_cache_level cache_level, -u32 flags) +struct i915_vm_pt_stash *stash, +struct i915_vma_resource *vma_res, +enum i915_cache_level cache_level, +u32 flags) {u32 pte_flags;@@ -243,7 +466,7 @@ void intel_ggtt_bind_vma(struct i915_address_space *vm, }void intel_ggtt_unbind_vma (struct i915_address_space *vm, -struct i915_vma_resource *vma_res) +struct i915_vma_resource *vma_res) { vm->clear_range (vm, vma_res->start, vma_res->vma_size); }@@ -560,12 +783,317 @@ void i915_ggtt_driver_late_release(struct drm_i915_private *i915)dma_resv_fini (&ggtt->vm._resv); } -struct resource intel_pci_resource (struct pci_dev *pdev,int bar) +static unsigned int gen6_get_total_gtt_size (u16 snb_gmch_ctl) +{ + snb_gmch_ctl >>=SNB_GMCH_GGMS_SHIFT ; + snb_gmch_ctl &=SNB_GMCH_GGMS_MASK ; +return snb_gmch_ctl <<20 ; +} + +static unsigned int gen8_get_total_gtt_size (u16 bdw_gmch_ctl) +{ + bdw_gmch_ctl >>=BDW_GMCH_GGMS_SHIFT ; + bdw_gmch_ctl &=BDW_GMCH_GGMS_MASK ; +if (bdw_gmch_ctl) + bdw_gmch_ctl =1 << bdw_gmch_ctl; + +#ifdef CONFIG_X86_32 +/* Limit 32b platforms to a 2GB GGTT: 4 << 20 / pte size * I915_GTT_PAGE_SIZE */ +if (bdw_gmch_ctl >4 ) + bdw_gmch_ctl =4 ; +#endif + +return bdw_gmch_ctl <<20 ; +} + +static unsigned int chv_get_total_gtt_size (u16 gmch_ctrl) +{ + gmch_ctrl >>=SNB_GMCH_GGMS_SHIFT ; + gmch_ctrl &=SNB_GMCH_GGMS_MASK ; + +if (gmch_ctrl) +return 1 << (20 + gmch_ctrl); + +return 0 ; +} + +static unsigned int gen6_gttmmadr_size (struct drm_i915_private *i915) +{ +/* +* GEN6: GTTMMADR size is 4MB and GTTADR starts at 2MB offset +* GEN8: GTTMMADR size is 16MB and GTTADR starts at 8MB offset +*/ +GEM_BUG_ON (GRAPHICS_VER (i915) <6 ); +return (GRAPHICS_VER (i915) <8 ) ?SZ_4M :SZ_16M ; +} + +static unsigned int gen6_gttadr_offset (struct drm_i915_private *i915) +{ +return gen6_gttmmadr_size (i915) /2 ; +} + +static int ggtt_probe_common (struct i915_ggtt *ggtt,u64 size) +{ +struct drm_i915_private *i915 = ggtt->vm.i915; +struct pci_dev *pdev =to_pci_dev (i915->drm.dev); +phys_addr_t phys_addr; +u32 pte_flags; +int ret; + +GEM_WARN_ON (pci_resource_len (pdev,0 ) !=gen6_gttmmadr_size (i915)); + phys_addr =pci_resource_start (pdev,0 ) +gen6_gttadr_offset (i915); + +/* +* On BXT+/ICL+ writes larger than 64 bit to the GTT pagetable range +* will be dropped. For WC mappings in general we have 64 byte burst +* writes when the WC buffer is flushed, so we can't use it, but have to +* resort to an uncached mapping. The WC issue is easily caught by the +* readback check when writing GTT PTE entries. +*/ +if (IS_GEN9_LP (i915) ||GRAPHICS_VER (i915) >=11 ) + ggtt->gsm =ioremap (phys_addr, size); +else + ggtt->gsm =ioremap_wc (phys_addr, size); +if (!ggtt->gsm) { +drm_err (&i915->drm,"Failed to map the ggtt page table\n" ); +return -ENOMEM ; + } + +kref_init (&ggtt->vm.resv_ref); + ret =setup_scratch_page (&ggtt->vm); +if (ret) { +drm_err (&i915->drm,"Scratch setup failed\n" ); +/* iounmap will also get called at remove, but meh */ +iounmap (ggtt->gsm); +return ret; + } + + pte_flags =0 ; +if (i915_gem_object_is_lmem (ggtt->vm.scratch[0 ])) + pte_flags |=PTE_LM ; + + ggtt->vm.scratch[0 ]->encode = + ggtt->vm.pte_encode (px_dma (ggtt->vm.scratch[0 ]), +I915_CACHE_NONE , pte_flags); + +return 0 ; +} + +static void gen6_gmch_remove (struct i915_address_space *vm) +{ +struct i915_ggtt *ggtt =i915_vm_to_ggtt (vm); + +iounmap (ggtt->gsm); +free_scratch (vm); +} + +static struct resource pci_resource (struct pci_dev *pdev,int bar) {return (struct resource )DEFINE_RES_MEM (pci_resource_start (pdev, bar),pci_resource_len (pdev, bar));
drivers/gpu/drm/i915/gt/intel_ggtt.c void i915_ggtt_driver_late_release(struct drm_i915_private *i915) · line 903
Quoted 10 lines
drivers/gpu/drm/i915/gt/intel_ggtt.c +8
-0} +static int gen8_gmch_probe (struct i915_ggtt *ggtt) +{ +struct drm_i915_private *i915 = ggtt->vm.i915; +struct pci_dev *pdev =to_pci_dev (i915->drm.dev); +unsigned int size; +u16 snb_gmch_ctl; + +/* TODO: We're not aware of mappable constraints on gen8 yet */
We could probably take the opportunity to drop this TODO while moving the function. Given how old gen8 is now I think it's safe to say that there aren't any extra constraints we haven't found out about yet. :-)
Quoted 200 lines
drivers/gpu/drm/i915/gt/intel_ggtt.c +193
-0+if (!HAS_LMEM (i915)) { + ggtt->gmadr =pci_resource (pdev,2 ); + ggtt->mappable_end =resource_size (&ggtt->gmadr); + } + +pci_read_config_word (pdev,SNB_GMCH_CTRL , &snb_gmch_ctl); +if (IS_CHERRYVIEW (i915)) + size =chv_get_total_gtt_size (snb_gmch_ctl); +else + size =gen8_get_total_gtt_size (snb_gmch_ctl); + + ggtt->vm.alloc_pt_dma = alloc_pt_dma; + ggtt->vm.alloc_scratch_dma = alloc_pt_dma; + ggtt->vm.lmem_pt_obj_flags =I915_BO_ALLOC_PM_EARLY ; + + ggtt->vm.total = (size /sizeof (gen8_pte_t)) *I915_GTT_PAGE_SIZE ; + ggtt->vm.cleanup = gen6_gmch_remove; + ggtt->vm.insert_page = gen8_ggtt_insert_page; + ggtt->vm.clear_range = nop_clear_range; +if (intel_scanout_needs_vtd_wa (i915)) + ggtt->vm.clear_range = gen8_ggtt_clear_range; + + ggtt->vm.insert_entries = gen8_ggtt_insert_entries; + +/* +* Serialize GTT updates with aperture access on BXT if VT-d is on, +* and always on CHV. +*/ +if (intel_vm_no_concurrent_access_wa (i915)) { + ggtt->vm.insert_entries = bxt_vtd_ggtt_insert_entries__BKL; + ggtt->vm.insert_page = bxt_vtd_ggtt_insert_page__BKL; + ggtt->vm.bind_async_flags = +I915_VMA_GLOBAL_BIND |I915_VMA_LOCAL_BIND ; + } + + ggtt->invalidate = gen8_ggtt_invalidate; + + ggtt->vm.vma_ops.bind_vma = intel_ggtt_bind_vma; + ggtt->vm.vma_ops.unbind_vma = intel_ggtt_unbind_vma; + + ggtt->vm.pte_encode = gen8_ggtt_pte_encode; + +setup_private_pat (ggtt->vm.gt->uncore); + +return ggtt_probe_common (ggtt, size); +} + +static u64 snb_pte_encode (dma_addr_t addr, +enum i915_cache_level level, +u32 flags) +{ +gen6_pte_t pte =GEN6_PTE_ADDR_ENCODE (addr) |GEN6_PTE_VALID ; + +switch (level) { +case I915_CACHE_L3_LLC : +case I915_CACHE_LLC : + pte |=GEN6_PTE_CACHE_LLC ; +break ; +case I915_CACHE_NONE : + pte |=GEN6_PTE_UNCACHED ; +break ; +default : +MISSING_CASE (level); + } + +return pte; +} + +static u64 ivb_pte_encode (dma_addr_t addr, +enum i915_cache_level level, +u32 flags) +{ +gen6_pte_t pte =GEN6_PTE_ADDR_ENCODE (addr) |GEN6_PTE_VALID ; + +switch (level) { +case I915_CACHE_L3_LLC : + pte |=GEN7_PTE_CACHE_L3_LLC ; +break ; +case I915_CACHE_LLC : + pte |=GEN6_PTE_CACHE_LLC ; +break ; +case I915_CACHE_NONE : + pte |=GEN6_PTE_UNCACHED ; +break ; +default : +MISSING_CASE (level); + } + +return pte; +} + +static u64 byt_pte_encode (dma_addr_t addr, +enum i915_cache_level level, +u32 flags) +{ +gen6_pte_t pte =GEN6_PTE_ADDR_ENCODE (addr) |GEN6_PTE_VALID ; + +if (!(flags &PTE_READ_ONLY )) + pte |=BYT_PTE_WRITEABLE ; + +if (level !=I915_CACHE_NONE ) + pte |=BYT_PTE_SNOOPED_BY_CPU_CACHES ; + +return pte; +} + +static u64 hsw_pte_encode (dma_addr_t addr, +enum i915_cache_level level, +u32 flags) +{ +gen6_pte_t pte =HSW_PTE_ADDR_ENCODE (addr) |GEN6_PTE_VALID ; + +if (level !=I915_CACHE_NONE ) + pte |=HSW_WB_LLC_AGE3 ; + +return pte; +} + +static u64 iris_pte_encode (dma_addr_t addr, +enum i915_cache_level level, +u32 flags) +{ +gen6_pte_t pte =HSW_PTE_ADDR_ENCODE (addr) |GEN6_PTE_VALID ; + +switch (level) { +case I915_CACHE_NONE : +break ; +case I915_CACHE_WT : + pte |=HSW_WT_ELLC_LLC_AGE3 ; +break ; +default : + pte |=HSW_WB_ELLC_LLC_AGE3 ; +break ; + } + +return pte; +} + +static int gen6_gmch_probe (struct i915_ggtt *ggtt) +{ +struct drm_i915_private *i915 = ggtt->vm.i915; +struct pci_dev *pdev =to_pci_dev (i915->drm.dev); +unsigned int size; +u16 snb_gmch_ctl; + + ggtt->gmadr =pci_resource (pdev,2 ); + ggtt->mappable_end =resource_size (&ggtt->gmadr); + +/* +* 64/512MB is the current min/max we actually know of, but this is +* just a coarse sanity check. +*/ +if (ggtt->mappable_end < (64 <<20 ) || + ggtt->mappable_end > (512 <<20 )) { +drm_err (&i915->drm,"Unknown GMADR size (%pa)\n" , + &ggtt->mappable_end); +return -ENXIO ; + } + +pci_read_config_word (pdev,SNB_GMCH_CTRL , &snb_gmch_ctl); + + size =gen6_get_total_gtt_size (snb_gmch_ctl); + ggtt->vm.total = (size /sizeof (gen6_pte_t)) *I915_GTT_PAGE_SIZE ; + + ggtt->vm.alloc_pt_dma = alloc_pt_dma; + ggtt->vm.alloc_scratch_dma = alloc_pt_dma; + + ggtt->vm.clear_range = nop_clear_range; +if (!HAS_FULL_PPGTT (i915) ||intel_scanout_needs_vtd_wa (i915)) + ggtt->vm.clear_range = gen6_ggtt_clear_range; + ggtt->vm.insert_page = gen6_ggtt_insert_page; + ggtt->vm.insert_entries = gen6_ggtt_insert_entries; + ggtt->vm.cleanup = gen6_gmch_remove; + + ggtt->invalidate = gen6_ggtt_invalidate; + +if (HAS_EDRAM (i915)) + ggtt->vm.pte_encode = iris_pte_encode; +else if (IS_HASWELL (i915)) + ggtt->vm.pte_encode = hsw_pte_encode; +else if (IS_VALLEYVIEW (i915)) + ggtt->vm.pte_encode = byt_pte_encode; +else if (GRAPHICS_VER (i915) >=7 ) + ggtt->vm.pte_encode = ivb_pte_encode; +else + ggtt->vm.pte_encode = snb_pte_encode; + + ggtt->vm.vma_ops.bind_vma = intel_ggtt_bind_vma; + ggtt->vm.vma_ops.unbind_vma = intel_ggtt_unbind_vma; + +return ggtt_probe_common (ggtt, size); +} +static int ggtt_probe_hw (struct i915_ggtt *ggtt,struct intel_gt *gt) {struct drm_i915_private *i915 = gt->i915;@@ -576,12 +1104,12 @@ static int ggtt_probe_hw(struct i915_ggtt *ggtt, struct intel_gt *gt) ggtt->vm.dma = i915->drm.dev;dma_resv_init (&ggtt->vm._resv);
drivers/gpu/drm/i915/gt/intel_ggtt.c static int ggtt_probe_hw(struct i915_ggtt *ggtt, struct intel_gt *gt) · line 1112
Quoted 10 lines
drivers/gpu/drm/i915/gt/intel_ggtt.c +4
-4-if (GRAPHICS_VER (i915) <=5 ) - ret =intel_gt_gmch_gen5_probe (ggtt); +if (GRAPHICS_VER (i915) <6 ) + ret =intel_ggtt_gmch_probe (ggtt);else if (GRAPHICS_VER (i915) <8 ) - ret =intel_gt_gmch_gen6_probe (ggtt); + ret =gen6_gmch_probe (ggtt);else - ret =intel_gt_gmch_gen8_probe (ggtt); + ret =gen8_gmch_probe (ggtt);
We could also take the opportunity to reverse the if/else ladder here and put it in the i915-preferred "newest at top" order.
Quoted 30 lines
drivers/gpu/drm/i915/gt/intel_ggtt.c +4
-1if (ret) {dma_resv_fini (&ggtt->vm._resv);return ret;@@ -635,7 +1163,10 @@ int i915_ggtt_probe_hw(struct drm_i915_private *i915)int i915_ggtt_enable_hw (struct drm_i915_private *i915) { -return intel_gt_gmch_gen5_enable_hw (i915); +if (GRAPHICS_VER (i915) <6 ) +return intel_ggtt_gmch_enable_hw (i915); + +return 0 ; }void i915_ggtt_enable_guc (struct i915_ggtt *ggtt)drivers/gpu/drm/i915/gt/intel_ggtt_gmch.c new file +9
-0@@ -0,0 +1,132 @@ +// SPDX-License-Identifier: MIT +/* +* Copyright © 2022 Intel Corporation +*/ + +#include "intel_ggtt_gmch.h" + +#include <drm/intel-gtt.h> +#include <drm/i915_drm.h>
drivers/gpu/drm/i915/gt/intel_ggtt_gmch.c line 19
Quoted 10 lines
drivers/gpu/drm/i915/gt/intel_ggtt_gmch.c new file +10
-0+ +#include <linux/agp_backend.h> + +#include "i915_drv.h" +#include "i915_utils.h" +#include "intel_gtt.h" +#include "intel_gt_regs.h" +#include "intel_gt.h" + +static void gen5_ggtt_insert_page(struct i915_address_space *vm,
All the "gen5_" prefixes in this file seem a bit misleading if they wind up getting used on earlier platforms too; most of the driver uses the prefix to indicate the first platform/architecture that the function was used on. Maybe we should also rename these with a "gmch_" prefix as well to indicate that they're intended for the platforms where the GMCH was an independent chip and not integrated into the CPU?
Anyway, all of my review comments are just bikeshedding so feel free to use or ignore them as you see fit. Either way, this series should fix the issue and restore GGTT handling for non-x86.
Quoted 952 lines
drivers/gpu/drm/i915/gt/intel_ggtt_gmch.c new file +113
-0+dma_addr_t addr, + u64 offset, + enum i915_cache_level cache_level, + u32 unused) +{ + unsigned int flags = (cache_level == I915_CACHE_NONE) ? +AGP_USER_MEMORY :AGP_USER_CACHED_MEMORY ; + +intel_gmch_gtt_insert_page (addr, offset >>PAGE_SHIFT , flags); +} + +static void gen5_ggtt_insert_entries (struct i915_address_space *vm, +struct i915_vma_resource *vma_res, +enum i915_cache_level cache_level, +u32 unused) +{ +unsigned int flags = (cache_level ==I915_CACHE_NONE ) ? +AGP_USER_MEMORY :AGP_USER_CACHED_MEMORY ; + +intel_gmch_gtt_insert_sg_entries (vma_res->bi.pages, vma_res->start >>PAGE_SHIFT , + flags); +} + +static void gen5_ggtt_invalidate (struct i915_ggtt *ggtt) +{ +intel_gmch_gtt_flush (); +} + +static void gen5_ggtt_clear_range (struct i915_address_space *vm, +u64 start,u64 length) +{ +intel_gmch_gtt_clear_range (start >>PAGE_SHIFT , length >>PAGE_SHIFT ); +} + +static void gen5_ggtt_remove (struct i915_address_space *vm) +{ +intel_gmch_remove (); +} + +/* +* Certain Gen5 chipsets require idling the GPU before unmapping anything from +* the GTT when VT-d is enabled. +*/ +static bool needs_idle_maps (struct drm_i915_private *i915) +{ +/* +* Query intel_iommu to see if we need the workaround. Presumably that +* was loaded first. +*/ +if (!i915_vtd_active (i915)) +return false; + +if (GRAPHICS_VER (i915) ==5 &&IS_MOBILE (i915)) +return true; + +return false; +} + +int intel_ggtt_gmch_probe (struct i915_ggtt *ggtt) +{ +struct drm_i915_private *i915 = ggtt->vm.i915; +phys_addr_t gmadr_base; +int ret; + + ret =intel_gmch_probe (i915->bridge_dev,to_pci_dev (i915->drm.dev),NULL ); +if (!ret) { +drm_err (&i915->drm,"failed to set up gmch\n" ); +return -EIO ; + } + +intel_gmch_gtt_get (&ggtt->vm.total, &gmadr_base, &ggtt->mappable_end); + + ggtt->gmadr = + (struct resource )DEFINE_RES_MEM (gmadr_base, ggtt->mappable_end); + + ggtt->vm.alloc_pt_dma = alloc_pt_dma; + ggtt->vm.alloc_scratch_dma = alloc_pt_dma; + +if (needs_idle_maps (i915)) { +drm_notice (&i915->drm, +"Flushing DMA requests before IOMMU unmaps; performance may be degraded\n" ); + ggtt->do_idle_maps = true; + } + + ggtt->vm.insert_page = gen5_ggtt_insert_page; + ggtt->vm.insert_entries = gen5_ggtt_insert_entries; + ggtt->vm.clear_range = gen5_ggtt_clear_range; + ggtt->vm.cleanup = gen5_ggtt_remove; + + ggtt->invalidate = gen5_ggtt_invalidate; + + ggtt->vm.vma_ops.bind_vma = intel_ggtt_bind_vma; + ggtt->vm.vma_ops.unbind_vma = intel_ggtt_unbind_vma; + +if (unlikely (ggtt->do_idle_maps)) +drm_notice (&i915->drm, +"Applying Ironlake quirks for intel_iommu\n" ); + +return 0 ; +} + +int intel_ggtt_gmch_enable_hw (struct drm_i915_private *i915) +{ +if (!intel_gmch_enable_gtt ()) +return -EIO ; + +return 0 ; +} + +void intel_ggtt_gmch_flush (void ) +{ +intel_gmch_gtt_flush (); +}drivers/gpu/drm/i915/gt/intel_ggtt_gmch.h new file +27
-0@@ -0,0 +1,27 @@ +/* SPDX-License-Identifier: MIT */ +/* +* Copyright © 2022 Intel Corporation +*/ + +#ifndef __INTEL_GGTT_GMCH_H__ +#define __INTEL_GGTT_GMCH_H__ + +#include "intel_gtt.h" + +/* For x86 platforms */ +#if IS_ENABLED (CONFIG_X86 ) + +void intel_ggtt_gmch_flush (void ); +int intel_ggtt_gmch_enable_hw (struct drm_i915_private *i915); +int intel_ggtt_gmch_probe (struct i915_ggtt *ggtt); + +/* Stubs for non-x86 platforms */ +#else + +static inline void intel_ggtt_gmch_flush (void ) { } +static inline int intel_ggtt_gmch_enable_hw (struct drm_i915_private *i915) {return -ENODEV ; } +static inline int intel_ggtt_gmch_probe (struct i915_ggtt *ggtt) {return -ENODEV ; } + +#endif + +#endif /* __INTEL_GGTT_GMCH_H__ */ drivers/gpu/drm/i915/gt/intel_gt.c +3
-2@@ -4,6 +4,7 @@*/ #include <drm/drm_managed.h> +#include <drm/intel-gtt.h> #include "gem/i915_gem_internal.h" #include "gem/i915_gem_lmem.h" @@ -12,11 +13,11 @@#include "i915_drv.h" #include "intel_context.h" #include "intel_engine_regs.h" +#include "intel_ggtt_gmch.h" #include "intel_gt.h" #include "intel_gt_buffer_pool.h" #include "intel_gt_clock_utils.h" #include "intel_gt_debugfs.h" -#include "intel_gt_gmch.h" #include "intel_gt_pm.h" #include "intel_gt_regs.h" #include "intel_gt_requests.h" @@ -480,7 +481,7 @@ void intel_gt_chipset_flush(struct intel_gt *gt) {wmb ();if (GRAPHICS_VER (gt->i915) <6 ) -intel_gt_gmch_gen5_chipset_flush (gt); +intel_ggtt_gmch_flush (); }void intel_gt_driver_register (struct intel_gt *gt)drivers/gpu/drm/i915/gt/intel_gt.h +0
-9@@ -13,13 +13,6 @@struct drm_i915_private ;struct drm_printer ; -struct insert_entries { -struct i915_address_space *vm; -struct i915_vma_resource *vma_res; -enum i915_cache_level level; -u32 flags; -}; -#define GT_TRACE (gt, fmt, ...) do { \ const struct intel_gt *gt__ __maybe_unused = (gt); \ GEM_TRACE("%s " fmt, dev_name(gt__->i915->drm.dev), \@@ -125,6 +118,4 @@ void intel_gt_watchdog_work(struct work_struct *work);void intel_gt_invalidate_tlbs (struct intel_gt *gt); -struct resource intel_pci_resource (struct pci_dev *pdev,int bar); -#endif /* __INTEL_GT_H__ */ drivers/gpu/drm/i915/gt/intel_gt_gmch.c deleted +0
-654@@ -1,654 +0,0 @@ -// SPDX-License-Identifier: MIT -/* -* Copyright © 2022 Intel Corporation -*/ - -#include <drm/intel-gtt.h> -#include <drm/i915_drm.h> - -#include <linux/agp_backend.h> -#include <linux/stop_machine.h> - -#include "i915_drv.h" -#include "intel_gt_gmch.h" -#include "intel_gt_regs.h" -#include "intel_gt.h" -#include "i915_utils.h" - -#include "gen8_ppgtt.h" - -struct insert_page { -struct i915_address_space *vm; -dma_addr_t addr; -u64 offset; -enum i915_cache_level level; -}; - -static void gen8_set_pte (void __iomem *addr,gen8_pte_t pte) -{ -writeq (pte, addr); -} - -static void nop_clear_range (struct i915_address_space *vm, -u64 start,u64 length) -{ -} - -static u64 snb_pte_encode (dma_addr_t addr, -enum i915_cache_level level, -u32 flags) -{ -gen6_pte_t pte =GEN6_PTE_ADDR_ENCODE (addr) |GEN6_PTE_VALID ; - -switch (level) { -case I915_CACHE_L3_LLC : -case I915_CACHE_LLC : - pte |=GEN6_PTE_CACHE_LLC ; -break ; -case I915_CACHE_NONE : - pte |=GEN6_PTE_UNCACHED ; -break ; -default : -MISSING_CASE (level); - } - -return pte; -} - -static u64 ivb_pte_encode (dma_addr_t addr, -enum i915_cache_level level, -u32 flags) -{ -gen6_pte_t pte =GEN6_PTE_ADDR_ENCODE (addr) |GEN6_PTE_VALID ; - -switch (level) { -case I915_CACHE_L3_LLC : - pte |=GEN7_PTE_CACHE_L3_LLC ; -break ; -case I915_CACHE_LLC : - pte |=GEN6_PTE_CACHE_LLC ; -break ; -case I915_CACHE_NONE : - pte |=GEN6_PTE_UNCACHED ; -break ; -default : -MISSING_CASE (level); - } - -return pte; -} - -static u64 byt_pte_encode (dma_addr_t addr, -enum i915_cache_level level, -u32 flags) -{ -gen6_pte_t pte =GEN6_PTE_ADDR_ENCODE (addr) |GEN6_PTE_VALID ; - -if (!(flags &PTE_READ_ONLY )) - pte |=BYT_PTE_WRITEABLE ; - -if (level !=I915_CACHE_NONE ) - pte |=BYT_PTE_SNOOPED_BY_CPU_CACHES ; - -return pte; -} - -static u64 hsw_pte_encode (dma_addr_t addr, -enum i915_cache_level level, -u32 flags) -{ -gen6_pte_t pte =HSW_PTE_ADDR_ENCODE (addr) |GEN6_PTE_VALID ; - -if (level !=I915_CACHE_NONE ) - pte |=HSW_WB_LLC_AGE3 ; - -return pte; -} - -static u64 iris_pte_encode (dma_addr_t addr, -enum i915_cache_level level, -u32 flags) -{ -gen6_pte_t pte =HSW_PTE_ADDR_ENCODE (addr) |GEN6_PTE_VALID ; - -switch (level) { -case I915_CACHE_NONE : -break ; -case I915_CACHE_WT : - pte |=HSW_WT_ELLC_LLC_AGE3 ; -break ; -default : - pte |=HSW_WB_ELLC_LLC_AGE3 ; -break ; - } - -return pte; -} - -static void gen5_ggtt_insert_page (struct i915_address_space *vm, -dma_addr_t addr, -u64 offset, -enum i915_cache_level cache_level, -u32 unused) -{ -unsigned int flags = (cache_level ==I915_CACHE_NONE ) ? -AGP_USER_MEMORY :AGP_USER_CACHED_MEMORY ; - -intel_gmch_gtt_insert_page (addr, offset >>PAGE_SHIFT , flags); -} - -static void gen6_ggtt_insert_page (struct i915_address_space *vm, -dma_addr_t addr, -u64 offset, -enum i915_cache_level level, -u32 flags) -{ -struct i915_ggtt *ggtt =i915_vm_to_ggtt (vm); -gen6_pte_t __iomem *pte = - (gen6_pte_t __iomem *)ggtt->gsm + offset /I915_GTT_PAGE_SIZE ; - -iowrite32 (vm->pte_encode (addr, level, flags), pte); - - ggtt->invalidate (ggtt); -} - -static void gen8_ggtt_insert_page (struct i915_address_space *vm, -dma_addr_t addr, -u64 offset, -enum i915_cache_level level, -u32 flags) -{ -struct i915_ggtt *ggtt =i915_vm_to_ggtt (vm); -gen8_pte_t __iomem *pte = - (gen8_pte_t __iomem *)ggtt->gsm + offset /I915_GTT_PAGE_SIZE ; - -gen8_set_pte (pte,gen8_ggtt_pte_encode (addr, level, flags)); - - ggtt->invalidate (ggtt); -} - -static void gen5_ggtt_insert_entries (struct i915_address_space *vm, -struct i915_vma_resource *vma_res, -enum i915_cache_level cache_level, -u32 unused) -{ -unsigned int flags = (cache_level ==I915_CACHE_NONE ) ? -AGP_USER_MEMORY :AGP_USER_CACHED_MEMORY ; - -intel_gmch_gtt_insert_sg_entries (vma_res->bi.pages, vma_res->start >>PAGE_SHIFT , - flags); -} - -/* -* Binds an object into the global gtt with the specified cache level. -* The object will be accessible to the GPU via commands whose operands -* reference offsets within the global GTT as well as accessible by the GPU -* through the GMADR mapped BAR (i915->mm.gtt->gtt). -*/ -static void gen6_ggtt_insert_entries (struct i915_address_space *vm, -struct i915_vma_resource *vma_res, -enum i915_cache_level level, -u32 flags) -{ -struct i915_ggtt *ggtt =i915_vm_to_ggtt (vm); -gen6_pte_t __iomem *gte; -gen6_pte_t __iomem *end; -struct sgt_iter iter; -dma_addr_t addr; - - gte = (gen6_pte_t __iomem *)ggtt->gsm; - gte += vma_res->start /I915_GTT_PAGE_SIZE ; - end = gte + vma_res->node_size /I915_GTT_PAGE_SIZE ; - -for_each_sgt_daddr (addr, iter, vma_res->bi.pages) -iowrite32 (vm->pte_encode (addr, level, flags), gte++); -GEM_BUG_ON (gte > end); - -/* Fill the allocated but "unused" space beyond the end of the buffer */ -while (gte < end) -iowrite32 (vm->scratch[0 ]->encode, gte++); - -/* -* We want to flush the TLBs only after we're certain all the PTE -* updates have finished. -*/ - ggtt->invalidate (ggtt); -} - -static void gen8_ggtt_insert_entries (struct i915_address_space *vm, -struct i915_vma_resource *vma_res, -enum i915_cache_level level, -u32 flags) -{ -const gen8_pte_t pte_encode =gen8_ggtt_pte_encode (0 , level, flags); -struct i915_ggtt *ggtt =i915_vm_to_ggtt (vm); -gen8_pte_t __iomem *gte; -gen8_pte_t __iomem *end; -struct sgt_iter iter; -dma_addr_t addr; - -/* -* Note that we ignore PTE_READ_ONLY here. The caller must be careful -* not to allow the user to override access to a read only page. -*/ - - gte = (gen8_pte_t __iomem *)ggtt->gsm; - gte += vma_res->start /I915_GTT_PAGE_SIZE ; - end = gte + vma_res->node_size /I915_GTT_PAGE_SIZE ; - -for_each_sgt_daddr (addr, iter, vma_res->bi.pages) -gen8_set_pte (gte++, pte_encode | addr); -GEM_BUG_ON (gte > end); - -/* Fill the allocated but "unused" space beyond the end of the buffer */ -while (gte < end) -gen8_set_pte (gte++, vm->scratch[0 ]->encode); - -/* -* We want to flush the TLBs only after we're certain all the PTE -* updates have finished. -*/ - ggtt->invalidate (ggtt); -} - -static void bxt_vtd_ggtt_wa (struct i915_address_space *vm) -{ -/* -* Make sure the internal GAM fifo has been cleared of all GTT -* writes before exiting stop_machine(). This guarantees that -* any aperture accesses waiting to start in another process -* cannot back up behind the GTT writes causing a hang. -* The register can be any arbitrary GAM register. -*/ -intel_uncore_posting_read_fw (vm->gt->uncore,GFX_FLSH_CNTL_GEN6 ); -} - -static int bxt_vtd_ggtt_insert_page__cb (void *_arg) -{ -struct insert_page *arg = _arg; - -gen8_ggtt_insert_page (arg->vm, arg->addr, arg->offset, arg->level,0 ); -bxt_vtd_ggtt_wa (arg->vm); - -return 0 ; -} - -static void bxt_vtd_ggtt_insert_page__BKL (struct i915_address_space *vm, -dma_addr_t addr, -u64 offset, -enum i915_cache_level level, -u32 unused) -{ -struct insert_page arg = { vm, addr, offset, level }; - -stop_machine (bxt_vtd_ggtt_insert_page__cb, &arg,NULL ); -} - -static int bxt_vtd_ggtt_insert_entries__cb (void *_arg) -{ -struct insert_entries *arg = _arg; - -gen8_ggtt_insert_entries (arg->vm, arg->vma_res, arg->level, arg->flags); -bxt_vtd_ggtt_wa (arg->vm); - -return 0 ; -} - -static void bxt_vtd_ggtt_insert_entries__BKL (struct i915_address_space *vm, -struct i915_vma_resource *vma_res, -enum i915_cache_level level, -u32 flags) -{ -struct insert_entries arg = { vm, vma_res, level, flags }; - -stop_machine (bxt_vtd_ggtt_insert_entries__cb, &arg,NULL ); -} - -void intel_gt_gmch_gen5_chipset_flush (struct intel_gt *gt) -{ -intel_gmch_gtt_flush (); -} - -static void gmch_ggtt_invalidate (struct i915_ggtt *ggtt) -{ -intel_gmch_gtt_flush (); -} - -static void gen5_ggtt_clear_range (struct i915_address_space *vm, -u64 start,u64 length) -{ -intel_gmch_gtt_clear_range (start >>PAGE_SHIFT , length >>PAGE_SHIFT ); -} - -static void gen6_ggtt_clear_range (struct i915_address_space *vm, -u64 start,u64 length) -{ -struct i915_ggtt *ggtt =i915_vm_to_ggtt (vm); -unsigned int first_entry = start /I915_GTT_PAGE_SIZE ; -unsigned int num_entries = length /I915_GTT_PAGE_SIZE ; -gen6_pte_t scratch_pte,__iomem *gtt_base = - (gen6_pte_t __iomem *)ggtt->gsm + first_entry; -const int max_entries =ggtt_total_entries (ggtt) - first_entry; -int i; - -if (WARN (num_entries > max_entries, -"First entry = %d; Num entries = %d (max=%d)\n" , - first_entry, num_entries, max_entries)) - num_entries = max_entries; - - scratch_pte = vm->scratch[0 ]->encode; -for (i =0 ; i < num_entries; i++) -iowrite32 (scratch_pte, >t_base[i]); -} - -static void gen8_ggtt_clear_range (struct i915_address_space *vm, -u64 start,u64 length) -{ -struct i915_ggtt *ggtt =i915_vm_to_ggtt (vm); -unsigned int first_entry = start /I915_GTT_PAGE_SIZE ; -unsigned int num_entries = length /I915_GTT_PAGE_SIZE ; -const gen8_pte_t scratch_pte = vm->scratch[0 ]->encode; -gen8_pte_t __iomem *gtt_base = - (gen8_pte_t __iomem *)ggtt->gsm + first_entry; -const int max_entries =ggtt_total_entries (ggtt) - first_entry; -int i; - -if (WARN (num_entries > max_entries, -"First entry = %d; Num entries = %d (max=%d)\n" , - first_entry, num_entries, max_entries)) - num_entries = max_entries; - -for (i =0 ; i < num_entries; i++) -gen8_set_pte (>t_base[i], scratch_pte); -} - -static void gen5_gmch_remove (struct i915_address_space *vm) -{ -intel_gmch_remove (); -} - -static void gen6_gmch_remove (struct i915_address_space *vm) -{ -struct i915_ggtt *ggtt =i915_vm_to_ggtt (vm); - -iounmap (ggtt->gsm); -free_scratch (vm); -} - -/* -* Certain Gen5 chipsets require idling the GPU before -* unmapping anything from the GTT when VT-d is enabled. -*/ -static bool needs_idle_maps (struct drm_i915_private *i915) -{ -/* -* Query intel_iommu to see if we need the workaround. Presumably that -* was loaded first. -*/ -if (!i915_vtd_active (i915)) -return false; - -if (GRAPHICS_VER (i915) ==5 &&IS_MOBILE (i915)) -return true; - -if (GRAPHICS_VER (i915) ==12 ) -return true;/* XXX DMAR fault reason 7 */ - -return false; -} - -static unsigned int gen6_gttmmadr_size (struct drm_i915_private *i915) -{ -/* -* GEN6: GTTMMADR size is 4MB and GTTADR starts at 2MB offset -* GEN8: GTTMMADR size is 16MB and GTTADR starts at 8MB offset -*/ -GEM_BUG_ON (GRAPHICS_VER (i915) <6 ); -return (GRAPHICS_VER (i915) <8 ) ?SZ_4M :SZ_16M ; -} - -static unsigned int gen6_get_total_gtt_size (u16 snb_gmch_ctl) -{ - snb_gmch_ctl >>=SNB_GMCH_GGMS_SHIFT ; - snb_gmch_ctl &=SNB_GMCH_GGMS_MASK ; -return snb_gmch_ctl <<20 ; -} - -static unsigned int gen8_get_total_gtt_size (u16 bdw_gmch_ctl) -{ - bdw_gmch_ctl >>=BDW_GMCH_GGMS_SHIFT ; - bdw_gmch_ctl &=BDW_GMCH_GGMS_MASK ; -if (bdw_gmch_ctl) - bdw_gmch_ctl =1 << bdw_gmch_ctl; - -#ifdef CONFIG_X86_32 -/* Limit 32b platforms to a 2GB GGTT: 4 << 20 / pte size * I915_GTT_PAGE_SIZE */ -if (bdw_gmch_ctl >4 ) - bdw_gmch_ctl =4 ; -#endif - -return bdw_gmch_ctl <<20 ; -} - -static unsigned int gen6_gttadr_offset (struct drm_i915_private *i915) -{ -return gen6_gttmmadr_size (i915) /2 ; -} - -static int ggtt_probe_common (struct i915_ggtt *ggtt,u64 size) -{ -struct drm_i915_private *i915 = ggtt->vm.i915; -struct pci_dev *pdev =to_pci_dev (i915->drm.dev); -phys_addr_t phys_addr; -u32 pte_flags; -int ret; - -GEM_WARN_ON (pci_resource_len (pdev,0 ) !=gen6_gttmmadr_size (i915)); - phys_addr =pci_resource_start (pdev,0 ) +gen6_gttadr_offset (i915); - -/* -* On BXT+/ICL+ writes larger than 64 bit to the GTT pagetable range -* will be dropped. For WC mappings in general we have 64 byte burst -* writes when the WC buffer is flushed, so we can't use it, but have to -* resort to an uncached mapping. The WC issue is easily caught by the -* readback check when writing GTT PTE entries. -*/ -if (IS_GEN9_LP (i915) ||GRAPHICS_VER (i915) >=11 ) - ggtt->gsm =ioremap (phys_addr, size); -else - ggtt->gsm =ioremap_wc (phys_addr, size); -if (!ggtt->gsm) { -drm_err (&i915->drm,"Failed to map the ggtt page table\n" ); -return -ENOMEM ; - } - -kref_init (&ggtt->vm.resv_ref); - ret =setup_scratch_page (&ggtt->vm); -if (ret) { -drm_err (&i915->drm,"Scratch setup failed\n" ); -/* iounmap will also get called at remove, but meh */ -iounmap (ggtt->gsm); -return ret; - } - - pte_flags =0 ; -if (i915_gem_object_is_lmem (ggtt->vm.scratch[0 ])) - pte_flags |=PTE_LM ; - - ggtt->vm.scratch[0 ]->encode = - ggtt->vm.pte_encode (px_dma (ggtt->vm.scratch[0 ]), -I915_CACHE_NONE , pte_flags); - -return 0 ; -} - -int intel_gt_gmch_gen5_probe (struct i915_ggtt *ggtt) -{ -struct drm_i915_private *i915 = ggtt->vm.i915; -phys_addr_t gmadr_base; -int ret; - - ret =intel_gmch_probe (i915->bridge_dev,to_pci_dev (i915->drm.dev),NULL ); -if (!ret) { -drm_err (&i915->drm,"failed to set up gmch\n" ); -return -EIO ; - } - -intel_gmch_gtt_get (&ggtt->vm.total, &gmadr_base, &ggtt->mappable_end); - - ggtt->gmadr = - (struct resource )DEFINE_RES_MEM (gmadr_base, ggtt->mappable_end); - - ggtt->vm.alloc_pt_dma = alloc_pt_dma; - ggtt->vm.alloc_scratch_dma = alloc_pt_dma; - -if (needs_idle_maps (i915)) { -drm_notice (&i915->drm, -"Flushing DMA requests before IOMMU unmaps; performance may be degraded\n" ); - ggtt->do_idle_maps = true; - } - - ggtt->vm.insert_page = gen5_ggtt_insert_page; - ggtt->vm.insert_entries = gen5_ggtt_insert_entries; - ggtt->vm.clear_range = gen5_ggtt_clear_range; - ggtt->vm.cleanup = gen5_gmch_remove; - - ggtt->invalidate = gmch_ggtt_invalidate; - - ggtt->vm.vma_ops.bind_vma = intel_ggtt_bind_vma; - ggtt->vm.vma_ops.unbind_vma = intel_ggtt_unbind_vma; - -if (unlikely (ggtt->do_idle_maps)) -drm_notice (&i915->drm, -"Applying Ironlake quirks for intel_iommu\n" ); - -return 0 ; -} - -int intel_gt_gmch_gen6_probe (struct i915_ggtt *ggtt) -{ -struct drm_i915_private *i915 = ggtt->vm.i915; -struct pci_dev *pdev =to_pci_dev (i915->drm.dev); -unsigned int size; -u16 snb_gmch_ctl; - - ggtt->gmadr =intel_pci_resource (pdev,2 ); - ggtt->mappable_end =resource_size (&ggtt->gmadr); - -/* -* 64/512MB is the current min/max we actually know of, but this is -* just a coarse sanity check. -*/ -if (ggtt->mappable_end < (64 <<20 ) || ggtt->mappable_end > (512 <<20 )) { -drm_err (&i915->drm,"Unknown GMADR size (%pa)\n" , - &ggtt->mappable_end); -return -ENXIO ; - } - -pci_read_config_word (pdev,SNB_GMCH_CTRL , &snb_gmch_ctl); - - size =gen6_get_total_gtt_size (snb_gmch_ctl); - ggtt->vm.total = (size /sizeof (gen6_pte_t)) *I915_GTT_PAGE_SIZE ; - - ggtt->vm.alloc_pt_dma = alloc_pt_dma; - ggtt->vm.alloc_scratch_dma = alloc_pt_dma; - - ggtt->vm.clear_range = nop_clear_range; -if (!HAS_FULL_PPGTT (i915) ||intel_scanout_needs_vtd_wa (i915)) - ggtt->vm.clear_range = gen6_ggtt_clear_range; - ggtt->vm.insert_page = gen6_ggtt_insert_page; - ggtt->vm.insert_entries = gen6_ggtt_insert_entries; - ggtt->vm.cleanup = gen6_gmch_remove; - - ggtt->invalidate = gen6_ggtt_invalidate; - -if (HAS_EDRAM (i915)) - ggtt->vm.pte_encode = iris_pte_encode; -else if (IS_HASWELL (i915)) - ggtt->vm.pte_encode = hsw_pte_encode; -else if (IS_VALLEYVIEW (i915)) - ggtt->vm.pte_encode = byt_pte_encode; -else if (GRAPHICS_VER (i915) >=7 ) - ggtt->vm.pte_encode = ivb_pte_encode; -else - ggtt->vm.pte_encode = snb_pte_encode; - - ggtt->vm.vma_ops.bind_vma = intel_ggtt_bind_vma; - ggtt->vm.vma_ops.unbind_vma = intel_ggtt_unbind_vma; - -return ggtt_probe_common (ggtt, size); -} - -static unsigned int chv_get_total_gtt_size (u16 gmch_ctrl) -{ - gmch_ctrl >>=SNB_GMCH_GGMS_SHIFT ; - gmch_ctrl &=SNB_GMCH_GGMS_MASK ; - -if (gmch_ctrl) -return 1 << (20 + gmch_ctrl); - -return 0 ; -} - -int intel_gt_gmch_gen8_probe (struct i915_ggtt *ggtt) -{ -struct drm_i915_private *i915 = ggtt->vm.i915; -struct pci_dev *pdev =to_pci_dev (i915->drm.dev); -unsigned int size; -u16 snb_gmch_ctl; - -/* TODO: We're not aware of mappable constraints on gen8 yet */ -if (!HAS_LMEM (i915)) { - ggtt->gmadr =intel_pci_resource (pdev,2 ); - ggtt->mappable_end =resource_size (&ggtt->gmadr); - } - -pci_read_config_word (pdev,SNB_GMCH_CTRL , &snb_gmch_ctl); -if (IS_CHERRYVIEW (i915)) - size =chv_get_total_gtt_size (snb_gmch_ctl); -else - size =gen8_get_total_gtt_size (snb_gmch_ctl); - - ggtt->vm.alloc_pt_dma = alloc_pt_dma; - ggtt->vm.alloc_scratch_dma = alloc_pt_dma; - ggtt->vm.lmem_pt_obj_flags =I915_BO_ALLOC_PM_EARLY ; - - ggtt->vm.total = (size /sizeof (gen8_pte_t)) *I915_GTT_PAGE_SIZE ; - ggtt->vm.cleanup = gen6_gmch_remove; - ggtt->vm.insert_page = gen8_ggtt_insert_page; - ggtt->vm.clear_range = nop_clear_range; -if (intel_scanout_needs_vtd_wa (i915)) - ggtt->vm.clear_range = gen8_ggtt_clear_range; - - ggtt->vm.insert_entries = gen8_ggtt_insert_entries; - -/* -* Serialize GTT updates with aperture access on BXT if VT-d is on, -* and always on CHV. -*/ -if (intel_vm_no_concurrent_access_wa (i915)) { - ggtt->vm.insert_entries = bxt_vtd_ggtt_insert_entries__BKL; - ggtt->vm.insert_page = bxt_vtd_ggtt_insert_page__BKL; - ggtt->vm.bind_async_flags = -I915_VMA_GLOBAL_BIND |I915_VMA_LOCAL_BIND ; - } - - ggtt->invalidate = gen8_ggtt_invalidate; - - ggtt->vm.vma_ops.bind_vma = intel_ggtt_bind_vma; - ggtt->vm.vma_ops.unbind_vma = intel_ggtt_unbind_vma; - - ggtt->vm.pte_encode = gen8_ggtt_pte_encode; - -setup_private_pat (ggtt->vm.gt->uncore); - -return ggtt_probe_common (ggtt, size); -} - -int intel_gt_gmch_gen5_enable_hw (struct drm_i915_private *i915) -{ -if (GRAPHICS_VER (i915) <6 && !intel_gmch_enable_gtt ()) -return -EIO ; - -return 0 ; -}drivers/gpu/drm/i915/gt/intel_gt_gmch.h deleted +0
-46@@ -1,46 +0,0 @@ -/* SPDX-License-Identifier: MIT */ -/* -* Copyright © 2022 Intel Corporation -*/ - -#ifndef __INTEL_GT_GMCH_H__ -#define __INTEL_GT_GMCH_H__ - -#include "intel_gtt.h" - -/* For x86 platforms */ -#if IS_ENABLED (CONFIG_X86 ) -void intel_gt_gmch_gen5_chipset_flush (struct intel_gt *gt); -int intel_gt_gmch_gen6_probe (struct i915_ggtt *ggtt); -int intel_gt_gmch_gen8_probe (struct i915_ggtt *ggtt); -int intel_gt_gmch_gen5_probe (struct i915_ggtt *ggtt); -int intel_gt_gmch_gen5_enable_hw (struct drm_i915_private *i915); - -/* Stubs for non-x86 platforms */ -#else -static inline void intel_gt_gmch_gen5_chipset_flush (struct intel_gt *gt) -{ -} -static inline int intel_gt_gmch_gen5_probe (struct i915_ggtt *ggtt) -{ -/* No HW should be probed for this case yet, return fail */ -return -ENODEV ; -} -static inline int intel_gt_gmch_gen6_probe (struct i915_ggtt *ggtt) -{ -/* No HW should be probed for this case yet, return fail */ -return -ENODEV ; -} -static inline int intel_gt_gmch_gen8_probe (struct i915_ggtt *ggtt) -{ -/* No HW should be probed for this case yet, return fail */ -return -ENODEV ; -} -static inline int intel_gt_gmch_gen5_enable_hw (struct drm_i915_private *i915) -{ -/* No HW should be enabled for this case yet, return fail */ -return -ENODEV ; -} -#endif - -#endif /* __INTEL_GT_GMCH_H__ */ drivers/gpu/drm/i915/gt/intel_gtt.h +5
-7@@ -548,14 +548,13 @@ i915_page_dir_dma_addr(const struct i915_ppgtt *ppgtt, const unsigned int n)void ppgtt_init (struct i915_ppgtt *ppgtt,struct intel_gt *gt,unsigned long lmem_pt_obj_flags); -void intel_ggtt_bind_vma (struct i915_address_space *vm, -struct i915_vm_pt_stash *stash, -struct i915_vma_resource *vma_res, -enum i915_cache_level cache_level, -u32 flags); +struct i915_vm_pt_stash *stash, +struct i915_vma_resource *vma_res, +enum i915_cache_level cache_level, +u32 flags);void intel_ggtt_unbind_vma (struct i915_address_space *vm, -struct i915_vma_resource *vma_res); +struct i915_vma_resource *vma_res);int i915_ggtt_probe_hw (struct drm_i915_private *i915);int i915_ggtt_init_hw (struct drm_i915_private *i915);@@ -627,7 +626,6 @@ release_pd_entry(struct i915_page_directory * const pd,struct i915_page_table *const pt, const struct drm_i915_gem_object * const scratch);void gen6_ggtt_invalidate (struct i915_ggtt *ggtt); -void gen8_ggtt_invalidate (struct i915_ggtt *ggtt); void ppgtt_bind_vma(struct i915_address_space *vm, struct i915_vm_pt_stash *stash,Signature · 1 line
2.36.1
Signature · 4 lines
Matt Roper Graphics Software Engineer VTT-OSGC Platform Enablement Intel Corporation
Re: [Intel-gfx] [PATCH 2/2] drm/i915/gt: Re-do the intel-gtt split
Quoted 700 lines · Matt Roper
Quoted 434 lines · Lucas De Marchi
Re-do what was attempted in commit
7a5c922377b4("drm/i915/gt: Split intel-gtt functions by arch"). The goal of that commit was to split the handlers for older hardware that depend on intel-gtt.ko so i915 can be built for non-x86 archs, after some more patches. Other archs do not need intel-gtt.ko.Main issue with the previous approach: it moved all the hooks, including the gen8, which is used by all platforms gen8 and newer. Re-do the split moving only the handlers for gen < 6, which are the only ones calling out to the separate module.
Signed-off-by Lucas De Marchi <[email protected]>--- drivers/gpu/drm/i915/Makefile | 2 +- drivers/gpu/drm/i915/gt/intel_ggtt.c | 559 +++++++++++++++++- drivers/gpu/drm/i915/gt/intel_ggtt_gmch.c | 132 +++++ drivers/gpu/drm/i915/gt/intel_ggtt_gmch.h | 27 + drivers/gpu/drm/i915/gt/intel_gt.c | 5 +- drivers/gpu/drm/i915/gt/intel_gt.h | 9 - drivers/gpu/drm/i915/gt/intel_gt_gmch.c | 654 ---------------------- drivers/gpu/drm/i915/gt/intel_gt_gmch.h | 46 -- drivers/gpu/drm/i915/gt/intel_gtt.h | 12 +- 9 files changed, 713 insertions(+), 733 deletions(-) create mode 100644 drivers/gpu/drm/i915/gt/intel_ggtt_gmch.c create mode 100644 drivers/gpu/drm/i915/gt/intel_ggtt_gmch.h delete mode 100644 drivers/gpu/drm/i915/gt/intel_gt_gmch.c delete mode 100644 drivers/gpu/drm/i915/gt/intel_gt_gmch.hdrivers/gpu/drm/i915/Makefile +1
-1@@ -129,7 +129,7 @@ gt-y += \ gt/shmem_utils.o \ gt/sysfs_engines.o # x86 intel-gtt module support -gt-$(CONFIG_X86) += gt/intel_gt_gmch.o +gt-$(CONFIG_X86) += gt/intel_ggtt_gmch.o # autogenerated null render state gt-y += \ gt/gen6_renderstate.o \drivers/gpu/drm/i915/gt/intel_ggtt.c +336
-9@@ -3,16 +3,18 @@* Copyright © 2020 Intel Corporation */ -#include <linux/types.h> #include <asm/set_memory.h> #include <asm/smp.h> +#include <linux/types.h> +#include <linux/stop_machine.h> #include <drm/i915_drm.h> +#include <drm/intel-gtt.h> #include "gem/i915_gem_lmem.h" +#include "intel_ggtt_gmch.h" #include "intel_gt.h" -#include "intel_gt_gmch.h" #include "intel_gt_regs.h" #include "i915_drv.h" #include "i915_scatterlist.h" @@ -181,7 +183,7 @@ void gen6_ggtt_invalidate(struct i915_ggtt *ggtt)spin_unlock_irq (&uncore->lock); } -void gen8_ggtt_invalidate (struct i915_ggtt *ggtt) +static void gen8_ggtt_invalidate (struct i915_ggtt *ggtt) {struct intel_uncore *uncore = ggtt->vm.gt->uncore;@@ -218,11 +220,232 @@ u64 gen8_ggtt_pte_encode(dma_addr_t addr,return pte; } +static void gen8_set_pte (void __iomem *addr,gen8_pte_t pte) +{ +writeq (pte, addr); +} + +static void gen8_ggtt_insert_page (struct i915_address_space *vm, +dma_addr_t addr, +u64 offset, +enum i915_cache_level level, +u32 flags) +{ +struct i915_ggtt *ggtt =i915_vm_to_ggtt (vm); +gen8_pte_t __iomem *pte = + (gen8_pte_t __iomem *)ggtt->gsm + offset /I915_GTT_PAGE_SIZE ; + +gen8_set_pte (pte,gen8_ggtt_pte_encode (addr, level, flags)); + + ggtt->invalidate (ggtt); +} + +static void gen8_ggtt_insert_entries (struct i915_address_space *vm, +struct i915_vma_resource *vma_res, +enum i915_cache_level level, +u32 flags) +{ +const gen8_pte_t pte_encode =gen8_ggtt_pte_encode (0 , level, flags); +struct i915_ggtt *ggtt =i915_vm_to_ggtt (vm); +gen8_pte_t __iomem *gte; +gen8_pte_t __iomem *end; +struct sgt_iter iter; +dma_addr_t addr; + +/* +* Note that we ignore PTE_READ_ONLY here. The caller must be careful +* not to allow the user to override access to a read only page. +*/ + + gte = (gen8_pte_t __iomem *)ggtt->gsm; + gte += vma_res->start /I915_GTT_PAGE_SIZE ; + end = gte + vma_res->node_size /I915_GTT_PAGE_SIZE ; + +for_each_sgt_daddr (addr, iter, vma_res->bi.pages) +gen8_set_pte (gte++, pte_encode | addr); +GEM_BUG_ON (gte > end); + +/* Fill the allocated but "unused" space beyond the end of the buffer */ +while (gte < end) +gen8_set_pte (gte++, vm->scratch[0 ]->encode); + +/* +* We want to flush the TLBs only after we're certain all the PTE +* updates have finished. +*/ + ggtt->invalidate (ggtt); +} + +static void gen6_ggtt_insert_page (struct i915_address_space *vm, +dma_addr_t addr, +u64 offset, +enum i915_cache_level level, +u32 flags) +{ +struct i915_ggtt *ggtt =i915_vm_to_ggtt (vm); +gen6_pte_t __iomem *pte = + (gen6_pte_t __iomem *)ggtt->gsm + offset /I915_GTT_PAGE_SIZE ; + +iowrite32 (vm->pte_encode (addr, level, flags), pte); + + ggtt->invalidate (ggtt); +} + +/* +* Binds an object into the global gtt with the specified cache level. +* The object will be accessible to the GPU via commands whose operands +* reference offsets within the global GTT as well as accessible by the GPU +* through the GMADR mapped BAR (i915->mm.gtt->gtt). +*/ +static void gen6_ggtt_insert_entries (struct i915_address_space *vm, +struct i915_vma_resource *vma_res, +enum i915_cache_level level, +u32 flags) +{ +struct i915_ggtt *ggtt =i915_vm_to_ggtt (vm); +gen6_pte_t __iomem *gte; +gen6_pte_t __iomem *end; +struct sgt_iter iter; +dma_addr_t addr; + + gte = (gen6_pte_t __iomem *)ggtt->gsm; + gte += vma_res->start /I915_GTT_PAGE_SIZE ; + end = gte + vma_res->node_size /I915_GTT_PAGE_SIZE ; + +for_each_sgt_daddr (addr, iter, vma_res->bi.pages) +iowrite32 (vm->pte_encode (addr, level, flags), gte++); +GEM_BUG_ON (gte > end); + +/* Fill the allocated but "unused" space beyond the end of the buffer */ +while (gte < end) +iowrite32 (vm->scratch[0 ]->encode, gte++); + +/* +* We want to flush the TLBs only after we're certain all the PTE +* updates have finished. +*/ + ggtt->invalidate (ggtt); +} + +static void nop_clear_range (struct i915_address_space *vm, +u64 start,u64 length) +{ +} + +static void gen8_ggtt_clear_range (struct i915_address_space *vm, +u64 start,u64 length) +{ +struct i915_ggtt *ggtt =i915_vm_to_ggtt (vm); +unsigned int first_entry = start /I915_GTT_PAGE_SIZE ; +unsigned int num_entries = length /I915_GTT_PAGE_SIZE ; +const gen8_pte_t scratch_pte = vm->scratch[0 ]->encode; +gen8_pte_t __iomem *gtt_base = + (gen8_pte_t __iomem *)ggtt->gsm + first_entry; +const int max_entries =ggtt_total_entries (ggtt) - first_entry; +int i; + +if (WARN (num_entries > max_entries, +"First entry = %d; Num entries = %d (max=%d)\n" , + first_entry, num_entries, max_entries)) + num_entries = max_entries; + +for (i =0 ; i < num_entries; i++) +gen8_set_pte (>t_base[i], scratch_pte); +} + +static void bxt_vtd_ggtt_wa (struct i915_address_space *vm) +{ +/* +* Make sure the internal GAM fifo has been cleared of all GTT +* writes before exiting stop_machine(). This guarantees that +* any aperture accesses waiting to start in another process +* cannot back up behind the GTT writes causing a hang. +* The register can be any arbitrary GAM register. +*/ +intel_uncore_posting_read_fw (vm->gt->uncore,GFX_FLSH_CNTL_GEN6 ); +} + +struct insert_page { +struct i915_address_space *vm; +dma_addr_t addr; +u64 offset; +enum i915_cache_level level; +}; + +static int bxt_vtd_ggtt_insert_page__cb (void *_arg) +{ +struct insert_page *arg = _arg; + +gen8_ggtt_insert_page (arg->vm, arg->addr, arg->offset, arg->level,0 ); +bxt_vtd_ggtt_wa (arg->vm); + +return 0 ; +} + +static void bxt_vtd_ggtt_insert_page__BKL (struct i915_address_space *vm, +dma_addr_t addr, +u64 offset, +enum i915_cache_level level, +u32 unused) +{ +struct insert_page arg = { vm, addr, offset, level }; + +stop_machine (bxt_vtd_ggtt_insert_page__cb, &arg,NULL ); +} + +struct insert_entries { +struct i915_address_space *vm; +struct i915_vma_resource *vma_res; +enum i915_cache_level level; +u32 flags; +}; + +static int bxt_vtd_ggtt_insert_entries__cb (void *_arg) +{ +struct insert_entries *arg = _arg; + +gen8_ggtt_insert_entries (arg->vm, arg->vma_res, arg->level, arg->flags); +bxt_vtd_ggtt_wa (arg->vm); + +return 0 ; +} + +static void bxt_vtd_ggtt_insert_entries__BKL (struct i915_address_space *vm, +struct i915_vma_resource *vma_res, +enum i915_cache_level level, +u32 flags) +{ +struct insert_entries arg = { vm, vma_res, level, flags }; + +stop_machine (bxt_vtd_ggtt_insert_entries__cb, &arg,NULL ); +} + +static void gen6_ggtt_clear_range (struct i915_address_space *vm, +u64 start,u64 length) +{ +struct i915_ggtt *ggtt =i915_vm_to_ggtt (vm); +unsigned int first_entry = start /I915_GTT_PAGE_SIZE ; +unsigned int num_entries = length /I915_GTT_PAGE_SIZE ; +gen6_pte_t scratch_pte,__iomem *gtt_base = + (gen6_pte_t __iomem *)ggtt->gsm + first_entry; +const int max_entries =ggtt_total_entries (ggtt) - first_entry; +int i; + +if (WARN (num_entries > max_entries, +"First entry = %d; Num entries = %d (max=%d)\n" , + first_entry, num_entries, max_entries)) + num_entries = max_entries; + + scratch_pte = vm->scratch[0 ]->encode; +for (i =0 ; i < num_entries; i++) +iowrite32 (scratch_pte, >t_base[i]); +} +void intel_ggtt_bind_vma (struct i915_address_space *vm, -struct i915_vm_pt_stash *stash, -struct i915_vma_resource *vma_res, -enum i915_cache_level cache_level, -u32 flags) +struct i915_vm_pt_stash *stash, +struct i915_vma_resource *vma_res, +enum i915_cache_level cache_level, +u32 flags) {u32 pte_flags;@@ -243,7 +466,7 @@ void intel_ggtt_bind_vma(struct i915_address_space *vm, }void intel_ggtt_unbind_vma (struct i915_address_space *vm, -struct i915_vma_resource *vma_res) +struct i915_vma_resource *vma_res) { vm->clear_range (vm, vma_res->start, vma_res->vma_size); }@@ -560,12 +783,317 @@ void i915_ggtt_driver_late_release(struct drm_i915_private *i915)dma_resv_fini (&ggtt->vm._resv); } -struct resource intel_pci_resource (struct pci_dev *pdev,int bar) +static unsigned int gen6_get_total_gtt_size (u16 snb_gmch_ctl) +{ + snb_gmch_ctl >>=SNB_GMCH_GGMS_SHIFT ; + snb_gmch_ctl &=SNB_GMCH_GGMS_MASK ; +return snb_gmch_ctl <<20 ; +} + +static unsigned int gen8_get_total_gtt_size (u16 bdw_gmch_ctl) +{ + bdw_gmch_ctl >>=BDW_GMCH_GGMS_SHIFT ; + bdw_gmch_ctl &=BDW_GMCH_GGMS_MASK ; +if (bdw_gmch_ctl) + bdw_gmch_ctl =1 << bdw_gmch_ctl; + +#ifdef CONFIG_X86_32 +/* Limit 32b platforms to a 2GB GGTT: 4 << 20 / pte size * I915_GTT_PAGE_SIZE */ +if (bdw_gmch_ctl >4 ) + bdw_gmch_ctl =4 ; +#endif + +return bdw_gmch_ctl <<20 ; +} + +static unsigned int chv_get_total_gtt_size (u16 gmch_ctrl) +{ + gmch_ctrl >>=SNB_GMCH_GGMS_SHIFT ; + gmch_ctrl &=SNB_GMCH_GGMS_MASK ; + +if (gmch_ctrl) +return 1 << (20 + gmch_ctrl); + +return 0 ; +} + +static unsigned int gen6_gttmmadr_size (struct drm_i915_private *i915) +{ +/* +* GEN6: GTTMMADR size is 4MB and GTTADR starts at 2MB offset +* GEN8: GTTMMADR size is 16MB and GTTADR starts at 8MB offset +*/ +GEM_BUG_ON (GRAPHICS_VER (i915) <6 ); +return (GRAPHICS_VER (i915) <8 ) ?SZ_4M :SZ_16M ; +} + +static unsigned int gen6_gttadr_offset (struct drm_i915_private *i915) +{ +return gen6_gttmmadr_size (i915) /2 ; +} + +static int ggtt_probe_common (struct i915_ggtt *ggtt,u64 size) +{ +struct drm_i915_private *i915 = ggtt->vm.i915; +struct pci_dev *pdev =to_pci_dev (i915->drm.dev); +phys_addr_t phys_addr; +u32 pte_flags; +int ret; + +GEM_WARN_ON (pci_resource_len (pdev,0 ) !=gen6_gttmmadr_size (i915)); + phys_addr =pci_resource_start (pdev,0 ) +gen6_gttadr_offset (i915); + +/* +* On BXT+/ICL+ writes larger than 64 bit to the GTT pagetable range +* will be dropped. For WC mappings in general we have 64 byte burst +* writes when the WC buffer is flushed, so we can't use it, but have to +* resort to an uncached mapping. The WC issue is easily caught by the +* readback check when writing GTT PTE entries. +*/ +if (IS_GEN9_LP (i915) ||GRAPHICS_VER (i915) >=11 ) + ggtt->gsm =ioremap (phys_addr, size); +else + ggtt->gsm =ioremap_wc (phys_addr, size); +if (!ggtt->gsm) { +drm_err (&i915->drm,"Failed to map the ggtt page table\n" ); +return -ENOMEM ; + } + +kref_init (&ggtt->vm.resv_ref); + ret =setup_scratch_page (&ggtt->vm); +if (ret) { +drm_err (&i915->drm,"Scratch setup failed\n" ); +/* iounmap will also get called at remove, but meh */ +iounmap (ggtt->gsm); +return ret; + } + + pte_flags =0 ; +if (i915_gem_object_is_lmem (ggtt->vm.scratch[0 ])) + pte_flags |=PTE_LM ; + + ggtt->vm.scratch[0 ]->encode = + ggtt->vm.pte_encode (px_dma (ggtt->vm.scratch[0 ]), +I915_CACHE_NONE , pte_flags); + +return 0 ; +} + +static void gen6_gmch_remove (struct i915_address_space *vm) +{ +struct i915_ggtt *ggtt =i915_vm_to_ggtt (vm); + +iounmap (ggtt->gsm); +free_scratch (vm); +} + +static struct resource pci_resource (struct pci_dev *pdev,int bar) {return (struct resource )DEFINE_RES_MEM (pci_resource_start (pdev, bar),pci_resource_len (pdev, bar));drivers/gpu/drm/i915/gt/intel_ggtt.c void i915_ggtt_driver_late_release(struct drm_i915_private *i915) · line 903
Quoted 10 lines
drivers/gpu/drm/i915/gt/intel_ggtt.c +8
-0} +static int gen8_gmch_probe (struct i915_ggtt *ggtt) +{ +struct drm_i915_private *i915 = ggtt->vm.i915; +struct pci_dev *pdev =to_pci_dev (i915->drm.dev); +unsigned int size; +u16 snb_gmch_ctl; + +/* TODO: We're not aware of mappable constraints on gen8 yet */ We could probably take the opportunity to drop this TODO while moving the function. Given how old gen8 is now I think it's safe to say that there aren't any extra constraints we haven't found out about yet. :-)
Quoted 200 lines
drivers/gpu/drm/i915/gt/intel_ggtt.c +193
-0+if (!HAS_LMEM (i915)) { + ggtt->gmadr =pci_resource (pdev,2 ); + ggtt->mappable_end =resource_size (&ggtt->gmadr); + } + +pci_read_config_word (pdev,SNB_GMCH_CTRL , &snb_gmch_ctl); +if (IS_CHERRYVIEW (i915)) + size =chv_get_total_gtt_size (snb_gmch_ctl); +else + size =gen8_get_total_gtt_size (snb_gmch_ctl); + + ggtt->vm.alloc_pt_dma = alloc_pt_dma; + ggtt->vm.alloc_scratch_dma = alloc_pt_dma; + ggtt->vm.lmem_pt_obj_flags =I915_BO_ALLOC_PM_EARLY ; + + ggtt->vm.total = (size /sizeof (gen8_pte_t)) *I915_GTT_PAGE_SIZE ; + ggtt->vm.cleanup = gen6_gmch_remove; + ggtt->vm.insert_page = gen8_ggtt_insert_page; + ggtt->vm.clear_range = nop_clear_range; +if (intel_scanout_needs_vtd_wa (i915)) + ggtt->vm.clear_range = gen8_ggtt_clear_range; + + ggtt->vm.insert_entries = gen8_ggtt_insert_entries; + +/* +* Serialize GTT updates with aperture access on BXT if VT-d is on, +* and always on CHV. +*/ +if (intel_vm_no_concurrent_access_wa (i915)) { + ggtt->vm.insert_entries = bxt_vtd_ggtt_insert_entries__BKL; + ggtt->vm.insert_page = bxt_vtd_ggtt_insert_page__BKL; + ggtt->vm.bind_async_flags = +I915_VMA_GLOBAL_BIND |I915_VMA_LOCAL_BIND ; + } + + ggtt->invalidate = gen8_ggtt_invalidate; + + ggtt->vm.vma_ops.bind_vma = intel_ggtt_bind_vma; + ggtt->vm.vma_ops.unbind_vma = intel_ggtt_unbind_vma; + + ggtt->vm.pte_encode = gen8_ggtt_pte_encode; + +setup_private_pat (ggtt->vm.gt->uncore); + +return ggtt_probe_common (ggtt, size); +} + +static u64 snb_pte_encode (dma_addr_t addr, +enum i915_cache_level level, +u32 flags) +{ +gen6_pte_t pte =GEN6_PTE_ADDR_ENCODE (addr) |GEN6_PTE_VALID ; + +switch (level) { +case I915_CACHE_L3_LLC : +case I915_CACHE_LLC : + pte |=GEN6_PTE_CACHE_LLC ; +break ; +case I915_CACHE_NONE : + pte |=GEN6_PTE_UNCACHED ; +break ; +default : +MISSING_CASE (level); + } + +return pte; +} + +static u64 ivb_pte_encode (dma_addr_t addr, +enum i915_cache_level level, +u32 flags) +{ +gen6_pte_t pte =GEN6_PTE_ADDR_ENCODE (addr) |GEN6_PTE_VALID ; + +switch (level) { +case I915_CACHE_L3_LLC : + pte |=GEN7_PTE_CACHE_L3_LLC ; +break ; +case I915_CACHE_LLC : + pte |=GEN6_PTE_CACHE_LLC ; +break ; +case I915_CACHE_NONE : + pte |=GEN6_PTE_UNCACHED ; +break ; +default : +MISSING_CASE (level); + } + +return pte; +} + +static u64 byt_pte_encode (dma_addr_t addr, +enum i915_cache_level level, +u32 flags) +{ +gen6_pte_t pte =GEN6_PTE_ADDR_ENCODE (addr) |GEN6_PTE_VALID ; + +if (!(flags &PTE_READ_ONLY )) + pte |=BYT_PTE_WRITEABLE ; + +if (level !=I915_CACHE_NONE ) + pte |=BYT_PTE_SNOOPED_BY_CPU_CACHES ; + +return pte; +} + +static u64 hsw_pte_encode (dma_addr_t addr, +enum i915_cache_level level, +u32 flags) +{ +gen6_pte_t pte =HSW_PTE_ADDR_ENCODE (addr) |GEN6_PTE_VALID ; + +if (level !=I915_CACHE_NONE ) + pte |=HSW_WB_LLC_AGE3 ; + +return pte; +} + +static u64 iris_pte_encode (dma_addr_t addr, +enum i915_cache_level level, +u32 flags) +{ +gen6_pte_t pte =HSW_PTE_ADDR_ENCODE (addr) |GEN6_PTE_VALID ; + +switch (level) { +case I915_CACHE_NONE : +break ; +case I915_CACHE_WT : + pte |=HSW_WT_ELLC_LLC_AGE3 ; +break ; +default : + pte |=HSW_WB_ELLC_LLC_AGE3 ; +break ; + } + +return pte; +} + +static int gen6_gmch_probe (struct i915_ggtt *ggtt) +{ +struct drm_i915_private *i915 = ggtt->vm.i915; +struct pci_dev *pdev =to_pci_dev (i915->drm.dev); +unsigned int size; +u16 snb_gmch_ctl; + + ggtt->gmadr =pci_resource (pdev,2 ); + ggtt->mappable_end =resource_size (&ggtt->gmadr); + +/* +* 64/512MB is the current min/max we actually know of, but this is +* just a coarse sanity check. +*/ +if (ggtt->mappable_end < (64 <<20 ) || + ggtt->mappable_end > (512 <<20 )) { +drm_err (&i915->drm,"Unknown GMADR size (%pa)\n" , + &ggtt->mappable_end); +return -ENXIO ; + } + +pci_read_config_word (pdev,SNB_GMCH_CTRL , &snb_gmch_ctl); + + size =gen6_get_total_gtt_size (snb_gmch_ctl); + ggtt->vm.total = (size /sizeof (gen6_pte_t)) *I915_GTT_PAGE_SIZE ; + + ggtt->vm.alloc_pt_dma = alloc_pt_dma; + ggtt->vm.alloc_scratch_dma = alloc_pt_dma; + + ggtt->vm.clear_range = nop_clear_range; +if (!HAS_FULL_PPGTT (i915) ||intel_scanout_needs_vtd_wa (i915)) + ggtt->vm.clear_range = gen6_ggtt_clear_range; + ggtt->vm.insert_page = gen6_ggtt_insert_page; + ggtt->vm.insert_entries = gen6_ggtt_insert_entries; + ggtt->vm.cleanup = gen6_gmch_remove; + + ggtt->invalidate = gen6_ggtt_invalidate; + +if (HAS_EDRAM (i915)) + ggtt->vm.pte_encode = iris_pte_encode; +else if (IS_HASWELL (i915)) + ggtt->vm.pte_encode = hsw_pte_encode; +else if (IS_VALLEYVIEW (i915)) + ggtt->vm.pte_encode = byt_pte_encode; +else if (GRAPHICS_VER (i915) >=7 ) + ggtt->vm.pte_encode = ivb_pte_encode; +else + ggtt->vm.pte_encode = snb_pte_encode; + + ggtt->vm.vma_ops.bind_vma = intel_ggtt_bind_vma; + ggtt->vm.vma_ops.unbind_vma = intel_ggtt_unbind_vma; + +return ggtt_probe_common (ggtt, size); +} +static int ggtt_probe_hw (struct i915_ggtt *ggtt,struct intel_gt *gt) {struct drm_i915_private *i915 = gt->i915;@@ -576,12 +1104,12 @@ static int ggtt_probe_hw(struct i915_ggtt *ggtt, struct intel_gt *gt) ggtt->vm.dma = i915->drm.dev;dma_resv_init (&ggtt->vm._resv);drivers/gpu/drm/i915/gt/intel_ggtt.c static int ggtt_probe_hw(struct i915_ggtt *ggtt, struct intel_gt *gt) · line 1112
Quoted 10 lines
drivers/gpu/drm/i915/gt/intel_ggtt.c +4
-4-if (GRAPHICS_VER (i915) <=5 ) - ret =intel_gt_gmch_gen5_probe (ggtt); +if (GRAPHICS_VER (i915) <6 ) + ret =intel_ggtt_gmch_probe (ggtt);else if (GRAPHICS_VER (i915) <8 ) - ret =intel_gt_gmch_gen6_probe (ggtt); + ret =gen6_gmch_probe (ggtt);else - ret =intel_gt_gmch_gen8_probe (ggtt); + ret =gen8_gmch_probe (ggtt);We could also take the opportunity to reverse the if/else ladder here and put it in the i915-preferred "newest at top" order.
Quoted 36 lines
drivers/gpu/drm/i915/gt/intel_ggtt.c +4
-1if (ret) {dma_resv_fini (&ggtt->vm._resv);return ret;@@ -635,7 +1163,10 @@ int i915_ggtt_probe_hw(struct drm_i915_private *i915)int i915_ggtt_enable_hw (struct drm_i915_private *i915) { -return intel_gt_gmch_gen5_enable_hw (i915); +if (GRAPHICS_VER (i915) <6 ) +return intel_ggtt_gmch_enable_hw (i915); + +return 0 ; }void i915_ggtt_enable_guc (struct i915_ggtt *ggtt)drivers/gpu/drm/i915/gt/intel_ggtt_gmch.c new file +15
-0@@ -0,0 +1,132 @@ +// SPDX-License-Identifier: MIT +/* +* Copyright © 2022 Intel Corporation +*/ + +#include "intel_ggtt_gmch.h" + +#include <drm/intel-gtt.h> +#include <drm/i915_drm.h> + +#include <linux/agp_backend.h> + +#include "i915_drv.h" +#include "i915_utils.h" +#include "intel_gtt.h"
Quoted 8 lines
drivers/gpu/drm/i915/gt/intel_ggtt_gmch.c line 19
Quoted 4 lines
drivers/gpu/drm/i915/gt/intel_ggtt_gmch.c new file +4
-0+#include "intel_gt_regs.h" +#include "intel_gt.h" + +static void gen5_ggtt_insert_page(struct i915_address_space *vm,All the "
gen5_" prefixes in this file seem a bit misleading if they wind up getting used on earlier platforms too; most of the driver uses the prefix to indicate the first platform/architecture that the function was
yeah... I think at the time we didn't want to say "gen1" (or whatever is the oldest one we support), so we just left with gen5.
Quoted 3 lines
used on. Maybe we should also rename these with a "
gmch_" prefix as well to indicate that they're intended for the platforms where the GMCH was an independent chip and not integrated into the CPU?
Yeah, now that that intel-gtt symbols are renamed, we can use gmch_* prefix that calls out to intel_gmch_* symbols from that module.
Quoted 3 lines
Anyway, all of my review comments are just bikeshedding so feel free to
but I like the color of your shed :)
I will squash these changes here and make a note in the commit message. And also mention something I forgot to say... that I removed some dead code for gen12 from needs_idle_maps() since that function is not called for anything above gen5.
Quoted 4 lines
use or ignore them as you see fit. Either way, this series should fix the issue and restore GGTT handling for non-x86.
Reviewed-by Matt Roper <[email protected]>
thanks. I will keep the r-b in the next version.
Lucas De Marchi
Patchwork
CI[Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for series starting with [1/2] agp/intel: Rename intel-gtt symbols
In reply to Lucas De Marchi== Series Details ==
== Series Details ==
Series: series starting with [1/2] agp/intel: Rename intel-gtt symbols
URL : https://patchwork.freedesktop.org/series/105261/
State : warning
== Summary ==
Error: dim checkpatch failede1bbe8530903 agp/intel: Rename intel-gtt symbolsdeae3fe392d9 drm/i915/gt: Re-do the intel-gtt split
Traceback (most recent call last):
File "scripts/spdxcheck.py", line 6, in <module>
from ply import lex, yacc
ModuleNotFoundError: No module named 'ply'
Traceback (most recent call last):
File "scripts/spdxcheck.py", line 6, in <module>
from ply import lex, yacc
ModuleNotFoundError: No module named 'ply'
-:661: WARNING:FILE_PATH_CHANGES: added, moved or deleted file(s), does MAINTAINERS need updating? #661:
new file mode 100644
total: 0 errors, 1 warnings, 0 checks, 856 lines checked
Patchwork
CI[Intel-gfx] ✗ Fi.CI.SPARSE: warning for series starting with [1/2] agp/intel: Rename intel-gtt symbols
In reply to Lucas De Marchi== Series Details ==
== Series Details ==
Series: series starting with [1/2] agp/intel: Rename intel-gtt symbols
URL : https://patchwork.freedesktop.org/series/105261/
State : warning
== Summary ==
Error: dim sparse failed
Sparse version: v0.6.2
Fast mode used, each commit won't be checked separately.
Patchwork
CI[Intel-gfx] ✓ Fi.CI.BAT: success for series starting with [1/2] agp/intel: Rename intel-gtt symbols
In reply to Lucas De Marchi== Series Details ==
== Series Details ==
Series: series starting with [1/2] agp/intel: Rename intel-gtt symbols
URL : https://patchwork.freedesktop.org/series/105261/
State : success
== Summary ==
CI Bug Log - changes from CI_DRM_11773 -> Patchwork_105261v1
====================================================
Summary
-------
**SUCCESS**
No regressions found.
External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_105261v1/index.html
Participating hosts (35 -> 32)
------------------------------
Missing (3): fi-bdw-samus fi-snb-2520m fi-pnv-d510
Known issues
------------
Here are the changes found in Patchwork_105261v1 that come from known issues:
### IGT changes ###
#### Possible fixes ####
* igt@i915_selftest@live@gt_lrc:
- fi-bsw-n3050: [DMESG-FAIL][1] ([i915#2373]) -> [PASS][2]
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11773/fi-bsw-n3050/igt@i915_selftest@live@gt_lrc.html
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_105261v1/fi-bsw-n3050/igt@i915_selftest@live@gt_lrc.html
[i915#2373]: https://gitlab.freedesktop.org/drm/intel/issues/2373
Build changes
-------------
* Linux: CI_DRM_11773 -> Patchwork_105261v1
CI-20190529: 20190529
CI_DRM_11773: 8025a295b7aa707f64c7984b7781c6f25e22a901 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_6533: 6b5107d91827962808441db6b98e478aa9e67bdb @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git
Patchwork_105261v1: 8025a295b7aa707f64c7984b7781c6f25e22a901 @ git://anongit.freedesktop.org/gfx-ci/linux
### Linux commits
0ccd88c50693 drm/i915/gt: Re-do the intel-gtt split 8a9df0f87182 agp/intel: Rename intel-gtt symbols
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_105261v1/index.html
Quoted 270 lines · Lucas De Marchi
Exporting the symbols like intel_gtt_* creates some confusion inside i915 that has symbols named similarly. In an attempt to isolate platforms needing intel-gtt.ko, commit
7a5c922377b4("drm/i915/gt: Split intel-gtt functions by arch") moved way too much
insidegt/intel_gt_gmch.c, even the functions that don't callout to this module. Rename the symbols to make the separation clear.Signed-off-by Lucas De Marchi <[email protected]>--- drivers/char/agp/intel-gtt.c | 58 ++++++++++++------------- drivers/gpu/drm/i915/gt/intel_gt_gmch.c | 16 +++---- include/drm/intel-gtt.h | 24 +++++----- 3 files changed, 49 insertions(+), 49 deletions(-)drivers/char/agp/intel-gtt.c +29
-29@@ -744,7 +744,7 @@ static void i830_write_entry(dma_addr_t addr, unsigned int entry,writel_relaxed (addr | pte_flags, intel_private.gtt + entry); } -bool intel_enable_gtt (void ) +bool intel_gmch_enable_gtt (void ) {u8 __iomem *reg;@@ -787,7 +787,7 @@ bool intel_enable_gtt(void)return true; } -EXPORT_SYMBOL (intel_enable_gtt); +EXPORT_SYMBOL (intel_gmch_enable_gtt);static int i830_setup (void ) {@@ -821,8 +821,8 @@ static int intel_fake_agp_free_gatt_table(struct agp_bridge_data *bridge)static int intel_fake_agp_configure (void ) { -if (!intel_enable_gtt ()) -return -EIO ; +if (!intel_gmch_enable_gtt ()) +return -EIO ; intel_private.clear_fake_agp = true; agp_bridge->gart_bus_addr = intel_private.gma_bus_addr;@@ -844,20 +844,20 @@ static bool i830_check_flags(unsigned int flags)return false; } -void intel_gtt_insert_page (dma_addr_t addr, -unsigned int pg, -unsigned int flags) +void intel_gmch_gtt_insert_page (dma_addr_t addr, +unsigned int pg, +unsigned int flags) { intel_private.driver->write_entry (addr, pg, flags);readl (intel_private.gtt + pg);if (intel_private.driver->chipset_flush) intel_private.driver->chipset_flush (); } -EXPORT_SYMBOL (intel_gtt_insert_page); +EXPORT_SYMBOL (intel_gmch_gtt_insert_page); -void intel_gtt_insert_sg_entries (struct sg_table *st, -unsigned int pg_start, -unsigned int flags) +void intel_gmch_gtt_insert_sg_entries (struct sg_table *st, +unsigned int pg_start, +unsigned int flags) {struct scatterlist *sg;unsigned int len, m;@@ -879,13 +879,13 @@ void intel_gtt_insert_sg_entries(struct sg_table *st,if (intel_private.driver->chipset_flush) intel_private.driver->chipset_flush (); } -EXPORT_SYMBOL (intel_gtt_insert_sg_entries); +EXPORT_SYMBOL (intel_gmch_gtt_insert_sg_entries);#if IS_ENABLED (CONFIG_AGP_INTEL ) -static void intel_gtt_insert_pages (unsigned int first_entry, -unsigned int num_entries, -struct page **pages, -unsigned int flags) +static void intel_gmch_gtt_insert_pages (unsigned int first_entry, +unsigned int num_entries, +struct page **pages, +unsigned int flags) {int i, j;@@ -905,7 +905,7 @@ static int intel_fake_agp_insert_entries(struct agp_memory *mem,if (intel_private.clear_fake_agp) {int start = intel_private.stolen_size /PAGE_SIZE ;int end = intel_private.gtt_mappable_entries; -intel_gtt_clear_range (start, end - start); +intel_gmch_gtt_clear_range (start, end - start); intel_private.clear_fake_agp = false; }@@ -934,12 +934,12 @@ static int intel_fake_agp_insert_entries(struct agp_memory *mem,if (ret !=0 )return ret; -intel_gtt_insert_sg_entries (&st, pg_start, type); +intel_gmch_gtt_insert_sg_entries (&st, pg_start, type); mem->sg_list = st.sgl; mem->num_sg = st.nents; }else -intel_gtt_insert_pages (pg_start, mem->page_count, mem->pages, - type); +intel_gmch_gtt_insert_pages (pg_start, mem->page_count, mem->pages, + type); out: ret =0 ;@@ -949,7 +949,7 @@ static int intel_fake_agp_insert_entries(struct agp_memory *mem, }#endif -void intel_gtt_clear_range (unsigned int first_entry,unsigned int num_entries) +void intel_gmch_gtt_clear_range (unsigned int first_entry,unsigned int num_entries) {unsigned int i;@@ -959,7 +959,7 @@ void intel_gtt_clear_range(unsigned int first_entry, unsigned int num_entries) }wmb (); } -EXPORT_SYMBOL (intel_gtt_clear_range); +EXPORT_SYMBOL (intel_gmch_gtt_clear_range);#if IS_ENABLED (CONFIG_AGP_INTEL ) static int intel_fake_agp_remove_entries(struct agp_memory *mem,@@ -968,7 +968,7 @@ static int intel_fake_agp_remove_entries(struct agp_memory *mem,if (mem->page_count ==0 )return 0 ; -intel_gtt_clear_range (pg_start, mem->page_count); +intel_gmch_gtt_clear_range (pg_start, mem->page_count);if (intel_private.needs_dmar) {intel_gtt_unmap_memory (mem->sg_list, mem->num_sg);@@ -1431,22 +1431,22 @@ int intel_gmch_probe(struct pci_dev *bridge_pdev, struct pci_dev *gpu_pdev, }EXPORT_SYMBOL (intel_gmch_probe); -void intel_gtt_get (u64 *gtt_total, -phys_addr_t *mappable_base, -resource_size_t *mappable_end) +void intel_gmch_gtt_get (u64 *gtt_total, +phys_addr_t *mappable_base, +resource_size_t *mappable_end) { *gtt_total = intel_private.gtt_total_entries <<PAGE_SHIFT ; *mappable_base = intel_private.gma_bus_addr; *mappable_end = intel_private.gtt_mappable_entries <<PAGE_SHIFT ; } -EXPORT_SYMBOL (intel_gtt_get); +EXPORT_SYMBOL (intel_gmch_gtt_get); -void intel_gtt_chipset_flush (void ) +void intel_gmch_gtt_flush (void ) {if (intel_private.driver->chipset_flush) intel_private.driver->chipset_flush (); } -EXPORT_SYMBOL (intel_gtt_chipset_flush); +EXPORT_SYMBOL (intel_gmch_gtt_flush);void intel_gmch_remove (void ) {drivers/gpu/drm/i915/gt/intel_gt_gmch.c +8
-8@@ -134,7 +134,7 @@ static void gen5_ggtt_insert_page(struct i915_address_space *vm,unsigned int flags = (cache_level ==I915_CACHE_NONE ) ?AGP_USER_MEMORY :AGP_USER_CACHED_MEMORY ; -intel_gtt_insert_page (addr, offset >>PAGE_SHIFT , flags); +intel_gmch_gtt_insert_page (addr, offset >>PAGE_SHIFT , flags); } static void gen6_ggtt_insert_page(struct i915_address_space *vm,@@ -175,8 +175,8 @@ static void gen5_ggtt_insert_entries(struct i915_address_space *vm,unsigned int flags = (cache_level ==I915_CACHE_NONE ) ?AGP_USER_MEMORY :AGP_USER_CACHED_MEMORY ; -intel_gtt_insert_sg_entries (vma_res->bi.pages, vma_res->start >>PAGE_SHIFT , - flags); +intel_gmch_gtt_insert_sg_entries (vma_res->bi.pages, vma_res->start >>PAGE_SHIFT , + flags); }/* @@ -306,18 +306,18 @@ static void bxt_vtd_ggtt_insert_entries__BKL(struct i915_address_space *vm,void intel_gt_gmch_gen5_chipset_flush (struct intel_gt *gt) { -intel_gtt_chipset_flush (); +intel_gmch_gtt_flush (); }static void gmch_ggtt_invalidate (struct i915_ggtt *ggtt) { -intel_gtt_chipset_flush (); +intel_gmch_gtt_flush (); }static void gen5_ggtt_clear_range (struct i915_address_space *vm,u64 start,u64 length) { -intel_gtt_clear_range (start >>PAGE_SHIFT , length >>PAGE_SHIFT ); +intel_gmch_gtt_clear_range (start >>PAGE_SHIFT , length >>PAGE_SHIFT ); } static void gen6_ggtt_clear_range(struct i915_address_space *vm,@@ -494,7 +494,7 @@ int intel_gt_gmch_gen5_probe(struct i915_ggtt *ggtt)return -EIO ; } -intel_gtt_get (&ggtt->vm.total, &gmadr_base, &ggtt->mappable_end); +intel_gmch_gtt_get (&ggtt->vm.total, &gmadr_base, &ggtt->mappable_end); ggtt->gmadr = (struct resource )DEFINE_RES_MEM (gmadr_base, ggtt->mappable_end);@@ -647,7 +647,7 @@ int intel_gt_gmch_gen8_probe(struct i915_ggtt *ggtt)int intel_gt_gmch_gen5_enable_hw (struct drm_i915_private *i915) { -if (GRAPHICS_VER (i915) <6 && !intel_enable_gtt ()) +if (GRAPHICS_VER (i915) <6 && !intel_gmch_enable_gtt ())return -EIO ;return 0 ;include/drm/intel-gtt.h +5
-12@@ -10,24 +10,24 @@ struct agp_bridge_data;struct pci_dev ;struct sg_table ; -void intel_gtt_get (u64 *gtt_total, -phys_addr_t *mappable_base, -resource_size_t *mappable_end); +void intel_gmch_gtt_get (u64 *gtt_total, +phys_addr_t *mappable_base, +resource_size_t *mappable_end);int intel_gmch_probe (struct pci_dev *bridge_pdev,struct pci_dev *gpu_pdev,struct agp_bridge_data *bridge);void intel_gmch_remove (void ); -bool intel_enable_gtt (void ); +bool intel_gmch_enable_gtt (void ); -void intel_gtt_chipset_flush (void ); -void intel_gtt_insert_page (dma_addr_t addr, -unsigned int pg, -unsigned int flags); -void intel_gtt_insert_sg_entries (struct sg_table *st, -unsigned int pg_start, -unsigned int flags); -void intel_gtt_clear_range (unsigned int first_entry,unsigned int num_entries); +void intel_gmch_gtt_flush (void );
include/drm/intel-gtt.h struct agp_bridge_data; · line 33
Quoted 10 lines
include/drm/intel-gtt.h +7
-0+void intel_gmch_gtt_insert_page (dma_addr_t addr, +unsigned int pg, +unsigned int flags); +void intel_gmch_gtt_insert_sg_entries (struct sg_table *st, +unsigned int pg_start, +unsigned int flags); +void intel_gmch_gtt_clear_range (unsigned int first_entry,unsigned int num_entries);/* Special gtt memory types */ #define AGP_DCACHE_MEMORY 1
Regards,
Tvrtko
Patchwork
CI[Intel-gfx] ✗ Fi.CI.IGT: failure for series starting with [1/2] agp/intel: Rename intel-gtt symbols
In reply to Lucas De Marchi== Series Details ==
== Series Details ==
Series: series starting with [1/2] agp/intel: Rename intel-gtt symbols
URL : https://patchwork.freedesktop.org/series/105261/
State : failure
== Summary ==
CI Bug Log - changes from CI_DRM_11773_full -> Patchwork_105261v1_full
====================================================
Summary
-------
**FAILURE**
Serious unknown changes coming with Patchwork_105261v1_full absolutely need to be verified manually.
If you think the reported changes have nothing to do with the changes introduced in Patchwork_105261v1_full, please notify your bug team to allow them to document this new failure mode, which will reduce false positives in CI.
Participating hosts (10 -> 10)
------------------------------
No changes in participating hosts
Possible new issues
-------------------
Here are the unknown changes that may have been introduced in Patchwork_105261v1_full:
### IGT changes ###
#### Possible regressions ####
* igt@api_intel_allocator@two-level-inception-interruptible:
- shard-tglb: [PASS][1] -> [INCOMPLETE][2]
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11773/shard-tglb7/igt@[email protected]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_105261v1/shard-tglb6/igt@[email protected]
Known issues
------------
Here are the changes found in Patchwork_105261v1_full that come from known issues:
### CI changes ###
#### Possible fixes ####
* boot:
- shard-skl: ([PASS][3], [PASS][4], [PASS][5], [PASS][6], [PASS][7], [PASS][8], [PASS][9], [PASS][10], [PASS][11], [PASS][12], [PASS][13], [FAIL][14], [PASS][15], [PASS][16], [PASS][17], [PASS][18], [PASS][19], [PASS][20], [PASS][21], [PASS][22], [PASS][23], [PASS][24]) ([i915#5032]) -> ([PASS][25], [PASS][26], [PASS][27], [PASS][28], [PASS][29], [PASS][30], [PASS][31], [PASS][32], [PASS][33], [PASS][34], [PASS][35], [PASS][36], [PASS][37], [PASS][38], [PASS][39], [PASS][40], [PASS][41], [PASS][42], [PASS][43], [PASS][44], [PASS][45], [PASS][46])
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11773/shard-skl9/boot.html
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11773/shard-skl9/boot.html
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11773/shard-skl9/boot.html
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11773/shard-skl7/boot.html
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11773/shard-skl7/boot.html
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11773/shard-skl6/boot.html
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11773/shard-skl6/boot.html
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11773/shard-skl6/boot.html
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11773/shard-skl4/boot.html
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11773/shard-skl4/boot.html
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11773/shard-skl4/boot.html
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11773/shard-skl3/boot.html
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11773/shard-skl3/boot.html
[16]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11773/shard-skl2/boot.html
[17]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11773/shard-skl2/boot.html
[18]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11773/shard-skl1/boot.html
[19]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11773/shard-skl1/boot.html
[20]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11773/shard-skl1/boot.html
[21]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11773/shard-skl1/boot.html
[22]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11773/shard-skl10/boot.html
[23]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11773/shard-skl10/boot.html
[24]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11773/shard-skl10/boot.html
[25]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_105261v1/shard-skl9/boot.html
[26]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_105261v1/shard-skl9/boot.html
[27]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_105261v1/shard-skl7/boot.html
[28]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_105261v1/shard-skl7/boot.html
[29]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_105261v1/shard-skl7/boot.html
[30]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_105261v1/shard-skl6/boot.html
[31]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_105261v1/shard-skl6/boot.html
[32]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_105261v1/shard-skl6/boot.html
[33]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_105261v1/shard-skl4/boot.html
[34]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_105261v1/shard-skl4/boot.html
[35]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_105261v1/shard-skl4/boot.html
[36]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_105261v1/shard-skl4/boot.html
[37]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_105261v1/shard-skl3/boot.html
[38]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_105261v1/shard-skl3/boot.html
[39]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_105261v1/shard-skl3/boot.html
[40]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_105261v1/shard-skl2/boot.html
[41]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_105261v1/shard-skl1/boot.html
[42]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_105261v1/shard-skl1/boot.html
[43]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_105261v1/shard-skl1/boot.html
[44]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_105261v1/shard-skl10/boot.html
[45]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_105261v1/shard-skl10/boot.html
[46]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_105261v1/shard-skl10/boot.html
### IGT changes ###
#### Issues hit ####
* igt@gem_eio@in-flight-10ms:
- shard-tglb: [PASS][47] -> [TIMEOUT][48] ([i915#3063])
[47]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11773/shard-tglb3/igt@[email protected]
[48]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_105261v1/shard-tglb3/igt@[email protected]
* igt@gem_eio@unwedge-stress:
- shard-iclb: [PASS][49] -> [TIMEOUT][50] ([i915#3070])
[49]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11773/shard-iclb2/igt@[email protected]
[50]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_105261v1/shard-iclb8/igt@[email protected]
* igt@gem_exec_balancer@parallel-bb-first:
- shard-iclb: [PASS][51] -> [SKIP][52] ([i915#4525]) +1 similar issue
[51]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11773/shard-iclb2/igt@[email protected]
[52]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_105261v1/shard-iclb8/igt@[email protected]
* igt@gem_exec_fair@basic-none-share@rcs0:
- shard-iclb: [PASS][53] -> [FAIL][54] ([i915#2842])
[53]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11773/shard-iclb8/igt@gem_exec_fair@[email protected]
[54]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_105261v1/shard-iclb1/igt@gem_exec_fair@[email protected]
* igt@gem_exec_fair@basic-none@vecs0:
- shard-kbl: [PASS][55] -> [FAIL][56] ([i915#2842]) +2 similar issues
[55]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11773/shard-kbl3/igt@gem_exec_fair@[email protected]
[56]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_105261v1/shard-kbl6/igt@gem_exec_fair@[email protected]
- shard-apl: [PASS][57] -> [FAIL][58] ([i915#2842])
[57]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11773/shard-apl8/igt@gem_exec_fair@[email protected]
[58]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_105261v1/shard-apl1/igt@gem_exec_fair@[email protected]
* igt@gem_exec_fair@basic-pace-share@rcs0:
- shard-tglb: [PASS][59] -> [FAIL][60] ([i915#2842])
[59]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11773/shard-tglb5/igt@gem_exec_fair@[email protected]
[60]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_105261v1/shard-tglb1/igt@gem_exec_fair@[email protected]
* igt@gem_exec_fair@basic-pace@vcs1:
- shard-iclb: NOTRUN -> [FAIL][61] ([i915#2842])
[61]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_105261v1/shard-iclb2/igt@gem_exec_fair@[email protected]
* igt@gem_exec_whisper@basic-queues-all:
- shard-glk: [PASS][62] -> [DMESG-WARN][63] ([i915#118])
[62]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11773/shard-glk2/igt@[email protected]
[63]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_105261v1/shard-glk4/igt@[email protected]
* igt@gem_huc_copy@huc-copy:
- shard-skl: NOTRUN -> [SKIP][64] ([fdo#109271] / [i915#2190])
[64]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_105261v1/shard-skl2/igt@[email protected]
* igt@gem_userptr_blits@input-checking:
- shard-skl: NOTRUN -> [DMESG-WARN][65] ([i915#4991])
[65]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_105261v1/shard-skl6/igt@[email protected]
* igt@gen9_exec_parse@allowed-all:
- shard-glk: [PASS][66] -> [DMESG-WARN][67] ([i915#5566] / [i915#716])
[66]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11773/shard-glk3/igt@[email protected]
[67]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_105261v1/shard-glk7/igt@[email protected]
* igt@i915_pm_dc@dc6-psr:
- shard-skl: NOTRUN -> [FAIL][68] ([i915#454])
[68]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_105261v1/shard-skl2/igt@[email protected]
* igt@kms_async_flips@alternate-sync-async-flip@pipe-a-edp-1:
- shard-skl: [PASS][69] -> [FAIL][70] ([i915#2521])
[69]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11773/shard-skl10/igt@kms_async_flips@[email protected]
[70]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_105261v1/shard-skl1/igt@kms_async_flips@[email protected]
* igt@kms_big_fb@x-tiled-max-hw-stride-64bpp-rotate-0-async-flip:
- shard-skl: NOTRUN -> [FAIL][71] ([i915#3743])
[71]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_105261v1/shard-skl6/igt@[email protected]
* igt@kms_ccs@pipe-b-ccs-on-another-bo-y_tiled_gen12_mc_ccs:
- shard-skl: NOTRUN -> [SKIP][72] ([fdo#109271] / [i915#3886]) +5 similar issues
[72]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_105261v1/shard-skl6/igt@kms_ccs@pipe-b-ccs-on-another-bo-y_tiled_gen12_mc_ccs.html
* igt@kms_color_chamelium@pipe-b-ctm-green-to-red:
- shard-skl: NOTRUN -> [SKIP][73] ([fdo#109271] / [fdo#111827]) +8 similar issues
[73]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_105261v1/shard-skl2/igt@[email protected]
* igt@kms_cursor_crc@pipe-c-cursor-suspend:
- shard-apl: [PASS][74] -> [DMESG-WARN][75] ([i915#180]) +2 similar issues
[74]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11773/shard-apl2/igt@[email protected]
[75]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_105261v1/shard-apl4/igt@[email protected]
* igt@kms_cursor_legacy@2x-long-flip-vs-cursor-atomic:
- shard-glk: [PASS][76] -> [FAIL][77] ([i915#72])
[76]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11773/shard-glk7/igt@[email protected]
[77]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_105261v1/shard-glk6/igt@[email protected]
* igt@kms_cursor_legacy@flip-vs-cursor-atomic-transitions:
- shard-skl: NOTRUN -> [FAIL][78] ([i915#2346])
[78]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_105261v1/shard-skl2/igt@[email protected]
* igt@kms_cursor_legacy@flip-vs-cursor-atomic-transitions-varying-size:
- shard-iclb: [PASS][79] -> [FAIL][80] ([i915#2346])
[79]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11773/shard-iclb6/igt@kms_cursor_legacy@flip-vs-cursor-atomic-transitions-varying-size.html
[80]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_105261v1/shard-iclb7/igt@kms_cursor_legacy@flip-vs-cursor-atomic-transitions-varying-size.html
* igt@kms_cursor_legacy@flip-vs-cursor-varying-size:
- shard-skl: [PASS][81] -> [FAIL][82] ([i915#2346])
[81]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11773/shard-skl6/igt@[email protected]
[82]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_105261v1/shard-skl3/igt@[email protected]
* igt@kms_dither@fb-8bpc-vs-panel-8bpc@pipe-a-hdmi-a-1:
- shard-glk: [PASS][83] -> [SKIP][84] ([fdo#109271])
[83]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11773/shard-glk5/igt@kms_dither@[email protected]
[84]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_105261v1/shard-glk8/igt@kms_dither@[email protected]
* igt@kms_flip@flip-vs-suspend@a-dp1:
- shard-kbl: [PASS][85] -> [DMESG-WARN][86] ([i915#180]) +7 similar issues
[85]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11773/shard-kbl1/igt@kms_flip@[email protected]
[86]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_105261v1/shard-kbl6/igt@kms_flip@[email protected]
* igt@kms_flip@plain-flip-ts-check@c-edp1:
- shard-skl: [PASS][87] -> [FAIL][88] ([i915#2122]) +1 similar issue
[87]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11773/shard-skl1/igt@kms_flip@[email protected]
[88]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_105261v1/shard-skl10/igt@kms_flip@[email protected]
* igt@kms_flip_scaled_crc@flip-64bpp-ytile-to-32bpp-ytile-downscaling:
- shard-skl: NOTRUN -> [SKIP][89] ([fdo#109271] / [i915#3701]) +1 similar issue
[89]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_105261v1/shard-skl2/igt@kms_flip_scaled_crc@flip-64bpp-ytile-to-32bpp-ytile-downscaling.html
* igt@kms_frontbuffer_tracking@psr-1p-primscrn-indfb-msflip-blt:
- shard-iclb: [PASS][90] -> [FAIL][91] ([i915#1888])
[90]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11773/shard-iclb1/igt@[email protected]
[91]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_105261v1/shard-iclb7/igt@[email protected]
* igt@kms_plane_alpha_blend@pipe-a-alpha-transparent-fb:
- shard-skl: NOTRUN -> [FAIL][92] ([i915#265])
[92]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_105261v1/shard-skl7/igt@[email protected]
* igt@kms_psr2_sf@overlay-plane-update-sf-dmg-area:
- shard-skl: NOTRUN -> [SKIP][93] ([fdo#109271] / [i915#658]) +1 similar issue
[93]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_105261v1/shard-skl7/igt@[email protected]
* igt@kms_psr@psr2_no_drrs:
- shard-iclb: [PASS][94] -> [SKIP][95] ([fdo#109441]) +1 similar issue
[94]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11773/shard-iclb2/igt@kms_psr@psr2_no_drrs.html
[95]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_105261v1/shard-iclb8/igt@kms_psr@psr2_no_drrs.html
* igt@kms_vrr@flipline:
- shard-skl: NOTRUN -> [SKIP][96] ([fdo#109271]) +132 similar issues
[96]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_105261v1/shard-skl2/igt@[email protected]
* igt@perf@polling-parameterized:
- shard-iclb: [PASS][97] -> [FAIL][98] ([i915#5639])
[97]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11773/shard-iclb5/igt@[email protected]
[98]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_105261v1/shard-iclb6/igt@[email protected]
* igt@sysfs_clients@sema-50:
- shard-skl: NOTRUN -> [SKIP][99] ([fdo#109271] / [i915#2994])
[99]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_105261v1/shard-skl2/igt@[email protected]
#### Possible fixes ####
* igt@gem_exec_balancer@parallel-contexts:
- shard-iclb: [SKIP][100] ([i915#4525]) -> [PASS][101] +1 similar issue
[100]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11773/shard-iclb5/igt@[email protected]
[101]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_105261v1/shard-iclb4/igt@[email protected]
* igt@gem_exec_fair@basic-pace@vecs0:
- shard-kbl: [FAIL][102] ([i915#2842]) -> [PASS][103] +3 similar issues
[102]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11773/shard-kbl1/igt@gem_exec_fair@[email protected]
[103]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_105261v1/shard-kbl6/igt@gem_exec_fair@[email protected]
* igt@gem_huc_copy@huc-copy:
- shard-tglb: [SKIP][104] ([i915#2190]) -> [PASS][105]
[104]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11773/shard-tglb6/igt@[email protected]
[105]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_105261v1/shard-tglb5/igt@[email protected]
* igt@i915_pm_dc@dc6-psr:
- shard-iclb: [FAIL][106] ([i915#454]) -> [PASS][107]
[106]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11773/shard-iclb6/igt@[email protected]
[107]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_105261v1/shard-iclb7/igt@[email protected]
* igt@kms_cursor_legacy@cursor-vs-flip-legacy:
- shard-iclb: [DMESG-WARN][108] ([i915#1888]) -> [PASS][109]
[108]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11773/shard-iclb1/igt@[email protected]
[109]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_105261v1/shard-iclb7/igt@[email protected]
* igt@kms_cursor_legacy@cursor-vs-flip-toggle:
- shard-iclb: [FAIL][110] ([i915#5072]) -> [PASS][111]
[110]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11773/shard-iclb7/igt@[email protected]
[111]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_105261v1/shard-iclb5/igt@[email protected]
* igt@kms_flip@flip-vs-suspend@b-dp1:
- shard-apl: [DMESG-WARN][112] ([i915#180]) -> [PASS][113] +3 similar issues
[112]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11773/shard-apl8/igt@kms_flip@[email protected]
[113]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_105261v1/shard-apl2/igt@kms_flip@[email protected]
* igt@kms_flip@plain-flip-ts-check-interruptible@c-edp1:
- shard-skl: [FAIL][114] ([i915#2122]) -> [PASS][115]
[114]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11773/shard-skl6/igt@kms_flip@[email protected]
[115]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_105261v1/shard-skl3/igt@kms_flip@[email protected]
* igt@kms_flip_scaled_crc@flip-32bpp-ytile-to-32bpp-ytileccs-upscaling:
- shard-glk: [FAIL][116] ([i915#4911]) -> [PASS][117]
[116]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11773/shard-glk8/igt@kms_flip_scaled_crc@flip-32bpp-ytile-to-32bpp-ytileccs-upscaling.html
[117]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_105261v1/shard-glk1/igt@kms_flip_scaled_crc@flip-32bpp-ytile-to-32bpp-ytileccs-upscaling.html
* igt@kms_flip_scaled_crc@flip-64bpp-ytile-to-16bpp-ytile-downscaling:
- shard-iclb: [SKIP][118] ([i915#3701]) -> [PASS][119] +2 similar issues
[118]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11773/shard-iclb2/igt@kms_flip_scaled_crc@flip-64bpp-ytile-to-16bpp-ytile-downscaling.html
[119]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_105261v1/shard-iclb8/igt@kms_flip_scaled_crc@flip-64bpp-ytile-to-16bpp-ytile-downscaling.html
* igt@kms_hdr@bpc-switch-dpms@pipe-a-dp-1:
- shard-kbl: [FAIL][120] ([i915#1188]) -> [PASS][121]
[120]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11773/shard-kbl4/igt@kms_hdr@[email protected]
[121]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_105261v1/shard-kbl3/igt@kms_hdr@[email protected]
* igt@kms_plane_scaling@planes-downscale-factor-0-5@pipe-a-edp-1:
- shard-iclb: [SKIP][122] ([i915#5235]) -> [PASS][123] +2 similar issues
[122]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11773/shard-iclb2/igt@kms_plane_scaling@[email protected]
[123]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_105261v1/shard-iclb8/igt@kms_plane_scaling@[email protected]
* igt@kms_psr@psr2_sprite_blt:
- shard-iclb: [SKIP][124] ([fdo#109441]) -> [PASS][125] +2 similar issues
[124]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11773/shard-iclb4/igt@kms_psr@psr2_sprite_blt.html
[125]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_105261v1/shard-iclb2/igt@kms_psr@psr2_sprite_blt.html
* igt@perf@polling-parameterized:
- shard-tglb: [FAIL][126] ([i915#5639]) -> [PASS][127]
[126]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11773/shard-tglb8/igt@[email protected]
[127]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_105261v1/shard-tglb3/igt@[email protected]
* igt@sysfs_heartbeat_interval@mixed@vecs0:
- shard-skl: [FAIL][128] ([i915#1731]) -> [PASS][129]
[128]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11773/shard-skl3/igt@sysfs_heartbeat_interval@[email protected]
[129]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_105261v1/shard-skl9/igt@sysfs_heartbeat_interval@[email protected]
#### Warnings ####
* igt@gem_exec_fair@basic-throttle@rcs0:
- shard-iclb: [FAIL][130] ([i915#2849]) -> [FAIL][131] ([i915#2842])
[130]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11773/shard-iclb2/igt@gem_exec_fair@[email protected]
[131]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_105261v1/shard-iclb8/igt@gem_exec_fair@[email protected]
* igt@kms_psr2_sf@cursor-plane-move-continuous-exceed-fully-sf:
- shard-iclb: [SKIP][132] ([i915#658]) -> [SKIP][133] ([i915#2920])
[132]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11773/shard-iclb4/igt@[email protected]
[133]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_105261v1/shard-iclb2/igt@[email protected]
* igt@kms_psr2_sf@overlay-plane-update-sf-dmg-area:
- shard-iclb: [SKIP][134] ([i915#2920]) -> [SKIP][135] ([fdo#111068] / [i915#658])
[134]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11773/shard-iclb2/igt@[email protected]
[135]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_105261v1/shard-iclb8/igt@[email protected]
* igt@kms_psr2_sf@plane-move-sf-dmg-area:
- shard-iclb: [SKIP][136] ([fdo#111068] / [i915#658]) -> [SKIP][137] ([i915#2920])
[136]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11773/shard-iclb3/igt@[email protected]
[137]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_105261v1/shard-iclb2/igt@[email protected]
* igt@kms_psr2_sf@primary-plane-update-sf-dmg-area-big-fb:
- shard-iclb: [SKIP][138] ([i915#2920]) -> [SKIP][139] ([i915#658]) +1 similar issue
[138]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11773/shard-iclb2/igt@[email protected]
[139]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_105261v1/shard-iclb8/igt@[email protected]
* igt@runner@aborted:
- shard-skl: [FAIL][140] ([i915#3002] / [i915#4312] / [i915#5257]) -> ([FAIL][141], [FAIL][142], [FAIL][143]) ([i915#2029] / [i915#3002] / [i915#4312] / [i915#5257])
[140]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11773/shard-skl1/igt@[email protected]
[141]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_105261v1/shard-skl4/igt@[email protected]
[142]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_105261v1/shard-skl6/igt@[email protected]
[143]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_105261v1/shard-skl3/igt@[email protected]
- shard-kbl: ([FAIL][144], [FAIL][145]) ([i915#3002] / [i915#4312] / [i915#5257]) -> ([FAIL][146], [FAIL][147], [FAIL][148], [FAIL][149], [FAIL][150], [FAIL][151], [FAIL][152], [FAIL][153]) ([i915#180] / [i915#3002] / [i915#4312] / [i915#5257])
[144]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11773/shard-kbl7/igt@[email protected]
[145]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11773/shard-kbl3/igt@[email protected]
[146]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_105261v1/shard-kbl7/igt@[email protected]
[147]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_105261v1/shard-kbl6/igt@[email protected]
[148]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_105261v1/shard-kbl4/igt@[email protected]
[149]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_105261v1/shard-kbl7/igt@[email protected]
[150]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_105261v1/shard-kbl7/igt@[email protected]
[151]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_105261v1/shard-kbl6/igt@[email protected]
[152]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_105261v1/shard-kbl7/igt@[email protected]
[153]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_105261v1/shard-kbl6/igt@[email protected]
[fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
[fdo#109441]: https://bugs.freedesktop.org/show_bug.cgi?id=109441
[fdo#111068]: https://bugs.freedesktop.org/show_bug.cgi?id=111068
[fdo#111827]: https://bugs.freedesktop.org/show_bug.cgi?id=111827
[i915#118]: https://gitlab.freedesktop.org/drm/intel/issues/118
[i915#1188]: https://gitlab.freedesktop.org/drm/intel/issues/1188
[i915#1731]: https://gitlab.freedesktop.org/drm/intel/issues/1731
[i915#180]: https://gitlab.freedesktop.org/drm/intel/issues/180
[i915#1888]: https://gitlab.freedesktop.org/drm/intel/issues/1888
[i915#2029]: https://gitlab.freedesktop.org/drm/intel/issues/2029
[i915#2122]: https://gitlab.freedesktop.org/drm/intel/issues/2122
[i915#2190]: https://gitlab.freedesktop.org/drm/intel/issues/2190
[i915#2346]: https://gitlab.freedesktop.org/drm/intel/issues/2346
[i915#2521]: https://gitlab.freedesktop.org/drm/intel/issues/2521
[i915#265]: https://gitlab.freedesktop.org/drm/intel/issues/265
[i915#2842]: https://gitlab.freedesktop.org/drm/intel/issues/2842
[i915#2849]: https://gitlab.freedesktop.org/drm/intel/issues/2849
[i915#2920]: https://gitlab.freedesktop.org/drm/intel/issues/2920
[i915#2994]: https://gitlab.freedesktop.org/drm/intel/issues/2994
[i915#3002]: https://gitlab.freedesktop.org/drm/intel/issues/3002
[i915#3063]: https://gitlab.freedesktop.org/drm/intel/issues/3063
[i915#3070]: https://gitlab.freedesktop.org/drm/intel/issues/3070
[i915#3701]: https://gitlab.freedesktop.org/drm/intel/issues/3701
[i915#3743]: https://gitlab.freedesktop.org/drm/intel/issues/3743
[i915#3886]: https://gitlab.freedesktop.org/drm/intel/issues/3886
[i915#4312]: https://gitlab.freedesktop.org/drm/intel/issues/4312
[i915#4525]: https://gitlab.freedesktop.org/drm/intel/issues/4525
[i915#454]: https://gitlab.freedesktop.org/drm/intel/issues/454
[i915#4911]: https://gitlab.freedesktop.org/drm/intel/issues/4911
[i915#4991]: https://gitlab.freedesktop.org/drm/intel/issues/4991
[i915#5032]: https://gitlab.freedesktop.org/drm/intel/issues/5032
[i915#5072]: https://gitlab.freedesktop.org/drm/intel/issues/5072
[i915#5235]: https://gitlab.freedesktop.org/drm/intel/issues/5235
[i915#5257]: https://gitlab.freedesktop.org/drm/intel/issues/5257
[i915#5566]: https://gitlab.freedesktop.org/drm/intel/issues/5566
[i915#5639]: https://gitlab.freedesktop.org/drm/intel/issues/5639
[i915#658]: https://gitlab.freedesktop.org/drm/intel/issues/658
[i915#716]: https://gitlab.freedesktop.org/drm/intel/issues/716
[i915#72]: https://gitlab.freedesktop.org/drm/intel/issues/72
Build changes
-------------
* Linux: CI_DRM_11773 -> Patchwork_105261v1
CI-20190529: 20190529
CI_DRM_11773: 8025a295b7aa707f64c7984b7781c6f25e22a901 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_6533: 6b5107d91827962808441db6b98e478aa9e67bdb @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git
Patchwork_105261v1: 8025a295b7aa707f64c7984b7781c6f25e22a901 @ git://anongit.freedesktop.org/gfx-ci/linux
piglit_4509: fdc5a4ca11124ab8413c7988896eec4c97336694 @ git://anongit.freedesktop.org/piglit
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_105261v1/index.html