DG1 + LMEM enabling
Subsystems (5)
RFC PATCH 98/162 drm/i915/gtt: map the PD up front
In reply to Matthew AuldWe need to general our accessor for the page directories and tables from using the simple kmap_atomic to support local memory, and this setup must be done on acquisition of the backing storage prior to entering fence execution contexts. Here we replace the kmap with the object maping code that for simple single page shmemfs object will return a plain kmap, that is then kept for the lifetime of the page directory.
--- .../drm/i915/gem/selftests/i915_gem_context.c | 11 +---- drivers/gpu/drm/i915/gt/gen6_ppgtt.c | 11 ++--- drivers/gpu/drm/i915/gt/gen8_ppgtt.c | 26 ++++------ drivers/gpu/drm/i915/gt/intel_ggtt.c | 2 +- drivers/gpu/drm/i915/gt/intel_gtt.c | 48 +++++++++---------- drivers/gpu/drm/i915/gt/intel_gtt.h | 11 +++-- drivers/gpu/drm/i915/gt/intel_ppgtt.c | 7 ++- drivers/gpu/drm/i915/i915_vma.c | 3 +- drivers/gpu/drm/i915/selftests/i915_gem_gtt.c | 10 ++-- drivers/gpu/drm/i915/selftests/i915_perf.c | 3 +- 10 files changed, 54 insertions(+), 78 deletions(-)
drivers/gpu/drm/i915/gem/selftests/i915_gem_context.c +2 -9
@@ -1740,7 +1740,6 @@ static int read_from_scratch(struct i915_gem_context *ctx,static int check_scratch_page (struct i915_gem_context *ctx,u32 *out) {struct i915_address_space *vm; -struct page *page;u32 *vaddr;int err =0 ;
@@ -1748,24 +1747,18 @@ static int check_scratch_page(struct i915_gem_context *ctx, u32 *out)if (!vm)return -ENODEV ; - page =__px_page (vm->scratch[0 ]); -if (!page) { +if (!vm->scratch[0 ]) {pr_err ("No scratch page!\n" );return -EINVAL ; } - vaddr =kmap (page); -if (!vaddr) { -pr_err ("No (mappable) scratch page!\n" ); -return -EINVAL ; - } + vaddr =__px_vaddr (vm->scratch[0 ]);memcpy (out, vaddr,sizeof (*out));if (memchr_inv (vaddr, *out,PAGE_SIZE )) {pr_err ("Inconsistent initial state of scratch page!\n" ); err = -EINVAL ; } -kunmap (page);return err; }
drivers/gpu/drm/i915/gt/gen6_ppgtt.c +4 -7
@@ -105,9 +105,8 @@ static void gen6_ppgtt_clear_range(struct i915_address_space *vm,* entries back to scratch. */ - vaddr =kmap_atomic_px (pt); + vaddr =px_vaddr (pt);memset32 (vaddr + pte, scratch_pte, count); -kunmap_atomic (vaddr); pte =0 ; }
@@ -129,7 +128,7 @@ static void gen6_ppgtt_insert_entries(struct i915_address_space *vm,GEM_BUG_ON (!pd->entry[act_pt]); - vaddr =kmap_atomic_px (i915_pt_entry (pd, act_pt)); + vaddr =px_vaddr (i915_pt_entry (pd, act_pt)); do { GEM_BUG_ON(sg_dma_len(iter.sg) < I915_GTT_PAGE_SIZE); vaddr[act_pte] = pte_encode | GEN6_PTE_ADDR_ENCODE(iter.dma);
@@ -145,12 +144,10 @@ static void gen6_ppgtt_insert_entries(struct i915_address_space *vm, }if (++act_pte ==GEN6_PTES ) { -kunmap_atomic (vaddr); - vaddr =kmap_atomic_px (i915_pt_entry (pd, ++act_pt)); + vaddr =px_vaddr (i915_pt_entry (pd, ++act_pt)); act_pte =0 ; } }while (1 ); -kunmap_atomic (vaddr); vma->page_sizes.gtt =I915_GTT_PAGE_SIZE ; }
@@ -244,7 +241,7 @@ static int gen6_ppgtt_init_scratch(struct gen6_ppgtt *ppgtt) goto err_scratch0; } - ret =pin_pt_dma (vm, vm->scratch[1 ]); + ret =map_pt_dma (vm, vm->scratch[1 ]);if (ret) goto err_scratch1;
drivers/gpu/drm/i915/gt/gen8_ppgtt.c +10 -16
@@ -237,11 +237,10 @@ static u64 __gen8_ppgtt_clear(struct i915_address_space * const vm, atomic_read(&pt->used));GEM_BUG_ON (!count || count >=atomic_read (&pt->used)); - vaddr =kmap_atomic_px (pt); + vaddr =px_vaddr (pt);memset64 (vaddr +gen8_pd_index (start,0 ), vm->scratch[0 ]->encode, count); -kunmap_atomic (vaddr);atomic_sub (count, &pt->used); start += count;
@@ -370,7 +369,7 @@ gen8_ppgtt_insert_pte(struct i915_ppgtt *ppgtt,gen8_pte_t *vaddr; pd =i915_pd_entry (pdp,gen8_pd_index (idx,2 )); - vaddr =kmap_atomic_px (i915_pt_entry (pd,gen8_pd_index (idx,1 ))); + vaddr =px_vaddr (i915_pt_entry (pd,gen8_pd_index (idx,1 ))); do { GEM_BUG_ON(sg_dma_len(iter->sg) < I915_GTT_PAGE_SIZE); vaddr[gen8_pd_index(idx, 0)] = pte_encode | iter->dma;
@@ -397,12 +396,10 @@ gen8_ppgtt_insert_pte(struct i915_ppgtt *ppgtt, }clflush_cache_range (vaddr,PAGE_SIZE ); -kunmap_atomic (vaddr); - vaddr =kmap_atomic_px (i915_pt_entry (pd,gen8_pd_index (idx,1 ))); + vaddr =px_vaddr (i915_pt_entry (pd,gen8_pd_index (idx,1 ))); } }while (1 );clflush_cache_range (vaddr,PAGE_SIZE ); -kunmap_atomic (vaddr);return idx; }
@@ -437,7 +434,7 @@ static void gen8_ppgtt_insert_huge(struct i915_vma *vma, encode |=GEN8_PDE_PS_2M ; page_size =I915_GTT_PAGE_SIZE_2M ; - vaddr =kmap_atomic_px (pd); + vaddr =px_vaddr (pd); }else {struct i915_page_table *pt =i915_pt_entry (pd,__gen8_pte_index (start,1 ));
@@ -452,7 +449,7 @@ static void gen8_ppgtt_insert_huge(struct i915_vma *vma, rem >= (I915_PDES - index) * I915_GTT_PAGE_SIZE)) maybe_64K =__gen8_pte_index (start,1 ); - vaddr =kmap_atomic_px (pt); + vaddr =px_vaddr (pt); } do {
@@ -486,7 +483,6 @@ static void gen8_ppgtt_insert_huge(struct i915_vma *vma, }while (rem >= page_size && index <I915_PDES );clflush_cache_range (vaddr,PAGE_SIZE ); -kunmap_atomic (vaddr);/* * Is it safe to mark the 2M block as 64K? -- Either we have
@@ -500,9 +496,8 @@ static void gen8_ppgtt_insert_huge(struct i915_vma *vma, !iter->sg && IS_ALIGNED(vma->node.start + vma->node.size, I915_GTT_PAGE_SIZE_2M)))) { - vaddr =kmap_atomic_px (pd); + vaddr =px_vaddr (pd); vaddr[maybe_64K] |=GEN8_PDE_IPS_64K ; -kunmap_atomic (vaddr); page_size =I915_GTT_PAGE_SIZE_64K ;/*
@@ -518,12 +513,11 @@ static void gen8_ppgtt_insert_huge(struct i915_vma *vma,u16 i; encode = vma->vm->scratch[0 ]->encode; - vaddr =kmap_atomic_px (i915_pt_entry (pd, maybe_64K)); + vaddr =px_vaddr (i915_pt_entry (pd, maybe_64K));for (i =1 ; i < index; i +=16 )memset64 (vaddr + i, encode,15 ); -kunmap_atomic (vaddr); } }
@@ -592,7 +586,7 @@ static int gen8_init_scratch(struct i915_address_space *vm)if (IS_ERR (obj)) goto free_scratch; - ret =pin_pt_dma (vm, obj); + ret =map_pt_dma (vm, obj);if (ret) {i915_gem_object_put (obj); goto free_scratch;
@@ -629,7 +623,7 @@ static int gen8_preallocate_top_level_pdp(struct i915_ppgtt *ppgtt)if (IS_ERR (pde))return PTR_ERR (pde); - err =pin_pt_dma (vm, pde->pt.base); + err =map_pt_dma (vm, pde->pt.base);if (err) {i915_gem_object_put (pde->pt.base);free_pd (vm, pde);
@@ -665,7 +659,7 @@ gen8_alloc_top_pd(struct i915_address_space *vm) goto err_pd; } - err =pin_pt_dma (vm, pd->pt.base); + err =map_pt_dma (vm, pd->pt.base);if (err) goto err_pd;
drivers/gpu/drm/i915/gt/intel_ggtt.c +1 -1
@@ -616,7 +616,7 @@ static int init_aliasing_ppgtt(struct i915_ggtt *ggtt) goto err_ppgtt;i915_gem_object_lock (ppgtt->vm.scratch[0 ],NULL ); - err =i915_vm_pin_pt_stash (&ppgtt->vm, &stash); + err =i915_vm_map_pt_stash (&ppgtt->vm, &stash);i915_gem_object_unlock (ppgtt->vm.scratch[0 ]);if (err) goto err_stash;
drivers/gpu/drm/i915/gt/intel_gtt.c +22 -26
94 lines not on this page · raw message
drivers/gpu/drm/i915/gt/intel_gtt.h +6 -5
@@ -176,6 +176,9 @@ struct page *__px_page(struct drm_i915_gem_object *p);dma_addr_t __px_dma (struct drm_i915_gem_object *p);#define px_dma (px) (__px_dma(px_base(px))) +void *__px_vaddr (struct drm_i915_gem_object *p); +#define px_vaddr (px) (__px_vaddr(px_base(px))) +#define px_pt (px) \ __px_choose_expr(px, struct i915_page_table *, __x, \ __px_choose_expr(px, struct i915_page_directory *, &__x->pt, \
@@ -506,8 +509,6 @@ struct i915_ppgtt *i915_ppgtt_create(struct intel_gt *gt);void i915_ggtt_suspend (struct i915_ggtt *gtt);void i915_ggtt_resume (struct i915_ggtt *ggtt); -#define kmap_atomic_px (px) kmap_atomic(__px_page(px_base(px))) -void fill_page_dma (struct drm_i915_gem_object *p,const u64 val,unsigned int count);
@@ -525,8 +526,8 @@ struct i915_page_table *alloc_pt(struct i915_address_space *vm);struct i915_page_directory *alloc_pd (struct i915_address_space *vm);struct i915_page_directory *__alloc_pd (int npde); -int pin_pt_dma (struct i915_address_space *vm,struct drm_i915_gem_object *obj); -int pin_pt_dma_locked (struct i915_address_space *vm,struct drm_i915_gem_object *obj); +int map_pt_dma (struct i915_address_space *vm,struct drm_i915_gem_object *obj); +int map_pt_dma_locked (struct i915_address_space *vm,struct drm_i915_gem_object *obj);void free_px (struct i915_address_space *vm,struct i915_page_table *pt,int lvl);
@@ -573,7 +574,7 @@ void setup_private_pat(struct intel_uncore *uncore);int i915_vm_alloc_pt_stash (struct i915_address_space *vm,struct i915_vm_pt_stash *stash,u64 size); -int i915_vm_pin_pt_stash (struct i915_address_space *vm, +int i915_vm_map_pt_stash (struct i915_address_space *vm,struct i915_vm_pt_stash *stash);void i915_vm_free_pt_stash (struct i915_address_space *vm,struct i915_vm_pt_stash *stash);
drivers/gpu/drm/i915/gt/intel_ppgtt.c +3 -4
@@ -85,11 +85,10 @@ write_dma_entry(struct drm_i915_gem_object * const pdma,const unsigned short idx, const u64 encoded_entry) { - u64 * const vaddr = kmap_atomic(__px_page(pdma)); + u64 * const vaddr = __px_vaddr(pdma); vaddr[idx] = encoded_entry;clflush_cache_range (&vaddr[idx],sizeof (u64)); -kunmap_atomic (vaddr); }void
@@ -254,7 +253,7 @@ int i915_vm_alloc_pt_stash(struct i915_address_space *vm,return 0 ; } -int i915_vm_pin_pt_stash (struct i915_address_space *vm, +int i915_vm_map_pt_stash (struct i915_address_space *vm,struct i915_vm_pt_stash *stash) {struct i915_page_table *pt;
@@ -262,7 +261,7 @@ int i915_vm_pin_pt_stash(struct i915_address_space *vm,for (n =0 ; n <ARRAY_SIZE (stash->pt); n++) {for (pt = stash->pt[n]; pt; pt = pt->stash) { - err =pin_pt_dma_locked (vm, pt->base); + err =map_pt_dma_locked (vm, pt->base);if (err)return err; }
drivers/gpu/drm/i915/i915_vma.c +1 -2
@@ -914,8 +914,7 @@ int i915_vma_pin_ww(struct i915_vma *vma, struct i915_gem_ww_ctx *ww,if (err) goto err_fence; - err =i915_vm_pin_pt_stash (vma->vm, - &work->stash); + err =i915_vm_map_pt_stash (vma->vm, &work->stash);if (err) goto err_fence; }
drivers/gpu/drm/i915/selftests/i915_gem_gtt.c +4 -6
@@ -185,7 +185,7 @@ static int igt_ppgtt_alloc(void *arg)if (err) goto err_ppgtt_cleanup; - err =i915_vm_pin_pt_stash (&ppgtt->vm, &stash); + err =i915_vm_map_pt_stash (&ppgtt->vm, &stash);if (err) {i915_vm_free_pt_stash (&ppgtt->vm, &stash); goto err_ppgtt_cleanup;
@@ -207,7 +207,7 @@ static int igt_ppgtt_alloc(void *arg)if (err) goto err_ppgtt_cleanup; - err =i915_vm_pin_pt_stash (&ppgtt->vm, &stash); + err =i915_vm_map_pt_stash (&ppgtt->vm, &stash);if (err) {i915_vm_free_pt_stash (&ppgtt->vm, &stash); goto err_ppgtt_cleanup;
@@ -324,11 +324,10 @@ static int lowlevel_hole(struct i915_address_space *vm, BIT_ULL(size))) goto alloc_vm_end; - err =i915_vm_pin_pt_stash (vm, &stash); + err =i915_vm_map_pt_stash (vm, &stash);if (!err) vm->allocate_va_range (vm, &stash, addr,BIT_ULL (size)); -i915_vm_free_pt_stash (vm, &stash); alloc_vm_end:if (err == -EDEADLK ) {
@@ -1966,10 +1965,9 @@ static int igt_cs_tlb(void *arg)if (err) goto end_ww; - err =i915_vm_pin_pt_stash (vm, &stash); + err =i915_vm_map_pt_stash (vm, &stash);if (!err) vm->allocate_va_range (vm, &stash, offset, chunk_size); -i915_vm_free_pt_stash (vm, &stash); end_ww:if (err == -EDEADLK ) {
drivers/gpu/drm/i915/selftests/i915_perf.c +1 -2
@@ -307,7 +307,7 @@ static int live_noa_gpr(void *arg) }/* Poison the ce->vm so we detect writes not to the GGTT gt->scratch */ - scratch =kmap (__px_page (ce->vm->scratch[0 ])); + scratch =__px_vaddr (ce->vm->scratch[0 ]);memset (scratch,POISON_FREE ,PAGE_SIZE ); rq =intel_context_create_request (ce);
@@ -405,7 +405,6 @@ static int live_noa_gpr(void *arg) out_rq:i915_request_put (rq); out_ce: -kunmap (__px_page (ce->vm->scratch[0 ]));intel_context_put (ce); out:stream_destroy (stream);
Signature · 6 lines
2.26.2 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [RFC PATCH 098/162] drm/i915/gtt: map the PD up front
Quoting Matthew Auld (2020-11-27 12:06:14)
Quoted 9 lines
We need to general our accessor for the page directories and tables from using the simple
kmap_atomicto support local memory, and this setup must be done on acquisition of the backing storage prior to entering fence execution contexts. Here we replace the kmap with the object maping code that for simple single page shmemfs object will return a plain kmap, that is then kept for the lifetime of the page directory.Signed-off-by Matthew Auld <[email protected]>Signed-off-by Chris Wilson <[email protected]>
We are going to really struggle with this on 32b :( -Chris
_______________________________________________
dri-devel mailing list [email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [Intel-gfx] [RFC PATCH 098/162] drm/i915/gtt: map the PD up front
Quoted 9 lines · Chris Wilson
Quoting Matthew Auld (2020-11-27 12:06:14)
Quoted 7 lines
We need to general our accessor for the page directories and tables from using the simple
kmap_atomicto support local memory, and this setup must be done on acquisition of the backing storage prior to entering fence execution contexts. Here we replace the kmap with the object maping code that for simple single page shmemfs object will return a plain kmap, that is then kept for the lifetime of the page directory.
Quoted 4 lines
Quoted 2 lines
Signed-off-by Matthew Auld <[email protected]>Signed-off-by Chris Wilson <[email protected]>We are going to really struggle with this on 32b :(
Just go back to mapping everything on demand like we did previously, and unmap as soon as we are done with the current directory across alloc/insert/clear?
Quoted 5 lines
-Chris
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [Intel-gfx] [RFC PATCH 098/162] drm/i915/gtt: map the PD up front
Quoted 10 lines · Matthew Auld
Quoted 9 lines · Chris Wilson
Quoting Matthew Auld (2020-11-27 12:06:14)
Quoted 7 lines
We need to general our accessor for the page directories and tables from using the simple
kmap_atomicto support local memory, and this setup must be done on acquisition of the backing storage prior to entering fence execution contexts. Here we replace the kmap with the object maping code that for simple single page shmemfs object will return a plain kmap, that is then kept for the lifetime of the page directory.
Quoted 8 lines
Quoted 4 lines
Quoted 2 lines
Signed-off-by Matthew Auld <[email protected]>Signed-off-by Chris Wilson <[email protected]>We are going to really struggle with this on 32b :(
Just go back to mapping everything on demand like we did previously, and unmap as soon as we are done with the current directory across alloc/insert/clear?
tbh if you run i915.ko on 32b kernels, on a modern platform, you deserve all the pain you get. There's quite a bit of work going on to essentially make kmap functions worse on 32b (we're not yet at the stage where people propose to nuke them, but getting there slowly), so designing code today with them in mind as primary justification is backwards.
What we can't do is keep kmap around forever, it'd need to be something like vmap that has a long-term mapping intention behind it. And at that point it's probably equally amounts of work to just go back to ad-hoc kmap. Also the rules have changed somewhat with kmap_local anyway, a kmap is a lot less painful in the code than it was with kmap_atomic. -Daniel
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
RFC PATCH 99/162 drm/i915/gtt/dgfx: place the PD in LMEM
In reply to Matthew AuldIt's a requirement that for dgfx we place all the paging structures in device local-memory.
--- drivers/gpu/drm/i915/gt/gen8_ppgtt.c | 5 ++++- drivers/gpu/drm/i915/gt/intel_gtt.c | 27 +++++++++++++++++++++++++-- drivers/gpu/drm/i915/gt/intel_gtt.h | 1 + 3 files changed, 30 insertions(+), 3 deletions(-)
drivers/gpu/drm/i915/gt/gen8_ppgtt.c +4 -1
@@ -702,7 +702,10 @@ struct i915_ppgtt *gen8_ppgtt_create(struct intel_gt *gt)*/ ppgtt->vm.has_read_only = !IS_GEN_RANGE (gt->i915,11 ,12 ); - ppgtt->vm.alloc_pt_dma = alloc_pt_dma; +if (IS_DGFX (gt->i915)) + ppgtt->vm.alloc_pt_dma = alloc_pt_lmem; +else + ppgtt->vm.alloc_pt_dma = alloc_pt_dma; err =gen8_init_scratch (&ppgtt->vm);if (err)
drivers/gpu/drm/i915/gt/intel_gtt.c +25 -2
@@ -7,10 +7,23 @@#include <linux/fault-inject.h> +#include "gem/i915_gem_lmem.h" #include "i915_trace.h" #include "intel_gt.h" #include "intel_gtt.h" +struct drm_i915_gem_object *alloc_pt_lmem (struct i915_address_space *vm,int sz) +{ +struct drm_i915_gem_object *obj; + + obj =i915_gem_object_create_lmem (vm->i915, sz,0 ); + +/* ensure all dma objects have the same reservation class */ +if (!IS_ERR (obj)) + obj->base.resv = &vm->resv; +return obj; +} +struct drm_i915_gem_object *alloc_pt_dma (struct i915_address_space *vm,int sz) {struct drm_i915_gem_object *obj;
@@ -27,9 +40,14 @@ struct drm_i915_gem_object *alloc_pt_dma(struct i915_address_space *vm, int sz)int map_pt_dma (struct i915_address_space *vm,struct drm_i915_gem_object *obj) { +enum i915_map_type type;void *vaddr; - vaddr =i915_gem_object_pin_map_unlocked (obj,I915_MAP_WB ); + type =I915_MAP_WB ; +if (i915_gem_object_is_lmem (obj)) + type =I915_MAP_WC ; + + vaddr =i915_gem_object_pin_map_unlocked (obj, type);if (IS_ERR (vaddr))return PTR_ERR (vaddr);
@@ -39,9 +57,14 @@ int map_pt_dma(struct i915_address_space *vm, struct drm_i915_gem_object *obj)int map_pt_dma_locked (struct i915_address_space *vm,struct drm_i915_gem_object *obj) { +enum i915_map_type type;void *vaddr; - vaddr =i915_gem_object_pin_map (obj,I915_MAP_WB ); + type =I915_MAP_WB ; +if (i915_gem_object_is_lmem (obj)) + type =I915_MAP_WC ; + + vaddr =i915_gem_object_pin_map (obj, type);if (IS_ERR (vaddr))return PTR_ERR (vaddr);
drivers/gpu/drm/i915/gt/intel_gtt.h +1 -0
@@ -522,6 +522,7 @@ int setup_scratch_page(struct i915_address_space *vm);void free_scratch (struct i915_address_space *vm);struct drm_i915_gem_object *alloc_pt_dma (struct i915_address_space *vm,int sz); +struct drm_i915_gem_object *alloc_pt_lmem (struct i915_address_space *vm,int sz);struct i915_page_table *alloc_pt (struct i915_address_space *vm);struct i915_page_directory *alloc_pd (struct i915_address_space *vm);struct i915_page_directory *__alloc_pd (int npde);
Signature · 6 lines
2.26.2 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
RFC PATCH 100/162 drm/i915/gtt: make flushing conditional
In reply to Matthew AuldNow that PDs can also be mapped as WC, we can forgo all the flushing for such mappings.
--- .../drm/i915/gem/selftests/i915_gem_context.c | 2 +- drivers/gpu/drm/i915/gt/gen6_ppgtt.c | 6 ++--- drivers/gpu/drm/i915/gt/gen8_ppgtt.c | 26 ++++++++++++------- drivers/gpu/drm/i915/gt/intel_gtt.c | 20 ++++++++++---- drivers/gpu/drm/i915/gt/intel_gtt.h | 4 +-- drivers/gpu/drm/i915/gt/intel_ppgtt.c | 6 +++-- drivers/gpu/drm/i915/selftests/i915_perf.c | 2 +- 7 files changed, 42 insertions(+), 24 deletions(-)
drivers/gpu/drm/i915/gem/selftests/i915_gem_context.c +1 -1
@@ -1752,7 +1752,7 @@ static int check_scratch_page(struct i915_gem_context *ctx, u32 *out)return -EINVAL ; } - vaddr =__px_vaddr (vm->scratch[0 ]); + vaddr =__px_vaddr (vm->scratch[0 ],NULL );memcpy (out, vaddr,sizeof (*out));if (memchr_inv (vaddr, *out,PAGE_SIZE )) {
drivers/gpu/drm/i915/gt/gen6_ppgtt.c +3 -3
@@ -105,7 +105,7 @@ static void gen6_ppgtt_clear_range(struct i915_address_space *vm,* entries back to scratch. */ - vaddr =px_vaddr (pt); + vaddr =px_vaddr (pt,NULL );memset32 (vaddr + pte, scratch_pte, count); pte =0 ;
@@ -128,7 +128,7 @@ static void gen6_ppgtt_insert_entries(struct i915_address_space *vm,GEM_BUG_ON (!pd->entry[act_pt]); - vaddr =px_vaddr (i915_pt_entry (pd, act_pt)); + vaddr =px_vaddr (i915_pt_entry (pd, act_pt),NULL ); do { GEM_BUG_ON(sg_dma_len(iter.sg) < I915_GTT_PAGE_SIZE); vaddr[act_pte] = pte_encode | GEN6_PTE_ADDR_ENCODE(iter.dma);
@@ -144,7 +144,7 @@ static void gen6_ppgtt_insert_entries(struct i915_address_space *vm, }if (++act_pte ==GEN6_PTES ) { - vaddr =px_vaddr (i915_pt_entry (pd, ++act_pt)); + vaddr =px_vaddr (i915_pt_entry (pd, ++act_pt),NULL ); act_pte =0 ; } }while (1 );
drivers/gpu/drm/i915/gt/gen8_ppgtt.c +16 -10
@@ -237,7 +237,7 @@ static u64 __gen8_ppgtt_clear(struct i915_address_space * const vm, atomic_read(&pt->used));GEM_BUG_ON (!count || count >=atomic_read (&pt->used)); - vaddr =px_vaddr (pt); + vaddr =px_vaddr (pt,NULL );memset64 (vaddr +gen8_pd_index (start,0 ), vm->scratch[0 ]->encode, count);
@@ -367,9 +367,10 @@ gen8_ppgtt_insert_pte(struct i915_ppgtt *ppgtt,struct i915_page_directory *pd;const gen8_pte_t pte_encode =gen8_pte_encode (0 , cache_level, flags);gen8_pte_t *vaddr; +bool needs_flush; pd =i915_pd_entry (pdp,gen8_pd_index (idx,2 )); - vaddr =px_vaddr (i915_pt_entry (pd,gen8_pd_index (idx,1 ))); + vaddr =px_vaddr (i915_pt_entry (pd,gen8_pd_index (idx,1 )), &needs_flush); do { GEM_BUG_ON(sg_dma_len(iter->sg) < I915_GTT_PAGE_SIZE); vaddr[gen8_pd_index(idx, 0)] = pte_encode | iter->dma;
@@ -395,11 +396,14 @@ gen8_ppgtt_insert_pte(struct i915_ppgtt *ppgtt, pd = pdp->entry[gen8_pd_index (idx,2 )]; } -clflush_cache_range (vaddr,PAGE_SIZE ); - vaddr =px_vaddr (i915_pt_entry (pd,gen8_pd_index (idx,1 ))); +if (needs_flush) +clflush_cache_range (vaddr,PAGE_SIZE ); + vaddr =px_vaddr (i915_pt_entry (pd,gen8_pd_index (idx,1 )), + &needs_flush); } }while (1 ); -clflush_cache_range (vaddr,PAGE_SIZE ); +if (needs_flush) +clflush_cache_range (vaddr,PAGE_SIZE );return idx; }
@@ -412,6 +416,7 @@ static void gen8_ppgtt_insert_huge(struct i915_vma *vma,const gen8_pte_t pte_encode =gen8_pte_encode (0 , cache_level, flags);unsigned int rem =sg_dma_len (iter->sg);u64 start = vma->node.start; +bool needs_flush;GEM_BUG_ON (!i915_vm_is_4lvl (vma->vm));
@@ -434,7 +439,7 @@ static void gen8_ppgtt_insert_huge(struct i915_vma *vma, encode |=GEN8_PDE_PS_2M ; page_size =I915_GTT_PAGE_SIZE_2M ; - vaddr =px_vaddr (pd); + vaddr =px_vaddr (pd, &needs_flush); }else {struct i915_page_table *pt =i915_pt_entry (pd,__gen8_pte_index (start,1 ));
@@ -449,7 +454,7 @@ static void gen8_ppgtt_insert_huge(struct i915_vma *vma, rem >= (I915_PDES - index) * I915_GTT_PAGE_SIZE)) maybe_64K =__gen8_pte_index (start,1 ); - vaddr =px_vaddr (pt); + vaddr =px_vaddr (pt, &needs_flush); } do {
@@ -482,7 +487,8 @@ static void gen8_ppgtt_insert_huge(struct i915_vma *vma, } }while (rem >= page_size && index <I915_PDES ); -clflush_cache_range (vaddr,PAGE_SIZE ); +if (needs_flush) +clflush_cache_range (vaddr,PAGE_SIZE );/* * Is it safe to mark the 2M block as 64K? -- Either we have
@@ -496,7 +502,7 @@ static void gen8_ppgtt_insert_huge(struct i915_vma *vma, !iter->sg && IS_ALIGNED(vma->node.start + vma->node.size, I915_GTT_PAGE_SIZE_2M)))) { - vaddr =px_vaddr (pd); + vaddr =px_vaddr (pd,NULL ); vaddr[maybe_64K] |=GEN8_PDE_IPS_64K ; page_size =I915_GTT_PAGE_SIZE_64K ;
@@ -513,7 +519,7 @@ static void gen8_ppgtt_insert_huge(struct i915_vma *vma,u16 i; encode = vma->vm->scratch[0 ]->encode; - vaddr =px_vaddr (i915_pt_entry (pd, maybe_64K)); + vaddr =px_vaddr (i915_pt_entry (pd, maybe_64K),NULL );for (i =1 ; i < index; i +=16 )memset64 (vaddr + i, encode,15 );
drivers/gpu/drm/i915/gt/intel_gtt.c +15 -5
@@ -176,12 +176,19 @@ void clear_pages(struct i915_vma *vma)memset (&vma->page_sizes,0 ,sizeof (vma->page_sizes)); } -void *__px_vaddr (struct drm_i915_gem_object *p) +void *__px_vaddr (struct drm_i915_gem_object *p,bool *needs_flush) {enum i915_map_type type; +void *vaddr;GEM_BUG_ON (!i915_gem_object_has_pages (p)); -return page_unpack_bits (p->mm.mapping, &type); + + vaddr =page_unpack_bits (p->mm.mapping, &type); + +if (needs_flush) + *needs_flush = type !=I915_MAP_WC ; + +return vaddr; }dma_addr_t __px_dma (struct drm_i915_gem_object *p)
@@ -199,15 +206,18 @@ struct page *__px_page(struct drm_i915_gem_object *p)void fill_page_dma (struct drm_i915_gem_object *p,const u64 val,unsigned int count) { -void *vaddr =__px_vaddr (p); +bool needs_flush; +void *vaddr; + vaddr =__px_vaddr (p, &needs_flush);memset64 (vaddr, val, count); -clflush_cache_range (vaddr,PAGE_SIZE ); +if (needs_flush) +clflush_cache_range (vaddr,PAGE_SIZE ); }static void poison_scratch_page (struct drm_i915_gem_object *scratch) { -void *vaddr =__px_vaddr (scratch); +void *vaddr =__px_vaddr (scratch,NULL );u8 val; val =0 ;
drivers/gpu/drm/i915/gt/intel_gtt.h +2 -2
@@ -176,8 +176,8 @@ struct page *__px_page(struct drm_i915_gem_object *p);dma_addr_t __px_dma (struct drm_i915_gem_object *p);#define px_dma (px) (__px_dma(px_base(px))) -void *__px_vaddr (struct drm_i915_gem_object *p); -#define px_vaddr (px) (__px_vaddr(px_base(px))) +void *__px_vaddr (struct drm_i915_gem_object *p,bool *needs_flush); +#define px_vaddr (px, needs_flush) (__px_vaddr(px_base(px), needs_flush))#define px_pt (px) \ __px_choose_expr(px, struct i915_page_table *, __x, \
drivers/gpu/drm/i915/gt/intel_ppgtt.c +4 -2
@@ -85,10 +85,12 @@ write_dma_entry(struct drm_i915_gem_object * const pdma,const unsigned short idx, const u64 encoded_entry) { - u64 * const vaddr = __px_vaddr(pdma); + bool needs_flush; +u64 *const vaddr =__px_vaddr (pdma, &needs_flush); vaddr[idx] = encoded_entry; -clflush_cache_range (&vaddr[idx],sizeof (u64)); +if (needs_flush) +clflush_cache_range (&vaddr[idx],sizeof (u64)); }void
drivers/gpu/drm/i915/selftests/i915_perf.c +1 -1
@@ -307,7 +307,7 @@ static int live_noa_gpr(void *arg) }/* Poison the ce->vm so we detect writes not to the GGTT gt->scratch */ - scratch =__px_vaddr (ce->vm->scratch[0 ]); + scratch =__px_vaddr (ce->vm->scratch[0 ],NULL );memset (scratch,POISON_FREE ,PAGE_SIZE ); rq =intel_context_create_request (ce);
Signature · 6 lines
2.26.2 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
RFC PATCH 101/162 drm/i915/gtt/dg1: add PTE_LM plumbing for PPGTT
In reply to Matthew AuldFor the PTEs we get an LM bit, to signal whether the page resides in SMEM or LMEM.
--- drivers/gpu/drm/i915/gt/gen8_ppgtt.c | 35 ++++++++++++++++++++++----- drivers/gpu/drm/i915/gt/intel_gtt.h | 3 +++ drivers/gpu/drm/i915/gt/intel_ppgtt.c | 4 +++ 3 files changed, 36 insertions(+), 6 deletions(-)
drivers/gpu/drm/i915/gt/gen8_ppgtt.c +29 -6
@@ -5,6 +5,7 @@#include <linux/log2.h> +#include "gem/i915_gem_lmem.h" #include "gen8_ppgtt.h" #include "i915_scatterlist.h" #include "i915_trace.h"
@@ -50,6 +51,21 @@ static u64 gen8_pte_encode(dma_addr_t addr,return pte; } +static u64 gen12_pte_encode (dma_addr_t addr, +enum i915_cache_level level, +u32 flags) +{ +gen8_pte_t pte = addr | _PAGE_PRESENT | _PAGE_RW; + +if (unlikely (flags &PTE_READ_ONLY )) + pte &= ~_PAGE_RW; + +if (flags &PTE_LM ) + pte |=GEN12_PPGTT_PTE_LM ; + +return pte; +} +static void gen8_ppgtt_notify_vgt (struct i915_ppgtt *ppgtt,bool create) {struct drm_i915_private *i915 = ppgtt->vm.i915;
@@ -365,7 +381,7 @@ gen8_ppgtt_insert_pte(struct i915_ppgtt *ppgtt, u32 flags) {struct i915_page_directory *pd; -const gen8_pte_t pte_encode =gen8_pte_encode (0 , cache_level, flags); +const gen8_pte_t pte_encode = ppgtt->vm.pte_encode (0 , cache_level, flags);gen8_pte_t *vaddr;bool needs_flush;
@@ -413,7 +429,7 @@ static void gen8_ppgtt_insert_huge(struct i915_vma *vma, enum i915_cache_level cache_level, u32 flags) { -const gen8_pte_t pte_encode =gen8_pte_encode (0 , cache_level, flags); +const gen8_pte_t pte_encode = vma->vm->pte_encode (0 , cache_level, flags);unsigned int rem =sg_dma_len (iter->sg);u64 start = vma->node.start;bool needs_flush;
@@ -558,6 +574,7 @@ static void gen8_ppgtt_insert(struct i915_address_space *vm,static int gen8_init_scratch (struct i915_address_space *vm) { +u32 pte_flags = vm->has_read_only;int ret;int i;
@@ -581,9 +598,12 @@ static int gen8_init_scratch(struct i915_address_space *vm)if (ret)return ret; +if (i915_gem_object_is_lmem (vm->scratch[0 ])) + pte_flags |=PTE_LM ; + vm->scratch[0 ]->encode = -gen8_pte_encode (px_dma (vm->scratch[0 ]), -I915_CACHE_LLC , vm->has_read_only); + vm->pte_encode (px_dma (vm->scratch[0 ]), +I915_CACHE_LLC , pte_flags);for (i =1 ; i <= vm->top; i++) {struct drm_i915_gem_object *obj;
@@ -713,6 +733,11 @@ struct i915_ppgtt *gen8_ppgtt_create(struct intel_gt *gt)else ppgtt->vm.alloc_pt_dma = alloc_pt_dma; +if (INTEL_GEN (gt->i915) >=12 ) + ppgtt->vm.pte_encode = gen12_pte_encode; +else + ppgtt->vm.pte_encode = gen8_pte_encode; + err =gen8_init_scratch (&ppgtt->vm);if (err) goto err_free;
@@ -734,8 +759,6 @@ struct i915_ppgtt *gen8_ppgtt_create(struct intel_gt *gt) ppgtt->vm.allocate_va_range = gen8_ppgtt_alloc; ppgtt->vm.clear_range = gen8_ppgtt_clear; - ppgtt->vm.pte_encode = gen8_pte_encode; -if (intel_vgpu_active (gt->i915))gen8_ppgtt_notify_vgt (ppgtt, true);
drivers/gpu/drm/i915/gt/intel_gtt.h +3 -0
@@ -85,6 +85,8 @@ typedef u64 gen8_pte_t;#define BYT_PTE_SNOOPED_BY_CPU_CACHES REG_BIT(2)#define BYT_PTE_WRITEABLE REG_BIT(1) +#define GEN12_PPGTT_PTE_LM (1 << 11) +/* * Cacheability Control is a 4-bit value. The low three bits are stored in bits * 3:1 of the PTE, while the fourth bit is stored in bit 11 of the PTE.
@@ -268,6 +270,7 @@ struct i915_address_space {enum i915_cache_level level, u32 flags); /* Create a valid PTE */#define PTE_READ_ONLY BIT(0) +#define PTE_LM BIT(1) void (*allocate_va_range)(struct i915_address_space *vm, struct i915_vm_pt_stash *stash,
drivers/gpu/drm/i915/gt/intel_ppgtt.c +4 -0
@@ -7,6 +7,8 @@#include "i915_trace.h" #include "intel_gtt.h" +#include "gem/i915_gem_lmem.h" +#include "gem/i915_gem_region.h" #include "gen6_ppgtt.h" #include "gen8_ppgtt.h"
@@ -193,6 +195,8 @@ void ppgtt_bind_vma(struct i915_address_space *vm, pte_flags =0 ;if (i915_gem_object_is_readonly (vma->obj)) pte_flags |=PTE_READ_ONLY ; +if (i915_gem_object_is_lmem (vma->obj)) + pte_flags |=PTE_LM ; vm->insert_entries (vm, vma, cache_level, pte_flags);wmb ();
Signature · 6 lines
2.26.2 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [Intel-gfx] [RFC PATCH 101/162] drm/i915/gtt/dg1: add PTE_LM plumbing for PPGTT
Quoting Matthew Auld (2020-11-27 12:06:17)
Quoted 50 lines
For the PTEs we get an LM bit, to signal whether the page resides in SMEM or LMEM.
Signed-off-by Matthew Auld <[email protected]>Cc Joonas Lahtinen <[email protected]>Cc Abdiel Janulgue <[email protected]>Signed-off-by Daniele Ceraolo Spurio <[email protected]>Signed-off-by Niranjana Vishwanathapura <[email protected]>Signed-off-by Venkata Sandeep Dhanalakota <[email protected]>--- drivers/gpu/drm/i915/gt/gen8_ppgtt.c | 35 ++++++++++++++++++++++----- drivers/gpu/drm/i915/gt/intel_gtt.h | 3 +++ drivers/gpu/drm/i915/gt/intel_ppgtt.c | 4 +++ 3 files changed, 36 insertions(+), 6 deletions(-)drivers/gpu/drm/i915/gt/gen8_ppgtt.c +16
-0@@ -5,6 +5,7 @@#include <linux/log2.h> +#include "gem/i915_gem_lmem.h" #include "gen8_ppgtt.h" #include "i915_scatterlist.h" #include "i915_trace.h" @@ -50,6 +51,21 @@ static u64 gen8_pte_encode(dma_addr_t addr,return pte; } +static u64 gen12_pte_encode (dma_addr_t addr, +enum i915_cache_level level, +u32 flags) +{ +gen8_pte_t pte = addr | _PAGE_PRESENT | _PAGE_RW; + +if (unlikely (flags &PTE_READ_ONLY )) + pte &= ~_PAGE_RW; + +if (flags &PTE_LM ) + pte |=GEN12_PPGTT_PTE_LM ; + +return pte; +} +static void gen8_ppgtt_notify_vgt (struct i915_ppgtt *ppgtt,bool create) {struct drm_i915_private *i915 = ppgtt->vm.i915;
drivers/gpu/drm/i915/gt/gen8_ppgtt.c gen8_ppgtt_insert_pte(struct i915_ppgtt *ppgtt, · line 384
Quoted 5 lines
drivers/gpu/drm/i915/gt/gen8_ppgtt.c +1
-1@@ -365,7 +381,7 @@ gen8_ppgtt_insert_pte(struct i915_ppgtt *ppgtt, u32 flags) {struct i915_page_directory *pd; -const gen8_pte_t pte_encode =gen8_pte_encode (0 , cache_level, flags); +const gen8_pte_t pte_encode = ppgtt->vm.pte_encode (0 , cache_level, flags);
We don't need the vfunc, since that flag will not be sent for gen8.
That bit test will be cheaper than the retpoline.
-Chris
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
RFC PATCH 102/162 drm/i915/gtt/dg1: add PTE_LM plumbing for GGTT
In reply to Matthew AuldBased on a patch from Michel Thierry.
--- drivers/gpu/drm/i915/gt/intel_ggtt.c | 24 ++++++++++++++++++------ drivers/gpu/drm/i915/gt/intel_gtt.h | 3 ++- 2 files changed, 20 insertions(+), 7 deletions(-)
drivers/gpu/drm/i915/gt/intel_ggtt.c +18 -6
@@ -10,6 +10,7 @@#include <drm/i915_drm.h> +#include "gem/i915_gem_lmem.h" #include "intel_gt.h" #include "i915_drv.h" #include "i915_scatterlist.h"
@@ -180,7 +181,12 @@ static u64 gen8_ggtt_pte_encode(dma_addr_t addr, enum i915_cache_level level, u32 flags) { -return addr | _PAGE_PRESENT; +gen8_pte_t pte = addr | _PAGE_PRESENT; + +if (flags &PTE_LM ) + pte |=GEN12_GGTT_PTE_LM ; + +return pte; }static void gen8_set_pte (void __iomem *addr,gen8_pte_t pte)
@@ -192,13 +198,13 @@ static void gen8_ggtt_insert_page(struct i915_address_space *vm,dma_addr_t addr, u64 offset, enum i915_cache_level level, - u32 unused) + 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,0 )); +gen8_set_pte (pte,gen8_ggtt_pte_encode (addr, level, flags)); ggtt->invalidate (ggtt); }
@@ -208,7 +214,7 @@ static void gen8_ggtt_insert_entries(struct i915_address_space *vm, enum i915_cache_level level, u32 flags) { -const gen8_pte_t pte_encode =gen8_ggtt_pte_encode (0 , level,0 ); +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;
@@ -448,8 +454,10 @@ static void ggtt_bind_vma(struct i915_address_space *vm,/* Applicable to VLV (gen8+ do not support RO in the GGTT) */ pte_flags =0 ; -if (i915_gem_object_is_readonly (obj)) +if (vma->vm->has_read_only &&i915_gem_object_is_readonly (obj)) pte_flags |=PTE_READ_ONLY ; +if (i915_gem_object_is_lmem (obj)) + pte_flags |=PTE_LM ; vm->insert_entries (vm, vma, cache_level, pte_flags); vma->page_sizes.gtt =I915_GTT_PAGE_SIZE ;
@@ -765,6 +773,7 @@ static int ggtt_probe_common(struct i915_ggtt *ggtt, u64 size)struct drm_i915_private *i915 = ggtt->vm.i915;struct pci_dev *pdev = i915->drm.pdev;phys_addr_t phys_addr; +u32 pte_flags =0 ;int ret;/* For Modern GENs the PTEs and register space are split in the BAR */
@@ -794,9 +803,12 @@ static int ggtt_probe_common(struct i915_ggtt *ggtt, u64 size)return ret; } +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 ,0 ); +I915_CACHE_NONE , pte_flags);return 0 ; }
drivers/gpu/drm/i915/gt/intel_gtt.h +2 -1
@@ -85,7 +85,8 @@ typedef u64 gen8_pte_t;#define BYT_PTE_SNOOPED_BY_CPU_CACHES REG_BIT(2)#define BYT_PTE_WRITEABLE REG_BIT(1) -#define GEN12_PPGTT_PTE_LM (1 << 11) +#define GEN12_GGTT_PTE_LM (1 << 1) +#define GEN12_PPGTT_PTE_LM (1 << 11)/* * Cacheability Control is a 4-bit value. The low three bits are stored in bits
Signature · 6 lines
2.26.2 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
RFC PATCH 103/162 drm/i915: allocate context from LMEM
In reply to Matthew AuldBased on a patch from Michel Thierry.
--- .../drm/i915/gt/intel_execlists_submission.c | 31 ++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/gt/intel_execlists_submission.c +30 -1
@@ -108,6 +108,8 @@*/ #include <linux/interrupt.h> +#include "gem/i915_gem_lmem.h" +#include "i915_drv.h" #include "i915_perf.h" #include "i915_trace.h"
@@ -4660,6 +4662,21 @@ static struct intel_timeline *pinned_timeline(struct intel_context *ce) page_unmask_bits(tl)); } +static int context_clear_lmem (struct drm_i915_gem_object *ctx_obj) +{ +void *vaddr; + + vaddr =i915_gem_object_pin_map (ctx_obj,I915_MAP_WC ); +if (IS_ERR (vaddr)) +return PTR_ERR (vaddr); + +memset64 (vaddr,0 , ctx_obj->base.size /sizeof (u64)); + +i915_gem_object_unpin_map (ctx_obj); + +return 0 ; +} +static int __execlists_context_alloc (struct intel_context *ce,struct intel_engine_cs *engine) {
@@ -4680,10 +4697,22 @@ static int __execlists_context_alloc(struct intel_context *ce, context_size +=PAGE_SIZE ; } - ctx_obj =i915_gem_object_create_shmem (engine->i915, context_size); +if (HAS_LMEM (engine->i915)) { + ctx_obj =i915_gem_object_create_lmem (engine->i915, + context_size, +I915_BO_ALLOC_CONTIGUOUS ); + }else { + ctx_obj =i915_gem_object_create_shmem (engine->i915, context_size); + }if (IS_ERR (ctx_obj))return PTR_ERR (ctx_obj); +if (HAS_LMEM (engine->i915)) { + ret =context_clear_lmem (ctx_obj); +if (ret) + goto error_deref_obj; + } + vma =i915_vma_instance (ctx_obj, &engine->gt->ggtt->vm,NULL );if (IS_ERR (vma)) { ret =PTR_ERR (vma);
Signature · 6 lines
2.26.2 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [Intel-gfx] [RFC PATCH 103/162] drm/i915: allocate context from LMEM
Quoting Matthew Auld (2020-11-27 12:06:19)
Quoted 27 lines
Based on a patch from Michel Thierry.
Signed-off-by Matthew Auld <[email protected]>Cc Joonas Lahtinen <[email protected]>Cc Abdiel Janulgue <[email protected]>--- .../drm/i915/gt/intel_execlists_submission.c | 31 ++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-)drivers/gpu/drm/i915/gt/intel_execlists_submission.c +3
-0@@ -108,6 +108,8 @@*/ #include <linux/interrupt.h> +#include "gem/i915_gem_lmem.h" +#include "i915_drv.h" #include "i915_perf.h" #include "i915_trace.h" @@ -4660,6 +4662,21 @@ static struct intel_timeline *pinned_timeline(struct intel_context *ce) page_unmask_bits(tl)); } +static int context_clear_lmem (struct drm_i915_gem_object *ctx_obj)
drivers/gpu/drm/i915/gt/intel_execlists_submission.c static struct intel_timeline *pinned_timeline(struct intel_context *ce) · line 4675
Quoted 10 lines
drivers/gpu/drm/i915/gt/intel_execlists_submission.c +10
-0+{ +void *vaddr; + + vaddr =i915_gem_object_pin_map (ctx_obj,I915_MAP_WC ); +if (IS_ERR (vaddr)) +return PTR_ERR (vaddr); + +memset64 (vaddr,0 , ctx_obj->base.size /sizeof (u64)); + +i915_gem_object_unpin_map (ctx_obj);
What? We copy over the entire object with the default state. -Chris
_______________________________________________
dri-devel mailing list [email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
RFC PATCH 104/162 drm/i915: move engine scratch to LMEM
In reply to Matthew Auld--- drivers/gpu/drm/i915/gt/intel_gt.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-)
drivers/gpu/drm/i915/gt/intel_gt.c +11 -3
@@ -4,6 +4,8 @@*/ #include "debugfs_gt.h" + +#include "gem/i915_gem_lmem.h" #include "i915_drv.h" #include "intel_context.h" #include "intel_gt.h"
@@ -342,9 +344,15 @@ static int intel_gt_init_scratch(struct intel_gt *gt, unsigned int size)struct i915_vma *vma;int ret; - obj =i915_gem_object_create_stolen (i915, size); -if (IS_ERR (obj)) - obj =i915_gem_object_create_internal (i915, size); +if (HAS_LMEM (i915)) { + obj =i915_gem_object_create_lmem (i915, size, +I915_BO_ALLOC_CONTIGUOUS | +I915_BO_ALLOC_VOLATILE ); + }else { + obj =i915_gem_object_create_stolen (i915, size); +if (IS_ERR (obj)) + obj =i915_gem_object_create_internal (i915, size); + }if (IS_ERR (obj)) {DRM_ERROR ("Failed to allocate scratch page\n" );return PTR_ERR (obj);
Signature · 6 lines
2.26.2 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
RFC PATCH 105/162 drm/i915: Provide a way to disable PCIe relaxed write ordering
In reply to Matthew AuldFrom: Abdiel Janulgue <[email protected]>
For performance writes over PCIe may not be strictly ordered by default. This provides an option to expose a kernel configuration option to disable relaxed ordering and turn on strict ordering instead for debug purposes.
--- drivers/gpu/drm/i915/Kconfig.debug | 11 +++++++++++ drivers/gpu/drm/i915/intel_memory_region.c | 12 ++++++++++++ 2 files changed, 23 insertions(+)
drivers/gpu/drm/i915/Kconfig.debug +11 -0
@@ -222,3 +222,14 @@ config DRM_I915_DEBUG_RUNTIME_PM driver loading, suspend and resume operations. If in doubt, say "N" + +config DRM_I915_PCIE_STRICT_WRITE_ORDERING + bool "Enable PCIe strict ordering " + depends on DRM_I915 + default n + help + Relaxed ordering in writes is enabled by default to improve system + performance. Strict ordering can be selected instead to assist in + debugging. + + If in doubt, say "N".
drivers/gpu/drm/i915/intel_memory_region.c +12 -0
@@ -286,6 +286,18 @@ int intel_memory_regions_hw_probe(struct drm_i915_private *i915) {int err, i; +/* All platforms currently have system memory */ +GEM_BUG_ON (!HAS_REGION (i915,REGION_SMEM )); + +if (IS_DGFX (i915)) { +if (IS_ENABLED (CONFIG_DRM_I915_PCIE_STRICT_WRITE_ORDERING )) +pcie_capability_clear_word (i915->drm.pdev,PCI_EXP_DEVCTL , +PCI_EXP_DEVCTL_RELAX_EN ); +else +pcie_capability_set_word (i915->drm.pdev,PCI_EXP_DEVCTL , +PCI_EXP_DEVCTL_RELAX_EN ); + } +for (i =0 ; i <ARRAY_SIZE (i915->mm.regions); i++) {struct intel_memory_region *mem =ERR_PTR (-ENODEV );u16 type, instance;
Signature · 6 lines
2.26.2 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
RFC PATCH 106/162 drm/i915: i915 returns -EBUSY on thread contention
In reply to Matthew AuldFrom: CQ Tang <[email protected]>
During high threads contention, the same object had been pinned with a different type. A new pinning will catch -EBUSY if the FORCE flag is not specified.
This error was observed on DG1 silicon during PO.
--- drivers/gpu/drm/i915/gem/i915_gem_object_blt.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/gem/i915_gem_object_blt.c +2 -2
@@ -57,7 +57,7 @@ struct i915_vma *intel_emit_vma_fill_blt(struct intel_context *ce,/* we pinned the pool, mark it as such */ intel_gt_buffer_pool_mark_used (pool); - cmd =i915_gem_object_pin_map (pool->obj,I915_MAP_WC ); + cmd =i915_gem_object_pin_map (pool->obj,I915_MAP_FORCE_WC );if (IS_ERR (cmd)) { err =PTR_ERR (cmd); goto out_unpin;
@@ -297,7 +297,7 @@ struct i915_vma *intel_emit_vma_copy_blt(struct intel_context *ce,/* we pinned the pool, mark it as such */ intel_gt_buffer_pool_mark_used (pool); - cmd =i915_gem_object_pin_map (pool->obj,I915_MAP_WC ); + cmd =i915_gem_object_pin_map (pool->obj,I915_MAP_FORCE_WC );if (IS_ERR (cmd)) { err =PTR_ERR (cmd); goto out_unpin;
Signature · 6 lines
2.26.2 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
RFC PATCH 107/162 drm/i915: setup GPU device lmem region
In reply to Matthew AuldFrom: CQ Tang <[email protected]>
The lmem region needs to remove the stolen part.
--- drivers/gpu/drm/i915/i915_reg.h | 2 ++ drivers/gpu/drm/i915/intel_region_lmem.c | 11 +++++++---- 2 files changed, 9 insertions(+), 4 deletions(-)
drivers/gpu/drm/i915/i915_reg.h +2 -0
@@ -12066,6 +12066,8 @@ enum skl_power_gate {#define GEN12_LMEM_CFG_ADDR _MMIO(0xcf58)#define LMEM_ENABLE (1 << 31) +#define GEN12_GSMBASE _MMIO(0x108100) +/* gamt regs */ #define GEN8_L3_LRA_1_GPGPU _MMIO(0x4dd4)#define GEN8_L3_LRA_1_GPGPU_DEFAULT_VALUE_BDW 0x67F1427F/* max/min for LRA1/2 */
drivers/gpu/drm/i915/intel_region_lmem.c +7 -4
@@ -140,20 +140,23 @@ intel_setup_fake_lmem(struct drm_i915_private *i915)static struct intel_memory_region *setup_lmem (struct drm_i915_private *dev_priv) { +struct intel_uncore *uncore = &dev_priv->uncore;struct pci_dev *pdev = dev_priv->drm.pdev;struct intel_memory_region *mem;resource_size_t io_start; -resource_size_t size; +resource_size_t lmem_size;/* Enables Local Memory functionality in GAM */ I915_WRITE (GEN12_LMEM_CFG_ADDR ,I915_READ (GEN12_LMEM_CFG_ADDR ) |LMEM_ENABLE ); +/* Stolen starts from GSMBASE on DG1 */ + lmem_size =intel_uncore_read64 (uncore,GEN12_GSMBASE ); + io_start =pci_resource_start (pdev,2 ); - size =pci_resource_len (pdev,2 ); mem =intel_memory_region_create (dev_priv,0 , - size, + lmem_size,I915_GTT_PAGE_SIZE_4K , io_start, &intel_region_lmem_ops);
@@ -162,7 +165,7 @@ setup_lmem(struct drm_i915_private *dev_priv)DRM_INFO ("Intel graphics LMEM IO start: %llx\n" , (u64 )mem->io_start);DRM_INFO ("Intel graphics LMEM size: %llx\n" , - (u64 )size); + (u64 )lmem_size); }return mem;
Signature · 6 lines
2.26.2 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [RFC PATCH 107/162] drm/i915: setup GPU device lmem region
Quoting Matthew Auld (2020-11-27 12:06:23)
Quoted 38 lines
From: CQ Tang <[email protected]>
The lmem region needs to remove the stolen part.
Cc Joonas Lahtinen <[email protected]>Cc Matthew Auld <[email protected]>Cc Abdiel Janulgue <[email protected]>Cc Chris P Wilson <[email protected]>Cc Balestrieri, Francesco <[email protected]>Cc Niranjana Vishwanathapura <[email protected]>Cc Venkata S Dhanalakota <[email protected]>Cc Neel Desai <[email protected]>Cc Matthew Brost <[email protected]>Cc Sudeep Dutt <[email protected]>Signed-off-by CQ Tang <[email protected]>--- drivers/gpu/drm/i915/i915_reg.h | 2 ++ drivers/gpu/drm/i915/intel_region_lmem.c | 11 +++++++---- 2 files changed, 9 insertions(+), 4 deletions(-)drivers/gpu/drm/i915/i915_reg.h +2
-0@@ -12066,6 +12066,8 @@ enum skl_power_gate {#define GEN12_LMEM_CFG_ADDR _MMIO(0xcf58)#define LMEM_ENABLE (1 << 31) +#define GEN12_GSMBASE _MMIO(0x108100) +/* gamt regs */ #define GEN8_L3_LRA_1_GPGPU _MMIO(0x4dd4)#define GEN8_L3_LRA_1_GPGPU_DEFAULT_VALUE_BDW 0x67F1427F/* max/min for LRA1/2 */ drivers/gpu/drm/i915/intel_region_lmem.c +0
-0
drivers/gpu/drm/i915/intel_region_lmem.c intel_setup_fake_lmem(struct drm_i915_private *i915) · line 141
Quoted 2 lines
drivers/gpu/drm/i915/intel_region_lmem.c +0
-0@@ -140,20 +140,23 @@ intel_setup_fake_lmem(struct drm_i915_private *i915)static struct intel_memory_region *setup_lmem (struct drm_i915_private *dev_priv)
Am I wrong in thinking lmem should be under gt?
Quoted 6 lines
drivers/gpu/drm/i915/intel_region_lmem.c +1
-1{ +struct intel_uncore *uncore = &dev_priv->uncore;struct pci_dev *pdev = dev_priv->drm.pdev;struct intel_memory_region *mem;resource_size_t io_start; -resource_size_t size;
drivers/gpu/drm/i915/intel_region_lmem.c intel_setup_fake_lmem(struct drm_i915_private *i915) · line 152
Quoted 10 lines
drivers/gpu/drm/i915/intel_region_lmem.c +4
-1+resource_size_t lmem_size;/* Enables Local Memory functionality in GAM */ I915_WRITE (GEN12_LMEM_CFG_ADDR ,I915_READ (GEN12_LMEM_CFG_ADDR ) |LMEM_ENABLE ); +/* Stolen starts from GSMBASE on DG1 */ + lmem_size =intel_uncore_read64 (uncore,GEN12_GSMBASE ); + io_start =pci_resource_start (pdev,2 ); - size =pci_resource_len (pdev,2 );
Sanitycheck the two.
size = min(size, lmem_size);
drivers/gpu/drm/i915/intel_region_lmem.c intel_setup_fake_lmem(struct drm_i915_private *i915) · line 159
Quoted 5 lines
drivers/gpu/drm/i915/intel_region_lmem.c +1
-1mem = intel_memory_region_create(dev_priv, 0, - size, + lmem_size,
Ok, stolen is at tail not start.
drivers/gpu/drm/i915/intel_region_lmem.c setup_lmem(struct drm_i915_private *dev_priv) · line 168
Quoted 9 lines
drivers/gpu/drm/i915/intel_region_lmem.c +1
-1I915_GTT_PAGE_SIZE_4K , io_start, &intel_region_lmem_ops);@@ -162,7 +165,7 @@ setup_lmem(struct drm_i915_private *dev_priv)DRM_INFO ("Intel graphics LMEM IO start: %llx\n" , (u64 )mem->io_start);DRM_INFO ("Intel graphics LMEM size: %llx\n" , - (u64 )size); + (u64 )lmem_size);
Use the correct printf-formats, %pa.
Quoted 6 lines
drivers/gpu/drm/i915/intel_region_lmem.c +0
-0}return mem;Signature · 1 line
2.26.2
---------------------------------------------------------------------
Intel Corporation (UK) Limited
Registered No. 1134945 (England)
Registered Office: Pipers Way, Swindon SN3 1RJ
VAT No: 860 2173 47
This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
RFC PATCH 108/162 drm/i915: Fix object page offset within a region
In reply to Matthew AuldFrom: CQ Tang <[email protected]>
Adjust the page offset with region start dma address.
--- drivers/gpu/drm/i915/i915_gpu_error.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/i915_gpu_error.c +3 -1
@@ -1051,7 +1051,9 @@ i915_vma_coredump_create(const struct intel_gt *gt,for_each_sgt_daddr (dma, iter, vma->pages) {void __iomem *s; - s =io_mapping_map_wc (&mem->iomap, dma,PAGE_SIZE ); + s =io_mapping_map_wc (&mem->iomap, + dma - mem->region.start, +PAGE_SIZE ); ret =compress_page (compress, (void __force *)s, dst, true);
Signature · 6 lines
2.26.2 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
RFC PATCH 109/162 drm/i915: add i915_gem_object_is_devmem() function
In reply to Matthew AuldFrom: CQ Tang <[email protected]>
We have three memory region types: INTEL_SMEM, INTEL_LMEM, andINTEL_STOLEN. We also have two types of memory: system memory
and device memory (or called local memory).
Memory region with type INTEL_SMEM only has system memory; the other two types of memory regions could have either system memory or device memory.
This function is used to distinguish real local device memory or system memory (including fake local memmory and bios stolen system memory) for INTEL_LMEM and INTEL_STOLEN memory region type.
PPGTT will program PTE_LM bit based on this value.
--- drivers/gpu/drm/i915/gem/i915_gem_lmem.c | 11 ++++++++++- drivers/gpu/drm/i915/gem/i915_gem_lmem.h | 1 + drivers/gpu/drm/i915/gt/intel_ggtt.c | 2 +- drivers/gpu/drm/i915/gt/intel_ppgtt.c | 2 +- drivers/gpu/drm/i915/intel_memory_region.h | 1 + drivers/gpu/drm/i915/intel_region_lmem.c | 3 +++ 6 files changed, 17 insertions(+), 3 deletions(-)
drivers/gpu/drm/i915/gem/i915_gem_lmem.c +10 -1
@@ -217,7 +217,16 @@ i915_gem_object_lmem_io_map_page_atomic(struct drm_i915_gem_object *obj,bool i915_gem_object_is_lmem (struct drm_i915_gem_object *obj) { -return obj->ops == &i915_gem_lmem_obj_ops; +struct intel_memory_region *region = obj->mm.region; + +return region && (region->is_devmem || region->type ==INTEL_MEMORY_LOCAL ); +} + +bool i915_gem_object_is_devmem (struct drm_i915_gem_object *obj) +{ +struct intel_memory_region *region = obj->mm.region; + +return region && region->is_devmem; } struct drm_i915_gem_object *
drivers/gpu/drm/i915/gem/i915_gem_lmem.h +1 -0
@@ -21,6 +21,7 @@ i915_gem_object_lmem_io_map_page_atomic(struct drm_i915_gem_object *obj, unsigned long n);bool i915_gem_object_is_lmem (struct drm_i915_gem_object *obj); +bool i915_gem_object_is_devmem (struct drm_i915_gem_object *obj);struct drm_i915_gem_object * i915_gem_object_create_lmem(struct drm_i915_private *i915,
drivers/gpu/drm/i915/gt/intel_ggtt.c +1 -1
@@ -456,7 +456,7 @@ static void ggtt_bind_vma(struct i915_address_space *vm, pte_flags =0 ;if (vma->vm->has_read_only &&i915_gem_object_is_readonly (obj)) pte_flags |=PTE_READ_ONLY ; -if (i915_gem_object_is_lmem (obj)) +if (i915_gem_object_is_devmem (obj)) pte_flags |=PTE_LM ; vm->insert_entries (vm, vma, cache_level, pte_flags);
drivers/gpu/drm/i915/gt/intel_ppgtt.c +1 -1
@@ -195,7 +195,7 @@ void ppgtt_bind_vma(struct i915_address_space *vm, pte_flags =0 ;if (i915_gem_object_is_readonly (vma->obj)) pte_flags |=PTE_READ_ONLY ; -if (i915_gem_object_is_lmem (vma->obj)) +if (i915_gem_object_is_devmem (vma->obj)) pte_flags |=PTE_LM ; vm->insert_entries (vm, vma, cache_level, pte_flags);
drivers/gpu/drm/i915/intel_memory_region.h +1 -0
@@ -92,6 +92,7 @@ struct intel_memory_region {enum intel_region_id id;char name[8 ];struct intel_gt *gt;/* GT closest to this region. */ +bool is_devmem;/* true for device memory */ dma_addr_t remap_addr;
drivers/gpu/drm/i915/intel_region_lmem.c +3 -0
@@ -166,6 +166,9 @@ setup_lmem(struct drm_i915_private *dev_priv) (u64)mem->io_start);DRM_INFO ("Intel graphics LMEM size: %llx\n" , (u64 )lmem_size); + +/* this is real device memory */ + mem->is_devmem = true; }return mem;
Signature · 6 lines
2.26.2 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
RFC PATCH 110/162 drm/i915: finish memory region support for stolen objects.
In reply to Matthew AuldFrom: CQ Tang <[email protected]>
Current stolen code has partial memory region support. This patch finish the rest of code, so object memory are allocated from stolen memory region.
However, three "global" variables are still kept for the display code to access, "i915->dsm", "i915->dsm_reserved",
and "i915->stolen_usable_size",
This is to reduce the amount of code change. Also there is only one display per device, while there could be multipes stolen memory region.
--- drivers/gpu/drm/i915/display/intel_fbc.c | 20 ++- drivers/gpu/drm/i915/gem/i915_gem_stolen.c | 185 ++++++++++----------- drivers/gpu/drm/i915/gem/i915_gem_stolen.h | 7 +- drivers/gpu/drm/i915/gt/selftest_reset.c | 5 +- drivers/gpu/drm/i915/i915_drv.h | 6 - drivers/gpu/drm/i915/intel_memory_region.h | 3 + 6 files changed, 112 insertions(+), 114 deletions(-)
drivers/gpu/drm/i915/display/intel_fbc.c +12 -8
@@ -437,6 +437,7 @@ static int find_compression_threshold(struct drm_i915_private *dev_priv, unsigned int size, unsigned int fb_cpp) { +struct intel_memory_region *mem =i915_stolen_region (dev_priv);int compression_threshold =1 ;int ret;u64 end;
@@ -460,7 +461,7 @@ static int find_compression_threshold(struct drm_i915_private *dev_priv,*/ /* Try to over-allocate to reduce reallocations and fragmentation. */ - ret =i915_gem_stolen_insert_node_in_range (dev_priv, node, size <<=1 , + ret =i915_gem_stolen_insert_node_in_range (mem, node, size <<=1 ,4096 ,0 , end);if (ret ==0 )return compression_threshold;
@@ -471,7 +472,7 @@ static int find_compression_threshold(struct drm_i915_private *dev_priv, (fb_cpp == 2 && compression_threshold == 2))return 0 ; - ret =i915_gem_stolen_insert_node_in_range (dev_priv, node, size >>=1 , + ret =i915_gem_stolen_insert_node_in_range (mem, node, size >>=1 ,4096 ,0 , end);if (ret &&INTEL_GEN (dev_priv) <=4 ) {return 0 ;
@@ -486,6 +487,7 @@ static int find_compression_threshold(struct drm_i915_private *dev_priv,static int intel_fbc_alloc_cfb (struct drm_i915_private *dev_priv,unsigned int size,unsigned int fb_cpp) { +struct intel_memory_region *mem =i915_stolen_region (dev_priv);struct intel_fbc *fbc = &dev_priv->fbc;struct drm_mm_node *compressed_llb;int ret;
@@ -515,7 +517,7 @@ static int intel_fbc_alloc_cfb(struct drm_i915_private *dev_priv,if (!compressed_llb) goto err_fb; - ret =i915_gem_stolen_insert_node (dev_priv, compressed_llb, + ret =i915_gem_stolen_insert_node (mem, compressed_llb,4096 ,4096 );if (ret) goto err_fb;
@@ -542,15 +544,16 @@ static int intel_fbc_alloc_cfb(struct drm_i915_private *dev_priv, err_fb:kfree (compressed_llb); -i915_gem_stolen_remove_node (dev_priv, &fbc->compressed_fb); +i915_gem_stolen_remove_node (mem, &fbc->compressed_fb); err_llb: -if (drm_mm_initialized (&dev_priv->mm.stolen)) +if (drm_mm_initialized (&mem->stolen))drm_info_once (&dev_priv->drm,"not enough stolen space for compressed buffer (need %d more bytes), disabling. Hint: you may be able to increase stolen memory size in the BIOS to avoid this.\n" , size);return -ENOSPC ; }static void __intel_fbc_cleanup_cfb (struct drm_i915_private *dev_priv) { +struct intel_memory_region *mem =i915_stolen_region (dev_priv);struct intel_fbc *fbc = &dev_priv->fbc;if (WARN_ON (intel_fbc_hw_is_active (dev_priv)))
@@ -560,11 +563,11 @@ static void __intel_fbc_cleanup_cfb(struct drm_i915_private *dev_priv)return ;if (fbc->compressed_llb) { -i915_gem_stolen_remove_node (dev_priv, fbc->compressed_llb); +i915_gem_stolen_remove_node (mem, fbc->compressed_llb);kfree (fbc->compressed_llb); } -i915_gem_stolen_remove_node (dev_priv, &fbc->compressed_fb); +i915_gem_stolen_remove_node (mem, &fbc->compressed_fb); }void intel_fbc_cleanup_cfb (struct drm_i915_private *dev_priv)
@@ -1468,12 +1471,13 @@ static bool need_fbc_vtd_wa(struct drm_i915_private *dev_priv)void intel_fbc_init (struct drm_i915_private *dev_priv) {struct intel_fbc *fbc = &dev_priv->fbc; +struct intel_memory_region *mem =i915_stolen_region (dev_priv);INIT_WORK (&fbc->underrun_work, intel_fbc_underrun_work_fn);mutex_init (&fbc->lock); fbc->active = false; -if (!drm_mm_initialized (&dev_priv->mm.stolen)) +if (!mem || !drm_mm_initialized (&mem->stolen))mkwrite_device_info (dev_priv)->display.has_fbc = false;if (need_fbc_vtd_wa (dev_priv))
drivers/gpu/drm/i915/gem/i915_gem_stolen.c +90 -95
373 lines not on this page · raw message
drivers/gpu/drm/i915/gem/i915_gem_stolen.h +4 -3
@@ -11,15 +11,16 @@struct drm_i915_private ;struct drm_mm_node ;struct drm_i915_gem_object ; +struct intel_memory_region ; -int i915_gem_stolen_insert_node (struct drm_i915_private *dev_priv, +int i915_gem_stolen_insert_node (struct intel_memory_region *mem,struct drm_mm_node *node,u64 size,unsigned alignment); -int i915_gem_stolen_insert_node_in_range (struct drm_i915_private *dev_priv, +int i915_gem_stolen_insert_node_in_range (struct intel_memory_region *mem,struct drm_mm_node *node,u64 size,unsigned alignment,u64 start,u64 end); -void i915_gem_stolen_remove_node (struct drm_i915_private *dev_priv, +void i915_gem_stolen_remove_node (struct intel_memory_region *mem,struct drm_mm_node *node);struct intel_memory_region *i915_gem_stolen_setup (struct drm_i915_private *i915);
drivers/gpu/drm/i915/gt/selftest_reset.c +3 -2
@@ -20,6 +20,7 @@ __igt_reset_stolen(struct intel_gt *gt, {struct i915_ggtt *ggtt = >->i915->ggtt;const struct resource *dsm = >->i915->dsm; +struct intel_memory_region *mem =i915_stolen_region (gt->i915);resource_size_t num_pages, page;struct intel_engine_cs *engine;intel_wakeref_t wakeref;
@@ -92,7 +93,7 @@ __igt_reset_stolen(struct intel_gt *gt, ggtt->error_capture.start, PAGE_SIZE); -if (!__drm_mm_interval_first (>->i915->mm.stolen, +if (!__drm_mm_interval_first (&mem->stolen, page <<PAGE_SHIFT , ((page +1 ) <<PAGE_SHIFT ) -1 ))memset32 (s,STACK_MAGIC ,PAGE_SIZE /sizeof (u32));
@@ -139,7 +140,7 @@ __igt_reset_stolen(struct intel_gt *gt, x =crc32_le (0 , in,PAGE_SIZE );if (x != crc[page] && - !__drm_mm_interval_first (>->i915->mm.stolen, + !__drm_mm_interval_first (&mem->stolen, page <<PAGE_SHIFT , ((page +1 ) <<PAGE_SHIFT ) -1 )) { pr_debug("unused stolen page %pa modified by GPU reset\n",
drivers/gpu/drm/i915/i915_drv.h +0 -6
@@ -549,12 +549,6 @@ struct intel_l3_parity { };struct i915_gem_mm { -/** Memory allocator for GTT stolen memory */ -struct drm_mm stolen; -/** Protects the usage of the GTT stolen memory allocator. This is -* always the inner lock when overlapping with struct_mutex. */ -struct mutex stolen_lock; -/* Protects bound_list/unbound_list and #drm_i915_gem_object.mm.link */ spinlock_t obj_lock;
drivers/gpu/drm/i915/intel_memory_region.h +3 -0
@@ -6,6 +6,7 @@#ifndef __INTEL_MEMORY_REGION_H__#define __INTEL_MEMORY_REGION_H__ +#include <drm/drm_mm.h> #include <linux/kref.h> #include <linux/ioport.h> #include <linux/mutex.h>
@@ -77,6 +78,8 @@ struct intel_memory_region {/* For fake LMEM */ struct drm_mm_node fake_mappable; +struct drm_mm stolen; +struct i915_buddy_mm mm;struct mutex mm_lock;
Signature · 6 lines
2.26.2 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
RFC PATCH 111/162 drm/i915/lmem: support optional CPU clearing for special internal use
In reply to Matthew AuldFor some internal device local-memory objects it would be useful to have an option to CPU clear the pages upon gathering the backing store. Note that this might be before the blitter is useable, which is the case for some internal GuC objects.
--- .../gpu/drm/i915/gem/i915_gem_object_types.h | 6 +- drivers/gpu/drm/i915/gem/i915_gem_region.c | 20 +++++ .../drm/i915/selftests/intel_memory_region.c | 90 ++++++++++++++++++- 3 files changed, 113 insertions(+), 3 deletions(-)
drivers/gpu/drm/i915/gem/i915_gem_object_types.h +4 -2
@@ -166,10 +166,12 @@ struct drm_i915_gem_object {#define I915_BO_ALLOC_CONTIGUOUS BIT(0)#define I915_BO_ALLOC_VOLATILE BIT(1)#define I915_BO_ALLOC_STRUCT_PAGE BIT(2) +#define I915_BO_ALLOC_CPU_CLEAR BIT(3)#define I915_BO_ALLOC_FLAGS (I915_BO_ALLOC_CONTIGUOUS | \ I915_BO_ALLOC_VOLATILE | \ - I915_BO_ALLOC_STRUCT_PAGE) -#define I915_BO_READONLY BIT(3) + I915_BO_ALLOC_STRUCT_PAGE | \ + I915_BO_ALLOC_CPU_CLEAR) +#define I915_BO_READONLY BIT(4)/* * Is the object to be mapped as read-only to the GPU
drivers/gpu/drm/i915/gem/i915_gem_region.c +20 -0
@@ -95,6 +95,26 @@ i915_gem_object_get_pages_buddy(struct drm_i915_gem_object *obj)sg_mark_end (sg);i915_sg_trim (st); +/* Intended for kernel internal use only */ +if (obj->flags &I915_BO_ALLOC_CPU_CLEAR ) { +struct scatterlist *sg; +unsigned long i; + +for_each_sg (st->sgl, sg, st->nents, i) { +unsigned int length; +void __iomem *vaddr; +dma_addr_t daddr; + + daddr =sg_dma_address (sg); + daddr -= mem->region.start; + length =sg_dma_len (sg); + + vaddr =io_mapping_map_wc (&mem->iomap, daddr, length); +memset64 (vaddr,0 , length /sizeof (u64)); +io_mapping_unmap (vaddr); + } + } +__i915_gem_object_set_pages (obj, st, sg_page_sizes);return 0 ;
drivers/gpu/drm/i915/selftests/intel_memory_region.c +89 -1
115 lines not on this page · raw message
Signature · 6 lines
2.26.2 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
RFC PATCH 112/162 drm/i915/guc: put all guc objects in lmem when available
In reply to Matthew AuldFrom: Daniele Ceraolo Spurio <[email protected]>
The firmware binary has to be loaded from lmem and the recommendation is to put all other objects in there as well. Note that we don't fall back to system memory if the allocation in lmem fails because all objects are allocated during driver load and if we have issues with lmem at that point something is seriously wrong with the system, so no point in trying to handle it.
--- drivers/gpu/drm/i915/gem/i915_gem_lmem.c | 41 +++++++++++++++++++++++ drivers/gpu/drm/i915/gem/i915_gem_lmem.h | 8 +++++ drivers/gpu/drm/i915/gt/uc/intel_guc.c | 9 ++++- drivers/gpu/drm/i915/gt/uc/intel_guc_fw.c | 11 ++++-- drivers/gpu/drm/i915/gt/uc/intel_huc.c | 14 ++++++-- drivers/gpu/drm/i915/gt/uc/intel_uc_fw.c | 35 ++++++++++++++++--- 6 files changed, 107 insertions(+), 11 deletions(-)
drivers/gpu/drm/i915/gem/i915_gem_lmem.c +41 -0
@@ -215,6 +215,21 @@ i915_gem_object_lmem_io_map_page_atomic(struct drm_i915_gem_object *obj,return io_mapping_map_atomic_wc (&obj->mm.region->iomap, offset); } +void __iomem * +i915_gem_object_lmem_io_map (struct drm_i915_gem_object *obj, +unsigned long n, +unsigned long size) +{ +resource_size_t offset; + +GEM_BUG_ON (!i915_gem_object_is_contiguous (obj)); + + offset =i915_gem_object_get_dma_address (obj, n); + offset -= obj->mm.region->region.start; + +return io_mapping_map_wc (&obj->mm.region->iomap, offset, size); +} +bool i915_gem_object_is_lmem (struct drm_i915_gem_object *obj) {struct intel_memory_region *region = obj->mm.region;
@@ -229,6 +244,32 @@ bool i915_gem_object_is_devmem(struct drm_i915_gem_object *obj)return region && region->is_devmem; } +struct drm_i915_gem_object * +i915_gem_object_create_lmem_from_data (struct drm_i915_private *i915, +const void *data,size_t size) +{ +struct drm_i915_gem_object *obj; +void *map; + + obj =i915_gem_object_create_lmem (i915, +round_up (size,PAGE_SIZE ), +I915_BO_ALLOC_CONTIGUOUS ); +if (IS_ERR (obj)) +return obj; + + map =i915_gem_object_pin_map_unlocked (obj,I915_MAP_WC ); +if (IS_ERR (map)) { +i915_gem_object_put (obj); +return map; + } + +memcpy (map, data, size); + +i915_gem_object_unpin_map (obj); + +return obj; +} +struct drm_i915_gem_object * i915_gem_object_create_lmem(struct drm_i915_private *i915, resource_size_t size,
drivers/gpu/drm/i915/gem/i915_gem_lmem.h +8 -0
@@ -14,6 +14,10 @@ struct intel_memory_region;extern const struct drm_i915_gem_object_ops i915_gem_lmem_obj_ops; +void __iomem * +i915_gem_object_lmem_io_map (struct drm_i915_gem_object *obj, +unsigned long n, +unsigned long size);void __iomem *i915_gem_object_lmem_io_map_page (struct drm_i915_gem_object *obj,unsigned long n); void __iomem *
@@ -23,6 +27,10 @@ i915_gem_object_lmem_io_map_page_atomic(struct drm_i915_gem_object *obj,bool i915_gem_object_is_lmem (struct drm_i915_gem_object *obj);bool i915_gem_object_is_devmem (struct drm_i915_gem_object *obj); +struct drm_i915_gem_object * +i915_gem_object_create_lmem_from_data (struct drm_i915_private *i915, +const void *data,size_t size); +struct drm_i915_gem_object * i915_gem_object_create_lmem(struct drm_i915_private *i915, resource_size_t size,
drivers/gpu/drm/i915/gt/uc/intel_guc.c +8 -1
@@ -3,6 +3,7 @@* Copyright © 2014-2019 Intel Corporation */ +#include "gem/i915_gem_lmem.h" #include "gt/intel_gt.h" #include "gt/intel_gt_irq.h" #include "gt/intel_gt_pm_irq.h"
@@ -650,7 +651,13 @@ struct i915_vma *intel_guc_allocate_vma(struct intel_guc *guc, u32 size)u64 flags;int ret; - obj =i915_gem_object_create_shmem (gt->i915, size); +if (HAS_LMEM (gt->i915)) + obj =i915_gem_object_create_lmem (gt->i915, size, +I915_BO_ALLOC_CPU_CLEAR | +I915_BO_ALLOC_CONTIGUOUS ); +else + obj =i915_gem_object_create_shmem (gt->i915, size); +if (IS_ERR (obj))return ERR_CAST (obj);
drivers/gpu/drm/i915/gt/uc/intel_guc_fw.c +8 -3
@@ -41,7 +41,7 @@ static void guc_prepare_xfer(struct intel_uncore *uncore) }/* Copy RSA signature from the fw image to HW for verification */ -static void guc_xfer_rsa (struct intel_uc_fw *guc_fw, +static int guc_xfer_rsa (struct intel_uc_fw *guc_fw,struct intel_uncore *uncore) {u32 rsa[UOS_RSA_SCRATCH_COUNT ];
@@ -49,10 +49,13 @@ static void guc_xfer_rsa(struct intel_uc_fw *guc_fw,int i; copied =intel_uc_fw_copy_rsa (guc_fw, rsa,sizeof (rsa)); -GEM_BUG_ON (copied <sizeof (rsa)); +if (copied <sizeof (rsa)) +return -ENOMEM ;for (i =0 ; i <UOS_RSA_SCRATCH_COUNT ; i++)intel_uncore_write (uncore,UOS_RSA_SCRATCH (i), rsa[i]); + +return 0 ; }/*
@@ -142,7 +145,9 @@ int intel_guc_fw_upload(struct intel_guc *guc)* by the DMA engine in one operation, whereas the RSA signature is * loaded via MMIO. */ -guc_xfer_rsa (&guc->fw, uncore); + ret =guc_xfer_rsa (&guc->fw, uncore); +if (ret) + goto out;/* * Current uCode expects the code to be loaded at 8k; locations below
drivers/gpu/drm/i915/gt/uc/intel_huc.c +11 -3
@@ -87,17 +87,25 @@ static int intel_huc_rsa_data_create(struct intel_huc *huc) vma->obj, true));if (IS_ERR (vaddr)) {i915_vma_unpin_and_release (&vma,0 ); -return PTR_ERR (vaddr); + err =PTR_ERR (vaddr); + goto unpin_out; } copied =intel_uc_fw_copy_rsa (&huc->fw, vaddr, vma->size); -GEM_BUG_ON (copied < huc->fw.rsa_size); -i915_gem_object_unpin_map (vma->obj); +if (copied < huc->fw.rsa_size) { + err = -ENOMEM ; + goto unpin_out; + } + huc->rsa_data = vma;return 0 ; + +unpin_out: +i915_vma_unpin_and_release (&vma,0 ); +return err; }static void intel_huc_rsa_data_destroy (struct intel_huc *huc)
drivers/gpu/drm/i915/gt/uc/intel_uc_fw.c +31 -4
@@ -7,6 +7,7 @@#include <linux/firmware.h> #include <drm/drm_print.h> +#include "gem/i915_gem_lmem.h" #include "intel_uc_fw.h" #include "intel_uc_fw_abi.h" #include "i915_drv.h"
@@ -371,7 +372,11 @@ int intel_uc_fw_fetch(struct intel_uc_fw *uc_fw)if (uc_fw->type ==INTEL_UC_FW_TYPE_GUC ) uc_fw->private_data_size = css->private_data_size; - obj =i915_gem_object_create_shmem_from_data (i915, fw->data, fw->size); +if (HAS_LMEM (i915)) + obj =i915_gem_object_create_lmem_from_data (i915, fw->data, fw->size); +else + obj =i915_gem_object_create_shmem_from_data (i915, fw->data, fw->size); +if (IS_ERR (obj)) { err =PTR_ERR (obj); goto fail;
@@ -420,14 +425,19 @@ static void uc_fw_bind_ggtt(struct intel_uc_fw *uc_fw) .pages = obj->mm.pages, .vm = &ggtt->vm, }; +u32 pte_flags =0 ;GEM_BUG_ON (!i915_gem_object_has_pinned_pages (obj));GEM_BUG_ON (dummy.node.size > ggtt->uc_fw.size);/* uc_fw->obj cache domains were not controlled across suspend */ -drm_clflush_sg (dummy.pages); +if (i915_gem_object_has_struct_page (obj)) +drm_clflush_sg (dummy.pages); + +if (i915_gem_object_is_lmem (obj)) + pte_flags |=PTE_LM ; - ggtt->vm.insert_entries (&ggtt->vm, &dummy,I915_CACHE_NONE ,0 ); + ggtt->vm.insert_entries (&ggtt->vm, &dummy,I915_CACHE_NONE , pte_flags); }static void uc_fw_unbind_ggtt (struct intel_uc_fw *uc_fw)
@@ -592,7 +602,24 @@ size_t intel_uc_fw_copy_rsa(struct intel_uc_fw *uc_fw, void *dst, u32 max_len)GEM_BUG_ON (!intel_uc_fw_is_available (uc_fw)); -return sg_pcopy_to_buffer (pages->sgl, pages->nents, dst, size, offset); +if (i915_gem_object_is_lmem (uc_fw->obj)) { +unsigned long page_idx = offset >>PAGE_SHIFT ; +unsigned int page_off =offset_in_page (offset); +void __iomem *vaddr; + + vaddr =i915_gem_object_lmem_io_map (uc_fw->obj, + page_idx, + page_off + size); +if (!vaddr) +return 0 ; + +memcpy (dst, vaddr + page_off, size); +io_mapping_unmap (vaddr); +return size; + }else { +return sg_pcopy_to_buffer (pages->sgl, pages->nents, + dst, size, offset); + } }/**
Signature · 6 lines
2.26.2 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
RFC PATCH 113/162 drm/i915: Create stolen memory region from local memory
In reply to Matthew AuldFrom: CQ Tang <[email protected]>
Add "REGION_STOLEN" device info to dg1, create stolen memory region from upper portion of local device memory, starting from DSMBASE.
The memory region is marked with "is_devmem=true".
--- drivers/gpu/drm/i915/gem/i915_gem_lmem.c | 4 +- drivers/gpu/drm/i915/gem/i915_gem_lmem.h | 7 +++ drivers/gpu/drm/i915/gem/i915_gem_stolen.c | 56 +++++++++++++++++++++- drivers/gpu/drm/i915/i915_pci.c | 2 +- drivers/gpu/drm/i915/i915_reg.h | 1 + drivers/gpu/drm/i915/intel_memory_region.c | 5 ++ drivers/gpu/drm/i915/intel_memory_region.h | 2 +- 7 files changed, 71 insertions(+), 6 deletions(-)
drivers/gpu/drm/i915/gem/i915_gem_lmem.c +2 -2
@@ -111,8 +111,8 @@ int i915_gem_object_lmem_pread(struct drm_i915_gem_object *obj,return ret; } -static int i915_gem_object_lmem_pwrite (struct drm_i915_gem_object *obj, -const struct drm_i915_gem_pwrite *arg) +int i915_gem_object_lmem_pwrite (struct drm_i915_gem_object *obj, +const struct drm_i915_gem_pwrite *arg) {struct drm_i915_private *i915 =to_i915 (obj->base.dev);struct intel_runtime_pm *rpm = &i915->runtime_pm;
drivers/gpu/drm/i915/gem/i915_gem_lmem.h +7 -0
@@ -11,9 +11,16 @@struct drm_i915_private ;struct drm_i915_gem_object ;struct intel_memory_region ; +struct drm_i915_gem_pread ; +struct drm_i915_gem_pwrite ;extern const struct drm_i915_gem_object_ops i915_gem_lmem_obj_ops; +int i915_gem_object_lmem_pread (struct drm_i915_gem_object *obj, +const struct drm_i915_gem_pread *args); +int i915_gem_object_lmem_pwrite (struct drm_i915_gem_object *obj, +const struct drm_i915_gem_pwrite *args); +void __iomem * i915_gem_object_lmem_io_map(struct drm_i915_gem_object *obj, unsigned long n,
drivers/gpu/drm/i915/gem/i915_gem_stolen.c +54 -2
88 lines not on this page · raw message
drivers/gpu/drm/i915/i915_pci.c +1 -1
@@ -907,7 +907,7 @@ static const struct intel_device_info rkl_info = {#define GEN12_DGFX_FEATURES \ GEN12_FEATURES, \ - .memory_regions = REGION_SMEM | REGION_LMEM, \ + .memory_regions = REGION_SMEM | REGION_LMEM | REGION_STOLEN_LMEM, \ .has_master_unit_irq = 1, \ .has_llc = 0, \ .has_snoop = 1, \
drivers/gpu/drm/i915/i915_reg.h +1 -0
@@ -12067,6 +12067,7 @@ enum skl_power_gate {#define LMEM_ENABLE (1 << 31)#define GEN12_GSMBASE _MMIO(0x108100) +#define GEN12_DSMBASE _MMIO(0x1080C0)/* gamt regs */ #define GEN8_L3_LRA_1_GPGPU _MMIO(0x4dd4)
drivers/gpu/drm/i915/intel_memory_region.c +5 -0
@@ -19,6 +19,10 @@ const struct intel_memory_region_info intel_region_map[] = { .class = INTEL_MEMORY_STOLEN_SYSTEM, .instance = 0, }, + [INTEL_REGION_STOLEN_LMEM] = { + .class = INTEL_MEMORY_STOLEN_LOCAL, + .instance = 0, + }, }; struct intel_memory_region *
@@ -311,6 +315,7 @@ int intel_memory_regions_hw_probe(struct drm_i915_private *i915)case INTEL_MEMORY_SYSTEM : mem =i915_gem_shmem_setup (i915);break ; +case INTEL_MEMORY_STOLEN_LOCAL :/* fallthrough */ case INTEL_MEMORY_STOLEN_SYSTEM : mem =i915_gem_stolen_setup (i915);break ;
drivers/gpu/drm/i915/intel_memory_region.h +1 -1
@@ -93,7 +93,7 @@ struct intel_memory_region {u16 type;u16 instance;enum intel_region_id id; -char name[8 ]; +char name[16 ];struct intel_gt *gt;/* GT closest to this region. */ bool is_devmem;/* true for device memory */
Signature · 6 lines
2.26.2 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Jani Nikula
maintainerRe: [Intel-gfx] [RFC PATCH 113/162] drm/i915: Create stolen memory region from local memory
Quoted 94 lines · Matthew Auld
From: CQ Tang <[email protected]>
Add "
REGION_STOLEN" device info to dg1, create stolen memory region from upper portion of local device memory, starting from DSMBASE.The memory region is marked with "is_devmem=true".
Cc Joonas Lahtinen <[email protected]>Cc Matthew Auld <[email protected]>Cc Abdiel Janulgue <[email protected]>Cc Chris P Wilson <[email protected]>Cc Balestrieri, Francesco <[email protected]>Cc Niranjana Vishwanathapura <[email protected]>Cc Venkata S Dhanalakota <[email protected]>Cc Neel Desai <[email protected]>Cc Matthew Brost <[email protected]>Cc Sudeep Dutt <[email protected]>Signed-off-by CQ Tang <[email protected]>Cc Lucas De Marchi <[email protected]>--- drivers/gpu/drm/i915/gem/i915_gem_lmem.c | 4 +- drivers/gpu/drm/i915/gem/i915_gem_lmem.h | 7 +++ drivers/gpu/drm/i915/gem/i915_gem_stolen.c | 56 +++++++++++++++++++++- drivers/gpu/drm/i915/i915_pci.c | 2 +- drivers/gpu/drm/i915/i915_reg.h | 1 + drivers/gpu/drm/i915/intel_memory_region.c | 5 ++ drivers/gpu/drm/i915/intel_memory_region.h | 2 +- 7 files changed, 71 insertions(+), 6 deletions(-)drivers/gpu/drm/i915/gem/i915_gem_lmem.c +2
-2@@ -111,8 +111,8 @@ int i915_gem_object_lmem_pread(struct drm_i915_gem_object *obj,return ret; } -static int i915_gem_object_lmem_pwrite (struct drm_i915_gem_object *obj, -const struct drm_i915_gem_pwrite *arg) +int i915_gem_object_lmem_pwrite (struct drm_i915_gem_object *obj, +const struct drm_i915_gem_pwrite *arg) {struct drm_i915_private *i915 =to_i915 (obj->base.dev);struct intel_runtime_pm *rpm = &i915->runtime_pm;drivers/gpu/drm/i915/gem/i915_gem_lmem.h +7
-0@@ -11,9 +11,16 @@struct drm_i915_private ;struct drm_i915_gem_object ;struct intel_memory_region ; +struct drm_i915_gem_pread ; +struct drm_i915_gem_pwrite ;extern const struct drm_i915_gem_object_ops i915_gem_lmem_obj_ops; +int i915_gem_object_lmem_pread (struct drm_i915_gem_object *obj, +const struct drm_i915_gem_pread *args); +int i915_gem_object_lmem_pwrite (struct drm_i915_gem_object *obj, +const struct drm_i915_gem_pwrite *args); +void __iomem * i915_gem_object_lmem_io_map(struct drm_i915_gem_object *obj, unsigned long n,drivers/gpu/drm/i915/gem/i915_gem_stolen.c +9
-0@@ -10,6 +10,7 @@#include <drm/drm_mm.h> #include <drm/i915_drm.h> +#include "gem/i915_gem_lmem.h" #include "gem/i915_gem_region.h" #include "i915_drv.h" #include "i915_gem_stolen.h" @@ -121,6 +122,14 @@ static int i915_adjust_stolen(struct drm_i915_private *i915, } } +/* +* With device local memory, we don't need to check the address range, +* this is device memory physical address, could overlap with system +* memory. +*/ +if (HAS_LMEM (i915)) +return 0 ; +/* * Verify that nothing else uses this physical address. Stolen * memory should be reserved by the BIOS and hidden from the
drivers/gpu/drm/i915/gem/i915_gem_stolen.c static void i915_gem_object_put_pages_stolen(struct drm_i915_gem_object *obj, · line 619
Quoted 5 lines
drivers/gpu/drm/i915/gem/i915_gem_stolen.c +1
-1@@ -607,7 +616,7 @@ static void i915_gem_object_put_pages_stolen(struct drm_i915_gem_object *obj,kfree (pages); } -static const struct drm_i915_gem_object_ops i915_gem_object_stolen_ops = { +static struct drm_i915_gem_object_ops i915_gem_object_stolen_ops = {
Making driver specific ops non-const seems suspicious...
Quoted 6 lines
drivers/gpu/drm/i915/gem/i915_gem_stolen.c +0
-0.name = "i915_gem_object_stolen", .get_pages = i915_gem_object_get_pages_stolen, .put_pages = i915_gem_object_put_pages_stolen,@@ -716,7 +725,19 @@ i915_gem_object_create_stolen(struct drm_i915_private *i915,static int init_stolen (struct intel_memory_region *mem)
drivers/gpu/drm/i915/gem/i915_gem_stolen.c i915_gem_object_create_stolen(struct drm_i915_private *i915, · line 735
Quoted 10 lines
drivers/gpu/drm/i915/gem/i915_gem_stolen.c +8
-1{ -intel_memory_region_set_name (mem,"stolen" ); +if (mem->type ==INTEL_MEMORY_STOLEN_SYSTEM ) +intel_memory_region_set_name (mem,"stolen-system" ); +else +intel_memory_region_set_name (mem,"stolen-local" ); + +if (HAS_LMEM (mem->i915)) { + i915_gem_object_stolen_ops.pread = i915_gem_object_lmem_pread; + i915_gem_object_stolen_ops.pwrite = i915_gem_object_lmem_pwrite;
...and AFAICT this modifies the ops for all devices, including the integrated GPU, if any of the devices HAS_LMEM().
BR,
Jani.
Quoted 108 lines
drivers/gpu/drm/i915/gem/i915_gem_stolen.c +36
-0+if (!io_mapping_init_wc (&mem->iomap, + mem->io_start, +resource_size (&mem->region))) +return -EIO ; + }/* * Initialise stolen early so that we may reserve preallocated @@ -736,8 +757,39 @@ static const struct intel_memory_region_ops i915_region_stolen_ops = { .create_object = i915_gem_object_create_stolen_region, }; +static +struct intel_memory_region *setup_lmem_stolen (struct drm_i915_private *i915) +{ +struct intel_uncore *uncore = &i915->uncore; +struct pci_dev *pdev = i915->drm.pdev; +struct intel_memory_region *mem; +resource_size_t io_start; +resource_size_t lmem_size; +u64 lmem_base; + + lmem_base =intel_uncore_read64 (uncore,GEN12_DSMBASE ); + lmem_size =pci_resource_len (pdev,2 ) - lmem_base; + io_start =pci_resource_start (pdev,2 ) + lmem_base; + + mem =intel_memory_region_create (i915, lmem_base, lmem_size, +I915_GTT_PAGE_SIZE_4K , io_start, + &i915_region_stolen_ops); +if (!IS_ERR (mem)) { +DRM_INFO ("Intel graphics stolen LMEM: %pR\n" , &mem->region); +DRM_INFO ("Intel graphics stolen LMEM IO start: %llx\n" , + (u64 )mem->io_start); +/* this is real device memory */ + mem->is_devmem = true; + } + +return mem; +} +struct intel_memory_region *i915_gem_stolen_setup (struct drm_i915_private *i915) { +if (HAS_LMEM (i915)) +return setup_lmem_stolen (i915); + return intel_memory_region_create(i915, intel_graphics_stolen_res.start, resource_size(&intel_graphics_stolen_res),drivers/gpu/drm/i915/i915_pci.c +1
-1@@ -907,7 +907,7 @@ static const struct intel_device_info rkl_info = {#define GEN12_DGFX_FEATURES \ GEN12_FEATURES, \ - .memory_regions = REGION_SMEM | REGION_LMEM, \ + .memory_regions = REGION_SMEM | REGION_LMEM | REGION_STOLEN_LMEM, \ .has_master_unit_irq = 1, \ .has_llc = 0, \ .has_snoop = 1, \drivers/gpu/drm/i915/i915_reg.h +1
-0@@ -12067,6 +12067,7 @@ enum skl_power_gate {#define LMEM_ENABLE (1 << 31)#define GEN12_GSMBASE _MMIO(0x108100) +#define GEN12_DSMBASE _MMIO(0x1080C0)/* gamt regs */ #define GEN8_L3_LRA_1_GPGPU _MMIO(0x4dd4)drivers/gpu/drm/i915/intel_memory_region.c +5
-0@@ -19,6 +19,10 @@ const struct intel_memory_region_info intel_region_map[] = { .class = INTEL_MEMORY_STOLEN_SYSTEM, .instance = 0, }, + [INTEL_REGION_STOLEN_LMEM] = { + .class = INTEL_MEMORY_STOLEN_LOCAL, + .instance = 0, + }, }; struct intel_memory_region *@@ -311,6 +315,7 @@ int intel_memory_regions_hw_probe(struct drm_i915_private *i915)case INTEL_MEMORY_SYSTEM : mem =i915_gem_shmem_setup (i915);break ; +case INTEL_MEMORY_STOLEN_LOCAL :/* fallthrough */ case INTEL_MEMORY_STOLEN_SYSTEM : mem =i915_gem_stolen_setup (i915);break ;drivers/gpu/drm/i915/intel_memory_region.h +1
-1@@ -93,7 +93,7 @@ struct intel_memory_region {u16 type;u16 instance;enum intel_region_id id; -char name[8 ]; +char name[16 ];struct intel_gt *gt;/* GT closest to this region. */ bool is_devmem;/* true for device memory */
Signature · 5 lines
Jani Nikula, Intel Open Source Graphics Center _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
RFC PATCH 114/162 drm/i915/lmem: Bypass aperture when lmem is available
In reply to Matthew AuldFrom: Anusha Srivatsa <[email protected]>
In the scenario where local memory is available, we have rely on CPU access via lmem directly instead of aperture.
--- drivers/gpu/drm/i915/display/intel_fbdev.c | 23 +++++++++++++++------- drivers/gpu/drm/i915/i915_vma.c | 19 ++++++++++++------ 2 files changed, 29 insertions(+), 13 deletions(-)
drivers/gpu/drm/i915/display/intel_fbdev.c +16 -7
@@ -41,6 +41,7 @@#include <drm/drm_fb_helper.h> #include <drm/drm_fourcc.h> +#include "gem/i915_gem_lmem.h" #include "i915_drv.h" #include "intel_display_types.h" #include "intel_fbdev.h"
@@ -137,14 +138,22 @@ static int intelfb_alloc(struct drm_fb_helper *helper, size = mode_cmd.pitches[0 ] * mode_cmd.height; size =PAGE_ALIGN (size); -/* If the FB is too big, just don't use it since fbdev is not very -* important and we should probably use that space with FBC or other -* features. */ obj =ERR_PTR (-ENODEV ); -if (size *2 < dev_priv->stolen_usable_size) - obj =i915_gem_object_create_stolen (dev_priv, size); -if (IS_ERR (obj)) - obj =i915_gem_object_create_shmem (dev_priv, size); +if (HAS_LMEM (dev_priv)) { + obj =i915_gem_object_create_lmem (dev_priv, size, +I915_BO_ALLOC_CONTIGUOUS ); + }else { +/* +* If the FB is too big, just don't use it since fbdev is not very +* important and we should probably use that space with FBC or other +* features. +*/ +if (size *2 < dev_priv->stolen_usable_size) + obj =i915_gem_object_create_stolen (dev_priv, size); +if (IS_ERR (obj)) + obj =i915_gem_object_create_shmem (dev_priv, size); + } +if (IS_ERR (obj)) {drm_err (&dev_priv->drm,"failed to allocate framebuffer\n" );return PTR_ERR (obj);
drivers/gpu/drm/i915/i915_vma.c +13 -6
@@ -27,6 +27,7 @@#include "display/intel_frontbuffer.h" +#include "gem/i915_gem_lmem.h" #include "gt/intel_engine.h" #include "gt/intel_engine_heartbeat.h" #include "gt/intel_gt.h"
@@ -448,9 +449,11 @@ void __iomem *i915_vma_pin_iomap(struct i915_vma *vma)void __iomem *ptr;int err; -if (GEM_WARN_ON (!i915_vma_is_map_and_fenceable (vma))) { - err = -ENODEV ; - goto err; +if (!i915_gem_object_is_devmem (vma->obj)) { +if (GEM_WARN_ON (!i915_vma_is_map_and_fenceable (vma))) { + err = -ENODEV ; + goto err; + } }GEM_BUG_ON (!i915_vma_is_ggtt (vma));
@@ -458,9 +461,13 @@ void __iomem *i915_vma_pin_iomap(struct i915_vma *vma) ptr =READ_ONCE (vma->iomap);if (ptr ==NULL ) { - ptr =io_mapping_map_wc (&i915_vm_to_ggtt (vma->vm)->iomap, - vma->node.start, - vma->node.size); +if (i915_gem_object_is_devmem (vma->obj)) + ptr =i915_gem_object_lmem_io_map (vma->obj,0 , + vma->obj->base.size); +else + ptr =io_mapping_map_wc (&i915_vm_to_ggtt (vma->vm)->iomap, + vma->node.start, + vma->node.size);if (ptr ==NULL ) { err = -ENOMEM ; goto err;
Signature · 6 lines
2.26.2 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
RFC PATCH 115/162 drm/i915/lmem: reset the lmem buffer created by fbdev
In reply to Matthew AuldFrom: Animesh Manna <[email protected]>
Newly created lmem buffer by fbdev need reset otherwise it has old garbage data. Same logic was present for stolen memory, extended the same for lmem.
--- drivers/gpu/drm/i915/display/intel_fbdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/i915/display/intel_fbdev.c +1 -1
@@ -280,7 +280,7 @@ static int intelfb_create(struct drm_fb_helper *helper,* If the object is stolen however, it will be full of whatever * garbage was left in there. */ -if (vma->obj->stolen && !prealloc) +if ((vma->obj->stolen ||HAS_LMEM (dev_priv)) && !prealloc)memset_io (info->screen_base,0 , info->screen_size);/* Use default scratch pixmap (info->pixmap.flags = FB_PIXMAP_SYSTEM) */
Signature · 6 lines
2.26.2 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
RFC PATCH 116/162 drm/i915/dsb: Enable lmem for dsb
In reply to Matthew AuldFrom: Animesh Manna <[email protected]>
For dgfx, DSB should use local memory instead of system memory. Using local memory surely brings performance improvement as local memory is close to gpu. Also want to avoid multiple gpu using system memory.
Use LMEM API to create gem object needed for DSB command buffer.
--- drivers/gpu/drm/i915/display/intel_dsb.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/display/intel_dsb.c +6 -1
@@ -6,6 +6,7 @@#include "i915_drv.h" #include "intel_display_types.h" +#include "gem/i915_gem_lmem.h" #define DSB_BUF_SIZE (2 * PAGE_SIZE)
@@ -278,7 +279,11 @@ void intel_dsb_prepare(struct intel_crtc_state *crtc_state) wakeref =intel_runtime_pm_get (&i915->runtime_pm); - obj =i915_gem_object_create_internal (i915,DSB_BUF_SIZE ); +if (HAS_LMEM (i915)) + obj =i915_gem_object_create_lmem (i915,DSB_BUF_SIZE ,0 ); +else + obj =i915_gem_object_create_internal (i915,DSB_BUF_SIZE ); +if (IS_ERR (obj)) {drm_err (&i915->drm,"Gem object creation failed\n" );kfree (dsb);
Signature · 6 lines
2.26.2 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
RFC PATCH 117/162 drm/i915: Reintroduce mem->reserved
In reply to Matthew AuldFrom: Abdiel Janulgue <[email protected]>
In the following patch we need to reserve regions unaccessible to the driver during initialization, so add back mem->reserved for collecting such regions.
--- drivers/gpu/drm/i915/intel_memory_region.c | 2 + drivers/gpu/drm/i915/intel_memory_region.h | 2 + .../drm/i915/selftests/intel_memory_region.c | 89 +++++++++++++++++++ 3 files changed, 93 insertions(+)
drivers/gpu/drm/i915/intel_memory_region.c +2 -0
@@ -203,6 +203,7 @@ int intel_memory_region_init_buddy(struct intel_memory_region *mem)void intel_memory_region_release_buddy (struct intel_memory_region *mem) { +i915_buddy_free_list (&mem->mm, &mem->reserved);i915_buddy_fini (&mem->mm); }
@@ -232,6 +233,7 @@ intel_memory_region_create(struct drm_i915_private *i915,mutex_init (&mem->objects.lock);INIT_LIST_HEAD (&mem->objects.list);INIT_LIST_HEAD (&mem->objects.purgeable); +INIT_LIST_HEAD (&mem->reserved);mutex_init (&mem->mm_lock);
drivers/gpu/drm/i915/intel_memory_region.h +2 -0
@@ -97,6 +97,8 @@ struct intel_memory_region {struct intel_gt *gt;/* GT closest to this region. */ bool is_devmem;/* true for device memory */ +struct list_head reserved; +dma_addr_t remap_addr;struct {
drivers/gpu/drm/i915/selftests/intel_memory_region.c +89 -0
101 lines not on this page · raw message
Signature · 6 lines
2.26.2 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
RFC PATCH 118/162 drm/i915/dg1: Reserve first 1MB of local memory
In reply to Matthew AuldFrom: Imre Deak <[email protected]>
On DG1 A0/B0 steppings the first 1MB of local memory must be reserved. One reason for this is that the 0xA0000-0xB0000 range is not accessible by the display, probably since this region is redirected to another memory location for legacy VGA compatibility.
BSpec: 50586
Testcase: igt/kms_big_fb/linear-64bpp-rotate-0
--- drivers/gpu/drm/i915/intel_region_lmem.c | 52 ++++++++++++++++++++++++ 1 file changed, 52 insertions(+)
drivers/gpu/drm/i915/intel_region_lmem.c +52 -0
@@ -137,6 +137,48 @@ intel_setup_fake_lmem(struct drm_i915_private *i915)return mem; } +static void get_legacy_lowmem_region (struct intel_uncore *uncore, +u64 *start,u32 *size) +{ + *start =0 ; + *size =0 ; + +if (!IS_DG1_REVID (uncore->i915,DG1_REVID_A0 ,DG1_REVID_B0 )) +return ; + + *size =SZ_1M ; + +DRM_DEBUG_DRIVER ("LMEM: reserved legacy low-memory [0x%llx-0x%llx]\n" , + *start, *start + *size); +} + +static int reserve_lowmem_region (struct intel_uncore *uncore, +struct intel_memory_region *mem) +{ +u64 reserve_start; +u64 reserve_end; +u64 region_start; +u32 region_size; +int ret; + +get_legacy_lowmem_region (uncore, ®ion_start, ®ion_size); + reserve_start = region_start; + reserve_end = region_start + region_size; + +if (!reserve_end) +return 0 ; + +DRM_INFO ("LMEM: reserving low-memory region [0x%llx-0x%llx]\n" , + reserve_start, reserve_end); + ret =i915_buddy_alloc_range (&mem->mm, &mem->reserved, + reserve_start, + reserve_end - reserve_start); +if (ret) +DRM_ERROR ("LMEM: reserving low memory region failed\n" ); + +return ret; +} +static struct intel_memory_region *setup_lmem (struct drm_i915_private *dev_priv) {
@@ -160,6 +202,16 @@ setup_lmem(struct drm_i915_private *dev_priv)I915_GTT_PAGE_SIZE_4K , io_start, &intel_region_lmem_ops); +if (!IS_ERR (mem)) { +int err; + + err =reserve_lowmem_region (uncore, mem); +if (err) { +intel_memory_region_put (mem); +return ERR_PTR (err); + } + } +if (!IS_ERR (mem)) {DRM_INFO ("Intel graphics LMEM: %pR\n" , &mem->region); DRM_INFO("Intel graphics LMEM IO start: %llx\n",
Signature · 6 lines
2.26.2 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [Intel-gfx] [RFC PATCH 118/162] drm/i915/dg1: Reserve first 1MB of local memory
Quoting Matthew Auld (2020-11-27 12:06:34)
Quoted 48 lines
From: Imre Deak <[email protected]>
On DG1 A0/B0 steppings the first 1MB of local memory must be reserved. One reason for this is that the 0xA0000-0xB0000 range is not accessible by the display, probably since this region is redirected to another memory location for legacy VGA compatibility.
BSpec: 50586
Testcase: igt/kms_big_fb/linear-64bpp-rotate-0Signed-off-by Imre Deak <[email protected]>--- drivers/gpu/drm/i915/intel_region_lmem.c | 52 ++++++++++++++++++++++++ 1 file changed, 52 insertions(+)drivers/gpu/drm/i915/intel_region_lmem.c +26
-0@@ -137,6 +137,48 @@ intel_setup_fake_lmem(struct drm_i915_private *i915)return mem; } +static void get_legacy_lowmem_region (struct intel_uncore *uncore, +u64 *start,u32 *size) +{ + *start =0 ; + *size =0 ; + +if (!IS_DG1_REVID (uncore->i915,DG1_REVID_A0 ,DG1_REVID_B0 )) +return ; + + *size =SZ_1M ; + +DRM_DEBUG_DRIVER ("LMEM: reserved legacy low-memory [0x%llx-0x%llx]\n" , + *start, *start + *size); +} + +static int reserve_lowmem_region (struct intel_uncore *uncore, +struct intel_memory_region *mem) +{ +u64 reserve_start; +u64 reserve_end; +u64 region_start; +u32 region_size; +int ret; + +get_legacy_lowmem_region (uncore, ®ion_start, ®ion_size); + reserve_start = region_start;
drivers/gpu/drm/i915/intel_region_lmem.c intel_setup_fake_lmem(struct drm_i915_private *i915) · line 175
Quoted 10 lines
drivers/gpu/drm/i915/intel_region_lmem.c +10
-0+ reserve_end = region_start + region_size; + +if (!reserve_end) +return 0 ; + +DRM_INFO ("LMEM: reserving low-memory region [0x%llx-0x%llx]\n" , + reserve_start, reserve_end); + ret =i915_buddy_alloc_range (&mem->mm, &mem->reserved, + reserve_start, + reserve_end - reserve_start);
Isn't this now relative to the stolen offset? Should this be reserved, or excluded like stolen?
-Chris
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [Intel-gfx] [RFC PATCH 118/162] drm/i915/dg1: Reserve first 1MB of local memory
Quoted 54 lines · Chris Wilson
Quoting Matthew Auld (2020-11-27 12:06:34)
Quoted 53 lines
From: Imre Deak <[email protected]>
On DG1 A0/B0 steppings the first 1MB of local memory must be reserved. One reason for this is that the 0xA0000-0xB0000 range is not accessible by the display, probably since this region is redirected to another memory location for legacy VGA compatibility.
BSpec: 50586
Testcase: igt/kms_big_fb/linear-64bpp-rotate-0Signed-off-by Imre Deak <[email protected]>--- drivers/gpu/drm/i915/intel_region_lmem.c | 52 ++++++++++++++++++++++++ 1 file changed, 52 insertions(+)drivers/gpu/drm/i915/intel_region_lmem.c +31
-0@@ -137,6 +137,48 @@ intel_setup_fake_lmem(struct drm_i915_private *i915)return mem; } +static void get_legacy_lowmem_region (struct intel_uncore *uncore, +u64 *start,u32 *size) +{ + *start =0 ; + *size =0 ; + +if (!IS_DG1_REVID (uncore->i915,DG1_REVID_A0 ,DG1_REVID_B0 )) +return ; + + *size =SZ_1M ; + +DRM_DEBUG_DRIVER ("LMEM: reserved legacy low-memory [0x%llx-0x%llx]\n" , + *start, *start + *size); +} + +static int reserve_lowmem_region (struct intel_uncore *uncore, +struct intel_memory_region *mem) +{ +u64 reserve_start; +u64 reserve_end; +u64 region_start; +u32 region_size; +int ret; + +get_legacy_lowmem_region (uncore, ®ion_start, ®ion_size); + reserve_start = region_start; + reserve_end = region_start + region_size; + +if (!reserve_end) +return 0 ; +
Quoted 8 lines
drivers/gpu/drm/i915/intel_region_lmem.c intel_setup_fake_lmem(struct drm_i915_private *i915) · line 175
Quoted 5 lines
drivers/gpu/drm/i915/intel_region_lmem.c +5
-0+DRM_INFO ("LMEM: reserving low-memory region [0x%llx-0x%llx]\n" , + reserve_start, reserve_end); + ret =i915_buddy_alloc_range (&mem->mm, &mem->reserved, + reserve_start, + reserve_end - reserve_start);Isn't this now relative to the stolen offset? Should this be reserved, or excluded like stolen?
AFAIK stolen is just snipped off at the end of lmem, so I don't think it really matters if we exclude or reserve. But for this if we exclude then the region.start might have "strange" alignment, which is annoying since alloc(some_power_of_two) might not give us the expected alignment, whereas if we reserve then the allocator is aware, and so we should get the proper alignment. Maybe you have better ideas with how to handle this, but I think keeping the alignment property is nice.
Quoted 2 lines
-Chris
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [Intel-gfx] [RFC PATCH 118/162] drm/i915/dg1: Reserve first 1MB of local memory
Quoting Matthew Auld (2020-11-30 11:09:57)
Quoted 64 lines · Chris Wilson
Quoted 54 lines
Quoting Matthew Auld (2020-11-27 12:06:34)
Quoted 53 lines
From: Imre Deak <[email protected]>
On DG1 A0/B0 steppings the first 1MB of local memory must be reserved. One reason for this is that the 0xA0000-0xB0000 range is not accessible by the display, probably since this region is redirected to another memory location for legacy VGA compatibility.
BSpec: 50586
Testcase: igt/kms_big_fb/linear-64bpp-rotate-0Signed-off-by Imre Deak <[email protected]>--- drivers/gpu/drm/i915/intel_region_lmem.c | 52 ++++++++++++++++++++++++ 1 file changed, 52 insertions(+)drivers/gpu/drm/i915/intel_region_lmem.c +31
-0@@ -137,6 +137,48 @@ intel_setup_fake_lmem(struct drm_i915_private *i915)return mem; } +static void get_legacy_lowmem_region (struct intel_uncore *uncore, +u64 *start,u32 *size) +{ + *start =0 ; + *size =0 ; + +if (!IS_DG1_REVID (uncore->i915,DG1_REVID_A0 ,DG1_REVID_B0 )) +return ; + + *size =SZ_1M ; + +DRM_DEBUG_DRIVER ("LMEM: reserved legacy low-memory [0x%llx-0x%llx]\n" , + *start, *start + *size); +} + +static int reserve_lowmem_region (struct intel_uncore *uncore, +struct intel_memory_region *mem) +{ +u64 reserve_start; +u64 reserve_end; +u64 region_start; +u32 region_size; +int ret; + +get_legacy_lowmem_region (uncore, ®ion_start, ®ion_size); + reserve_start = region_start; + reserve_end = region_start + region_size; + +if (!reserve_end) +return 0 ; +Quoted 8 lines
drivers/gpu/drm/i915/intel_region_lmem.c intel_setup_fake_lmem(struct drm_i915_private *i915) · line 175
Quoted 5 lines
drivers/gpu/drm/i915/intel_region_lmem.c +5
-0+DRM_INFO ("LMEM: reserving low-memory region [0x%llx-0x%llx]\n" , + reserve_start, reserve_end); + ret =i915_buddy_alloc_range (&mem->mm, &mem->reserved, + reserve_start, + reserve_end - reserve_start);Isn't this now relative to the stolen offset? Should this be reserved, or excluded like stolen?
Quoted 2 lines
AFAIK stolen is just snipped off at the end of lmem, so I don't think it really matters if we exclude or reserve.
Right, misread, thought it was moving the start point.
Quoted 6 lines
But for this if we exclude then
the region.start might have "strange" alignment, which is annoying sincealloc(some_power_of_two)might not give us the expected alignment, whereas if we reserve then the allocator is aware, and so we should get the proper alignment. Maybe you have better ideas with how to handle this, but I think keeping the alignment property is nice.
The only tweak I would look at is making this reservation be the property of the VGA decode. But if this promises not to live into production, kiss.
-Chris
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
RFC PATCH 119/162 drm/i915/dg1: Read OPROM via SPI controller
In reply to Matthew AuldFrom: Clint Taylor <[email protected]>
Read OPROM SPI through MMIO and find VBT entry since we can't use OpRegion and PCI mapping may not work on some systems due to the BIOS not leaving the Option ROM mapped.
--- drivers/gpu/drm/i915/display/intel_bios.c | 80 +++++++++++++++++++++-- drivers/gpu/drm/i915/i915_reg.h | 8 +++ 2 files changed, 82 insertions(+), 6 deletions(-)
drivers/gpu/drm/i915/display/intel_bios.c +74 -6
@@ -2086,6 +2086,66 @@ bool intel_bios_is_valid_vbt(const void *buf, size_t size)return vbt; } +static struct vbt_header *spi_oprom_get_vbt (struct drm_i915_private *dev_priv) +{ +u32 count, data, found, store =0 ; +u32 static_region, oprom_offset; +u32 oprom_size =0x200000 ; +u16 vbt_size; +u32 *vbt; + + static_region =I915_READ (SPI_STATIC_REGIONS ); + static_region &=OPTIONROM_SPI_REGIONID_MASK ; +I915_WRITE (PRIMARY_SPI_REGIONID , static_region); + + oprom_offset =I915_READ (OROM_OFFSET ); + oprom_offset &=OROM_OFFSET_MASK ; + +for (count =0 ; count < oprom_size; count +=4 ) { +I915_WRITE (PRIMARY_SPI_ADDRESS , oprom_offset + count); + data =I915_READ (PRIMARY_SPI_TRIGGER ); + +if (data == *((const u32 *)"$VBT" )) { + found = oprom_offset + count; +break ; + } + } + +if (count >= oprom_size) + goto err_not_found; + +/* Get VBT size and allocate space for the VBT */ +I915_WRITE (PRIMARY_SPI_ADDRESS , found + + offsetof(struct vbt_header , vbt_size)); + vbt_size =I915_READ (PRIMARY_SPI_TRIGGER ); + vbt_size &=0xffff ; + + vbt =kzalloc (vbt_size,GFP_KERNEL ); +if (!vbt) { +DRM_ERROR ("Unable to allocate %u bytes for VBT storage\n" , + vbt_size); + goto err_not_found; + } + +for (count =0 ; count < vbt_size; count +=4 ) { +I915_WRITE (PRIMARY_SPI_ADDRESS , found + count); + data =I915_READ (PRIMARY_SPI_TRIGGER ); + *(vbt + store++) = data; + } + +if (!intel_bios_is_valid_vbt (vbt, vbt_size)) + goto err_free_vbt; + +DRM_DEBUG_KMS ("Found valid VBT in SPI flash\n" ); + +return (struct vbt_header *)vbt; + +err_free_vbt: +kfree (vbt); +err_not_found: +return NULL ; +} +static struct vbt_header *oprom_get_vbt (struct drm_i915_private *dev_priv) {struct pci_dev *pdev = dev_priv->drm.pdev;
@@ -2135,6 +2195,8 @@ static struct vbt_header *oprom_get_vbt(struct drm_i915_private *dev_priv)pci_unmap_rom (pdev, oprom); +DRM_DEBUG_KMS ("Found valid VBT in PCI ROM\n" ); +return vbt; err_free_vbt:
@@ -2169,17 +2231,23 @@ void intel_bios_init(struct drm_i915_private *dev_priv)init_vbt_defaults (dev_priv); -/* If the OpRegion does not have VBT, look in PCI ROM. */ +/* +* If the OpRegion does not have VBT, look in SPI flash through MMIO or +* PCI mapping +*/ +if (!vbt &&IS_DGFX (dev_priv)) { + oprom_vbt =spi_oprom_get_vbt (dev_priv); + vbt = oprom_vbt; + } +if (!vbt) { oprom_vbt =oprom_get_vbt (dev_priv); -if (!oprom_vbt) - goto out; - vbt = oprom_vbt; - -drm_dbg_kms (&dev_priv->drm,"Found valid VBT in PCI ROM\n" ); } +if (!vbt) + goto out; + bdb =get_bdb_header (vbt); drm_dbg_kms(&dev_priv->drm,
drivers/gpu/drm/i915/i915_reg.h +8 -0
@@ -12413,6 +12413,14 @@ enum skl_power_gate {#define DP_PIN_ASSIGNMENT_MASK (idx) (0xf << ((idx) * 4))#define DP_PIN_ASSIGNMENT (idx, x) ((x) << ((idx) * 4)) +#define PRIMARY_SPI_TRIGGER _MMIO(0x102040) +#define PRIMARY_SPI_ADDRESS _MMIO(0x102080) +#define PRIMARY_SPI_REGIONID _MMIO(0x102084) +#define SPI_STATIC_REGIONS _MMIO(0x102090) +#define OPTIONROM_SPI_REGIONID_MASK REG_GENMASK(7, 0) +#define OROM_OFFSET _MMIO(0x1020c0) +#define OROM_OFFSET_MASK REG_GENMASK(20, 16) +/* This register controls the Display State Buffer (DSB) engines. */ #define _DSBSL_INSTANCE_BASE 0x70B00#define DSBSL_INSTANCE (pipe, id) (_DSBSL_INSTANCE_BASE + \
Signature · 6 lines
2.26.2 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Jani Nikula
maintainerRe: [Intel-gfx] [RFC PATCH 119/162] drm/i915/dg1: Read OPROM via SPI controller
drivers/gpu/drm/i915/display/intel_bios.c bool intel_bios_is_valid_vbt(const void *buf, size_t size) · line 2139
Quoted 1 line · Matthew Auld
drivers/gpu/drm/i915/display/intel_bios.c +1
-0+DRM_DEBUG_KMS ("Found valid VBT in SPI flash\n" );
Please use drm_dbg_kms() and friends throughout the series. We don't want new users of DRM_DEBUG* in the driver.
BR,
Jani.
Signature · 5 lines
Jani Nikula, Intel Open Source Graphics Center _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
RFC PATCH 120/162 drm/i915/oprom: Basic sanitization
In reply to Matthew AuldFrom: Anshuman Gupta <[email protected]>
Sanitize OPROM header, CPD signature and OPROM PCI version. OPROM_HEADER, EXPANSION_ROM_HEADER and OPROM_MEU_BLOB structures and PCI struct offsets are provided by GSC counterparts. These are yet to be Documented in B.Spec.
After successful sanitization, extract VBT from opregion image.
--- drivers/gpu/drm/i915/display/intel_bios.c | 49 +++-- drivers/gpu/drm/i915/display/intel_opregion.c | 169 ++++++++++++++++++ drivers/gpu/drm/i915/display/intel_opregion.h | 31 +++- 3 files changed, 221 insertions(+), 28 deletions(-)
drivers/gpu/drm/i915/display/intel_bios.c +22 -27
@@ -2088,37 +2088,36 @@ bool intel_bios_is_valid_vbt(const void *buf, size_t size)static struct vbt_header *spi_oprom_get_vbt (struct drm_i915_private *dev_priv) { -u32 count, data, found, store =0 ; -u32 static_region, oprom_offset; -u32 oprom_size =0x200000 ; -u16 vbt_size; -u32 *vbt; - - static_region =I915_READ (SPI_STATIC_REGIONS ); - static_region &=OPTIONROM_SPI_REGIONID_MASK ; -I915_WRITE (PRIMARY_SPI_REGIONID , static_region); +u32 count, found; +u32 *vbt, *oprom_opreg =NULL ; +u16 vbt_size, opreg_size; +u8 *parse_ptr; - oprom_offset =I915_READ (OROM_OFFSET ); - oprom_offset &=OROM_OFFSET_MASK ; +if (intel_oprom_verify_signature (&oprom_opreg, &opreg_size, dev_priv)) { +drm_err (&dev_priv->drm,"oprom signature verification failed\n" ); + goto err_not_found; + } -for (count =0 ; count < oprom_size; count +=4 ) { -I915_WRITE (PRIMARY_SPI_ADDRESS , oprom_offset + count); - data =I915_READ (PRIMARY_SPI_TRIGGER ); +if (!oprom_opreg) { +drm_err (&dev_priv->drm,"opregion not found\n" ); + goto err_not_found; + } -if (data == *((const u32 *)"$VBT" )) { - found = oprom_offset + count; +for (count =0 ; count < opreg_size; count +=4 ) { +if (oprom_opreg[count /4 ] == *((const u32 *)"$VBT" )) { + found = count;break ; } } -if (count >= oprom_size) +if (count >= opreg_size) { +drm_err (&dev_priv->drm,"VBT not found in opregion\n" ); goto err_not_found; + }/* Get VBT size and allocate space for the VBT */ -I915_WRITE (PRIMARY_SPI_ADDRESS , found + - offsetof(struct vbt_header , vbt_size)); - vbt_size =I915_READ (PRIMARY_SPI_TRIGGER ); - vbt_size &=0xffff ; + parse_ptr = (u8 *)oprom_opreg + found; + vbt_size = ((struct vbt_header *)parse_ptr)->vbt_size; vbt =kzalloc (vbt_size,GFP_KERNEL );if (!vbt) {
@@ -2127,16 +2126,12 @@ static struct vbt_header *spi_oprom_get_vbt(struct drm_i915_private *dev_priv) goto err_not_found; } -for (count =0 ; count < vbt_size; count +=4 ) { -I915_WRITE (PRIMARY_SPI_ADDRESS , found + count); - data =I915_READ (PRIMARY_SPI_TRIGGER ); - *(vbt + store++) = data; - } - +memcpy (vbt, parse_ptr, vbt_size);if (!intel_bios_is_valid_vbt (vbt, vbt_size)) goto err_free_vbt;DRM_DEBUG_KMS ("Found valid VBT in SPI flash\n" ); +kfree (oprom_opreg);return (struct vbt_header *)vbt;
drivers/gpu/drm/i915/display/intel_opregion.c +169 -0
175 lines not on this page · raw message
drivers/gpu/drm/i915/display/intel_opregion.h +30 -1
@@ -54,6 +54,34 @@ struct intel_opregion {#define OPREGION_SIZE (8 * 1024) +#define CPD_SIGNATURE "$CPD"/* CPD Signature */ +#define NUM_CPD_BYTES 4 +#define PCI_IMAGE_LENGTH_OFFSET 0x10 +#define PCI_CODE_TYPE_OFFSET 0x14 +#define PCI_LAST_IMAGE_INDICATOR_OFFSET 0x15 +#define LAST_IMG_INDICATOR 0x80 +#define OPROM_IMAGE_MAGIC 0xAA55/* Little Endian */ +#define OPROM_CSS_CODE_TYPE 0xF0 +#define OPROM_BYTE_BOUNDARY 512/* OPROM image sizes are indicated in 512 byte boundaries */ +#define OPROM_INITIAL_READ_SIZE 60/* Read 60 bytes to compute the Img Len from PCI structure */ + +union oprom_header { +u32 data; +struct { +u16 signature;/* Offset[0x0]: Header 0x55 0xAA */ +u8 sizein512bytes; +u8 reserved; + }; +}; + +struct expansion_rom_header { +union oprom_header header;/* Offset[0x0]: Oprom Header */ +u16 vbiospostoffset;/* Offset[0x4]: pointer to VBIOS entry point */ +u8 resvd[0x12 ]; +u16 pcistructoffset;/* Offset[0x18]: Contains pointer PCI Data Structure */ +u16 opregion_base;/* Offset[0x1A]: Offset to Opregion Base start */ +}; +#ifdef CONFIG_ACPI int intel_opregion_setup (struct drm_i915_private *dev_priv);
@@ -118,5 +146,6 @@ static inline int intel_opregion_get_panel_type(struct drm_i915_private *dev) }#endif /* CONFIG_ACPI */ - +int intel_oprom_verify_signature (u32 **opreg,u16 *opreg_size, +struct drm_i915_private *i915);#endif
Signature · 6 lines
2.26.2 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [Intel-gfx] [RFC PATCH 120/162] drm/i915/oprom: Basic sanitization
Quoted 8 lines · Matthew Auld
From: Anshuman Gupta <[email protected]>
Sanitize OPROM header, CPD signature and OPROM PCI version.
OPROM_HEADER,EXPANSION_ROM_HEADERandOPROM_MEU_BLOBstructures and PCI struct offsets are provided by GSC counterparts. These are yet to be Documented in B.Spec.
After successful sanitization, extract VBT from opregion image.
Comments inline.
BR,
Jani.
Quoted 29 lines
Cc Jani Nikula <[email protected]>Cc Uma Shankar <[email protected]>Cc Uma Shankar <[email protected]>Signed-off-by Anshuman Gupta <[email protected]>--- drivers/gpu/drm/i915/display/intel_bios.c | 49 +++-- drivers/gpu/drm/i915/display/intel_opregion.c | 169 ++++++++++++++++++ drivers/gpu/drm/i915/display/intel_opregion.h | 31 +++- 3 files changed, 221 insertions(+), 28 deletions(-)drivers/gpu/drm/i915/display/intel_bios.c +1
-9@@ -2088,37 +2088,36 @@ bool intel_bios_is_valid_vbt(const void *buf, size_t size)static struct vbt_header *spi_oprom_get_vbt (struct drm_i915_private *dev_priv) { -u32 count, data, found, store =0 ; -u32 static_region, oprom_offset; -u32 oprom_size =0x200000 ; -u16 vbt_size; -u32 *vbt; - - static_region =I915_READ (SPI_STATIC_REGIONS ); - static_region &=OPTIONROM_SPI_REGIONID_MASK ; -I915_WRITE (PRIMARY_SPI_REGIONID , static_region); +u32 count, found;
drivers/gpu/drm/i915/display/intel_bios.c bool intel_bios_is_valid_vbt(const void *buf, size_t size) · line 2099
Quoted 10 lines
drivers/gpu/drm/i915/display/intel_bios.c +7
-2+u32 *vbt, *oprom_opreg =NULL ; +u16 vbt_size, opreg_size; +u8 *parse_ptr; - oprom_offset =I915_READ (OROM_OFFSET ); - oprom_offset &=OROM_OFFSET_MASK ; +if (intel_oprom_verify_signature (&oprom_opreg, &opreg_size, dev_priv)) { +drm_err (&dev_priv->drm,"oprom signature verification failed\n" ); + goto err_not_found; + }
Kind of silly that the previous patch adds all the reading here, and then it gets moved into a function called "verify signature". Which looks like it verifies the signature, but it actually reads the SPI. Very confusing.
Quoted 250 lines
drivers/gpu/drm/i915/display/intel_bios.c +14
-16-for (count =0 ; count < oprom_size; count +=4 ) { -I915_WRITE (PRIMARY_SPI_ADDRESS , oprom_offset + count); - data =I915_READ (PRIMARY_SPI_TRIGGER ); +if (!oprom_opreg) { +drm_err (&dev_priv->drm,"opregion not found\n" ); + goto err_not_found; + } -if (data == *((const u32 *)"$VBT" )) { - found = oprom_offset + count; +for (count =0 ; count < opreg_size; count +=4 ) { +if (oprom_opreg[count /4 ] == *((const u32 *)"$VBT" )) { + found = count;break ; } } -if (count >= oprom_size) +if (count >= opreg_size) { +drm_err (&dev_priv->drm,"VBT not found in opregion\n" ); goto err_not_found; + }/* Get VBT size and allocate space for the VBT */ -I915_WRITE (PRIMARY_SPI_ADDRESS , found + - offsetof(struct vbt_header , vbt_size)); - vbt_size =I915_READ (PRIMARY_SPI_TRIGGER ); - vbt_size &=0xffff ; + parse_ptr = (u8 *)oprom_opreg + found; + vbt_size = ((struct vbt_header *)parse_ptr)->vbt_size; vbt =kzalloc (vbt_size,GFP_KERNEL );if (!vbt) {@@ -2127,16 +2126,12 @@ static struct vbt_header *spi_oprom_get_vbt(struct drm_i915_private *dev_priv) goto err_not_found; } -for (count =0 ; count < vbt_size; count +=4 ) { -I915_WRITE (PRIMARY_SPI_ADDRESS , found + count); - data =I915_READ (PRIMARY_SPI_TRIGGER ); - *(vbt + store++) = data; - } - +memcpy (vbt, parse_ptr, vbt_size);if (!intel_bios_is_valid_vbt (vbt, vbt_size)) goto err_free_vbt;DRM_DEBUG_KMS ("Found valid VBT in SPI flash\n" ); +kfree (oprom_opreg);return (struct vbt_header *)vbt;drivers/gpu/drm/i915/display/intel_opregion.c +169
-0@@ -983,6 +983,175 @@ int intel_opregion_setup(struct drm_i915_private *dev_priv)return err; } +static int oprom_image_parse_helper (u8 *parse_ptr,u8 *last_img,u8 *code_type, +struct drm_i915_private *i915) +{ +u8 size_512_bytes; + +if (((union oprom_header *)parse_ptr)->signature !=OPROM_IMAGE_MAGIC ) { +drm_err (&i915->drm,"Wrong OPROM header signature.\n" ); +return -EINVAL ; + } + + size_512_bytes = parse_ptr[((struct expansion_rom_header *)parse_ptr)->pcistructoffset +PCI_IMAGE_LENGTH_OFFSET ]; + *code_type = parse_ptr[((struct expansion_rom_header *)parse_ptr)->pcistructoffset +PCI_CODE_TYPE_OFFSET ]; + *last_img = parse_ptr[((struct expansion_rom_header *)parse_ptr)->pcistructoffset +PCI_LAST_IMAGE_INDICATOR_OFFSET ]; + +return size_512_bytes; +} + +static void spi_read_oprom_helper (size_t len,u32 offset,u32 *buf, +struct drm_i915_private *dev_priv) +{ +u32 count, data; + +for (count =0 ; count < len; count +=4 ) { +I915_WRITE (PRIMARY_SPI_ADDRESS , offset + count); + data =I915_READ (PRIMARY_SPI_TRIGGER ); + buf[count /4 ] = data; + } +} + +/** +* + DASH+G OPROM IMAGE LAYOUT + +* +--------+-------+---------------------------+ +* | Offset | Value | ROM Header Fields +-----> Image 1 (CSS) +* +--------------------------------------------+ +* | 0h | 55h | ROM Signature Byte1 | +* | 1h | AAh | ROM Signature Byte2 | +* | 2h | xx | Reserved | +* | 18+19h| xx | Ptr to PCI DataStructure | +* +----------------+---------------------------+ +* | PCI Data Structure | +* +--------------------------------------------+ +* | . . . | +* | . . . | +* | 10 + xx + Image Length | +* | 14 + xx + Code Type | +* | 15 + xx + Last Image Indicator | +* | . . . | +* +--------------------------------------------+ +* | MEU BLOB | +* +--------------------------------------------+ +* | CPD Header | +* | CPD Entry | +* | Reserved | +* | SignedDataPart1 | +* | PublicKey | +* | RSA Signature | +* | SignedDataPart2 | +* | IFWI Metadata | +* +--------+-------+---------------------------+ +* | . | . | . | +* | . | . | . | +* +--------------------------------------------+ +* | Offset | Value | ROM Header Fields +-----> Image 2 (Config Data) (Offset: 0x800) +* +--------------------------------------------+ +* | 0h | 55h | ROM Signature Byte1 | +* | 1h | AAh | ROM Signature Byte2 | +* | 2h | xx | Reserved | +* | 18+19h| xx | Ptr to PCI DataStructure | +* +----------------+---------------------------+ +* | PCI Data Structure | +* +--------------------------------------------+ +* | . . . | +* | . . . | +* | 10 + xx + Image Length | +* | 14 + xx + Code Type | +* | 15 + xx + Last Image Indicator | +* | . . . | +* | 1A + 3C + Ptr to Opregion Signature | +* | . . . | +* | . . . | +* | 83Ch + IntelGraphicsMem | <---+ Opregion Signature +* +--------+-----------------------------------+ +* +* intel_oprom_verify_signature() verify OPROM signature. +* @opreg: pointer to opregion buffer output. +* @opreg_size: pointer to opregion size output. +* @dev_priv: i915 device. +*/ +int +intel_oprom_verify_signature (u32 **opreg,u16 *opreg_size, +struct drm_i915_private *dev_priv) +{ +u8 img_sig[sizeof (OPREGION_SIGNATURE )]; +u8 code_type, last_img; +u32 static_region, offset; +u32 *oprom_img, *oprom_img_hdr; +u16 opreg_base, img_len; +u8 *parse_ptr; +int img_size; +int ret = -EINVAL ; + +/* initialize SPI to read the OPROM */ + static_region =I915_READ (SPI_STATIC_REGIONS ); + static_region &=OPTIONROM_SPI_REGIONID_MASK ; +I915_WRITE (PRIMARY_SPI_REGIONID , static_region); +/* read OPROM offset in SPI flash */ + offset =I915_READ (OROM_OFFSET ); + offset &=OROM_OFFSET_MASK ; + + oprom_img_hdr =kzalloc (OPROM_INITIAL_READ_SIZE ,GFP_KERNEL ); +if (!oprom_img_hdr) +return -ENOMEM ; + +do { +spi_read_oprom_helper (OPROM_INITIAL_READ_SIZE , offset, + oprom_img_hdr, dev_priv); + img_size =oprom_image_parse_helper ((u8 *)oprom_img_hdr, &last_img, + &code_type, dev_priv); +if (img_size <=0 ) { + ret = -EINVAL ; + goto err_free_hdr; + } + + img_len = img_size *OPROM_BYTE_BOUNDARY ; + oprom_img =kzalloc (img_len,GFP_KERNEL ); +if (!oprom_img) { + ret = -ENOMEM ; + goto err_free_hdr; + } + +spi_read_oprom_helper (img_len, offset, oprom_img, dev_priv); + parse_ptr = (u8 *)oprom_img; + offset = offset + img_len; + +/* opregion base offset */ + opreg_base = ((struct expansion_rom_header *)parse_ptr)->opregion_base; +/* CPD or opreg signature is present at opregion_base offset */ +memcpy (img_sig, parse_ptr + opreg_base,sizeof (OPREGION_SIGNATURE )); + +if (!memcmp (img_sig,OPREGION_SIGNATURE ,sizeof (OPREGION_SIGNATURE ) -1 )) { + *opreg = oprom_img; + *opreg_size = img_len; +drm_dbg_kms (&dev_priv->drm,"Found opregion image\n" ); + ret =0 ; +break ; + }else if (!memcmp (img_sig,CPD_SIGNATURE ,NUM_CPD_BYTES )) { +if (code_type !=OPROM_CSS_CODE_TYPE ) { +drm_err (&dev_priv->drm,"Invalid OPROM\n" ); + ret = -EINVAL ; + goto err_free_img; + } +drm_dbg_kms (&dev_priv->drm,"Found CSS image\n" ); +/* proceed here onwards for signature authentication */ +kfree (oprom_img); +continue ; + } + + }while (last_img !=LAST_IMG_INDICATOR ); + +return ret; + +err_free_img: +kfree (oprom_img); +err_free_hdr: +kfree (oprom_img_hdr); + +return ret; +} +static int intel_use_opregion_panel_type_callback (const struct dmi_system_id *id) {DRM_INFO ("Using panel type from OpRegion on %s\n" , id->ident);drivers/gpu/drm/i915/display/intel_opregion.h +9
-0@@ -54,6 +54,34 @@ struct intel_opregion {#define OPREGION_SIZE (8 * 1024) +#define CPD_SIGNATURE "$CPD"/* CPD Signature */ +#define NUM_CPD_BYTES 4 +#define PCI_IMAGE_LENGTH_OFFSET 0x10 +#define PCI_CODE_TYPE_OFFSET 0x14 +#define PCI_LAST_IMAGE_INDICATOR_OFFSET 0x15 +#define LAST_IMG_INDICATOR 0x80 +#define OPROM_IMAGE_MAGIC 0xAA55/* Little Endian */ +#define OPROM_CSS_CODE_TYPE 0xF0 +#define OPROM_BYTE_BOUNDARY 512/* OPROM image sizes are indicated in 512 byte boundaries */
drivers/gpu/drm/i915/display/intel_opregion.h struct intel_opregion { · line 75
Quoted 10 lines
drivers/gpu/drm/i915/display/intel_opregion.h +10
-0+#define OPROM_INITIAL_READ_SIZE 60/* Read 60 bytes to compute the Img Len from PCI structure */ + +union oprom_header { +u32 data; +struct { +u16 signature;/* Offset[0x0]: Header 0x55 0xAA */ +u8 sizein512bytes; +u8 reserved; + }; +};
What's the point of the union?
drivers/gpu/drm/i915/display/intel_opregion.h struct intel_opregion { · line 83
Quoted 8 lines
drivers/gpu/drm/i915/display/intel_opregion.h +8
-0+ +struct expansion_rom_header { +union oprom_header header;/* Offset[0x0]: Oprom Header */ +u16 vbiospostoffset;/* Offset[0x4]: pointer to VBIOS entry point */ +u8 resvd[0x12 ]; +u16 pcistructoffset;/* Offset[0x18]: Contains pointer PCI Data Structure */ +u16 opregion_base;/* Offset[0x1A]: Offset to Opregion Base start */ +};
AFAICT both of these should be hidden in the .c file instead of exposed to the rest of the driver, and they should be __packed as they're used for serialisation.
drivers/gpu/drm/i915/display/intel_opregion.h static inline int intel_opregion_get_panel_type(struct drm_i915_private *dev) · line 150
Quoted 11 lines
drivers/gpu/drm/i915/display/intel_opregion.h +3
-1+#ifdef CONFIG_ACPI int intel_opregion_setup (struct drm_i915_private *dev_priv);@@ -118,5 +146,6 @@ static inline int intel_opregion_get_panel_type(struct drm_i915_private *dev) }#endif /* CONFIG_ACPI */ - +int intel_oprom_verify_signature (u32 **opreg,u16 *opreg_size, +struct drm_i915_private *i915);
This breaks the build for CONFIG_ACPI=n.
Quoted 1 line
drivers/gpu/drm/i915/display/intel_opregion.h +0
-0#endif
Signature · 5 lines
Jani Nikula, Intel Open Source Graphics Center _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
RFC PATCH 121/162 drm/i915: WA for zero memory channel
In reply to Matthew AuldFrom: Daniele Ceraolo Spurio <[email protected]>
Commit c457d9cf256e ("drm/i915: Make sure we have enough memory bandwidth on ICL") assumes that we always have a non-zero dram_info->channels and uses it as a divisor. We need num memory channels to be at least 1 for sane bw limits checking, even when PCode returns 0, so lets force it to 1 in this case.
--- drivers/gpu/drm/i915/display/intel_bw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/i915/display/intel_bw.c +1 -1
@@ -222,7 +222,7 @@ static int icl_get_bw_info(struct drm_i915_private *dev_priv, const struct intel "Failed to get memory subsystem information, ignoring bandwidth limits");return ret; } - num_channels = qi.num_channels; + num_channels =max_t (u8,1 , qi.num_channels); deinterleave =DIV_ROUND_UP (num_channels, is_y_tile ?4 :2 ); dclk_max =icl_sagv_max_dclk (&qi);
Signature · 6 lines
2.26.2 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
RFC PATCH 122/162 drm/i915/dg1: Compute MEM Bandwidth using MCHBAR
In reply to Matthew AuldFrom: Clint Taylor <[email protected]>
The PUNIT FW is currently returning 0 for all memory bandwidth parameters. Read the values directly from MCHBAR offsets 0x5918 and 0x4000(4). This is a temporary WA until the PUNIT FW returns valid values.
--- drivers/gpu/drm/i915/display/intel_bw.c | 54 ++++++++++++++++++++++++- 1 file changed, 53 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/display/intel_bw.c +53 -1
@@ -90,6 +90,53 @@ static int icl_pcode_read_mem_global_info(struct drm_i915_private *dev_priv,return 0 ; } +#define SA_PERF_STATUS_0_0_0_MCHBAR_PC _MMIO(MCHBAR_MIRROR_BASE_SNB + 0x5918) +#define DG1_QCLK_RATIO_MASK (0xFF << 2) +#define DG1_QCLK_RATIO_SHIFT 2 +#define DG1_QCLK_REFERENCE (1 << 10) + +#define MCHBAR_CH0_CR_TC_PRE_0_0_0_MCHBAR _MMIO(MCHBAR_MIRROR_BASE_SNB + 0x4000) +#define MCHBAR_CH0_CR_TC_PRE_0_0_0_MCHBAR_HIGH _MMIO(MCHBAR_MIRROR_BASE_SNB + 0x4004) +#define MCHBAR_CH1_CR_TC_PRE_0_0_0_MCHBAR _MMIO(MCHBAR_MIRROR_BASE_SNB + 0x4400) +#define MCHBAR_CH1_CR_TC_PRE_0_0_0_MCHBAR_HIGH _MMIO(MCHBAR_MIRROR_BASE_SNB + 0x4404) +#define DG1_DRAM_T_RCD_MASK (0x7F << 9) +#define DG1_DRAM_T_RCD_SHIFT 9 +#define DG1_DRAM_T_RDPRE_MASK (0x3F << 11) +#define DG1_DRAM_T_RDPRE_SHIFT 11 +#define DG1_DRAM_T_RAS_MASK (0xFF << 1) +#define DG1_DRAM_T_RAS_SHIFT 1 +#define DG1_DRAM_T_RP_MASK (0x7F << 0) +#define DG1_DRAM_T_RP_SHIFT 0 + +static int dg1_mchbar_read_qgv_point_info (struct drm_i915_private *dev_priv, +struct intel_qgv_point *sp, +int point) +{ +u32 val =0 ; +u32 dclk_ratio =0 , dclk_reference =0 ; + + val =I915_READ (SA_PERF_STATUS_0_0_0_MCHBAR_PC ); + dclk_ratio = (val &DG1_QCLK_RATIO_MASK ) >>DG1_QCLK_RATIO_SHIFT ; +if (val &DG1_QCLK_REFERENCE ) + dclk_reference =6 ;/* 6 * 16.666 MHz = 100 MHz */ +else + dclk_reference =8 ;/* 8 * 16.666 MHz = 133 MHz */ + sp->dclk = dclk_ratio * dclk_reference; +if (sp->dclk ==0 ) +return -EINVAL ; + + val =I915_READ (MCHBAR_CH0_CR_TC_PRE_0_0_0_MCHBAR ); + sp->t_rp = (val &DG1_DRAM_T_RP_MASK ) >>DG1_DRAM_T_RP_SHIFT ; + sp->t_rdpre = (val &DG1_DRAM_T_RDPRE_MASK ) >>DG1_DRAM_T_RDPRE_SHIFT ; + + val =I915_READ (MCHBAR_CH0_CR_TC_PRE_0_0_0_MCHBAR_HIGH ); + sp->t_rcd = (val &DG1_DRAM_T_RCD_MASK ) >>DG1_DRAM_T_RCD_SHIFT ; + sp->t_ras = (val &DG1_DRAM_T_RAS_MASK ) >>DG1_DRAM_T_RAS_SHIFT ; + + sp->t_rc = sp->t_rp + sp->t_ras; +return 0 ; +} +static int icl_pcode_read_qgv_point_info (struct drm_i915_private *dev_priv,struct intel_qgv_point *sp,int point)
@@ -153,7 +200,12 @@ static int icl_get_qgv_points(struct drm_i915_private *dev_priv,struct intel_qgv_point *sp = &qi->points[i]; ret =icl_pcode_read_qgv_point_info (dev_priv, sp, i); -if (ret) +if (IS_DG1 (dev_priv) && (ret || sp->dclk ==0 )) { +drm_dbg_kms (&dev_priv->drm,"Failed to get memory subsystem information via pcode. IFWI needs update. Trying with MCHBAR\n" ); + ret =dg1_mchbar_read_qgv_point_info (dev_priv, sp, i); +if (ret) +return ret; + }else if (ret)return ret; drm_dbg_kms(&dev_priv->drm,
Signature · 6 lines
2.26.2 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
RFC PATCH 123/162 drm/i915/dg1: Double memory bandwidth available
In reply to Matthew AuldFrom: Clint Taylor <[email protected]>
Use MCHBAR Gear_type information to compute memory bandwidth available during MCHBAR calculations.
--- drivers/gpu/drm/i915/display/intel_bw.c | 8 ++++++++ 1 file changed, 8 insertions(+)
drivers/gpu/drm/i915/display/intel_bw.c +8 -0
@@ -108,6 +108,9 @@ static int icl_pcode_read_mem_global_info(struct drm_i915_private *dev_priv,#define DG1_DRAM_T_RP_MASK (0x7F << 0)#define DG1_DRAM_T_RP_SHIFT 0 +#define ICL_GEAR_TYPE_MASK (0x01 << 16) +#define ICL_GEAR_TYPE_SHIFT 16 +static int dg1_mchbar_read_qgv_point_info (struct drm_i915_private *dev_priv,struct intel_qgv_point *sp,int point)
@@ -122,6 +125,11 @@ static int dg1_mchbar_read_qgv_point_info(struct drm_i915_private *dev_priv,else dclk_reference =8 ;/* 8 * 16.666 MHz = 133 MHz */ sp->dclk = dclk_ratio * dclk_reference; + + val =I915_READ (SKL_MC_BIOS_DATA_0_0_0_MCHBAR_PCU ); +if ((val &ICL_GEAR_TYPE_MASK ) >>ICL_GEAR_TYPE_SHIFT ) + sp->dclk *=2 ; +if (sp->dclk ==0 )return -EINVAL ;
Signature · 6 lines
2.26.2 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
RFC PATCH 124/162 drm/i915/lmem: allocate HWSP in lmem
In reply to Matthew AuldFrom: Michel Thierry <[email protected]>
--- drivers/gpu/drm/i915/gt/intel_engine_cs.c | 10 +++++++++- drivers/gpu/drm/i915/gt/intel_timeline.c | 8 +++++++- 2 files changed, 16 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/gt/intel_engine_cs.c +9 -1
@@ -25,6 +25,7 @@#include <drm/drm_print.h> #include "gem/i915_gem_context.h" +#include "gem/i915_gem_lmem.h" #include "i915_drv.h"
@@ -657,7 +658,14 @@ static int init_status_page(struct intel_engine_cs *engine)* in GFP_DMA32 for i965, and no earlier physical address users had * access to more than 4G. */ - obj =i915_gem_object_create_internal (engine->i915,PAGE_SIZE ); +if (HAS_LMEM (engine->i915)) { + obj =i915_gem_object_create_lmem (engine->i915, +PAGE_SIZE , +I915_BO_ALLOC_CONTIGUOUS | +I915_BO_ALLOC_VOLATILE ); + }else { + obj =i915_gem_object_create_internal (engine->i915,PAGE_SIZE ); + }if (IS_ERR (obj)) {drm_err (&engine->i915->drm,"Failed to allocate status page\n" );
drivers/gpu/drm/i915/gt/intel_timeline.c +7 -1
@@ -6,6 +6,7 @@#include "i915_drv.h" +#include "gem/i915_gem_lmem.h" #include "i915_active.h" #include "i915_syncmap.h" #include "intel_gt.h"
@@ -34,7 +35,12 @@ static int __hwsp_alloc(struct intel_gt *gt, struct intel_timeline_hwsp *hwsp)int type;int ret; - obj =i915_gem_object_create_internal (i915,PAGE_SIZE ); +if (HAS_LMEM (i915)) + obj =i915_gem_object_create_lmem (i915,PAGE_SIZE , +I915_BO_ALLOC_CONTIGUOUS | +I915_BO_ALLOC_VOLATILE ); +else + obj =i915_gem_object_create_internal (i915,PAGE_SIZE );if (IS_ERR (obj))return PTR_ERR (obj);
Signature · 6 lines
2.26.2 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [Intel-gfx] [RFC PATCH 124/162] drm/i915/lmem: allocate HWSP in lmem
Quoting Matthew Auld (2020-11-27 12:06:40)
Quoted 1 line
From: Michel Thierry <[email protected]>
Rationale goes here.
Is this wise? HWSP is very frequently read by the CPU, and expected to be cached on the CPU.
What do the performance profiles indicate?
-Chris
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [Intel-gfx] [RFC PATCH 124/162] drm/i915/lmem: allocate HWSP in lmem
Quoted 9 lines · Chris Wilson
Quoting Matthew Auld (2020-11-27 12:06:40)
Quoted 1 line
From: Michel Thierry <[email protected]>
Rationale goes here.
Is this wise? HWSP is very frequently read by the CPU, and expected to be cached on the CPU.
What do the performance profiles indicate?
Do you have a recommendation for an existing selftest or IGT to help measure this?
Also are you suggesting moving this to system memory, or just using a different mapping type, if it's placed in local memory? Or maybe try both? Although I'm pretty sceptical about !wc for local memory.
Quoted 2 lines
-Chris
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [Intel-gfx] [RFC PATCH 124/162] drm/i915/lmem: allocate HWSP in lmem
Quoting Matthew Auld (2020-11-30 17:17:16)
Quoted 9 lines · Chris Wilson
Quoted 8 lines
Quoting Matthew Auld (2020-11-27 12:06:40)
Quoted 1 line
From: Michel Thierry <[email protected]>
Rationale goes here.
Is this wise? HWSP is very frequently read by the CPU, and expected to be cached on the CPU.
Quoted 8 lines
Quoted 1 line
What do the performance profiles indicate?
Do you have a recommendation for an existing selftest or IGT to help measure this?
Also are you suggesting moving this to system memory, or just using a different mapping type, if it's placed in local memory? Or maybe try both? Although I'm pretty sceptical about !wc for local memory.
A lot of worries go out of the window if this can be in system memory and snooped.
For measuring, I suspect there is a lot of chaff that needs to be removed before individual microbenchmarks like perf/request discern any difference; although that would be a starting point. We do a lot of completion checking during execlists interrupt processing, and there we (cpu profiles at least) are sensitive to uncached reads.
We can trivially construct a benchmark that only shows the impact of the WC reads; but the point where I think we would first notice from userspace is client wakeup latency scaling: benchmarks/gem_latency, which was once a point of major concern. Nowadays, we can couple that with a second concern about inducing system latency from interrupt processing time. -Chris
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
RFC PATCH 125/162 drm/i915/lmem: Limit block size to 4G
In reply to Matthew AuldFrom: Venkata Sandeep Dhanalakota <[email protected]>
when allocating pages to lmem object of size 4G or greater we allocate memory blocks from buddy system. In this scenario buddy sytem can allocate blocks that can have size >= 4G and these blocks require >32b to represent block size with these blocks we run into an issue with sg list construction because sg->length field is only 32b wide.
Hence limit the max allowed block size to less than 4G.
--- drivers/gpu/drm/i915/intel_memory_region.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/intel_memory_region.c +12 -1
@@ -101,6 +101,7 @@ __intel_memory_region_get_pages_buddy(struct intel_memory_region *mem, struct list_head *blocks) {unsigned int min_order =0 ; +unsigned int max_order;unsigned long n_pages;GEM_BUG_ON (!IS_ALIGNED (size, mem->mm.chunk_size));
@@ -121,6 +122,16 @@ __intel_memory_region_get_pages_buddy(struct intel_memory_region *mem, n_pages = size >>ilog2 (mem->mm.chunk_size); +/* +* When allocating pages for an lmem object of size > 4G +* the memory blocks allocated from buddy system could be +* from sizes greater than 4G requiring > 32b to represent +* block size. But those blocks cannot be used in sg list +* construction(in caller) as sg->length is only 32b wide. +* Hence limiting the block size to 4G. +*/ + max_order = (ilog2 (SZ_4G ) -1 ) -ilog2 (mem->mm.chunk_size); +mutex_lock (&mem->mm_lock); do {
@@ -128,7 +139,7 @@ __intel_memory_region_get_pages_buddy(struct intel_memory_region *mem,unsigned int order;bool retry = true; retry: - order =fls (n_pages) -1 ; + order =min_t (u32, (fls (n_pages) -1 ), max_order);GEM_BUG_ON (order > mem->mm.max_order);GEM_BUG_ON (order < min_order);
Signature · 6 lines
2.26.2 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [Intel-gfx] [RFC PATCH 125/162] drm/i915/lmem: Limit block size to 4G
Quoting Matthew Auld (2020-11-27 12:06:41)
Quoted 4 lines
From: Venkata Sandeep Dhanalakota <[email protected]>
when allocating pages to lmem object of size 4G or greater we allocate memory blocks from buddy system.
Any lmem object is from the buddy system.
Quoted 5 lines
In this scenario
buddy sytem can allocate blocks that can have size >= 4G and these blocks require >32b to represent block size with these blocks we run into an issue with sg list construction becausesg->lengthfield is only 32b wide.
Just say the when using scatterlist, the maximum segment size is 4G. In fact, we can ask sg what the backend maximum is, and use that as our max order.
The only question is whether this merits a flag, or we just assume that the buddy allocator is only used for objects and so always presented via sg?
-Chris
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
RFC PATCH 126/162 drm/i915/gem: Update shmem available memory
In reply to Matthew AuldFrom: Bommu Krishnaiah <[email protected]>
Update shmem available memory in “intel_memory_region”
--- drivers/gpu/drm/i915/gem/i915_gem_shmem.c | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/gpu/drm/i915/gem/i915_gem_shmem.c +7 -0
@@ -30,6 +30,7 @@ static int shmem_get_pages(struct drm_i915_gem_object *obj)struct drm_i915_private *i915 =to_i915 (obj->base.dev);struct intel_memory_region *mem = obj->mm.region;const unsigned long page_count = obj->base.size /PAGE_SIZE ; +resource_size_t size = obj->base.size;unsigned long i;struct address_space *mapping;struct sg_table *st;
@@ -184,6 +185,8 @@ static int shmem_get_pages(struct drm_i915_gem_object *obj)__i915_gem_object_set_pages (obj, st, sg_page_sizes); + mem->avail -= size; +return 0 ; err_sg:
@@ -298,6 +301,8 @@ __i915_gem_object_release_shmem(struct drm_i915_gem_object *obj,void i915_gem_object_put_pages_shmem (struct drm_i915_gem_object *obj,struct sg_table *pages) { +struct intel_memory_region *mem = obj->mm.region; +resource_size_t size = obj->base.size;struct sgt_iter sgt_iter;struct pagevec pvec;struct page *page;
@@ -326,6 +331,8 @@ void i915_gem_object_put_pages_shmem(struct drm_i915_gem_object *obj, struct sg_check_release_pagevec (&pvec); obj->mm.dirty = false; + mem->avail += size; +sg_free_table (pages);kfree (pages); }
Signature · 6 lines
2.26.2 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [RFC PATCH 126/162] drm/i915/gem: Update shmem available memory
Quoting Matthew Auld (2020-11-27 12:06:42)
Quoted 3 lines
From: Bommu Krishnaiah <[email protected]>
Update shmem available memory in “intel_memory_region”
Was avail ever set?
-Chris
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
RFC PATCH 127/162 drm/i915: Allow non-uniform subslices in gen12+
In reply to Matthew AuldFrom: Stuart Summers <[email protected]>
The current implementation of intel_set_subslices only takes the number of bits per subslice stride and copies those in based on the slice given. For all known use cases, this works fine. But in the event of some faulty hardware or other future use case, do a straight memcpy of these subslice bits into the internal mask to ensure all subslices are correctly calculated.
--- drivers/gpu/drm/i915/gt/intel_sseu.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/gt/intel_sseu.c +5 -1
@@ -104,6 +104,7 @@ static u16 compute_eu_total(const struct sseu_dev_info *sseu)static void gen11_compute_sseu_info (struct sseu_dev_info *sseu,u8 s_en,u32 ss_en,u16 eu_en) { +u32 ss_mask;int s, ss;/* ss_en represents entire subslice mask across all slices */
@@ -116,7 +117,10 @@ static void gen11_compute_sseu_info(struct sseu_dev_info *sseu, sseu->slice_mask |=BIT (s); -intel_sseu_set_subslices (sseu, s, ss_en); + ss_mask = ss_en >> (s * sseu->max_subslices); + ss_mask &=GENMASK (sseu->max_subslices -1 ,0 ); + +intel_sseu_set_subslices (sseu, s, ss_mask);for (ss =0 ; ss < sseu->max_subslices; ss++)if (intel_sseu_has_subslice (sseu, s, ss))
Signature · 6 lines
2.26.2 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
RFC PATCH 128/162 drm/i915/dg1: intel_memory_region_evict() changes for eviction
In reply to Matthew AuldFrom: CQ Tang <[email protected]>
Function i915_gem_shrink_memory_region() is changed to intel_memory_region_evict() and moved from i915_gem_shrinker.c to intel_memory_region.c, this function is used to handle local memory swapping, in addition to evict purgeable objects only.
When an object is selected from list, i915_gem_object_unbind() might fail if the object vma is pinned, this causes an error -EBUSY is returned from this function.
The new code uses similar logic as function i915_gem_shrink().
--- .../gpu/drm/i915/gem/i915_gem_object_types.h | 1 - drivers/gpu/drm/i915/gem/i915_gem_shrinker.c | 58 ----------- drivers/gpu/drm/i915/gem/i915_gem_shrinker.h | 2 - drivers/gpu/drm/i915/i915_gem.c | 8 +- drivers/gpu/drm/i915/intel_memory_region.c | 95 +++++++++++++++++-- .../drm/i915/selftests/intel_memory_region.c | 3 +- 6 files changed, 94 insertions(+), 73 deletions(-)
drivers/gpu/drm/i915/gem/i915_gem_object_types.h +0 -1
@@ -237,7 +237,6 @@ struct drm_i915_gem_object {* region->obj_lock. */ struct list_head region_link; -struct list_head tmp_link;struct sg_table *pages;void *mapping;
drivers/gpu/drm/i915/gem/i915_gem_shrinker.c +0 -58
64 lines not on this page · raw message
drivers/gpu/drm/i915/gem/i915_gem_shrinker.h +0 -2
@@ -31,7 +31,5 @@ void i915_gem_driver_register__shrinker(struct drm_i915_private *i915);void i915_gem_driver_unregister__shrinker (struct drm_i915_private *i915);void i915_gem_shrinker_taints_mutex (struct drm_i915_private *i915,struct mutex *mutex); -int i915_gem_shrink_memory_region (struct intel_memory_region *mem, -resource_size_t target);#endif /* __I915_GEM_SHRINKER_H__ */
drivers/gpu/drm/i915/i915_gem.c +4 -4
@@ -1008,12 +1008,12 @@ i915_gem_madvise_ioctl(struct drm_device *dev, void *data,switch (obj->mm.madv) {case I915_MADV_WILLNEED : -list_move (&obj->mm.region_link, - &obj->mm.region->objects.list); +list_move_tail (&obj->mm.region_link, + &obj->mm.region->objects.list);break ;default : -list_move (&obj->mm.region_link, - &obj->mm.region->objects.purgeable); +list_move_tail (&obj->mm.region_link, + &obj->mm.region->objects.purgeable);break ; }
drivers/gpu/drm/i915/intel_memory_region.c +88 -7
126 lines not on this page · raw message
drivers/gpu/drm/i915/selftests/intel_memory_region.c +2 -1
@@ -1093,7 +1093,8 @@ static void igt_mark_evictable(struct drm_i915_gem_object *obj) {i915_gem_object_unpin_pages (obj); obj->mm.madv =I915_MADV_DONTNEED ; -list_move (&obj->mm.region_link, &obj->mm.region->objects.purgeable); +list_move_tail (&obj->mm.region_link, + &obj->mm.region->objects.purgeable); }static int igt_mock_shrink (void *arg)
Signature · 6 lines
2.26.2 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [Intel-gfx] [RFC PATCH 128/162] drm/i915/dg1: intel_memory_region_evict() changes for eviction
Quoting Matthew Auld (2020-11-27 12:06:44)
Quoted 6 lines
From: CQ Tang <[email protected]>
Function
i915_gem_shrink_memory_region()is changed tointel_memory_region_evict()and moved fromi915_gem_shrinker.ctointel_memory_region.c, this function is used to handle local memory swapping, in addition to evict purgeable objects only.
We really do not want to conflate the system shrinker with eviction. Reservation based eviction looks nothing like the shrinker. -Chris
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
RFC PATCH 129/162 drm/i915/dg1: i915_gem_object_memcpy(..) infrastructure
In reply to Matthew AuldFrom: CQ Tang <[email protected]>
i915_gem_object_memcpy() will copy the pages from source object to destination object by using memcpy. If source and destination are not the same size, copy the smaller pages.
Using pread/pwrite mechanism to do the page read/write.
--- drivers/gpu/drm/i915/gem/i915_gem_object.c | 151 +++++++++++++++++++++ drivers/gpu/drm/i915/gem/i915_gem_object.h | 2 + 2 files changed, 153 insertions(+)
drivers/gpu/drm/i915/gem/i915_gem_object.c +151 -0
@@ -30,11 +30,13 @@#include "i915_drv.h" #include "i915_gem_clflush.h" #include "i915_gem_context.h" +#include "i915_gem_lmem.h" #include "i915_gem_mman.h" #include "i915_gem_object.h" #include "i915_gem_object_blt.h" #include "i915_gem_region.h" #include "i915_globals.h" +#include "i915_memcpy.h" #include "i915_trace.h" static struct i915_global_object {
@@ -449,6 +451,155 @@ int i915_gem_object_migrate(struct drm_i915_gem_object *obj,return err; } +struct object_memcpy_info { +struct drm_i915_gem_object *obj; +intel_wakeref_t wakeref; +bool write; +int clflush; +struct page *page; +void *vaddr; +void *(*get_vaddr)(struct object_memcpy_info *info, +unsigned long idx); +void (*put_vaddr)(struct object_memcpy_info *info); +}; + +static +void *lmem_get_vaddr (struct object_memcpy_info *info,unsigned long idx) +{ + info->vaddr =i915_gem_object_lmem_io_map_page (info->obj, idx); +return info->vaddr; +} + +static +void lmem_put_vaddr (struct object_memcpy_info *info) +{ +io_mapping_unmap (info->vaddr); +} + +static +void *smem_get_vaddr (struct object_memcpy_info *info,unsigned long idx) +{ + info->page =i915_gem_object_get_page (info->obj, (unsigned int )idx); + info->vaddr =kmap (info->page); +if (info->clflush &CLFLUSH_BEFORE ) +drm_clflush_virt_range (info->vaddr,PAGE_SIZE ); +return info->vaddr; +} + +static +void smem_put_vaddr (struct object_memcpy_info *info) +{ +if (info->clflush &CLFLUSH_AFTER ) +drm_clflush_virt_range (info->vaddr,PAGE_SIZE ); +kunmap (info->page); +} + +static int +i915_gem_object_prepare_memcpy (struct drm_i915_gem_object *obj, +struct object_memcpy_info *info, +bool write) +{ +struct drm_i915_private *i915 =to_i915 (obj->base.dev); +int ret; + +assert_object_held (obj); + ret =i915_gem_object_wait (obj, +I915_WAIT_INTERRUPTIBLE , +MAX_SCHEDULE_TIMEOUT ); +if (ret) +return ret; + + ret =i915_gem_object_pin_pages (obj); +if (ret) +return ret; + +if (i915_gem_object_is_lmem (obj)) { + ret =i915_gem_object_set_to_wc_domain (obj, write); +if (!ret) { + info->wakeref = +intel_runtime_pm_get (&i915->runtime_pm); + info->get_vaddr = lmem_get_vaddr; + info->put_vaddr = lmem_put_vaddr; + } + }else { +if (write) + ret =i915_gem_object_prepare_write (obj, + &info->clflush); +else + ret =i915_gem_object_prepare_read (obj, + &info->clflush); + +if (!ret) { +i915_gem_object_finish_access (obj); + info->get_vaddr = smem_get_vaddr; + info->put_vaddr = smem_put_vaddr; + } + } + +if (!ret) { + info->obj = obj; + info->write = write; + }else { +i915_gem_object_unpin_pages (obj); + } + +return ret; +} + +static void +i915_gem_object_finish_memcpy (struct object_memcpy_info *info) +{ +struct drm_i915_private *i915 =to_i915 (info->obj->base.dev); + +if (i915_gem_object_is_lmem (info->obj)) { +intel_runtime_pm_put (&i915->runtime_pm, info->wakeref); + }else { +if (info->write) { +i915_gem_object_flush_frontbuffer (info->obj, +ORIGIN_CPU ); + info->obj->mm.dirty = true; + } + } +i915_gem_object_unpin_pages (info->obj); +} + +int i915_gem_object_memcpy (struct drm_i915_gem_object *dst, +struct drm_i915_gem_object *src) +{ +struct object_memcpy_info sinfo, dinfo; +void *svaddr, *dvaddr; +unsigned long npages; +int i, ret; + + ret =i915_gem_object_prepare_memcpy (src, &sinfo, false); +if (ret) +return ret; + + ret =i915_gem_object_prepare_memcpy (dst, &dinfo, true); +if (ret) + goto finish_src; + + npages = src->base.size /PAGE_SIZE ; +for (i =0 ; i < npages; i++) { + svaddr = sinfo.get_vaddr (&sinfo, i); + dvaddr = dinfo.get_vaddr (&dinfo, i); + +/* a performance optimization */ +if (!i915_gem_object_is_lmem (src) || + !i915_memcpy_from_wc (dvaddr, svaddr,PAGE_SIZE )) +memcpy (dvaddr, svaddr,PAGE_SIZE ); + + dinfo.put_vaddr (&dinfo); + sinfo.put_vaddr (&sinfo); + } + +i915_gem_object_finish_memcpy (&dinfo); +finish_src: +i915_gem_object_finish_memcpy (&sinfo); + +return ret; +} +static bool gpu_write_needs_clflush (struct drm_i915_gem_object *obj) { return !(obj->cache_level == I915_CACHE_NONE ||
drivers/gpu/drm/i915/gem/i915_gem_object.h +2 -0
@@ -57,6 +57,8 @@ int i915_gem_object_migrate(struct drm_i915_gem_object *obj,struct i915_gem_ww_ctx *ww, struct intel_context *ce, enum intel_region_id id); +int i915_gem_object_memcpy (struct drm_i915_gem_object *dst, +struct drm_i915_gem_object *src);void i915_gem_flush_free_objects (struct drm_i915_private *i915);
Signature · 6 lines
2.26.2 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
RFC PATCH 130/162 drm/i915/dg1: Eviction logic
In reply to Matthew AuldFrom: CQ Tang <[email protected]>
When an object is pinning, get_pages() is called to allocate memory on a region, if memory pages are not availabe, the region eviction is triggered to find other objects on the same region to be evicted, the selected object is passed to put_pages() call to free the memory pages, before freeing the pages, whether to swap out first to system memory depends on if object is marked as WILLNEED.
After swapped-out, the object is treated as if it does not have any page allocated for it.
Similarly, when an object is pinning, memory pages are allocated from a region, then the object is checked if it had been swapped out before, if yes, swap-in the pages contents into the allocated memory pages.
For this initial swapping code, i915_gem_object_memcpy() is used to copy pages.
--- drivers/gpu/drm/i915/gem/i915_gem_object.c | 12 +- drivers/gpu/drm/i915/gem/i915_gem_object.h | 2 + .../gpu/drm/i915/gem/i915_gem_object_types.h | 6 + drivers/gpu/drm/i915/gem/i915_gem_pages.c | 1 - drivers/gpu/drm/i915/gem/i915_gem_region.c | 139 +++++++++++++++++- drivers/gpu/drm/i915/intel_memory_region.c | 6 + 6 files changed, 162 insertions(+), 4 deletions(-)
drivers/gpu/drm/i915/gem/i915_gem_object.c +11 -1
@@ -178,6 +178,8 @@ static void __i915_gem_free_object_rcu(struct rcu_head *head)container_of (head,typeof (*obj), rcu);struct drm_i915_private *i915 =to_i915 (obj->base.dev); +/* Reset shared reservation object */ + obj->base.resv = &obj->base._resv;dma_resv_fini (&obj->base._resv);i915_gem_object_free (obj);
@@ -185,7 +187,7 @@ static void __i915_gem_free_object_rcu(struct rcu_head *head)atomic_dec (&i915->mm.free_count); } -static void __i915_gem_object_free_mmaps (struct drm_i915_gem_object *obj) +void __i915_gem_object_free_mmaps (struct drm_i915_gem_object *obj) {/* Skip serialisation and waking the device if known to be not used. */
@@ -287,6 +289,14 @@ static void i915_gem_free_object(struct drm_gem_object *gem_obj)GEM_BUG_ON (i915_gem_object_is_framebuffer (obj)); +/* +* If object had been swapped out, free the hidden object. +*/ +if (obj->swapto) { +i915_gem_object_put (obj->swapto); + obj->swapto =NULL ; + } +/* * Before we free the object, make sure any pure RCU-only * read-side critical sections are complete, e.g.
drivers/gpu/drm/i915/gem/i915_gem_object.h +2 -0
@@ -366,6 +366,8 @@ void __i915_gem_object_set_pages(struct drm_i915_gem_object *obj,int ____i915_gem_object_get_pages (struct drm_i915_gem_object *obj);int __i915_gem_object_get_pages (struct drm_i915_gem_object *obj); +void __i915_gem_object_free_mmaps (struct drm_i915_gem_object *obj); +static inline int __must_check i915_gem_object_pin_pages (struct drm_i915_gem_object *obj) {
drivers/gpu/drm/i915/gem/i915_gem_object_types.h +6 -0
@@ -316,6 +316,12 @@ struct drm_i915_gem_object {void *gvt_info; }; + +/** +* object to swap-to if non-null. +*/ +bool do_swapping; +struct drm_i915_gem_object *swapto; }; static inline struct drm_i915_gem_object *
drivers/gpu/drm/i915/gem/i915_gem_pages.c +0 -1
@@ -231,7 +231,6 @@ __i915_gem_object_unset_pages(struct drm_i915_gem_object *obj) }__i915_gem_object_reset_page_iter (obj); - obj->mm.page_sizes.phys = obj->mm.page_sizes.sg =0 ;return pages; }
drivers/gpu/drm/i915/gem/i915_gem_region.c +137 -2
156 lines not on this page · raw message
drivers/gpu/drm/i915/intel_memory_region.c +6 -0
@@ -147,6 +147,11 @@ static int intel_memory_region_evict(struct intel_memory_region *mem,mutex_unlock (&mem->objects.lock); +/* tell callee to do swapping */ +if (i915_gem_object_type_has (obj,I915_GEM_OBJECT_HAS_IOMEM ) + && pass ==1 ) + obj->do_swapping = true; +if (!i915_gem_object_unbind (obj,I915_GEM_OBJECT_UNBIND_ACTIVE )) {if (i915_gem_object_trylock (obj)) {__i915_gem_object_put_pages (obj);
@@ -160,6 +165,7 @@ static int intel_memory_region_evict(struct intel_memory_region *mem, } } + obj->do_swapping = false;i915_gem_object_put (obj);mutex_lock (&mem->objects.lock);
Signature · 6 lines
2.26.2 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
RFC PATCH 131/162 drm/i915/dg1: Add enable_eviction modparam
In reply to Matthew AuldFrom: CQ Tang <[email protected]>
enable_eviction is used to tune if eviction is enabled (default) or not.
--- drivers/gpu/drm/i915/gem/i915_gem_object.c | 1 + drivers/gpu/drm/i915/gem/i915_gem_region.c | 5 +++++ drivers/gpu/drm/i915/i915_params.c | 3 +++ drivers/gpu/drm/i915/i915_params.h | 1 + drivers/gpu/drm/i915/intel_memory_region.c | 2 +- 5 files changed, 11 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/gem/i915_gem_object.c +1 -0
@@ -293,6 +293,7 @@ static void i915_gem_free_object(struct drm_gem_object *gem_obj)* If object had been swapped out, free the hidden object. */ if (obj->swapto) { +GEM_BUG_ON (!i915->params.enable_eviction);i915_gem_object_put (obj->swapto); obj->swapto =NULL ; }
drivers/gpu/drm/i915/gem/i915_gem_region.c +5 -0
@@ -21,6 +21,7 @@ i915_gem_object_swapout_pages(struct drm_i915_gem_object *obj,GEM_BUG_ON (i915_gem_object_has_pages (obj));GEM_BUG_ON (obj->mm.madv !=I915_MADV_WILLNEED );GEM_BUG_ON (obj->mm.region->type !=INTEL_MEMORY_LOCAL ); +GEM_BUG_ON (!i915->params.enable_eviction);assert_object_held (obj);
@@ -70,6 +71,7 @@ static int i915_gem_object_swapin_pages(struct drm_i915_gem_object *obj, struct sg_table *pages, unsigned int sizes) { + struct drm_i915_private *i915 = to_i915(obj->base.dev);struct drm_i915_gem_object *dst, *src;int err;
@@ -77,6 +79,7 @@ i915_gem_object_swapin_pages(struct drm_i915_gem_object *obj,GEM_BUG_ON (i915_gem_object_has_pages (obj));GEM_BUG_ON (obj->mm.madv !=I915_MADV_WILLNEED );GEM_BUG_ON (obj->mm.region->type !=INTEL_MEMORY_LOCAL ); +GEM_BUG_ON (!i915->params.enable_eviction);assert_object_held (obj);
@@ -146,6 +149,7 @@ i915_gem_object_put_pages_buddy(struct drm_i915_gem_object *obj,int i915_gem_object_get_pages_buddy (struct drm_i915_gem_object *obj) { +struct drm_i915_private *i915 =to_i915 (obj->base.dev);struct intel_memory_region *mem = obj->mm.region;struct list_head *blocks = &obj->mm.blocks;resource_size_t size = obj->base.size;
@@ -222,6 +226,7 @@ i915_gem_object_get_pages_buddy(struct drm_i915_gem_object *obj)/* if we saved the page contents, swap them in */ if (obj->swapto) {GEM_BUG_ON (i915_gem_object_is_volatile (obj)); +GEM_BUG_ON (!i915->params.enable_eviction); ret =i915_gem_object_swapin_pages (obj, st, sg_page_sizes);
drivers/gpu/drm/i915/i915_params.c +3 -0
@@ -197,6 +197,9 @@ i915_param_named_unsafe(fake_lmem_start, ulong, 0400, "Fake LMEM start offset (default: 0)");#endif +i915_param_named_unsafe (enable_eviction, bool,0600 , +"Enable memcpy based eviction which does not rely on DMA resv refactoring)" ); + static __always_inline void _print_param(struct drm_printer *p, const char *name, const char *type,
drivers/gpu/drm/i915/i915_params.h +1 -0
@@ -72,6 +72,7 @@ struct drm_printer; param(char *, force_probe, CONFIG_DRM_I915_FORCE_PROBE, 0400) \ param(unsigned long, fake_lmem_start, 0, 0400) \/* leave bools at the end to not create holes */ \ + param(bool, enable_eviction, true, 0600) \ param(bool, enable_hangcheck, true, 0600) \ param(bool, load_detect_test, false, 0600) \param (bool, force_reset_modeset_test, false,0600 ) \
drivers/gpu/drm/i915/intel_memory_region.c +1 -1
@@ -175,7 +175,7 @@ static int intel_memory_region_evict(struct intel_memory_region *mem,list_splice_tail (&still_in_list, *phase);mutex_unlock (&mem->objects.lock); -if (found < target) { +if (found < target && i915->params.enable_eviction) { pass++; phase++;if (*phase)
Signature · 6 lines
2.26.2 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Jani Nikula
maintainerRe: [RFC PATCH 131/162] drm/i915/dg1: Add enable_eviction modparam
Quoted 75 lines · Matthew Auld
From: CQ Tang <[email protected]>
enable_evictionis used to tune if eviction is enabled (default) or not.Signed-off-by Sudeep Dutt <[email protected]>Signed-off-by CQ Tang <[email protected]>--- drivers/gpu/drm/i915/gem/i915_gem_object.c | 1 + drivers/gpu/drm/i915/gem/i915_gem_region.c | 5 +++++ drivers/gpu/drm/i915/i915_params.c | 3 +++ drivers/gpu/drm/i915/i915_params.h | 1 + drivers/gpu/drm/i915/intel_memory_region.c | 2 +- 5 files changed, 11 insertions(+), 1 deletion(-)drivers/gpu/drm/i915/gem/i915_gem_object.c +1
-0@@ -293,6 +293,7 @@ static void i915_gem_free_object(struct drm_gem_object *gem_obj)* If object had been swapped out, free the hidden object. */ if (obj->swapto) { +GEM_BUG_ON (!i915->params.enable_eviction);i915_gem_object_put (obj->swapto); obj->swapto =NULL ; }drivers/gpu/drm/i915/gem/i915_gem_region.c +5
-0@@ -21,6 +21,7 @@ i915_gem_object_swapout_pages(struct drm_i915_gem_object *obj,GEM_BUG_ON (i915_gem_object_has_pages (obj));GEM_BUG_ON (obj->mm.madv !=I915_MADV_WILLNEED );GEM_BUG_ON (obj->mm.region->type !=INTEL_MEMORY_LOCAL ); +GEM_BUG_ON (!i915->params.enable_eviction);assert_object_held (obj);@@ -70,6 +71,7 @@ static int i915_gem_object_swapin_pages(struct drm_i915_gem_object *obj, struct sg_table *pages, unsigned int sizes) { + struct drm_i915_private *i915 = to_i915(obj->base.dev);struct drm_i915_gem_object *dst, *src;int err;@@ -77,6 +79,7 @@ i915_gem_object_swapin_pages(struct drm_i915_gem_object *obj,GEM_BUG_ON (i915_gem_object_has_pages (obj));GEM_BUG_ON (obj->mm.madv !=I915_MADV_WILLNEED );GEM_BUG_ON (obj->mm.region->type !=INTEL_MEMORY_LOCAL ); +GEM_BUG_ON (!i915->params.enable_eviction);assert_object_held (obj);@@ -146,6 +149,7 @@ i915_gem_object_put_pages_buddy(struct drm_i915_gem_object *obj,int i915_gem_object_get_pages_buddy (struct drm_i915_gem_object *obj) { +struct drm_i915_private *i915 =to_i915 (obj->base.dev);struct intel_memory_region *mem = obj->mm.region;struct list_head *blocks = &obj->mm.blocks;resource_size_t size = obj->base.size;@@ -222,6 +226,7 @@ i915_gem_object_get_pages_buddy(struct drm_i915_gem_object *obj)/* if we saved the page contents, swap them in */ if (obj->swapto) {GEM_BUG_ON (i915_gem_object_is_volatile (obj)); +GEM_BUG_ON (!i915->params.enable_eviction); ret =i915_gem_object_swapin_pages (obj, st, sg_page_sizes);drivers/gpu/drm/i915/i915_params.c +0
-0
drivers/gpu/drm/i915/i915_params.c i915_param_named_unsafe(fake_lmem_start, ulong, 0400, · line 201
Quoted 5 lines
drivers/gpu/drm/i915/i915_params.c +2
-0@@ -197,6 +197,9 @@ i915_param_named_unsafe(fake_lmem_start, ulong, 0400, "Fake LMEM start offset (default: 0)");#endif +i915_param_named_unsafe (enable_eviction, bool,0600 , +"Enable memcpy based eviction which does not rely on DMA resv refactoring)" );
Does the module parameter actually need to be writable? Should be modified via debugfs as a device specific parameter?
BR,
Jani.
Quoted 29 lines
drivers/gpu/drm/i915/i915_params.c +1
-0+ static __always_inline void _print_param(struct drm_printer *p, const char *name, const char *type,drivers/gpu/drm/i915/i915_params.h +1
-0@@ -72,6 +72,7 @@ struct drm_printer; param(char *, force_probe, CONFIG_DRM_I915_FORCE_PROBE, 0400) \ param(unsigned long, fake_lmem_start, 0, 0400) \/* leave bools at the end to not create holes */ \ + param(bool, enable_eviction, true, 0600) \ param(bool, enable_hangcheck, true, 0600) \ param(bool, load_detect_test, false, 0600) \param (bool, force_reset_modeset_test, false,0600 ) \drivers/gpu/drm/i915/intel_memory_region.c +1
-1@@ -175,7 +175,7 @@ static int intel_memory_region_evict(struct intel_memory_region *mem,list_splice_tail (&still_in_list, *phase);mutex_unlock (&mem->objects.lock); -if (found < target) { +if (found < target && i915->params.enable_eviction) { pass++; phase++;if (*phase)
Signature · 5 lines
Jani Nikula, Intel Open Source Graphics Center _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
RFC PATCH 132/162 drm/i915/dg1: Add lmem_size modparam
In reply to Matthew AuldFrom: CQ Tang <[email protected]>
lmem_size is used to limit the amount of lmem_size. Default is to use hardware available lmem size, when setting this modpraram which is in MB unit.
--- drivers/gpu/drm/i915/i915_params.c | 3 +++ drivers/gpu/drm/i915/i915_params.h | 1 + drivers/gpu/drm/i915/intel_region_lmem.c | 4 ++++ 3 files changed, 8 insertions(+)
drivers/gpu/drm/i915/i915_params.c +3 -0
@@ -200,6 +200,9 @@ i915_param_named_unsafe(fake_lmem_start, ulong, 0400,i915_param_named_unsafe (enable_eviction, bool,0600 ,"Enable memcpy based eviction which does not rely on DMA resv refactoring)" ); +i915_param_named_unsafe (lmem_size, uint,0400 , +"Change lmem size for each region. (default: 0, all memory)" ); + static __always_inline void _print_param(struct drm_printer *p, const char *name, const char *type,
drivers/gpu/drm/i915/i915_params.h +1 -0
@@ -71,6 +71,7 @@ struct drm_printer; param(int, enable_dpcd_backlight, -1, 0600) \ param(char *, force_probe, CONFIG_DRM_I915_FORCE_PROBE, 0400) \ param(unsigned long, fake_lmem_start, 0, 0400) \ + param(unsigned int, lmem_size, 0, 0400) \/* leave bools at the end to not create holes */ \ param(bool, enable_eviction, true, 0600) \param (bool, enable_hangcheck, true,0600 ) \
drivers/gpu/drm/i915/intel_region_lmem.c +4 -0
@@ -196,6 +196,10 @@ setup_lmem(struct drm_i915_private *dev_priv) io_start =pci_resource_start (pdev,2 ); +if (dev_priv->params.lmem_size >0 ) + lmem_size =min_t (resource_size_t, lmem_size, +mul_u32_u32 (dev_priv->params.lmem_size,SZ_1M )); + mem = intel_memory_region_create(dev_priv, 0, lmem_size,
Signature · 6 lines
2.26.2 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
RFC PATCH 133/162 drm/i915/dg1: Track swap in/out stats via debugfs
In reply to Matthew AuldFrom: Sudeep Dutt <[email protected]>
cat /sys/kernel/debug/dri/0/i915_gem_objects num_bytes_swapped_out 94170000 num_bytes_swapped_in 56120000
--- drivers/gpu/drm/i915/gem/i915_gem_region.c | 6 ++++++ drivers/gpu/drm/i915/i915_debugfs.c | 3 +++ drivers/gpu/drm/i915/i915_drv.h | 3 +++ 3 files changed, 12 insertions(+)
drivers/gpu/drm/i915/gem/i915_gem_region.c +6 -0
@@ -64,6 +64,9 @@ i915_gem_object_swapout_pages(struct drm_i915_gem_object *obj,else i915_gem_object_put (dst); +if (!err) +atomic_long_add (sizes, &i915->num_bytes_swapped_out); +return err; }
@@ -118,6 +121,9 @@ i915_gem_object_swapin_pages(struct drm_i915_gem_object *obj,i915_gem_object_put (src); } +if (!err) +atomic_long_add (sizes, &i915->num_bytes_swapped_in); +return err; }
drivers/gpu/drm/i915/i915_debugfs.c +3 -0
@@ -372,6 +372,9 @@ static int i915_gem_object_info(struct seq_file *m, void *data)for_each_memory_region (mr, i915, id)seq_printf (m,"%s: total:%pa, available:%pa bytes\n" , mr->name, &mr->total, &mr->avail); +seq_printf (m,"num_bytes_swapped_out %ld num_bytes_swapped_in %ld\n" , +atomic_long_read (&i915->num_bytes_swapped_out), +atomic_long_read (&i915->num_bytes_swapped_in));seq_putc (m,'\n' );print_context_stats (m, i915);
drivers/gpu/drm/i915/i915_drv.h +3 -0
@@ -1214,6 +1214,9 @@ struct drm_i915_private {* NOTE: This is the dri1/ums dungeon, don't add stuff here. Your patch * will be rejected. Instead look for a better place. */ + +atomic_long_t num_bytes_swapped_out; +atomic_long_t num_bytes_swapped_in; };static inline struct drm_i915_private *to_i915 (const struct drm_device *dev)
Signature · 6 lines
2.26.2 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [Intel-gfx] [RFC PATCH 133/162] drm/i915/dg1: Track swap in/out stats via debugfs
Quoting Matthew Auld (2020-11-27 12:06:49)
drivers/gpu/drm/i915/i915_drv.h struct drm_i915_private { · line 1219
Quoted 11 lines
drivers/gpu/drm/i915/i915_drv.h +3
-0@@ -1214,6 +1214,9 @@ struct drm_i915_private {* NOTE: This is the dri1/ums dungeon, don't add stuff here. Your patch * will be rejected. Instead look for a better place. */ + +atomic_long_t num_bytes_swapped_out; +atomic_long_t num_bytes_swapped_in;
Enough said. Don't mindlessly add fields.
-Chris
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
RFC PATCH 134/162 drm/i915/dg1: Measure swap in/out timing stats
In reply to Matthew AuldFrom: Sudeep Dutt <[email protected]>
--- drivers/gpu/drm/i915/gem/i915_gem_region.c | 16 ++++++++++++++-- drivers/gpu/drm/i915/i915_debugfs.c | 3 +++ drivers/gpu/drm/i915/i915_drv.h | 2 ++ 3 files changed, 19 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/gem/i915_gem_region.c +14 -2
@@ -15,6 +15,7 @@ i915_gem_object_swapout_pages(struct drm_i915_gem_object *obj, {struct drm_i915_private *i915 =to_i915 (obj->base.dev);struct drm_i915_gem_object *dst, *src; +unsigned long start, diff, msec;int err;GEM_BUG_ON (obj->swapto);
@@ -24,6 +25,7 @@ i915_gem_object_swapout_pages(struct drm_i915_gem_object *obj,GEM_BUG_ON (!i915->params.enable_eviction);assert_object_held (obj); + start = jiffies;/* create a shadow object on smem region */ dst =i915_gem_object_create_shmem (i915, obj->base.size);
@@ -64,8 +66,12 @@ i915_gem_object_swapout_pages(struct drm_i915_gem_object *obj,else i915_gem_object_put (dst); -if (!err) +if (!err) { + diff = jiffies - start; + msec = diff *1000 /HZ ; +atomic_long_add (msec, &i915->time_swap_out_ms);atomic_long_add (sizes, &i915->num_bytes_swapped_out); + }return err; }
@@ -76,6 +82,7 @@ i915_gem_object_swapin_pages(struct drm_i915_gem_object *obj, {struct drm_i915_private *i915 =to_i915 (obj->base.dev);struct drm_i915_gem_object *dst, *src; +unsigned long start, diff, msec;int err;GEM_BUG_ON (!obj->swapto);
@@ -85,6 +92,7 @@ i915_gem_object_swapin_pages(struct drm_i915_gem_object *obj,GEM_BUG_ON (!i915->params.enable_eviction);assert_object_held (obj); + start = jiffies; src = obj->swapto;
@@ -121,8 +129,12 @@ i915_gem_object_swapin_pages(struct drm_i915_gem_object *obj,i915_gem_object_put (src); } -if (!err) +if (!err) { + diff = jiffies - start; + msec = diff *1000 /HZ ; +atomic_long_add (msec, &i915->time_swap_in_ms);atomic_long_add (sizes, &i915->num_bytes_swapped_in); + }return err; }
drivers/gpu/drm/i915/i915_debugfs.c +3 -0
@@ -375,6 +375,9 @@ static int i915_gem_object_info(struct seq_file *m, void *data)seq_printf (m,"num_bytes_swapped_out %ld num_bytes_swapped_in %ld\n" ,atomic_long_read (&i915->num_bytes_swapped_out),atomic_long_read (&i915->num_bytes_swapped_in)); +seq_printf (m,"time_swap_out_msec %ld time_swap_in_msec %ld\n" , +atomic_long_read (&i915->time_swap_out_ms), +atomic_long_read (&i915->time_swap_in_ms));seq_putc (m,'\n' );print_context_stats (m, i915);
drivers/gpu/drm/i915/i915_drv.h +2 -0
@@ -1217,6 +1217,8 @@ struct drm_i915_private {atomic_long_t num_bytes_swapped_out;atomic_long_t num_bytes_swapped_in; +atomic_long_t time_swap_out_ms; +atomic_long_t time_swap_in_ms; };static inline struct drm_i915_private *to_i915 (const struct drm_device *dev)
Signature · 6 lines
2.26.2 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [Intel-gfx] [RFC PATCH 134/162] drm/i915/dg1: Measure swap in/out timing stats
Quoting Matthew Auld (2020-11-27 12:06:50)
Quoted 30 lines
From: Sudeep Dutt <[email protected]>
Signed-off-by Sudeep Dutt <[email protected]>--- drivers/gpu/drm/i915/gem/i915_gem_region.c | 16 ++++++++++++++-- drivers/gpu/drm/i915/i915_debugfs.c | 3 +++ drivers/gpu/drm/i915/i915_drv.h | 2 ++ 3 files changed, 19 insertions(+), 2 deletions(-)drivers/gpu/drm/i915/gem/i915_gem_region.c +2
-0@@ -15,6 +15,7 @@ i915_gem_object_swapout_pages(struct drm_i915_gem_object *obj, {struct drm_i915_private *i915 =to_i915 (obj->base.dev);struct drm_i915_gem_object *dst, *src; +unsigned long start, diff, msec;int err;GEM_BUG_ON (obj->swapto);@@ -24,6 +25,7 @@ i915_gem_object_swapout_pages(struct drm_i915_gem_object *obj,GEM_BUG_ON (!i915->params.enable_eviction);assert_object_held (obj); + start = jiffies;/* create a shadow object on smem region */ dst =i915_gem_object_create_shmem (i915, obj->base.size);
drivers/gpu/drm/i915/gem/i915_gem_region.c i915_gem_object_swapout_pages(struct drm_i915_gem_object *obj, · line 74
Quoted 10 lines
drivers/gpu/drm/i915/gem/i915_gem_region.c +5
-1@@ -64,8 +66,12 @@ i915_gem_object_swapout_pages(struct drm_i915_gem_object *obj,else i915_gem_object_put (dst); -if (!err) +if (!err) { + diff = jiffies - start; + msec = diff *1000 /HZ ; +atomic_long_add (msec, &i915->time_swap_out_ms);atomic_long_add (sizes, &i915->num_bytes_swapped_out); + }
This can be done using a kprobe, and with prettier statistics as builtin functionality.
-Chris
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
RFC PATCH 135/162 drm/i915: define intel_partial_pages_for_sg_table
In reply to Matthew AuldFrom: Ramalingam C <[email protected]>
Function to retrieve the partial pages from the object, from mentioned offset(pages). This is created as a subset of intel_partial pages to be used for window blt copy feature which is introduced in forthcoming patches.
This takes the sg_table to be filled in with pages and also passes out the ptr to last scatterlist used. sg_table is trimmed based on the parameter.
--- drivers/gpu/drm/i915/gt/intel_ggtt.c | 59 +++++++++++++++++----------- drivers/gpu/drm/i915/gt/intel_gtt.h | 4 ++ 2 files changed, 40 insertions(+), 23 deletions(-)
drivers/gpu/drm/i915/gt/intel_ggtt.c +36 -23
@@ -1383,25 +1383,17 @@ intel_remap_pages(struct intel_remapped_info *rem_info,return ERR_PTR (ret); } -static noinline struct sg_table * -intel_partial_pages (const struct i915_ggtt_view *view, -struct drm_i915_gem_object *obj) +void intel_partial_pages_for_sg_table (struct drm_i915_gem_object *obj, +struct sg_table *st, +u32 obj_offset,u32 page_count, +struct scatterlist **sgl) { -struct sg_table *st;struct scatterlist *sg, *iter; -unsigned int count = view->partial.size;unsigned int offset; -int ret = -ENOMEM ; - st =kmalloc (sizeof (*st),GFP_KERNEL ); -if (!st) - goto err_st_alloc; +GEM_BUG_ON (!st); - ret =sg_alloc_table (st, count,GFP_KERNEL ); -if (ret) - goto err_sg_alloc; - - iter =i915_gem_object_get_sg_dma (obj, view->partial.offset, &offset, true); + iter =i915_gem_object_get_sg_dma (obj, obj_offset, &offset, true);GEM_BUG_ON (!iter); sg = st->sgl;
@@ -1410,30 +1402,51 @@ intel_partial_pages(const struct i915_ggtt_view *view,unsigned int len; len =min (sg_dma_len (iter) - (offset <<PAGE_SHIFT ), - count <<PAGE_SHIFT ); + page_count <<PAGE_SHIFT ); +sg_set_page (sg,NULL , len,0 );sg_dma_address (sg) =sg_dma_address (iter) + (offset <<PAGE_SHIFT );sg_dma_len (sg) = len; st->nents++; - count -= len >>PAGE_SHIFT ; -if (count ==0 ) { + page_count -= len >>PAGE_SHIFT ; +if (page_count ==0 ) {sg_mark_end (sg); -i915_sg_trim (st);/* Drop any unused tail entries. */ +if (sgl) + *sgl = sg; -return st; +return ; } sg =__sg_next (sg); iter =__sg_next (iter); offset =0 ; }while (1 ); +} -err_sg_alloc: -kfree (st); -err_st_alloc: -return ERR_PTR (ret); +static noinline struct sg_table * +intel_partial_pages (const struct i915_ggtt_view *view, +struct drm_i915_gem_object *obj) +{ +struct sg_table *st; +int ret; + + st =kmalloc (sizeof (*st),GFP_KERNEL ); +if (!st) +return ERR_PTR (-ENOMEM ); + + ret =sg_alloc_table (st, view->partial.size,GFP_KERNEL ); +if (ret) { +kfree (st); +return ERR_PTR (ret); + } + +intel_partial_pages_for_sg_table (obj, st, view->partial.offset, + view->partial.size,NULL ); +i915_sg_trim (st); + +return st; } static int
drivers/gpu/drm/i915/gt/intel_gtt.h +4 -0
@@ -506,6 +506,10 @@ static inline bool i915_ggtt_has_aperture(const struct i915_ggtt *ggtt)return ggtt->mappable_end >0 ; } +void intel_partial_pages_for_sg_table (struct drm_i915_gem_object *obj, +struct sg_table *st, +u32 obj_offset,u32 page_count, +struct scatterlist **sgl);int i915_ppgtt_init_hw (struct intel_gt *gt);struct i915_ppgtt *i915_ppgtt_create (struct intel_gt *gt);
Signature · 6 lines
2.26.2 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
RFC PATCH 136/162 drm/i915: create and destroy dummy vma
In reply to Matthew AuldFrom: Ramalingam C <[email protected]>
Functions for window_blt_copy defined to create and destroy the dummy vmas for virtual memory, which dont have any associated objects.
These dummy vmas are used at window_blt_copy festure to associated to set of pages and create ptes at runtime and submit it for blt copy.
--- drivers/gpu/drm/i915/i915_vma.c | 38 +++++++++++++++++++++++++++++++++ drivers/gpu/drm/i915/i915_vma.h | 6 ++++++ 2 files changed, 44 insertions(+)
drivers/gpu/drm/i915/i915_vma.c +38 -0
@@ -100,6 +100,44 @@ static void __i915_vma_retire(struct i915_active *ref)i915_vma_put (active_to_vma (ref)); } +struct i915_vma * +i915_alloc_window_vma (struct drm_i915_private *i915, +struct i915_address_space *vm,u64 size, +u64 min_page_size) +{ +struct i915_vma *vma; + + vma =i915_vma_alloc (); +if (!vma) +return ERR_PTR (-ENOMEM ); + +kref_init (&vma->ref); +mutex_init (&vma->pages_mutex); + vma->vm =i915_vm_get (vm); + vma->ops = &vm->vma_ops; + vma->obj =NULL ; + vma->resv =NULL ; + vma->size = size; + vma->display_alignment =I915_GTT_MIN_ALIGNMENT ; + vma->page_sizes.sg = min_page_size; + +i915_active_init (&vma->active, __i915_vma_active, __i915_vma_retire); +INIT_LIST_HEAD (&vma->closed_link); + +GEM_BUG_ON (!IS_ALIGNED (vma->size,I915_GTT_PAGE_SIZE )); +GEM_BUG_ON (i915_is_ggtt (vm)); + +return vma; +} + +void i915_destroy_window_vma (struct i915_vma *vma) +{ +i915_active_fini (&vma->active); +i915_vm_put (vma->vm); +mutex_destroy (&vma->pages_mutex); +i915_vma_free (vma); +} +static struct i915_vma * vma_create(struct drm_i915_gem_object *obj, struct i915_address_space *vm,
drivers/gpu/drm/i915/i915_vma.h +6 -0
@@ -44,6 +44,12 @@ i915_vma_instance(struct drm_i915_gem_object *obj,struct i915_address_space *vm, const struct i915_ggtt_view *view); +struct i915_vma * +i915_alloc_window_vma (struct drm_i915_private *i915, +struct i915_address_space *vm,u64 size, +u64 min_page_size); +void i915_destroy_window_vma (struct i915_vma *vma); +void i915_vma_unpin_and_release (struct i915_vma **p_vma,unsigned int flags);#define I915_VMA_RELEASE_MAP BIT(0)
Signature · 6 lines
2.26.2 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
RFC PATCH 137/162 drm/i915: blt copy between objs using pre-created vma windows
In reply to Matthew AuldFrom: Ramalingam C <[email protected]>
To avoid the locking issues in vma handling during the blt copy of objects, dummy vmas with sg_tables of size BLT_WINDOW_SZ (with WINDOW_SIZE / PAGE_SIZE number of scatterlists) are created in driver load for source and destination objects.
Two sets of these vmas are created, where one set is for lmem and another set is for smem to enable the blt copy of the contents of objects belongs to same mem regions or different mem regions
When blitter copy is required between objects, pages of size <=WINDOW_SIZE are assigned to the dummy_vma->pages for both source and destination objects into corrresponding windows.
Then PTE are created at runtime for the pages attached and batch commands are filled into the BCS ring for the pages filled in the window and request is submitted for the BCS0.
Until all pages of the source object are copied into destination object pages above process will be executed in a loop.
--- drivers/gpu/drm/i915/gem/i915_gem_object.c | 355 +++++++++++++++++++++ drivers/gpu/drm/i915/gem/i915_gem_object.h | 5 + drivers/gpu/drm/i915/i915_drv.c | 11 + drivers/gpu/drm/i915/i915_drv.h | 6 + 4 files changed, 377 insertions(+)
drivers/gpu/drm/i915/gem/i915_gem_object.c +355 -0
@@ -22,11 +22,13 @@* */ +#include <drm/drm_print.h> #include <linux/sched/mm.h> #include "display/intel_frontbuffer.h" #include "gt/intel_gt.h" #include "gt/intel_gt_requests.h" +#include "gt/intel_ring.h" #include "i915_drv.h" #include "i915_gem_clflush.h" #include "i915_gem_context.h"
@@ -718,6 +720,359 @@ static const struct drm_gem_object_funcs i915_gem_object_funcs = { .export = i915_gem_prime_export, }; +#define BLT_WINDOW_SZ SZ_4M +static int i915_alloc_vm_range (struct i915_vma *vma) +{ +struct i915_vm_pt_stash stash = {}; +int err; +struct i915_gem_ww_ctx ww; + + err =i915_vm_alloc_pt_stash (vma->vm, &stash, vma->size); +if (err) +return err; + + for_i915_gem_ww(&ww, err, false) { + err =i915_vm_lock_objects (vma->vm, &ww); +if (err) +continue ; + +dma_resv_assert_held (&vma->vm->resv); + + err =i915_vm_map_pt_stash (vma->vm, &stash); +if (err) +continue ; + + vma->vm->allocate_va_range (vma->vm, &stash, + vma->node.start, vma->size); + +set_bit (I915_VMA_ALLOC_BIT ,__i915_vma_flags (vma)); +/* Implicit unlock */ + } + +i915_vm_free_pt_stash (vma->vm, &stash); + +return err; +} + +static inline void i915_insert_vma_pages (struct i915_vma *vma,bool is_lmem) +{ +enum i915_cache_level cache_level =I915_CACHE_NONE ; + + vma->vm->insert_entries (vma->vm, vma, cache_level, + is_lmem ?PTE_LM :0 ); +wmb (); +} + +static struct i915_vma * +i915_window_vma_init (struct drm_i915_private *i915, +struct intel_memory_region *mem) +{ +struct intel_context *ce = i915->gt.engine[BCS0 ]->blitter_context; +struct i915_address_space *vm = ce->vm; +struct i915_vma *vma; +int ret; + + vma =i915_alloc_window_vma (i915, vm,BLT_WINDOW_SZ , + mem->min_page_size); +if (IS_ERR (vma)) { +DRM_ERROR ("window vma alloc failed(%ld)\n" ,PTR_ERR (vma)); +return vma; + } + + vma->pages =kmalloc (sizeof (*vma->pages),GFP_KERNEL ); +if (!vma->pages) { + ret = -ENOMEM ; +DRM_ERROR ("page alloc failed. %d" , ret); + goto err_page; + } + + ret =sg_alloc_table (vma->pages,BLT_WINDOW_SZ /PAGE_SIZE , +GFP_KERNEL ); +if (ret) { +DRM_ERROR ("sg alloc table failed(%d)" , ret); + goto err_sg_table; + } + +mutex_lock (&vm->mutex); + ret =drm_mm_insert_node_in_range (&vm->mm, &vma->node, +BLT_WINDOW_SZ ,BLT_WINDOW_SZ , +I915_COLOR_UNEVICTABLE , +0 , vm->total, +DRM_MM_INSERT_LOW ); +mutex_unlock (&vm->mutex); +if (ret) { +DRM_ERROR ("drm_mm_insert_node_in_range failed. %d\n" , ret); + goto err_mm_node; + } + + ret =i915_alloc_vm_range (vma); +if (ret) { +DRM_ERROR ("src: Page table alloc failed(%d)\n" , ret); + goto err_alloc; + } + +return vma; + +err_alloc: +mutex_lock (&vm->mutex); +drm_mm_remove_node (&vma->node); +mutex_unlock (&vm->mutex); +err_mm_node: +sg_free_table (vma->pages); +err_sg_table: +kfree (vma->pages); +err_page: +i915_destroy_window_vma (vma); + +return ERR_PTR (ret); +} + +static void i915_window_vma_teardown (struct i915_vma *vma) +{ + vma->vm->clear_range (vma->vm, vma->node.start, vma->size); +drm_mm_remove_node (&vma->node); +sg_free_table (vma->pages); +kfree (vma->pages); +i915_destroy_window_vma (vma); +} + +int i915_setup_blt_windows (struct drm_i915_private *i915) +{ +struct intel_memory_region *lmem_region = +intel_memory_region_by_type (i915,INTEL_MEMORY_LOCAL ); +struct intel_memory_region *smem_region = +intel_memory_region_by_type (i915,INTEL_MEMORY_SYSTEM ); +struct i915_vma *lmem[2 ]; +struct i915_vma *smem[2 ]; +int ret, i; + +if (intel_gt_is_wedged (&i915->gt)) { +drm_dbg (&i915->drm,"GT0 is wedged; BCS0 not available\n" ); +return -EIO ; + } + +if (!i915->gt.engine[BCS0 ]) { +DRM_DEBUG ("No BCS0 engine, hence blt evict is not setup\n" ); +return 0 ; + } + +mutex_init (&i915->mm.window_mutex); +for (i =0 ; i <ARRAY_SIZE (lmem); i++) { + lmem[i] =i915_window_vma_init (i915, lmem_region); +if (IS_ERR_OR_NULL (lmem[i])) { + ret =PTR_ERR (lmem[i]); +DRM_ERROR ("Err for lmem[%d]. %d\n" , i, ret); +if (i--) +for (; i >=0 ; i--) +i915_window_vma_teardown (lmem[i]); +return ret; + } + i915->mm.lmem_window[i] = lmem[i]; +GEM_BUG_ON (!i915->mm.lmem_window[i]); + } + +for (i =0 ; i <ARRAY_SIZE (smem); i++) { + smem[i] =i915_window_vma_init (i915, smem_region); +if (IS_ERR_OR_NULL (smem[i])) { + ret =PTR_ERR (smem[i]); +DRM_ERROR ("Err for smem[%d]. %d\n" , i, ret); +if (i--) +for (; i >=0 ; i--) +i915_window_vma_teardown (smem[i]); +for (i =0 ; i <ARRAY_SIZE (lmem); i++) +i915_window_vma_teardown (lmem[i]); +return ret; + } + i915->mm.smem_window[i] = smem[i]; +GEM_BUG_ON (!i915->mm.smem_window[i]); + } + +return 0 ; +} + +void i915_teardown_blt_windows (struct drm_i915_private *i915) +{ +int i; + +for (i =0 ; i <ARRAY_SIZE (i915->mm.lmem_window); i++) { +if (!i915->mm.lmem_window[i]) +continue ; +i915_window_vma_teardown (i915->mm.lmem_window[i]); + } +for (i =0 ; i <ARRAY_SIZE (i915->mm.smem_window); i++) { +if (!i915->mm.smem_window[i]) +continue ; +i915_window_vma_teardown (i915->mm.smem_window[i]); + } +mutex_destroy (&i915->mm.window_mutex); +} + +static int i915_window_blt_copy_prepare_obj (struct drm_i915_gem_object *obj) +{ +int ret; + + ret =i915_gem_object_wait (obj, +I915_WAIT_INTERRUPTIBLE , +MAX_SCHEDULE_TIMEOUT ); +if (ret) +return ret; + +return i915_gem_object_pin_pages (obj); +} + +static int +i915_window_blt_copy_batch_prepare (struct i915_request *rq, +struct i915_vma *src, +struct i915_vma *dst,size_t size) +{ +u32 *cmd; + +GEM_BUG_ON (size >BLT_WINDOW_SZ ); + cmd =intel_ring_begin (rq,10 ); +if (IS_ERR (cmd)) +return PTR_ERR (cmd); + +GEM_BUG_ON (size >>PAGE_SHIFT >S16_MAX ); +GEM_BUG_ON (INTEL_GEN (rq->engine->i915) <9 ); + + *cmd++ =GEN9_XY_FAST_COPY_BLT_CMD | (10 -2 ); + *cmd++ =BLT_DEPTH_32 |PAGE_SIZE ; + *cmd++ =0 ; + *cmd++ = size >>PAGE_SHIFT <<16 |PAGE_SIZE /4 ; + *cmd++ =lower_32_bits (dst->node.start); + *cmd++ =upper_32_bits (dst->node.start); + *cmd++ =0 ; + *cmd++ =PAGE_SIZE ; + *cmd++ =lower_32_bits (src->node.start); + *cmd++ =upper_32_bits (src->node.start); +intel_ring_advance (rq, cmd); + +return 0 ; +} + +int i915_window_blt_copy (struct drm_i915_gem_object *dst, +struct drm_i915_gem_object *src) +{ +struct drm_i915_private *i915 =to_i915 (src->base.dev); +struct intel_context *ce = i915->gt.engine[BCS0 ]->blitter_context; +bool src_is_lmem =i915_gem_object_is_lmem (src); +bool dst_is_lmem =i915_gem_object_is_lmem (dst); +struct scatterlist *last_sgl; +struct i915_vma *src_vma, *dst_vma; +struct i915_request *rq; +u64 cur_win_sz, blt_copied, offset; +long timeout; +u32 size; +int err; + + src_vma = src_is_lmem ? i915->mm.lmem_window[0 ] : + i915->mm.smem_window[0 ]; + dst_vma = dst_is_lmem ? i915->mm.lmem_window[1 ] : + i915->mm.smem_window[1 ]; + +if (!src_vma || !dst_vma) +return -ENODEV ; + + blt_copied =0 ; + + err =i915_window_blt_copy_prepare_obj (src); +if (err) +return err; + + err =i915_window_blt_copy_prepare_obj (dst); +if (err) { +i915_gem_object_unpin_pages (src); +return err; + } + +mutex_lock (&i915->mm.window_mutex); + src_vma->obj = src; + dst_vma->obj = dst; +do { + cur_win_sz =min_t (u64,BLT_WINDOW_SZ , + (src->base.size - blt_copied)); + offset = blt_copied >>PAGE_SHIFT ; + size =ALIGN (cur_win_sz, src->mm.region->min_page_size) >> +PAGE_SHIFT ; +intel_partial_pages_for_sg_table (src, src_vma->pages, offset, + size, &last_sgl); + +/* +* Insert pages into vm, expects the pages to the full +* length of VMA. But we may have the pages of <= vma_size. +* Hence altering the vma size to match the total size of +* the pages attached. +*/ + src_vma->size = size <<PAGE_SHIFT ; +i915_insert_vma_pages (src_vma, src_is_lmem); +sg_unmark_end (last_sgl); + +/* +* Source obj size could be smaller than the dst obj size, +* due to the varying min_page_size of the mem regions the +* obj belongs to. But when we insert the pages into vm, +* the total size of the pages supposed to be multiples of +* the min page size of that mem region. +*/ + size =ALIGN (cur_win_sz, dst->mm.region->min_page_size) >> +PAGE_SHIFT ; +intel_partial_pages_for_sg_table (dst, dst_vma->pages, offset, + size, &last_sgl); + + dst_vma->size = size <<PAGE_SHIFT ; +i915_insert_vma_pages (dst_vma, dst_is_lmem); +sg_unmark_end (last_sgl); + + rq =i915_request_create (ce); +if (IS_ERR (rq)) { + err =PTR_ERR (rq); +break ; + } +if (rq->engine->emit_init_breadcrumb) { + err = rq->engine->emit_init_breadcrumb (rq); +if (unlikely (err)) { +DRM_ERROR ("init_breadcrumb failed. %d\n" , err); +break ; + } + } + err =i915_window_blt_copy_batch_prepare (rq, src_vma, dst_vma, + cur_win_sz); +if (err) { +DRM_ERROR ("Batch preparation failed. %d\n" , err); +i915_request_set_error_once (rq, -EIO ); + } + +i915_request_get (rq); +i915_request_add (rq); + + timeout =i915_request_wait (rq,0 ,MAX_SCHEDULE_TIMEOUT ); +if (timeout <0 ) { +DRM_ERROR ("BLT Request is not completed. %ld\n" , + timeout); + err = timeout; +i915_request_put (rq); +break ; + } + + blt_copied += cur_win_sz; + err =0 ; +i915_request_put (rq); +flush_work (&i915->gt.engine[BCS0 ]->retire_work); + }while (src->base.size != blt_copied); + + src_vma->size =BLT_WINDOW_SZ ; + dst_vma->size =BLT_WINDOW_SZ ; + src_vma->obj =NULL ; + dst_vma->obj =NULL ; +mutex_unlock (&i915->mm.window_mutex); + + dst->mm.dirty = true; +i915_gem_object_unpin_pages (src); +i915_gem_object_unpin_pages (dst); + +return err; +} +#if IS_ENABLED (CONFIG_DRM_I915_SELFTEST )#include "selftests/huge_gem_object.c" #include "selftests/huge_pages.c"
drivers/gpu/drm/i915/gem/i915_gem_object.h +5 -0
@@ -598,4 +598,9 @@ static inline int i915_gem_object_userptr_submit_done(struct drm_i915_gem_objectstatic inline void i915_gem_object_userptr_submit_fini (struct drm_i915_gem_object *obj) {GEM_BUG_ON (1 ); }#endif +int i915_window_blt_copy (struct drm_i915_gem_object *dst, +struct drm_i915_gem_object *src); +int i915_setup_blt_windows (struct drm_i915_private *i915); +void i915_teardown_blt_windows (struct drm_i915_private *i915); +#endif
drivers/gpu/drm/i915/i915_drv.c +11 -0
@@ -891,6 +891,12 @@ int i915_driver_probe(struct pci_dev *pdev, const struct pci_device_id *ent)i915_driver_register (i915); +if (HAS_LMEM (i915)) { + ret =i915_setup_blt_windows (i915); +if (ret) + goto out_cleanup_drv_register; + } +enable_rpm_wakeref_asserts (&i915->runtime_pm);i915_welcome_messages (i915);
@@ -899,6 +905,8 @@ int i915_driver_probe(struct pci_dev *pdev, const struct pci_device_id *ent)return 0 ; +out_cleanup_drv_register: +i915_driver_unregister (i915); out_cleanup_gem:i915_gem_suspend (i915);i915_gem_driver_remove (i915);
@@ -931,6 +939,9 @@ int i915_driver_probe(struct pci_dev *pdev, const struct pci_device_id *ent)void i915_driver_remove (struct drm_i915_private *i915) { +if (HAS_LMEM (i915)) +i915_teardown_blt_windows (i915); +disable_rpm_wakeref_asserts (&i915->runtime_pm);i915_driver_unregister (i915);
drivers/gpu/drm/i915/i915_drv.h +6 -0
@@ -595,6 +595,12 @@ struct i915_gem_mm {/* shrinker accounting, also useful for userland debugging */ u64 shrink_memory;u32 shrink_count; + +struct i915_vma *lmem_window[2 ]; +struct i915_vma *smem_window[2 ]; + +/* To protect above two set of vmas */ +struct mutex window_mutex; };#define I915_IDLE_ENGINES_TIMEOUT (200)/* in ms */
Signature · 6 lines
2.26.2 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [Intel-gfx] [RFC PATCH 137/162] drm/i915: blt copy between objs using pre-created vma windows
Quoting Matthew Auld (2020-11-27 12:06:53)
Quoted 86 lines
drivers/gpu/drm/i915/gem/i915_gem_object.c +86
-0+int i915_window_blt_copy(struct drm_i915_gem_object *dst, + struct drm_i915_gem_object *src) +{ + struct drm_i915_private *i915 = to_i915(src->base.dev); + struct intel_context *ce = i915->gt.engine[BCS0]->blitter_context; + bool src_is_lmem = i915_gem_object_is_lmem(src); + bool dst_is_lmem = i915_gem_object_is_lmem(dst); + struct scatterlist *last_sgl; + struct i915_vma *src_vma, *dst_vma; + struct i915_request *rq; + u64 cur_win_sz, blt_copied, offset; + long timeout; + u32 size; + int err; + + src_vma = src_is_lmem ? i915->mm.lmem_window[0] : + i915->mm.smem_window[0]; + dst_vma = dst_is_lmem ? i915->mm.lmem_window[1] : + i915->mm.smem_window[1]; + + if (!src_vma || !dst_vma) + return -ENODEV; + + blt_copied = 0; + + err = i915_window_blt_copy_prepare_obj(src); + if (err) + return err; + + err = i915_window_blt_copy_prepare_obj(dst); + if (err) { + i915_gem_object_unpin_pages(src); + return err; + } + + mutex_lock(&i915->mm.window_mutex); + src_vma->obj = src; + dst_vma->obj = dst; + do { + cur_win_sz = min_t(u64, BLT_WINDOW_SZ, + (src->base.size - blt_copied)); + offset = blt_copied >> PAGE_SHIFT; + size = ALIGN(cur_win_sz, src->mm.region->min_page_size) >> + PAGE_SHIFT; + intel_partial_pages_for_sg_table(src, src_vma->pages, offset, + size, &last_sgl); + + /* + * Insert pages into vm, expects the pages to the full + * length of VMA. But we may have the pages of <= vma_size. + * Hence altering the vma size to match the total size of + * the pages attached. + */ + src_vma->size = size << PAGE_SHIFT; + i915_insert_vma_pages(src_vma, src_is_lmem); + sg_unmark_end(last_sgl); + + /* + * Source obj size could be smaller than the dst obj size, + * due to the varying min_page_size of the mem regions the + * obj belongs to. But when we insert the pages into vm, + * the total size of the pages supposed to be multiples of + * the min page size of that mem region. + */ + size = ALIGN(cur_win_sz, dst->mm.region->min_page_size) >> + PAGE_SHIFT; + intel_partial_pages_for_sg_table(dst, dst_vma->pages, offset, + size, &last_sgl); + + dst_vma->size = size << PAGE_SHIFT; + i915_insert_vma_pages(dst_vma, dst_is_lmem); + sg_unmark_end(last_sgl); + + rq = i915_request_create(ce); + if (IS_ERR(rq)) { + err = PTR_ERR(rq); + break; + } + if (rq->engine->emit_init_breadcrumb) { + err = rq->engine->emit_init_breadcrumb(rq); + if (unlikely(err)) { + DRM_ERROR("init_breadcrumb failed. %d\n", err); + break; + } + } + err = i915_window_blt_copy_batch_prepare(rq, src_vma, dst_vma,
drivers/gpu/drm/i915/gem/i915_gem_object.c static const struct drm_gem_object_funcs i915_gem_object_funcs = { · line 1048
Quoted 10 lines
drivers/gpu/drm/i915/gem/i915_gem_object.c +10
-0+ cur_win_sz); +if (err) { +DRM_ERROR ("Batch preparation failed. %d\n" , err); +i915_request_set_error_once (rq, -EIO ); + } + +i915_request_get (rq); +i915_request_add (rq); + + timeout =i915_request_wait (rq,0 ,MAX_SCHEDULE_TIMEOUT );
Locked waits.
drivers/gpu/drm/i915/gem/i915_gem_object.c static const struct drm_gem_object_funcs i915_gem_object_funcs = { · line 1060
Quoted 12 lines
drivers/gpu/drm/i915/gem/i915_gem_object.c +12
-0+if (timeout <0 ) { +DRM_ERROR ("BLT Request is not completed. %ld\n" , + timeout); + err = timeout; +i915_request_put (rq); +break ; + } + + blt_copied += cur_win_sz; + err =0 ; +i915_request_put (rq); +flush_work (&i915->gt.engine[BCS0 ]->retire_work);
Papering (doubtful the paper is successful) over bugs by introducing a whole load more.
This fails the basic premise that eviction must be pipelined. The PTE are transient and can be written prior to the copy and kept within the non-preemptible window of the blt. Thus allowing many evictions to scheduled in parallel (by either allocating separate contexts, or more preferably picking a user context).
-Chris
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
RFC PATCH 138/162 drm/i915/dg1: Eliminate eviction mutex
In reply to Matthew AuldFrom: Tvrtko Ursulin <[email protected]>
We can eliminate the current evict window mutex, held over the whole eviction process, and replace it with a wait queue which takes over the role of co-ordinating access to pre-configured window copy vmas.
Apart from the global lock not being held over whole of the copy, additional benefit is that, since we have two pairs of copy windows, two evict operations can now progress independently. (One swap-in plus one swap-out.)
Also consolidate some of the eviction code into helper functions for readability and fix cleanup if emit_init_breadcrumb fails.
--- drivers/gpu/drm/i915/gem/i915_gem_object.c | 144 ++++++++++++--------- drivers/gpu/drm/i915/i915_drv.h | 2 +- 2 files changed, 85 insertions(+), 61 deletions(-)
drivers/gpu/drm/i915/gem/i915_gem_object.c +84 -60
@@ -856,7 +856,8 @@ int i915_setup_blt_windows(struct drm_i915_private *i915)return 0 ; } -mutex_init (&i915->mm.window_mutex); +init_waitqueue_head (&i915->mm.window_queue); +for (i =0 ; i <ARRAY_SIZE (lmem); i++) { lmem[i] =i915_window_vma_init (i915, lmem_region);if (IS_ERR_OR_NULL (lmem[i])) {
@@ -904,7 +905,6 @@ void i915_teardown_blt_windows(struct drm_i915_private *i915)continue ;i915_window_vma_teardown (i915->mm.smem_window[i]); } -mutex_destroy (&i915->mm.window_mutex); }static int i915_window_blt_copy_prepare_obj (struct drm_i915_gem_object *obj)
@@ -950,6 +950,36 @@ i915_window_blt_copy_batch_prepare(struct i915_request *rq,return 0 ; } +static void prepare_vma (struct i915_vma *vma, +struct drm_i915_gem_object *obj, +u32 offset, +u32 chunk, +bool is_lmem) +{ +struct scatterlist *sgl; +u32 size; + +/* +* Source obj size could be smaller than the dst obj size, +* due to the varying min_page_size of the mem regions the +* obj belongs to. But when we insert the pages into vm, +* the total size of the pages supposed to be multiples of +* the min page size of that mem region. +*/ + size =ALIGN (chunk, obj->mm.region->min_page_size) >>PAGE_SHIFT ; +intel_partial_pages_for_sg_table (obj, vma->pages, offset, size, &sgl); + +/* +* Insert pages into vm, expects the pages to the full +* length of VMA. But we may have the pages of <= vma_size. +* Hence altering the vma size to match the total size of +* the pages attached. +*/ + vma->size = size <<PAGE_SHIFT ; +i915_insert_vma_pages (vma, is_lmem); +sg_unmark_end (sgl); +} +int i915_window_blt_copy (struct drm_i915_gem_object *dst,struct drm_i915_gem_object *src) {
@@ -957,24 +987,10 @@ int i915_window_blt_copy(struct drm_i915_gem_object *dst,struct intel_context *ce = i915->gt.engine[BCS0 ]->blitter_context;bool src_is_lmem =i915_gem_object_is_lmem (src);bool dst_is_lmem =i915_gem_object_is_lmem (dst); -struct scatterlist *last_sgl; -struct i915_vma *src_vma, *dst_vma; -struct i915_request *rq; -u64 cur_win_sz, blt_copied, offset; -long timeout; -u32 size; +u64 remain = src->base.size, offset =0 ; +struct i915_vma *src_vma, *dst_vma, **ps, **pd;int err; - src_vma = src_is_lmem ? i915->mm.lmem_window[0 ] : - i915->mm.smem_window[0 ]; - dst_vma = dst_is_lmem ? i915->mm.lmem_window[1 ] : - i915->mm.smem_window[1 ]; - -if (!src_vma || !dst_vma) -return -ENODEV ; - - blt_copied =0 ; - err =i915_window_blt_copy_prepare_obj (src);if (err)return err;
@@ -985,43 +1001,42 @@ int i915_window_blt_copy(struct drm_i915_gem_object *dst,return err; } -mutex_lock (&i915->mm.window_mutex); + ps = src_is_lmem ? &i915->mm.lmem_window[0 ] : + &i915->mm.smem_window[0 ]; + pd = dst_is_lmem ? &i915->mm.lmem_window[1 ] : + &i915->mm.smem_window[1 ]; + +spin_lock (&i915->mm.window_queue.lock); + + err =wait_event_interruptible_locked (i915->mm.window_queue, + *ps && *pd); +if (err) { +spin_unlock (&i915->mm.window_queue.lock); +i915_gem_object_unpin_pages (src); +i915_gem_object_unpin_pages (dst); +return err; + } + + src_vma = *ps; + dst_vma = *pd; + src_vma->obj = src; dst_vma->obj = dst; - do { - cur_win_sz = min_t(u64, BLT_WINDOW_SZ, - (src->base.size - blt_copied)); - offset = blt_copied >> PAGE_SHIFT; - size = ALIGN(cur_win_sz, src->mm.region->min_page_size) >> - PAGE_SHIFT; - intel_partial_pages_for_sg_table(src, src_vma->pages, offset, - size, &last_sgl); - /* - * Insert pages into vm, expects the pages to the full - * length of VMA. But we may have the pages of <= vma_size. - * Hence altering the vma size to match the total size of - * the pages attached. - */ - src_vma->size = size << PAGE_SHIFT; - i915_insert_vma_pages(src_vma, src_is_lmem); - sg_unmark_end(last_sgl); + *ps =NULL ; + *pd =NULL ; - /* - * Source obj size could be smaller than the dst obj size, - * due to the varying min_page_size of the mem regions the - * obj belongs to. But when we insert the pages into vm, - * the total size of the pages supposed to be multiples of - * the min page size of that mem region. - */ - size = ALIGN(cur_win_sz, dst->mm.region->min_page_size) >> - PAGE_SHIFT; - intel_partial_pages_for_sg_table(dst, dst_vma->pages, offset, - size, &last_sgl); +spin_unlock (&i915->mm.window_queue.lock); + + do { + struct i915_request *rq; + long timeout; + u32 chunk; - dst_vma->size = size << PAGE_SHIFT; - i915_insert_vma_pages(dst_vma, dst_is_lmem); - sg_unmark_end(last_sgl); + chunk = min_t(u64, BLT_WINDOW_SZ, remain); + + prepare_vma(src_vma, src, offset, chunk, src_is_lmem); + prepare_vma(dst_vma, dst, offset, chunk, dst_is_lmem); rq = i915_request_create(ce); if (IS_ERR(rq)) {
@@ -1032,11 +1047,14 @@ int i915_window_blt_copy(struct drm_i915_gem_object *dst, err = rq->engine->emit_init_breadcrumb (rq);if (unlikely (err)) {DRM_ERROR ("init_breadcrumb failed. %d\n" , err); +i915_request_set_error_once (rq, err); +__i915_request_skip (rq); +i915_request_add (rq);break ; } } err =i915_window_blt_copy_batch_prepare (rq, src_vma, dst_vma, - cur_win_sz); + chunk);if (err) {DRM_ERROR ("Batch preparation failed. %d\n" , err);i915_request_set_error_once (rq, -EIO );
@@ -1045,26 +1063,32 @@ int i915_window_blt_copy(struct drm_i915_gem_object *dst,i915_request_get (rq);i915_request_add (rq); - timeout =i915_request_wait (rq,0 ,MAX_SCHEDULE_TIMEOUT ); -if (timeout <0 ) { +if (!err) + timeout =i915_request_wait (rq,0 , +MAX_SCHEDULE_TIMEOUT ); +i915_request_put (rq); +if (!err && timeout <0 ) {DRM_ERROR ("BLT Request is not completed. %ld\n" , timeout); err = timeout; -i915_request_put (rq);break ; } - blt_copied += cur_win_sz; - err =0 ; -i915_request_put (rq); -flush_work (&i915->gt.engine[BCS0 ]->retire_work); - }while (src->base.size != blt_copied); + remain -= chunk; + offset += chunk >>PAGE_SHIFT ; + +flush_work (&ce->engine->retire_work); + }while (remain); +spin_lock (&i915->mm.window_queue.lock); src_vma->size =BLT_WINDOW_SZ ; dst_vma->size =BLT_WINDOW_SZ ; src_vma->obj =NULL ; dst_vma->obj =NULL ; -mutex_unlock (&i915->mm.window_mutex); + *ps = src_vma; + *pd = dst_vma; +wake_up_locked (&i915->mm.window_queue); +spin_unlock (&i915->mm.window_queue.lock); dst->mm.dirty = true;i915_gem_object_unpin_pages (src);
drivers/gpu/drm/i915/i915_drv.h +1 -1
@@ -600,7 +600,7 @@ struct i915_gem_mm {struct i915_vma *smem_window[2 ];/* To protect above two set of vmas */ -struct mutex window_mutex; +wait_queue_head_t window_queue; };#define I915_IDLE_ENGINES_TIMEOUT (200)/* in ms */
Signature · 6 lines
2.26.2 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
RFC PATCH 139/162 drm/i915/dg1: Keep engine awake across whole blit
In reply to Matthew AuldFrom: Tvrtko Ursulin <[email protected]>
Hold blitter engine power reference across the whole copy operation for efficiency.
--- drivers/gpu/drm/i915/gem/i915_gem_object.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/gpu/drm/i915/gem/i915_gem_object.c +4 -0
@@ -1028,6 +1028,8 @@ int i915_window_blt_copy(struct drm_i915_gem_object *dst,spin_unlock (&i915->mm.window_queue.lock); +intel_engine_pm_get (ce->engine); + do { struct i915_request *rq; long timeout;
@@ -1080,6 +1082,8 @@ int i915_window_blt_copy(struct drm_i915_gem_object *dst,flush_work (&ce->engine->retire_work); }while (remain); +intel_engine_pm_put (ce->engine); +spin_lock (&i915->mm.window_queue.lock); src_vma->size =BLT_WINDOW_SZ ; dst_vma->size =BLT_WINDOW_SZ ;
Signature · 6 lines
2.26.2 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
RFC PATCH 140/162 drm/i915: window_blt_copy is used for swapin and swapout
In reply to Matthew AuldFrom: Ramalingam C <[email protected]>
window_blt_copy feature is used for swapin and swapout based on the i915 module parameter called enable_eviction.
--- drivers/gpu/drm/i915/gem/i915_gem_region.c | 14 ++++++++++---- drivers/gpu/drm/i915/i915_drv.c | 4 ++-- drivers/gpu/drm/i915/i915_params.c | 6 ++++-- drivers/gpu/drm/i915/i915_params.h | 2 +- 4 files changed, 17 insertions(+), 9 deletions(-)
drivers/gpu/drm/i915/gem/i915_gem_region.c +10 -4
@@ -16,7 +16,7 @@ i915_gem_object_swapout_pages(struct drm_i915_gem_object *obj,struct drm_i915_private *i915 =to_i915 (obj->base.dev);struct drm_i915_gem_object *dst, *src;unsigned long start, diff, msec; -int err; +int err = -EINVAL ;GEM_BUG_ON (obj->swapto);GEM_BUG_ON (i915_gem_object_has_pages (obj));
@@ -54,7 +54,10 @@ i915_gem_object_swapout_pages(struct drm_i915_gem_object *obj,__i915_gem_object_pin_pages (src);/* copying the pages */ - err =i915_gem_object_memcpy (dst, src); +if (i915->params.enable_eviction >=2 ) + err =i915_window_blt_copy (dst, src); +if (err && i915->params.enable_eviction !=2 ) + err =i915_gem_object_memcpy (dst, src);__i915_gem_object_unpin_pages (src);__i915_gem_object_unset_pages (src);
@@ -83,7 +86,7 @@ i915_gem_object_swapin_pages(struct drm_i915_gem_object *obj,struct drm_i915_private *i915 =to_i915 (obj->base.dev);struct drm_i915_gem_object *dst, *src;unsigned long start, diff, msec; -int err; +int err = -EINVAL ;GEM_BUG_ON (!obj->swapto);GEM_BUG_ON (i915_gem_object_has_pages (obj));
@@ -117,7 +120,10 @@ i915_gem_object_swapin_pages(struct drm_i915_gem_object *obj,__i915_gem_object_pin_pages (dst);/* copying the pages */ - err =i915_gem_object_memcpy (dst, src); +if (i915->params.enable_eviction >=2 ) + err =i915_window_blt_copy (dst, src); +if (err && i915->params.enable_eviction !=2 ) + err =i915_gem_object_memcpy (dst, src);__i915_gem_object_unpin_pages (dst);__i915_gem_object_unset_pages (dst);
drivers/gpu/drm/i915/i915_drv.c +2 -2
@@ -891,7 +891,7 @@ int i915_driver_probe(struct pci_dev *pdev, const struct pci_device_id *ent)i915_driver_register (i915); -if (HAS_LMEM (i915)) { +if (HAS_LMEM (i915) && i915->params.enable_eviction >=2 ) { ret =i915_setup_blt_windows (i915);if (ret) goto out_cleanup_drv_register;
@@ -939,7 +939,7 @@ int i915_driver_probe(struct pci_dev *pdev, const struct pci_device_id *ent)void i915_driver_remove (struct drm_i915_private *i915) { -if (HAS_LMEM (i915)) +if (HAS_LMEM (i915) && i915->params.enable_eviction >=2 )i915_teardown_blt_windows (i915);disable_rpm_wakeref_asserts (&i915->runtime_pm);
drivers/gpu/drm/i915/i915_params.c +4 -2
@@ -197,8 +197,10 @@ i915_param_named_unsafe(fake_lmem_start, ulong, 0400, "Fake LMEM start offset (default: 0)");#endif -i915_param_named_unsafe (enable_eviction, bool,0600 , -"Enable memcpy based eviction which does not rely on DMA resv refactoring)" ); +i915_param_named_unsafe (enable_eviction, uint,0600 , +"Enable eviction which does not rely on DMA resv refactoring " +"0=disabled, 1=memcpy based only, 2=blt based only, " +"3=blt based but fallsback to memcpy based [default])" );i915_param_named_unsafe (lmem_size, uint,0400 ,"Change lmem size for each region. (default: 0, all memory)" );
drivers/gpu/drm/i915/i915_params.h +1 -1
@@ -72,8 +72,8 @@ struct drm_printer; param(char *, force_probe, CONFIG_DRM_I915_FORCE_PROBE, 0400) \ param(unsigned long, fake_lmem_start, 0, 0400) \ param(unsigned int, lmem_size, 0, 0400) \ + param(unsigned int, enable_eviction, 3, 0600) \/* leave bools at the end to not create holes */ \ - param(bool, enable_eviction, true, 0600) \ param(bool, enable_hangcheck, true, 0600) \ param(bool, load_detect_test, false, 0600) \param (bool, force_reset_modeset_test, false,0600 ) \
Signature · 6 lines
2.26.2 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [Intel-gfx] [RFC PATCH 140/162] drm/i915: window_blt_copy is used for swapin and swapout
Quoting Matthew Auld (2020-11-27 12:06:56)
Quoted 4 lines
From: Ramalingam C <[email protected]>
window_blt_copyfeature is used for swapin and swapout based on the i915 module parameter calledenable_eviction.
A module parameter?
-Chris
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
RFC PATCH 141/162 drm/i915: Lmem eviction statistics by category
In reply to Matthew AuldFrom: Ramalingam C <[email protected]>
Number of bytes swapped in and out are captured for both blitter and memcpy based evictions with time taken for the process.
Debugfs is extended to provide the eviction statistics through both methods with rate of transfer.
--- drivers/gpu/drm/i915/gem/i915_gem_region.c | 32 +++++++++++++--- drivers/gpu/drm/i915/i915_debugfs.c | 43 +++++++++++++++++++--- drivers/gpu/drm/i915/i915_drv.h | 5 +++ 3 files changed, 68 insertions(+), 12 deletions(-)
drivers/gpu/drm/i915/gem/i915_gem_region.c +26 -6
@@ -16,6 +16,7 @@ i915_gem_object_swapout_pages(struct drm_i915_gem_object *obj,struct drm_i915_private *i915 =to_i915 (obj->base.dev);struct drm_i915_gem_object *dst, *src;unsigned long start, diff, msec; +bool blt_completed = false;int err = -EINVAL ;GEM_BUG_ON (obj->swapto);
@@ -54,8 +55,11 @@ i915_gem_object_swapout_pages(struct drm_i915_gem_object *obj,__i915_gem_object_pin_pages (src);/* copying the pages */ -if (i915->params.enable_eviction >=2 ) +if (i915->params.enable_eviction >=2 ) { err =i915_window_blt_copy (dst, src); +if (!err) + blt_completed = true; + }if (err && i915->params.enable_eviction !=2 ) err =i915_gem_object_memcpy (dst, src);
@@ -72,8 +76,14 @@ i915_gem_object_swapout_pages(struct drm_i915_gem_object *obj,if (!err) { diff = jiffies - start; msec = diff *1000 /HZ ; -atomic_long_add (msec, &i915->time_swap_out_ms); -atomic_long_add (sizes, &i915->num_bytes_swapped_out); +if (blt_completed) { +atomic_long_add (sizes, &i915->num_bytes_swapped_out); +atomic_long_add (msec, &i915->time_swap_out_ms); + }else { +atomic_long_add (sizes, + &i915->num_bytes_swapped_out_memcpy); +atomic_long_add (msec, &i915->time_swap_out_ms_memcpy); + } }return err;
@@ -86,6 +96,7 @@ i915_gem_object_swapin_pages(struct drm_i915_gem_object *obj,struct drm_i915_private *i915 =to_i915 (obj->base.dev);struct drm_i915_gem_object *dst, *src;unsigned long start, diff, msec; +bool blt_completed = false;int err = -EINVAL ;GEM_BUG_ON (!obj->swapto);
@@ -120,8 +131,11 @@ i915_gem_object_swapin_pages(struct drm_i915_gem_object *obj,__i915_gem_object_pin_pages (dst);/* copying the pages */ -if (i915->params.enable_eviction >=2 ) +if (i915->params.enable_eviction >=2 ) { err =i915_window_blt_copy (dst, src); +if (!err) + blt_completed = true; + }if (err && i915->params.enable_eviction !=2 ) err =i915_gem_object_memcpy (dst, src);
@@ -138,8 +152,14 @@ i915_gem_object_swapin_pages(struct drm_i915_gem_object *obj,if (!err) { diff = jiffies - start; msec = diff *1000 /HZ ; -atomic_long_add (msec, &i915->time_swap_in_ms); -atomic_long_add (sizes, &i915->num_bytes_swapped_in); +if (blt_completed) { +atomic_long_add (sizes, &i915->num_bytes_swapped_in); +atomic_long_add (msec, &i915->time_swap_in_ms); + }else { +atomic_long_add (sizes, + &i915->num_bytes_swapped_in_memcpy); +atomic_long_add (msec, &i915->time_swap_in_ms_memcpy); + } }return err;
drivers/gpu/drm/i915/i915_debugfs.c +37 -6
55 lines not on this page · raw message
drivers/gpu/drm/i915/i915_drv.h +5 -0
@@ -1225,6 +1225,11 @@ struct drm_i915_private {atomic_long_t num_bytes_swapped_in;atomic_long_t time_swap_out_ms;atomic_long_t time_swap_in_ms; + +atomic_long_t num_bytes_swapped_out_memcpy; +atomic_long_t num_bytes_swapped_in_memcpy; +atomic_long_t time_swap_out_ms_memcpy; +atomic_long_t time_swap_in_ms_memcpy; };static inline struct drm_i915_private *to_i915 (const struct drm_device *dev)
Signature · 6 lines
2.26.2 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [Intel-gfx] [RFC PATCH 141/162] drm/i915: Lmem eviction statistics by category
Quoting Matthew Auld (2020-11-27 12:06:57)
drivers/gpu/drm/i915/i915_drv.h struct drm_i915_private { · line 1232
Quoted 13 lines
drivers/gpu/drm/i915/i915_drv.h +5
-0@@ -1225,6 +1225,11 @@ struct drm_i915_private {atomic_long_t num_bytes_swapped_in;atomic_long_t time_swap_out_ms;atomic_long_t time_swap_in_ms; + +atomic_long_t num_bytes_swapped_out_memcpy; +atomic_long_t num_bytes_swapped_in_memcpy; +atomic_long_t time_swap_out_ms_memcpy; +atomic_long_t time_swap_in_ms_memcpy;
See earlier comments about why this will be rejected. -Chris
_______________________________________________
dri-devel mailing list [email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
RFC PATCH 142/162 drm/i915/gem/selftest: test and measure window based blt cpy
In reply to Matthew AuldFrom: Ramalingam C <[email protected]>
Selftest live_blt_evict is written to create an lmem and smem objects and copy lmem into smem obj using the window based blt copy used for lmem eviction.
And we test for range of object size from 4K to 64M with different usecase scenario w.r.t to window size.
--- .../i915/gem/selftests/i915_gem_object_blt.c | 166 ++++++++++++++++++ .../drm/i915/selftests/i915_live_selftests.h | 1 + 2 files changed, 167 insertions(+)
drivers/gpu/drm/i915/gem/selftests/i915_gem_object_blt.c +166 -0
@@ -16,6 +16,7 @@#include "selftests/mock_drm.h" #include "huge_gem_object.h" #include "mock_context.h" +#include "gem/i915_gem_region.h" static int wrap_ktime_compare (const void *A ,const void *B ) {
@@ -568,6 +569,171 @@ static int igt_copy_blt_ctx0(void *arg)return test_copy_engines (arg, igt_copy_blt_thread,SINGLE_CTX ); } +static int __igt_obj_window_blt_copy (struct drm_i915_private *i915, +struct intel_memory_region *src_mem, +struct intel_memory_region *dst_mem, +u64 size) +{ +struct drm_i915_gem_object *src, *dst; +ktime_t t0, t1; +u32 *vaddr, i; +int err; + + src =i915_gem_object_create_region (src_mem, size,0 ); +if (IS_ERR (src)) { + err =PTR_ERR (src); + goto err; + } + size =max_t (u64, size, src->base.size); +i915_gem_object_lock_isolated (src); + + dst =i915_gem_object_create_region (dst_mem, size,0 ); +if (IS_ERR (dst)) { + err =PTR_ERR (dst); + goto err_put_src; + } + +i915_gem_object_lock_isolated (dst); + + vaddr =i915_gem_object_pin_map (src, +i915_coherent_map_type (i915, src, true)); +if (IS_ERR (vaddr)) { + err =PTR_ERR (vaddr); +pr_err ("Failed at pin map of src. %d\n" , err); + goto err_put_dst; + } + +for (i =0 ; i < size /sizeof (u32); i++) + vaddr[i] = i; + +if (!(src->cache_coherent &I915_BO_CACHE_COHERENT_FOR_READ )) + src->cache_dirty = true; + + vaddr =i915_gem_object_pin_map (dst, +i915_coherent_map_type (i915, dst, true)); +if (IS_ERR (vaddr)) { + err =PTR_ERR (vaddr); +pr_err ("Failed at pin map of dst. %d\n" , err); + goto err_unpin_src; + } +memset32 (vaddr,0xdeadbeaf , size /sizeof (u32)); + +if (!(dst->cache_coherent &I915_BO_CACHE_COHERENT_FOR_WRITE )) + dst->cache_dirty = true; + +/* +* FIXME: Blitter based eviction is failing occasionally due to +* trylock approach. To avoid the selftest failure due to trylocks, +* we are adding retries with a delay inn between. +* Retry count and delay are fixed on trial and error basis. +* As soon as trylocks are removed from blt eviction, we should +* remove this retry attempts. +*/ +#define WINDOW_BLT_COPY_RETRY 3 +for (i =0 ; i <=WINDOW_BLT_COPY_RETRY ; i++) { + t0 =ktime_get (); + err =i915_window_blt_copy (dst, src); +if (err == -EBUSY ) +msleep (1 ); +else +break ; + } + +if (err) + goto err_unpin_dst; + + t1 =ktime_sub (ktime_get (), t0); +pr_info ("blt of %zd KiB at %lld MiB/s\n" , src->base.size >>10 , +div64_u64 (mul_u32_u32 (src->base.size,1000 *1000 *1000 ), + t1) >>20 ); + +for (i =0 ; i < size /sizeof (u32); i +=17 ) { +if (!(dst->cache_coherent &I915_BO_CACHE_COHERENT_FOR_READ )) +drm_clflush_virt_range (&vaddr[i],sizeof (vaddr[i])); + +if (vaddr[i] != i) { +pr_err ("vaddr[%u]=%x, expected=%x\n" , i, + vaddr[i], i); + err = -EINVAL ; + goto err_unpin_dst; + } + } + +err_unpin_dst: +i915_gem_object_unpin_map (dst); +err_unpin_src: +i915_gem_object_unpin_map (src); +err_put_dst: +i915_gem_object_unlock (dst); +i915_gem_object_put (dst); +err_put_src: +i915_gem_object_unlock (src); +i915_gem_object_put (src); +err: +if (err == -ENODEV ) + err =0 ; +return err; +} + +static int igt_obj_window_blt_copy (void *data) +{ +struct drm_i915_private *i915 = data; +u64 size[] = {SZ_2K ,SZ_4K ,SZ_64K ,SZ_4M ,SZ_8M +SZ_2K ,SZ_64M }; +struct intel_memory_region *lmem = +intel_memory_region_by_type (i915,INTEL_MEMORY_LOCAL ); +struct intel_memory_region *smem = +intel_memory_region_by_type (i915,INTEL_MEMORY_SYSTEM ); +int i, ret; + +for (i =0 ; i <ARRAY_SIZE (size); i++) { + ret =__igt_obj_window_blt_copy (i915, lmem, lmem, size[i]); +if (ret <0 ) { +pr_err ("%s: Failed at lmem->lmem size: %llu, err: %d\n" , + __func__, size[i], ret); +break ; + } + ret =__igt_obj_window_blt_copy (i915, smem, smem, size[i]); +if (ret <0 ) { +pr_err ("%s: Failed at smem->smem size: %llu, err: %d\n" , + __func__, size[i], ret); +break ; + } + ret =__igt_obj_window_blt_copy (i915, lmem, smem, size[i]); +if (ret <0 ) { +pr_err ("%s: Failed at lmem->smem size: %llu, err: %d\n" , + __func__, size[i], ret); +break ; + } + + ret =__igt_obj_window_blt_copy (i915, smem, lmem, size[i]); +if (ret <0 ) { +pr_err ("%s: Failed at smem->lmem size: %llu, err: %d\n" , + __func__, size[i], ret); +break ; + } + } + +return ret; +} + +int i915_obj_window_blt_copy_live_selftests (struct drm_i915_private *i915) +{ +static const struct i915_subtest tests[] = { +SUBTEST (igt_obj_window_blt_copy), + }; + +if (intel_gt_is_wedged (&i915->gt)) +return 0 ; + +if (!HAS_ENGINE (&i915->gt,BCS0 )) +return 0 ; + +if (!HAS_LMEM (i915)) +return 0 ; + +return i915_live_subtests (tests, i915); +} +int i915_gem_object_blt_live_selftests (struct drm_i915_private *i915) {static const struct i915_subtest tests[] = {
drivers/gpu/drm/i915/selftests/i915_live_selftests.h +1 -0
@@ -39,6 +39,7 @@ selftest(hugepages, i915_gem_huge_page_live_selftests) selftest(gem_contexts, i915_gem_context_live_selftests) selftest(gem_execbuf, i915_gem_execbuffer_live_selftests) selftest(blt, i915_gem_object_blt_live_selftests) +selftest(win_blt_copy, i915_obj_window_blt_copy_live_selftests) selftest(client, i915_gem_client_blt_live_selftests) selftest(reset, intel_reset_live_selftests)selftest (memory_region, intel_memory_region_live_selftests)
Signature · 6 lines
2.26.2 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
RFC PATCH 143/162 drm/i915: suspend/resume eviction
In reply to Matthew AuldFrom: Venkata Ramana Nayana <[email protected]>
As the initial phase of implementation, when the system in idle, copying the user objects from LMEM to SMEM during suspend and restoring back in resume. In present implementation using memcpy based eviction during swapout/swapin of objects. To test the functionality, suspend is initiated as part of igt application.
--- .../gpu/drm/i915/gem/i915_gem_object_types.h | 3 + drivers/gpu/drm/i915/i915_drv.c | 83 +++++++++++++++++++ 2 files changed, 86 insertions(+)
drivers/gpu/drm/i915/gem/i915_gem_object_types.h +3 -0
@@ -322,6 +322,9 @@ struct drm_i915_gem_object {*/ bool do_swapping;struct drm_i915_gem_object *swapto; + +/** mark evicted object during suspend */ +bool evicted; }; static inline struct drm_i915_gem_object *
drivers/gpu/drm/i915/i915_drv.c +83 -0
106 lines not on this page · raw message
Signature · 6 lines
2.26.2 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [RFC PATCH 143/162] drm/i915: suspend/resume eviction
Quoting Matthew Auld (2020-11-27 12:06:59)
drivers/gpu/drm/i915/i915_drv.c static int i915_drm_prepare(struct drm_device *dev) · line 1116
Quoted 12 lines
drivers/gpu/drm/i915/i915_drv.c +12
-0+static int intel_dmem_evict_buffers (struct drm_device *dev,bool in_suspend) +{ +struct drm_i915_private *i915 =to_i915 (dev); +struct drm_i915_gem_object *obj; +struct intel_memory_region *mem; +int id, ret =0 ; + +/* +* FIXME: Presently using memcpy, +* will replace with blitter once +* fix the issues. +*/
Why hasn't it been fixed then?
-Chris
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
RFC PATCH 144/162 drm/i915: Reset blitter context when unpark engine
In reply to Matthew AuldFrom: Venkata Ramana Nayana <[email protected]>
We are only doing it now for kernel_context. We also need to do for the copy engine blitter context.
--- drivers/gpu/drm/i915/gt/intel_engine_pm.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/gpu/drm/i915/gt/intel_engine_pm.c +5 -0
@@ -66,6 +66,11 @@ static int __engine_unpark(struct intel_wakeref *wf) ce->ops->reset (ce); } +if (engine->class ==COPY_ENGINE_CLASS ) { + ce = engine->blitter_context; + ce->ops->reset (ce); + } +if (engine->unpark) engine->unpark (engine);
Signature · 6 lines
2.26.2 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [RFC PATCH 144/162] drm/i915: Reset blitter context when unpark engine
Quoting Matthew Auld (2020-11-27 12:07:00)
Quoted 15 lines
From: Venkata Ramana Nayana <[email protected]>
We are only doing it now for
kernel_context. We also need to do for the copy engine blitter context.Signed-off-by Venkata Ramana Nayana <[email protected]>--- drivers/gpu/drm/i915/gt/intel_engine_pm.c | 5 +++++ 1 file changed, 5 insertions(+)drivers/gpu/drm/i915/gt/intel_engine_pm.c +0
-0
drivers/gpu/drm/i915/gt/intel_engine_pm.c static int __engine_unpark(struct intel_wakeref *wf) · line 67
Quoted 2 lines
drivers/gpu/drm/i915/gt/intel_engine_pm.c +0
-0@@ -66,6 +66,11 @@ static int __engine_unpark(struct intel_wakeref *wf) ce->ops->reset (ce); }
Add a list of pinned volatile contexts to the engine that must be restored across resume.
-Chris
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
RFC PATCH 145/162 drm/i915/dg1: Add dedicated context for blitter eviction
In reply to Matthew AuldFrom: Tvrtko Ursulin <[email protected]>
Without a dedicated context there can be a "deadlock" due inversion between object clearing and eviction on the shared blitter context timeline.
Clearing of a newly allocated objects emits it's request, but to execute the request, something may need to be evicted in order to make space for the new VMA. When the eviction code emits it's copy request it will be after the buffer clear one in the ringbuffer and so neither can complete.
If we add a dedicated context for eviction then we can de-couple the two and break the "deadlock".
--- drivers/gpu/drm/i915/gem/i915_gem_object.c | 4 +- drivers/gpu/drm/i915/gt/intel_engine.h | 2 + drivers/gpu/drm/i915/gt/intel_engine_cs.c | 40 ++++++++++++++++++-- drivers/gpu/drm/i915/gt/intel_engine_pm.c | 9 +++-- drivers/gpu/drm/i915/gt/intel_engine_types.h | 1 + 5 files changed, 47 insertions(+), 9 deletions(-)
drivers/gpu/drm/i915/gem/i915_gem_object.c +2 -2
@@ -767,7 +767,7 @@ static struct i915_vma * i915_window_vma_init(struct drm_i915_private *i915, struct intel_memory_region *mem) { - struct intel_context *ce = i915->gt.engine[BCS0]->blitter_context; + struct intel_context *ce = i915->gt.engine[BCS0]->evict_context;struct i915_address_space *vm = ce->vm;struct i915_vma *vma;int ret;
@@ -984,7 +984,7 @@ int i915_window_blt_copy(struct drm_i915_gem_object *dst, struct drm_i915_gem_object *src) {struct drm_i915_private *i915 =to_i915 (src->base.dev); -struct intel_context *ce = i915->gt.engine[BCS0 ]->blitter_context; +struct intel_context *ce = i915->gt.engine[BCS0 ]->evict_context;bool src_is_lmem =i915_gem_object_is_lmem (src);bool dst_is_lmem =i915_gem_object_is_lmem (dst);u64 remain = src->base.size, offset =0 ;
drivers/gpu/drm/i915/gt/intel_engine.h +2 -0
@@ -188,6 +188,8 @@ intel_write_status_page(struct intel_engine_cs *engine, int reg, u32 value)#define I915_GEM_HWS_SEQNO_ADDR (I915_GEM_HWS_SEQNO * sizeof(u32))#define I915_GEM_HWS_BLITTER 0x42#define I915_GEM_HWS_BLITTER_ADDR (I915_GEM_HWS_BLITTER * sizeof(u32)) +#define I915_GEM_HWS_EVICT 0x44 +#define I915_GEM_HWS_EVICT_ADDR (I915_GEM_HWS_EVICT * sizeof(u32))#define I915_GEM_HWS_SCRATCH 0x80#define I915_HWS_CSB_BUF0_INDEX 0x10
drivers/gpu/drm/i915/gt/intel_engine_cs.c +36 -4
@@ -874,6 +874,20 @@ create_blitter_context(struct intel_engine_cs *engine)return ce; } +static struct intel_context * +create_evict_context (struct intel_engine_cs *engine) +{ +static struct lock_class_key evict; +struct intel_context *ce; + + ce =create_pinned_context (engine,I915_GEM_HWS_EVICT_ADDR , &evict, +"evict_context" ); +if (IS_ERR (ce)) +return ce; + +return ce; +} +/** * intel_engines_init_common - initialize cengine state which might require hw access * @engine: Engine to initialize.
@@ -912,22 +926,35 @@ static int engine_init_common(struct intel_engine_cs *engine) engine->emit_fini_breadcrumb_dw = ret;/* -* The blitter context is used to quickly memset or migrate objects -* in local memory, so it has to always be available. +* The blitter and evict contexts are used to clear and migrate objects +* in local memory so they have to always be available. */ if (engine->class ==COPY_ENGINE_CLASS ) { ce =create_blitter_context (engine);if (IS_ERR (ce)) { ret =PTR_ERR (ce); - goto err_unpin; + goto err_blitter; } engine->blitter_context = ce; + +if (HAS_LMEM (engine->i915)) { + ce =create_evict_context (engine); +if (IS_ERR (ce)) { + ret =PTR_ERR (ce); + goto err_evict; + } + + engine->evict_context = ce; + } }return 0 ; -err_unpin: +err_evict: +intel_context_unpin (engine->blitter_context); +intel_context_put (engine->blitter_context); +err_blitter:intel_context_unpin (engine->kernel_context); err_context:intel_context_put (engine->kernel_context);
@@ -986,6 +1013,11 @@ void intel_engine_cleanup_common(struct intel_engine_cs *engine)if (engine->default_state)fput (engine->default_state); +if (engine->evict_context) { +intel_context_unpin (engine->evict_context); +intel_context_put (engine->evict_context); + } +if (engine->blitter_context) {intel_context_unpin (engine->blitter_context);intel_context_put (engine->blitter_context);
drivers/gpu/drm/i915/gt/intel_engine_pm.c +6 -3
@@ -66,10 +66,13 @@ static int __engine_unpark(struct intel_wakeref *wf) ce->ops->reset (ce); } -if (engine->class ==COPY_ENGINE_CLASS ) { - ce = engine->blitter_context; + ce = engine->blitter_context; +if (ce) + ce->ops->reset (ce); + + ce = engine->evict_context; +if (ce) ce->ops->reset (ce); - }if (engine->unpark) engine->unpark (engine);
drivers/gpu/drm/i915/gt/intel_engine_types.h +1 -0
@@ -348,6 +348,7 @@ struct intel_engine_cs {struct intel_context *kernel_context;/* pinned */ struct intel_context *blitter_context;/* pinned; exists for BCS only */ +struct intel_context *evict_context;/* pinned; exists for BCS only */ intel_engine_mask_t saturated;/* submitting semaphores too late? */
Signature · 6 lines
2.26.2 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
RFC PATCH 146/162 drm/i915/pm: suspend and restore ppgtt mapping
In reply to Matthew AuldFrom: Prathap Kumar Valsan <[email protected]>
During suspend we will lose all page tables as they are allocated in LMEM. In-order to make sure that the contexts do not access the corrupted page table after we restore, we are evicting all vma's that are bound to vm's. This includes kernel vm.
During resume, we are restoring the page tables back to scratch page.
--- drivers/gpu/drm/i915/gt/gen8_ppgtt.c | 13 ++++ drivers/gpu/drm/i915/gt/gen8_ppgtt.h | 2 + drivers/gpu/drm/i915/gt/intel_ppgtt.c | 4 + drivers/gpu/drm/i915/i915_drv.c | 102 +++++++++++++++++++++++--- 4 files changed, 112 insertions(+), 9 deletions(-)
drivers/gpu/drm/i915/gt/gen8_ppgtt.c +13 -0
@@ -775,3 +775,16 @@ struct i915_ppgtt *gen8_ppgtt_create(struct intel_gt *gt)kfree (ppgtt);return ERR_PTR (err); } + +void gen8_restore_ppgtt_mappings (struct i915_address_space *vm) +{ +const unsigned int count =gen8_pd_top_count (vm); +int i; + +for (i =1 ; i <= vm->top; i++) +fill_px (vm->scratch[i], vm->scratch[i -1 ]->encode); + +fill_page_dma (px_base (i915_vm_to_ppgtt (vm)->pd), + vm->scratch[vm->top]->encode, count); +} +
drivers/gpu/drm/i915/gt/gen8_ppgtt.h +2 -0
@@ -6,8 +6,10 @@#ifndef __GEN8_PPGTT_H__#define __GEN8_PPGTT_H__ +struct i915_address_space ;struct intel_gt ; +void gen8_restore_ppgtt_mappings (struct i915_address_space *vm);struct i915_ppgtt *gen8_ppgtt_create (struct intel_gt *gt);#endif
drivers/gpu/drm/i915/gt/intel_ppgtt.c +4 -0
@@ -9,6 +9,8 @@#include "intel_gtt.h" #include "gem/i915_gem_lmem.h" #include "gem/i915_gem_region.h" +#include "gem/i915_gem_context.h" +#include "gem/i915_gem_region.h" #include "gen6_ppgtt.h" #include "gen8_ppgtt.h"
@@ -317,3 +319,5 @@ void ppgtt_init(struct i915_ppgtt *ppgtt, struct intel_gt *gt) ppgtt->vm.vma_ops.set_pages = ppgtt_set_pages; ppgtt->vm.vma_ops.clear_pages = clear_pages; } + +
drivers/gpu/drm/i915/i915_drv.c +93 -9
142 lines not on this page · raw message
Signature · 6 lines
2.26.2 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [Intel-gfx] [RFC PATCH 146/162] drm/i915/pm: suspend and restore ppgtt mapping
Quoting Matthew Auld (2020-11-27 12:07:02)
Quoted 104 lines
From: Prathap Kumar Valsan <[email protected]>
During suspend we will lose all page tables as they are allocated in LMEM. In-order to make sure that the contexts do not access the corrupted page table after we restore, we are evicting all vma's that are bound to vm's. This includes kernel vm.
During resume, we are restoring the page tables back to scratch page.
Signed-off-by Prathap Kumar Valsan <[email protected]>Signed-off-by Venkata Ramana Nayana <[email protected]>Cc CQ Tang <[email protected]>--- drivers/gpu/drm/i915/gt/gen8_ppgtt.c | 13 ++++ drivers/gpu/drm/i915/gt/gen8_ppgtt.h | 2 + drivers/gpu/drm/i915/gt/intel_ppgtt.c | 4 + drivers/gpu/drm/i915/i915_drv.c | 102 +++++++++++++++++++++++--- 4 files changed, 112 insertions(+), 9 deletions(-)drivers/gpu/drm/i915/gt/gen8_ppgtt.c +13
-0@@ -775,3 +775,16 @@ struct i915_ppgtt *gen8_ppgtt_create(struct intel_gt *gt)kfree (ppgtt);return ERR_PTR (err); } + +void gen8_restore_ppgtt_mappings (struct i915_address_space *vm) +{ +const unsigned int count =gen8_pd_top_count (vm); +int i; + +for (i =1 ; i <= vm->top; i++) +fill_px (vm->scratch[i], vm->scratch[i -1 ]->encode); + +fill_page_dma (px_base (i915_vm_to_ppgtt (vm)->pd), + vm->scratch[vm->top]->encode, count); +} +drivers/gpu/drm/i915/gt/gen8_ppgtt.h +2
-0@@ -6,8 +6,10 @@#ifndef __GEN8_PPGTT_H__#define __GEN8_PPGTT_H__ +struct i915_address_space ;struct intel_gt ; +void gen8_restore_ppgtt_mappings (struct i915_address_space *vm);struct i915_ppgtt *gen8_ppgtt_create (struct intel_gt *gt);#endif drivers/gpu/drm/i915/gt/intel_ppgtt.c +4
-0@@ -9,6 +9,8 @@#include "intel_gtt.h" #include "gem/i915_gem_lmem.h" #include "gem/i915_gem_region.h" +#include "gem/i915_gem_context.h" +#include "gem/i915_gem_region.h" #include "gen6_ppgtt.h" #include "gen8_ppgtt.h" @@ -317,3 +319,5 @@ void ppgtt_init(struct i915_ppgtt *ppgtt, struct intel_gt *gt) ppgtt->vm.vma_ops.set_pages = ppgtt_set_pages; ppgtt->vm.vma_ops.clear_pages = clear_pages; } + +drivers/gpu/drm/i915/i915_drv.c +4
-3@@ -64,6 +64,7 @@#include "gem/i915_gem_context.h" #include "gem/i915_gem_ioctls.h" #include "gem/i915_gem_mman.h" +#include "gt/gen8_ppgtt.h" #include "gt/intel_gt.h" #include "gt/intel_gt_pm.h" #include "gt/intel_rc6.h" @@ -1136,13 +1137,13 @@ static int intel_dmem_evict_buffers(struct drm_device *dev, bool in_suspend)mutex_unlock (&mem->objects.lock); -if (in_suspend) -i915_gem_object_unbind (obj,0 ); -if (in_suspend) { obj->swapto =NULL ; obj->evicted = false; obj->do_swapping = true; + +i915_gem_object_unbind (obj,0 ); + ret =__i915_gem_object_put_pages (obj); obj->do_swapping = false;if (ret) {
drivers/gpu/drm/i915/i915_drv.c static int intel_dmem_evict_buffers(struct drm_device *dev, bool in_suspend) · line 1186
Quoted 10 lines
drivers/gpu/drm/i915/i915_drv.c +7
-0@@ -1176,6 +1177,43 @@ static int intel_dmem_evict_buffers(struct drm_device *dev, bool in_suspend)return ret; } +static int i915_gem_suspend_ppgtt_mappings (struct drm_i915_private *i915) +{ +struct i915_gem_context *ctx, *cn; +int ret; + +spin_lock (&i915->gem.contexts.lock); +list_for_each_entry_safe (ctx, cn, &i915->gem.contexts.list, link) {
Wrong list. Bad starting point from GEM.
-Chris
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
RFC PATCH 147/162 drm/i915/gt: Allocate default ctx objects in SMEM
In reply to Matthew AuldFrom: Venkata Ramana Nayana <[email protected]>
If record default objects are created in LMEM and in suspend pin the pages of obj (src) and use blitter for eviction. But during request creation using blitter context and try to pin the same default object, to restore the ctx with default HW values, will leads to the dead lock situation. To avoid this, safe to keep these objects in SMEM.
--- .../drm/i915/gt/intel_execlists_submission.c | 25 +++++++++++++------ 1 file changed, 18 insertions(+), 7 deletions(-)
drivers/gpu/drm/i915/gt/intel_execlists_submission.c +18 -7
@@ -4697,7 +4697,13 @@ static int __execlists_context_alloc(struct intel_context *ce, context_size +=PAGE_SIZE ; } -if (HAS_LMEM (engine->i915)) { +/* FIXME: temporary fix for allocating default ctx objects +* in SMEM, to reslove suspend/resume issues while using +* blitter based eviction. Will remove this once the upstream +* changes merged, where default obj's stored using shmemfs file. +*/ +if (HAS_LMEM (engine->i915) && + (!IS_DG1 (engine->i915) || engine->default_state)) { ctx_obj =i915_gem_object_create_lmem (engine->i915, context_size,I915_BO_ALLOC_CONTIGUOUS );
@@ -4707,16 +4713,18 @@ static int __execlists_context_alloc(struct intel_context *ce,if (IS_ERR (ctx_obj))return PTR_ERR (ctx_obj); -if (HAS_LMEM (engine->i915)) { +i915_gem_object_lock_isolated (ctx_obj); +if (HAS_LMEM (engine->i915) && + (!IS_DG1 (engine->i915) || engine->default_state)) { ret =context_clear_lmem (ctx_obj);if (ret) - goto error_deref_obj; + goto error_unlock; } vma =i915_vma_instance (ctx_obj, &engine->gt->ggtt->vm,NULL );if (IS_ERR (vma)) { ret =PTR_ERR (vma); - goto error_deref_obj; + goto error_unlock; }if (!page_mask_bits (ce->timeline)) {
@@ -4732,7 +4740,7 @@ static int __execlists_context_alloc(struct intel_context *ce, tl =intel_timeline_create (engine->gt);if (IS_ERR (tl)) { ret =PTR_ERR (tl); - goto error_deref_obj; + goto error_unlock; } ce->timeline = tl;
@@ -4741,15 +4749,18 @@ static int __execlists_context_alloc(struct intel_context *ce, ring =intel_engine_create_ring (engine, (unsigned long )ce->ring);if (IS_ERR (ring)) { ret =PTR_ERR (ring); - goto error_deref_obj; + goto error_unlock; } ce->ring = ring; ce->state = vma; +i915_gem_object_unlock (ctx_obj); +return 0 ; -error_deref_obj: +error_unlock: +i915_gem_object_unlock (ctx_obj);i915_gem_object_put (ctx_obj);return ret; }
Signature · 6 lines
2.26.2 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [RFC PATCH 147/162] drm/i915/gt: Allocate default ctx objects in SMEM
Quoting Matthew Auld (2020-11-27 12:07:03)
Quoted 8 lines
From: Venkata Ramana Nayana <[email protected]>
If record default objects are created in LMEM and in suspend pin the pages of obj (src) and use blitter for eviction. But during request creation using blitter context and try to pin the same default object, to restore the ctx with default HW values, will leads to the dead lock situation. To avoid this, safe to keep these objects in SMEM.
Dead patch. Default object state should be recorded as shmemfs. -Chris
_______________________________________________
dri-devel mailing list [email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
RFC PATCH 148/162 drm/i915: suspend/resume enable blitter eviction
In reply to Matthew AuldFrom: Venkata Ramana Nayana <[email protected]>
In suspend mode use blitter eviction before disable the runtime interrupts and in resume use blitter after the gem resume happens.
--- drivers/gpu/drm/i915/i915_drv.c | 36 +++++++++++++-------------------- 1 file changed, 14 insertions(+), 22 deletions(-)
drivers/gpu/drm/i915/i915_drv.c +14 -22
@@ -1110,13 +1110,6 @@ static int intel_dmem_evict_buffers(struct drm_device *dev, bool in_suspend)struct intel_memory_region *mem;int id, ret =0 ; -/* -* FIXME: Presently using memcpy, -* will replace with blitter once -* fix the issues. -*/ - i915->params.enable_eviction =1 ; -for_each_memory_region (mem, i915, id) {struct list_head still_in_list;INIT_LIST_HEAD (&still_in_list);
@@ -1173,7 +1166,6 @@ static int intel_dmem_evict_buffers(struct drm_device *dev, bool in_suspend)mutex_unlock (&mem->objects.lock); } } - i915->params.enable_eviction =3 ;return ret; }
@@ -1235,6 +1227,18 @@ static int i915_drm_suspend(struct drm_device *dev)intel_dp_mst_suspend (dev_priv); +if (HAS_LMEM (dev_priv)) { + ret =intel_dmem_evict_buffers (dev, true); +if (ret) +return ret; + +i915_teardown_blt_windows (dev_priv); + + ret =i915_gem_suspend_ppgtt_mappings (dev_priv); +if (ret) +return ret; + } +intel_runtime_pm_disable_interrupts (dev_priv);intel_hpd_cancel_work (dev_priv);
@@ -1251,18 +1255,6 @@ static int i915_drm_suspend(struct drm_device *dev)intel_fbdev_set_suspend (dev,FBINFO_STATE_SUSPENDED , true); -if (HAS_LMEM (dev_priv)) { - ret =intel_dmem_evict_buffers (dev, true); -if (ret) -return ret; - -i915_teardown_blt_windows (dev_priv); - - ret =i915_gem_suspend_ppgtt_mappings (dev_priv); -if (ret) -return ret; - } - dev_priv->suspend_count++;intel_csr_ucode_suspend (dev_priv);
@@ -1418,6 +1410,8 @@ static int i915_drm_resume(struct drm_device *dev)drm_mode_config_reset (dev); +i915_gem_resume (dev_priv); +if (HAS_LMEM (dev_priv)) {i915_gem_restore_ppgtt_mappings (dev_priv);
@@ -1430,8 +1424,6 @@ static int i915_drm_resume(struct drm_device *dev)DRM_ERROR ("i915_resume:i915_gem_object_pin_pages failed with err=%d\n" , ret); } -i915_gem_resume (dev_priv); -intel_modeset_init_hw (dev_priv);intel_init_clock_gating (dev_priv);intel_hpd_init (dev_priv);
Signature · 6 lines
2.26.2 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [Intel-gfx] [RFC PATCH 148/162] drm/i915: suspend/resume enable blitter eviction
Quoting Matthew Auld (2020-11-27 12:07:04)
Quoted 4 lines
From: Venkata Ramana Nayana <[email protected]>
In suspend mode use blitter eviction before disable the runtime interrupts and in resume use blitter after the gem resume happens.
Consider add it to the suspend prepare function.
-Chris
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
RFC PATCH 149/162 drm/i915: suspend/resume handling of perma-pinned objects
In reply to Matthew AuldFrom: Venkata Ramana Nayana <[email protected]>
The objects which are perma-pinned (like guc), use memcpy to evict these objects. Since the objects are always have pinned pages, so can't use present existing swapout/swapin functions.
--- drivers/gpu/drm/i915/i915_drv.c | 105 +++++++++++++++++++++++++++----- 1 file changed, 89 insertions(+), 16 deletions(-)
drivers/gpu/drm/i915/i915_drv.c +89 -16
@@ -1103,7 +1103,54 @@ static int i915_drm_prepare(struct drm_device *dev)return 0 ; } -static int intel_dmem_evict_buffers (struct drm_device *dev,bool in_suspend) +static int i915_gem_perma_pinned_object_swapout (struct drm_i915_gem_object *obj) +{ +struct drm_i915_private *i915 =to_i915 (obj->base.dev); +struct drm_i915_gem_object *dst; +int err = -EINVAL ; + +assert_object_held (obj); + dst =i915_gem_object_create_shmem (i915, obj->base.size); +if (IS_ERR (dst)) +return PTR_ERR (dst); + +i915_gem_object_lock_isolated (dst); + err =i915_gem_object_memcpy (dst, obj); +i915_gem_object_unlock (dst); + +if (!err) { + obj->swapto = dst; + obj->evicted = true; + }else +i915_gem_object_put (dst); + +return err; +} + +static int i915_gem_perma_pinned_object_swapin (struct drm_i915_gem_object *obj) +{ +struct drm_i915_gem_object *src; +int err = -EINVAL ; + +assert_object_held (obj); + src = obj->swapto; + +if (WARN_ON (!i915_gem_object_trylock (src))) +return -EBUSY ; + + err =i915_gem_object_memcpy (obj, src); +i915_gem_object_unlock (src); + +if (!err) { + obj->swapto =NULL ; + obj->evicted = false; +i915_gem_object_put (src); + } +return err; +} + +static int intel_dmem_evict_buffers (struct drm_device *dev,bool in_suspend, +bool perma_pin) {struct drm_i915_private *i915 =to_i915 (dev);struct drm_i915_gem_object *obj;
@@ -1133,24 +1180,37 @@ static int intel_dmem_evict_buffers(struct drm_device *dev, bool in_suspend)if (in_suspend) { obj->swapto =NULL ; obj->evicted = false; - obj->do_swapping = true; -i915_gem_object_unbind (obj,0 ); + ret =i915_gem_object_unbind (obj,0 ); +if (ret ||i915_gem_object_has_pinned_pages (obj)) { +if (!i915_gem_object_trylock (obj)) { + ret = -EBUSY ; + goto next; + } + ret =i915_gem_perma_pinned_object_swapout (obj); +i915_gem_object_unlock (obj); + goto next; + } + obj->do_swapping = true; ret =__i915_gem_object_put_pages (obj); obj->do_swapping = false; -if (ret) { -/* -* FIXME: internal ctx objects still pinned -* returning as BUSY. Presently just evicting -* the user objects, will fix it later -*/ +if (ret) obj->evicted = false; - ret =0 ; - }else +else obj->evicted = true; }else { -if (obj->swapto && obj->evicted) { +if (i915_gem_object_has_pinned_pages (obj) && perma_pin) { +if (!i915_gem_object_trylock (obj)) { + ret = -EBUSY ; + goto next; + } + ret =i915_gem_perma_pinned_object_swapin (obj); +/* FIXME: Where is this error message taken care of? */ +i915_gem_object_unlock (obj); + } + +if (obj->swapto && obj->evicted && !perma_pin) { ret =i915_gem_object_pin_pages (obj);if (ret) {i915_gem_object_put (obj);
@@ -1160,7 +1220,10 @@ static int intel_dmem_evict_buffers(struct drm_device *dev, bool in_suspend) } } } +next:mutex_lock (&mem->objects.lock); +if (ret) +break ; }list_splice_tail (&still_in_list, &mem->objects.list);mutex_unlock (&mem->objects.lock);
@@ -1228,7 +1291,7 @@ static int i915_drm_suspend(struct drm_device *dev)intel_dp_mst_suspend (dev_priv);if (HAS_LMEM (dev_priv)) { - ret =intel_dmem_evict_buffers (dev, true); + ret =intel_dmem_evict_buffers (dev, true, false);if (ret)return ret;
@@ -1410,6 +1473,14 @@ static int i915_drm_resume(struct drm_device *dev)drm_mode_config_reset (dev); +if (HAS_LMEM (dev_priv)) { + ret =intel_dmem_evict_buffers (dev, false, true); +if (ret) { +DRM_ERROR ("perma pinned obj's failed with err=%d\n" , ret); +return ret; + } + } +i915_gem_resume (dev_priv);if (HAS_LMEM (dev_priv)) {
@@ -1419,9 +1490,11 @@ static int i915_drm_resume(struct drm_device *dev)if (ret)GEM_BUG_ON (ret); - ret =intel_dmem_evict_buffers (dev, false); -if (ret) -DRM_ERROR ("i915_resume:i915_gem_object_pin_pages failed with err=%d\n" , ret); + ret =intel_dmem_evict_buffers (dev, false, false); +if (ret) { +DRM_ERROR ("gem_object_pin_pages failed with err=%d\n" , ret); +return ret; + } }intel_modeset_init_hw (dev_priv);
Signature · 6 lines
2.26.2 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
RFC PATCH 150/162 drm/i915: need consider system BO snoop for dgfx
In reply to Matthew AuldFrom: CQ Tang <[email protected]>
When cache_level is NONE, we check HAS_LLC(i915). But additionally for DGFX, we also need to check HAS_SNOOP(i915) on system memory object to use I915_BO_CACHE_COHERENT_FOR_READ. on dg1, has_llc=0, and has_snoop=1. Otherwise, we set obj->cache_choerent=0 and have performance impact.
--- drivers/gpu/drm/i915/gem/i915_gem_object.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/gem/i915_gem_object.c +15 -1
@@ -95,6 +95,20 @@ void i915_gem_object_init(struct drm_i915_gem_object *obj,mutex_init (&obj->mm.get_dma_page.lock); } +static bool i915_gem_object_use_llc (struct drm_i915_gem_object *obj) +{ +struct drm_i915_private *i915 =to_i915 (obj->base.dev); + +if (HAS_LLC (i915)) +return true; + +if (IS_DGFX (i915) &&HAS_SNOOP (i915) && + !i915_gem_object_is_lmem (obj)) +return true; + +return false; +} +/** * Mark up the object's coherency levels for a given cache_level * @obj: #drm_i915_gem_object
@@ -108,7 +122,7 @@ void i915_gem_object_set_cache_coherency(struct drm_i915_gem_object *obj,if (cache_level !=I915_CACHE_NONE ) obj->cache_coherent = (I915_BO_CACHE_COHERENT_FOR_READ |I915_BO_CACHE_COHERENT_FOR_WRITE ); -else if (HAS_LLC (to_i915 (obj->base.dev))) +else if (i915_gem_object_use_llc (obj)) obj->cache_coherent =I915_BO_CACHE_COHERENT_FOR_READ ;else obj->cache_coherent =0 ;
Signature · 6 lines
2.26.2 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [RFC PATCH 150/162] drm/i915: need consider system BO snoop for dgfx
Quoting Matthew Auld (2020-11-27 12:07:06)
Quoted 44 lines
From: CQ Tang <[email protected]>
When
cache_levelis NONE, we checkHAS_LLC(i915). But additionally for DGFX, we also need to checkHAS_SNOOP(i915)on system memory object to useI915_BO_CACHE_COHERENT_FOR_READ. on dg1, has_llc=0, and has_snoop=1. Otherwise, we set obj->cache_choerent=0 and have performance impact.Cc Chris P Wilson <[email protected]>Cc Ramalingam C <[email protected]>Cc Sudeep Dutt <[email protected]>Cc Matthew Auld <[email protected]>Signed-off-by CQ Tang <[email protected]>--- drivers/gpu/drm/i915/gem/i915_gem_object.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-)drivers/gpu/drm/i915/gem/i915_gem_object.c +14
-0@@ -95,6 +95,20 @@ void i915_gem_object_init(struct drm_i915_gem_object *obj,mutex_init (&obj->mm.get_dma_page.lock); } +static bool i915_gem_object_use_llc (struct drm_i915_gem_object *obj) +{ +struct drm_i915_private *i915 =to_i915 (obj->base.dev); + +if (HAS_LLC (i915)) +return true; + +if (IS_DGFX (i915) &&HAS_SNOOP (i915) && + !i915_gem_object_is_lmem (obj)) +return true; + +return false; +} +/** * Mark up the object's coherency levels for a given cache_level * @obj: #drm_i915_gem_object
drivers/gpu/drm/i915/gem/i915_gem_object.c void i915_gem_object_set_cache_coherency(struct drm_i915_gem_object *obj, · line 128
Quoted 8 lines
drivers/gpu/drm/i915/gem/i915_gem_object.c +1
-1@@ -108,7 +122,7 @@ void i915_gem_object_set_cache_coherency(struct drm_i915_gem_object *obj,if (cache_level !=I915_CACHE_NONE ) obj->cache_coherent = (I915_BO_CACHE_COHERENT_FOR_READ |I915_BO_CACHE_COHERENT_FOR_WRITE ); -else if (HAS_LLC (to_i915 (obj->base.dev))) +else if (i915_gem_object_use_llc (obj)) obj->cache_coherent =I915_BO_CACHE_COHERENT_FOR_READ ;else obj->cache_coherent =0 ;
You must also define obj->cache_level correctly. You can not just assume the object will be snooped.
-Chris
---------------------------------------------------------------------
Intel Corporation (UK) Limited
Registered No. 1134945 (England)
Registered Office: Pipers Way, Swindon SN3 1RJ
VAT No: 860 2173 47
This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies.
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
RFC PATCH 151/162 drm/i915: move eviction to prepare hook
In reply to Matthew AuldFrom: Lucas De Marchi <[email protected]>
--- drivers/gpu/drm/i915/i915_drv.c | 40 ++++++++++++++++++++++----------- 1 file changed, 27 insertions(+), 13 deletions(-)
drivers/gpu/drm/i915/i915_drv.c +27 -13
@@ -68,6 +68,7 @@#include "gt/intel_gt.h" #include "gt/intel_gt_pm.h" #include "gt/intel_rc6.h" +#include "gt/intel_gt_requests.h" #include "i915_debugfs.h" #include "i915_drv.h"
@@ -1088,10 +1089,36 @@ static bool suspend_to_idle(struct drm_i915_private *dev_priv)return false; } +static int i915_gem_suspend_ppgtt_mappings (struct drm_i915_private *i915); + +static int intel_dmem_evict_buffers (struct drm_device *dev,bool in_suspend, +bool perma_pin); +static int i915_drm_prepare (struct drm_device *dev) {struct drm_i915_private *i915 =to_i915 (dev); +if (HAS_LMEM (i915)) { +struct intel_gt *gt= &i915->gt; +long timeout =I915_GEM_IDLE_TIMEOUT ; +int ret; + +if (intel_gt_wait_for_idle (gt, timeout) == -ETIME ) { +intel_gt_set_wedged (gt); +intel_gt_retire_requests (gt); + } + + ret =intel_dmem_evict_buffers (dev, true, false); +if (ret) +return ret; + +i915_teardown_blt_windows (i915); + + ret =i915_gem_suspend_ppgtt_mappings (i915); +if (ret) +return ret; + } +/* * NB intel_display_suspend() may issue new requests after we've * ostensibly marked the GPU as ready-to-sleep here. We need to
@@ -1274,7 +1301,6 @@ static int i915_drm_suspend(struct drm_device *dev)struct drm_i915_private *dev_priv =to_i915 (dev);struct pci_dev *pdev = dev_priv->drm.pdev;pci_power_t opregion_target_state; -int ret =0 ;disable_rpm_wakeref_asserts (&dev_priv->runtime_pm);
@@ -1290,18 +1316,6 @@ static int i915_drm_suspend(struct drm_device *dev)intel_dp_mst_suspend (dev_priv); -if (HAS_LMEM (dev_priv)) { - ret =intel_dmem_evict_buffers (dev, true, false); -if (ret) -return ret; - -i915_teardown_blt_windows (dev_priv); - - ret =i915_gem_suspend_ppgtt_mappings (dev_priv); -if (ret) -return ret; - } -intel_runtime_pm_disable_interrupts (dev_priv);intel_hpd_cancel_work (dev_priv);
Signature · 6 lines
2.26.2 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
RFC PATCH 152/162 drm/i915: Perform execbuffer object locking as a separate step
In reply to Matthew AuldFrom: Thomas Hellström <[email protected]>
This is important to help avoid evicting already resident buffers from the batch we're processing.
--- .../gpu/drm/i915/gem/i915_gem_execbuffer.c | 25 ++++++++++++++++--- 1 file changed, 21 insertions(+), 4 deletions(-)
drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c +21 -4
@@ -918,21 +918,38 @@ static int eb_lookup_vmas(struct i915_execbuffer *eb)return err; } -static int eb_validate_vmas (struct i915_execbuffer *eb) +static int eb_lock_vmas (struct i915_execbuffer *eb) {unsigned int i;int err; -INIT_LIST_HEAD (&eb->unbound); -for (i =0 ; i < eb->buffer_count; i++) { -struct drm_i915_gem_exec_object2 *entry = &eb->exec[i];struct eb_vma *ev = &eb->vma[i];struct i915_vma *vma = ev->vma; err =i915_gem_object_lock (vma->obj, &eb->ww);if (err)return err; + } + +return 0 ; +} + +static int eb_validate_vmas (struct i915_execbuffer *eb) +{ +unsigned int i; +int err; + +INIT_LIST_HEAD (&eb->unbound); + + err =eb_lock_vmas (eb); +if (err) +return err; + +for (i =0 ; i < eb->buffer_count; i++) { +struct drm_i915_gem_exec_object2 *entry = &eb->exec[i]; +struct eb_vma *ev = &eb->vma[i]; +struct i915_vma *vma = ev->vma; err =eb_pin_vma (eb, entry, ev);if (err == -EDEADLK )
Signature · 6 lines
2.26.2 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
RFC PATCH 153/162 drm/i915: Implement eviction locking v2
In reply to Matthew AuldFrom: Maarten Lankhorst <[email protected]>
Use a separate acquire context list and a separate locking function for objects that are locked for eviction. These objects are then properly referenced while on the list and can be unlocked early in the ww transaction.
--- drivers/gpu/drm/i915/gem/i915_gem_object.h | 67 +++++++++++++++++-- .../gpu/drm/i915/gem/i915_gem_object_types.h | 5 ++ drivers/gpu/drm/i915/gem/i915_gem_shrinker.c | 14 +++- drivers/gpu/drm/i915/i915_gem_ww.c | 51 ++++++++++---- drivers/gpu/drm/i915/i915_gem_ww.h | 3 + 5 files changed, 122 insertions(+), 18 deletions(-)
drivers/gpu/drm/i915/gem/i915_gem_object.h +63 -4
@@ -158,6 +158,32 @@ static inline void assert_object_held_shared(struct drm_i915_gem_object *obj)assert_object_held (obj); } +static inline int +i915_gem_object_lock_to_evict (struct drm_i915_gem_object *obj, +struct i915_gem_ww_ctx *ww) +{ +int ret; + +if (ww->intr) + ret =dma_resv_lock_interruptible (obj->base.resv, &ww->ctx); +else + ret =dma_resv_lock (obj->base.resv, &ww->ctx); + +if (!ret) { +list_add_tail (&obj->obj_link, &ww->eviction_list); +i915_gem_object_get (obj); + obj->evict_locked = true; + } + +GEM_WARN_ON (ret == -EALREADY ); +if (ret == -EDEADLK ) { + ww->contended_evict = true; + ww->contended =i915_gem_object_get (obj); + } + +return ret; +} +static inline int __i915_gem_object_lock (struct drm_i915_gem_object *obj,struct i915_gem_ww_ctx *ww,bool intr)
@@ -169,13 +195,25 @@ static inline int __i915_gem_object_lock(struct drm_i915_gem_object *obj,else ret =dma_resv_lock (obj->base.resv, ww ? &ww->ctx :NULL ); -if (!ret && ww) +if (!ret && ww) {list_add_tail (&obj->obj_link, &ww->obj_list); -if (ret == -EALREADY ) - ret =0 ; + obj->evict_locked = false; + } -if (ret == -EDEADLK ) +if (ret == -EALREADY ) { + ret =0 ; +/* We've already evicted an object needed for this batch. */ +if (obj->evict_locked) { +list_move_tail (&obj->obj_link, &ww->obj_list); +i915_gem_object_put (obj); + obj->evict_locked = false; + } + } + +if (ret == -EDEADLK ) { + ww->contended_evict = false; ww->contended =i915_gem_object_get (obj); + }return ret; }
@@ -580,6 +618,27 @@ i915_gem_object_invalidate_frontbuffer(struct drm_i915_gem_object *obj,__i915_gem_object_invalidate_frontbuffer (obj, origin); } +/** +* i915_gem_get_locking_ctx - Get the locking context of a locked object +* if any. +* +* @obj: The object to get the locking ctx from +* +* RETURN: The locking context if the object was locked using a context. +* NULL otherwise. +*/ +static inline struct i915_gem_ww_ctx * +i915_gem_get_locking_ctx (const struct drm_i915_gem_object *obj) +{ +struct ww_acquire_ctx *ctx; + + ctx = obj->base.resv->lock.ctx; +if (!ctx) +return NULL ; + + return container_of(ctx, struct i915_gem_ww_ctx, ctx); +} +#ifdef CONFIG_MMU_NOTIFIER static inline bool i915_gem_object_is_userptr (struct drm_i915_gem_object *obj)
drivers/gpu/drm/i915/gem/i915_gem_object_types.h +5 -0
@@ -142,6 +142,11 @@ struct drm_i915_gem_object {*/ struct list_head obj_link; +/** +* @evict_locked: Whether @obj_link sits on the eviction_list +*/ +bool evict_locked; +/** Stolen memory for this object, instead of being backed by shmem. */ struct drm_mm_node *stolen;union {
drivers/gpu/drm/i915/gem/i915_gem_shrinker.c +12 -2
@@ -100,6 +100,7 @@ i915_gem_shrink(struct i915_gem_ww_ctx *ww, unsigned long *nr_scanned, unsigned int shrink) { +struct drm_i915_gem_object *obj; const struct { struct list_head *list; unsigned int bit;
@@ -164,7 +165,6 @@ i915_gem_shrink(struct i915_gem_ww_ctx *ww,*/ for (phase = phases; phase->list; phase++) {struct list_head still_in_list; -struct drm_i915_gem_object *obj;unsigned long flags;if ((shrink & phase->bit) ==0 )
@@ -197,6 +197,10 @@ i915_gem_shrink(struct i915_gem_ww_ctx *ww,if (!can_release_pages (obj))continue ; +/* Already locked this object? */ +if (ww && ww ==i915_gem_get_locking_ctx (obj)) +continue ; +if (!kref_get_unless_zero (&obj->base.refcount))continue ;
@@ -209,7 +213,11 @@ i915_gem_shrink(struct i915_gem_ww_ctx *ww,if (!i915_gem_object_trylock (obj)) goto skip; }else { - err =i915_gem_object_lock (obj, ww); + err =i915_gem_object_lock_to_evict (obj, ww); +if (err == -EALREADY ) { + err =0 ; + goto skip; + }if (err) goto skip; }
@@ -235,6 +243,8 @@ i915_gem_shrink(struct i915_gem_ww_ctx *ww,if (err)return err; } +if (ww) +i915_gem_ww_ctx_unlock_evictions (ww);if (shrink &I915_SHRINK_BOUND )intel_runtime_pm_put (&i915->runtime_pm, wakeref);
drivers/gpu/drm/i915/i915_gem_ww.c +39 -12
90 lines not on this page · raw message
drivers/gpu/drm/i915/i915_gem_ww.h +3 -0
@@ -10,15 +10,18 @@struct i915_gem_ww_ctx {struct ww_acquire_ctx ctx;struct list_head obj_list; +struct list_head eviction_list;struct drm_i915_gem_object *contended;unsigned short intr;unsigned short loop; +unsigned short contended_evict; };void i915_gem_ww_ctx_init (struct i915_gem_ww_ctx *ctx,bool intr);void i915_gem_ww_ctx_fini (struct i915_gem_ww_ctx *ctx);int __must_check i915_gem_ww_ctx_backoff (struct i915_gem_ww_ctx *ctx);void i915_gem_ww_unlock_single (struct drm_i915_gem_object *obj); +void i915_gem_ww_ctx_unlock_evictions (struct i915_gem_ww_ctx *ww);/* Internal functions used by the inlines! Don't use. */ static inline int __i915_gem_ww_fini (struct i915_gem_ww_ctx *ww,int err)
Signature · 6 lines
2.26.2 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
RFC PATCH 154/162 drm/i915: Support ww eviction
In reply to Matthew AuldFrom: Thomas Hellström <[email protected]>
Use sleeping ww locks if we're in a ww transaction. Trylock otherwise.
We unlock the evicted objects either when eviction failed or when we've reached the target. The ww ticket locks will then ensure we will eventually succeed reaching the target if there is evictable space available. However another process may still steal the evicted memory before we have a chance to allocate it. To ensure we eventually succeed we need to move the evict unlock until after get pages succeeds. That's considered a TODO for now.
--- drivers/gpu/drm/i915/gem/i915_gem_region.c | 7 ++- drivers/gpu/drm/i915/intel_memory_region.c | 57 ++++++++++++++++------ drivers/gpu/drm/i915/intel_memory_region.h | 2 + 3 files changed, 49 insertions(+), 17 deletions(-)
drivers/gpu/drm/i915/gem/i915_gem_region.c +5 -2
@@ -204,6 +204,7 @@ i915_gem_object_get_pages_buddy(struct drm_i915_gem_object *obj)struct scatterlist *sg;unsigned int sg_page_sizes;int ret; +struct i915_gem_ww_ctx *ww =i915_gem_get_locking_ctx (obj);/* XXX: Check if we have any post. This is nasty hack, see gem_create */ if (obj->mm.gem_create_posted_err)
@@ -222,7 +223,8 @@ i915_gem_object_get_pages_buddy(struct drm_i915_gem_object *obj)if (obj->flags &I915_BO_ALLOC_CONTIGUOUS ) flags |=I915_ALLOC_CONTIGUOUS ; - ret =__intel_memory_region_get_pages_buddy (mem, size, flags, blocks); + ret =__intel_memory_region_get_pages_buddy (mem, ww, size, flags, + blocks);if (ret) goto err_free_sg;
@@ -277,7 +279,8 @@ i915_gem_object_get_pages_buddy(struct drm_i915_gem_object *obj)if (ret) {/* swapin failed, free the pages */ __intel_memory_region_put_pages_buddy (mem, blocks); - ret = -ENXIO ; +if (ret != -EDEADLK && ret != -EINTR ) + ret = -ENXIO ; goto err_free_sg; } }else if (obj->flags &I915_BO_ALLOC_CPU_CLEAR ) {
drivers/gpu/drm/i915/intel_memory_region.c +42 -15
140 lines not on this page · raw message
drivers/gpu/drm/i915/intel_memory_region.h +2 -0
@@ -16,6 +16,7 @@#include "i915_buddy.h" +struct i915_gem_ww_ctx ;struct drm_i915_private ;struct drm_i915_gem_object ;struct intel_memory_region ;
@@ -116,6 +117,7 @@ int intel_memory_region_init_buddy(struct intel_memory_region *mem);void intel_memory_region_release_buddy (struct intel_memory_region *mem);int __intel_memory_region_get_pages_buddy (struct intel_memory_region *mem, +struct i915_gem_ww_ctx *ww,resource_size_t size,unsigned int flags,struct list_head *blocks);
Signature · 6 lines
2.26.2 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
RFC PATCH 155/162 drm/i915: Use a ww transaction in the fault handler
In reply to Matthew AuldFrom: Thomas Hellström <[email protected]>
Prefer a ww transaction rather than a single object lock to enable sleeping lock eviction if reached by the fault handler.
--- drivers/gpu/drm/i915/gem/i915_gem_mman.c | 45 +++++++++++++----------- 1 file changed, 24 insertions(+), 21 deletions(-)
drivers/gpu/drm/i915/gem/i915_gem_mman.c +24 -21
@@ -238,6 +238,7 @@ static vm_fault_t vm_fault_cpu(struct vm_fault *vmf)struct vm_area_struct *area = vmf->vma;struct i915_mmap_offset *mmo = area->vm_private_data;struct drm_i915_gem_object *obj = mmo->obj; +struct i915_gem_ww_ctx ww;resource_size_t iomap;int err;
@@ -246,33 +247,35 @@ static vm_fault_t vm_fault_cpu(struct vm_fault *vmf) area->vm_flags & VM_WRITE)) return VM_FAULT_SIGBUS; -if (i915_gem_object_lock_interruptible (obj,NULL )) -return VM_FAULT_NOPAGE ; + for_i915_gem_ww(&ww, err, true) { + err =i915_gem_object_lock (obj, &ww); +if (err) +continue ; - err =i915_gem_object_pin_pages (obj); -if (err) - goto out; + err =i915_gem_object_pin_pages (obj); +if (err) +continue ; - iomap =-1 ; -if (!i915_gem_object_has_struct_page (obj)) { - iomap = obj->mm.region->iomap.base; - iomap -= obj->mm.region->region.start; - } + iomap =-1 ; +if (!i915_gem_object_has_struct_page (obj)) { + iomap = obj->mm.region->iomap.base; + iomap -= obj->mm.region->region.start; + } -/* PTEs are revoked in obj->ops->put_pages() */ - err =remap_io_sg (area, - area->vm_start, area->vm_end - area->vm_start, - obj->mm.pages->sgl, iomap); +/* PTEs are revoked in obj->ops->put_pages() */ + err =remap_io_sg (area, + area->vm_start, area->vm_end - area->vm_start, + obj->mm.pages->sgl, iomap); -if (area->vm_flags &VM_WRITE ) { -GEM_BUG_ON (!i915_gem_object_has_pinned_pages (obj)); - obj->mm.dirty = true; - } +if (area->vm_flags &VM_WRITE ) { +GEM_BUG_ON (!i915_gem_object_has_pinned_pages (obj)); + obj->mm.dirty = true; + } -i915_gem_object_unpin_pages (obj); +i915_gem_object_unpin_pages (obj); +/* Implicit unlock */ + } -out: -i915_gem_object_unlock (obj);return i915_error_to_vmf_fault (err); }
Signature · 6 lines
2.26.2 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
RFC PATCH 156/162 drm/i915: Use a ww transaction in i915_gem_object_pin_map_unlocked()
In reply to Matthew AuldFrom: Thomas Hellström <[email protected]>
By using a ww transaction, anybody using this function and ending up evicting objects can use sleeping waits when locking objects to evict.
--- drivers/gpu/drm/i915/gem/i915_gem_pages.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-)
drivers/gpu/drm/i915/gem/i915_gem_pages.c +14 -3
@@ -425,11 +425,22 @@ void *i915_gem_object_pin_map(struct drm_i915_gem_object *obj,void *i915_gem_object_pin_map_unlocked (struct drm_i915_gem_object *obj,enum i915_map_type type) { +struct i915_gem_ww_ctx ww;void *ret; +int err; -i915_gem_object_lock (obj,NULL ); - ret =i915_gem_object_pin_map (obj, type); -i915_gem_object_unlock (obj); + for_i915_gem_ww(&ww, err, false) { + err =i915_gem_object_lock (obj, &ww); +if (err) +continue ; + + ret =i915_gem_object_pin_map (obj, type); +if (IS_ERR (ret)) + err =PTR_ERR (ret); +/* Implicit unlock */ + } +if (err) +return ERR_PTR (err);return ret; }
Signature · 6 lines
2.26.2 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
RFC PATCH 157/162 drm/i915: Improve accuracy of eviction stats
In reply to Matthew AuldFrom: Tvrtko Ursulin <[email protected]>
Current code uses jiffie time to do the accounting and then does:
diff = jiffies - start; msec = diff * 1000 / HZ; ... atomic_long_add(msec, &i915->time_swap_out_ms);
If we assume jiffie can be as non-granular as 10ms and that the current accounting records all evictions faster than one jiffie as infinite speed, we can end up over-estimating the reported eviction throughput.
Fix this by accumulating ktime_t and only dividing to more user friendly granularity at presentation time (debugfs read).
At the same time consolidate the code a bit and convert from multiple atomics to single seqlock per stat.
--- drivers/gpu/drm/i915/gem/i915_gem_region.c | 67 ++++++++++---------- drivers/gpu/drm/i915/i915_debugfs.c | 73 +++++++++++----------- drivers/gpu/drm/i915/i915_drv.h | 25 +++++--- drivers/gpu/drm/i915/i915_gem.c | 5 ++ 4 files changed, 90 insertions(+), 80 deletions(-)
drivers/gpu/drm/i915/gem/i915_gem_region.c +33 -34
@@ -9,14 +9,29 @@#include "i915_trace.h" #include "i915_gem_mman.h" +static void +__update_stat (struct i915_mm_swap_stat *stat, +unsigned long pages, +ktime_t start) +{ +if (stat) { + start =ktime_get () - start; + +write_seqlock (&stat->lock); + stat->time =ktime_add (stat->time, start); + stat->pages += pages; +write_sequnlock (&stat->lock); + } +} +static int i915_gem_object_swapout_pages (struct drm_i915_gem_object *obj,struct sg_table *pages,unsigned int sizes) {struct drm_i915_private *i915 =to_i915 (obj->base.dev); +struct i915_mm_swap_stat *stat =NULL ;struct drm_i915_gem_object *dst, *src; -unsigned long start, diff, msec; -bool blt_completed = false; +ktime_t start =ktime_get ();int err = -EINVAL ;GEM_BUG_ON (obj->swapto);
@@ -26,7 +41,6 @@ i915_gem_object_swapout_pages(struct drm_i915_gem_object *obj,GEM_BUG_ON (!i915->params.enable_eviction);assert_object_held (obj); - start = jiffies;/* create a shadow object on smem region */ dst =i915_gem_object_create_shmem (i915, obj->base.size);
@@ -58,10 +72,14 @@ i915_gem_object_swapout_pages(struct drm_i915_gem_object *obj,if (i915->params.enable_eviction >=2 ) { err =i915_window_blt_copy (dst, src);if (!err) - blt_completed = true; + stat = &i915->mm.blt_swap_stats.out; } -if (err && i915->params.enable_eviction !=2 ) + +if (err && i915->params.enable_eviction !=2 ) { err =i915_gem_object_memcpy (dst, src); +if (!err) + stat = &i915->mm.memcpy_swap_stats.out; + }__i915_gem_object_unpin_pages (src);__i915_gem_object_unset_pages (src);
@@ -73,18 +91,7 @@ i915_gem_object_swapout_pages(struct drm_i915_gem_object *obj,else i915_gem_object_put (dst); -if (!err) { - diff = jiffies - start; - msec = diff *1000 /HZ ; -if (blt_completed) { -atomic_long_add (sizes, &i915->num_bytes_swapped_out); -atomic_long_add (msec, &i915->time_swap_out_ms); - }else { -atomic_long_add (sizes, - &i915->num_bytes_swapped_out_memcpy); -atomic_long_add (msec, &i915->time_swap_out_ms_memcpy); - } - } +__update_stat (stat, sizes >>PAGE_SHIFT , start);return err; }
@@ -94,9 +101,9 @@ i915_gem_object_swapin_pages(struct drm_i915_gem_object *obj, struct sg_table *pages, unsigned int sizes) {struct drm_i915_private *i915 =to_i915 (obj->base.dev); +struct i915_mm_swap_stat *stat =NULL ;struct drm_i915_gem_object *dst, *src; -unsigned long start, diff, msec; -bool blt_completed = false; +ktime_t start =ktime_get ();int err = -EINVAL ;GEM_BUG_ON (!obj->swapto);
@@ -106,7 +113,6 @@ i915_gem_object_swapin_pages(struct drm_i915_gem_object *obj,GEM_BUG_ON (!i915->params.enable_eviction);assert_object_held (obj); - start = jiffies; src = obj->swapto;
@@ -134,10 +140,14 @@ i915_gem_object_swapin_pages(struct drm_i915_gem_object *obj,if (i915->params.enable_eviction >=2 ) { err =i915_window_blt_copy (dst, src);if (!err) - blt_completed = true; + stat = &i915->mm.blt_swap_stats.in; } -if (err && i915->params.enable_eviction !=2 ) + +if (err && i915->params.enable_eviction !=2 ) { err =i915_gem_object_memcpy (dst, src); +if (!err) + stat = &i915->mm.memcpy_swap_stats.in; + }__i915_gem_object_unpin_pages (dst);__i915_gem_object_unset_pages (dst);
@@ -149,18 +159,7 @@ i915_gem_object_swapin_pages(struct drm_i915_gem_object *obj,i915_gem_object_put (src); } -if (!err) { - diff = jiffies - start; - msec = diff *1000 /HZ ; -if (blt_completed) { -atomic_long_add (sizes, &i915->num_bytes_swapped_in); -atomic_long_add (msec, &i915->time_swap_in_ms); - }else { -atomic_long_add (sizes, - &i915->num_bytes_swapped_in_memcpy); -atomic_long_add (msec, &i915->time_swap_in_ms_memcpy); - } - } +__update_stat (stat, sizes >>PAGE_SHIFT , start);return err; }
drivers/gpu/drm/i915/i915_debugfs.c +37 -36
90 lines not on this page · raw message
drivers/gpu/drm/i915/i915_drv.h +15 -10
@@ -49,6 +49,7 @@#include <linux/shmem_fs.h> #include <linux/stackdepot.h> #include <linux/xarray.h> +#include <linux/seqlock.h> #include <drm/intel-gtt.h> #include <drm/drm_legacy.h> /* for struct drm_dma_handle */
@@ -548,6 +549,17 @@ struct intel_l3_parity {int which_slice; }; +struct i915_mm_swap_stat { +seqlock_t lock; +unsigned long pages; +ktime_t time; +}; + +struct i915_mm_swap_stats { +struct i915_mm_swap_stat in; +struct i915_mm_swap_stat out; +}; +struct i915_gem_mm {/* Protects bound_list/unbound_list and #drm_i915_gem_object.mm.link */ spinlock_t obj_lock;
@@ -601,6 +613,9 @@ struct i915_gem_mm {/* To protect above two set of vmas */ wait_queue_head_t window_queue; + +struct i915_mm_swap_stats blt_swap_stats; +struct i915_mm_swap_stats memcpy_swap_stats; };#define I915_IDLE_ENGINES_TIMEOUT (200)/* in ms */
@@ -1220,16 +1235,6 @@ struct drm_i915_private {* NOTE: This is the dri1/ums dungeon, don't add stuff here. Your patch * will be rejected. Instead look for a better place. */ - -atomic_long_t num_bytes_swapped_out; -atomic_long_t num_bytes_swapped_in; -atomic_long_t time_swap_out_ms; -atomic_long_t time_swap_in_ms; - -atomic_long_t num_bytes_swapped_out_memcpy; -atomic_long_t num_bytes_swapped_in_memcpy; -atomic_long_t time_swap_out_ms_memcpy; -atomic_long_t time_swap_in_ms_memcpy; };static inline struct drm_i915_private *to_i915 (const struct drm_device *dev)
drivers/gpu/drm/i915/i915_gem.c +5 -0
@@ -1151,6 +1151,11 @@ static void i915_gem_init__mm(struct drm_i915_private *i915)INIT_LIST_HEAD (&i915->mm.purge_list);INIT_LIST_HEAD (&i915->mm.shrink_list); +seqlock_init (&i915->mm.blt_swap_stats.in.lock); +seqlock_init (&i915->mm.blt_swap_stats.out.lock); +seqlock_init (&i915->mm.memcpy_swap_stats.in.lock); +seqlock_init (&i915->mm.memcpy_swap_stats.out.lock); +i915_gem_init__objects (i915); }
Signature · 6 lines
2.26.2 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [Intel-gfx] [RFC PATCH 157/162] drm/i915: Improve accuracy of eviction stats
Quoting Matthew Auld (2020-11-27 12:07:13)
Quoted 16 lines
From: Tvrtko Ursulin <[email protected]>
Current code uses jiffie time to do the accounting and then does:
diff = jiffies - start; msec = diff * 1000 / HZ; ... atomic_long_add(msec, &i915->time_swap_out_ms);If we assume jiffie can be as non-granular as 10ms and that the current accounting records all evictions faster than one jiffie as infinite speed, we can end up over-estimating the reported eviction throughput.
Fix this by accumulating
ktime_tand only dividing to more user friendly granularity at presentation time (debugfs read).
Quoted 7 lines
At the same time consolidate the code a bit and convert from multiple atomics to single seqlock per stat.
Signed-off-by Tvrtko Ursulin <[email protected]>Cc CQ Tang <[email protected]>Cc Sudeep Dutt <[email protected]>Cc Mika Kuoppala <[email protected]>
A lot of effort to fix up patches after the fact, might as well make it a real PMU interface.
-Chris
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [Intel-gfx] [RFC PATCH 157/162] drm/i915: Improve accuracy of eviction stats
Quoted 20 lines · Chris Wilson
Quoting Matthew Auld (2020-11-27 12:07:13)
Quoted 19 lines
From: Tvrtko Ursulin <[email protected]>
Current code uses jiffie time to do the accounting and then does:
diff = jiffies - start; msec = diff * 1000 / HZ; ... atomic_long_add(msec, &i915->time_swap_out_ms);If we assume jiffie can be as non-granular as 10ms and that the current accounting records all evictions faster than one jiffie as infinite speed, we can end up over-estimating the reported eviction throughput.
Fix this by accumulating
ktime_tand only dividing to more user friendly granularity at presentation time (debugfs read).At the same time consolidate the code a bit and convert from multiple atomics to single seqlock per stat.
Quoted 7 lines
Quoted 4 lines
Signed-off-by Tvrtko Ursulin <[email protected]>Cc CQ Tang <[email protected]>Cc Sudeep Dutt <[email protected]>Cc Mika Kuoppala <[email protected]>A lot of effort to fix up patches after the fact, might as well make it a real PMU interface.
It did cross my mind and should be easy to add on top if deemed useful or interesting.
More importantly, it is okay with me to incorporate this patch into the earlier one(s) which first added statistics.
Regards,
Tvrtko
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
RFC PATCH 158/162 drm/i915: Support ww locks in suspend/resume
In reply to Matthew AuldFrom: Venkata Ramana Nayana <[email protected]>
Add ww locks during suspend/resume.
--- drivers/gpu/drm/i915/i915_drv.c | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-)
drivers/gpu/drm/i915/i915_drv.c +18 -15
@@ -1099,7 +1099,7 @@ static int i915_drm_prepare(struct drm_device *dev)struct drm_i915_private *i915 =to_i915 (dev);if (HAS_LMEM (i915)) { -struct intel_gt *gt= &i915->gt; +struct intel_gt *gt = &i915->gt;long timeout =I915_GEM_IDLE_TIMEOUT ;int ret;
@@ -1182,7 +1182,8 @@ static int intel_dmem_evict_buffers(struct drm_device *dev, bool in_suspend,struct drm_i915_private *i915 =to_i915 (dev);struct drm_i915_gem_object *obj;struct intel_memory_region *mem; -int id, ret =0 ; +struct i915_gem_ww_ctx ww; +int id, ret =0 , err =0 ;for_each_memory_region (mem, i915, id) {struct list_head still_in_list;
@@ -1204,19 +1205,20 @@ static int intel_dmem_evict_buffers(struct drm_device *dev, bool in_suspend,mutex_unlock (&mem->objects.lock); +i915_gem_ww_ctx_init (&ww, true); +retry: + err =i915_gem_object_lock (obj, &ww); +if (err) + goto out_err; +if (in_suspend) { obj->swapto =NULL ; obj->evicted = false; ret =i915_gem_object_unbind (obj,0 );if (ret ||i915_gem_object_has_pinned_pages (obj)) { -if (!i915_gem_object_trylock (obj)) { - ret = -EBUSY ; - goto next; - } ret =i915_gem_perma_pinned_object_swapout (obj); -i915_gem_object_unlock (obj); - goto next; + goto out_err; } obj->do_swapping = true;
@@ -1228,13 +1230,7 @@ static int intel_dmem_evict_buffers(struct drm_device *dev, bool in_suspend, obj->evicted = true; }else {if (i915_gem_object_has_pinned_pages (obj) && perma_pin) { -if (!i915_gem_object_trylock (obj)) { - ret = -EBUSY ; - goto next; - } ret =i915_gem_perma_pinned_object_swapin (obj); -/* FIXME: Where is this error message taken care of? */ -i915_gem_object_unlock (obj); }if (obj->swapto && obj->evicted && !perma_pin) {
@@ -1247,7 +1243,14 @@ static int intel_dmem_evict_buffers(struct drm_device *dev, bool in_suspend, } } } -next: +out_err: +if (err == -EDEADLK ) { + err =i915_gem_ww_ctx_backoff (&ww); +if (!err) + goto retry; + } +i915_gem_ww_ctx_fini (&ww); +mutex_lock (&mem->objects.lock);if (ret)break ;
Signature · 6 lines
2.26.2 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
RFC PATCH 159/162 drm/i915/dg1: Fix mapping type for default state object
In reply to Matthew AuldFrom: Venkata Ramana Nayana <[email protected]>
Use I915_MAP_WC when default state object is allocated on LMEM.
--- drivers/gpu/drm/i915/gt/shmem_utils.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/gt/shmem_utils.c +3 -1
@@ -8,6 +8,7 @@#include <linux/shmem_fs.h> #include "gem/i915_gem_object.h" +#include "gem/i915_gem_lmem.h" #include "shmem_utils.h" struct file *shmem_create_from_data (const char *name,void *data,size_t len)
@@ -39,7 +40,8 @@ struct file *shmem_create_from_object(struct drm_i915_gem_object *obj)return file; } - ptr =i915_gem_object_pin_map_unlocked (obj,I915_MAP_WB ); + ptr =i915_gem_object_pin_map_unlocked (obj,i915_gem_object_is_lmem (obj) ? +I915_MAP_WC :I915_MAP_WB );if (IS_ERR (ptr))return ERR_CAST (ptr);
Signature · 6 lines
2.26.2 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
RFC PATCH 160/162 drm/i915/dg1: Fix GPU hang due to shmemfs page drop
In reply to Matthew AuldFrom: Venkata Ramana Nayana <[email protected]>
This is to fix a bug in upstream
commit a6326a4f8ffb ("drm/i915/gt: Keep a no-frills swappable copy of the default context state")
We allocate context state obj ce->state from lmem, so in __engines_record_defaults(), we call shmem_create_from_object(). Because it is lmem object, this call will create a new shmemfs file, copy the contents into it, and return the file pointer and assign to engine->default_state. Of course ce->state lmem object is freed at the end of function __engines_record_redefaults().
Because a new shmemfs file is create for engine->default_state, and more importantly, we DON'T mark the pages dirty after we write into it, the OS page cache eviction will drop these pages.
Now with the test move forward, it will create new request/context, and will copy the saved engine->default_state into ce->state. If the default_state pages are dropped during page cache eviction, the copying will get new pages, and copy garbage from the new pages. Next, ce->state will have wrong instruction and causes GPU to hang.
The fixing is very simple, we just mark the shmemfs pages to be dirty when writing into it, and also mark the pages to accessed when read/write to them.
--- drivers/gpu/drm/i915/gt/shmem_utils.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/gt/shmem_utils.c +5 -2
@@ -105,10 +105,13 @@ static int __shmem_rw(struct file *file, loff_t off,return PTR_ERR (page); vaddr =kmap (page); -if (write) +if (write) {memcpy (vaddr +offset_in_page (off), ptr, this); -else +set_page_dirty (page); + }else {memcpy (ptr, vaddr +offset_in_page (off), this); + } +mark_page_accessed (page);kunmap (page);put_page (page);
Signature · 6 lines
2.26.2 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [Intel-gfx] [RFC PATCH 160/162] drm/i915/dg1: Fix GPU hang due to shmemfs page drop
Quoting Matthew Auld (2020-11-27 12:07:16)
Quoted 21 lines
From: Venkata Ramana Nayana <[email protected]>
This is to fix a bug in upstream
commita6326a4f8ffb("drm/i915/gt: Keep a no-frills swappable copy of the default context state")We allocate context state obj
ce->statefrom lmem, so in__engines_record_defaults(), we callshmem_create_from_object(). Because it is lmem object, this call will create a new shmemfs file, copy the contents into it, and return the file pointer and assign toengine->default_state. Of coursece->statelmem object is freed at the end of function__engines_record_redefaults().Because a new shmemfs file is create for
engine->default_state, and more importantly, we DON'T mark the pages dirty after we write into it, the OS page cache eviction will drop these pages.Now with the test move forward, it will create new request/context, and will copy the saved
engine->default_stateintoce->state. If thedefault_statepages are dropped during page cache eviction, the copying will get new pages, and copy garbage from the new pages. Next,ce->statewill have wrong instruction and causes GPU to hang.
Quoted 4 lines
The fixing is very simple, we just mark the shmemfs pages to be dirty when writing into it, and also mark the pages to accessed when read/write to them.
Fixes a6326a4f8ffb("drm/i915/gt: Keep a no-frills swappable copy of the default context state")
A bug fix, send it. But please write a concise changelog first.
I missed setting the dirty bit, and so the contents were not being saved on swap out as expected. Impact is severe; any context created after resume may be gibberish.
-Chris
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
RFC PATCH 161/162 drm/i915/dg1: allow pci to auto probe
In reply to Matthew AuldFrom: Lucas De Marchi <[email protected]>
--- drivers/gpu/drm/i915/i915_pci.c | 1 + 1 file changed, 1 insertion(+)
drivers/gpu/drm/i915/i915_pci.c +1 -0
@@ -1001,6 +1001,7 @@ static const struct pci_device_id pciidlist[] = {INTEL_JSL_IDS (&jsl_info),INTEL_TGL_12_IDS (&tgl_info),INTEL_RKL_IDS (&rkl_info), +INTEL_DG1_IDS (&dg1_info), {0, 0, 0} };MODULE_DEVICE_TABLE (pci, pciidlist);
Signature · 6 lines
2.26.2 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
RFC PATCH 162/162 drm/i915: drop fake lmem
In reply to Matthew Auld--- drivers/gpu/drm/i915/i915_drv.c | 15 ---- drivers/gpu/drm/i915/i915_params.c | 5 -- drivers/gpu/drm/i915/i915_params.h | 1 - drivers/gpu/drm/i915/intel_memory_region.c | 11 +-- drivers/gpu/drm/i915/intel_region_lmem.c | 96 ---------------------- drivers/gpu/drm/i915/intel_region_lmem.h | 3 - 6 files changed, 1 insertion(+), 130 deletions(-)
drivers/gpu/drm/i915/i915_drv.c +0 -15
@@ -836,21 +836,6 @@ int i915_driver_probe(struct pci_dev *pdev, const struct pci_device_id *ent)if (!i915->params.nuclear_pageflip && match_info->gen <5 ) i915->drm.driver_features &= ~DRIVER_ATOMIC ; -/* -* Check if we support fake LMEM -- for now we only unleash this for -* the live selftests(test-and-exit). -*/ -#if IS_ENABLED (CONFIG_DRM_I915_SELFTEST ) -if (IS_ENABLED (CONFIG_DRM_I915_UNSTABLE_FAKE_LMEM )) { -if (INTEL_GEN (i915) >=9 && i915_selftest.live <0 && - i915->params.fake_lmem_start) { -mkwrite_device_info (i915)->memory_regions = -REGION_SMEM |REGION_LMEM |REGION_STOLEN_SMEM ; -GEM_BUG_ON (!HAS_LMEM (i915)); - } - } -#endif - ret =pci_enable_device (pdev);if (ret) goto out_fini;
drivers/gpu/drm/i915/i915_params.c +0 -5
@@ -192,11 +192,6 @@ i915_param_named(enable_gvt, bool, 0400, "Enable support for Intel GVT-g graphics virtualization host support(default:false)");#endif -#if IS_ENABLED (CONFIG_DRM_I915_UNSTABLE_FAKE_LMEM ) -i915_param_named_unsafe (fake_lmem_start, ulong,0400 , -"Fake LMEM start offset (default: 0)" ); -#endif -i915_param_named_unsafe (enable_eviction, uint,0600 ,"Enable eviction which does not rely on DMA resv refactoring " "0=disabled, 1=memcpy based only, 2=blt based only, "
drivers/gpu/drm/i915/i915_params.h +0 -1
@@ -70,7 +70,6 @@ struct drm_printer; param(int, fastboot, -1, 0600) \ param(int, enable_dpcd_backlight, -1, 0600) \ param(char *, force_probe, CONFIG_DRM_I915_FORCE_PROBE, 0400) \ - param(unsigned long, fake_lmem_start, 0, 0400) \ param(unsigned int, lmem_size, 0, 0400) \ param(unsigned int, enable_eviction, 3, 0600) \/* leave bools at the end to not create holes */ \
drivers/gpu/drm/i915/intel_memory_region.c +1 -10
@@ -447,16 +447,7 @@ int intel_memory_regions_hw_probe(struct drm_i915_private *i915) mem =i915_gem_stolen_setup (i915);break ;case INTEL_MEMORY_LOCAL : -#if IS_ENABLED (CONFIG_DRM_I915_SELFTEST ) -if (IS_ENABLED (CONFIG_DRM_I915_UNSTABLE_FAKE_LMEM )) { -if (INTEL_GEN (i915) >=9 && i915_selftest.live <0 && - i915->params.fake_lmem_start) - mem =intel_setup_fake_lmem (i915); - } -#endif - -if (IS_ERR (mem)) - mem =i915_gem_setup_lmem (i915); + mem =i915_gem_setup_lmem (i915);break ; }
drivers/gpu/drm/i915/intel_region_lmem.c +0 -96
117 lines not on this page · raw message
drivers/gpu/drm/i915/intel_region_lmem.h +0 -3
@@ -12,7 +12,4 @@ extern const struct intel_memory_region_ops intel_region_lmem_ops;struct intel_memory_region *i915_gem_setup_lmem (struct drm_i915_private *i915); -struct intel_memory_region * -intel_setup_fake_lmem (struct drm_i915_private *i915); -#endif /* !__INTEL_REGION_LMEM_H */
Signature · 6 lines
2.26.2 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Patchwork
CI[Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for DG1 + LMEM enabling
In reply to Matthew Auld== Series Details ==
== Series Details ==
Series: DG1 + LMEM enabling
URL : https://patchwork.freedesktop.org/series/84344/
State : warning
== Summary ==
$ dim checkpatch origin/drm-tip ecc99f864651 drm/i915/selftest: also consider non-contiguous objects 3c1e72a3ebbe drm/i915/selftest: assert we get 2M GTT pages -:21: CHECK:LINE_SPACING: Please don't use multiple blank lines #21: FILE: drivers/gpu/drm/i915/gem/selftests/huge_pages.c:371:
+
-:41: CHECK:LINE_SPACING: Please don't use multiple blank lines #41: FILE: drivers/gpu/drm/i915/gem/selftests/huge_pages.c:391:
+
+
total: 0 errors, 0 warnings, 2 checks, 27 lines checked37a823615518 drm/i915/selftest: handle local-memory in perf_memcpy5e4d77873cee drm/i915/gt: Move move context layout registers and offsets to lrc_reg.h ec25b9b7e7bf drm/i915/gt: Rename lrc.c to execlists_submission.c
-:79: WARNING:FILE_PATH_CHANGES: added, moved or deleted file(s), does MAINTAINERS need updating? #79:
rename from drivers/gpu/drm/i915/gt/intel_lrc.c
total: 0 errors, 1 warnings, 0 checks, 177 lines checkedeb9b76584a33 drm/i915: split gen8+ flush and bb_start emission functions to their own file -:31: WARNING:FILE_PATH_CHANGES: added, moved or deleted file(s), does MAINTAINERS need updating? #31:
new file mode 100644
-:220: WARNING:EMBEDDED_FUNCTION_NAME: Prefer using '"%s...", __func__' to using 'aux_inv_reg', this function's name, in a string #220: FILE: drivers/gpu/drm/i915/gt/gen8_engine_cs.c:185:
+ GEM_BUG_ON("unknown aux_inv_reg\n");
-:428: CHECK:LINE_SPACING: Please don't use multiple blank lines #428: FILE: drivers/gpu/drm/i915/gt/gen8_engine_cs.c:393:
+
+
total: 0 errors, 2 warnings, 1 checks, 829 lines checked4d38888a6e1b drm/i915: split wa_bb code to its own file
-:29: WARNING:FILE_PATH_CHANGES: added, moved or deleted file(s), does MAINTAINERS need updating? #29:
new file mode 100644
total: 0 errors, 1 warnings, 0 checks, 701 lines checked151185a3fc12 HAX drm/i915: Work around the selftest timeline lock splat workaround 450f75d41b63 drm/i915: Introduce drm_i915_lock_isolated
-:25: CHECK:MACRO_ARG_REUSE: Macro argument reuse 'obj' - possible side-effects? #25: FILE: drivers/gpu/drm/i915/gem/i915_gem_object.h:110:
+#define object_is_isolated(obj) \
+ (!IS_ENABLED(CONFIG_LOCKDEP) || \
+ ((kref_read(&obj->base.refcount) == 0) || \
+ ((kref_read(&obj->base.refcount) == 1) && \
+ list_empty_careful(&obj->mm.link) && \
+ list_empty_careful(&obj->vma.list))))
-:25: CHECK:MACRO_ARG_PRECEDENCE: Macro argument 'obj' may be better as '(obj)' to avoid precedence issues #25: FILE: drivers/gpu/drm/i915/gem/i915_gem_object.h:110:
+#define object_is_isolated(obj) \
+ (!IS_ENABLED(CONFIG_LOCKDEP) || \
+ ((kref_read(&obj->base.refcount) == 0) || \
+ ((kref_read(&obj->base.refcount) == 1) && \
+ list_empty_careful(&obj->mm.link) && \
+ list_empty_careful(&obj->vma.list))))
total: 0 errors, 0 warnings, 2 checks, 28 lines checked dcd32ce75f16 drm/i915: Lock hwsp objects isolated for pinning at create time 2e77f388c53a drm/i915: Pin timeline map after first timeline pin, v5. 4277aa6901de drm/i915: Move cmd parser pinning to execbuffer 1ac931e19fb2 drm/i915: Add missing -EDEADLK handling to execbuf pinning, v2. -:55: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #55: FILE: drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c:451:
+ err = i915_vma_pin_ww(vma, &eb->ww,
entry->pad_to_size,
total: 0 errors, 0 warnings, 1 checks, 75 lines checked 52b472892a57 drm/i915: Ensure we hold the object mutex in pin correctly v2 67281c042a1c drm/i915: Add gem object locking to madvise. d6f3a6ff8ec5 drm/i915: Move HAS_STRUCT_PAGE to obj->flags
-:110: WARNING:UNSPECIFIED_INT: Prefer 'unsigned int' to bare use of 'unsigned' #110: FILE: drivers/gpu/drm/i915/gem/i915_gem_object.c:63:
+ struct lock_class_key *key, unsigned flags)
-:133: WARNING:UNSPECIFIED_INT: Prefer 'unsigned int' to bare use of 'unsigned' #133: FILE: drivers/gpu/drm/i915/gem/i915_gem_object.h:27:
+ unsigned alloc_flags);
total: 0 errors, 2 warnings, 0 checks, 348 lines checkedf5fd74ff0eb5 drm/i915: Rework struct phys attachment handlingf2139104bdcb drm/i915: Convert i915_gem_object_attach_phys() to ww locking, v2.8625ed6419dc drm/i915: make lockdep slightly happier about execbuf.1eaf989afae0 drm/i915: Disable userptr pread/pwrite support.eae3f2ab3922 drm/i915: No longer allow exporting userptr through dma-bufb78c8c467a1f drm/i915: Reject more ioctls for userptrcccfa9edcf51 drm/i915: Reject UNSYNCHRONIZED for userptr, v2.154de4c68c26 drm/i915: Make compilation of userptr code depend on MMU_NOTIFIER.7523423fd46d drm/i915: Fix userptr so we do not have to worry about obj->mm.lock, v5.
-:281: WARNING:LONG_LINE: line length of 121 exceeds 100 columns
#281: FILE: drivers/gpu/drm/i915/gem/i915_gem_object.h:578:
+static inline int i915_gem_object_userptr_submit_init(struct drm_i915_gem_object *obj) { GEM_BUG_ON(1); return -ENODEV; }
-:282: WARNING:LONG_LINE: line length of 121 exceeds 100 columns
#282: FILE: drivers/gpu/drm/i915/gem/i915_gem_object.h:579:
+static inline int i915_gem_object_userptr_submit_done(struct drm_i915_gem_object *obj) { GEM_BUG_ON(1); return -ENODEV; }
-:283: WARNING:LONG_LINE: line length of 106 exceeds 100 columns
#283: FILE: drivers/gpu/drm/i915/gem/i915_gem_object.h:580:
+static inline void i915_gem_object_userptr_submit_fini(struct drm_i915_gem_object *obj) { GEM_BUG_ON(1); }
-:341: WARNING:SPDX_LICENSE_TAG: Misplaced SPDX-License-Identifier tag - use line 1 instead #341: FILE: drivers/gpu/drm/i915/gem/i915_gem_userptr.c:2:
* SPDX-License-Identifier: MIT
-:345: WARNING:BLOCK_COMMENT_STYLE: Block comments should align the * on each line #345: FILE: drivers/gpu/drm/i915/gem/i915_gem_userptr.c:6:
+ *
+ * Based on amdgpu_mn, which bears the following notice:
-:346: WARNING:BLOCK_COMMENT_STYLE: Block comments should align the * on each line #346: FILE: drivers/gpu/drm/i915/gem/i915_gem_userptr.c:7:
+ * Based on amdgpu_mn, which bears the following notice:
+ *
-:459: WARNING:LONG_LINE: line length of 106 exceeds 100 columns #459: FILE: drivers/gpu/drm/i915/gem/i915_gem_userptr.c:63:
+ struct drm_i915_gem_object *obj = container_of(mni, struct drm_i915_gem_object, userptr.notifier);
-:1113: CHECK:MULTIPLE_ASSIGNMENTS: multiple assignments should be avoided #1113: FILE: drivers/gpu/drm/i915/gem/i915_gem_userptr.c:294:
+ pinned = ret = 0;
-:1128: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #1128: FILE: drivers/gpu/drm/i915/gem/i915_gem_userptr.c:309:
+ if (mmu_interval_read_retry(&obj->userptr.notifier,
+ !obj->userptr.page_ref ? notifier_seq :
-:1249: CHECK:UNCOMMENTED_DEFINITION: spinlock_t definition without comment #1249: FILE: drivers/gpu/drm/i915/i915_drv.h:597:
+ spinlock_t notifier_lock;
total: 0 errors, 7 warnings, 3 checks, 1201 lines checked 017b310c32a3 drm/i915: Flatten obj->mm.lock36ad03b9459e drm/i915: Populate logical context during first pin. -:180: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #180: FILE: drivers/gpu/drm/i915/gt/intel_execlists_submission.c:4848:
+virtual_context_pre_pin(struct intel_context *ce,
+ struct i915_gem_ww_ctx *ww, void **vaddr)
total: 0 errors, 0 warnings, 1 checks, 169 lines checked34b1aa8c9124 drm/i915: Make ring submission compatible with obj->mm.lock removal, v2. 9d0185cb4582 drm/i915: Handle ww locking in init_status_page d52ff035dcdf drm/i915: Rework clflush to work correctly without obj->mm.lock. 82c19c566326 drm/i915: Pass ww ctx to intel_pin_to_display_plane 3e82ce86e8a8 drm/i915: Add object locking to vm_fault_cpu776c4968310c drm/i915: Move pinning to inside engine_wa_list_verify() -:57: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #57: FILE: drivers/gpu/drm/i915/gt/intel_workarounds.c:2209:
+ err = i915_vma_pin_ww(vma, &ww, 0, 0,
+ i915_vma_is_ggtt(vma) ? PIN_GLOBAL : PIN_USER);
total: 0 errors, 0 warnings, 1 checks, 109 lines checkedace7a49a44b4 drm/i915: Take reservation lock around i915_vma_pin. c514ed4de29a drm/i915: Make intel_init_workaround_bb more compatible with ww locking. -:113: CHECK:LINE_SPACING: Please don't use multiple blank lines
#113: FILE: drivers/gpu/drm/i915/gt/intel_engine_workaround_bb.c:360:
+
total: 0 errors, 0 warnings, 1 checks, 92 lines checked c09d61d0c59a drm/i915: Make __engine_unpark() compatible with ww locking v2 -:11: WARNING:REPEATED_WORD: Possible repeated word: 'many' #11:
many many places where rpm is used, I chose the safest option
total: 0 errors, 1 warnings, 0 checks, 16 lines checked8e69aa4f0efd drm/i915: Take obj lock around set_domain ioctl99a95058dcdb drm/i915: Defer pin calls in buffer pool until first use by caller. ce9f6c46fc3a drm/i915: Fix pread/pwrite to work with new locking rules.
-:32: WARNING:FILE_PATH_CHANGES: added, moved or deleted file(s), does MAINTAINERS need updating? #32:
deleted file mode 100644
total: 0 errors, 1 warnings, 0 checks, 359 lines checkedc6c0c64d6026 drm/i915: Fix workarounds selftest, part 179bd0897399a drm/i915: Prepare for obj->mm.lock removal52f9f5f31a0f drm/i915: Add igt_spinner_pin() to allow for ww locking around spinner. eb6fcc0954ff drm/i915: Add ww locking around vm_access()cd47b7ad5405 drm/i915: Increase ww locking for perf.244dae79052a drm/i915: Lock ww in ucode objects correctly333090d025a8 drm/i915: Add ww locking to dma-buf ops.09740eb15ae0 drm/i915: Add missing ww lock in intel_dsb_prepare. 0cd52e7ebb96 drm/i915: Fix ww locking in shmem_create_from_object fae9a34de3ad drm/i915: Use a single page table lock for each gtt. -:112: WARNING:UNNECESSARY_ELSE: else is not generally useful after a break or return #112: FILE: drivers/gpu/drm/i915/gt/intel_gtt.c:85:
+ return i915_gem_object_lock(vm->scratch[0], ww);
+ } else {
total: 0 errors, 1 warnings, 0 checks, 153 lines checkedf95d0fb66807 drm/i915/selftests: Prepare huge_pages testcases for obj->mm.lock removal. 2c146f16bb0f drm/i915/selftests: Prepare client blit for obj->mm.lock removal. 639fcd5ea986 drm/i915/selftests: Prepare coherency tests for obj->mm.lock removal. 57c19694c266 drm/i915/selftests: Prepare context tests for obj->mm.lock removal. c25eb6821a19 drm/i915/selftests: Prepare dma-buf tests for obj->mm.lock removal. 3f28d8d73a33 drm/i915/selftests: Prepare execbuf tests for obj->mm.lock removal. 89afabcc408e drm/i915/selftests: Prepare mman testcases for obj->mm.lock removal. ba084a771fd9 drm/i915/selftests: Prepare object tests for obj->mm.lock removal. 4a4950747bae drm/i915/selftests: Prepare object blit tests for obj->mm.lock removal. 5a39c68fb094 drm/i915/selftests: Prepare igt_gem_utils for obj->mm.lock removal 8fec33b51cda drm/i915/selftests: Prepare context selftest for obj->mm.lock removal 795a67bb1fbf drm/i915/selftests: Prepare hangcheck for obj->mm.lock removal a94b8d1885c2 drm/i915/selftests: Prepare execlists for obj->mm.lock removal -:159: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #159: FILE: drivers/gpu/drm/i915/gt/selftest_execlists.c:5857:
+ lrc = i915_gem_object_pin_map_unlocked(ce->state->obj,
i915_coherent_map_type(engine->i915));
total: 0 errors, 0 warnings, 1 checks, 130 lines checked602f787839eb drm/i915/selftests: Prepare mocs tests for obj->mm.lock removal dd71228759cc drm/i915/selftests: Prepare ring submission for obj->mm.lock removal 37021ba46236 drm/i915/selftests: Prepare timeline tests for obj->mm.lock removal 27d90930aa00 drm/i915/selftests: Prepare i915_request tests for obj->mm.lock removal f5a8a22004f2 drm/i915/selftests: Prepare memory region tests for obj->mm.lock removal 285510611ec9 drm/i915/selftests: Prepare cs engine tests for obj->mm.lock removal e83d2d2ded23 drm/i915/selftests: Prepare gtt tests for obj->mm.lock removal 84a9ca7ba448 drm/i915: Finally remove obj->mm.lock.fcf207bef4c6 drm/i915: Keep userpointer bindings if seqcount is unchanged, v2. 9d27adfe1cd7 drm/i915: Avoid some false positives in assert_object_held() -:27: CHECK:MACRO_ARG_REUSE: Macro argument reuse 'obj' - possible side-effects? #27: FILE: drivers/gpu/drm/i915/gem/i915_gem_object.h:121:
+#define assert_object_held(obj) do { \
+ dma_resv_assert_held((obj)->base.resv); \
+ WARN_ON(!ww_mutex_is_locked(&(obj)->base.resv->lock)); \
+ } while (0)
total: 0 errors, 0 warnings, 1 checks, 15 lines checkedd58138a3962d drm/i915: Reference contending lock objectsad0364e0969c drm/i915: Break out dma_resv ww locking utilities to separate files -:144: WARNING:FILE_PATH_CHANGES: added, moved or deleted file(s), does MAINTAINERS need updating? #144:
new file mode 100644
-:169: WARNING:LONG_LINE: line length of 103 exceeds 100 columns #169: FILE: drivers/gpu/drm/i915/i915_gem_ww.c:21:
+ while ((obj = list_first_entry_or_null(&ww->obj_list, struct drm_i915_gem_object, obj_link))) {
total: 0 errors, 2 warnings, 0 checks, 189 lines checked 94aeb7363b28 drm/i915: Introduce a for_i915_gem_ww(){}
-:56: CHECK:MACRO_ARG_REUSE: Macro argument reuse '_ww' - possible side-effects? #56: FILE: drivers/gpu/drm/i915/i915_gem_ww.h:46:
+#define for_i915_gem_ww(_ww, _err, _intr) \
+ for (__i915_gem_ww_init(_ww, _intr); (_ww)->loop; \
+ _err = __i915_gem_ww_fini(_ww, _err))
-:56: CHECK:MACRO_ARG_REUSE: Macro argument reuse '_err' - possible side-effects? #56: FILE: drivers/gpu/drm/i915/i915_gem_ww.h:46:
+#define for_i915_gem_ww(_ww, _err, _intr) \
+ for (__i915_gem_ww_init(_ww, _intr); (_ww)->loop; \
+ _err = __i915_gem_ww_fini(_ww, _err))
total: 0 errors, 0 warnings, 2 checks, 41 lines checkedf9f3ea170515 drm/i915: Untangle the vma pages_mutexf5559b991383 drm/i915/fbdev: Use lmem physical addresses for fb_mmap() on discrete fd9e9f4efbc5 drm/i915: Return error value when bo not in LMEM for discrete 7160b8cb229a drm/i915/dmabuf: Disallow LMEM objects from dma-buf -:35: WARNING:ENOTSUPP: ENOTSUPP is not a SUSV4 error code, prefer EOPNOTSUPP #35: FILE: drivers/gpu/drm/i915/gem/i915_gem_dmabuf.c:30:
+ ret = -ENOTSUPP;
-:49: WARNING:ENOTSUPP: ENOTSUPP is not a SUSV4 error code, prefer EOPNOTSUPP #49: FILE: drivers/gpu/drm/i915/gem/i915_gem_dmabuf.c:260:
+ return ERR_PTR(-ENOTSUPP);
total: 0 errors, 2 warnings, 0 checks, 28 lines checked 425ac61c78e0 drm/i915/lmem: Fail driver init if LMEM training failed 638e59094088 HAX drm/i915/lmem: support CPU relocations -:83: CHECK:SPACING: No space is necessary after a cast #83: FILE: drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c:1204:
+ io_mapping_unmap_atomic((void __force __iomem *) unmask_page(cache->vaddr));
total: 0 errors, 0 warnings, 1 checks, 119 lines checked 7c7b8d398ff6 HAX drm/i915/lmem: support pread and pwrite 36db22233ecf drm/i915: Update the helper to set correct mapping -:14: WARNING:BAD_SIGN_OFF: Duplicate signature
#14:
Cc: Matthew Auld <[email protected]>
-:53: WARNING:LONG_LINE: line length of 106 exceeds 100 columns #53: FILE: drivers/gpu/drm/i915/gt/intel_execlists_submission.c:3538:
+ i915_coherent_map_type(ce->engine->i915, ce->state->obj, false) |
-:69: CHECK:BRACES: Unbalanced braces around else statement #69: FILE: drivers/gpu/drm/i915/gt/intel_ring.c:54:
+ else {
total: 0 errors, 2 warnings, 1 checks, 159 lines checked3db87b4f64ed drm/i915: introduce kernel blitter_context4bb2bb3961aa drm/i915/region: support basic eviction1e5ec74bb7b8 drm/i915: Add blit functions that can be called from within a WW transaction -:79: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #79: FILE: drivers/gpu/drm/i915/gem/i915_gem_object_blt.c:219:
+int i915_gem_object_fill_blt(struct drm_i915_gem_object *obj,
+ struct intel_context *ce,
-:104: CHECK:LINE_SPACING: Please don't use multiple blank lines #104: FILE: drivers/gpu/drm/i915/gem/i915_gem_object_blt.c:243:
+
total: 0 errors, 0 warnings, 2 checks, 189 lines checked ccd239f2c053 drm/i915: Delay publishing objects on the eviction lists bd78bfa4452f drm/i915: support basic object migration -:14: WARNING:BAD_SIGN_OFF: Duplicate signature
#14:
Cc: Abdiel Janulgue <[email protected]>
-:172: CHECK:BRACES: braces {} should be used on all arms of this statement #172: FILE: drivers/gpu/drm/i915/gem/i915_gem_object.c:408:
+ if (obj->base.filp)
[...]
+ else if (donor->base.filp) {
[...]
total: 0 errors, 1 warnings, 1 checks, 404 lines checked 87518556758f drm/i915/dg1: Fix occasional migration error 985600b152ca drm/i915/query: Expose memory regions through the query uAPI -:180: WARNING:LEADING_SPACE: please, no spaces at the start of a line #180: FILE: drivers/gpu/drm/i915/intel_memory_region.c:10:
+ [INTEL_REGION_SMEM] = {$
-:181: ERROR:CODE_INDENT: code indent should use tabs where possible #181: FILE: drivers/gpu/drm/i915/intel_memory_region.c:11:
+ .class = INTEL_MEMORY_SYSTEM,$
-:181: WARNING:LEADING_SPACE: please, no spaces at the start of a line #181: FILE: drivers/gpu/drm/i915/intel_memory_region.c:11:
+ .class = INTEL_MEMORY_SYSTEM,$
-:182: ERROR:CODE_INDENT: code indent should use tabs where possible #182: FILE: drivers/gpu/drm/i915/intel_memory_region.c:12:
+ .instance = 0,$
-:182: WARNING:LEADING_SPACE: please, no spaces at the start of a line #182: FILE: drivers/gpu/drm/i915/intel_memory_region.c:12:
+ .instance = 0,$
-:183: WARNING:LEADING_SPACE: please, no spaces at the start of a line #183: FILE: drivers/gpu/drm/i915/intel_memory_region.c:13:
+ },$
-:184: WARNING:LEADING_SPACE: please, no spaces at the start of a line #184: FILE: drivers/gpu/drm/i915/intel_memory_region.c:14:
+ [INTEL_REGION_LMEM] = {$
-:185: ERROR:CODE_INDENT: code indent should use tabs where possible #185: FILE: drivers/gpu/drm/i915/intel_memory_region.c:15:
+ .class = INTEL_MEMORY_LOCAL,$
-:185: WARNING:LEADING_SPACE: please, no spaces at the start of a line #185: FILE: drivers/gpu/drm/i915/intel_memory_region.c:15:
+ .class = INTEL_MEMORY_LOCAL,$
-:186: ERROR:CODE_INDENT: code indent should use tabs where possible #186: FILE: drivers/gpu/drm/i915/intel_memory_region.c:16:
+ .instance = 0,$
-:186: WARNING:LEADING_SPACE: please, no spaces at the start of a line #186: FILE: drivers/gpu/drm/i915/intel_memory_region.c:16:
+ .instance = 0,$
-:187: WARNING:LEADING_SPACE: please, no spaces at the start of a line #187: FILE: drivers/gpu/drm/i915/intel_memory_region.c:17:
+ },$
-:188: WARNING:LEADING_SPACE: please, no spaces at the start of a line #188: FILE: drivers/gpu/drm/i915/intel_memory_region.c:18:
+ [INTEL_REGION_STOLEN_SMEM] = {$
-:189: ERROR:CODE_INDENT: code indent should use tabs where possible #189: FILE: drivers/gpu/drm/i915/intel_memory_region.c:19:
+ .class = INTEL_MEMORY_STOLEN_SYSTEM,$
-:189: WARNING:LEADING_SPACE: please, no spaces at the start of a line #189: FILE: drivers/gpu/drm/i915/intel_memory_region.c:19:
+ .class = INTEL_MEMORY_STOLEN_SYSTEM,$
-:190: ERROR:CODE_INDENT: code indent should use tabs where possible #190: FILE: drivers/gpu/drm/i915/intel_memory_region.c:20:
+ .instance = 0,$
-:190: WARNING:LEADING_SPACE: please, no spaces at the start of a line #190: FILE: drivers/gpu/drm/i915/intel_memory_region.c:20:
+ .instance = 0,$
-:191: WARNING:LEADING_SPACE: please, no spaces at the start of a line #191: FILE: drivers/gpu/drm/i915/intel_memory_region.c:21:
+ },$
-:289: WARNING:LEADING_SPACE: please, no spaces at the start of a line #289: FILE: drivers/gpu/drm/i915/intel_memory_region.h:51:
+ u16 class;$
-:290: WARNING:LEADING_SPACE: please, no spaces at the start of a line #290: FILE: drivers/gpu/drm/i915/intel_memory_region.h:52:
+ u16 instance;$
total: 6 errors, 14 warnings, 0 checks, 328 lines checked29499067db3b drm/i915: Store gt in memory region37b5e5cb7b02 drm/i915/uapi: introduce drm_i915_gem_create_ext
-:65: WARNING:FILE_PATH_CHANGES: added, moved or deleted file(s), does MAINTAINERS need updating? #65:
new file mode 100644
-:704: WARNING:LONG_LINE: line length of 120 exceeds 100 columns #704: FILE: include/uapi/drm/i915_drm.h:394:
+#define DRM_IOCTL_I915_GEM_CREATE_EXT DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_CREATE, struct drm_i915_gem_create_ext)
-:713: CHECK:BRACES: Blank lines aren't necessary after an open brace '{' #713: FILE: include/uapi/drm/i915_drm.h:733:
+struct drm_i915_gem_create_ext {
+
-:752: CHECK:SPACING: spaces preferred around that '<<' (ctx:VxV) #752: FILE: include/uapi/drm/i915_drm.h:1735:
+#define I915_OBJECT_PARAM (1ull<<32)
^
total: 0 errors, 2 warnings, 2 checks, 675 lines checked 6491c69340d4 drm/i915/lmem: allocate cmd ring in lmem
-:7: WARNING:COMMIT_MESSAGE: Missing commit description - Add an appropriate one
total: 0 errors, 1 warnings, 0 checks, 27 lines checked5e1663900ad4 drm/i915/dg1: Do not check r->sgt.pfn for NULL
-:6: WARNING:COMMIT_LOG_LONG_LINE: Possible unwrapped commit description (prefer a maximum 75 chars per line) #6:
When user space does mmap, kernel would map the physical page of local memory
total: 0 errors, 1 warnings, 0 checks, 8 lines checked4a88133b064b drm/i915/dg1: Introduce dmabuf mmap to LMEM 29e876fe2352 drm/i915: setup the LMEM region7fb05ce64cc0 drm/i915: Distinction of memory regions33489c547561 drm/i915/gtt: map the PD up fronta5a268b53456 drm/i915/gtt/dgfx: place the PD in LMEM934cf6d2978f drm/i915/gtt: make flushing conditional95c33d19bc2e drm/i915/gtt/dg1: add PTE_LM plumbing for PPGTT 3bac8276df64 drm/i915/gtt/dg1: add PTE_LM plumbing for GGTT 333376c17e45 drm/i915: allocate context from LMEMae1d26ee9713 drm/i915: move engine scratch to LMEM
-:7: WARNING:COMMIT_MESSAGE: Missing commit description - Add an appropriate one
total: 0 errors, 1 warnings, 0 checks, 26 lines checked3f5760d53851 drm/i915: Provide a way to disable PCIe relaxed write ordering 7d2a163655ac drm/i915: i915 returns -EBUSY on thread contention 1588b3cc3983 drm/i915: setup GPU device lmem regionebf42a2d1043 drm/i915: Fix object page offset within a region 8adce9072e8d drm/i915: add i915_gem_object_is_devmem() function 5ec0749cbeac drm/i915: finish memory region support for stolen objects. 39aed9c40f1a drm/i915/lmem: support optional CPU clearing for special internal use -:95: WARNING:LINE_SPACING: Missing a blank line after declarations #95: FILE: drivers/gpu/drm/i915/selftests/intel_memory_region.c:551:
+ struct drm_i915_private *i915 = arg;
+ I915_RND_STATE(prng);
total: 0 errors, 1 warnings, 0 checks, 155 lines checked 31c4a0f29ed1 drm/i915/guc: put all guc objects in lmem when available -:20: WARNING:BAD_SIGN_OFF: Duplicate signature
#20:
Cc: Vinay Belgaumkar <[email protected]>
-:21: WARNING:BAD_SIGN_OFF: Duplicate signature
#21:
Cc: Matthew Auld <[email protected]>
-:145: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #145: FILE: drivers/gpu/drm/i915/gt/uc/intel_guc_fw.c:45:
+static int guc_xfer_rsa(struct intel_uc_fw *guc_fw,
struct intel_uncore *uncore)
total: 0 errors, 2 warnings, 1 checks, 219 lines checked 2b03d5d4546d drm/i915: Create stolen memory region from local memory -:191: WARNING:LEADING_SPACE: please, no spaces at the start of a line #191: FILE: drivers/gpu/drm/i915/intel_memory_region.c:22:
+ [INTEL_REGION_STOLEN_LMEM] = {$
-:194: WARNING:LEADING_SPACE: please, no spaces at the start of a line #194: FILE: drivers/gpu/drm/i915/intel_memory_region.c:25:
+ },$
-:202: WARNING:PREFER_FALLTHROUGH: Prefer 'fallthrough;' over fallthrough comment #202: FILE: drivers/gpu/drm/i915/intel_memory_region.c:318:
+ case INTEL_MEMORY_STOLEN_LOCAL: /* fallthrough */
total: 0 errors, 3 warnings, 0 checks, 154 lines checked 4e7c3c2116df drm/i915/lmem: Bypass aperture when lmem is available a5830c8b075a drm/i915/lmem: reset the lmem buffer created by fbdev -:11: WARNING:BAD_SIGN_OFF: Duplicate signature
#11:
Cc: Daniel Vetter <[email protected]>
total: 0 errors, 1 warnings, 0 checks, 8 lines checked 9dd81dae303d drm/i915/dsb: Enable lmem for dsb 362b620d7074 drm/i915: Reintroduce mem->reserved
-:74: WARNING:LINE_SPACING: Missing a blank line after declarations #74: FILE: drivers/gpu/drm/i915/selftests/intel_memory_region.c:157:
+ resource_size_t avail = resource_size(&mem->region);
+ I915_RND_STATE(prng);
total: 0 errors, 1 warnings, 0 checks, 123 lines checked bd91b2337589 drm/i915/dg1: Reserve first 1MB of local memory adf64d641e06 drm/i915/dg1: Read OPROM via SPI controller ca804dda82c6 drm/i915/oprom: Basic sanitization -:15: WARNING:BAD_SIGN_OFF: Duplicate signature #15:
Cc: Uma Shankar <[email protected]>
-:117: WARNING:LONG_LINE: line length of 122 exceeds 100 columns #117: FILE: drivers/gpu/drm/i915/display/intel_opregion.c:996:
+ size_512_bytes = parse_ptr[((struct expansion_rom_header *)parse_ptr)->pcistructoffset + PCI_IMAGE_LENGTH_OFFSET];
-:118: WARNING:LONG_LINE: line length of 115 exceeds 100 columns #118: FILE: drivers/gpu/drm/i915/display/intel_opregion.c:997:
+ *code_type = parse_ptr[((struct expansion_rom_header *)parse_ptr)->pcistructoffset + PCI_CODE_TYPE_OFFSET];
-:119: WARNING:LONG_LINE: line length of 125 exceeds 100 columns #119: FILE: drivers/gpu/drm/i915/display/intel_opregion.c:998:
+ *last_img = parse_ptr[((struct expansion_rom_header *)parse_ptr)->pcistructoffset + PCI_LAST_IMAGE_INDICATOR_OFFSET];
total: 0 errors, 4 warnings, 0 checks, 291 lines checked 3c364e753afe drm/i915: WA for zero memory channel fca06b7ce6d8 drm/i915/dg1: Compute MEM Bandwidth using MCHBAR a076828abb5c drm/i915/dg1: Double memory bandwidth available -:13: WARNING:BAD_SIGN_OFF: Duplicate signature #13:
Cc: Swati Sharma <[email protected]>
total: 0 errors, 1 warnings, 0 checks, 20 lines checked a7be54957ebd drm/i915/lmem: allocate HWSP in lmem
-:7: WARNING:COMMIT_MESSAGE: Missing commit description - Add an appropriate one
total: 0 errors, 1 warnings, 0 checks, 42 lines checked 599eb2888fa7 drm/i915/lmem: Limit block size to 4G
-:8: WARNING:TYPO_SPELLING: 'sytem' may be misspelled - perhaps 'system'? #8:
buddy sytem can allocate blocks that can have size >= 4G and
total: 0 errors, 1 warnings, 0 checks, 31 lines checked 14fefe71abbe drm/i915/gem: Update shmem available memory -:13: WARNING:BAD_SIGN_OFF: Duplicate signature #13:
Cc: Zbigniew Kempczyński <[email protected]>
total: 0 errors, 1 warnings, 0 checks, 31 lines checked 85bcec541bc6 drm/i915: Allow non-uniform subslices in gen12+ e371a4fda4c8 drm/i915/dg1: intel_memory_region_evict() changes for eviction -:176: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #176: FILE: drivers/gpu/drm/i915/intel_memory_region.c:124:
+ while (found < target &&
+ (obj = list_first_entry_or_null(*phase,
-:194: CHECK:LOGICAL_CONTINUATIONS: Logical continuations should be on the previous line #194: FILE: drivers/gpu/drm/i915/intel_memory_region.c:142:
+ if (i915_gem_object_type_has(obj, I915_GEM_OBJECT_HAS_IOMEM)
+ && !obj->base.handle_count)
total: 0 errors, 0 warnings, 2 checks, 229 lines checked 280d036c6cc4 drm/i915/dg1: i915_gem_object_memcpy(..) infrastructure 8df8e087dc74 drm/i915/dg1: Eviction logic
-:7: WARNING:TYPO_SPELLING: 'availabe' may be misspelled - perhaps 'available'? #7:
on a region, if memory pages are not availabe, the region eviction
-:276: CHECK:LOGICAL_CONTINUATIONS: Logical continuations should be on the previous line #276: FILE: drivers/gpu/drm/i915/intel_memory_region.c:152:
+ if (i915_gem_object_type_has(obj, I915_GEM_OBJECT_HAS_IOMEM)
+ && pass == 1)
total: 0 errors, 1 warnings, 1 checks, 231 lines checked c43e26b457ba drm/i915/dg1: Add enable_eviction modparam
-:76: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #76: FILE: drivers/gpu/drm/i915/i915_params.c:201:
+i915_param_named_unsafe(enable_eviction, bool, 0600,
+ "Enable memcpy based eviction which does not rely on DMA resv refactoring)");
total: 0 errors, 0 warnings, 1 checks, 66 lines checked 94618502032f drm/i915/dg1: Add lmem_size modparam
-:21: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #21: FILE: drivers/gpu/drm/i915/i915_params.c:204:
+i915_param_named_unsafe(lmem_size, uint, 0400,
+ "Change lmem size for each region. (default: 0, all memory)");
total: 0 errors, 0 warnings, 1 checks, 26 lines checked 45aa0145d9d7 drm/i915/dg1: Track swap in/out stats via debugfs dea599a449c3 drm/i915/dg1: Measure swap in/out timing stats
-:7: WARNING:COMMIT_MESSAGE: Missing commit description - Add an appropriate one
total: 0 errors, 1 warnings, 0 checks, 71 lines checked 7a3906ab73e5 drm/i915: define intel_partial_pages_for_sg_table 7f58be45fa4a drm/i915: create and destroy dummy vma 84d54dd2aedf drm/i915: blt copy between objs using pre-created vma windows -:95: WARNING:MEMORY_BARRIER: memory barrier without comment #95: FILE: drivers/gpu/drm/i915/gem/i915_gem_object.c:763:
+ wmb();
total: 0 errors, 1 warnings, 0 checks, 422 lines checked 3e237c57e079 drm/i915/dg1: Eliminate eviction mutex efc0c590d514 drm/i915/dg1: Keep engine awake across whole blit 0fb68f1c3c17 drm/i915: window_blt_copy is used for swapin and swapout -:92: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #92: FILE: drivers/gpu/drm/i915/i915_params.c:201:
+i915_param_named_unsafe(enable_eviction, uint, 0600,
+ "Enable eviction which does not rely on DMA resv refactoring "
total: 0 errors, 0 warnings, 1 checks, 75 lines checkedd30141a1c7dc drm/i915: Lmem eviction statistics by categorye77001d0741d drm/i915/gem/selftest: test and measure window based blt cpy
-:98: WARNING:MSLEEP: msleep < 20ms can sleep for up to 20ms; see Documentation/timers/timers-howto.rst #98: FILE: drivers/gpu/drm/i915/gem/selftests/i915_gem_object_blt.c:637:
+ msleep(1);
total: 0 errors, 1 warnings, 0 checks, 185 lines checked 5f2a87a3c62a drm/i915: suspend/resume eviction
-:53: WARNING:LINE_SPACING: Missing a blank line after declarations #53: FILE: drivers/gpu/drm/i915/i915_drv.c:1121:
+ struct list_head still_in_list;
+ INIT_LIST_HEAD(&s
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI[Intel-gfx] ✗ Fi.CI.SPARSE: warning for DG1 + LMEM enabling
In reply to Matthew Auld== Series Details ==
== Series Details ==
Series: DG1 + LMEM enabling
URL : https://patchwork.freedesktop.org/series/84344/
State : warning
== Summary ==
$ dim sparse --fast origin/drm-tip Sparse version: v0.6.2 Fast mode used, each commit won't be checked separately. +drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c:1237:15: expected void *vaddr +drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c:1237:15: got void [noderef] __iomem * +drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c:1237:15: warning: incorrect type in assignment (different address spaces) +drivers/gpu/drm/i915/gem/i915_gem_object.c:496:21: expected void *vaddr +drivers/gpu/drm/i915/gem/i915_gem_object.c:496:21: got void [noderef] __iomem * +drivers/gpu/drm/i915/gem/i915_gem_object.c:496:21: warning: incorrect type in assignment (different address spaces) +drivers/gpu/drm/i915/gem/i915_gem_object.c:503:30: expected void [noderef] __iomem *vaddr +drivers/gpu/drm/i915/gem/i915_gem_object.c:503:30: got void *vaddr +drivers/gpu/drm/i915/gem/i915_gem_object.c:503:30: warning: incorrect type in argument 1 (different address spaces) +drivers/gpu/drm/i915/gem/i915_gem_region.c:299:34: expected unsigned long long [usertype] *s +drivers/gpu/drm/i915/gem/i915_gem_region.c:299:34: got void [noderef] __iomem *[assigned] vaddr +drivers/gpu/drm/i915/gem/i915_gem_region.c:299:34: warning: incorrect type in argument 1 (different address spaces) +drivers/gpu/drm/i915/gt/gen8_engine_cs.c:109:5: warning: symbol 'gen11_emit_flush_render' was not declared. Should it be static? +drivers/gpu/drm/i915/gt/gen8_engine_cs.c:11:5: warning: symbol 'gen8_emit_flush_render' was not declared. Should it be static? +drivers/gpu/drm/i915/gt/gen8_engine_cs.c:201:5: warning: symbol 'gen12_emit_flush_render' was not declared. Should it be static? +drivers/gpu/drm/i915/gt/gen8_engine_cs.c:271:5: warning: symbol 'gen12_emit_flush' was not declared. Should it be static? +drivers/gpu/drm/i915/gt/gen8_engine_cs.c:332:5: warning: symbol 'gen8_emit_bb_start_noarb' was not declared. Should it be static? +drivers/gpu/drm/i915/gt/gen8_engine_cs.c:368:5: warning: symbol 'gen8_emit_bb_start' was not declared. Should it be static? +drivers/gpu/drm/i915/gt/gen8_engine_cs.c:77:5: warning: symbol 'gen8_emit_flush' was not declared. Should it be static? +drivers/gpu/drm/i915/gt/intel_ring_submission.c:1229:24: warning: Using plain integer as NULL pointer +drivers/gpu/drm/i915/gt/selftest_reset.c:99:34: expected unsigned int [usertype] *s +drivers/gpu/drm/i915/gt/selftest_reset.c:99:34: got void [noderef] __iomem *[assigned] s +drivers/gpu/drm/i915/gt/selftest_reset.c:99:34: warning: incorrect type in argument 1 (different address spaces) +drivers/gpu/drm/i915/gt/uc/intel_uc_fw.c:616:35: expected void const *from +drivers/gpu/drm/i915/gt/uc/intel_uc_fw.c:616:35: got void [noderef] __iomem * +drivers/gpu/drm/i915/gt/uc/intel_uc_fw.c:616:35: warning: incorrect type in argument 2 (different address spaces) +drivers/gpu/drm/i915/intel_wakeref.c:137:19: warning: context imbalance in 'wakeref_auto_timeout' - unexpected unlock +drivers/gpu/drm/i915/selftests/i915_syncmap.c:80:54: warning: dubious: x | !y +drivers/gpu/drm/i915/selftests/intel_memory_region.c:689:23: expected void [noderef] __iomem *vaddr +drivers/gpu/drm/i915/selftests/intel_memory_region.c:689:23: got void * +drivers/gpu/drm/i915/selftests/intel_memory_region.c:689:23: warning: incorrect type in assignment (different address spaces) +drivers/gpu/drm/i915/selftests/intel_memory_region.c:698:40: expected unsigned int [usertype] *s +drivers/gpu/drm/i915/selftests/intel_memory_region.c:698:40: got void [noderef] __iomem * +drivers/gpu/drm/i915/selftests/intel_memory_region.c:698:40: warning: incorrect type in argument 1 (different address spaces) +./include/linux/seqlock.h:838:24: warning: trying to copy expression type 31 +./include/linux/seqlock.h:838:24: warning: trying to copy expression type 31 +./include/linux/seqlock.h:864:16: warning: trying to copy expression type 31 -O:drivers/gpu/drm/i915/gt/selftest_reset.c:98:34: expected unsigned int [usertype] *s -O:drivers/gpu/drm/i915/gt/selftest_reset.c:98:34: got void [noderef] __iomem *[assigned] s -O:drivers/gpu/drm/i915/gt/selftest_reset.c:98:34: warning: incorrect type in argument 1 (different address spaces)
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI[Intel-gfx] ✗ Fi.CI.DOCS: warning for DG1 + LMEM enabling
In reply to Matthew Auld== Series Details ==
== Series Details ==
Series: DG1 + LMEM enabling
URL : https://patchwork.freedesktop.org/series/84344/
State : warning
== Summary ==
$ make htmldocs 2>&1 > /dev/null | grep i915 ./drivers/gpu/drm/i915/gem/i915_gem_shrinker.c:102: warning: Function parameter or member 'ww' not described in 'i915_gem_shrink' ./drivers/gpu/drm/i915/i915_cmd_parser.c:1414: warning: Excess function parameter 'trampoline' description in 'intel_engine_cmd_parser' ./drivers/gpu/drm/i915/i915_cmd_parser.c:1414: warning: Function parameter or member 'jump_whitelist' not described in 'intel_engine_cmd_parser' ./drivers/gpu/drm/i915/i915_cmd_parser.c:1414: warning: Function parameter or member 'shadow_map' not described in 'intel_engine_cmd_parser' ./drivers/gpu/drm/i915/i915_cmd_parser.c:1414: warning: Function parameter or member 'batch_map' not described in 'intel_engine_cmd_parser' ./drivers/gpu/drm/i915/i915_cmd_parser.c:1414: warning: Excess function parameter 'trampoline' description in 'intel_engine_cmd_parser' Error: Cannot open file ./drivers/gpu/drm/i915/gt/intel_lrc.c WARNING: kernel-doc './scripts/kernel-doc -rst -enable-lineno -sphinx-version 1.7.9 -function Logical Rings, Logical Ring Contexts and Execlists ./drivers/gpu/drm/i915/gt/intel_lrc.c' failed with return code 1
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI[Intel-gfx] ✗ Fi.CI.BAT: failure for DG1 + LMEM enabling
In reply to Matthew Auld== Series Details ==
== Series Details ==
Series: DG1 + LMEM enabling
URL : https://patchwork.freedesktop.org/series/84344/
State : failure
== Summary ==
CI Bug Log - changes from CI_DRM_9398 -> Patchwork_18999
====================================================
Summary
-------
**FAILURE**
Serious unknown changes coming with Patchwork_18999 absolutely need to be verified manually.
If you think the reported changes have nothing to do with the changes introduced in Patchwork_18999, please notify your bug team to allow them to document this new failure mode, which will reduce false positives in CI.
External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18999/index.html
Possible new issues
-------------------
Here are the unknown changes that may have been introduced in Patchwork_18999:
### IGT changes ###
#### Possible regressions ####
* igt@core_hotunplug@unbind-rebind:
- fi-byt-j1900: [PASS][1] -> [INCOMPLETE][2]
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9398/fi-byt-j1900/igt@[email protected]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18999/fi-byt-j1900/igt@[email protected]
* igt@i915_selftest@live@gt_lrc:
- fi-bsw-n3050: [PASS][3] -> [DMESG-FAIL][4]
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9398/fi-bsw-n3050/igt@i915_selftest@live@gt_lrc.html
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18999/fi-bsw-n3050/igt@i915_selftest@live@gt_lrc.html
- fi-glk-dsi: [PASS][5] -> [DMESG-FAIL][6]
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9398/fi-glk-dsi/igt@i915_selftest@live@gt_lrc.html
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18999/fi-glk-dsi/igt@i915_selftest@live@gt_lrc.html
- fi-bsw-nick: [PASS][7] -> [DMESG-FAIL][8]
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9398/fi-bsw-nick/igt@i915_selftest@live@gt_lrc.html
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18999/fi-bsw-nick/igt@i915_selftest@live@gt_lrc.html
- fi-apl-guc: [PASS][9] -> [DMESG-FAIL][10]
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9398/fi-apl-guc/igt@i915_selftest@live@gt_lrc.html
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18999/fi-apl-guc/igt@i915_selftest@live@gt_lrc.html
- fi-bxt-dsi: [PASS][11] -> [DMESG-FAIL][12]
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9398/fi-bxt-dsi/igt@i915_selftest@live@gt_lrc.html
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18999/fi-bxt-dsi/igt@i915_selftest@live@gt_lrc.html
#### Suppressed ####
The following results come from untrusted machines, tests, or statuses. They do not affect the overall result.
* {igt@gem_exec_parallel@engines@userptr}:
- fi-kbl-r: [PASS][13] -> [FAIL][14]
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9398/fi-kbl-r/igt@gem_exec_parallel@[email protected]
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18999/fi-kbl-r/igt@gem_exec_parallel@[email protected]
- fi-cfl-8109u: [PASS][15] -> [FAIL][16]
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9398/fi-cfl-8109u/igt@gem_exec_parallel@[email protected]
[16]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18999/fi-cfl-8109u/igt@gem_exec_parallel@[email protected]
- {fi-tgl-dsi}: [PASS][17] -> [FAIL][18]
[17]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9398/fi-tgl-dsi/igt@gem_exec_parallel@[email protected]
[18]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18999/fi-tgl-dsi/igt@gem_exec_parallel@[email protected]
- fi-blb-e6850: [PASS][19] -> [FAIL][20]
[19]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9398/fi-blb-e6850/igt@gem_exec_parallel@[email protected]
[20]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18999/fi-blb-e6850/igt@gem_exec_parallel@[email protected]
- fi-bsw-nick: [PASS][21] -> [FAIL][22]
[21]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9398/fi-bsw-nick/igt@gem_exec_parallel@[email protected]
[22]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18999/fi-bsw-nick/igt@gem_exec_parallel@[email protected]
- fi-bxt-dsi: [PASS][23] -> [FAIL][24]
[23]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9398/fi-bxt-dsi/igt@gem_exec_parallel@[email protected]
[24]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18999/fi-bxt-dsi/igt@gem_exec_parallel@[email protected]
- fi-apl-guc: [PASS][25] -> [FAIL][26]
[25]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9398/fi-apl-guc/igt@gem_exec_parallel@[email protected]
[26]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18999/fi-apl-guc/igt@gem_exec_parallel@[email protected]
- fi-icl-y: [PASS][27] -> [FAIL][28]
[27]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9398/fi-icl-y/igt@gem_exec_parallel@[email protected]
[28]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18999/fi-icl-y/igt@gem_exec_parallel@[email protected]
- fi-snb-2520m: [PASS][29] -> [FAIL][30]
[29]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9398/fi-snb-2520m/igt@gem_exec_parallel@[email protected]
[30]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18999/fi-snb-2520m/igt@gem_exec_parallel@[email protected]
- fi-cml-u2: NOTRUN -> [FAIL][31]
[31]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18999/fi-cml-u2/igt@gem_exec_parallel@[email protected]
- fi-pnv-d510: [PASS][32] -> [FAIL][33]
[32]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9398/fi-pnv-d510/igt@gem_exec_parallel@[email protected]
[33]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18999/fi-pnv-d510/igt@gem_exec_parallel@[email protected]
- fi-cfl-8700k: [PASS][34] -> [FAIL][35]
[34]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9398/fi-cfl-8700k/igt@gem_exec_parallel@[email protected]
[35]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18999/fi-cfl-8700k/igt@gem_exec_parallel@[email protected]
- fi-icl-u2: [PASS][36] -> [FAIL][37]
[36]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9398/fi-icl-u2/igt@gem_exec_parallel@[email protected]
[37]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18999/fi-icl-u2/igt@gem_exec_parallel@[email protected]
- fi-tgl-u2: [PASS][38] -> [FAIL][39]
[38]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9398/fi-tgl-u2/igt@gem_exec_parallel@[email protected]
[39]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18999/fi-tgl-u2/igt@gem_exec_parallel@[email protected]
- {fi-ehl-1}: [PASS][40] -> [FAIL][41]
[40]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9398/fi-ehl-1/igt@gem_exec_parallel@[email protected]
[41]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18999/fi-ehl-1/igt@gem_exec_parallel@[email protected]
- fi-skl-6600u: [PASS][42] -> [FAIL][43]
[42]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9398/fi-skl-6600u/igt@gem_exec_parallel@[email protected]
[43]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18999/fi-skl-6600u/igt@gem_exec_parallel@[email protected]
- fi-bsw-n3050: [PASS][44] -> [FAIL][45]
[44]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9398/fi-bsw-n3050/igt@gem_exec_parallel@[email protected]
[45]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18999/fi-bsw-n3050/igt@gem_exec_parallel@[email protected]
- fi-byt-j1900: [PASS][46] -> [FAIL][47]
[46]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9398/fi-byt-j1900/igt@gem_exec_parallel@[email protected]
[47]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18999/fi-byt-j1900/igt@gem_exec_parallel@[email protected]
- fi-hsw-4770: [PASS][48] -> [FAIL][49]
[48]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9398/fi-hsw-4770/igt@gem_exec_parallel@[email protected]
[49]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18999/fi-hsw-4770/igt@gem_exec_parallel@[email protected]
- {fi-kbl-7560u}: [PASS][50] -> [FAIL][51]
[50]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9398/fi-kbl-7560u/igt@gem_exec_parallel@[email protected]
[51]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18999/fi-kbl-7560u/igt@gem_exec_parallel@[email protected]
- fi-cml-s: [PASS][52] -> [FAIL][53]
[52]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9398/fi-cml-s/igt@gem_exec_parallel@[email protected]
[53]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18999/fi-cml-s/igt@gem_exec_parallel@[email protected]
- {fi-dg1-1}: NOTRUN -> [FAIL][54]
[54]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18999/fi-dg1-1/igt@gem_exec_parallel@[email protected]
- fi-ilk-650: [PASS][55] -> [FAIL][56]
[55]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9398/fi-ilk-650/igt@gem_exec_parallel@[email protected]
[56]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18999/fi-ilk-650/igt@gem_exec_parallel@[email protected]
- fi-elk-e7500: [PASS][57] -> [FAIL][58]
[57]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9398/fi-elk-e7500/igt@gem_exec_parallel@[email protected]
[58]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18999/fi-elk-e7500/igt@gem_exec_parallel@[email protected]
- fi-cfl-guc: [PASS][59] -> [FAIL][60]
[59]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9398/fi-cfl-guc/igt@gem_exec_parallel@[email protected]
[60]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18999/fi-cfl-guc/igt@gem_exec_parallel@[email protected]
- fi-kbl-soraka: [PASS][61] -> [FAIL][62]
[61]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9398/fi-kbl-soraka/igt@gem_exec_parallel@[email protected]
[62]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18999/fi-kbl-soraka/igt@gem_exec_parallel@[email protected]
- fi-ivb-3770: [PASS][63] -> [FAIL][64]
[63]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9398/fi-ivb-3770/igt@gem_exec_parallel@[email protected]
[64]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18999/fi-ivb-3770/igt@gem_exec_parallel@[email protected]
- fi-skl-6700k2: [PASS][65] -> [FAIL][66]
[65]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9398/fi-skl-6700k2/igt@gem_exec_parallel@[email protected]
[66]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18999/fi-skl-6700k2/igt@gem_exec_parallel@[email protected]
- fi-glk-dsi: [PASS][67] -> [FAIL][68]
[67]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9398/fi-glk-dsi/igt@gem_exec_parallel@[email protected]
[68]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18999/fi-glk-dsi/igt@gem_exec_parallel@[email protected]
- fi-kbl-x1275: [PASS][69] -> [FAIL][70]
[69]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9398/fi-kbl-x1275/igt@gem_exec_parallel@[email protected]
[70]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18999/fi-kbl-x1275/igt@gem_exec_parallel@[email protected]
- fi-snb-2600: [PASS][71] -> [FAIL][72]
[71]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9398/fi-snb-2600/igt@gem_exec_parallel@[email protected]
[72]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18999/fi-snb-2600/igt@gem_exec_parallel@[email protected]
- fi-tgl-y: [PASS][73] -> [FAIL][74]
[73]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9398/fi-tgl-y/igt@gem_exec_parallel@[email protected]
[74]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18999/fi-tgl-y/igt@gem_exec_parallel@[email protected]
- fi-kbl-7500u: [PASS][75] -> [FAIL][76]
[75]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9398/fi-kbl-7500u/igt@gem_exec_parallel@[email protected]
[76]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18999/fi-kbl-7500u/igt@gem_exec_parallel@[email protected]
- fi-kbl-guc: [PASS][77] -> [FAIL][78]
[77]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9398/fi-kbl-guc/igt@gem_exec_parallel@[email protected]
[78]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18999/fi-kbl-guc/igt@gem_exec_parallel@[email protected]
- fi-bdw-gvtdvm: [PASS][79] -> [FAIL][80]
[79]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9398/fi-bdw-gvtdvm/igt@gem_exec_parallel@[email protected]
[80]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18999/fi-bdw-gvtdvm/igt@gem_exec_parallel@[email protected]
- fi-bdw-5557u: [PASS][81] -> [FAIL][82]
[81]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9398/fi-bdw-5557u/igt@gem_exec_parallel@[email protected]
[82]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18999/fi-bdw-5557u/igt@gem_exec_parallel@[email protected]
- fi-skl-guc: [PASS][83] -> [FAIL][84]
[83]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9398/fi-skl-guc/igt@gem_exec_parallel@[email protected]
[84]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18999/fi-skl-guc/igt@gem_exec_parallel@[email protected]
* igt@gem_exec_suspend@basic-s0:
- {fi-dg1-1}: [SKIP][85] ([i915#2575]) -> [DMESG-WARN][86]
[85]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9398/fi-dg1-1/igt@[email protected]
[86]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18999/fi-dg1-1/igt@[email protected]
* igt@gem_exec_suspend@basic-s3:
- {fi-dg1-1}: [SKIP][87] ([i915#2575]) -> [INCOMPLETE][88]
[87]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9398/fi-dg1-1/igt@[email protected]
[88]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18999/fi-dg1-1/igt@[email protected]
* {igt@prime_vgem@basic-userptr}:
- fi-tgl-y: [PASS][89] -> [SKIP][90]
[89]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9398/fi-tgl-y/igt@[email protected]
[90]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18999/fi-tgl-y/igt@[email protected]
- fi-icl-u2: [PASS][91] -> [SKIP][92]
[91]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9398/fi-icl-u2/igt@[email protected]
[92]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18999/fi-icl-u2/igt@[email protected]
- fi-tgl-u2: [PASS][93] -> [SKIP][94]
[93]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9398/fi-tgl-u2/igt@[email protected]
[94]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18999/fi-tgl-u2/igt@[email protected]
- fi-cml-s: [PASS][95] -> [SKIP][96]
[95]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9398/fi-cml-s/igt@[email protected]
[96]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18999/fi-cml-s/igt@[email protected]
- fi-icl-y: [PASS][97] -> [SKIP][98]
[97]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9398/fi-icl-y/igt@[email protected]
[98]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18999/fi-icl-y/igt@[email protected]
- fi-cml-u2: NOTRUN -> [SKIP][99]
[99]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18999/fi-cml-u2/igt@[email protected]
- {fi-ehl-1}: [PASS][100] -> [SKIP][101]
[100]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9398/fi-ehl-1/igt@[email protected]
[101]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18999/fi-ehl-1/igt@[email protected]
New tests
---------
New tests have been introduced between CI_DRM_9398 and Patchwork_18999:
### New CI tests (1) ###
* boot:
- Statuses : 39 pass(s)
- Exec time: [0.0] s
### New IGT tests (1) ###
* igt@i915_selftest@live@win_blt_copy:
- Statuses : 33 pass(s)
- Exec time: [0.44, 6.51] s
Known issues
------------
Here are the changes found in Patchwork_18999 that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@i915_getparams_basic@basic-subslice-total:
- fi-tgl-y: [PASS][102] -> [DMESG-WARN][103] ([i915#402]) +1 similar issue
[102]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9398/fi-tgl-y/igt@[email protected]
[103]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18999/fi-tgl-y/igt@[email protected]
* igt@i915_module_load@reload:
- fi-icl-y: [PASS][104] -> [DMESG-WARN][105] ([i915#1982])
[104]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9398/fi-icl-y/igt@[email protected]
[105]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18999/fi-icl-y/igt@[email protected]
* igt@i915_selftest@live@gt_heartbeat:
- fi-kbl-soraka: [PASS][106] -> [DMESG-FAIL][107] ([i915#541])
[106]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9398/fi-kbl-soraka/igt@i915_selftest@live@gt_heartbeat.html
[107]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18999/fi-kbl-soraka/igt@i915_selftest@live@gt_heartbeat.html
* igt@kms_pipe_crc_basic@compare-crc-sanitycheck-pipe-a:
- fi-tgl-y: [PASS][108] -> [DMESG-WARN][109] ([i915#1982])
[108]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9398/fi-tgl-y/igt@[email protected]
[109]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18999/fi-tgl-y/igt@[email protected]
#### Possible fixes ####
* igt@debugfs_test@read_all_entries:
- {fi-dg1-1}: [SKIP][110] ([i915#2575]) -> [PASS][111] +12 similar issues
[110]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9398/fi-dg1-1/igt@debugfs_test@read_all_entries.html
[111]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18999/fi-dg1-1/igt@debugfs_test@read_all_entries.html
- fi-tgl-y: [DMESG-WARN][112] ([i915#402]) -> [PASS][113] +2 similar issues
[112]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9398/fi-tgl-y/igt@debugfs_test@read_all_entries.html
[113]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18999/fi-tgl-y/igt@debugfs_test@read_all_entries.html
* {igt@fbdev@read}:
- {fi-dg1-1}: [SKIP][114] ([i915#2582]) -> [PASS][115] +4 similar issues
[114]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9398/fi-dg1-1/igt@[email protected]
[115]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18999/fi-dg1-1/igt@[email protected]
* igt@i915_pm_rpm@basic-pci-d3-state:
- {fi-ehl-1}: [DMESG-WARN][116] ([i915#1982]) -> [PASS][117]
[116]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9398/fi-ehl-1/igt@[email protected]
[117]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18999/fi-ehl-1/igt@[email protected]
- fi-apl-guc: [DMESG-WARN][118] ([i915#1982]) -> [PASS][119]
[118]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9398/fi-apl-guc/igt@[email protected]
[119]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18999/fi-apl-guc/igt@[email protected]
* igt@kms_busy@basic@flip:
- fi-kbl-soraka: [DMESG-WARN][120] ([i915#1982]) -> [PASS][121]
[120]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9398/fi-kbl-soraka/igt@kms_busy@[email protected]
[121]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18999/fi-kbl-soraka/igt@kms_busy@[email protected]
* igt@kms_cursor_legacy@basic-busy-flip-before-cursor-legacy:
- fi-icl-u2: [DMESG-WARN][122] ([i915#1982]) -> [PASS][123] +1 similar issue
[122]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9398/fi-icl-u2/igt@[email protected]
[123]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18999/fi-icl-u2/igt@[email protected]
* igt@kms_frontbuffer_tracking@basic:
- fi-tgl-y: [DMESG-WARN][124] ([i915#1982]) -> [PASS][125]
[124]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9398/fi-tgl-y/igt@[email protected]
[125]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18999/fi-tgl-y/igt@[email protected]
* igt@kms_pipe_crc_basic@compare-crc-sanitycheck-pipe-b:
- fi-cfl-8109u: [DMESG-WARN][126] ([i915#165]) -> [PASS][127] +15 similar issues
[126]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9398/fi-cfl-8109u/igt@[email protected]
[127]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18999/fi-cfl-8109u/igt@[email protected]
{name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).
[fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
[i915#165]: https://gitlab.freedesktop.org/drm/intel/issues/165
[i915#1982]: https://gitlab.freedesktop.org/drm/intel/issues/1982
[i915#2292]: https://gitlab.freedesktop.org/drm/intel/issues/2292
[i915#2575]: https://gitlab.freedesktop.org/drm/intel/issues/2575
[i915#2582]: https://gitlab.freedesktop.org/drm/intel/issues/2582
[i915#2722]: https://gitlab.freedesktop.org/drm/intel/issues/2722
[i915#402]: https://gitlab.freedesktop.org/drm/intel/issues/402
[i915#541]: https://gitlab.freedesktop.org/drm/intel/issues/541
[k.org#204565]: https://bugzilla.kernel.org/show_bug.cgi?id=204565
Participating hosts (43 -> 39)
------------------------------
Additional (1): fi-cml-u2
Missing (5): fi-ilk-m540 fi-hsw-4200u fi-bsw-cyan fi-bsw-kefka fi-bdw-samus
Build changes
-------------
* Linux: CI_DRM_9398 -> Patchwork_18999
CI-20190529: 20190529
CI_DRM_9398: 31a04133814ab8f7b3aab042517e3f104df5ee2d @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_5873: b6321b58dcaa41ba1d28aced42d6b15dc3d49ca2 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_18999: 6308b9d298372639e94b1fb28f7a28ca5ae2f4e2 @ git://anongit.freedesktop.org/gfx-ci/linux
== Linux commits ==
6308b9d29837 drm/i915: drop fake lmem91802d0e6465 drm/i915/dg1: allow pci to auto probea2a7eee3b71b drm/i915/dg1: Fix GPU hang due to shmemfs page drop 2105c55a88e1 drm/i915/dg1: Fix mapping type for default state object 7de35bf9f62a drm/i915: Support ww locks in suspend/resume737dfb23d460 drm/i915: Improve accuracy of eviction stats32deab2bab4b drm/i915: Use a ww transaction in i915_gem_object_pin_map_unlocked() 7ad1c0697fb2 drm/i915: Use a ww transaction in the fault handler 02ce389f0623 drm/i915: Support ww evictionbc70e7e45bcb drm/i915: Implement eviction locking v26fbe288750c4 drm/i915: Perform execbuffer object locking as a separate step 69ba4c87d1c0 drm/i915: move eviction to prepare hookb333606856ec drm/i915: need consider system BO snoop for dgfxd868fcf1ecf1 drm/i915: suspend/resume handling of perma-pinned objects 7f4379debc55 drm/i915: suspend/resume enable blitter eviction9054df43c6e6 drm/i915/gt: Allocate default ctx objects in SMEM5138a90c0179 drm/i915/pm: suspend and restore ppgtt mapping2b5c568f6237 drm/i915/dg1: Add dedicated context for blitter eviction fe6486a08fff drm/i915: Reset blitter context when unpark engine 5f2a87a3c62a drm/i915: suspend/resume evictione77001d0741d drm/i915/gem/selftest: test and measure window based blt cpy d30141a1c7dc drm/i915: Lmem eviction statistics by category0fb68f1c3c17 drm/i915: window_blt_copy is used for swapin and swapout efc0c590d514 drm/i915/dg1: Keep engine awake across whole blit3e237c57e079 drm/i915/dg1: Eliminate eviction mutex84d54dd2aedf drm/i915: blt copy between objs using pre-created vma windows 7f58be45fa4a drm/i915: create and destroy dummy vma7a3906ab73e5 drm/i915: define intel_partial_pages_for_sg_tabledea599a449c3 drm/i915/dg1: Measure swap in/out timing stats45aa0145d9d7 drm/i915/dg1: Track swap in/out stats via debugfs94618502032f drm/i915/dg1: Add lmem_size modparamc43e26b457ba drm/i915/dg1: Add enable_eviction modparam8df8e087dc74 drm/i915/dg1: Eviction logic280d036c6cc4 drm/i915/dg1: i915_gem_object_memcpy(..) infrastructure e371a4fda4c8 drm/i915/dg1: intel_memory_region_evict() changes for eviction 85bcec541bc6 drm/i915: Allow non-uniform subslices in gen12+14fefe71abbe drm/i915/gem: Update shmem available memory599eb2888fa7 drm/i915/lmem: Limit block size to 4Ga7be54957ebd drm/i915/lmem: allocate HWSP in lmema076828abb5c drm/i915/dg1: Double memory bandwidth availablefca06b7ce6d8 drm/i915/dg1: Compute MEM Bandwidth using MCHBAR3c364e753afe drm/i915: WA for zero memory channelca804dda82c6 drm/i915/oprom: Basic sanitizationadf64d641e06 drm/i915/dg1: Read OPROM via SPI controllerbd91b2337589 drm/i915/dg1: Reserve first 1MB of local memory362b620d7074 drm/i915: Reintroduce mem->reserved9dd81dae303d drm/i915/dsb: Enable lmem for dsba5830c8b075a drm/i915/lmem: reset the lmem buffer created by fbdev 4e7c3c2116df drm/i915/lmem: Bypass aperture when lmem is available 2b03d5d4546d drm/i915: Create stolen memory region from local memory 31c4a0f29ed1 drm/i915/guc: put all guc objects in lmem when available 39aed9c40f1a drm/i915/lmem: support optional CPU clearing for special internal use 5ec0749cbeac drm/i915: finish memory region support for stolen objects. 8adce9072e8d drm/i915: add i915_gem_object_is_devmem() function ebf42a2d1043 drm/i915: Fix object page offset within a region1588b3cc3983 drm/i915: setup GPU device lmem region7d2a163655ac drm/i915: i915 returns -EBUSY on thread contention 3f5760d53851 drm/i915: Provide a way to disable PCIe relaxed write ordering ae1d26ee9713 drm/i915: move engine scratch to LMEM333376c17e45 drm/i915: allocate context from LMEM3bac8276df64 drm/i915/gtt/dg1: add PTE_LM plumbing for GGTT95c33d19bc2e drm/i915/gtt/dg1: add PTE_LM plumbing for PPGTT934cf6d2978f drm/i915/gtt: make flushing conditionala5a268b53456 drm/i915/gtt/dgfx: place the PD in LMEM33489c547561 drm/i915/gtt: map the PD up front7fb05ce64cc0 drm/i915: Distinction of memory regions29e876fe2352 drm/i915: setup the LMEM region4a88133b064b drm/i915/dg1: Introduce dmabuf mmap to LMEM5e1663900ad4 drm/i915/dg1: Do not check r->sgt.pfn for NULL6491c69340d4 drm/i915/lmem: allocate cmd ring in lmem37b5e5cb7b02 drm/i915/uapi: introduce drm_i915_gem_create_ext29499067db3b drm/i915: Store gt in memory region985600b152ca drm/i915/query: Expose memory regions through the query uAPI 87518556758f drm/i915/dg1: Fix occasional migration errorbd78bfa4452f drm/i915: support basic object migrationccd239f2c053 drm/i915: Delay publishing objects on the eviction lists 1e5ec74bb7b8 drm/i915: Add blit functions that can be called from within a WW transaction 4bb2bb3961aa drm/i915/region: support basic eviction3db87b4f64ed drm/i915: introduce kernel blitter_context36db22233ecf drm/i915: Update the helper to set correct mapping 7c7b8d398ff6 HAX drm/i915/lmem: support pread and pwrite638e59094088 HAX drm/i915/lmem: support CPU relocations425ac61c78e0 drm/i915/lmem: Fail driver init if LMEM training failed 7160b8cb229a drm/i915/dmabuf: Disallow LMEM objects from dma-buf fd9e9f4efbc5 drm/i915: Return error value when bo not in LMEM for discrete f5559b991383 drm/i915/fbdev: Use lmem physical addresses for fb_mmap() on discrete f9f3ea170515 drm/i915: Untangle the vma pages_mutex94aeb7363b28 drm/i915: Introduce a for_i915_gem_ww(){}ad0364e0969c drm/i915: Break out dma_resv ww locking utilities to separate files d58138a3962d drm/i915: Reference contending lock objects9d27adfe1cd7 drm/i915: Avoid some false positives in assert_object_held() fcf207bef4c6 drm/i915: Keep userpointer bindings if seqcount is unchanged, v2. 84a9ca7ba448 drm/i915: Finally remove obj->mm.lock.e83d2d2ded23 drm/i915/selftests: Prepare gtt tests for obj->mm.lock removal 285510611ec9 drm/i915/selftests: Prepare cs engine tests for obj->mm.lock removal f5a8a22004f2 drm/i915/selftests: Prepare memory region tests for obj->mm.lock removal 27d90930aa00 drm/i915/selftests: Prepare i915_request tests for obj->mm.lock removal 37021ba46236 drm/i915/selftests: Prepare timeline tests for obj->mm.lock removal dd71228759cc drm/i915/selftests: Prepare ring submission for obj->mm.lock removal 602f787839eb drm/i915/selftests: Prepare mocs tests for obj->mm.lock removal a94b8d1885c2 drm/i915/selftests: Prepare execlists for obj->mm.lock removal 795a67bb1fbf drm/i915/selftests: Prepare hangcheck for obj->mm.lock removal 8fec33b51cda drm/i915/selftests: Prepare context selftest for obj->mm.lock removal 5a39c68fb094 drm/i915/selftests: Prepare igt_gem_utils for obj->mm.lock removal 4a4950747bae drm/i915/selftests: Prepare object blit tests for obj->mm.lock removal. ba084a771fd9 drm/i915/selftests: Prepare object tests for obj->mm.lock removal. 89afabcc408e drm/i915/selftests: Prepare mman testcases for obj->mm.lock removal. 3f28d8d73a33 drm/i915/selftests: Prepare execbuf tests for obj->mm.lock removal. c25eb6821a19 drm/i915/selftests: Prepare dma-buf tests for obj->mm.lock removal. 57c19694c266 drm/i915/selftests: Prepare context tests for obj->mm.lock removal. 639fcd5ea986 drm/i915/selftests: Prepare coherency tests for obj->mm.lock removal. 2c146f16bb0f drm/i915/selftests: Prepare client blit for obj->mm.lock removal. f95d0fb66807 drm/i915/selftests: Prepare huge_pages testcases for obj->mm.lock removal. fae9a34de3ad drm/i915: Use a single page table lock for each gtt. 0cd52e7ebb96 drm/i915: Fix ww locking in shmem_create_from_object 09740eb15ae0 drm/i915: Add missing ww lock in intel_dsb_prepare. 333090d025a8 drm/i915: Add ww locking to dma-buf ops.244dae79052a drm/i915: Lock ww in ucode objects correctlycd47b7ad5405 drm/i915: Increase ww locking for perf.eb6fcc0954ff drm/i915: Add ww locking around vm_access()52f9f5f31a0f drm/i915: Add igt_spinner_pin() to allow for ww locking around spinner. 79bd0897399a drm/i915: Prepare for obj->mm.lock removalc6c0c64d6026 drm/i915: Fix workarounds selftest, part 1ce9f6c46fc3a drm/i915: Fix pread/pwrit
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18999/index.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx