Revert "drm/i915/gem: Drop relocation slowpath".
Subsystems (4)
PATCH 1/24 Revert "drm/i915/gem: Drop relocation slowpath".
This reverts commit 7dc8f1143778 ("drm/i915/gem: Drop relocation slowpath"). We need the slowpath relocation for taking ww-mutex inside the page fault handler, and we will take this mutex when pinning all objects.
[mlankhorst: Adjusted for reloc_gpu_flush() changes]
--- .../gpu/drm/i915/gem/i915_gem_execbuffer.c | 246 +++++++++++++++++- 1 file changed, 245 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c +245 -1
@@ -1705,7 +1705,9 @@ static int eb_relocate_vma(struct i915_execbuffer *eb, struct eb_vma *ev)* we would try to acquire the struct mutex again. Obviously * this is bad and so lockdep complains vehemently. */ - copied =__copy_from_user (r, urelocs, count *sizeof (r[0 ])); +pagefault_disable (); + copied =__copy_from_user_inatomic (r, urelocs, count *sizeof (r[0 ])); +pagefault_enable ();if (unlikely (copied)) { remain = -EFAULT ; goto out;
@@ -1753,6 +1755,246 @@ static int eb_relocate_vma(struct i915_execbuffer *eb, struct eb_vma *ev)return remain; } +static int +eb_relocate_vma_slow (struct i915_execbuffer *eb,struct eb_vma *ev) +{ +const struct drm_i915_gem_exec_object2 *entry = ev->exec; +struct drm_i915_gem_relocation_entry *relocs = +u64_to_ptr (typeof (*relocs), entry->relocs_ptr); +unsigned int i; +int err; + +for (i =0 ; i < entry->relocation_count; i++) { +u64 offset =eb_relocate_entry (eb, ev, &relocs[i]); + +if ((s64 )offset <0 ) { + err = (int )offset; + goto err; + } + } + err =0 ; +err: +reloc_cache_reset (&eb->reloc_cache); +return err; +} + +static int check_relocations (const struct drm_i915_gem_exec_object2 *entry) +{ +const char __user *addr, *end; +unsigned long size; +char __maybe_unused c; + + size = entry->relocation_count; +if (size ==0 ) +return 0 ; + +if (size >N_RELOC (ULONG_MAX )) +return -EINVAL ; + + addr =u64_to_user_ptr (entry->relocs_ptr); + size *=sizeof (struct drm_i915_gem_relocation_entry ); +if (!access_ok (addr, size)) +return -EFAULT ; + + end = addr + size; +for (; addr < end; addr +=PAGE_SIZE ) { +int err =__get_user (c, addr); +if (err) +return err; + } +return __get_user (c, end -1 ); +} + +static int eb_copy_relocations (const struct i915_execbuffer *eb) +{ +struct drm_i915_gem_relocation_entry *relocs; +const unsigned int count = eb->buffer_count; +unsigned int i; +int err; + +for (i =0 ; i < count; i++) { +const unsigned int nreloc = eb->exec[i].relocation_count; +struct drm_i915_gem_relocation_entry __user *urelocs; +unsigned long size; +unsigned long copied; + +if (nreloc ==0 ) +continue ; + + err =check_relocations (&eb->exec[i]); +if (err) + goto err; + + urelocs =u64_to_user_ptr (eb->exec[i].relocs_ptr); + size = nreloc *sizeof (*relocs); + + relocs =kvmalloc_array (size,1 ,GFP_KERNEL ); +if (!relocs) { + err = -ENOMEM ; + goto err; + } + +/* copy_from_user is limited to < 4GiB */ + copied =0 ; +do { +unsigned int len = +min_t (u64,BIT_ULL (31 ), size - copied); + +if (__copy_from_user ((char *)relocs + copied, + (char __user *)urelocs + copied, + len)) + goto end; + + copied += len; + }while (copied < size); + +/* +* As we do not update the known relocation offsets after +* relocating (due to the complexities in lock handling), +* we need to mark them as invalid now so that we force the +* relocation processing next time. Just in case the target +* object is evicted and then rebound into its old +* presumed_offset before the next execbuffer - if that +* happened we would make the mistake of assuming that the +* relocations were valid. +*/ +if (!user_access_begin (urelocs, size)) + goto end; + +for (copied =0 ; copied < nreloc; copied++) +unsafe_put_user (-1 , + &urelocs[copied].presumed_offset, + end_user); +user_access_end (); + + eb->exec[i].relocs_ptr = (uintptr_t )relocs; + } + +return 0 ; + +end_user: +user_access_end (); +end: +kvfree (relocs); + err = -EFAULT ; +err: +while (i--) { + relocs =u64_to_ptr (typeof (*relocs), eb->exec[i].relocs_ptr); +if (eb->exec[i].relocation_count) +kvfree (relocs); + } +return err; +} + +static int eb_prefault_relocations (const struct i915_execbuffer *eb) +{ +const unsigned int count = eb->buffer_count; +unsigned int i; + +for (i =0 ; i < count; i++) { +int err; + + err =check_relocations (&eb->exec[i]); +if (err) +return err; + } + +return 0 ; +} + +static noinline int eb_relocate_slow(struct i915_execbuffer *eb) +{ +bool have_copy = false; +struct eb_vma *ev; +int err =0 , flush; + +repeat: +if (signal_pending (current)) { + err = -ERESTARTSYS ; + goto out; + } + +/* +* We take 3 passes through the slowpatch. +* +* 1 - we try to just prefault all the user relocation entries and +* then attempt to reuse the atomic pagefault disabled fast path again. +* +* 2 - we copy the user entries to a local buffer here outside of the +* local and allow ourselves to wait upon any rendering before +* relocations +* +* 3 - we already have a local copy of the relocation entries, but +* were interrupted (EAGAIN) whilst waiting for the objects, try again. +*/ +if (!err) { + err =eb_prefault_relocations (eb); + }else if (!have_copy) { + err =eb_copy_relocations (eb); + have_copy = err ==0 ; + }else { +cond_resched (); + err =0 ; + } +if (err) + goto out; + +list_for_each_entry (ev, &eb->relocs, reloc_link) { +if (!have_copy) { +pagefault_disable (); + err =eb_relocate_vma (eb, ev); +pagefault_enable (); +if (err) +break ; + }else { + err =eb_relocate_vma_slow (eb, ev); +if (err) +break ; + } + } + + flush =reloc_gpu_flush (&eb->reloc_cache); +if (err && !have_copy) + goto repeat; + +if (!err) + err = flush; + +if (err) + goto err; + +/* +* Leave the user relocations as are, this is the painfully slow path, +* and we want to avoid the complication of dropping the lock whilst +* having buffers reserved in the aperture and so causing spurious +* ENOSPC for random operations. +*/ + +err: +if (err == -EAGAIN ) + goto repeat; + +out: +if (have_copy) { +const unsigned int count = eb->buffer_count; +unsigned int i; + +for (i =0 ; i < count; i++) { +const struct drm_i915_gem_exec_object2 *entry = + &eb->exec[i]; +struct drm_i915_gem_relocation_entry *relocs; + +if (!entry->relocation_count) +continue ; + + relocs =u64_to_ptr (typeof (*relocs), entry->relocs_ptr); +kvfree (relocs); + } + } + +return err; +} +static int eb_relocate (struct i915_execbuffer *eb) {int err;
@@ -1781,6 +2023,8 @@ static int eb_relocate(struct i915_execbuffer *eb) flush =reloc_gpu_flush (&eb->reloc_cache);if (!err) err = flush; +else +return eb_relocate_slow (eb); }return err;
base-commit: 0536dff30eff69abcf6355bdd9b9fdf45a560099
prerequisite-patch-id: e6315738715ac4ffccaeb4c4bf5a94651fb8da1d
Signature · 6 lines
2.26.2 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 2/24 drm/i915: Add an implementation for i915_gem_ww_ctx locking, v2.
i915_gem_ww_ctx is used to lock all gem bo's for pinning and memory eviction. We don't use it yet, but lets start adding the definition first.
To use it, we have to pass a non-NULL ww to gem_object_lock, and don't unlock directly. It is done in i915_gem_ww_ctx_fini.
Changes since v1:
- Change ww_ctx and obj order in locking functions (Jonas Lahtinen)
--- drivers/gpu/drm/i915/display/intel_display.c | 4 +- .../gpu/drm/i915/gem/i915_gem_client_blt.c | 2 +- drivers/gpu/drm/i915/gem/i915_gem_context.c | 2 +- drivers/gpu/drm/i915/gem/i915_gem_dmabuf.c | 4 +- drivers/gpu/drm/i915/gem/i915_gem_domain.c | 10 ++-- .../gpu/drm/i915/gem/i915_gem_execbuffer.c | 4 +- drivers/gpu/drm/i915/gem/i915_gem_object.c | 2 +- drivers/gpu/drm/i915/gem/i915_gem_object.h | 38 +++++++++++--- .../gpu/drm/i915/gem/i915_gem_object_blt.c | 2 +- .../gpu/drm/i915/gem/i915_gem_object_types.h | 9 ++++ drivers/gpu/drm/i915/gem/i915_gem_pm.c | 2 +- drivers/gpu/drm/i915/gem/i915_gem_tiling.c | 2 +- .../gpu/drm/i915/gem/selftests/huge_pages.c | 2 +- .../i915/gem/selftests/i915_gem_client_blt.c | 2 +- .../i915/gem/selftests/i915_gem_coherency.c | 10 ++-- .../drm/i915/gem/selftests/i915_gem_context.c | 4 +- .../drm/i915/gem/selftests/i915_gem_mman.c | 4 +- .../drm/i915/gem/selftests/i915_gem_phys.c | 2 +- .../gpu/drm/i915/gt/selftest_workarounds.c | 2 +- drivers/gpu/drm/i915/gvt/cmd_parser.c | 2 +- drivers/gpu/drm/i915/i915_gem.c | 52 +++++++++++++++++-- drivers/gpu/drm/i915/i915_gem.h | 11 ++++ drivers/gpu/drm/i915/selftests/i915_gem.c | 41 +++++++++++++++ drivers/gpu/drm/i915/selftests/i915_vma.c | 2 +- .../drm/i915/selftests/intel_memory_region.c | 2 +- 25 files changed, 174 insertions(+), 43 deletions(-)
drivers/gpu/drm/i915/display/intel_display.c +2 -2
@@ -2309,7 +2309,7 @@ intel_pin_and_fence_fb_obj(struct drm_framebuffer *fb,void intel_unpin_fb_vma (struct i915_vma *vma,unsigned long flags) { -i915_gem_object_lock (vma->obj); +i915_gem_object_lock (vma->obj,NULL );if (flags &PLANE_HAS_FENCE )i915_vma_unpin_fence (vma);i915_gem_object_unpin_from_display_plane (vma);
@@ -17112,7 +17112,7 @@ static int intel_framebuffer_init(struct intel_framebuffer *intel_fb,if (!intel_fb->frontbuffer)return -ENOMEM ; -i915_gem_object_lock (obj); +i915_gem_object_lock (obj,NULL ); tiling =i915_gem_object_get_tiling (obj); stride =i915_gem_object_get_stride (obj);i915_gem_object_unlock (obj);
drivers/gpu/drm/i915/gem/i915_gem_client_blt.c +1 -1
@@ -286,7 +286,7 @@ int i915_gem_schedule_fill_pages_blt(struct drm_i915_gem_object *obj,dma_fence_init (&work->dma, &clear_pages_work_ops, &fence_lock,0 ,0 );i915_sw_fence_init (&work->wait, clear_pages_work_notify); -i915_gem_object_lock (obj); +i915_gem_object_lock (obj,NULL ); err =i915_sw_fence_await_reservation (&work->wait, obj->base.resv,NULL , true,0 ,I915_FENCE_GFP );
drivers/gpu/drm/i915/gem/i915_gem_context.c +1 -1
@@ -113,7 +113,7 @@ static void lut_close(struct i915_gem_context *ctx)continue ;rcu_read_unlock (); -i915_gem_object_lock (obj); +i915_gem_object_lock (obj,NULL );list_for_each_entry (lut, &obj->lut_list, obj_link) {if (lut->ctx != ctx)continue ;
drivers/gpu/drm/i915/gem/i915_gem_dmabuf.c +2 -2
@@ -128,7 +128,7 @@ static int i915_gem_begin_cpu_access(struct dma_buf *dma_buf, enum dma_data_direif (err)return err; - err =i915_gem_object_lock_interruptible (obj); + err =i915_gem_object_lock_interruptible (obj,NULL );if (err) goto out;
@@ -149,7 +149,7 @@ static int i915_gem_end_cpu_access(struct dma_buf *dma_buf, enum dma_data_directif (err)return err; - err =i915_gem_object_lock_interruptible (obj); + err =i915_gem_object_lock_interruptible (obj,NULL );if (err) goto out;
drivers/gpu/drm/i915/gem/i915_gem_domain.c +5 -5
@@ -32,7 +32,7 @@ void i915_gem_object_flush_if_display(struct drm_i915_gem_object *obj)if (!i915_gem_object_is_framebuffer (obj))return ; -i915_gem_object_lock (obj); +i915_gem_object_lock (obj,NULL );__i915_gem_object_flush_for_display (obj);i915_gem_object_unlock (obj); }
@@ -197,7 +197,7 @@ int i915_gem_object_set_cache_level(struct drm_i915_gem_object *obj,if (ret)return ret; - ret =i915_gem_object_lock_interruptible (obj); + ret =i915_gem_object_lock_interruptible (obj,NULL );if (ret)return ret;
@@ -536,7 +536,7 @@ i915_gem_set_domain_ioctl(struct drm_device *dev, void *data,if (err) goto out; - err =i915_gem_object_lock_interruptible (obj); + err =i915_gem_object_lock_interruptible (obj,NULL );if (err) goto out_unpin;
@@ -576,7 +576,7 @@ int i915_gem_object_prepare_read(struct drm_i915_gem_object *obj,if (!i915_gem_object_has_struct_page (obj))return -ENODEV ; - ret =i915_gem_object_lock_interruptible (obj); + ret =i915_gem_object_lock_interruptible (obj,NULL );if (ret)return ret;
@@ -630,7 +630,7 @@ int i915_gem_object_prepare_write(struct drm_i915_gem_object *obj,if (!i915_gem_object_has_struct_page (obj))return -ENODEV ; - ret =i915_gem_object_lock_interruptible (obj); + ret =i915_gem_object_lock_interruptible (obj,NULL );if (ret)return ret;
drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c +2 -2
@@ -815,7 +815,7 @@ static int __eb_add_lut(struct i915_execbuffer *eb,if (err ==0 ) {/* And nor has this handle */ struct drm_i915_gem_object *obj = vma->obj; -i915_gem_object_lock (obj); +i915_gem_object_lock (obj,NULL );if (idr_find (&eb->file->object_idr, handle) == obj) {list_add (&lut->obj_link, &obj->lut_list); }else {
@@ -1178,7 +1178,7 @@ static void *reloc_iomap(struct drm_i915_gem_object *obj,if (use_cpu_reloc (cache, obj))return NULL ; -i915_gem_object_lock (obj); +i915_gem_object_lock (obj,NULL ); err =i915_gem_object_set_to_gtt_domain (obj, true);i915_gem_object_unlock (obj);if (err)
drivers/gpu/drm/i915/gem/i915_gem_object.c +1 -1
@@ -108,7 +108,7 @@ void i915_gem_close_object(struct drm_gem_object *gem, struct drm_file *file)struct i915_lut_handle *lut, *ln;LIST_HEAD (close); -i915_gem_object_lock (obj); +i915_gem_object_lock (obj,NULL );list_for_each_entry_safe (lut, ln, &obj->lut_list, obj_link) {struct i915_gem_context *ctx = lut->ctx;
drivers/gpu/drm/i915/gem/i915_gem_object.h +31 -7
@@ -110,20 +110,44 @@ i915_gem_object_put(struct drm_i915_gem_object *obj)#define assert_object_held (obj) dma_resv_assert_held((obj)->base.resv) -static inline void i915_gem_object_lock (struct drm_i915_gem_object *obj) +static inline int __i915_gem_object_lock (struct drm_i915_gem_object *obj, +struct i915_gem_ww_ctx *ww, +bool intr) { -dma_resv_lock (obj->base.resv,NULL ); +int ret; + +if (intr) + ret =dma_resv_lock_interruptible (obj->base.resv, ww ? &ww->ctx :NULL ); +else + ret =dma_resv_lock (obj->base.resv, ww ? &ww->ctx :NULL ); + +if (!ret && ww) +list_add_tail (&obj->obj_link, &ww->obj_list); +if (ret == -EALREADY ) + ret =0 ; + +if (ret == -EDEADLK ) + ww->contended = obj; + +return ret; } -static inline bool i915_gem_object_trylock (struct drm_i915_gem_object *obj) +static inline int i915_gem_object_lock (struct drm_i915_gem_object *obj, +struct i915_gem_ww_ctx *ww) { -return dma_resv_trylock (obj->base.resv); +return __i915_gem_object_lock (obj, ww, ww && ww->intr); } -static inline int -i915_gem_object_lock_interruptible (struct drm_i915_gem_object *obj) +static inline int i915_gem_object_lock_interruptible (struct drm_i915_gem_object *obj, +struct i915_gem_ww_ctx *ww) { -return dma_resv_lock_interruptible (obj->base.resv,NULL ); +WARN_ON (ww && !ww->intr); +return __i915_gem_object_lock (obj, ww, true); +} + +static inline bool i915_gem_object_trylock (struct drm_i915_gem_object *obj) +{ +return dma_resv_trylock (obj->base.resv); }static inline void i915_gem_object_unlock (struct drm_i915_gem_object *obj)
drivers/gpu/drm/i915/gem/i915_gem_object_blt.c +1 -1
@@ -144,7 +144,7 @@ int i915_gem_object_fill_blt(struct drm_i915_gem_object *obj,return err;if (obj->cache_dirty & ~obj->cache_coherent) { -i915_gem_object_lock (obj); +i915_gem_object_lock (obj,NULL );i915_gem_clflush_object (obj,0 );i915_gem_object_unlock (obj); }
drivers/gpu/drm/i915/gem/i915_gem_object_types.h +9 -0
@@ -122,6 +122,15 @@ struct drm_i915_gem_object {*/ struct list_head lut_list; +/** +* @obj_link: Link into @i915_gem_ww_ctx.obj_list +* +* When we lock this object through i915_gem_object_lock() with a +* context, we add it to the list to ensure we can unlock everything +* when i915_gem_ww_ctx_backoff() or i915_gem_ww_ctx_fini() are called. +*/ +struct list_head obj_link; +/** Stolen memory for this object, instead of being backed by shmem. */ struct drm_mm_node *stolen;union {
drivers/gpu/drm/i915/gem/i915_gem_pm.c +1 -1
@@ -84,7 +84,7 @@ void i915_gem_suspend_late(struct drm_i915_private *i915)spin_unlock_irqrestore (&i915->mm.obj_lock, flags); -i915_gem_object_lock (obj); +i915_gem_object_lock (obj,NULL );drm_WARN_ON (&i915->drm,i915_gem_object_set_to_gtt_domain (obj, false));i915_gem_object_unlock (obj);
drivers/gpu/drm/i915/gem/i915_gem_tiling.c +1 -1
@@ -249,7 +249,7 @@ i915_gem_object_set_tiling(struct drm_i915_gem_object *obj,* whilst executing a fenced command for an untiled object. */ -i915_gem_object_lock (obj); +i915_gem_object_lock (obj,NULL );if (i915_gem_object_is_framebuffer (obj)) {i915_gem_object_unlock (obj);return -EBUSY ;
drivers/gpu/drm/i915/gem/selftests/huge_pages.c +1 -1
@@ -947,7 +947,7 @@ static int gpu_write(struct intel_context *ce, {int err; -i915_gem_object_lock (vma->obj); +i915_gem_object_lock (vma->obj,NULL ); err =i915_gem_object_set_to_gtt_domain (vma->obj, true);i915_gem_object_unlock (vma->obj);if (err)
drivers/gpu/drm/i915/gem/selftests/i915_gem_client_blt.c +1 -1
@@ -75,7 +75,7 @@ static int __igt_client_fill(struct intel_engine_cs *engine)if (err) goto err_unpin; -i915_gem_object_lock (obj); +i915_gem_object_lock (obj,NULL ); err =i915_gem_object_set_to_cpu_domain (obj, false);i915_gem_object_unlock (obj);if (err)
drivers/gpu/drm/i915/gem/selftests/i915_gem_coherency.c +5 -5
@@ -82,7 +82,7 @@ static int gtt_set(struct context *ctx, unsigned long offset, u32 v)u32 __iomem *map;int err =0 ; -i915_gem_object_lock (ctx->obj); +i915_gem_object_lock (ctx->obj,NULL ); err =i915_gem_object_set_to_gtt_domain (ctx->obj, true);i915_gem_object_unlock (ctx->obj);if (err)
@@ -115,7 +115,7 @@ static int gtt_get(struct context *ctx, unsigned long offset, u32 *v)u32 __iomem *map;int err =0 ; -i915_gem_object_lock (ctx->obj); +i915_gem_object_lock (ctx->obj,NULL ); err =i915_gem_object_set_to_gtt_domain (ctx->obj, false);i915_gem_object_unlock (ctx->obj);if (err)
@@ -147,7 +147,7 @@ static int wc_set(struct context *ctx, unsigned long offset, u32 v)u32 *map;int err; -i915_gem_object_lock (ctx->obj); +i915_gem_object_lock (ctx->obj,NULL ); err =i915_gem_object_set_to_wc_domain (ctx->obj, true);i915_gem_object_unlock (ctx->obj);if (err)
@@ -170,7 +170,7 @@ static int wc_get(struct context *ctx, unsigned long offset, u32 *v)u32 *map;int err; -i915_gem_object_lock (ctx->obj); +i915_gem_object_lock (ctx->obj,NULL ); err =i915_gem_object_set_to_wc_domain (ctx->obj, false);i915_gem_object_unlock (ctx->obj);if (err)
@@ -193,7 +193,7 @@ static int gpu_set(struct context *ctx, unsigned long offset, u32 v)u32 *cs;int err; -i915_gem_object_lock (ctx->obj); +i915_gem_object_lock (ctx->obj,NULL ); err =i915_gem_object_set_to_gtt_domain (ctx->obj, true);i915_gem_object_unlock (ctx->obj);if (err)
drivers/gpu/drm/i915/gem/selftests/i915_gem_context.c +2 -2
@@ -950,7 +950,7 @@ emit_rpcs_query(struct drm_i915_gem_object *obj,if (IS_ERR (vma))return PTR_ERR (vma); -i915_gem_object_lock (obj); +i915_gem_object_lock (obj,NULL ); err =i915_gem_object_set_to_gtt_domain (obj, false);i915_gem_object_unlock (obj);if (err)
@@ -1706,7 +1706,7 @@ static int read_from_scratch(struct i915_gem_context *ctx,i915_request_add (rq); -i915_gem_object_lock (obj); +i915_gem_object_lock (obj,NULL ); err =i915_gem_object_set_to_cpu_domain (obj, false);i915_gem_object_unlock (obj);if (err)
drivers/gpu/drm/i915/gem/selftests/i915_gem_mman.c +2 -2
@@ -103,7 +103,7 @@ static int check_partial_mapping(struct drm_i915_gem_object *obj,GEM_BUG_ON (i915_gem_object_get_tiling (obj) != tile->tiling);GEM_BUG_ON (i915_gem_object_get_stride (obj) != tile->stride); -i915_gem_object_lock (obj); +i915_gem_object_lock (obj,NULL ); err =i915_gem_object_set_to_gtt_domain (obj, true);i915_gem_object_unlock (obj);if (err) {
@@ -188,7 +188,7 @@ static int check_partial_mappings(struct drm_i915_gem_object *obj,GEM_BUG_ON (i915_gem_object_get_tiling (obj) != tile->tiling);GEM_BUG_ON (i915_gem_object_get_stride (obj) != tile->stride); -i915_gem_object_lock (obj); +i915_gem_object_lock (obj,NULL ); err =i915_gem_object_set_to_gtt_domain (obj, true);i915_gem_object_unlock (obj);if (err) {
drivers/gpu/drm/i915/gem/selftests/i915_gem_phys.c +1 -1
@@ -44,7 +44,7 @@ static int mock_phys_object(void *arg) }/* Make the object dirty so that put_pages must do copy back the data */ -i915_gem_object_lock (obj); +i915_gem_object_lock (obj,NULL ); err =i915_gem_object_set_to_gtt_domain (obj, true);i915_gem_object_unlock (obj);if (err) {
drivers/gpu/drm/i915/gt/selftest_workarounds.c +1 -1
@@ -214,7 +214,7 @@ static int check_whitelist(struct i915_gem_context *ctx,return PTR_ERR (results); err =0 ; -i915_gem_object_lock (results); +i915_gem_object_lock (results,NULL );intel_wedge_on_timeout (&wedge, engine->gt,HZ /5 )/* safety net! */ err = i915_gem_object_set_to_cpu_domain(results, false);i915_gem_object_unlock (results);
drivers/gpu/drm/i915/gvt/cmd_parser.c +1 -1
@@ -2994,7 +2994,7 @@ static int shadow_indirect_ctx(struct intel_shadow_wa_ctx *wa_ctx) goto put_obj; } -i915_gem_object_lock (obj); +i915_gem_object_lock (obj,NULL ); ret =i915_gem_object_set_to_cpu_domain (obj, false);i915_gem_object_unlock (obj);if (ret) {
drivers/gpu/drm/i915/i915_gem.c +49 -3
76 lines not on this page · raw message
drivers/gpu/drm/i915/i915_gem.h +11 -0
@@ -116,4 +116,15 @@ static inline bool __tasklet_is_scheduled(struct tasklet_struct *t) return test_bit(TASKLET_STATE_SCHED, &t->state); } +struct i915_gem_ww_ctx { +struct ww_acquire_ctx ctx; +struct list_head obj_list; +bool intr; +struct drm_i915_gem_object *contended; +}; + +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); +#endif /* __I915_GEM_H__ */
drivers/gpu/drm/i915/selftests/i915_gem.c +41 -0
52 lines not on this page · raw message
drivers/gpu/drm/i915/selftests/i915_vma.c +1 -1
@@ -892,7 +892,7 @@ static int igt_vma_remapped_gtt(void *arg)unsigned int x, y;int err; -i915_gem_object_lock (obj); +i915_gem_object_lock (obj,NULL ); err =i915_gem_object_set_to_gtt_domain (obj, true);i915_gem_object_unlock (obj);if (err)
drivers/gpu/drm/i915/selftests/intel_memory_region.c +1 -1
@@ -509,7 +509,7 @@ static int igt_lmem_write_cpu(void *arg)if (err) goto out_unpin; -i915_gem_object_lock (obj); +i915_gem_object_lock (obj,NULL ); err =i915_gem_object_set_to_wc_domain (obj, true);i915_gem_object_unlock (obj);if (err)
Signature · 6 lines
2.26.2 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [Intel-gfx] [PATCH 02/24] drm/i915: Add an implementation for i915_gem_ww_ctx locking, v2.
Quoted 12 lines
-----Original Message-----
From: Intel-gfx <[email protected]> On Behalf Of Maarten Lankhorst
Sent: Wednesday, June 3, 2020 10:57 AM
To: [email protected]
Subject: [Intel-gfx] [PATCH 02/24] drm/i915: Add an implementation fori915_gem_ww_ctxlocking, v2.
i915_gem_ww_ctxis used to lock all gem bo's for pinning and memory eviction. We don't use it yet, but lets start adding the definition first.
Quoted 5 lines
To use it, we have to pass a non-NULL ww to
gem_object_lock, and don't unlock directly. It is done ini915_gem_ww_ctx_fini.Changes since v1:
- Changeww_ctxand obj order in locking functions (Jonas Lahtinen)
Not to add more patches to this patch set, but this really seems like two patches:
1) pre-work: add the new parameter to the locking (and add NULL to all the calls)
2) add the new functionality, i.e. updates to the locking code (including the test code)
Finding the new functionality amongst the noise of the parameter update is a bit difficult.
Splitting into makes the first patch mechanical and compile checked, and the second patch reviewable.
Other than that, this looks pretty reasonable.
m
Quoted 717 lines
Signed-off-by Maarten Lankhorst <[email protected]>---
drivers/gpu/drm/i915/display/intel_display.c | 4 +- .../gpu/drm/i915/gem/i915_gem_client_blt.c | 2 +- drivers/gpu/drm/i915/gem/i915_gem_context.c | 2 +- drivers/gpu/drm/i915/gem/i915_gem_dmabuf.c | 4 +- drivers/gpu/drm/i915/gem/i915_gem_domain.c | 10 ++-- .../gpu/drm/i915/gem/i915_gem_execbuffer.c | 4 +- drivers/gpu/drm/i915/gem/i915_gem_object.c | 2 +- drivers/gpu/drm/i915/gem/i915_gem_object.h | 38 +++++++++++--- .../gpu/drm/i915/gem/i915_gem_object_blt.c | 2 +- .../gpu/drm/i915/gem/i915_gem_object_types.h | 9 ++++ drivers/gpu/drm/i915/gem/i915_gem_pm.c | 2 +- drivers/gpu/drm/i915/gem/i915_gem_tiling.c | 2 +- .../gpu/drm/i915/gem/selftests/huge_pages.c | 2 +- .../i915/gem/selftests/i915_gem_client_blt.c | 2 +- .../i915/gem/selftests/i915_gem_coherency.c | 10 ++-- .../drm/i915/gem/selftests/i915_gem_context.c | 4 +- .../drm/i915/gem/selftests/i915_gem_mman.c | 4 +- .../drm/i915/gem/selftests/i915_gem_phys.c | 2 +- .../gpu/drm/i915/gt/selftest_workarounds.c | 2 +- drivers/gpu/drm/i915/gvt/cmd_parser.c | 2 +- drivers/gpu/drm/i915/i915_gem.c | 52 +++++++++++++++++-- drivers/gpu/drm/i915/i915_gem.h | 11 ++++ drivers/gpu/drm/i915/selftests/i915_gem.c | 41 +++++++++++++++ drivers/gpu/drm/i915/selftests/i915_vma.c | 2 +- .../drm/i915/selftests/intel_memory_region.c | 2 +- 25 files changed, 174 insertions(+), 43 deletions(-)drivers/gpu/drm/i915/display/intel_display.c +1
-1@@ -2309,7 +2309,7 @@ intel_pin_and_fence_fb_obj(structdrm_framebuffer *fb, void intel_unpin_fb_vma(struct i915_vma *vma, unsigned long flags) { - i915_gem_object_lock(vma->obj); + i915_gem_object_lock(vma->obj, NULL);if (flags &PLANE_HAS_FENCE )i915_vma_unpin_fence (vma);i915_gem_object_unpin_from_display_plane(vma);drivers/gpu/drm/i915/display/intel_display.c +1
-1@@ -17112,7 +17112,7 @@ static int intel_framebuffer_init(struct intel_framebuffer *intel_fb, if (!intel_fb->frontbuffer) return -ENOMEM; -i915_gem_object_lock (obj); +i915_gem_object_lock (obj,NULL ); tiling =i915_gem_object_get_tiling (obj); stride =i915_gem_object_get_stride (obj);i915_gem_object_unlock(obj);drivers/gpu/drm/i915/gem/i915_gem_client_blt.c +1
-1@@ -286,7 +286,7 @@ int i915_gem_schedule_fill_pages_blt(struct drm_i915_gem_object *obj,dma_fence_init (&work->dma, &clear_pages_work_ops, &fence_lock,0 ,0 );i915_sw_fence_init (&work->wait, clear_pages_work_notify); -i915_gem_object_lock (obj); +i915_gem_object_lock (obj,NULL ); err = i915_sw_fence_await_reservation(&work->wait,obj->base.resv, NULL, true, 0, I915_FENCE_GFP);drivers/gpu/drm/i915/gem/i915_gem_context.c +1
-1@@ -113,7 +113,7 @@ static void lut_close(struct i915_gem_context *ctx)continue ;rcu_read_unlock (); -i915_gem_object_lock (obj); +i915_gem_object_lock (obj,NULL );list_for_each_entry (lut, &obj->lut_list, obj_link) {if (lut->ctx != ctx)continue ;drivers/gpu/drm/i915/gem/i915_gem_dmabuf.c +2
-2@@ -128,7 +128,7 @@ static int i915_gem_begin_cpu_access(struct dma_buf *dma_buf, enum dma_data_dire if (err) return err; - err = i915_gem_object_lock_interruptible(obj); + err = i915_gem_object_lock_interruptible(obj, NULL); if (err) goto out;@@ -149,7 +149,7 @@ static int i915_gem_end_cpu_access(struct dma_buf *dma_buf, enum dma_data_direct if (err) return err; - err = i915_gem_object_lock_interruptible(obj); + err = i915_gem_object_lock_interruptible(obj, NULL); if (err) goto out;drivers/gpu/drm/i915/gem/i915_gem_domain.c +1
-1@@ -32,7 +32,7 @@ void i915_gem_object_flush_if_display(struct drm_i915_gem_object *obj)if (!i915_gem_object_is_framebuffer (obj))return ; -i915_gem_object_lock (obj); +i915_gem_object_lock (obj,NULL );__i915_gem_object_flush_for_display (obj);i915_gem_object_unlock (obj);}
drivers/gpu/drm/i915/gem/i915_gem_domain.c +4
-4@@ -197,7 +197,7 @@ int i915_gem_object_set_cache_level(structdrm_i915_gem_object *obj, if (ret) return ret; - ret =i915_gem_object_lock_interruptible (obj); + ret =i915_gem_object_lock_interruptible (obj,NULL );if (ret)return ret;@@ -536,7 +536,7 @@ i915_gem_set_domain_ioctl(struct drm_device *dev,void *data, if (err) goto out; - err =i915_gem_object_lock_interruptible (obj); + err =i915_gem_object_lock_interruptible (obj,NULL );if (err) goto out_unpin;@@ -576,7 +576,7 @@ int i915_gem_object_prepare_read(struct drm_i915_gem_object *obj, if (!i915_gem_object_has_struct_page(obj)) return -ENODEV; - ret =i915_gem_object_lock_interruptible (obj); + ret =i915_gem_object_lock_interruptible (obj,NULL );if (ret)return ret;@@ -630,7 +630,7 @@ int i915_gem_object_prepare_write(struct drm_i915_gem_object *obj, if (!i915_gem_object_has_struct_page(obj)) return -ENODEV; - ret =i915_gem_object_lock_interruptible (obj); + ret =i915_gem_object_lock_interruptible (obj,NULL );if (ret)return ret;drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c +2
-2@@ -815,7 +815,7 @@ static int __eb_add_lut(struct i915_execbuffer *eb,if (err ==0 ) {/* And nor has this handle */ struct drm_i915_gem_object *obj = vma->obj; -i915_gem_object_lock (obj); +i915_gem_object_lock (obj,NULL );if (idr_find (&eb->file->object_idr, handle) == obj) {list_add (&lut->obj_link, &obj->lut_list); }else {@@ -1178,7 +1178,7 @@ static void *reloc_iomap(structdrm_i915_gem_object *obj, if (use_cpu_reloc(cache, obj)) return NULL; -i915_gem_object_lock (obj ); +i915_gem_object_lock (obj ,NULL ); err =i915_gem_object_set_to_gtt_domain (obj, true);i915_gem_object_unlock (obj);if (err)
drivers/gpu/drm/i915/gem/i915_gem_object.c +1
-1@@ -108,7 +108,7 @@ void i915_gem_close_object(struct drm_gem_object *gem, struct drm_file *file)struct i915_lut_handle *lut, *ln;LIST_HEAD (close); -i915_gem_object_lock (obj); +i915_gem_object_lock (obj,NULL );list_for_each_entry_safe (lut, ln, &obj->lut_list, obj_link) {struct i915_gem_context *ctx = lut->ctx;drivers/gpu/drm/i915/gem/i915_gem_object.h +24
-6@@ -110,20 +110,44 @@ i915_gem_object_put(struct drm_i915_gem_object *obj)#define assert_object_held (obj) dma_resv_assert_held((obj)->base.resv) -static inline void i915_gem_object_lock (struct drm_i915_gem_object *obj) +static inline int __i915_gem_object_lock (struct drm_i915_gem_object *obj, +struct i915_gem_ww_ctx *ww, +bool intr) { -dma_resv_lock (obj->base.resv,NULL ); +int ret; + +if (intr) + ret =dma_resv_lock_interruptible (obj->base.resv, ww ? &ww->ctx :NULL ); +else + ret =dma_resv_lock (obj->base.resv, ww ? &ww->ctx :NULL ); + +if (!ret && ww) +list_add_tail (&obj->obj_link, &ww->obj_list); +if (ret == -EALREADY ) + ret =0 ; + +if (ret == -EDEADLK ) + ww->contended = obj; + +return ret; } -static inline bool i915_gem_object_trylock (struct drm_i915_gem_object *obj) +static inline int i915_gem_object_lock (struct drm_i915_gem_object *obj, +struct i915_gem_ww_ctx *ww) { -return dma_resv_trylock (obj->base.resv); +return __i915_gem_object_lock (obj, ww, ww && ww->intr); } -static inline int -i915_gem_object_lock_interruptible(struct drm_i915_gem_object *obj) +static inline int i915_gem_object_lock_interruptible (struct drm_i915_gem_object *obj, +struct i915_gem_ww_ctx *ww){
drivers/gpu/drm/i915/gem/i915_gem_object.h +5
-1-return dma_resv_lock_interruptible (obj->base.resv,NULL ); +WARN_ON (ww && !ww->intr); +return __i915_gem_object_lock (obj, ww, true); +} + +static inline bool i915_gem_object_trylock(struct drm_i915_gem_object*obj)
drivers/gpu/drm/i915/gem/i915_gem_object.h +2
-0+{ +return dma_resv_trylock (obj->base.resv);}
static inline void
i915_gem_object_unlock(struct drm_i915_gem_object *obj)drivers/gpu/drm/i915/gem/i915_gem_object_blt.c +1
-1@@ -144,7 +144,7 @@ int i915_gem_object_fill_blt(structdrm_i915_gem_object *obj, return err;if (obj->cache_dirty & ~obj->cache_coherent) { -i915_gem_object_lock (obj); +i915_gem_object_lock (obj,NULL );i915_gem_clflush_object (obj,0 );i915_gem_object_unlock (obj);}drivers/gpu/drm/i915/gem/i915_gem_object_types.h +6
-0@@ -122,6 +122,15 @@ struct drm_i915_gem_object {*/ struct list_head lut_list; +/** +* @obj_link: Link into @i915_gem_ww_ctx.obj_list +* +* When we lock this object through i915_gem_object_lock() with a +* context, we add it to the list to ensure we can unlock everything +* when i915_gem_ww_ctx_backoff() or i915_gem_ww_ctx_fini() are called.
drivers/gpu/drm/i915/gem/i915_gem_object_types.h +3
-0+*/ +struct list_head obj_link; +/** Stolen memory for this object, instead of being backed by shmem. */ struct drm_mm_node *stolen; union {drivers/gpu/drm/i915/gem/i915_gem_pm.c +1
-1@@ -84,7 +84,7 @@ void i915_gem_suspend_late(struct drm_i915_private *i915)spin_unlock_irqrestore (&i915->mm.obj_lock, flags); -i915_gem_object_lock (obj); +i915_gem_object_lock (obj,NULL );drm_WARN_ON (&i915->drm,i915_gem_object_set_to_gtt_domain (obj, false));i915_gem_object_unlock(obj);drivers/gpu/drm/i915/gem/i915_gem_tiling.c +1
-1@@ -249,7 +249,7 @@ i915_gem_object_set_tiling(structdrm_i915_gem_object *obj, * whilst executing a fenced command for an untiled object. */ -i915_gem_object_lock (obj); +i915_gem_object_lock (obj,NULL );if (i915_gem_object_is_framebuffer (obj)) {i915_gem_object_unlock (obj);return -EBUSY;drivers/gpu/drm/i915/gem/selftests/huge_pages.c +1
-1@@ -947,7 +947,7 @@ static int gpu_write(struct intel_context *ce, {int err; -i915_gem_object_lock (vma->obj); +i915_gem_object_lock (vma->obj,NULL ); err =i915_gem_object_set_to_gtt_domain (vma->obj, true);i915_gem_object_unlock (vma->obj);if (err)drivers/gpu/drm/i915/gem/selftests/i915_gem_client_blt.c +1
-1@@ -75,7 +75,7 @@ static int __igt_client_fill(struct intel_engine_cs *engine)if (err) goto err_unpin; -i915_gem_object_lock (obj); +i915_gem_object_lock (obj,NULL ); err =i915_gem_object_set_to_cpu_domain (obj, false);i915_gem_object_unlock (obj);if (err)drivers/gpu/drm/i915/gem/selftests/i915_gem_coherency.c +1
-1@@ -82,7 +82,7 @@ static int gtt_set(struct context *ctx, unsigned long offset, u32 v) u32__iomem *map;int err =0 ; -i915_gem_object_lock (ctx->obj); +i915_gem_object_lock (ctx->obj,NULL ); err =i915_gem_object_set_to_gtt_domain (ctx->obj, true);i915_gem_object_unlock (ctx->obj);if (err)
drivers/gpu/drm/i915/gem/selftests/i915_gem_coherency.c +1
-1@@ -115,7 +115,7 @@ static int gtt_get(struct context *ctx, unsigned long offset, u32 *v)u32 __iomem *map;int err =0 ; -i915_gem_object_lock (ctx->obj); +i915_gem_object_lock (ctx->obj,NULL ); err =i915_gem_object_set_to_gtt_domain (ctx->obj, false);i915_gem_object_unlock (ctx->obj);if (err)
drivers/gpu/drm/i915/gem/selftests/i915_gem_coherency.c +1
-1@@ -147,7 +147,7 @@ static int wc_set(struct context *ctx, unsigned long offset, u32 v) u32 *map;int err; -i915_gem_object_lock (ctx->obj); +i915_gem_object_lock (ctx->obj,NULL ); err =i915_gem_object_set_to_wc_domain (ctx->obj, true);i915_gem_object_unlock (ctx->obj);if (err)
drivers/gpu/drm/i915/gem/selftests/i915_gem_coherency.c +1
-1@@ -170,7 +170,7 @@ static int wc_get(struct context *ctx, unsigned long offset, u32 *v)u32 *map;int err; -i915_gem_object_lock (ctx->obj); +i915_gem_object_lock (ctx->obj,NULL ); err =i915_gem_object_set_to_wc_domain (ctx->obj, false);i915_gem_object_unlock (ctx->obj);if (err)
drivers/gpu/drm/i915/gem/selftests/i915_gem_coherency.c +1
-1@@ -193,7 +193,7 @@ static int gpu_set(struct context *ctx, unsigned long offset, u32 v) u32 *cs;int err; -i915_gem_object_lock (ctx->obj); +i915_gem_object_lock (ctx->obj,NULL ); err =i915_gem_object_set_to_gtt_domain (ctx->obj, true);i915_gem_object_unlock (ctx->obj);if (err)
drivers/gpu/drm/i915/gem/selftests/i915_gem_context.c +2
-2@@ -950,7 +950,7 @@ emit_rpcs_query(struct drm_i915_gem_object *obj,if (IS_ERR (vma))return PTR_ERR (vma); -i915_gem_object_lock (obj); +i915_gem_object_lock (obj,NULL ); err =i915_gem_object_set_to_gtt_domain (obj, false);i915_gem_object_unlock (obj);if (err)@@ -1706,7 +1706,7 @@ static int read_from_scratch(structi915_gem_context *ctx,i915_request_add (rq ); -i915_gem_object_lock (obj); +i915_gem_object_lock (obj,NULL ); err =i915_gem_object_set_to_cpu_domain (obj, false);i915_gem_object_unlock (obj);if (err)
drivers/gpu/drm/i915/gem/selftests/i915_gem_mman.c +1
-1@@ -103,7 +103,7 @@ static int check_partial_mapping(struct drm_i915_gem_object *obj,GEM_BUG_ON (i915_gem_object_get_tiling (obj) != tile->tiling);GEM_BUG_ON (i915_gem_object_get_stride (obj) != tile->stride); -i915_gem_object_lock (obj); +i915_gem_object_lock (obj,NULL ); err =i915_gem_object_set_to_gtt_domain (obj, true);i915_gem_object_unlock (obj);if (err) {drivers/gpu/drm/i915/gem/selftests/i915_gem_mman.c +1
-1@@ -188,7 +188,7 @@ static int check_partial_mappings(struct drm_i915_gem_object *obj,GEM_BUG_ON (i915_gem_object_get_tiling (obj) != tile->tiling);GEM_BUG_ON (i915_gem_object_get_stride (obj) != tile->stride); -i915_gem_object_lock (obj); +i915_gem_object_lock (obj,NULL ); err =i915_gem_object_set_to_gtt_domain (obj, true);i915_gem_object_unlock (obj);if (err) {drivers/gpu/drm/i915/gem/selftests/i915_gem_phys.c +0
-0@@ -44,7 +44,7 @@ static int mock_phys_object(void *arg) }/* Make the object dirty so that put_pages must do copy back the data */
drivers/gpu/drm/i915/gem/selftests/i915_gem_phys.c +1
-1-i915_gem_object_lock (obj); +i915_gem_object_lock (obj,NULL );err = i915_gem_object_set_to_gtt_domain(obj, true); i915_gem_object_unlock(obj); if (err) {drivers/gpu/drm/i915/gt/selftest_workarounds.c +1
-1@@ -214,7 +214,7 @@ static int check_whitelist(struct i915_gem_context *ctx, return PTR_ERR(results); err =0 ; -i915_gem_object_lock (results); +i915_gem_object_lock (results,NULL );intel_wedge_on_timeout (&wedge, engine->gt,HZ /5 )/* safety net! */ err = i915_gem_object_set_to_cpu_domain(results, false); i915_gem_object_unlock(results);drivers/gpu/drm/i915/gvt/cmd_parser.c +1
-1@@ -2994,7 +2994,7 @@ static int shadow_indirect_ctx(struct intel_shadow_wa_ctx *wa_ctx) goto put_obj; } -i915_gem_object_lock (obj); +i915_gem_object_lock (obj,NULL ); ret =i915_gem_object_set_to_cpu_domain (obj, false);i915_gem_object_unlock (obj);if (ret) {drivers/gpu/drm/i915/i915_gem.c +3
-3@@ -420,7 +420,7 @@ i915_gem_gtt_pread(struct drm_i915_gem_object *obj,GEM_BUG_ON (!drm_mm_node_allocated (&node)); } - ret =i915_gem_object_lock_interruptible (obj); + ret =i915_gem_object_lock_interruptible (obj,NULL );if (ret) goto out_unpin;@@ -619,7 +619,7 @@ i915_gem_gtt_pwrite_fast(struct drm_i915_gem_object *obj,GEM_BUG_ON (!drm_mm_node_allocated (&node)); } - ret =i915_gem_object_lock_interruptible (obj); + ret =i915_gem_object_lock_interruptible (obj,NULL );if (ret) goto out_unpin;@@ -1272,7 +1272,7 @@ int i915_gem_freeze_late(struct drm_i915_private *i915)i915_gem_drain_freed_objects (i915);list_for_each_entry (obj, &i915->mm.shrink_list, mm.link) { -i915_gem_object_lock (obj); +i915_gem_object_lock (obj,NULL );drm_WARN_ON (&i915->drm,i915_gem_object_set_to_cpu_domain (obj, true));i915_gem_object_unlock(obj);drivers/gpu/drm/i915/i915_gem.c +35
-0@@ -1326,6 +1326,52 @@ int i915_gem_open(struct drm_i915_private *i915, struct drm_file *file)return ret; } +void i915_gem_ww_ctx_init (struct i915_gem_ww_ctx *ww,bool intr) +{ +ww_acquire_init (&ww->ctx, &reservation_ww_class); +INIT_LIST_HEAD (&ww->obj_list); + ww->intr = intr; + ww->contended =NULL ; +} + +static void i915_gem_ww_ctx_unlock_all (struct i915_gem_ww_ctx *ww) +{ +struct drm_i915_gem_object *obj; + + while ((obj = list_first_entry_or_null(&ww->obj_list, struct drm_i915_gem_object, obj_link))) { +list_del (&obj->obj_link); +i915_gem_object_unlock (obj); + } +} + +void i915_gem_ww_ctx_fini (struct i915_gem_ww_ctx *ww) +{ +i915_gem_ww_ctx_unlock_all (ww); +WARN_ON (ww->contended); +ww_acquire_fini (&ww->ctx); +} + +int __must_check i915_gem_ww_ctx_backoff (struct i915_gem_ww_ctx *ww) +{ +int ret =0 ; + +if (WARN_ON (!ww->contended)) +return -EINVAL ; + +i915_gem_ww_ctx_unlock_all (ww); +if (ww->intr) + ret = dma_resv_lock_slow_interruptible(ww->contended-Quoted 1 line
base.resv,
&ww->ctx);drivers/gpu/drm/i915/i915_gem.c +2
-0+else + dma_resv_lock_slow(ww->contended->base.resv, &ww-Quoted 1 line
ctx);
drivers/gpu/drm/i915/i915_gem.c +9
-0+ +if (!ret) +list_add_tail (&ww->contended->obj_link, &ww->obj_list); + + ww->contended =NULL ; + +return ret; +} +#if
IS_ENABLED(CONFIG_DRM_I915_SELFTEST)
#include "selftests/mock_gem_device.c"
#include "selftests/i915_gem.c"drivers/gpu/drm/i915/i915_gem.h +10
-0@@ -116,4 +116,15 @@ static inline bool __tasklet_is_scheduled(struct tasklet_struct *t)return test_bit (TASKLET_STATE_SCHED , &t->state); } +struct i915_gem_ww_ctx { +struct ww_acquire_ctx ctx; +struct list_head obj_list; +bool intr; +struct drm_i915_gem_object *contended; +}; + +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);
+
#endif /*__I915_GEM_H__*/drivers/gpu/drm/i915/selftests/i915_gem.c +41
-0@@ -199,11 +199,52 @@ static int igt_gem_hibernate(void *arg)return err; } +static int igt_gem_ww_ctx (void *arg) +{ +struct drm_i915_private *i915 = arg; +struct drm_i915_gem_object *obj, *obj2; +struct i915_gem_ww_ctx ww; +int err =0 ; + + obj =i915_gem_object_create_internal (i915,PAGE_SIZE ); +if (IS_ERR (obj)) +return PTR_ERR (obj); + + obj2 =i915_gem_object_create_internal (i915,PAGE_SIZE ); +if (IS_ERR (obj)) { + err =PTR_ERR (obj); + goto put1; + } + +i915_gem_ww_ctx_init (&ww, true); +retry: +/* Lock the objects, twice for good measure (-EALREADY handling) */ + err =i915_gem_object_lock (obj, &ww); +if (!err) + err =i915_gem_object_lock_interruptible (obj, &ww); +if (!err) + err =i915_gem_object_lock_interruptible (obj2, &ww); +if (!err) + err =i915_gem_object_lock (obj2, &ww); + +if (err == -EDEADLK ) { + err =i915_gem_ww_ctx_backoff (&ww); +if (!err) + goto retry; + } +i915_gem_ww_ctx_fini (&ww); +i915_gem_object_put (obj2); +put1: +i915_gem_object_put (obj); +return err; +} +int i915_gem_live_selftests (struct drm_i915_private *i915) {static const struct i915_subtest tests[] = {SUBTEST (igt_gem_suspend),SUBTEST (igt_gem_hibernate), +SUBTEST (igt_gem_ww_ctx), };if (intel_gt_is_wedged (&i915->gt))drivers/gpu/drm/i915/selftests/i915_vma.c +1
-1@@ -892,7 +892,7 @@ static int igt_vma_remapped_gtt(void *arg)unsigned int x, y;int err; -i915_gem_object_lock (obj); +i915_gem_object_lock (obj,NULL ); err =i915_gem_object_set_to_gtt_domain (obj, true);i915_gem_object_unlock (obj);if (err)drivers/gpu/drm/i915/selftests/intel_memory_region.c +1
-2@@ -509,7 +509,7 @@ static int igt_lmem_write_cpu(void *arg)if (err) goto out_unpin; -i915_gem_object_lock (obj); +i915_gem_object_lock (obj,NULL ); err =i915_gem_object_set_to_wc_domain (obj, true);i915_gem_object_unlock (obj);if (err) --2.26.2
Quoted 4 lines
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 3/24 drm/i915: Remove locking from i915_gem_object_prepare_read/write
In reply to Maarten LankhorstExecbuffer submission will perform its own WW locking, and we cannot rely on the implicit lock there.
This also makes it clear that the GVT code will get a lockdep splat when multiple batchbuffer shadows need to be performed in the same instance, fix that up.
--- drivers/gpu/drm/i915/gem/i915_gem_domain.c | 20 ++++++------------- .../gpu/drm/i915/gem/i915_gem_execbuffer.c | 13 ++++++++++-- drivers/gpu/drm/i915/gem/i915_gem_object.h | 1 - .../gpu/drm/i915/gem/selftests/huge_pages.c | 5 ++++- .../i915/gem/selftests/i915_gem_coherency.c | 14 +++++++++---- .../drm/i915/gem/selftests/i915_gem_context.c | 12 ++++++++--- drivers/gpu/drm/i915/gt/intel_renderstate.c | 5 ++++- drivers/gpu/drm/i915/gvt/cmd_parser.c | 9 ++++++++- drivers/gpu/drm/i915/i915_gem.c | 20 +++++++++++++++++-- 9 files changed, 70 insertions(+), 29 deletions(-)
drivers/gpu/drm/i915/gem/i915_gem_domain.c +6 -14
@@ -576,19 +576,17 @@ int i915_gem_object_prepare_read(struct drm_i915_gem_object *obj,if (!i915_gem_object_has_struct_page (obj))return -ENODEV ; - ret =i915_gem_object_lock_interruptible (obj,NULL ); -if (ret) -return ret; +assert_object_held (obj); ret =i915_gem_object_wait (obj,I915_WAIT_INTERRUPTIBLE ,MAX_SCHEDULE_TIMEOUT );if (ret) - goto err_unlock; +return ret; ret =i915_gem_object_pin_pages (obj);if (ret) - goto err_unlock; +return ret;if (obj->cache_coherent &I915_BO_CACHE_COHERENT_FOR_READ || !static_cpu_has (X86_FEATURE_CLFLUSH )) {
@@ -616,8 +614,6 @@ int i915_gem_object_prepare_read(struct drm_i915_gem_object *obj, err_unpin:i915_gem_object_unpin_pages (obj); -err_unlock: -i915_gem_object_unlock (obj);return ret; }
@@ -630,20 +626,18 @@ int i915_gem_object_prepare_write(struct drm_i915_gem_object *obj,if (!i915_gem_object_has_struct_page (obj))return -ENODEV ; - ret =i915_gem_object_lock_interruptible (obj,NULL ); -if (ret) -return ret; +assert_object_held (obj); ret =i915_gem_object_wait (obj,I915_WAIT_INTERRUPTIBLE |I915_WAIT_ALL ,MAX_SCHEDULE_TIMEOUT );if (ret) - goto err_unlock; +return ret; ret =i915_gem_object_pin_pages (obj);if (ret) - goto err_unlock; +return ret;if (obj->cache_coherent &I915_BO_CACHE_COHERENT_FOR_WRITE || !static_cpu_has (X86_FEATURE_CLFLUSH )) {
@@ -680,7 +674,5 @@ int i915_gem_object_prepare_write(struct drm_i915_gem_object *obj, err_unpin:i915_gem_object_unpin_pages (obj); -err_unlock: -i915_gem_object_unlock (obj);return ret; }
drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c +11 -2
@@ -1098,11 +1098,14 @@ static void reloc_cache_reset(struct reloc_cache *cache) vaddr =unmask_page (cache->vaddr);if (cache->vaddr &KMAP ) { +struct drm_i915_gem_object *obj = + (struct drm_i915_gem_object *)cache->node.mm;if (cache->vaddr &CLFLUSH_AFTER )mb ();kunmap_atomic (vaddr); -i915_gem_object_finish_access ((struct drm_i915_gem_object *)cache->node.mm); +i915_gem_object_finish_access (obj); +i915_gem_object_unlock (obj); }else {struct i915_ggtt *ggtt =cache_to_ggtt (cache);
@@ -1137,10 +1140,16 @@ static void *reloc_kmap(struct drm_i915_gem_object *obj,unsigned int flushes;int err; - err =i915_gem_object_prepare_write (obj, &flushes); + err =i915_gem_object_lock_interruptible (obj,NULL );if (err)return ERR_PTR (err); + err =i915_gem_object_prepare_write (obj, &flushes); +if (err) { +i915_gem_object_unlock (obj); +return ERR_PTR (err); + } +BUILD_BUG_ON (KMAP &CLFLUSH_FLAGS );BUILD_BUG_ON ((KMAP |CLFLUSH_FLAGS ) &PAGE_MASK );
drivers/gpu/drm/i915/gem/i915_gem_object.h +0 -1
@@ -434,7 +434,6 @@ static inline void i915_gem_object_finish_access(struct drm_i915_gem_object *obj) {i915_gem_object_unpin_pages (obj); -i915_gem_object_unlock (obj); } static inline struct intel_engine_cs *
drivers/gpu/drm/i915/gem/selftests/huge_pages.c +4 -1
@@ -964,9 +964,10 @@ __cpu_check_shmem(struct drm_i915_gem_object *obj, u32 dword, u32 val)unsigned long n;int err; +i915_gem_object_lock (obj,NULL ); err =i915_gem_object_prepare_read (obj, &needs_flush);if (err) -return err; + goto err_unlock;for (n =0 ; n < obj->base.size >>PAGE_SHIFT ; ++n) {u32 *ptr =kmap_atomic (i915_gem_object_get_page (obj, n));
@@ -986,6 +987,8 @@ __cpu_check_shmem(struct drm_i915_gem_object *obj, u32 dword, u32 val) }i915_gem_object_finish_access (obj); +err_unlock: +i915_gem_object_unlock (obj);return err; }
drivers/gpu/drm/i915/gem/selftests/i915_gem_coherency.c +10 -4
@@ -27,9 +27,10 @@ static int cpu_set(struct context *ctx, unsigned long offset, u32 v)u32 *cpu;int err; +i915_gem_object_lock (ctx->obj,NULL ); err =i915_gem_object_prepare_write (ctx->obj, &needs_clflush);if (err) -return err; + goto out; page =i915_gem_object_get_page (ctx->obj, offset >>PAGE_SHIFT ); map =kmap_atomic (page);
@@ -46,7 +47,9 @@ static int cpu_set(struct context *ctx, unsigned long offset, u32 v)kunmap_atomic (map);i915_gem_object_finish_access (ctx->obj); -return 0 ; +out: +i915_gem_object_unlock (ctx->obj); +return err; }static int cpu_get (struct context *ctx,unsigned long offset,u32 *v)
@@ -57,9 +60,10 @@ static int cpu_get(struct context *ctx, unsigned long offset, u32 *v)u32 *cpu;int err; +i915_gem_object_lock (ctx->obj,NULL ); err =i915_gem_object_prepare_read (ctx->obj, &needs_clflush);if (err) -return err; + goto out; page =i915_gem_object_get_page (ctx->obj, offset >>PAGE_SHIFT ); map =kmap_atomic (page);
@@ -73,7 +77,9 @@ static int cpu_get(struct context *ctx, unsigned long offset, u32 *v)kunmap_atomic (map);i915_gem_object_finish_access (ctx->obj); -return 0 ; +out: +i915_gem_object_unlock (ctx->obj); +return err; }static int gtt_set (struct context *ctx,unsigned long offset,u32 v)
drivers/gpu/drm/i915/gem/selftests/i915_gem_context.c +9 -3
@@ -461,9 +461,10 @@ static int cpu_fill(struct drm_i915_gem_object *obj, u32 value)unsigned int n, m, need_flush;int err; +i915_gem_object_lock (obj,NULL ); err =i915_gem_object_prepare_write (obj, &need_flush);if (err) -return err; + goto out;for (n =0 ; n <real_page_count (obj); n++) {u32 *map;
@@ -479,7 +480,9 @@ static int cpu_fill(struct drm_i915_gem_object *obj, u32 value)i915_gem_object_finish_access (obj); obj->read_domains =I915_GEM_DOMAIN_GTT |I915_GEM_DOMAIN_CPU ; obj->write_domain =0 ; -return 0 ; +out: +i915_gem_object_unlock (obj); +return err; } static noinline int cpu_check(struct drm_i915_gem_object *obj,
@@ -488,9 +491,10 @@ static noinline int cpu_check(struct drm_i915_gem_object *obj,unsigned int n, m, needs_flush;int err; +i915_gem_object_lock (obj,NULL ); err =i915_gem_object_prepare_read (obj, &needs_flush);if (err) -return err; + goto out_unlock;for (n =0 ; n <real_page_count (obj); n++) {u32 *map;
@@ -527,6 +531,8 @@ static noinline int cpu_check(struct drm_i915_gem_object *obj, }i915_gem_object_finish_access (obj); +out_unlock: +i915_gem_object_unlock (obj);return err; }
drivers/gpu/drm/i915/gt/intel_renderstate.c +4 -1
@@ -74,9 +74,10 @@ static int render_state_setup(struct intel_renderstate *so,u32 *d;int ret; +i915_gem_object_lock (so->vma->obj,NULL ); ret =i915_gem_object_prepare_write (so->vma->obj, &needs_clflush);if (ret) -return ret; + goto out_unlock; d =kmap_atomic (i915_gem_object_get_dirty_page (so->vma->obj,0 ));
@@ -157,6 +158,8 @@ static int render_state_setup(struct intel_renderstate *so, ret =0 ; out:i915_gem_object_finish_access (so->vma->obj); +out_unlock: +i915_gem_object_unlock (so->vma->obj);return ret; err:
drivers/gpu/drm/i915/gvt/cmd_parser.c +8 -1
@@ -1904,10 +1904,14 @@ static int perform_bb_shadow(struct parser_exec_state *s) goto err_free_bb; } - ret =i915_gem_object_prepare_write (bb->obj, &bb->clflush); + ret =i915_gem_object_lock_interruptible (bb->obj,NULL );if (ret) goto err_free_obj; + ret =i915_gem_object_prepare_write (bb->obj, &bb->clflush); +if (ret) + goto err_unlock; + bb->va =i915_gem_object_pin_map (bb->obj,I915_MAP_WB );if (IS_ERR (bb->va)) { ret =PTR_ERR (bb->va);
@@ -1932,6 +1936,7 @@ static int perform_bb_shadow(struct parser_exec_state *s)if (ret) goto err_unmap; +i915_gem_object_unlock (bb->obj);INIT_LIST_HEAD (&bb->list);list_add (&bb->list, &s->workload->shadow_bb);
@@ -1958,6 +1963,8 @@ static int perform_bb_shadow(struct parser_exec_state *s)i915_gem_object_unpin_map (bb->obj); err_finish_shmem_access:i915_gem_object_finish_access (bb->obj); +err_unlock: +i915_gem_object_unlock (bb->obj); err_free_obj:i915_gem_object_put (bb->obj); err_free_bb:
drivers/gpu/drm/i915/i915_gem.c +18 -2
@@ -335,12 +335,20 @@ i915_gem_shmem_pread(struct drm_i915_gem_object *obj,u64 remain;int ret; - ret =i915_gem_object_prepare_read (obj, &needs_clflush); + ret =i915_gem_object_lock_interruptible (obj,NULL );if (ret)return ret; + ret =i915_gem_object_prepare_read (obj, &needs_clflush); +if (ret) { +i915_gem_object_unlock (obj); +return ret; + } + fence =i915_gem_object_lock_fence (obj);i915_gem_object_finish_access (obj); +i915_gem_object_unlock (obj); +if (!fence)return -ENOMEM ;
@@ -734,12 +742,20 @@ i915_gem_shmem_pwrite(struct drm_i915_gem_object *obj,u64 remain;int ret; - ret =i915_gem_object_prepare_write (obj, &needs_clflush); + ret =i915_gem_object_lock_interruptible (obj,NULL );if (ret)return ret; + ret =i915_gem_object_prepare_write (obj, &needs_clflush); +if (ret) { +i915_gem_object_unlock (obj); +return ret; + } + fence =i915_gem_object_lock_fence (obj);i915_gem_object_finish_access (obj); +i915_gem_object_unlock (obj); +if (!fence)return -ENOMEM ;
Signature · 6 lines
2.26.2 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 4/24 drm/i915: Parse command buffer earlier in eb_relocate(slow)
In reply to Maarten LankhorstWe want to introduce backoff logic, but we need to lock the pool object as well for command parsing. Because of this, we will need backoff logic for the engine pool obj, move the batch validation up slightly to eb_lookup_vmas, and the actual command parsing in a separate function which can get called from execbuf relocation fast and slowpath.
--- .../gpu/drm/i915/gem/i915_gem_execbuffer.c | 68 ++++++++++--------- 1 file changed, 37 insertions(+), 31 deletions(-)
drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c +37 -31
@@ -292,6 +292,8 @@ struct i915_execbuffer {struct eb_vma_array *array; }; +static int eb_parse (struct i915_execbuffer *eb); +static inline bool eb_use_cmdparser (const struct i915_execbuffer *eb) { return intel_engine_requires_cmd_parser(eb->engine) ||
@@ -875,6 +877,7 @@ static struct i915_vma *eb_lookup_vma(struct i915_execbuffer *eb, u32 handle)static int eb_lookup_vmas (struct i915_execbuffer *eb) { +struct drm_i915_private *i915 = eb->i915;unsigned int batch =eb_batch_index (eb);unsigned int i;int err =0 ;
@@ -888,18 +891,37 @@ static int eb_lookup_vmas(struct i915_execbuffer *eb) vma =eb_lookup_vma (eb, eb->exec[i].handle);if (IS_ERR (vma)) { err =PTR_ERR (vma); -break ; + goto err; } err =eb_validate_vma (eb, &eb->exec[i], vma);if (unlikely (err)) {i915_vma_put (vma); -break ; + goto err; }eb_add_vma (eb, i, batch, vma); } +if (unlikely (eb->batch->flags &EXEC_OBJECT_WRITE )) { +drm_dbg (&i915->drm, +"Attempting to use self-modifying batch buffer\n" ); +return -EINVAL ; + } + +if (range_overflows_t (u64, + eb->batch_start_offset, eb->batch_len, + eb->batch->vma->size)) { +drm_dbg (&i915->drm,"Attempting to use out-of-bounds batch\n" ); +return -EINVAL ; + } + +if (eb->batch_len ==0 ) + eb->batch_len = eb->batch->vma->size - eb->batch_start_offset; + +return 0 ; + +err: eb->vma[i].vma =NULL ;return err; }
@@ -1911,7 +1933,7 @@ static int eb_prefault_relocations(const struct i915_execbuffer *eb)return 0 ; } -static noinline int eb_relocate_slow(struct i915_execbuffer *eb) +static noinline int eb_relocate_parse_slow(struct i915_execbuffer *eb) {bool have_copy = false;struct eb_vma *ev;
@@ -1972,6 +1994,11 @@ static noinline int eb_relocate_slow(struct i915_execbuffer *eb)if (err) goto err; +/* as last step, parse the command buffer */ + err =eb_parse (eb); +if (err) + goto err; +/* * Leave the user relocations as are, this is the painfully slow path, * and we want to avoid the complication of dropping the lock whilst
@@ -2004,7 +2031,7 @@ static noinline int eb_relocate_slow(struct i915_execbuffer *eb)return err; } -static int eb_relocate (struct i915_execbuffer *eb) +static int eb_relocate_parse (struct i915_execbuffer *eb) {int err;
@@ -2033,10 +2060,10 @@ static int eb_relocate(struct i915_execbuffer *eb)if (!err) err = flush;else -return eb_relocate_slow (eb); +return eb_relocate_parse_slow (eb); } -return err; +return eb_parse (eb); }static int eb_move_to_gpu (struct i915_execbuffer *eb)
@@ -2934,7 +2961,7 @@ i915_gem_do_execbuffer(struct drm_device *dev,if (unlikely (err)) goto err_context; - err =eb_relocate (&eb); + err =eb_relocate_parse (&eb);if (err) {/* * If the user expects the execobject.offset and
@@ -2947,33 +2974,10 @@ i915_gem_do_execbuffer(struct drm_device *dev, goto err_vma; } -if (unlikely (eb.batch->flags &EXEC_OBJECT_WRITE )) { -drm_dbg (&i915->drm, -"Attempting to use self-modifying batch buffer\n" ); - err = -EINVAL ; - goto err_vma; - } - -if (range_overflows_t (u64, - eb.batch_start_offset, eb.batch_len, - eb.batch->vma->size)) { -drm_dbg (&i915->drm,"Attempting to use out-of-bounds batch\n" ); - err = -EINVAL ; - goto err_vma; - } - -if (eb.batch_len ==0 ) - eb.batch_len = eb.batch->vma->size - eb.batch_start_offset; - - err =eb_parse (&eb); -if (err) - goto err_vma; -/* * snb/ivb/vlv conflate the "batch in ppgtt" bit with the "non-secure * batch" bit. Hence we need to pin secure batches into the global gtt. * hsw should have this fixed, but bdw mucks it up again. */ - batch = eb.batch->vma;if (eb.batch_flags &I915_DISPATCH_SECURE ) {struct i915_vma *vma;
@@ -2987,13 +2991,15 @@ i915_gem_do_execbuffer(struct drm_device *dev,* fitting due to fragmentation. * So this is actually safe. */ - vma =i915_gem_object_ggtt_pin (batch->obj,NULL ,0 ,0 ,0 ); + vma =i915_gem_object_ggtt_pin (eb.batch->vma->obj,NULL ,0 ,0 ,0 );if (IS_ERR (vma)) { err =PTR_ERR (vma); goto err_parse; } batch = vma; + }else { + batch = eb.batch->vma; }/* All GPU relocation batches must be submitted prior to the user rq */
Signature · 6 lines
2.26.2 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 5/24 Revert "drm/i915/gem: Split eb_vma into its own allocation"
In reply to Maarten LankhorstThis reverts commit 0f1dd02295f35dcdcbaafcbcbbec0753884ab974. This conflicts with the ww mutex handling, which needs to drop the references after gpu submission anyway, because otherwise we may risk unlocking a BO after first freeing it.
--- .../gpu/drm/i915/gem/i915_gem_execbuffer.c | 124 +++++++----------- 1 file changed, 51 insertions(+), 73 deletions(-)
drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c +51 -73
@@ -40,11 +40,6 @@ struct eb_vma {u32 handle; }; -struct eb_vma_array { -struct kref kref; -struct eb_vma vma[]; -}; -enum {FORCE_CPU_RELOC =1 ,FORCE_GTT_RELOC ,
@@ -57,6 +52,7 @@ enum {#define __EXEC_OBJECT_NEEDS_MAP BIT(29)#define __EXEC_OBJECT_NEEDS_BIAS BIT(28)#define __EXEC_OBJECT_INTERNAL_FLAGS (~0u << 28)/* all of the above */ +#define __EXEC_OBJECT_RESERVED (__EXEC_OBJECT_HAS_PIN | __EXEC_OBJECT_HAS_FENCE)#define __EXEC_HAS_RELOC BIT(31)#define __EXEC_INTERNAL_FLAGS (~0u << 31)
@@ -289,7 +285,6 @@ struct i915_execbuffer {*/ int lut_size;struct hlist_head *buckets;/** ht for relocation handles */ -struct eb_vma_array *array; };static int eb_parse (struct i915_execbuffer *eb);
@@ -301,62 +296,8 @@ static inline bool eb_use_cmdparser(const struct i915_execbuffer *eb) eb->args->batch_len); } -static struct eb_vma_array *eb_vma_array_create (unsigned int count) -{ -struct eb_vma_array *arr; - - arr =kvmalloc (struct_size (arr, vma, count),GFP_KERNEL | __GFP_NOWARN); -if (!arr) -return NULL ; - -kref_init (&arr->kref); - arr->vma[0 ].vma =NULL ; - -return arr; -} - -static inline void eb_unreserve_vma (struct eb_vma *ev) -{ -struct i915_vma *vma = ev->vma; - -if (unlikely (ev->flags & __EXEC_OBJECT_HAS_FENCE)) -__i915_vma_unpin_fence (vma); - -if (ev->flags & __EXEC_OBJECT_HAS_PIN) -__i915_vma_unpin (vma); - - ev->flags &= ~(__EXEC_OBJECT_HAS_PIN | - __EXEC_OBJECT_HAS_FENCE); -} - -static void eb_vma_array_destroy (struct kref *kref) -{ -struct eb_vma_array *arr =container_of (kref,typeof (*arr), kref); -struct eb_vma *ev = arr->vma; - -while (ev->vma) { -eb_unreserve_vma (ev); -i915_vma_put (ev->vma); - ev++; - } - -kvfree (arr); -} - -static void eb_vma_array_put (struct eb_vma_array *arr) -{ -kref_put (&arr->kref, eb_vma_array_destroy); -} -static int eb_create (struct i915_execbuffer *eb) { -/* Allocate an extra slot for use by the command parser + sentinel */ - eb->array =eb_vma_array_create (eb->buffer_count +2 ); -if (!eb->array) -return -ENOMEM ; - - eb->vma = eb->array->vma; -if (!(eb->args->flags &I915_EXEC_HANDLE_LUT )) {unsigned int size =1 +ilog2 (eb->buffer_count);
@@ -390,10 +331,8 @@ static int eb_create(struct i915_execbuffer *eb)break ; }while (--size); -if (unlikely (!size)) { -eb_vma_array_put (eb->array); +if (unlikely (!size))return -ENOMEM ; - } eb->lut_size = size; }else {
@@ -504,6 +443,26 @@ eb_pin_vma(struct i915_execbuffer *eb,return !eb_vma_misplaced (entry, vma, ev->flags); } +static inline void __eb_unreserve_vma (struct i915_vma *vma,unsigned int flags) +{ +GEM_BUG_ON (!(flags & __EXEC_OBJECT_HAS_PIN)); + +if (unlikely (flags & __EXEC_OBJECT_HAS_FENCE)) +__i915_vma_unpin_fence (vma); + +__i915_vma_unpin (vma); +} + +static inline void +eb_unreserve_vma (struct eb_vma *ev) +{ +if (!(ev->flags & __EXEC_OBJECT_HAS_PIN)) +return ; + +__eb_unreserve_vma (ev->vma, ev->flags); + ev->flags &= ~__EXEC_OBJECT_RESERVED; +} + static int eb_validate_vma(struct i915_execbuffer *eb, struct drm_i915_gem_exec_object2 *entry,
@@ -946,13 +905,31 @@ eb_get_vma(const struct i915_execbuffer *eb, unsigned long handle) } } +static void eb_release_vmas (const struct i915_execbuffer *eb) +{ +const unsigned int count = eb->buffer_count; +unsigned int i; + +for (i =0 ; i < count; i++) { +struct eb_vma *ev = &eb->vma[i]; +struct i915_vma *vma = ev->vma; + +if (!vma) +break ; + + eb->vma[i].vma =NULL ; + +if (ev->flags & __EXEC_OBJECT_HAS_PIN) +__eb_unreserve_vma (vma, ev->flags); + +i915_vma_put (vma); + } +} +static void eb_destroy (const struct i915_execbuffer *eb) {GEM_BUG_ON (eb->reloc_cache.rq); -if (eb->array) -eb_vma_array_put (eb->array); -if (eb->lut_size >0 )kfree (eb->buckets); }
@@ -2143,12 +2120,9 @@ static int eb_move_to_gpu(struct i915_execbuffer *eb) err =i915_vma_move_to_active (vma, eb->request, flags);i915_vma_unlock (vma); -eb_unreserve_vma (ev); }ww_acquire_fini (&acquire); -eb_vma_array_put (fetch_and_zero (&eb->array)); -if (unlikely (err)) goto err_skip;
@@ -2403,7 +2377,6 @@ static int eb_parse(struct i915_execbuffer *eb) eb->vma[eb->buffer_count].vma =i915_vma_get (shadow); eb->vma[eb->buffer_count].flags = __EXEC_OBJECT_HAS_PIN; eb->batch = &eb->vma[eb->buffer_count++]; - eb->vma[eb->buffer_count].vma =NULL ; eb->trampoline = trampoline; eb->batch_start_offset =0 ;
@@ -2902,6 +2875,8 @@ i915_gem_do_execbuffer(struct drm_device *dev, args->flags |= __EXEC_HAS_RELOC; eb.exec = exec; + eb.vma = (struct eb_vma *)(exec + args->buffer_count +1 ); + eb.vma[0 ].vma =NULL ; eb.invalid_flags = __EXEC_OBJECT_UNKNOWN_FLAGS;reloc_cache_init (&eb.reloc_cache, eb.i915);
@@ -3078,6 +3053,8 @@ i915_gem_do_execbuffer(struct drm_device *dev,if (batch->private)intel_gt_buffer_pool_put (batch->private); err_vma: +if (eb.exec) +eb_release_vmas (&eb);if (eb.trampoline)i915_vma_unpin (eb.trampoline);eb_unpin_engine (&eb);
@@ -3095,7 +3072,7 @@ i915_gem_do_execbuffer(struct drm_device *dev,static size_t eb_element_size (void ) { -return sizeof (struct drm_i915_gem_exec_object2 ); +return sizeof (struct drm_i915_gem_exec_object2 ) +sizeof (struct eb_vma ); }static bool check_buffer_count (size_t count)
@@ -3151,7 +3128,7 @@ i915_gem_execbuffer_ioctl(struct drm_device *dev, void *data,/* Copy in the exec list from userland */ exec_list =kvmalloc_array (count,sizeof (*exec_list), __GFP_NOWARN |GFP_KERNEL ); - exec2_list =kvmalloc_array (count,eb_element_size (), + exec2_list =kvmalloc_array (count +1 ,eb_element_size (), __GFP_NOWARN |GFP_KERNEL );if (exec_list ==NULL || exec2_list ==NULL ) { drm_dbg(&i915->drm,
@@ -3229,7 +3206,8 @@ i915_gem_execbuffer2_ioctl(struct drm_device *dev, void *data,if (err)return err; - exec2_list =kvmalloc_array (count,eb_element_size (), +/* Allocate an extra slot for use by the command parser */ + exec2_list =kvmalloc_array (count +1 ,eb_element_size (), __GFP_NOWARN |GFP_KERNEL );if (exec2_list ==NULL ) { drm_dbg(&i915->drm, "Failed to allocate exec list for %zd buffers\n",
Signature · 6 lines
2.26.2 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 6/24 drm/i915/gem: Make eb_add_lut interruptible wait on object lock.
In reply to Maarten LankhorstThe lock here should be interruptible, so we can backoff if needed.
--- drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c +7 -1
@@ -776,7 +776,12 @@ static int __eb_add_lut(struct i915_execbuffer *eb,if (err ==0 ) {/* And nor has this handle */ struct drm_i915_gem_object *obj = vma->obj; -i915_gem_object_lock (obj,NULL ); + err =i915_gem_object_lock_interruptible (obj,NULL ); +if (err) { +radix_tree_delete (&ctx->handles_vma, handle); + goto unlock; + } +if (idr_find (&eb->file->object_idr, handle) == obj) {list_add (&lut->obj_link, &obj->lut_list); }else {
@@ -785,6 +790,7 @@ static int __eb_add_lut(struct i915_execbuffer *eb, }i915_gem_object_unlock (obj); } +unlock:mutex_unlock (&ctx->mutex); }if (unlikely (err))
Signature · 6 lines
2.26.2 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 7/24 drm/i915: Use per object locking in execbuf, v11.
In reply to Maarten LankhorstNow that we changed execbuf submission slightly to allow us to do all pinning in one place, we can now simply add ww versions on top of struct_mutex. All we have to do is a separate path for -EDEADLK handling, which needs to unpin all gem bo's before dropping the lock, then starting over.
This finally allows us to do parallel submission, but because not all of the pinning code uses the ww ctx yet, we cannot completely drop struct_mutex yet.
Changes since v1:
- Keep struct_mutex for now. :(
Changes since v2:
- Make sure we always lock the ww context in slowpath. Changes since v3:
- Don't call __eb_unreserve_vma in eb_move_to_gpu now; this can be done on normal unlock path.
- Unconditionally release vmas and context.
Changes since v4:
- Rebased on top of struct_mutex reduction.
Changes since v5:
- Remove training wheels.
Changes since v6:
- Fix accidentally broken -ENOSPC handling.
Changes since v7:
- Handle gt buffer pool better.
Changes since v8:
- Properly clear variables, to make -EDEADLK handling not BUG. Change since v9:
- Fix unpinning fence on pnv and below.
Changes since v10:
- Make relocation gpu chaining working again.
--- .../gpu/drm/i915/gem/i915_gem_execbuffer.c | 396 +++++++++++------- .../i915/gem/selftests/i915_gem_execbuffer.c | 2 +- drivers/gpu/drm/i915/i915_gem.c | 6 + drivers/gpu/drm/i915/i915_gem.h | 1 + 4 files changed, 249 insertions(+), 156 deletions(-)
drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c +241 -155
@@ -249,6 +249,8 @@ struct i915_execbuffer {/** list of vma that have execobj.relocation_count */ struct list_head relocs; +struct i915_gem_ww_ctx ww; +/** * Track the most recently used object for relocations, as we * frequently have to perform multiple relocations within the same
@@ -269,14 +271,18 @@ struct i915_execbuffer {struct i915_vma *rq_vma;u32 *rq_cmd;unsigned int rq_size; +struct intel_gt_buffer_pool_node *pool; } reloc_cache; +struct intel_gt_buffer_pool_node *reloc_pool;/** relocation pool for -EDEADLK handling */ +u64 invalid_flags;/** Set of execobj.flags that are invalid */ u32 context_flags;/** Set of execobj.flags to insert from the ctx */ u32 batch_start_offset;/** Location within object of batch */ u32 batch_len;/** Length of batch within object */ u32 batch_flags;/** Flags composed for emit_bb_start() */ +struct intel_gt_buffer_pool_node *batch_pool;/** pool node for batch buffer */ /** * Indicate either the size of the hastable used to resolve
@@ -443,23 +449,16 @@ eb_pin_vma(struct i915_execbuffer *eb,return !eb_vma_misplaced (entry, vma, ev->flags); } -static inline void __eb_unreserve_vma (struct i915_vma *vma,unsigned int flags) -{ -GEM_BUG_ON (!(flags & __EXEC_OBJECT_HAS_PIN)); - -if (unlikely (flags & __EXEC_OBJECT_HAS_FENCE)) -__i915_vma_unpin_fence (vma); - -__i915_vma_unpin (vma); -} -static inline void eb_unreserve_vma (struct eb_vma *ev) {if (!(ev->flags & __EXEC_OBJECT_HAS_PIN))return ; -__eb_unreserve_vma (ev->vma, ev->flags); +if (unlikely (ev->flags & __EXEC_OBJECT_HAS_FENCE)) +__i915_vma_unpin_fence (ev->vma); + +__i915_vma_unpin (ev->vma); ev->flags &= ~__EXEC_OBJECT_RESERVED; }
@@ -554,16 +553,6 @@ eb_add_vma(struct i915_execbuffer *eb, eb->batch = ev; } - -if (eb_pin_vma (eb, entry, ev)) { -if (entry->offset != vma->node.start) { - entry->offset = vma->node.start |UPDATE ; - eb->args->flags |= __EXEC_HAS_RELOC; - } - }else { -eb_unreserve_vma (ev); -list_add_tail (&ev->bind_link, &eb->unbound); - } } static inline int use_cpu_reloc(const struct reloc_cache *cache,
@@ -648,10 +637,6 @@ static int eb_reserve(struct i915_execbuffer *eb)* This avoid unnecessary unbinding of later objects in order to make * room for the earlier objects *unless* we need to defragment. */ - -if (mutex_lock_interruptible (&eb->i915->drm.struct_mutex)) -return -EINTR ; - pass =0 ; do { list_for_each_entry(ev, &eb->unbound, bind_link) {
@@ -659,8 +644,8 @@ static int eb_reserve(struct i915_execbuffer *eb)if (err)break ; } -if (!(err == -ENOSPC || err == -EAGAIN )) -break ; +if (err != -ENOSPC ) +return err;/* Resort *all* the objects into priority order */ INIT_LIST_HEAD (&eb->unbound);
@@ -690,13 +675,6 @@ static int eb_reserve(struct i915_execbuffer *eb) }list_splice_tail (&last, &eb->unbound); -if (err == -EAGAIN ) { -mutex_unlock (&eb->i915->drm.struct_mutex); -flush_workqueue (eb->i915->mm.userptr_wq); -mutex_lock (&eb->i915->drm.struct_mutex); -continue ; - } -switch (pass++) {case 0 :break ;
@@ -707,20 +685,15 @@ static int eb_reserve(struct i915_execbuffer *eb) err =i915_gem_evict_vm (eb->context->vm);mutex_unlock (&eb->context->vm->mutex);if (err) - goto unlock; +return err;break ;default : - err = -ENOSPC ; - goto unlock; +return -ENOSPC ; } pin_flags =PIN_USER ; }while (1 ); - -unlock: -mutex_unlock (&eb->i915->drm.struct_mutex); -return err; }static unsigned int eb_batch_index (const struct i915_execbuffer *eb)
@@ -848,7 +821,6 @@ static int eb_lookup_vmas(struct i915_execbuffer *eb)int err =0 ;INIT_LIST_HEAD (&eb->relocs); -INIT_LIST_HEAD (&eb->unbound);for (i =0 ; i < eb->buffer_count; i++) {struct i915_vma *vma;
@@ -891,6 +863,48 @@ static int eb_lookup_vmas(struct i915_execbuffer *eb)return err; } +static int eb_validate_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; + +if (eb_pin_vma (eb, entry, ev)) { +if (entry->offset != vma->node.start) { + entry->offset = vma->node.start |UPDATE ; + eb->args->flags |= __EXEC_HAS_RELOC; + } + }else { +eb_unreserve_vma (ev); + +list_add_tail (&ev->bind_link, &eb->unbound); +if (drm_mm_node_allocated (&vma->node)) { + err =i915_vma_unbind (vma); +if (err) +return err; + } + } + +GEM_BUG_ON (drm_mm_node_allocated (&vma->node) && +eb_vma_misplaced (&eb->exec[i], vma, ev->flags)); + } + +if (!list_empty (&eb->unbound)) +return eb_reserve (eb); + +return 0 ; +} +static struct eb_vma *eb_get_vma (const struct i915_execbuffer *eb,unsigned long handle) {
@@ -911,7 +925,7 @@ eb_get_vma(const struct i915_execbuffer *eb, unsigned long handle) } } -static void eb_release_vmas (const struct i915_execbuffer *eb) +static void eb_release_vmas (const struct i915_execbuffer *eb,bool final) {const unsigned int count = eb->buffer_count;unsigned int i;
@@ -923,12 +937,10 @@ static void eb_release_vmas(const struct i915_execbuffer *eb)if (!vma)break ; - eb->vma[i].vma =NULL ; - -if (ev->flags & __EXEC_OBJECT_HAS_PIN) -__eb_unreserve_vma (vma, ev->flags); +eb_unreserve_vma (ev); -i915_vma_put (vma); +if (final) +i915_vma_put (vma); } }
@@ -947,6 +959,15 @@ relocation_target(const struct drm_i915_gem_relocation_entry *reloc,return gen8_canonical_addr ((int )reloc->delta + target->node.start); } +static void reloc_cache_clear (struct reloc_cache *cache) +{ + cache->rq =NULL ; + cache->rq_cmd =NULL ; + cache->pool =NULL ; + cache->rq_size =0 ; + cache->target =NULL ; +} +static void reloc_cache_init (struct reloc_cache *cache,struct drm_i915_private *i915) {
@@ -959,8 +980,7 @@ static void reloc_cache_init(struct reloc_cache *cache, cache->has_fence = cache->gen <4 ; cache->needs_unfenced =INTEL_INFO (i915)->unfenced_needs_alignment; cache->node.flags =0 ; - cache->rq =NULL ; - cache->target =NULL ; +reloc_cache_clear (cache); }static inline void *unmask_page (unsigned long p)
@@ -984,17 +1004,41 @@ static inline struct i915_ggtt *cache_to_ggtt(struct reloc_cache *cache)#define RELOC_TAIL 4 -static int reloc_gpu_chain (struct reloc_cache *cache) +static void reloc_cache_put_pool (struct i915_execbuffer *eb,struct reloc_cache *cache) { -struct intel_gt_buffer_pool_node *pool; +if (!cache->pool) +return ; + +/* +* This is a bit nasty, normally we keep objects locked until the end +* of execbuffer, but we already submit this, and have to unlock before +* dropping the reference. Fortunately we can only hold 1 pool node at +* a time, so this should be harmless. +*/ +i915_gem_ww_unlock_single (cache->pool->obj); +intel_gt_buffer_pool_put (cache->pool); + cache->pool =NULL ; +} + +static int reloc_gpu_chain (struct i915_execbuffer *eb,struct reloc_cache *cache) +{ +struct intel_gt_buffer_pool_node *pool = eb->reloc_pool;struct i915_request *rq = cache->rq;struct i915_vma *batch;u32 *cmd;int err; - pool =intel_gt_get_buffer_pool (rq->engine->gt,PAGE_SIZE ); -if (IS_ERR (pool)) -return PTR_ERR (pool); +if (!pool || pool == cache->pool) { + pool =intel_gt_get_buffer_pool (rq->engine->gt,PAGE_SIZE ); + +if (IS_ERR (pool)) +return PTR_ERR (pool); + } + eb->reloc_pool = pool; + + err =i915_gem_object_lock_interruptible (pool->obj, &eb->ww); +if (err) + goto out_pool; batch =i915_vma_instance (pool->obj, rq->context->vm,NULL );if (IS_ERR (batch)) {
@@ -1023,11 +1067,9 @@ static int reloc_gpu_chain(struct reloc_cache *cache) err =intel_gt_buffer_pool_mark_active (pool, rq);if (err ==0 ) { -i915_vma_lock (batch); err =i915_request_await_object (rq, batch->obj, false);if (err ==0 ) err =i915_vma_move_to_active (batch, rq,0 ); -i915_vma_unlock (batch); }i915_vma_unpin (batch);if (err)
@@ -1048,7 +1090,11 @@ static int reloc_gpu_chain(struct reloc_cache *cache) cache->rq_vma = batch; out_pool: -intel_gt_buffer_pool_put (pool); +/* Remove the old pool from chain */ +reloc_cache_put_pool (eb, cache); + +if (!err) + cache->pool = pool;return err; }
@@ -1057,7 +1103,7 @@ static unsigned int reloc_bb_flags(const struct reloc_cache *cache)return cache->gen >5 ?0 :I915_DISPATCH_SECURE ; } -static int reloc_gpu_flush (struct reloc_cache *cache) +static int reloc_gpu_flush (struct i915_execbuffer *eb,struct reloc_cache *cache) {struct i915_request *rq;int err;
@@ -1091,7 +1137,12 @@ static int reloc_gpu_flush(struct reloc_cache *cache)intel_gt_chipset_flush (rq->engine->gt);i915_request_add (rq); +reloc_cache_put_pool (eb, cache); +reloc_cache_clear (cache); + + eb->reloc_pool =NULL ;return err; + }static void reloc_cache_reset (struct reloc_cache *cache)
@@ -1110,7 +1161,6 @@ static void reloc_cache_reset(struct reloc_cache *cache)kunmap_atomic (vaddr);i915_gem_object_finish_access (obj); -i915_gem_object_unlock (obj); }else {struct i915_ggtt *ggtt =cache_to_ggtt (cache);
@@ -1145,15 +1195,9 @@ static void *reloc_kmap(struct drm_i915_gem_object *obj,unsigned int flushes;int err; - err =i915_gem_object_lock_interruptible (obj,NULL ); -if (err) -return ERR_PTR (err); - err =i915_gem_object_prepare_write (obj, &flushes); -if (err) { -i915_gem_object_unlock (obj); +if (err)return ERR_PTR (err); - }BUILD_BUG_ON (KMAP &CLFLUSH_FLAGS );BUILD_BUG_ON ((KMAP |CLFLUSH_FLAGS ) &PAGE_MASK );
@@ -1192,9 +1236,7 @@ static void *reloc_iomap(struct drm_i915_gem_object *obj,if (use_cpu_reloc (cache, obj))return NULL ; -i915_gem_object_lock (obj,NULL ); err =i915_gem_object_set_to_gtt_domain (obj, true); -i915_gem_object_unlock (obj);if (err)return ERR_PTR (err);
@@ -1283,7 +1325,7 @@ static int reloc_move_to_gpu(struct i915_request *rq, struct i915_vma *vma)struct drm_i915_gem_object *obj = vma->obj;int err; -i915_vma_lock (vma); +assert_vma_held (vma);if (obj->cache_dirty & ~obj->cache_coherent)i915_gem_clflush_object (obj,0 );
@@ -1293,8 +1335,6 @@ static int reloc_move_to_gpu(struct i915_request *rq, struct i915_vma *vma)if (err ==0 ) err =i915_vma_move_to_active (vma, rq,EXEC_OBJECT_WRITE ); -i915_vma_unlock (vma); -return err; }
@@ -1303,15 +1343,22 @@ static int __reloc_gpu_alloc(struct i915_execbuffer *eb, unsigned int len) {struct reloc_cache *cache = &eb->reloc_cache; -struct intel_gt_buffer_pool_node *pool; +struct intel_gt_buffer_pool_node *pool = eb->reloc_pool;struct i915_request *rq;struct i915_vma *batch;u32 *cmd;int err; - pool =intel_gt_get_buffer_pool (engine->gt,PAGE_SIZE ); -if (IS_ERR (pool)) -return PTR_ERR (pool); +if (!pool) { + pool =intel_gt_get_buffer_pool (engine->gt,PAGE_SIZE ); +if (IS_ERR (pool)) +return PTR_ERR (pool); + } + eb->reloc_pool =NULL ; + + err =i915_gem_object_lock (pool->obj, &eb->ww); +if (err) + goto err_pool; cmd = i915_gem_object_pin_map(pool->obj, cache->has_llc ?
@@ -1319,7 +1366,7 @@ static int __reloc_gpu_alloc(struct i915_execbuffer *eb, I915_MAP_FORCE_WC);if (IS_ERR (cmd)) { err =PTR_ERR (cmd); - goto out_pool; + goto err_pool; } batch =i915_vma_instance (pool->obj, eb->context->vm,NULL );
@@ -1358,11 +1405,11 @@ static int __reloc_gpu_alloc(struct i915_execbuffer *eb,if (err) goto err_request; -i915_vma_lock (batch); + +assert_vma_held (batch); err =i915_request_await_object (rq, batch->obj, false);if (err ==0 ) err =i915_vma_move_to_active (batch, rq,0 ); -i915_vma_unlock (batch);if (err) goto skip_request;
@@ -1373,9 +1420,10 @@ static int __reloc_gpu_alloc(struct i915_execbuffer *eb, cache->rq_cmd = cmd; cache->rq_size =0 ; cache->rq_vma = batch; + cache->pool = pool;/* Return with batch mapping (cmd) still pinned */ - goto out_pool; +return 0 ; skip_request:i915_request_set_error_once (rq, err);
@@ -1385,8 +1433,8 @@ static int __reloc_gpu_alloc(struct i915_execbuffer *eb,i915_vma_unpin (batch); err_unmap:i915_gem_object_unpin_map (pool->obj); -out_pool: -intel_gt_buffer_pool_put (pool); +err_pool: + eb->reloc_pool = pool;return err; }
@@ -1429,7 +1477,7 @@ static u32 *reloc_gpu(struct i915_execbuffer *eb,if (unlikely (cache->rq_size + len >PAGE_SIZE /sizeof (u32) -RELOC_TAIL )) { - err =reloc_gpu_chain (cache); + err =reloc_gpu_chain (eb, cache);if (unlikely (err)) {i915_request_set_error_once (cache->rq, err);return ERR_PTR (err);
@@ -1468,7 +1516,7 @@ static unsigned long vma_phys_addr(struct i915_vma *vma, u32 offset)return addr +offset_in_page (offset); } -static bool __reloc_entry_gpu (struct i915_execbuffer *eb, +static int __reloc_entry_gpu (struct i915_execbuffer *eb,struct i915_vma *vma,u64 offset,u64 target_addr)
@@ -1486,7 +1534,9 @@ static bool __reloc_entry_gpu(struct i915_execbuffer *eb, len =3 ; batch =reloc_gpu (eb, vma, len); -if (IS_ERR (batch)) +if (batch ==ERR_PTR (-EDEADLK )) +return (s64)-EDEADLK ; +else if (IS_ERR (batch))return false; addr =gen8_canonical_addr (vma->node.start + offset);
@@ -1539,7 +1589,7 @@ static bool __reloc_entry_gpu(struct i915_execbuffer *eb,return true; } -static bool reloc_entry_gpu (struct i915_execbuffer *eb, +static int reloc_entry_gpu (struct i915_execbuffer *eb,struct i915_vma *vma,u64 offset,u64 target_addr)
@@ -1561,8 +1611,12 @@ relocate_entry(struct i915_vma *vma, {u64 target_addr =relocation_target (reloc, target);u64 offset = reloc->offset; +int reloc_gpu =reloc_entry_gpu (eb, vma, offset, target_addr); -if (!reloc_entry_gpu (eb, vma, offset, target_addr)) { +if (reloc_gpu <0 ) +return reloc_gpu; + +if (!reloc_gpu) {bool wide = eb->reloc_cache.use_64bit_reloc;void *vaddr;
@@ -1928,6 +1982,10 @@ static noinline int eb_relocate_parse_slow(struct i915_execbuffer *eb) goto out; } +/* We may process another execbuffer during the unlock... */ +eb_release_vmas (eb, false); +i915_gem_ww_ctx_fini (&eb->ww); +/* * We take 3 passes through the slowpatch. *
@@ -1950,9 +2008,21 @@ static noinline int eb_relocate_parse_slow(struct i915_execbuffer *eb)cond_resched (); err =0 ; } + +flush_workqueue (eb->i915->mm.userptr_wq); + +i915_gem_ww_ctx_init (&eb->ww, true);if (err) goto out; +/* reacquire the objects */ +repeat_validate: + err =eb_validate_vmas (eb); +if (err) + goto err; + +GEM_BUG_ON (!eb->batch); +list_for_each_entry (ev, &eb->relocs, reloc_link) {if (!have_copy) {pagefault_disable ();
@@ -1967,7 +2037,10 @@ static noinline int eb_relocate_parse_slow(struct i915_execbuffer *eb) } } - flush =reloc_gpu_flush (&eb->reloc_cache); + flush =reloc_gpu_flush (eb, &eb->reloc_cache); +if (err == -EDEADLK ) + goto err; +if (err && !have_copy) goto repeat;
@@ -1990,6 +2063,13 @@ static noinline int eb_relocate_parse_slow(struct i915_execbuffer *eb)*/ err: +if (err == -EDEADLK ) { +eb_release_vmas (eb, false); + err =i915_gem_ww_ctx_backoff (&eb->ww); +if (!err) + goto repeat_validate; + } +if (err == -EAGAIN ) goto repeat;
@@ -2018,15 +2098,12 @@ static int eb_relocate_parse(struct i915_execbuffer *eb) {int err; - err =eb_lookup_vmas (eb); -if (err) -return err; - -if (!list_empty (&eb->unbound)) { - err =eb_reserve (eb); -if (err) -return err; - } +retry: + err =eb_validate_vmas (eb); +if (err == -EAGAIN ) + goto slow; +else if (err) + goto err;/* The objects are in their final locations, apply the relocations. */ if (eb->args->flags & __EXEC_HAS_RELOC) {
@@ -2039,48 +2116,49 @@ static int eb_relocate_parse(struct i915_execbuffer *eb)break ; } - flush =reloc_gpu_flush (&eb->reloc_cache); -if (!err) - err = flush; + flush =reloc_gpu_flush (eb, &eb->reloc_cache); +if (err == -EDEADLK ) + goto err; +else if (err) + goto slow;else -return eb_relocate_parse_slow (eb); + err = flush; + } + +if (!err) + err =eb_parse (eb); + +err: +if (err == -EDEADLK ) { +eb_release_vmas (eb, false); + err =i915_gem_ww_ctx_backoff (&eb->ww); +if (!err) + goto retry; } -return eb_parse (eb); +return err; + +slow: + err =eb_relocate_parse_slow (eb); +if (err) +/* +* If the user expects the execobject.offset and +* reloc.presumed_offset to be an exact match, +* as for using NO_RELOC, then we cannot update +* the execobject.offset until we have completed +* relocation. +*/ + eb->args->flags &= ~__EXEC_HAS_RELOC; + +return err; }static int eb_move_to_gpu (struct i915_execbuffer *eb) {const unsigned int count = eb->buffer_count; -struct ww_acquire_ctx acquire; -unsigned int i; +unsigned int i = count;int err =0 ; -ww_acquire_init (&acquire, &reservation_ww_class); - -for (i =0 ; i < count; i++) { -struct eb_vma *ev = &eb->vma[i]; -struct i915_vma *vma = ev->vma; - - err =ww_mutex_lock_interruptible (&vma->resv->lock, &acquire); -if (err == -EDEADLK ) { -GEM_BUG_ON (i ==0 ); -do { -int j = i -1 ; - -ww_mutex_unlock (&eb->vma[j].vma->resv->lock); - -swap (eb->vma[i], eb->vma[j]); - }while (--i); - - err =ww_mutex_lock_slow_interruptible (&vma->resv->lock, - &acquire); - } -if (err) -break ; - } -ww_acquire_done (&acquire); -while (i--) {struct eb_vma *ev = &eb->vma[i];struct i915_vma *vma = ev->vma;
@@ -2124,10 +2202,7 @@ static int eb_move_to_gpu(struct i915_execbuffer *eb)if (err ==0 ) err =i915_vma_move_to_active (vma, eb->request, flags); - -i915_vma_unlock (vma); } -ww_acquire_fini (&acquire);if (unlikely (err)) goto err_skip;
@@ -2281,10 +2356,6 @@ static int eb_parse_pipeline(struct i915_execbuffer *eb, pw->shadow = shadow; pw->trampoline = trampoline; - err =dma_resv_lock_interruptible (pw->batch->resv,NULL ); -if (err) - goto err_trampoline; - err =dma_resv_reserve_shared (pw->batch->resv,1 );if (err) goto err_batch_unlock;
@@ -2299,19 +2370,14 @@ static int eb_parse_pipeline(struct i915_execbuffer *eb,/* Keep the batch alive and unwritten as we parse */ dma_resv_add_shared_fence (pw->batch->resv, &pw->base.dma); -dma_resv_unlock (pw->batch->resv); -/* Force execution to wait for completion of the parser */ -dma_resv_lock (shadow->resv,NULL );dma_resv_add_excl_fence (shadow->resv, &pw->base.dma); -dma_resv_unlock (shadow->resv);dma_fence_work_commit_imm (&pw->base);return 0 ; err_batch_unlock:dma_resv_unlock (pw->batch->resv); -err_trampoline:if (trampoline)i915_active_release (&trampoline->active); err_shadow:
@@ -2326,7 +2392,7 @@ static int eb_parse_pipeline(struct i915_execbuffer *eb,static int eb_parse (struct i915_execbuffer *eb) {struct drm_i915_private *i915 = eb->i915; -struct intel_gt_buffer_pool_node *pool; +struct intel_gt_buffer_pool_node *pool = eb->batch_pool;struct i915_vma *shadow, *trampoline;unsigned int len;int err;
@@ -2349,9 +2415,16 @@ static int eb_parse(struct i915_execbuffer *eb) len +=I915_CMD_PARSER_TRAMPOLINE_SIZE ; } - pool =intel_gt_get_buffer_pool (eb->engine->gt, len); -if (IS_ERR (pool)) -return PTR_ERR (pool); +if (!pool) { + pool =intel_gt_get_buffer_pool (eb->engine->gt, len); +if (IS_ERR (pool)) +return PTR_ERR (pool); + eb->batch_pool = pool; + } + + err =i915_gem_object_lock (pool->obj, &eb->ww); +if (err) + goto err; shadow =shadow_batch_pin (pool->obj, eb->context->vm,PIN_USER );if (IS_ERR (shadow)) {
@@ -2387,7 +2460,6 @@ static int eb_parse(struct i915_execbuffer *eb) eb->trampoline = trampoline; eb->batch_start_offset =0 ; - shadow->private = pool;return 0 ; err_trampoline:
@@ -2396,7 +2468,6 @@ static int eb_parse(struct i915_execbuffer *eb) err_shadow:i915_vma_unpin (shadow); err: -intel_gt_buffer_pool_put (pool);return err; }
@@ -2883,6 +2954,7 @@ i915_gem_do_execbuffer(struct drm_device *dev, eb.exec = exec; eb.vma = (struct eb_vma *)(exec + args->buffer_count +1 ); eb.vma[0 ].vma =NULL ; + eb.reloc_pool = eb.batch_pool =NULL ; eb.invalid_flags = __EXEC_OBJECT_UNKNOWN_FLAGS;reloc_cache_init (&eb.reloc_cache, eb.i915);
@@ -2942,6 +3014,14 @@ i915_gem_do_execbuffer(struct drm_device *dev,if (unlikely (err)) goto err_context; + err =eb_lookup_vmas (&eb); +if (err) { +eb_release_vmas (&eb, true); + goto err_engine; + } + +i915_gem_ww_ctx_init (&eb.ww, true); + err =eb_relocate_parse (&eb);if (err) {/*
@@ -2955,6 +3035,8 @@ i915_gem_do_execbuffer(struct drm_device *dev, goto err_vma; } +ww_acquire_done (&eb.ww.ctx); +/* * snb/ivb/vlv conflate the "batch in ppgtt" bit with the "non-secure * batch" bit. Hence we need to pin secure batches into the global gtt.
@@ -2975,7 +3057,7 @@ i915_gem_do_execbuffer(struct drm_device *dev, vma =i915_gem_object_ggtt_pin (eb.batch->vma->obj,NULL ,0 ,0 ,0 );if (IS_ERR (vma)) { err =PTR_ERR (vma); - goto err_parse; + goto err_vma; } batch = vma;
@@ -3027,8 +3109,8 @@ i915_gem_do_execbuffer(struct drm_device *dev,* to explicitly hold another reference here. */ eb.request->batch = batch; -if (batch->private) -intel_gt_buffer_pool_mark_active (batch->private, eb.request); +if (eb.batch_pool) +intel_gt_buffer_pool_mark_active (eb.batch_pool, eb.request);trace_i915_request_queue (eb.request, eb.batch_flags); err =eb_submit (&eb, batch);
@@ -3055,14 +3137,18 @@ i915_gem_do_execbuffer(struct drm_device *dev, err_batch_unpin:if (eb.batch_flags &I915_DISPATCH_SECURE )i915_vma_unpin (batch); -err_parse: -if (batch->private) -intel_gt_buffer_pool_put (batch->private); err_vma: -if (eb.exec) -eb_release_vmas (&eb); +eb_release_vmas (&eb, true);if (eb.trampoline)i915_vma_unpin (eb.trampoline); +WARN_ON (err == -EDEADLK ); +i915_gem_ww_ctx_fini (&eb.ww); + +if (eb.batch_pool) +intel_gt_buffer_pool_put (eb.batch_pool); +if (eb.reloc_pool) +intel_gt_buffer_pool_put (eb.reloc_pool); +err_engine:eb_unpin_engine (&eb); err_context:i915_gem_context_put (eb.gem_context);
drivers/gpu/drm/i915/gem/selftests/i915_gem_execbuffer.c +1 -1
@@ -69,7 +69,7 @@ static int __igt_gpu_reloc(struct i915_execbuffer *eb,GEM_BUG_ON (!eb->reloc_cache.rq); rq =i915_request_get (eb->reloc_cache.rq); - err =reloc_gpu_flush (&eb->reloc_cache); + err =reloc_gpu_flush (eb, &eb->reloc_cache);if (err) goto put_rq;GEM_BUG_ON (eb->reloc_cache.rq);
drivers/gpu/drm/i915/i915_gem.c +6 -0
@@ -1360,6 +1360,12 @@ static void i915_gem_ww_ctx_unlock_all(struct i915_gem_ww_ctx *ww) } } +void i915_gem_ww_unlock_single (struct drm_i915_gem_object *obj) +{ +list_del (&obj->obj_link); +i915_gem_object_unlock (obj); +} +void i915_gem_ww_ctx_fini (struct i915_gem_ww_ctx *ww) {i915_gem_ww_ctx_unlock_all (ww);
drivers/gpu/drm/i915/i915_gem.h +1 -0
@@ -126,5 +126,6 @@ struct i915_gem_ww_ctx {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);#endif /* __I915_GEM_H__ */
Signature · 6 lines
2.26.2 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 8/24 drm/i915: Use ww locking in intel_renderstate.
In reply to Maarten LankhorstWe want to start using ww locking in intel_context_pin, for this we need to lock multiple objects, and the single i915_gem_object_lock is not enough.
Convert to using ww-waiting, and make sure we always pin intel_context_state, even if we don't have a renderstate object.
--- drivers/gpu/drm/i915/gt/intel_gt.c | 21 +++--- drivers/gpu/drm/i915/gt/intel_renderstate.c | 78 ++++++++++++++------- drivers/gpu/drm/i915/gt/intel_renderstate.h | 9 ++- 3 files changed, 72 insertions(+), 36 deletions(-)
drivers/gpu/drm/i915/gt/intel_gt.c +12 -9
@@ -398,21 +398,20 @@ static int __engines_record_defaults(struct intel_gt *gt)/* We must be able to switch to something! */ GEM_BUG_ON (!engine->kernel_context); - err =intel_renderstate_init (&so, engine); -if (err) - goto out; - ce =intel_context_create (engine);if (IS_ERR (ce)) { err =PTR_ERR (ce); goto out; } - rq =intel_context_create_request (ce); + err =intel_renderstate_init (&so, ce); +if (err) + goto err; + + rq =i915_request_create (ce);if (IS_ERR (rq)) { err =PTR_ERR (rq); -intel_context_put (ce); - goto out; + goto err_fini; } err =intel_engine_emit_ctx_wa (rq);
@@ -426,9 +425,13 @@ static int __engines_record_defaults(struct intel_gt *gt) err_rq: requests[id] =i915_request_get (rq);i915_request_add (rq); -intel_renderstate_fini (&so); -if (err) +err_fini: +intel_renderstate_fini (&so, ce); +err: +if (err) { +intel_context_put (ce); goto out; + } }/* Flush the default context image to memory, and enable powersaving. */
drivers/gpu/drm/i915/gt/intel_renderstate.c +54 -24
137 lines not on this page · raw message
drivers/gpu/drm/i915/gt/intel_renderstate.h +6 -3
@@ -25,9 +25,10 @@#define _INTEL_RENDERSTATE_H_#include <linux/types.h> +#include "i915_gem.h" struct i915_request ; -struct intel_engine_cs ; +struct intel_context ;struct i915_vma ;struct intel_renderstate_rodata {
@@ -49,6 +50,7 @@ extern const struct intel_renderstate_rodata gen8_null_state;extern const struct intel_renderstate_rodata gen9_null_state;struct intel_renderstate { +struct i915_gem_ww_ctx ww;const struct intel_renderstate_rodata *rodata;struct i915_vma *vma;u32 batch_offset;
@@ -58,9 +60,10 @@ struct intel_renderstate { };int intel_renderstate_init (struct intel_renderstate *so, -struct intel_engine_cs *engine); +struct intel_context *ce);int intel_renderstate_emit (struct intel_renderstate *so,struct i915_request *rq); -void intel_renderstate_fini (struct intel_renderstate *so); +void intel_renderstate_fini (struct intel_renderstate *so, +struct intel_context *ce);#endif /* _INTEL_RENDERSTATE_H_ */
Signature · 6 lines
2.26.2 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 9/24 drm/i915: Add ww context handling to context_barrier_task
In reply to Maarten LankhorstThis is required if we want to pass a ww context in intel_context_pin and gen6_ppgtt_pin().
--- drivers/gpu/drm/i915/gem/i915_gem_context.c | 55 ++++++++++++++----- .../drm/i915/gem/selftests/i915_gem_context.c | 22 +++----- 2 files changed, 48 insertions(+), 29 deletions(-)
drivers/gpu/drm/i915/gem/i915_gem_context.c +40 -15
@@ -1094,6 +1094,7 @@ I915_SELFTEST_DECLARE(static intel_engine_mask_t context_barrier_inject_fault);static int context_barrier_task (struct i915_gem_context *ctx,intel_engine_mask_t engines,bool (*skip)(struct intel_context *ce,void *data), +int (*pin)(struct intel_context *ce,struct i915_gem_ww_ctx *ww,void *data),int (*emit)(struct i915_request *rq,void *data),void (*task)(void *data),void *data)
@@ -1101,6 +1102,7 @@ static int context_barrier_task(struct i915_gem_context *ctx,struct context_barrier_task *cb;struct i915_gem_engines_iter it;struct i915_gem_engines *e; +struct i915_gem_ww_ctx ww;struct intel_context *ce;int err =0 ;
@@ -1138,10 +1140,21 @@ static int context_barrier_task(struct i915_gem_context *ctx,if (skip &&skip (ce, data))continue ; - rq =intel_context_create_request (ce); +i915_gem_ww_ctx_init (&ww, true); +retry: + err =intel_context_pin (ce); +if (err) + goto err; + +if (pin) + err =pin (ce, &ww, data); +if (err) + goto err_unpin; + + rq =i915_request_create (ce);if (IS_ERR (rq)) { err =PTR_ERR (rq); -break ; + goto err_unpin; } err =0 ;
@@ -1151,6 +1164,16 @@ static int context_barrier_task(struct i915_gem_context *ctx, err =i915_active_add_request (&cb->base, rq);i915_request_add (rq); +err_unpin: +intel_context_unpin (ce); +err: +if (err == -EDEADLK ) { + err =i915_gem_ww_ctx_backoff (&ww); +if (!err) + goto retry; + } +i915_gem_ww_ctx_fini (&ww); +if (err)break ; }
@@ -1206,6 +1229,17 @@ static void set_ppgtt_barrier(void *data)i915_vm_close (old); } +static int pin_ppgtt_update (struct intel_context *ce,struct i915_gem_ww_ctx *ww,void *data) +{ +struct i915_address_space *vm = ce->vm; + +if (!HAS_LOGICAL_RING_CONTEXTS (vm->i915)) +/* ppGTT is not part of the legacy context image */ +return gen6_ppgtt_pin (i915_vm_to_ppgtt (vm)); + +return 0 ; +} +static int emit_ppgtt_update (struct i915_request *rq,void *data) {struct i915_address_space *vm = rq->context->vm;
@@ -1262,20 +1296,10 @@ static int emit_ppgtt_update(struct i915_request *rq, void *data)static bool skip_ppgtt_update (struct intel_context *ce,void *data) { -if (!test_bit (CONTEXT_ALLOC_BIT , &ce->flags)) -return true; -if (HAS_LOGICAL_RING_CONTEXTS (ce->engine->i915)) -return false; - -if (!atomic_read (&ce->pin_count)) -return true; - -/* ppGTT is not part of the legacy context image */ -if (gen6_ppgtt_pin (i915_vm_to_ppgtt (ce->vm))) -return true; - -return false; +return !ce->state; +else +return !atomic_read (&ce->pin_count); } static int set_ppgtt(struct drm_i915_file_private *file_priv,
@@ -1326,6 +1350,7 @@ static int set_ppgtt(struct drm_i915_file_private *file_priv,*/ err =context_barrier_task (ctx,ALL_ENGINES , skip_ppgtt_update, + pin_ppgtt_update, emit_ppgtt_update, set_ppgtt_barrier, old);
drivers/gpu/drm/i915/gem/selftests/i915_gem_context.c +8 -14
@@ -1917,8 +1917,8 @@ static int mock_context_barrier(void *arg)return -ENOMEM ; counter =0 ; - err =context_barrier_task (ctx,0 , -NULL ,NULL , mock_barrier_task, &counter); + err =context_barrier_task (ctx,0 ,NULL ,NULL ,NULL , + mock_barrier_task, &counter);if (err) {pr_err ("Failed at line %d, err=%d\n" , __LINE__, err); goto out;
@@ -1930,11 +1930,8 @@ static int mock_context_barrier(void *arg) } counter =0 ; - err =context_barrier_task (ctx,ALL_ENGINES , - skip_unused_engines, -NULL , - mock_barrier_task, - &counter); + err =context_barrier_task (ctx,ALL_ENGINES , skip_unused_engines, +NULL ,NULL , mock_barrier_task, &counter);if (err) {pr_err ("Failed at line %d, err=%d\n" , __LINE__, err); goto out;
@@ -1954,8 +1951,8 @@ static int mock_context_barrier(void *arg) counter =0 ; context_barrier_inject_fault =BIT (RCS0 ); - err =context_barrier_task (ctx,ALL_ENGINES , -NULL ,NULL , mock_barrier_task, &counter); + err =context_barrier_task (ctx,ALL_ENGINES ,NULL ,NULL ,NULL , + mock_barrier_task, &counter); context_barrier_inject_fault =0 ;if (err == -ENXIO ) err =0 ;
@@ -1969,11 +1966,8 @@ static int mock_context_barrier(void *arg) goto out; counter =0 ; - err =context_barrier_task (ctx,ALL_ENGINES , - skip_unused_engines, -NULL , - mock_barrier_task, - &counter); + err =context_barrier_task (ctx,ALL_ENGINES , skip_unused_engines, +NULL ,NULL , mock_barrier_task, &counter);if (err) {pr_err ("Failed at line %d, err=%d\n" , __LINE__, err); goto out;
Signature · 6 lines
2.26.2 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 10/24 drm/i915: Nuke arguments to eb_pin_engine
In reply to Maarten LankhorstThose arguments are already set as eb.file and eb.args, so kill off the extra arguments. This will allow us to move eb_pin_engine() to after we reserved all BO's.
--- drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-)
drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c +7 -10
@@ -2689,11 +2689,10 @@ static void eb_unpin_engine(struct i915_execbuffer *eb) }static unsigned int -eb_select_legacy_ring (struct i915_execbuffer *eb, -struct drm_file *file, -struct drm_i915_gem_execbuffer2 *args) +eb_select_legacy_ring (struct i915_execbuffer *eb) {struct drm_i915_private *i915 = eb->i915; +struct drm_i915_gem_execbuffer2 *args = eb->args;unsigned int user_ring_id = args->flags &I915_EXEC_RING_MASK ; if (user_ring_id != I915_EXEC_BSD &&
@@ -2708,7 +2707,7 @@ eb_select_legacy_ring(struct i915_execbuffer *eb,unsigned int bsd_idx = args->flags &I915_EXEC_BSD_MASK ;if (bsd_idx ==I915_EXEC_BSD_DEFAULT ) { - bsd_idx =gen8_dispatch_bsd_engine (i915, file); + bsd_idx =gen8_dispatch_bsd_engine (i915, eb->file); }else if (bsd_idx >=I915_EXEC_BSD_RING1 && bsd_idx <=I915_EXEC_BSD_RING2 ) { bsd_idx >>=I915_EXEC_BSD_SHIFT ;
@@ -2733,18 +2732,16 @@ eb_select_legacy_ring(struct i915_execbuffer *eb, }static int -eb_pin_engine (struct i915_execbuffer *eb, -struct drm_file *file, -struct drm_i915_gem_execbuffer2 *args) +eb_pin_engine (struct i915_execbuffer *eb) {struct intel_context *ce;unsigned int idx;int err;if (i915_gem_context_user_engines (eb->gem_context)) - idx = args->flags &I915_EXEC_RING_MASK ; + idx = eb->args->flags &I915_EXEC_RING_MASK ;else - idx =eb_select_legacy_ring (eb, file, args); + idx =eb_select_legacy_ring (eb); ce =i915_gem_context_get_engine (eb->gem_context, idx);if (IS_ERR (ce))
@@ -3010,7 +3007,7 @@ i915_gem_do_execbuffer(struct drm_device *dev,if (unlikely (err)) goto err_destroy; - err =eb_pin_engine (&eb, file, args); + err =eb_pin_engine (&eb);if (unlikely (err)) goto err_context;
Signature · 6 lines
2.26.2 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 11/24 drm/i915: Pin engine before pinning all objects, v4.
In reply to Maarten LankhorstWe want to lock all gem objects, including the engine context objects, rework the throttling to ensure that we can do this. Now we only throttle once, but can take eb_pin_engine while acquiring objects. This means we will have to drop the lock to wait. If we don't have to throttle we can still take the fastpath, if not we will take the slowpath and wait for the throttle request while unlocked.
The engine has to be pinned as first step, otherwise gpu relocations won't work.
Changes since v1:
- Only need to get a throttled request in the fastpath, no need for a global flag any more.
- Always free the waited request correctly.
Changes since v2:
- Use intel_engine_pm_get()/put() to keeep engine pool alive during EDEADLK handling.
Changes since v3:
- Fix small rq leak.
--- .../gpu/drm/i915/gem/i915_gem_execbuffer.c | 185 ++++++++++++------ 1 file changed, 129 insertions(+), 56 deletions(-)
drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c +129 -56
@@ -55,7 +55,8 @@ enum {#define __EXEC_OBJECT_RESERVED (__EXEC_OBJECT_HAS_PIN | __EXEC_OBJECT_HAS_FENCE)#define __EXEC_HAS_RELOC BIT(31) -#define __EXEC_INTERNAL_FLAGS (~0u << 31) +#define __EXEC_ENGINE_PINNED BIT(30) +#define __EXEC_INTERNAL_FLAGS (~0u << 30)#define UPDATE PIN_OFFSET_FIXED#define BATCH_OFFSET_BIAS (256*1024)
@@ -294,6 +295,9 @@ struct i915_execbuffer { };static int eb_parse (struct i915_execbuffer *eb); +static struct i915_request *eb_pin_engine (struct i915_execbuffer *eb, +bool throttle); +static void eb_unpin_engine (struct i915_execbuffer *eb);static inline bool eb_use_cmdparser (const struct i915_execbuffer *eb) {
@@ -925,7 +929,7 @@ eb_get_vma(const struct i915_execbuffer *eb, unsigned long handle) } } -static void eb_release_vmas (const struct i915_execbuffer *eb,bool final) +static void eb_release_vmas (struct i915_execbuffer *eb,bool final) {const unsigned int count = eb->buffer_count;unsigned int i;
@@ -942,6 +946,8 @@ static void eb_release_vmas(const struct i915_execbuffer *eb, bool final)if (final)i915_vma_put (vma); } + +eb_unpin_engine (eb); }static void eb_destroy (const struct i915_execbuffer *eb)
@@ -1970,7 +1976,8 @@ static int eb_prefault_relocations(const struct i915_execbuffer *eb)return 0 ; } -static noinline int eb_relocate_parse_slow(struct i915_execbuffer *eb) +static noinline int eb_relocate_parse_slow(struct i915_execbuffer *eb, +struct i915_request *rq) {bool have_copy = false;struct eb_vma *ev;
@@ -1986,6 +1993,21 @@ static noinline int eb_relocate_parse_slow(struct i915_execbuffer *eb)eb_release_vmas (eb, false);i915_gem_ww_ctx_fini (&eb->ww); +if (rq) { +/* nonblocking is always false */ +if (i915_request_wait (rq,I915_WAIT_INTERRUPTIBLE , +MAX_SCHEDULE_TIMEOUT ) <0 ) { +i915_request_put (rq); + rq =NULL ; + + err = -EINTR ; + goto err_relock; + } + +i915_request_put (rq); + rq =NULL ; + } +/* * We take 3 passes through the slowpatch. *
@@ -2009,14 +2031,25 @@ static noinline int eb_relocate_parse_slow(struct i915_execbuffer *eb) err =0 ; } -flush_workqueue (eb->i915->mm.userptr_wq); +if (!err) +flush_workqueue (eb->i915->mm.userptr_wq); +err_relock:i915_gem_ww_ctx_init (&eb->ww, true);if (err) goto out;/* reacquire the objects */ repeat_validate: + rq =eb_pin_engine (eb, false); +if (IS_ERR (rq)) { + err =PTR_ERR (rq); + goto err; + } + +/* We didn't throttle, should be NULL */ +GEM_WARN_ON (rq); + err =eb_validate_vmas (eb);if (err) goto err;
@@ -2091,14 +2124,49 @@ static noinline int eb_relocate_parse_slow(struct i915_execbuffer *eb) } } +if (rq) +i915_request_put (rq); +return err; }static int eb_relocate_parse (struct i915_execbuffer *eb) {int err; +struct i915_request *rq =NULL ; +bool throttle = true; retry: + rq =eb_pin_engine (eb, throttle); +if (IS_ERR (rq)) { + err =PTR_ERR (rq); + rq =NULL ; +if (err != -EDEADLK ) +return err; + + goto err; + } + +if (rq) { +bool nonblock = eb->file->filp->f_flags &O_NONBLOCK ; + +/* Need to drop all locks now for throttling, take slowpath */ + err =i915_request_wait (rq,I915_WAIT_INTERRUPTIBLE ,0 ); +if (err == -ETIME ) { +if (nonblock) { + err = -EWOULDBLOCK ; +i915_request_put (rq); + goto err; + } + goto slow; + } +i915_request_put (rq); + rq =NULL ; + } + +/* only throttle once, even if we didn't need to throttle */ + throttle = false; + err =eb_validate_vmas (eb);if (err == -EAGAIN ) goto slow;
@@ -2139,7 +2207,7 @@ static int eb_relocate_parse(struct i915_execbuffer *eb)return err; slow: - err =eb_relocate_parse_slow (eb); + err =eb_relocate_parse_slow (eb, rq);if (err)/* * If the user expects the execobject.offset and
@@ -2565,7 +2633,7 @@ static const enum intel_engine_id user_ring_map[] = { [I915_EXEC_VEBOX] = VECS0 }; -static struct i915_request *eb_throttle (struct intel_context *ce) +static struct i915_request *eb_throttle (struct i915_execbuffer *eb,struct intel_context *ce) {struct intel_ring *ring = ce->ring;struct intel_timeline *tl = ce->timeline;
@@ -2599,22 +2667,17 @@ static struct i915_request *eb_throttle(struct intel_context *ce)return i915_request_get (rq); } -static int __eb_pin_engine (struct i915_execbuffer *eb,struct intel_context *ce) +static struct i915_request *eb_pin_engine (struct i915_execbuffer *eb,bool throttle) { +struct intel_context *ce = eb->context;struct intel_timeline *tl; -struct i915_request *rq; +struct i915_request *rq =NULL ;int err; -/* -* ABI: Before userspace accesses the GPU (e.g. execbuffer), report -* EIO if the GPU is already wedged. -*/ - err =intel_gt_terminally_wedged (ce->engine->gt); -if (err) -return err; +GEM_BUG_ON (eb->args->flags & __EXEC_ENGINE_PINNED);if (unlikely (intel_context_is_banned (ce))) -return -EIO ; +return ERR_PTR (-EIO );/* * Pinning the contexts may generate requests in order to acquire
@@ -2623,7 +2686,7 @@ static int __eb_pin_engine(struct i915_execbuffer *eb, struct intel_context *ce)*/ err =intel_context_pin (ce);if (err) -return err; +return ERR_PTR (err);/* * Take a local wakeref for preparing to dispatch the execbuf as
@@ -2635,45 +2698,17 @@ static int __eb_pin_engine(struct i915_execbuffer *eb, struct intel_context *ce)*/ tl =intel_context_timeline_lock (ce);if (IS_ERR (tl)) { - err =PTR_ERR (tl); - goto err_unpin; +intel_context_unpin (ce); +return ERR_CAST (tl); }intel_context_enter (ce); - rq =eb_throttle (ce); - +if (throttle) + rq =eb_throttle (eb, ce);intel_context_timeline_unlock (tl); -if (rq) { -bool nonblock = eb->file->filp->f_flags &O_NONBLOCK ; -long timeout; - - timeout =MAX_SCHEDULE_TIMEOUT ; -if (nonblock) - timeout =0 ; - - timeout =i915_request_wait (rq, -I915_WAIT_INTERRUPTIBLE , - timeout); -i915_request_put (rq); - -if (timeout <0 ) { - err = nonblock ? -EWOULDBLOCK : timeout; - goto err_exit; - } - } - - eb->engine = ce->engine; - eb->context = ce; -return 0 ; - -err_exit: -mutex_lock (&tl->mutex); -intel_context_exit (ce); -intel_context_timeline_unlock (tl); -err_unpin: -intel_context_unpin (ce); -return err; + eb->args->flags |= __EXEC_ENGINE_PINNED; +return rq; }static void eb_unpin_engine (struct i915_execbuffer *eb)
@@ -2681,6 +2716,11 @@ static void eb_unpin_engine(struct i915_execbuffer *eb)struct intel_context *ce = eb->context;struct intel_timeline *tl = ce->timeline; +if (!(eb->args->flags & __EXEC_ENGINE_PINNED)) +return ; + + eb->args->flags &= ~__EXEC_ENGINE_PINNED; +mutex_lock (&tl->mutex);intel_context_exit (ce);mutex_unlock (&tl->mutex);
@@ -2732,7 +2772,7 @@ eb_select_legacy_ring(struct i915_execbuffer *eb) }static int -eb_pin_engine (struct i915_execbuffer *eb) +eb_select_engine (struct i915_execbuffer *eb) {struct intel_context *ce;unsigned int idx;
@@ -2747,10 +2787,43 @@ eb_pin_engine(struct i915_execbuffer *eb)if (IS_ERR (ce))return PTR_ERR (ce); - err =__eb_pin_engine (eb, ce); -intel_context_put (ce); +intel_gt_pm_get (ce->engine->gt); +if (!test_bit (CONTEXT_ALLOC_BIT , &ce->flags)) { + err =intel_context_alloc_state (ce); +if (err) + goto err; + } + +/* +* ABI: Before userspace accesses the GPU (e.g. execbuffer), report +* EIO if the GPU is already wedged. +*/ + err =intel_gt_terminally_wedged (ce->engine->gt); +if (err) + goto err; + + eb->context = ce; + eb->engine = ce->engine; + +/* +* Make sure engine pool stays alive even if we call intel_context_put +* during ww handling. The pool is destroyed when last pm reference +* is dropped, which breaks our -EDEADLK handling. +*/ return err; + +err: +intel_gt_pm_put (ce->engine->gt); +intel_context_put (ce); +return err; +} + +static void +eb_put_engine (struct i915_execbuffer *eb) +{ +intel_gt_pm_put (eb->engine->gt); +intel_context_put (eb->context); } static void
@@ -3007,7 +3080,7 @@ i915_gem_do_execbuffer(struct drm_device *dev,if (unlikely (err)) goto err_destroy; - err =eb_pin_engine (&eb); + err =eb_select_engine (&eb);if (unlikely (err)) goto err_context;
@@ -3146,7 +3219,7 @@ i915_gem_do_execbuffer(struct drm_device *dev,if (eb.reloc_pool)intel_gt_buffer_pool_put (eb.reloc_pool); err_engine: -eb_unpin_engine (&eb); +eb_put_engine (&eb); err_context:i915_gem_context_put (eb.gem_context); err_destroy:
Signature · 6 lines
2.26.2 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 12/24 drm/i915: Rework intel_context pinning to do everything outside of pin_mutex
In reply to Maarten LankhorstInstead of doing everything inside of pin_mutex, we move all pinning outside. Because i915_active has its own reference counting and pinning is also having the same issues vs mutexes, we make sure everything is pinned first, so the pinning in i915_active only needs to bump refcounts. This allows us to take pin refcounts correctly all the time.
--- drivers/gpu/drm/i915/gt/intel_context.c | 232 +++++++++++------- drivers/gpu/drm/i915/gt/intel_context_types.h | 4 +- drivers/gpu/drm/i915/gt/intel_lrc.c | 34 ++- .../gpu/drm/i915/gt/intel_ring_submission.c | 13 +- drivers/gpu/drm/i915/gt/mock_engine.c | 13 +- 5 files changed, 190 insertions(+), 106 deletions(-)
drivers/gpu/drm/i915/gt/intel_context.c +141 -91
@@ -93,79 +93,6 @@ static void intel_context_active_release(struct intel_context *ce)i915_active_release (&ce->active); } -int __intel_context_do_pin (struct intel_context *ce) -{ -int err; - -if (unlikely (!test_bit (CONTEXT_ALLOC_BIT , &ce->flags))) { - err =intel_context_alloc_state (ce); -if (err) -return err; - } - - err =i915_active_acquire (&ce->active); -if (err) -return err; - -if (mutex_lock_interruptible (&ce->pin_mutex)) { - err = -EINTR ; - goto out_release; - } - -if (unlikely (intel_context_is_closed (ce))) { - err = -ENOENT ; - goto out_unlock; - } - -if (likely (!atomic_add_unless (&ce->pin_count,1 ,0 ))) { - err =intel_context_active_acquire (ce); -if (unlikely (err)) - goto out_unlock; - - err = ce->ops->pin (ce); -if (unlikely (err)) - goto err_active; - -CE_TRACE (ce,"pin ring:{start:%08x, head:%04x, tail:%04x}\n" , -i915_ggtt_offset (ce->ring->vma), - ce->ring->head, ce->ring->tail); - -smp_mb__before_atomic ();/* flush pin before it is visible */ -atomic_inc (&ce->pin_count); - } - -GEM_BUG_ON (!intel_context_is_pinned (ce));/* no overflow! */ -GEM_BUG_ON (i915_active_is_idle (&ce->active)); - goto out_unlock; - -err_active: -intel_context_active_release (ce); -out_unlock: -mutex_unlock (&ce->pin_mutex); -out_release: -i915_active_release (&ce->active); -return err; -} - -void intel_context_unpin (struct intel_context *ce) -{ -if (!atomic_dec_and_test (&ce->pin_count)) -return ; - -CE_TRACE (ce,"unpin\n" ); - ce->ops->unpin (ce); - -/* -* Once released, we may asynchronously drop the active reference. -* As that may be the only reference keeping the context alive, -* take an extra now so that it is not freed before we finish -* dereferencing it. -*/ -intel_context_get (ce); -intel_context_active_release (ce); -intel_context_put (ce); -} -static int __context_pin_state (struct i915_vma *vma) {unsigned int bias =i915_ggtt_pin_bias (vma) |PIN_OFFSET_BIAS ;
@@ -225,6 +152,138 @@ static void __ring_retire(struct intel_ring *ring)i915_active_release (&ring->vma->active); } +static int intel_context_pre_pin (struct intel_context *ce) +{ +int err; + +CE_TRACE (ce,"active\n" ); + + err =__ring_active (ce->ring); +if (err) +return err; + + err =intel_timeline_pin (ce->timeline); +if (err) + goto err_ring; + +if (!ce->state) +return 0 ; + + err =__context_pin_state (ce->state); +if (err) + goto err_timeline; + + +return 0 ; + +err_timeline: +intel_timeline_unpin (ce->timeline); +err_ring: +__ring_retire (ce->ring); +return err; +} + +static void intel_context_post_unpin (struct intel_context *ce) +{ +if (ce->state) +__context_unpin_state (ce->state); + +intel_timeline_unpin (ce->timeline); +__ring_retire (ce->ring); +} + +int __intel_context_do_pin (struct intel_context *ce) +{ +bool handoff = false; +void *vaddr; +int err =0 ; + +if (unlikely (!test_bit (CONTEXT_ALLOC_BIT , &ce->flags))) { + err =intel_context_alloc_state (ce); +if (err) +return err; + } + +/* +* We always pin the context/ring/timeline here, to ensure a pin +* refcount for __intel_context_active(), which prevent a lock +* inversion of ce->pin_mutex vs dma_resv_lock(). +*/ + err =intel_context_pre_pin (ce); +if (err) +return err; + + err =i915_active_acquire (&ce->active); +if (err) + goto err_ctx_unpin; + + err = ce->ops->pre_pin (ce, &vaddr); +if (err) + goto err_release; + + err =mutex_lock_interruptible (&ce->pin_mutex); +if (err) + goto err_post_unpin; + +if (unlikely (intel_context_is_closed (ce))) { + err = -ENOENT ; + goto err_unlock; + } + +if (likely (!atomic_add_unless (&ce->pin_count,1 ,0 ))) { + err =intel_context_active_acquire (ce); +if (unlikely (err)) + goto err_unlock; + + err = ce->ops->pin (ce, vaddr); +if (err) { +intel_context_active_release (ce); + goto err_unlock; + } + +CE_TRACE (ce,"pin ring:{start:%08x, head:%04x, tail:%04x}\n" , +i915_ggtt_offset (ce->ring->vma), + ce->ring->head, ce->ring->tail); + + handoff = true; +smp_mb__before_atomic ();/* flush pin before it is visible */ +atomic_inc (&ce->pin_count); + } + +GEM_BUG_ON (!intel_context_is_pinned (ce));/* no overflow! */ + +err_unlock: +mutex_unlock (&ce->pin_mutex); +err_post_unpin: +if (!handoff) + ce->ops->post_unpin (ce); +err_release: +i915_active_release (&ce->active); +err_ctx_unpin: +intel_context_post_unpin (ce); +return err; +} + +void intel_context_unpin (struct intel_context *ce) +{ +if (!atomic_dec_and_test (&ce->pin_count)) +return ; + +CE_TRACE (ce,"unpin\n" ); + ce->ops->unpin (ce); + ce->ops->post_unpin (ce); + +/* +* Once released, we may asynchronously drop the active reference. +* As that may be the only reference keeping the context alive, +* take an extra now so that it is not freed before we finish +* dereferencing it. +*/ +intel_context_get (ce); +intel_context_active_release (ce); +intel_context_put (ce); +} +__i915_active_call static void __intel_context_retire(struct i915_active *active) {
@@ -235,12 +294,7 @@ static void __intel_context_retire(struct i915_active *active) intel_context_get_avg_runtime_ns(ce));set_bit (CONTEXT_VALID_BIT , &ce->flags); -if (ce->state) -__context_unpin_state (ce->state); - -intel_timeline_unpin (ce->timeline); -__ring_retire (ce->ring); - +intel_context_post_unpin (ce);intel_context_put (ce); }
@@ -249,29 +303,25 @@ static int __intel_context_active(struct i915_active *active)struct intel_context *ce =container_of (active,typeof (*ce), active);int err; -CE_TRACE (ce,"active\n" ); -intel_context_get (ce); +/* everything should already be activated by intel_context_pre_pin() */ err =__ring_active (ce->ring); -if (err) +if (GEM_WARN_ON (err)) goto err_put; err =intel_timeline_pin (ce->timeline); -if (err) +if (GEM_WARN_ON (err)) goto err_ring; -if (!ce->state) -return 0 ; - - err =__context_pin_state (ce->state); -if (err) - goto err_timeline; +if (ce->state) { +GEM_WARN_ON (!i915_active_acquire_if_busy (&ce->state->active)); +__i915_vma_pin (ce->state); +i915_vma_make_unshrinkable (ce->state); + }return 0 ; -err_timeline: -intel_timeline_unpin (ce->timeline); err_ring:__ring_retire (ce->ring); err_put:
drivers/gpu/drm/i915/gt/intel_context_types.h +3 -1
@@ -30,8 +30,10 @@ struct intel_ring;struct intel_context_ops {int (*alloc)(struct intel_context *ce); -int (*pin)(struct intel_context *ce); +int (*pre_pin)(struct intel_context *ce,void **vaddr); +int (*pin)(struct intel_context *ce,void *vaddr);void (*unpin)(struct intel_context *ce); +void (*post_unpin)(struct intel_context *ce);void (*enter)(struct intel_context *ce);void (*exit)(struct intel_context *ce);
drivers/gpu/drm/i915/gt/intel_lrc.c +22 -12
@@ -3269,7 +3269,10 @@ static void execlists_context_unpin(struct intel_context *ce) {check_redzone ((void *)ce->lrc_reg_state -LRC_STATE_OFFSET , ce->engine); +} +static void execlists_context_post_unpin (struct intel_context *ce) +{i915_gem_object_unpin_map (ce->state->obj); }
@@ -3431,20 +3434,23 @@ __execlists_update_reg_state(const struct intel_context *ce, }static int -__execlists_context_pin (struct intel_context *ce, -struct intel_engine_cs *engine) +execlists_context_pre_pin (struct intel_context *ce,void **vaddr) { -void *vaddr; -GEM_BUG_ON (!ce->state);GEM_BUG_ON (!i915_vma_is_pinned (ce->state)); - vaddr =i915_gem_object_pin_map (ce->state->obj, -i915_coherent_map_type (engine->i915) | + *vaddr =i915_gem_object_pin_map (ce->state->obj, +i915_coherent_map_type (ce->engine->i915) |I915_MAP_OVERRIDE ); -if (IS_ERR (vaddr)) -return PTR_ERR (vaddr); +return PTR_ERR_OR_ZERO (*vaddr); +} + +static int +__execlists_context_pin (struct intel_context *ce, +struct intel_engine_cs *engine, +void *vaddr) +{ ce->lrc.lrca =lrc_descriptor (ce, engine) |CTX_DESC_FORCE_RESTORE ; ce->lrc_reg_state = vaddr +LRC_STATE_OFFSET ;__execlists_update_reg_state (ce, engine, ce->ring->tail);
@@ -3452,9 +3458,9 @@ __execlists_context_pin(struct intel_context *ce,return 0 ; } -static int execlists_context_pin (struct intel_context *ce) +static int execlists_context_pin (struct intel_context *ce,void *vaddr) { -return __execlists_context_pin (ce, ce->engine); +return __execlists_context_pin (ce, ce->engine, vaddr); }static int execlists_context_alloc (struct intel_context *ce)
@@ -3480,8 +3486,10 @@ static void execlists_context_reset(struct intel_context *ce)static const struct intel_context_ops execlists_context_ops = { .alloc = execlists_context_alloc, + .pre_pin = execlists_context_pre_pin, .pin = execlists_context_pin, .unpin = execlists_context_unpin, + .post_unpin = execlists_context_post_unpin, .enter = intel_context_enter_engine, .exit = intel_context_exit_engine,
@@ -5398,13 +5406,13 @@ static int virtual_context_alloc(struct intel_context *ce)return __execlists_context_alloc (ce, ve->siblings[0 ]); } -static int virtual_context_pin (struct intel_context *ce) +static int virtual_context_pin (struct intel_context *ce,void *vaddr) {struct virtual_engine *ve =container_of (ce,typeof (*ve), context);int err;/* Note: we must use a real engine class for setting up reg state */ - err =__execlists_context_pin (ce, ve->siblings[0 ]); + err =__execlists_context_pin (ce, ve->siblings[0 ], vaddr);if (err)return err;
@@ -5437,8 +5445,10 @@ static void virtual_context_exit(struct intel_context *ce)static const struct intel_context_ops virtual_context_ops = { .alloc = virtual_context_alloc, + .pre_pin = execlists_context_pre_pin, .pin = virtual_context_pin, .unpin = execlists_context_unpin, + .post_unpin = execlists_context_post_unpin, .enter = virtual_context_enter, .exit = virtual_context_exit,
drivers/gpu/drm/i915/gt/intel_ring_submission.c +12 -1
@@ -496,6 +496,10 @@ static void __context_unpin_ppgtt(struct intel_context *ce) }static void ring_context_unpin (struct intel_context *ce) +{ +} + +static void ring_context_post_unpin (struct intel_context *ce) {__context_unpin_ppgtt (ce); }
@@ -584,11 +588,16 @@ static int ring_context_alloc(struct intel_context *ce)return 0 ; } -static int ring_context_pin (struct intel_context *ce) +static int ring_context_pre_pin (struct intel_context *ce,void **unused) {return __context_pin_ppgtt (ce); } +static int ring_context_pin (struct intel_context *ce,void *unused) +{ +return 0 ; +} +static void ring_context_reset (struct intel_context *ce) {intel_ring_reset (ce->ring, ce->ring->emit);
@@ -597,8 +606,10 @@ static void ring_context_reset(struct intel_context *ce)static const struct intel_context_ops ring_context_ops = { .alloc = ring_context_alloc, + .pre_pin = ring_context_pre_pin, .pin = ring_context_pin, .unpin = ring_context_unpin, + .post_unpin = ring_context_post_unpin, .enter = intel_context_enter_engine, .exit = intel_context_exit_engine,
drivers/gpu/drm/i915/gt/mock_engine.c +12 -1
@@ -131,6 +131,10 @@ static void mock_context_unpin(struct intel_context *ce) { } +static void mock_context_post_unpin (struct intel_context *ce) +{ +} +static void mock_context_destroy (struct kref *ref) {struct intel_context *ce =container_of (ref,typeof (*ce), ref);
@@ -164,7 +168,12 @@ static int mock_context_alloc(struct intel_context *ce)return 0 ; } -static int mock_context_pin (struct intel_context *ce) +static int mock_context_pre_pin (struct intel_context *ce,void **unused) +{ +return 0 ; +} + +static int mock_context_pin (struct intel_context *ce,void *unused) {return 0 ; }
@@ -176,8 +185,10 @@ static void mock_context_reset(struct intel_context *ce)static const struct intel_context_ops mock_context_ops = { .alloc = mock_context_alloc, + .pre_pin = mock_context_pre_pin, .pin = mock_context_pin, .unpin = mock_context_unpin, + .post_unpin = mock_context_post_unpin, .enter = intel_context_enter_engine, .exit = intel_context_exit_engine,
Signature · 6 lines
2.26.2 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 13/24 drm/i915: Make sure execbuffer always passes ww state to i915_vma_pin.
In reply to Maarten LankhorstAs a preparation step for full object locking and wait/wound handling during pin and object mapping, ensure that we always pass the ww context in i915_gem_execbuffer.c to i915_vma_pin, use lockdep to ensure this happens.
This also requires changing the order of eb_parse slightly, to ensure we pass ww at a point where we could still handle -EDEADLK safely.
--- drivers/gpu/drm/i915/display/intel_display.c | 2 +- drivers/gpu/drm/i915/gem/i915_gem_context.c | 4 +- .../gpu/drm/i915/gem/i915_gem_execbuffer.c | 140 ++++++++++-------- drivers/gpu/drm/i915/gt/gen6_ppgtt.c | 4 +- drivers/gpu/drm/i915/gt/gen6_ppgtt.h | 4 +- drivers/gpu/drm/i915/gt/intel_context.c | 65 +++++--- drivers/gpu/drm/i915/gt/intel_context.h | 13 ++ drivers/gpu/drm/i915/gt/intel_context_types.h | 3 +- drivers/gpu/drm/i915/gt/intel_engine_cs.c | 2 +- drivers/gpu/drm/i915/gt/intel_gt.c | 2 +- drivers/gpu/drm/i915/gt/intel_lrc.c | 5 +- drivers/gpu/drm/i915/gt/intel_renderstate.c | 2 +- drivers/gpu/drm/i915/gt/intel_ring.c | 10 +- drivers/gpu/drm/i915/gt/intel_ring.h | 3 +- .../gpu/drm/i915/gt/intel_ring_submission.c | 15 +- drivers/gpu/drm/i915/gt/intel_timeline.c | 12 +- drivers/gpu/drm/i915/gt/intel_timeline.h | 3 +- drivers/gpu/drm/i915/gt/mock_engine.c | 3 +- drivers/gpu/drm/i915/gt/selftest_lrc.c | 2 +- drivers/gpu/drm/i915/gt/selftest_timeline.c | 4 +- drivers/gpu/drm/i915/gt/uc/intel_guc.c | 2 +- drivers/gpu/drm/i915/i915_drv.h | 13 +- drivers/gpu/drm/i915/i915_gem.c | 11 +- drivers/gpu/drm/i915/i915_vma.c | 13 +- drivers/gpu/drm/i915/i915_vma.h | 13 +- 25 files changed, 215 insertions(+), 135 deletions(-)
drivers/gpu/drm/i915/display/intel_display.c +1 -1
@@ -3449,7 +3449,7 @@ initial_plane_vma(struct drm_i915_private *i915,if (IS_ERR (vma)) goto err_obj; -if (i915_ggtt_pin (vma,0 ,PIN_MAPPABLE |PIN_OFFSET_FIXED | base)) +if (i915_ggtt_pin (vma,NULL ,0 ,PIN_MAPPABLE |PIN_OFFSET_FIXED | base)) goto err_obj; if (i915_gem_object_is_tiled(obj) &&
drivers/gpu/drm/i915/gem/i915_gem_context.c +2 -2
@@ -1142,7 +1142,7 @@ static int context_barrier_task(struct i915_gem_context *ctx,i915_gem_ww_ctx_init (&ww, true); retry: - err =intel_context_pin (ce); + err =intel_context_pin_ww (ce, &ww);if (err) goto err;
@@ -1235,7 +1235,7 @@ static int pin_ppgtt_update(struct intel_context *ce, struct i915_gem_ww_ctx *wwif (!HAS_LOGICAL_RING_CONTEXTS (vm->i915))/* ppGTT is not part of the legacy context image */ -return gen6_ppgtt_pin (i915_vm_to_ppgtt (vm)); +return gen6_ppgtt_pin (i915_vm_to_ppgtt (vm), ww);return 0 ; }
drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c +76 -64
303 lines not on this page · raw message
drivers/gpu/drm/i915/gt/gen6_ppgtt.c +2 -2
@@ -376,7 +376,7 @@ static struct i915_vma *pd_vma_create(struct gen6_ppgtt *ppgtt, int size)return vma; } -int gen6_ppgtt_pin (struct i915_ppgtt *base) +int gen6_ppgtt_pin (struct i915_ppgtt *base,struct i915_gem_ww_ctx *ww) {struct gen6_ppgtt *ppgtt =to_gen6_ppgtt (base);int err;
@@ -402,7 +402,7 @@ int gen6_ppgtt_pin(struct i915_ppgtt *base)*/ err =0 ;if (!atomic_read (&ppgtt->pin_count)) - err =i915_ggtt_pin (ppgtt->vma,GEN6_PD_ALIGN ,PIN_HIGH ); + err =i915_ggtt_pin (ppgtt->vma, ww,GEN6_PD_ALIGN ,PIN_HIGH );if (!err)atomic_inc (&ppgtt->pin_count);mutex_unlock (&ppgtt->pin_mutex);
drivers/gpu/drm/i915/gt/gen6_ppgtt.h +3 -1
@@ -8,6 +8,8 @@#include "intel_gtt.h" +struct i915_gem_ww_ctx ; +struct gen6_ppgtt {struct i915_ppgtt base;
@@ -66,7 +68,7 @@ static inline struct gen6_ppgtt *to_gen6_ppgtt(struct i915_ppgtt *base) (pt =i915_pt_entry (pd, iter), true); \ ++iter) -int gen6_ppgtt_pin (struct i915_ppgtt *base); +int gen6_ppgtt_pin (struct i915_ppgtt *base,struct i915_gem_ww_ctx *ww);void gen6_ppgtt_unpin (struct i915_ppgtt *base);void gen6_ppgtt_unpin_all (struct i915_ppgtt *base);void gen6_ppgtt_enable (struct intel_gt *gt);
drivers/gpu/drm/i915/gt/intel_context.c +41 -24
148 lines not on this page · raw message
drivers/gpu/drm/i915/gt/intel_context.h +13 -0
@@ -25,6 +25,8 @@ ##__VA_ARGS__); \ }while (0 ) +struct i915_gem_ww_ctx; +void intel_context_init (struct intel_context *ce,struct intel_engine_cs *engine);void intel_context_fini (struct intel_context *ce);
@@ -81,6 +83,8 @@ static inline void intel_context_unlock_pinned(struct intel_context *ce) }int __intel_context_do_pin (struct intel_context *ce); +int __intel_context_do_pin_ww (struct intel_context *ce, +struct i915_gem_ww_ctx *ww);static inline bool intel_context_pin_if_active (struct intel_context *ce) {
@@ -95,6 +99,15 @@ static inline int intel_context_pin(struct intel_context *ce)return __intel_context_do_pin (ce); } +static inline int intel_context_pin_ww (struct intel_context *ce, +struct i915_gem_ww_ctx *ww) +{ +if (likely (intel_context_pin_if_active (ce))) +return 0 ; + +return __intel_context_do_pin_ww (ce, ww); +} +static inline void __intel_context_pin (struct intel_context *ce) {GEM_BUG_ON (!intel_context_is_pinned (ce));
drivers/gpu/drm/i915/gt/intel_context_types.h +2 -1
@@ -23,6 +23,7 @@DECLARE_EWMA (runtime,3 ,8 );struct i915_gem_context ; +struct i915_gem_ww_ctx ;struct i915_vma ;struct intel_context ;struct intel_ring ;
@@ -30,7 +31,7 @@ struct intel_ring;struct intel_context_ops {int (*alloc)(struct intel_context *ce); -int (*pre_pin)(struct intel_context *ce,void **vaddr); +int (*pre_pin)(struct intel_context *ce,struct i915_gem_ww_ctx *ww,void **vaddr);int (*pin)(struct intel_context *ce,void *vaddr);void (*unpin)(struct intel_context *ce);void (*post_unpin)(struct intel_context *ce);
drivers/gpu/drm/i915/gt/intel_engine_cs.c +1 -1
@@ -559,7 +559,7 @@ static int pin_ggtt_status_page(struct intel_engine_cs *engine,else flags =PIN_HIGH ; -return i915_ggtt_pin (vma,0 , flags); +return i915_ggtt_pin (vma,NULL ,0 , flags); }static int init_status_page (struct intel_engine_cs *engine)
drivers/gpu/drm/i915/gt/intel_gt.c +1 -1
@@ -348,7 +348,7 @@ static int intel_gt_init_scratch(struct intel_gt *gt, unsigned int size) goto err_unref; } - ret =i915_ggtt_pin (vma,0 ,PIN_HIGH ); + ret =i915_ggtt_pin (vma,NULL ,0 ,PIN_HIGH );if (ret) goto err_unref;
drivers/gpu/drm/i915/gt/intel_lrc.c +3 -2
@@ -3434,7 +3434,8 @@ __execlists_update_reg_state(const struct intel_context *ce, }static int -execlists_context_pre_pin (struct intel_context *ce,void **vaddr) +execlists_context_pre_pin (struct intel_context *ce, +struct i915_gem_ww_ctx *ww,void **vaddr) {GEM_BUG_ON (!ce->state);GEM_BUG_ON (!i915_vma_is_pinned (ce->state));
@@ -3853,7 +3854,7 @@ static int lrc_setup_wa_ctx(struct intel_engine_cs *engine) goto err; } - err =i915_ggtt_pin (vma,0 ,PIN_HIGH ); + err =i915_ggtt_pin (vma,NULL ,0 ,PIN_HIGH );if (err) goto err;
drivers/gpu/drm/i915/gt/intel_renderstate.c +1 -1
@@ -195,7 +195,7 @@ int intel_renderstate_init(struct intel_renderstate *so,i915_gem_ww_ctx_init (&so->ww, true); retry: - err =intel_context_pin (ce); + err =intel_context_pin_ww (ce, &so->ww);if (err) goto err_fini;
drivers/gpu/drm/i915/gt/intel_ring.c +8 -2
@@ -21,7 +21,13 @@ unsigned int intel_ring_update_space(struct intel_ring *ring)return space; } -int intel_ring_pin (struct intel_ring *ring) +void __intel_ring_pin (struct intel_ring *ring) +{ +GEM_BUG_ON (!atomic_read (&ring->pin_count)); +atomic_inc (&ring->pin_count); +} + +int intel_ring_pin (struct intel_ring *ring,struct i915_gem_ww_ctx *ww) {struct i915_vma *vma = ring->vma;unsigned int flags;
@@ -39,7 +45,7 @@ int intel_ring_pin(struct intel_ring *ring)else flags |=PIN_HIGH ; - ret =i915_ggtt_pin (vma,0 , flags); + ret =i915_ggtt_pin (vma, ww,0 , flags);if (unlikely (ret)) goto err_unpin;
drivers/gpu/drm/i915/gt/intel_ring.h +2 -1
@@ -21,7 +21,8 @@ int intel_ring_cacheline_align(struct i915_request *rq);unsigned int intel_ring_update_space (struct intel_ring *ring); -int intel_ring_pin (struct intel_ring *ring); +void __intel_ring_pin (struct intel_ring *ring); +int intel_ring_pin (struct intel_ring *ring,struct i915_gem_ww_ctx *ww);void intel_ring_unpin (struct intel_ring *ring);void intel_ring_reset (struct intel_ring *ring,u32 tail);
drivers/gpu/drm/i915/gt/intel_ring_submission.c +6 -9
@@ -474,14 +474,16 @@ static void ring_context_destroy(struct kref *ref)intel_context_free (ce); } -static int __context_pin_ppgtt (struct intel_context *ce) +static int ring_context_pre_pin (struct intel_context *ce, +struct i915_gem_ww_ctx *ww, +void **unused) {struct i915_address_space *vm;int err =0 ; vm =vm_alias (ce->vm);if (vm) - err =gen6_ppgtt_pin (i915_vm_to_ppgtt ((vm))); + err =gen6_ppgtt_pin (i915_vm_to_ppgtt ((vm)), ww);return err; }
@@ -588,11 +590,6 @@ static int ring_context_alloc(struct intel_context *ce)return 0 ; } -static int ring_context_pre_pin (struct intel_context *ce,void **unused) -{ -return __context_pin_ppgtt (ce); -} -static int ring_context_pin (struct intel_context *ce,void *unused) {return 0 ;
@@ -1268,7 +1265,7 @@ int intel_ring_submission_setup(struct intel_engine_cs *engine) }GEM_BUG_ON (timeline->has_initial_breadcrumb); - err =intel_timeline_pin (timeline); + err =intel_timeline_pin (timeline,NULL );if (err) goto err_timeline;
@@ -1278,7 +1275,7 @@ int intel_ring_submission_setup(struct intel_engine_cs *engine) goto err_timeline_unpin; } - err =intel_ring_pin (ring); + err =intel_ring_pin (ring,NULL );if (err) goto err_ring;
drivers/gpu/drm/i915/gt/intel_timeline.c +9 -3
@@ -313,14 +313,20 @@ intel_timeline_create(struct intel_gt *gt, struct i915_vma *global_hwsp)return timeline; } -int intel_timeline_pin (struct intel_timeline *tl) +void __intel_timeline_pin (struct intel_timeline *tl) +{ +GEM_BUG_ON (!atomic_read (&tl->pin_count)); +atomic_inc (&tl->pin_count); +} + +int intel_timeline_pin (struct intel_timeline *tl,struct i915_gem_ww_ctx *ww) {int err;if (atomic_add_unless (&tl->pin_count,1 ,0 ))return 0 ; - err =i915_ggtt_pin (tl->hwsp_ggtt,0 ,PIN_HIGH ); + err =i915_ggtt_pin (tl->hwsp_ggtt, ww,0 ,PIN_HIGH );if (err)return err;
@@ -460,7 +466,7 @@ __intel_timeline_get_seqno(struct intel_timeline *tl, goto err_rollback; } - err =i915_ggtt_pin (vma,0 ,PIN_HIGH ); + err =i915_ggtt_pin (vma,NULL ,0 ,PIN_HIGH );if (err) {__idle_hwsp_free (vma->private, cacheline); goto err_rollback;
drivers/gpu/drm/i915/gt/intel_timeline.h +2 -1
@@ -71,7 +71,8 @@ static inline bool intel_timeline_sync_is_later(struct intel_timeline *tl,return __intel_timeline_sync_is_later (tl, fence->context, fence->seqno); } -int intel_timeline_pin (struct intel_timeline *tl); +void __intel_timeline_pin (struct intel_timeline *tl); +int intel_timeline_pin (struct intel_timeline *tl,struct i915_gem_ww_ctx *ww);void intel_timeline_enter (struct intel_timeline *tl); int intel_timeline_get_seqno(struct intel_timeline *tl, struct i915_request *rq,
drivers/gpu/drm/i915/gt/mock_engine.c +2 -1
@@ -168,7 +168,8 @@ static int mock_context_alloc(struct intel_context *ce)return 0 ; } -static int mock_context_pre_pin (struct intel_context *ce,void **unused) +static int mock_context_pre_pin (struct intel_context *ce, +struct i915_gem_ww_ctx *ww,void **unused) {return 0 ; }
drivers/gpu/drm/i915/gt/selftest_lrc.c +1 -1
@@ -2989,7 +2989,7 @@ static struct i915_vma *create_global(struct intel_gt *gt, size_t sz)return vma; } - err =i915_ggtt_pin (vma,0 ,0 ); + err =i915_ggtt_pin (vma,NULL ,0 ,0 );if (err) {i915_vma_put (vma);return ERR_PTR (err);
drivers/gpu/drm/i915/gt/selftest_timeline.c +2 -2
@@ -454,7 +454,7 @@ tl_write(struct intel_timeline *tl, struct intel_engine_cs *engine, u32 value)struct i915_request *rq;int err; - err =intel_timeline_pin (tl); + err =intel_timeline_pin (tl,NULL );if (err) { rq =ERR_PTR (err); goto out;
@@ -664,7 +664,7 @@ static int live_hwsp_wrap(void *arg)if (!tl->has_initial_breadcrumb || !tl->hwsp_cacheline) goto out_free; - err =intel_timeline_pin (tl); + err =intel_timeline_pin (tl,NULL );if (err) goto out_free;
drivers/gpu/drm/i915/gt/uc/intel_guc.c +1 -1
@@ -677,7 +677,7 @@ struct i915_vma *intel_guc_allocate_vma(struct intel_guc *guc, u32 size) goto err; flags =PIN_OFFSET_BIAS |i915_ggtt_pin_bias (vma); - ret =i915_ggtt_pin (vma,0 , flags); + ret =i915_ggtt_pin (vma,NULL ,0 , flags);if (ret) { vma =ERR_PTR (ret); goto err;
drivers/gpu/drm/i915/i915_drv.h +10 -3
@@ -1757,11 +1757,18 @@ static inline void i915_gem_drain_workqueue(struct drm_i915_private *i915) }struct i915_vma *__must_check +i915_gem_object_ggtt_pin_ww (struct drm_i915_gem_object *obj, +struct i915_gem_ww_ctx *ww, +const struct i915_ggtt_view *view, +u64 size,u64 alignment,u64 flags); + +static inline struct i915_vma *__must_check i915_gem_object_ggtt_pin (struct drm_i915_gem_object *obj,const struct i915_ggtt_view *view, -u64 size, -u64 alignment, -u64 flags); +u64 size,u64 alignment,u64 flags) +{ +return i915_gem_object_ggtt_pin_ww (obj,NULL , view, size, alignment, flags); +}int i915_gem_object_unbind (struct drm_i915_gem_object *obj,unsigned long flags);
drivers/gpu/drm/i915/i915_gem.c +5 -6
@@ -950,11 +950,10 @@ void i915_gem_runtime_suspend(struct drm_i915_private *i915) }struct i915_vma * -i915_gem_object_ggtt_pin (struct drm_i915_gem_object *obj, -const struct i915_ggtt_view *view, -u64 size, -u64 alignment, -u64 flags) +i915_gem_object_ggtt_pin_ww (struct drm_i915_gem_object *obj, +struct i915_gem_ww_ctx *ww, +const struct i915_ggtt_view *view, +u64 size,u64 alignment,u64 flags) {struct drm_i915_private *i915 =to_i915 (obj->base.dev);struct i915_ggtt *ggtt = &i915->ggtt;
@@ -1014,7 +1013,7 @@ i915_gem_object_ggtt_pin(struct drm_i915_gem_object *obj,return ERR_PTR (ret); } - ret =i915_vma_pin (vma, size, alignment, flags |PIN_GLOBAL ); + ret =i915_vma_pin_ww (vma, ww, size, alignment, flags |PIN_GLOBAL );if (ret)return ERR_PTR (ret);
drivers/gpu/drm/i915/i915_vma.c +10 -3
@@ -856,13 +856,19 @@ static void vma_unbind_pages(struct i915_vma *vma)__vma_put_pages (vma, count | count <<I915_VMA_PAGES_BIAS ); } -int i915_vma_pin (struct i915_vma *vma,u64 size,u64 alignment,u64 flags) +int i915_vma_pin_ww (struct i915_vma *vma,struct i915_gem_ww_ctx *ww, +u64 size,u64 alignment,u64 flags) {struct i915_vma_work *work =NULL ;intel_wakeref_t wakeref =0 ;unsigned int bound;int err; +#ifdef CONFIG_PROVE_LOCKING +if (debug_locks &&lockdep_is_held (&vma->vm->i915->drm.struct_mutex)) +WARN_ON (!ww); +#endif +BUILD_BUG_ON (PIN_GLOBAL !=I915_VMA_GLOBAL_BIND );BUILD_BUG_ON (PIN_USER !=I915_VMA_LOCAL_BIND );
@@ -992,7 +998,8 @@ static void flush_idle_contexts(struct intel_gt *gt)intel_gt_wait_for_idle (gt,MAX_SCHEDULE_TIMEOUT ); } -int i915_ggtt_pin (struct i915_vma *vma,u32 align,unsigned int flags) +int i915_ggtt_pin (struct i915_vma *vma,struct i915_gem_ww_ctx *ww, +u32 align,unsigned int flags) {struct i915_address_space *vm = vma->vm;int err;
@@ -1000,7 +1007,7 @@ int i915_ggtt_pin(struct i915_vma *vma, u32 align, unsigned int flags)GEM_BUG_ON (!i915_vma_is_ggtt (vma)); do { - err = i915_vma_pin(vma, 0, align, flags | PIN_GLOBAL); + err = i915_vma_pin_ww(vma, ww, 0, align, flags | PIN_GLOBAL); if (err != -ENOSPC) { if (!err) { err = i915_vma_wait_for_bind(vma);
drivers/gpu/drm/i915/i915_vma.h +11 -2
@@ -237,8 +237,17 @@ static inline void i915_vma_unlock(struct i915_vma *vma) }int __must_check -i915_vma_pin (struct i915_vma *vma,u64 size,u64 alignment,u64 flags); -int i915_ggtt_pin (struct i915_vma *vma,u32 align,unsigned int flags); +i915_vma_pin_ww (struct i915_vma *vma,struct i915_gem_ww_ctx *ww, +u64 size,u64 alignment,u64 flags); + +static inline int __must_check +i915_vma_pin (struct i915_vma *vma,u64 size,u64 alignment,u64 flags) +{ +return i915_vma_pin_ww (vma,NULL , size, alignment, flags); +} + +int i915_ggtt_pin (struct i915_vma *vma,struct i915_gem_ww_ctx *ww, +u32 align,unsigned int flags);static inline int i915_vma_pin_count (const struct i915_vma *vma) {
Signature · 6 lines
2.26.2 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 14/24 drm/i915: Convert i915_gem_object/client_blt.c to use ww locking as well, v2.
In reply to Maarten LankhorstThis is the last part outside of selftests that still don't use the correct lock ordering of timeline->mutex vs resv_lock.
With gem fixed, there are a few places that still get locking wrong:
- gvt/scheduler.c
- i915_perf.c
- Most if not all selftests.
Changes since v1:
- Add intel_engine_pm_get/put() calls to fix use-after-free when using intel_engine_get_pool().
--- .../gpu/drm/i915/gem/i915_gem_client_blt.c | 78 +++++++-- .../gpu/drm/i915/gem/i915_gem_object_blt.c | 157 +++++++++++------- .../gpu/drm/i915/gem/i915_gem_object_blt.h | 3 + 3 files changed, 164 insertions(+), 74 deletions(-)
drivers/gpu/drm/i915/gem/i915_gem_client_blt.c +61 -17
@@ -156,6 +156,7 @@ static void clear_pages_worker(struct work_struct *work)struct clear_pages_work *w =container_of (work,typeof (*w), work);struct drm_i915_gem_object *obj = w->sleeve->vma->obj;struct i915_vma *vma = w->sleeve->vma; +struct i915_gem_ww_ctx ww;struct i915_request *rq;struct i915_vma *batch;int err = w->dma.error;
@@ -171,17 +172,20 @@ static void clear_pages_worker(struct work_struct *work) obj->read_domains =I915_GEM_GPU_DOMAINS ; obj->write_domain =0 ; - err =i915_vma_pin (vma,0 ,0 ,PIN_USER ); -if (unlikely (err)) +i915_gem_ww_ctx_init (&ww, false); +intel_engine_pm_get (w->ce->engine); +retry: + err =intel_context_pin_ww (w->ce, &ww); +if (err) goto out_signal; - batch =intel_emit_vma_fill_blt (w->ce, vma, w->value); + batch =intel_emit_vma_fill_blt (w->ce, vma, &ww, w->value);if (IS_ERR (batch)) { err =PTR_ERR (batch); - goto out_unpin; + goto out_ctx; } - rq =intel_context_create_request (w->ce); + rq =i915_request_create (w->ce);if (IS_ERR (rq)) { err =PTR_ERR (rq); goto out_batch;
@@ -223,9 +227,19 @@ static void clear_pages_worker(struct work_struct *work)i915_request_add (rq); out_batch:intel_emit_vma_release (w->ce, batch); -out_unpin: -i915_vma_unpin (vma); +out_ctx: +intel_context_unpin (w->ce); out_signal: +if (err == -EDEADLK ) { + err =i915_gem_ww_ctx_backoff (&ww); +if (!err) + goto retry; + } +i915_gem_ww_ctx_fini (&ww); + +i915_vma_unpin (w->sleeve->vma); +intel_engine_pm_put (w->ce->engine); +if (unlikely (err)) {dma_fence_set_error (&w->dma, err);dma_fence_signal (&w->dma);
@@ -233,6 +247,44 @@ static void clear_pages_worker(struct work_struct *work) } } +static int pin_wait_clear_pages_work (struct clear_pages_work *w, +struct intel_context *ce) +{ +struct i915_vma *vma = w->sleeve->vma; +struct i915_gem_ww_ctx ww; +int err; + +i915_gem_ww_ctx_init (&ww, false); +retry: + err =i915_gem_object_lock (vma->obj, &ww); +if (err) + goto out; + + err =i915_vma_pin_ww (vma, &ww,0 ,0 ,PIN_USER ); +if (unlikely (err)) + goto out; + + err =i915_sw_fence_await_reservation (&w->wait, + vma->obj->base.resv,NULL , + true,0 ,I915_FENCE_GFP ); +if (err) + goto err_unpin_vma; + +dma_resv_add_excl_fence (vma->obj->base.resv, &w->dma); + +err_unpin_vma: +if (err) +i915_vma_unpin (vma); +out: +if (err == -EDEADLK ) { + err =i915_gem_ww_ctx_backoff (&ww); +if (!err) + goto retry; + } +i915_gem_ww_ctx_fini (&ww); +return err; +} + static int __i915_sw_fence_callclear_pages_work_notify (struct i915_sw_fence *fence,enum i915_sw_fence_notify state)
@@ -286,17 +338,9 @@ int i915_gem_schedule_fill_pages_blt(struct drm_i915_gem_object *obj,dma_fence_init (&work->dma, &clear_pages_work_ops, &fence_lock,0 ,0 );i915_sw_fence_init (&work->wait, clear_pages_work_notify); -i915_gem_object_lock (obj,NULL ); - err =i915_sw_fence_await_reservation (&work->wait, - obj->base.resv,NULL , true,0 , -I915_FENCE_GFP ); -if (err <0 ) { + err =pin_wait_clear_pages_work (work, ce); +if (err <0 )dma_fence_set_error (&work->dma, err); - }else { -dma_resv_add_excl_fence (obj->base.resv, &work->dma); - err =0 ; - } -i915_gem_object_unlock (obj);dma_fence_get (&work->dma);i915_sw_fence_commit (&work->wait);
drivers/gpu/drm/i915/gem/i915_gem_object_blt.c +100 -57
305 lines not on this page · raw message
drivers/gpu/drm/i915/gem/i915_gem_object_blt.h +3 -0
@@ -13,12 +13,15 @@#include "i915_vma.h" struct drm_i915_gem_object ; +struct i915_gem_ww_ctx ;struct i915_vma *intel_emit_vma_fill_blt (struct intel_context *ce,struct i915_vma *vma, +struct i915_gem_ww_ctx *ww,u32 value);struct i915_vma *intel_emit_vma_copy_blt (struct intel_context *ce, +struct i915_gem_ww_ctx *ww,struct i915_vma *src,struct i915_vma *dst);
Signature · 6 lines
2.26.2 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 15/24 drm/i915: Kill last user of intel_context_create_request outside of selftests
In reply to Maarten LankhorstInstead of using intel_context_create_request(), use intel_context_pin() and i915_create_request directly.
Now all those calls are gone outside of selftests. :)
--- drivers/gpu/drm/i915/gt/intel_workarounds.c | 43 ++++++++++++++------- 1 file changed, 29 insertions(+), 14 deletions(-)
drivers/gpu/drm/i915/gt/intel_workarounds.c +29 -14
@@ -1769,6 +1769,7 @@ static int engine_wa_list_verify(struct intel_context *ce,const struct i915_wa *wa;struct i915_request *rq;struct i915_vma *vma; +struct i915_gem_ww_ctx ww;unsigned int i;u32 *results;int err;
@@ -1781,29 +1782,34 @@ static int engine_wa_list_verify(struct intel_context *ce,return PTR_ERR (vma);intel_engine_pm_get (ce->engine); - rq =intel_context_create_request (ce); -intel_engine_pm_put (ce->engine); +i915_gem_ww_ctx_init (&ww, false); +retry: + err =i915_gem_object_lock (vma->obj, &ww); +if (err ==0 ) + err =intel_context_pin_ww (ce, &ww); +if (err) + goto err_pm; + + rq =i915_request_create (ce);if (IS_ERR (rq)) { err =PTR_ERR (rq); - goto err_vma; + goto err_unpin; } -i915_vma_lock (vma); err =i915_request_await_object (rq, vma->obj, true);if (err ==0 ) err =i915_vma_move_to_active (vma, rq,EXEC_OBJECT_WRITE ); -i915_vma_unlock (vma); -if (err) { -i915_request_add (rq); - goto err_vma; - } - - err =wa_list_srm (rq, wal, vma); -if (err) - goto err_vma; +if (err ==0 ) + err =wa_list_srm (rq, wal, vma);i915_request_get (rq); +if (err) +i915_request_set_error_once (rq, err);i915_request_add (rq); + +if (err) + goto err_rq; +if (i915_request_wait (rq,0 ,HZ /5 ) <0 ) { err = -ETIME ; goto err_rq;
@@ -1828,7 +1834,16 @@ static int engine_wa_list_verify(struct intel_context *ce, err_rq:i915_request_put (rq); -err_vma: +err_unpin: +intel_context_unpin (ce); +err_pm: +if (err == -EDEADLK ) { + err =i915_gem_ww_ctx_backoff (&ww); +if (!err) + goto retry; + } +i915_gem_ww_ctx_fini (&ww); +intel_engine_pm_put (ce->engine);i915_vma_unpin (vma);i915_vma_put (vma);return err;
Signature · 6 lines
2.26.2 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 16/24 drm/i915: Convert i915_perf to ww locking as well
In reply to Maarten LankhorstWe have the ordering of timeline->mutex vs resv_lock wrong, convert the i915_pin_vma and intel_context_pin as well to future-proof this.
We may need to do future changes to do this more transaction-like, and only get down to a single i915_gem_ww_ctx, but for now this should work.
--- drivers/gpu/drm/i915/i915_perf.c | 57 +++++++++++++++++++++++--------- 1 file changed, 42 insertions(+), 15 deletions(-)
drivers/gpu/drm/i915/i915_perf.c +42 -15
@@ -1195,24 +1195,39 @@ static struct intel_context *oa_pin_context(struct i915_perf_stream *stream)struct i915_gem_engines_iter it;struct i915_gem_context *ctx = stream->ctx;struct intel_context *ce; -int err; +struct i915_gem_ww_ctx ww; +int err = -ENODEV ;for_each_gem_engine (ce,i915_gem_context_lock_engines (ctx), it) {if (ce->engine != stream->engine)/* first match! */ continue ; -/* -* As the ID is the gtt offset of the context's vma we -* pin the vma to ensure the ID remains fixed. -*/ - err =intel_context_pin (ce); -if (err ==0 ) { - stream->pinned_ctx = ce; -break ; - } + err =0 ; +break ; }i915_gem_context_unlock_engines (ctx); +if (err) +return ERR_PTR (err); + +i915_gem_ww_ctx_init (&ww, true); +retry: +/* +* As the ID is the gtt offset of the context's vma we +* pin the vma to ensure the ID remains fixed. +*/ + err =intel_context_pin_ww (ce, &ww); +if (err == -EDEADLK ) { + err =i915_gem_ww_ctx_backoff (&ww); +if (!err) + goto retry; + } +i915_gem_ww_ctx_fini (&ww); + +if (err) +return ERR_PTR (err); + + stream->pinned_ctx = ce;return stream->pinned_ctx; }
@@ -1922,15 +1937,22 @@ emit_oa_config(struct i915_perf_stream *stream, {struct i915_request *rq;struct i915_vma *vma; +struct i915_gem_ww_ctx ww;int err; vma =get_oa_vma (stream, oa_config);if (IS_ERR (vma))return PTR_ERR (vma); - err =i915_vma_pin (vma,0 ,0 ,PIN_GLOBAL |PIN_HIGH ); +i915_gem_ww_ctx_init (&ww, true); +retry: + err =i915_gem_object_lock (vma->obj, &ww); +if (err) + goto err; + + err =i915_vma_pin_ww (vma, &ww,0 ,0 ,PIN_GLOBAL |PIN_HIGH );if (err) - goto err_vma_put; + goto err;intel_engine_pm_get (ce->engine); rq =i915_request_create (ce);
@@ -1952,11 +1974,9 @@ emit_oa_config(struct i915_perf_stream *stream, goto err_add_request; } -i915_vma_lock (vma); err =i915_request_await_object (rq, vma->obj,0 );if (!err) err =i915_vma_move_to_active (vma, rq,0 ); -i915_vma_unlock (vma);if (err) goto err_add_request;
@@ -1970,7 +1990,14 @@ emit_oa_config(struct i915_perf_stream *stream,i915_request_add (rq); err_vma_unpin:i915_vma_unpin (vma); -err_vma_put: +err: +if (err == -EDEADLK ) { + err =i915_gem_ww_ctx_backoff (&ww); +if (!err) + goto retry; + } + +i915_gem_ww_ctx_fini (&ww);i915_vma_put (vma);return err; }
Signature · 6 lines
2.26.2 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 17/24 drm/i915: Dirty hack to fix selftests locking inversion
In reply to Maarten LankhorstSome i915 selftests still use i915_vma_lock() as inner lock, and intel_context_create_request() intel_timeline->mutex as outer lock. Fortunately for selftests this is not an issue, they should be fixed but we can move ahead and cleanify lockdep now.
--- drivers/gpu/drm/i915/gt/intel_context.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)
drivers/gpu/drm/i915/gt/intel_context.c +12 -0
@@ -459,6 +459,18 @@ struct i915_request *intel_context_create_request(struct intel_context *ce) rq =i915_request_create (ce);intel_context_unpin (ce); +if (IS_ERR (rq)) +return rq; + +/* +* timeline->mutex should be the inner lock, but is used as outer lock. +* Hack around this to shut up lockdep in selftests.. +*/ +lockdep_unpin_lock (&ce->timeline->mutex, rq->cookie); +mutex_release (&ce->timeline->mutex.dep_map, _RET_IP_); +mutex_acquire (&ce->timeline->mutex.dep_map,SINGLE_DEPTH_NESTING ,0 , _RET_IP_); + rq->cookie =lockdep_pin_lock (&ce->timeline->mutex); +return rq; }
Signature · 6 lines
2.26.2 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 18/24 drm/i915/selftests: Fix locking inversion in lrc selftest.
In reply to Maarten LankhorstThis function does not use intel_context_create_request, so it has to use the same locking order as normal code. This is required to shut up lockdep in selftests.
--- drivers/gpu/drm/i915/gt/selftest_lrc.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-)
drivers/gpu/drm/i915/gt/selftest_lrc.c +12 -3
@@ -4910,6 +4910,7 @@ static int __live_lrc_state(struct intel_engine_cs *engine, {struct intel_context *ce;struct i915_request *rq; +struct i915_gem_ww_ctx ww;enum {RING_START_IDX =0 ,RING_TAIL_IDX ,
@@ -4924,7 +4925,11 @@ static int __live_lrc_state(struct intel_engine_cs *engine,if (IS_ERR (ce))return PTR_ERR (ce); - err =intel_context_pin (ce); +i915_gem_ww_ctx_init (&ww, false); +retry: + err =i915_gem_object_lock (scratch->obj, &ww); +if (!err) + err =intel_context_pin_ww (ce, &ww);if (err) goto err_put;
@@ -4953,11 +4958,9 @@ static int __live_lrc_state(struct intel_engine_cs *engine, *cs++ =i915_ggtt_offset (scratch) +RING_TAIL_IDX *sizeof (u32); *cs++ =0 ; -i915_vma_lock (scratch); err =i915_request_await_object (rq, scratch->obj, true);if (!err) err =i915_vma_move_to_active (scratch, rq,EXEC_OBJECT_WRITE ); -i915_vma_unlock (scratch);i915_request_get (rq);i915_request_add (rq);
@@ -4994,6 +4997,12 @@ static int __live_lrc_state(struct intel_engine_cs *engine, err_unpin:intel_context_unpin (ce); err_put: +if (err == -EDEADLK ) { + err =i915_gem_ww_ctx_backoff (&ww); +if (!err) + goto retry; + } +i915_gem_ww_ctx_fini (&ww);intel_context_put (ce);return err; }
Signature · 6 lines
2.26.2 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 19/24 drm/i915: Use ww pinning for intel_context_create_request()
In reply to Maarten LankhorstWe want to get rid of intel_context_pin(), convert intel_context_create_request() first. :)
--- drivers/gpu/drm/i915/gt/intel_context.c | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-)
drivers/gpu/drm/i915/gt/intel_context.c +15 -5
@@ -449,15 +449,25 @@ int intel_context_prepare_remote_request(struct intel_context *ce,struct i915_request *intel_context_create_request (struct intel_context *ce) { +struct i915_gem_ww_ctx ww;struct i915_request *rq;int err; - err =intel_context_pin (ce); -if (unlikely (err)) -return ERR_PTR (err); +i915_gem_ww_ctx_init (&ww, true); +retry: + err =intel_context_pin_ww (ce, &ww); +if (!err) { + rq =i915_request_create (ce); +intel_context_unpin (ce); + }else if (err == -EDEADLK ) { + err =i915_gem_ww_ctx_backoff (&ww); +if (!err) + goto retry; + }else { + rq =ERR_PTR (err); + } - rq =i915_request_create (ce); -intel_context_unpin (ce); +i915_gem_ww_ctx_fini (&ww);if (IS_ERR (rq))return rq;
Signature · 6 lines
2.26.2 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 20/24 drm/i915: Move i915_vma_lock in the selftests to avoid lock inversion, v2.
In reply to Maarten LankhorstMake sure vma_lock is not used as inner lock when kernel context is used, and add ww handling where appropriate.
Ensure that execbuf selftests keep passing by using ww handling.
--- .../i915/gem/selftests/i915_gem_coherency.c | 26 ++++++------ .../i915/gem/selftests/i915_gem_execbuffer.c | 26 +++++++++--- .../drm/i915/gem/selftests/i915_gem_mman.c | 41 ++++++++++++++----- drivers/gpu/drm/i915/gt/selftest_rps.c | 30 ++++++++------ drivers/gpu/drm/i915/selftests/i915_request.c | 18 +++++--- 5 files changed, 95 insertions(+), 46 deletions(-)
drivers/gpu/drm/i915/gem/selftests/i915_gem_coherency.c +14 -12
@@ -201,25 +201,25 @@ static int gpu_set(struct context *ctx, unsigned long offset, u32 v)i915_gem_object_lock (ctx->obj,NULL ); err =i915_gem_object_set_to_gtt_domain (ctx->obj, true); -i915_gem_object_unlock (ctx->obj);if (err) -return err; + goto out_unlock; vma =i915_gem_object_ggtt_pin (ctx->obj,NULL ,0 ,0 ,0 ); -if (IS_ERR (vma)) -return PTR_ERR (vma); +if (IS_ERR (vma)) { + err =PTR_ERR (vma); + goto out_unlock; + } rq =intel_engine_create_kernel_request (ctx->engine);if (IS_ERR (rq)) { -i915_vma_unpin (vma); -return PTR_ERR (rq); + err =PTR_ERR (rq); + goto out_unpin; } cs =intel_ring_begin (rq,4 );if (IS_ERR (cs)) { -i915_request_add (rq); -i915_vma_unpin (vma); -return PTR_ERR (cs); + err =PTR_ERR (cs); + goto out_rq; }if (INTEL_GEN (ctx->engine->i915) >=8 ) {
@@ -240,14 +240,16 @@ static int gpu_set(struct context *ctx, unsigned long offset, u32 v) }intel_ring_advance (rq, cs); -i915_vma_lock (vma); err =i915_request_await_object (rq, vma->obj, true);if (err ==0 ) err =i915_vma_move_to_active (vma, rq,EXEC_OBJECT_WRITE ); -i915_vma_unlock (vma); -i915_vma_unpin (vma); +out_rq:i915_request_add (rq); +out_unpin: +i915_vma_unpin (vma); +out_unlock: +i915_gem_object_unlock (ctx->obj);return err; }
drivers/gpu/drm/i915/gem/selftests/i915_gem_execbuffer.c +20 -6
@@ -124,6 +124,8 @@ static int igt_gpu_reloc(void *arg) goto err_scratch; } +intel_gt_pm_get (&eb.i915->gt); +for_each_uabi_engine (eb.engine, eb.i915) {reloc_cache_init (&eb.reloc_cache, eb.i915);memset (map,POISON_INUSE ,4096 );
@@ -134,15 +136,26 @@ static int igt_gpu_reloc(void *arg) err =PTR_ERR (eb.context); goto err_pm; } + eb.reloc_pool =NULL ; - err =intel_context_pin (eb.context); -if (err) - goto err_put; +i915_gem_ww_ctx_init (&eb.ww, false); +retry: + err =intel_context_pin_ww (eb.context, &eb.ww); +if (!err) { + err =__igt_gpu_reloc (&eb, scratch); + +intel_context_unpin (eb.context); + } +if (err == -EDEADLK ) { + err =i915_gem_ww_ctx_backoff (&eb.ww); +if (!err) + goto retry; + } +i915_gem_ww_ctx_fini (&eb.ww); - err =__igt_gpu_reloc (&eb, scratch); +if (eb.reloc_pool) +intel_gt_buffer_pool_put (eb.reloc_pool); -intel_context_unpin (eb.context); -err_put:intel_context_put (eb.context); err_pm:intel_engine_pm_put (eb.engine);
@@ -153,6 +166,7 @@ static int igt_gpu_reloc(void *arg)if (igt_flush_test (eb.i915)) err = -EIO ; +intel_gt_pm_put (&eb.i915->gt); err_scratch:i915_gem_object_put (scratch);return err;
drivers/gpu/drm/i915/gem/selftests/i915_gem_mman.c +31 -10
94 lines not on this page · raw message
drivers/gpu/drm/i915/gt/selftest_rps.c +18 -12
@@ -92,20 +92,20 @@ create_spin_counter(struct intel_engine_cs *engine, vma =i915_vma_instance (obj, vm,NULL );if (IS_ERR (vma)) { -i915_gem_object_put (obj); -return vma; + err =PTR_ERR (vma); + goto err_put; } err =i915_vma_pin (vma,0 ,0 ,PIN_USER ); -if (err) { -i915_vma_put (vma); -return ERR_PTR (err); - } +if (err) + goto err_unlock; + +i915_vma_lock (vma); base =i915_gem_object_pin_map (obj,I915_MAP_WC );if (IS_ERR (base)) { -i915_gem_object_put (obj); -return ERR_CAST (base); + err =PTR_ERR (base); + goto err_unpin; } cs = base;
@@ -149,6 +149,14 @@ create_spin_counter(struct intel_engine_cs *engine, *cancel = base + loop; *counter = srm ?memset32 (base + end,0 ,1 ) :NULL ;return vma; + +err_unpin: +i915_vma_unpin (vma); +err_unlock: +i915_vma_unlock (vma); +err_put: +i915_gem_object_put (obj); +return ERR_PTR (err); }static u8 wait_for_freq (struct intel_rps *rps,u8 freq,int timeout_ms)
@@ -654,7 +662,6 @@ int live_rps_frequency_cs(void *arg) goto err_vma; } -i915_vma_lock (vma); err =i915_request_await_object (rq, vma->obj, false);if (!err) err =i915_vma_move_to_active (vma, rq,0 );
@@ -662,7 +669,6 @@ int live_rps_frequency_cs(void *arg) err = rq->engine->emit_bb_start (rq, vma->node.start,PAGE_SIZE ,0 ); -i915_vma_unlock (vma);i915_request_add (rq);if (err) goto err_vma;
@@ -723,6 +729,7 @@ int live_rps_frequency_cs(void *arg)i915_gem_object_flush_map (vma->obj);i915_gem_object_unpin_map (vma->obj);i915_vma_unpin (vma); +i915_vma_unlock (vma);i915_vma_put (vma);engine_heartbeat_enable (engine);
@@ -796,7 +803,6 @@ int live_rps_frequency_srm(void *arg) goto err_vma; } -i915_vma_lock (vma); err =i915_request_await_object (rq, vma->obj, false);if (!err) err =i915_vma_move_to_active (vma, rq,0 );
@@ -804,7 +810,6 @@ int live_rps_frequency_srm(void *arg) err = rq->engine->emit_bb_start (rq, vma->node.start,PAGE_SIZE ,0 ); -i915_vma_unlock (vma);i915_request_add (rq);if (err) goto err_vma;
@@ -864,6 +869,7 @@ int live_rps_frequency_srm(void *arg)i915_gem_object_flush_map (vma->obj);i915_gem_object_unpin_map (vma->obj);i915_vma_unpin (vma); +i915_vma_unlock (vma);i915_vma_put (vma);engine_heartbeat_enable (engine);
drivers/gpu/drm/i915/selftests/i915_request.c +12 -6
@@ -861,6 +861,8 @@ static int live_all_engines(void *arg) goto out_free; } +i915_vma_lock (batch); + idx =0 ;for_each_uabi_engine (engine, i915) { request[idx] =intel_engine_create_kernel_request (engine);
@@ -871,11 +873,9 @@ static int live_all_engines(void *arg) goto out_request; } -i915_vma_lock (batch); err =i915_request_await_object (request[idx], batch->obj,0 );if (err ==0 ) err =i915_vma_move_to_active (batch, request[idx],0 ); -i915_vma_unlock (batch);GEM_BUG_ON (err); err = engine->emit_bb_start(request[idx],
@@ -890,6 +890,8 @@ static int live_all_engines(void *arg) idx++; } +i915_vma_unlock (batch); + idx =0 ;for_each_uabi_engine (engine, i915) {if (i915_request_completed (request[idx])) {
@@ -980,12 +982,13 @@ static int live_sequential_engines(void *arg) goto out_free; } +i915_vma_lock (batch); request[idx] =intel_engine_create_kernel_request (engine);if (IS_ERR (request[idx])) { err =PTR_ERR (request[idx]);pr_err ("%s: Request allocation failed for %s with err=%d\n" , __func__, engine->name, err); - goto out_request; + goto out_unlock; }if (prev) {
@@ -995,16 +998,14 @@ static int live_sequential_engines(void *arg)i915_request_add (request[idx]);pr_err ("%s: Request await failed for %s with err=%d\n" , __func__, engine->name, err); - goto out_request; + goto out_unlock; } } -i915_vma_lock (batch); err =i915_request_await_object (request[idx], batch->obj, false);if (err ==0 ) err =i915_vma_move_to_active (batch, request[idx],0 ); -i915_vma_unlock (batch);GEM_BUG_ON (err); err = engine->emit_bb_start(request[idx],
@@ -1019,6 +1020,11 @@ static int live_sequential_engines(void *arg) prev = request[idx]; idx++; + +out_unlock: +i915_vma_unlock (batch); +if (err) + goto out_request; } idx =0 ;
Signature · 6 lines
2.26.2 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 21/24 drm/i915: Add ww locking to vm_fault_gtt
In reply to Maarten Lankhorst--- drivers/gpu/drm/i915/gem/i915_gem_mman.c | 51 +++++++++++++++--------- 1 file changed, 33 insertions(+), 18 deletions(-)
drivers/gpu/drm/i915/gem/i915_gem_mman.c +33 -18
@@ -283,37 +283,46 @@ static vm_fault_t vm_fault_gtt(struct vm_fault *vmf)struct intel_runtime_pm *rpm = &i915->runtime_pm;struct i915_ggtt *ggtt = &i915->ggtt;bool write = area->vm_flags &VM_WRITE ; +struct i915_gem_ww_ctx ww;intel_wakeref_t wakeref;struct i915_vma *vma;pgoff_t page_offset;int srcu;int ret; -/* Sanity check that we allow writing into this object */ -if (i915_gem_object_is_readonly (obj) && write) -return VM_FAULT_SIGBUS ; -/* We don't use vmf->pgoff since that has the fake offset */ page_offset = (vmf->address - area->vm_start) >>PAGE_SHIFT ;trace_i915_gem_object_fault (obj, page_offset, true, write); - ret =i915_gem_object_pin_pages (obj); + wakeref =intel_runtime_pm_get (rpm); + +i915_gem_ww_ctx_init (&ww, true); +retry: + ret =i915_gem_object_lock (obj, &ww);if (ret) - goto err; + goto err_rpm; - wakeref =intel_runtime_pm_get (rpm); +/* Sanity check that we allow writing into this object */ +if (i915_gem_object_is_readonly (obj) && write) { + ret = -EFAULT ; + goto err_rpm; + } - ret =intel_gt_reset_trylock (ggtt->vm.gt, &srcu); + ret =i915_gem_object_pin_pages (obj);if (ret) goto err_rpm; + ret =intel_gt_reset_trylock (ggtt->vm.gt, &srcu); +if (ret) + goto err_pages; +/* Now pin it into the GTT as needed */ - vma =i915_gem_object_ggtt_pin (obj,NULL ,0 ,0 , -PIN_MAPPABLE | -PIN_NONBLOCK /* NOWARN */ | -PIN_NOEVICT ); -if (IS_ERR (vma)) { + vma =i915_gem_object_ggtt_pin_ww (obj, &ww,NULL ,0 ,0 , +PIN_MAPPABLE | +PIN_NONBLOCK /* NOWARN */ | +PIN_NOEVICT ); +if (IS_ERR (vma) && vma !=ERR_PTR (-EDEADLK )) {/* Use a partial view if it is bigger than available space */ struct i915_ggtt_view view =compute_partial_view (obj, page_offset,MIN_CHUNK_PAGES );
@@ -328,11 +337,11 @@ static vm_fault_t vm_fault_gtt(struct vm_fault *vmf)* all hope that the hardware is able to track future writes. */ - vma =i915_gem_object_ggtt_pin (obj, &view,0 ,0 , flags); -if (IS_ERR (vma)) { + vma =i915_gem_object_ggtt_pin_ww (obj, &ww, &view,0 ,0 , flags); +if (IS_ERR (vma) && vma !=ERR_PTR (-EDEADLK )) { flags =PIN_MAPPABLE ; view.type =I915_GGTT_VIEW_PARTIAL ; - vma =i915_gem_object_ggtt_pin (obj, &view,0 ,0 , flags); + vma =i915_gem_object_ggtt_pin_ww (obj, &ww, &view,0 ,0 , flags); }/* The entire mappable GGTT is pinned? Unexpected! */
@@ -389,10 +398,16 @@ static vm_fault_t vm_fault_gtt(struct vm_fault *vmf)__i915_vma_unpin (vma); err_reset:intel_gt_reset_unlock (ggtt->vm.gt, srcu); +err_pages: +i915_gem_object_unpin_pages (obj); err_rpm: +if (ret == -EDEADLK ) { + ret =i915_gem_ww_ctx_backoff (&ww); +if (!ret) + goto retry; + } +i915_gem_ww_ctx_fini (&ww);intel_runtime_pm_put (rpm, wakeref); -i915_gem_object_unpin_pages (obj); -err:return i915_error_to_vmf_fault (ret); }
Signature · 6 lines
2.26.2 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 22/24 drm/i915: Add ww locking to pin_to_display_plane
In reply to Maarten Lankhorst--- drivers/gpu/drm/i915/gem/i915_gem_domain.c | 65 ++++++++++++++++------ drivers/gpu/drm/i915/gem/i915_gem_object.h | 1 + 2 files changed, 49 insertions(+), 17 deletions(-)
drivers/gpu/drm/i915/gem/i915_gem_domain.c +48 -17
@@ -37,6 +37,12 @@ void i915_gem_object_flush_if_display(struct drm_i915_gem_object *obj)i915_gem_object_unlock (obj); } +void i915_gem_object_flush_if_display_locked (struct drm_i915_gem_object *obj) +{ +if (i915_gem_object_is_framebuffer (obj)) +__i915_gem_object_flush_for_display (obj); +} +/** * Moves a single object to the WC read, and possibly write domain. * @obj: object to act on
@@ -197,18 +203,12 @@ int i915_gem_object_set_cache_level(struct drm_i915_gem_object *obj,if (ret)return ret; - ret =i915_gem_object_lock_interruptible (obj,NULL ); -if (ret) -return ret; -/* Always invalidate stale cachelines */ if (obj->cache_level != cache_level) {i915_gem_object_set_cache_coherency (obj, cache_level); obj->cache_dirty = true; } -i915_gem_object_unlock (obj); -/* The cache-level will be applied when each vma is rebound. */ return i915_gem_object_unbind(obj, I915_GEM_OBJECT_UNBIND_ACTIVE |
@@ -255,6 +255,7 @@ int i915_gem_set_caching_ioctl(struct drm_device *dev, void *data,struct drm_i915_gem_caching *args = data;struct drm_i915_gem_object *obj;enum i915_cache_level level; +struct i915_gem_ww_ctx ww;int ret =0 ;switch (args->caching) {
@@ -293,7 +294,18 @@ int i915_gem_set_caching_ioctl(struct drm_device *dev, void *data, goto out; } - ret =i915_gem_object_set_cache_level (obj, level); +i915_gem_ww_ctx_init (&ww, true); +retry: + ret =i915_gem_object_lock (obj, &ww); +if (!ret) + ret =i915_gem_object_set_cache_level (obj, level); + +if (ret == -EDEADLK ) { + ret =i915_gem_ww_ctx_backoff (&ww); +if (!ret) + goto retry; + } +i915_gem_ww_ctx_fini (&ww); out:i915_gem_object_put (obj);
@@ -313,6 +325,7 @@ i915_gem_object_pin_to_display_plane(struct drm_i915_gem_object *obj, unsigned int flags) {struct drm_i915_private *i915 =to_i915 (obj->base.dev); +struct i915_gem_ww_ctx ww;struct i915_vma *vma;int ret;
@@ -320,6 +333,11 @@ i915_gem_object_pin_to_display_plane(struct drm_i915_gem_object *obj,if (HAS_LMEM (i915) && !i915_gem_object_is_lmem (obj))return ERR_PTR (-EINVAL ); +i915_gem_ww_ctx_init (&ww, true); +retry: + ret =i915_gem_object_lock (obj, &ww); +if (ret) + goto err;/* * The display engine is not coherent with the LLC cache on gen6. As * a result, we make sure that the pinning that is about to occur is
@@ -334,7 +352,7 @@ i915_gem_object_pin_to_display_plane(struct drm_i915_gem_object *obj,HAS_WT (i915) ? I915_CACHE_WT : I915_CACHE_NONE);if (ret) -return ERR_PTR (ret); + goto err;/* * As the user may map the buffer once pinned in the display plane
@@ -347,18 +365,31 @@ i915_gem_object_pin_to_display_plane(struct drm_i915_gem_object *obj, vma =ERR_PTR (-ENOSPC );if ((flags &PIN_MAPPABLE ) ==0 && (!view || view->type ==I915_GGTT_VIEW_NORMAL )) - vma =i915_gem_object_ggtt_pin (obj, view,0 , alignment, - flags | -PIN_MAPPABLE | -PIN_NONBLOCK ); -if (IS_ERR (vma)) - vma =i915_gem_object_ggtt_pin (obj, view,0 , alignment, flags); -if (IS_ERR (vma)) -return vma; + vma =i915_gem_object_ggtt_pin_ww (obj, &ww, view,0 , alignment, + flags |PIN_MAPPABLE | +PIN_NONBLOCK ); +if (IS_ERR (vma) && vma !=ERR_PTR (-EDEADLK )) + vma =i915_gem_object_ggtt_pin_ww (obj, &ww, view,0 , + alignment, flags); +if (IS_ERR (vma)) { + ret =PTR_ERR (vma); + goto err; + } vma->display_alignment =max_t (u64, vma->display_alignment, alignment); -i915_gem_object_flush_if_display (obj); +i915_gem_object_flush_if_display_locked (obj); + +err: +if (ret == -EDEADLK ) { + ret =i915_gem_ww_ctx_backoff (&ww); +if (!ret) + goto retry; + } +i915_gem_ww_ctx_fini (&ww); + +if (ret) +return ERR_PTR (ret);return vma; }
drivers/gpu/drm/i915/gem/i915_gem_object.h +1 -0
@@ -456,6 +456,7 @@ i915_gem_object_last_write_engine(struct drm_i915_gem_object *obj)void i915_gem_object_set_cache_coherency (struct drm_i915_gem_object *obj,unsigned int cache_level);void i915_gem_object_flush_if_display (struct drm_i915_gem_object *obj); +void i915_gem_object_flush_if_display_locked (struct drm_i915_gem_object *obj);int __must_check i915_gem_object_set_to_wc_domain (struct drm_i915_gem_object *obj,bool write);
Signature · 6 lines
2.26.2 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 23/24 drm/i915: Ensure we hold the pin mutex
In reply to Maarten Lankhorst--- drivers/gpu/drm/i915/gt/intel_renderstate.c | 2 +- drivers/gpu/drm/i915/i915_vma.c | 9 ++++++++- drivers/gpu/drm/i915/i915_vma.h | 3 +++ 3 files changed, 12 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/gt/intel_renderstate.c +1 -1
@@ -207,7 +207,7 @@ int intel_renderstate_init(struct intel_renderstate *so,if (err) goto err_context; - err =i915_vma_pin (so->vma,0 ,0 ,PIN_GLOBAL |PIN_HIGH ); + err =i915_vma_pin_ww (so->vma, &so->ww,0 ,0 ,PIN_GLOBAL |PIN_HIGH );if (err) goto err_context;
drivers/gpu/drm/i915/i915_vma.c +8 -1
@@ -867,6 +867,8 @@ int i915_vma_pin_ww(struct i915_vma *vma, struct i915_gem_ww_ctx *ww,#ifdef CONFIG_PROVE_LOCKING if (debug_locks &&lockdep_is_held (&vma->vm->i915->drm.struct_mutex))WARN_ON (!ww); +if (debug_locks && ww && vma->resv) +assert_vma_held (vma);#endif BUILD_BUG_ON (PIN_GLOBAL !=I915_VMA_GLOBAL_BIND );
@@ -1006,8 +1008,13 @@ int i915_ggtt_pin(struct i915_vma *vma, struct i915_gem_ww_ctx *ww,GEM_BUG_ON (!i915_vma_is_ggtt (vma)); +WARN_ON (!ww && vma->resv &&dma_resv_held (vma->resv)); + do { - err = i915_vma_pin_ww(vma, ww, 0, align, flags | PIN_GLOBAL); + if (ww) + err = i915_vma_pin_ww(vma, ww, 0, align, flags | PIN_GLOBAL); + else + err = i915_vma_pin(vma, 0, align, flags | PIN_GLOBAL); if (err != -ENOSPC) { if (!err) { err = i915_vma_wait_for_bind(vma);
drivers/gpu/drm/i915/i915_vma.h +3 -0
@@ -243,6 +243,9 @@ i915_vma_pin_ww(struct i915_vma *vma, struct i915_gem_ww_ctx *ww,static inline int __must_check i915_vma_pin (struct i915_vma *vma,u64 size,u64 alignment,u64 flags) { +#ifdef CONFIG_LOCKDEP +WARN_ON_ONCE (vma->resv &&dma_resv_held (vma->resv)); +#endif return i915_vma_pin_ww (vma,NULL , size, alignment, flags); }
Signature · 6 lines
2.26.2 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 24/24 drm/i915: Kill context before taking ctx->mutex
In reply to Maarten LankhorstKilling context before taking ctx->mutex fixes a hang in gem_ctx_persistence.close-replace-race, where lut_close takes obj->resv.lock which is already held by execbuf, causing a stalling indefinitely.
[ 1904.342847] 2 locks held by gem_ctx_persist/11520:
[ 1904.342849] #0: ffff8882188e4968 (&ctx->mutex){+.+.}-{3:3}, at: context_close+0xe6/0x850 [i915]
[ 1904.342941] #1: ffff88821c58a5a8 (reservation_ww_class_mutex){+.+.}-{3:3}, at: lut_close+0x2c2/0xba0 [i915]
[ 1904.343033] 3 locks held by gem_ctx_persist/11521:
[ 1904.343035] #0: ffffc900008ff938 (reservation_ww_class_acquire){+.+.}-{0:0}, at: i915_gem_do_execbuffer+0x103d/0x54c0 [i915]
[ 1904.343157] #1: ffff88821c58a5a8 (reservation_ww_class_mutex){+.+.}-{3:3}, at: eb_validate_vmas+0x602/0x2010 [i915]
[ 1904.343267] #2: ffff88820afd9200 (&vm->mutex/1){+.+.}-{3:3}, at: i915_vma_pin_ww+0x335/0x2300 [i915]--- drivers/gpu/drm/i915/gem/i915_gem_context.c | 24 ++++++++++----------- 1 file changed, 12 insertions(+), 12 deletions(-)
drivers/gpu/drm/i915/gem/i915_gem_context.c +12 -12
@@ -623,6 +623,18 @@ static void context_close(struct i915_gem_context *ctx)i915_gem_context_set_closed (ctx);mutex_unlock (&ctx->engines_mutex); +/* +* If the user has disabled hangchecking, we can not be sure that +* the batches will ever complete after the context is closed, +* keeping the context and all resources pinned forever. So in this +* case we opt to forcibly kill off all remaining requests on +* context close. +*/ +if (!i915_gem_context_is_persistent (ctx) || + !i915_modparams.enable_hangcheck) +kill_context (ctx); + +mutex_lock (&ctx->mutex);set_closed_name (ctx);
@@ -641,18 +653,6 @@ static void context_close(struct i915_gem_context *ctx)lut_close (ctx);mutex_unlock (&ctx->mutex); - -/* -* If the user has disabled hangchecking, we can not be sure that -* the batches will ever complete after the context is closed, -* keeping the context and all resources pinned forever. So in this -* case we opt to forcibly kill off all remaining requests on -* context close. -*/ -if (!i915_gem_context_is_persistent (ctx) || - !i915_modparams.enable_hangcheck) -kill_context (ctx); -i915_gem_context_put (ctx); }
Signature · 6 lines
2.26.2 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI[Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for series starting with [01/24] Revert "drm/i915/gem: Drop relocation slowpath".
In reply to Maarten Lankhorst== Series Details ==
== Series Details ==
Series: series starting with [01/24] Revert "drm/i915/gem: Drop relocation slowpath".
URL : https://patchwork.freedesktop.org/series/77960/
State : warning
== Summary ==
$ dim checkpatch origin/drm-tip a8a26d902de0 Revert "drm/i915/gem: Drop relocation slowpath". -:80: WARNING:LINE_SPACING: Missing a blank line after declarations #80: FILE: drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c:1802: + int err = __get_user(c, addr); + if (err)
total: 0 errors, 1 warnings, 0 checks, 264 lines checked 1534f179b1ab drm/i915: Add an implementation for i915_gem_ww_ctx locking, v2. -:493: WARNING:LONG_LINE: line length of 103 exceeds 100 columns #493: FILE: drivers/gpu/drm/i915/i915_gem.c:1341:
+ while ((obj = list_first_entry_or_null(&ww->obj_list, struct drm_i915_gem_object, obj_link))) {
total: 0 errors, 1 warnings, 0 checks, 473 lines checked c412b07e522c drm/i915: Remove locking from i915_gem_object_prepare_read/write ef8df645976c drm/i915: Parse command buffer earlier in eb_relocate(slow) 550bd4348656 Revert "drm/i915/gem: Split eb_vma into its own allocation" 7d8b20457516 drm/i915/gem: Make eb_add_lut interruptible wait on object lock. 45f9dff46487 drm/i915: Use per object locking in execbuf, v11. -:473: CHECK:LINE_SPACING: Please don't use multiple blank lines #473: FILE: drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c:1408:
+
-:520: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #520: FILE: drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c:1520:
+static int __reloc_entry_gpu(struct i915_execbuffer *eb,
struct i915_vma *vma,
-:540: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #540: FILE: drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c:1593:
+static int reloc_entry_gpu(struct i915_execbuffer *eb,
struct i915_vma *vma,
-:552: ERROR:TRAILING_WHITESPACE: trailing whitespace #552: FILE: drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c:1618:
+^I$
-:811: CHECK:MULTIPLE_ASSIGNMENTS: multiple assignments should be avoided #811: FILE: drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c:2957:
+ eb.reloc_pool = eb.batch_pool = NULL;
total: 1 errors, 0 warnings, 4 checks, 811 lines checked2d2857b3d5ae drm/i915: Use ww locking in intel_renderstate.
-:10: WARNING:COMMIT_LOG_LONG_LINE: Possible unwrapped commit description (prefer a maximum 75 chars per line) #10:
Convert to using ww-waiting, and make sure we always pin intel_context_state,
total: 0 errors, 1 warnings, 0 checks, 209 lines checked b25ba367c26d drm/i915: Add ww context handling to context_barrier_task -:19: WARNING:LONG_LINE: line length of 109 exceeds 100 columns #19: FILE: drivers/gpu/drm/i915/gem/i915_gem_context.c:1097:
+ int (*pin)(struct intel_context *ce, struct i915_gem_ww_ctx *ww, void *data),
total: 0 errors, 1 warnings, 0 checks, 146 lines checked36d3bd7c0420 drm/i915: Nuke arguments to eb_pin_engine5e983148f18d drm/i915: Pin engine before pinning all objects, v4. 2da536f6aca7 drm/i915: Rework intel_context pinning to do everything outside of pin_mutex -:125: CHECK:LINE_SPACING: Please don't use multiple blank lines
#125: FILE: drivers/gpu/drm/i915/gt/intel_context.c:176:
+
+
-:338: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #338: FILE: drivers/gpu/drm/i915/gt/intel_lrc.c:3443:
+ *vaddr = i915_gem_object_pin_map(ce->state->obj,
+ i915_coherent_map_type(ce->engine->i915) |
total: 0 errors, 0 warnings, 2 checks, 435 lines checkedfc5ed58aad70 drm/i915: Make sure execbuffer always passes ww state to i915_vma_pin. -:95: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #95: FILE: drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c:596:
+ err = i915_vma_pin_ww(vma, &eb->ww,
entry->pad_to_size, entry->alignment,
-:213: WARNING:BLOCK_COMMENT_STYLE: Block comments use a trailing */ on a separate line #213: FILE: drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c:2472:
+ * hsw should have this fixed, but bdw mucks it up again. */
total: 0 errors, 1 warnings, 1 checks, 850 lines checked18ebd9d92415 drm/i915: Convert i915_gem_object/client_blt.c to use ww locking as well, v2. de5ef8ca658c drm/i915: Kill last user of intel_context_create_request outside of selftests 756385fc367b drm/i915: Convert i915_perf to ww locking as well4b168d7eb625 drm/i915: Dirty hack to fix selftests locking inversion 51a11c92d700 drm/i915/selftests: Fix locking inversion in lrc selftest. 78eb94b06623 drm/i915: Use ww pinning for intel_context_create_request() 9bb49e2f74c1 drm/i915: Move i915_vma_lock in the selftests to avoid lock inversion, v2. -:108: ERROR:TRAILING_WHITESPACE: trailing whitespace
#108: FILE: drivers/gpu/drm/i915/gem/selftests/i915_gem_execbuffer.c:154:
+^I^Ii915_gem_ww_ctx_fini(&eb.ww); $
total: 1 errors, 0 warnings, 0 checks, 347 lines checked 2f3fd8b5e141 drm/i915: Add ww locking to vm_fault_gtt
-:7: WARNING:COMMIT_MESSAGE: Missing commit description - Add an appropriate one
total: 0 errors, 1 warnings, 0 checks, 91 lines checked f60b4639d689 drm/i915: Add ww locking to pin_to_display_plane
-:7: WARNING:COMMIT_MESSAGE: Missing commit description - Add an appropriate one
total: 0 errors, 1 warnings, 0 checks, 129 lines checked 1f073601ee7f drm/i915: Ensure we hold the pin mutex
-:7: WARNING:COMMIT_MESSAGE: Missing commit description - Add an appropriate one
total: 0 errors, 1 warnings, 0 checks, 39 lines checked de0fb243bf50 drm/i915: Kill context before taking ctx->mutex -:40: CHECK:LINE_SPACING: Please don't use multiple blank lines #40: FILE: drivers/gpu/drm/i915/gem/i915_gem_context.c:637:
+
+
total: 0 errors, 0 warnings, 1 checks, 36 lines checked
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI[Intel-gfx] ✗ Fi.CI.SPARSE: warning for series starting with [01/24] Revert "drm/i915/gem: Drop relocation slowpath".
In reply to Maarten Lankhorst== Series Details ==
== Series Details ==
Series: series starting with [01/24] Revert "drm/i915/gem: Drop relocation slowpath".
URL : https://patchwork.freedesktop.org/series/77960/
State : warning
== Summary ==
$ dim sparse --fast origin/drm-tip Sparse version: v0.6.0 Fast mode used, each commit won't be checked separately. +drivers/gpu/drm/i915/display/intel_display.c:1222:22: error: Expected constant expression in case statement +drivers/gpu/drm/i915/display/intel_display.c:1225:22: error: Expected constant expression in case statement +drivers/gpu/drm/i915/display/intel_display.c:1228:22: error: Expected constant expression in case statement +drivers/gpu/drm/i915/display/intel_display.c:1231:22: error: Expected constant expression in case statement +drivers/gpu/drm/i915/gt/intel_reset.c:1310:5: warning: context imbalance in 'intel_gt_reset_trylock' - different lock contexts for basic block +drivers/gpu/drm/i915/gt/sysfs_engines.c:61:10: error: bad integer constant expression +drivers/gpu/drm/i915/gt/sysfs_engines.c:62:10: error: bad integer constant expression +drivers/gpu/drm/i915/gt/sysfs_engines.c:66:10: error: bad integer constant expression +drivers/gpu/drm/i915/gvt/mmio.c:287:23: warning: memcpy with byte count of 279040 +drivers/gpu/drm/i915/i915_perf.c:1440:15: warning: memset with byte count of 16777216 +drivers/gpu/drm/i915/i915_perf.c:1494:15: warning: memset with byte count of 16777216 +drivers/gpu/drm/i915/selftests/i915_syncmap.c:80:54: warning: dubious: x | !y +./include/linux/spinlock.h:408:9: warning: context imbalance in 'fwtable_read16' - different lock contexts for basic block +./include/linux/spinlock.h:408:9: warning: context imbalance in 'fwtable_read32' - different lock contexts for basic block +./include/linux/spinlock.h:408:9: warning: context imbalance in 'fwtable_read64' - different lock contexts for basic block +./include/linux/spinlock.h:408:9: warning: context imbalance in 'fwtable_read8' - different lock contexts for basic block +./include/linux/spinlock.h:408:9: warning: context imbalance in 'fwtable_write16' - different lock contexts for basic block +./include/linux/spinlock.h:408:9: warning: context imbalance in 'fwtable_write32' - different lock contexts for basic block +./include/linux/spinlock.h:408:9: warning: context imbalance in 'fwtable_write8' - different lock contexts for basic block +./include/linux/spinlock.h:408:9: warning: context imbalance in 'gen11_fwtable_read16' - different lock contexts for basic block +./include/linux/spinlock.h:408:9: warning: context imbalance in 'gen11_fwtable_read32' - different lock contexts for basic block +./include/linux/spinlock.h:408:9: warning: context imbalance in 'gen11_fwtable_read64' - different lock contexts for basic block +./include/linux/spinlock.h:408:9: warning: context imbalance in 'gen11_fwtable_read8' - different lock contexts for basic block +./include/linux/spinlock.h:408:9: warning: context imbalance in 'gen11_fwtable_write16' - different lock contexts for basic block +./include/linux/spinlock.h:408:9: warning: context imbalance in 'gen11_fwtable_write32' - different lock contexts for basic block +./include/linux/spinlock.h:408:9: warning: context imbalance in 'gen11_fwtable_write8' - different lock contexts for basic block +./include/linux/spinlock.h:408:9: warning: context imbalance in 'gen12_fwtable_read16' - different lock contexts for basic block +./include/linux/spinlock.h:408:9: warning: context imbalance in 'gen12_fwtable_read32' - different lock contexts for basic block +./include/linux/spinlock.h:408:9: warning: context imbalance in 'gen12_fwtable_read64' - different lock contexts for basic block +./include/linux/spinlock.h:408:9: warning: context imbalance in 'gen12_fwtable_read8' - different lock contexts for basic block +./include/linux/spinlock.h:408:9: warning: context imbalance in 'gen12_fwtable_write16' - different lock contexts for basic block +./include/linux/spinlock.h:408:9: warning: context imbalance in 'gen12_fwtable_write32' - different lock contexts for basic block +./include/linux/spinlock.h:408:9: warning: context imbalance in 'gen12_fwtable_write8' - different lock contexts for basic block +./include/linux/spinlock.h:408:9: warning: context imbalance in 'gen6_read16' - different lock contexts for basic block +./include/linux/spinlock.h:408:9: warning: context imbalance in 'gen6_read32' - different lock contexts for basic block +./include/linux/spinlock.h:408:9: warning: context imbalance in 'gen6_read64' - different lock contexts for basic block +./include/linux/spinlock.h:408:9: warning: context imbalance in 'gen6_read8' - different lock contexts for basic block +./include/linux/spinlock.h:408:9: warning: context imbalance in 'gen6_write16' - different lock contexts for basic block +./include/linux/spinlock.h:408:9: warning: context imbalance in 'gen6_write32' - different lock contexts for basic block +./include/linux/spinlock.h:408:9: warning: context imbalance in 'gen6_write8' - different lock contexts for basic block +./include/linux/spinlock.h:408:9: warning: context imbalance in 'gen8_write16' - different lock contexts for basic block +./include/linux/spinlock.h:408:9: warning: context imbalance in 'gen8_write32' - different lock contexts for basic block +./include/linux/spinlock.h:408:9: warning: context imbalance in 'gen8_write8' - different lock contexts for basic block
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI[Intel-gfx] ✗ Fi.CI.BAT: failure for series starting with [01/24] Revert "drm/i915/gem: Drop relocation slowpath".
In reply to Maarten Lankhorst== Series Details ==
== Series Details ==
Series: series starting with [01/24] Revert "drm/i915/gem: Drop relocation slowpath".
URL : https://patchwork.freedesktop.org/series/77960/
State : failure
== Summary ==
CI Bug Log - changes from CI_DRM_8579 -> Patchwork_17854
====================================================
Summary
-------
**FAILURE**
Serious unknown changes coming with Patchwork_17854 absolutely need to be verified manually.
If you think the reported changes have nothing to do with the changes introduced in Patchwork_17854, 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_17854/index.html
Possible new issues
-------------------
Here are the unknown changes that may have been introduced in Patchwork_17854:
### IGT changes ###
#### Possible regressions ####
* igt@i915_selftest@live@gem_contexts:
- fi-cfl-8109u: [PASS][1] -> [DMESG-WARN][2]
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8579/fi-cfl-8109u/igt@i915_selftest@live@gem_contexts.html
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17854/fi-cfl-8109u/igt@i915_selftest@live@gem_contexts.html
- fi-skl-lmem: [PASS][3] -> [DMESG-WARN][4]
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8579/fi-skl-lmem/igt@i915_selftest@live@gem_contexts.html
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17854/fi-skl-lmem/igt@i915_selftest@live@gem_contexts.html
* igt@runner@aborted:
- fi-pnv-d510: NOTRUN -> [FAIL][5]
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17854/fi-pnv-d510/igt@[email protected]
- fi-snb-2520m: NOTRUN -> [FAIL][6]
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17854/fi-snb-2520m/igt@[email protected]
- fi-byt-n2820: NOTRUN -> [FAIL][7]
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17854/fi-byt-n2820/igt@[email protected]
- fi-snb-2600: NOTRUN -> [FAIL][8]
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17854/fi-snb-2600/igt@[email protected]
- fi-ivb-3770: NOTRUN -> [FAIL][9]
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17854/fi-ivb-3770/igt@[email protected]
- fi-byt-j1900: NOTRUN -> [FAIL][10]
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17854/fi-byt-j1900/igt@[email protected]
- fi-elk-e7500: NOTRUN -> [FAIL][11]
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17854/fi-elk-e7500/igt@[email protected]
- fi-blb-e6850: NOTRUN -> [FAIL][12]
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17854/fi-blb-e6850/igt@[email protected]
#### Suppressed ####
The following results come from untrusted machines, tests, or statuses. They do not affect the overall result.
* {igt@i915_selftest@live@gem_execbuf}:
- fi-skl-6600u: [PASS][13] -> [INCOMPLETE][14]
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8579/fi-skl-6600u/igt@i915_selftest@live@gem_execbuf.html
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17854/fi-skl-6600u/igt@i915_selftest@live@gem_execbuf.html
- fi-cfl-8109u: [PASS][15] -> [INCOMPLETE][16]
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8579/fi-cfl-8109u/igt@i915_selftest@live@gem_execbuf.html
[16]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17854/fi-cfl-8109u/igt@i915_selftest@live@gem_execbuf.html
- fi-kbl-7500u: [PASS][17] -> [INCOMPLETE][18]
[17]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8579/fi-kbl-7500u/igt@i915_selftest@live@gem_execbuf.html
[18]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17854/fi-kbl-7500u/igt@i915_selftest@live@gem_execbuf.html
- fi-kbl-guc: [PASS][19] -> [INCOMPLETE][20]
[19]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8579/fi-kbl-guc/igt@i915_selftest@live@gem_execbuf.html
[20]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17854/fi-kbl-guc/igt@i915_selftest@live@gem_execbuf.html
- fi-bsw-nick: [PASS][21] -> [INCOMPLETE][22]
[21]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8579/fi-bsw-nick/igt@i915_selftest@live@gem_execbuf.html
[22]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17854/fi-bsw-nick/igt@i915_selftest@live@gem_execbuf.html
- fi-kbl-8809g: [PASS][23] -> [INCOMPLETE][24]
[23]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8579/fi-kbl-8809g/igt@i915_selftest@live@gem_execbuf.html
[24]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17854/fi-kbl-8809g/igt@i915_selftest@live@gem_execbuf.html
- fi-icl-y: [PASS][25] -> [INCOMPLETE][26]
[25]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8579/fi-icl-y/igt@i915_selftest@live@gem_execbuf.html
[26]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17854/fi-icl-y/igt@i915_selftest@live@gem_execbuf.html
- fi-kbl-r: [PASS][27] -> [INCOMPLETE][28]
[27]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8579/fi-kbl-r/igt@i915_selftest@live@gem_execbuf.html
[28]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17854/fi-kbl-r/igt@i915_selftest@live@gem_execbuf.html
- fi-blb-e6850: [PASS][29] -> [INCOMPLETE][30]
[29]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8579/fi-blb-e6850/igt@i915_selftest@live@gem_execbuf.html
[30]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17854/fi-blb-e6850/igt@i915_selftest@live@gem_execbuf.html
- fi-kbl-x1275: [PASS][31] -> [INCOMPLETE][32]
[31]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8579/fi-kbl-x1275/igt@i915_selftest@live@gem_execbuf.html
[32]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17854/fi-kbl-x1275/igt@i915_selftest@live@gem_execbuf.html
- fi-bsw-kefka: [PASS][33] -> [INCOMPLETE][34]
[33]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8579/fi-bsw-kefka/igt@i915_selftest@live@gem_execbuf.html
[34]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17854/fi-bsw-kefka/igt@i915_selftest@live@gem_execbuf.html
- fi-cml-s: [PASS][35] -> [INCOMPLETE][36]
[35]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8579/fi-cml-s/igt@i915_selftest@live@gem_execbuf.html
[36]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17854/fi-cml-s/igt@i915_selftest@live@gem_execbuf.html
- fi-tgl-y: [PASS][37] -> [INCOMPLETE][38]
[37]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8579/fi-tgl-y/igt@i915_selftest@live@gem_execbuf.html
[38]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17854/fi-tgl-y/igt@i915_selftest@live@gem_execbuf.html
- fi-cfl-guc: [PASS][39] -> [INCOMPLETE][40]
[39]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8579/fi-cfl-guc/igt@i915_selftest@live@gem_execbuf.html
[40]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17854/fi-cfl-guc/igt@i915_selftest@live@gem_execbuf.html
- fi-kbl-soraka: [PASS][41] -> [INCOMPLETE][42]
[41]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8579/fi-kbl-soraka/igt@i915_selftest@live@gem_execbuf.html
[42]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17854/fi-kbl-soraka/igt@i915_selftest@live@gem_execbuf.html
- {fi-ehl-1}: [PASS][43] -> [INCOMPLETE][44]
[43]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8579/fi-ehl-1/igt@i915_selftest@live@gem_execbuf.html
[44]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17854/fi-ehl-1/igt@i915_selftest@live@gem_execbuf.html
- fi-bsw-n3050: [PASS][45] -> [INCOMPLETE][46]
[45]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8579/fi-bsw-n3050/igt@i915_selftest@live@gem_execbuf.html
[46]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17854/fi-bsw-n3050/igt@i915_selftest@live@gem_execbuf.html
- fi-ivb-3770: [PASS][47] -> [INCOMPLETE][48]
[47]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8579/fi-ivb-3770/igt@i915_selftest@live@gem_execbuf.html
[48]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17854/fi-ivb-3770/igt@i915_selftest@live@gem_execbuf.html
- fi-skl-lmem: [PASS][49] -> [INCOMPLETE][50]
[49]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8579/fi-skl-lmem/igt@i915_selftest@live@gem_execbuf.html
[50]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17854/fi-skl-lmem/igt@i915_selftest@live@gem_execbuf.html
- fi-ilk-650: [PASS][51] -> [INCOMPLETE][52]
[51]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8579/fi-ilk-650/igt@i915_selftest@live@gem_execbuf.html
[52]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17854/fi-ilk-650/igt@i915_selftest@live@gem_execbuf.html
- fi-cml-u2: [PASS][53] -> [INCOMPLETE][54]
[53]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8579/fi-cml-u2/igt@i915_selftest@live@gem_execbuf.html
[54]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17854/fi-cml-u2/igt@i915_selftest@live@gem_execbuf.html
- fi-icl-guc: [PASS][55] -> [INCOMPLETE][56]
[55]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8579/fi-icl-guc/igt@i915_selftest@live@gem_execbuf.html
[56]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17854/fi-icl-guc/igt@i915_selftest@live@gem_execbuf.html
- fi-cfl-8700k: [PASS][57] -> [INCOMPLETE][58]
[57]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8579/fi-cfl-8700k/igt@i915_selftest@live@gem_execbuf.html
[58]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17854/fi-cfl-8700k/igt@i915_selftest@live@gem_execbuf.html
- fi-bxt-dsi: [PASS][59] -> [INCOMPLETE][60]
[59]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8579/fi-bxt-dsi/igt@i915_selftest@live@gem_execbuf.html
[60]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17854/fi-bxt-dsi/igt@i915_selftest@live@gem_execbuf.html
- fi-hsw-4770: [PASS][61] -> [INCOMPLETE][62]
[61]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8579/fi-hsw-4770/igt@i915_selftest@live@gem_execbuf.html
[62]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17854/fi-hsw-4770/igt@i915_selftest@live@gem_execbuf.html
- {fi-tgl-u}: [PASS][63] -> [INCOMPLETE][64]
[63]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8579/fi-tgl-u/igt@i915_selftest@live@gem_execbuf.html
[64]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17854/fi-tgl-u/igt@i915_selftest@live@gem_execbuf.html
- fi-skl-6700k2: [PASS][65] -> [INCOMPLETE][66]
[65]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8579/fi-skl-6700k2/igt@i915_selftest@live@gem_execbuf.html
[66]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17854/fi-skl-6700k2/igt@i915_selftest@live@gem_execbuf.html
- fi-icl-u2: [PASS][67] -> [INCOMPLETE][68]
[67]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8579/fi-icl-u2/igt@i915_selftest@live@gem_execbuf.html
[68]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17854/fi-icl-u2/igt@i915_selftest@live@gem_execbuf.html
- {fi-tgl-dsi}: [PASS][69] -> [INCOMPLETE][70]
[69]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8579/fi-tgl-dsi/igt@i915_selftest@live@gem_execbuf.html
[70]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17854/fi-tgl-dsi/igt@i915_selftest@live@gem_execbuf.html
- fi-snb-2520m: [PASS][71] -> [INCOMPLETE][72]
[71]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8579/fi-snb-2520m/igt@i915_selftest@live@gem_execbuf.html
[72]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17854/fi-snb-2520m/igt@i915_selftest@live@gem_execbuf.html
- fi-whl-u: [PASS][73] -> [INCOMPLETE][74]
[73]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8579/fi-whl-u/igt@i915_selftest@live@gem_execbuf.html
[74]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17854/fi-whl-u/igt@i915_selftest@live@gem_execbuf.html
- fi-apl-guc: [PASS][75] -> [INCOMPLETE][76]
[75]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8579/fi-apl-guc/igt@i915_selftest@live@gem_execbuf.html
[76]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17854/fi-apl-guc/igt@i915_selftest@live@gem_execbuf.html
- fi-skl-guc: [PASS][77] -> [INCOMPLETE][78]
[77]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8579/fi-skl-guc/igt@i915_selftest@live@gem_execbuf.html
[78]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17854/fi-skl-guc/igt@i915_selftest@live@gem_execbuf.html
- fi-bdw-5557u: [PASS][79] -> [INCOMPLETE][80]
[79]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8579/fi-bdw-5557u/igt@i915_selftest@live@gem_execbuf.html
[80]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17854/fi-bdw-5557u/igt@i915_selftest@live@gem_execbuf.html
- fi-bwr-2160: [PASS][81] -> [INCOMPLETE][82]
[81]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8579/fi-bwr-2160/igt@i915_selftest@live@gem_execbuf.html
[82]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17854/fi-bwr-2160/igt@i915_selftest@live@gem_execbuf.html
Known issues
------------
Here are the changes found in Patchwork_17854 that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@kms_cursor_legacy@basic-flip-before-cursor-legacy:
- fi-icl-u2: [PASS][83] -> [DMESG-WARN][84] ([i915#1982])
[83]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8579/fi-icl-u2/igt@[email protected]
[84]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17854/fi-icl-u2/igt@[email protected]
#### Possible fixes ####
* igt@i915_module_load@reload:
- fi-byt-n2820: [DMESG-WARN][85] ([i915#1982]) -> [PASS][86] +1 similar issue
[85]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8579/fi-byt-n2820/igt@[email protected]
[86]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17854/fi-byt-n2820/igt@[email protected]
* igt@kms_cursor_legacy@basic-busy-flip-before-cursor-atomic:
- fi-kbl-soraka: [DMESG-WARN][87] ([i915#1982]) -> [PASS][88]
[87]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8579/fi-kbl-soraka/igt@[email protected]
[88]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17854/fi-kbl-soraka/igt@[email protected]
- fi-bsw-kefka: [DMESG-WARN][89] ([i915#1982]) -> [PASS][90]
[89]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8579/fi-bsw-kefka/igt@[email protected]
[90]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17854/fi-bsw-kefka/igt@[email protected]
* {igt@kms_flip@basic-flip-vs-wf_vblank@b-dvi-d1}:
- fi-bwr-2160: [FAIL][91] ([i915#1928]) -> [PASS][92]
[91]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8579/fi-bwr-2160/igt@kms_flip@[email protected]
[92]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17854/fi-bwr-2160/igt@kms_flip@[email protected]
* {igt@kms_flip@basic-flip-vs-wf_vblank@c-edp1}:
- fi-icl-u2: [DMESG-WARN][93] ([i915#1982]) -> [PASS][94]
[93]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8579/fi-icl-u2/igt@kms_flip@[email protected]
[94]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17854/fi-icl-u2/igt@kms_flip@[email protected]
#### Warnings ####
* igt@gem_exec_suspend@basic-s0:
- fi-kbl-x1275: [DMESG-WARN][95] ([i915#62] / [i915#92] / [i915#95]) -> [DMESG-WARN][96] ([i915#62] / [i915#92]) +4 similar issues
[95]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8579/fi-kbl-x1275/igt@[email protected]
[96]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17854/fi-kbl-x1275/igt@[email protected]
* igt@i915_pm_rpm@module-reload:
- fi-kbl-x1275: [SKIP][97] ([fdo#109271]) -> [DMESG-FAIL][98] ([i915#62])
[97]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8579/fi-kbl-x1275/igt@[email protected]
[98]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17854/fi-kbl-x1275/igt@[email protected]
* igt@kms_force_connector_basic@force-edid:
- fi-kbl-x1275: [DMESG-WARN][99] ([i915#62] / [i915#92]) -> [DMESG-WARN][100] ([i915#62] / [i915#92] / [i915#95]) +3 similar issues
[99]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8579/fi-kbl-x1275/igt@[email protected]
[100]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17854/fi-kbl-x1275/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#172]: https://gitlab.freedesktop.org/drm/intel/issues/172
[i915#1928]: https://gitlab.freedesktop.org/drm/intel/issues/1928
[i915#1982]: https://gitlab.freedesktop.org/drm/intel/issues/1982
[i915#299]: https://gitlab.freedesktop.org/drm/intel/issues/299
[i915#45]: https://gitlab.freedesktop.org/drm/intel/issues/45
[i915#58]: https://gitlab.freedesktop.org/drm/intel/issues/58
[i915#62]: https://gitlab.freedesktop.org/drm/intel/issues/62
[i915#66]: https://gitlab.freedesktop.org/drm/intel/issues/66
[i915#82]: https://gitlab.freedesktop.org/drm/intel/issues/82
[i915#92]: https://gitlab.freedesktop.org/drm/intel/issues/92
[i915#95]: https://gitlab.freedesktop.org/drm/intel/issues/95
[k.org#198133]: https://bugzilla.kernel.org/show_bug.cgi?id=198133
Participating hosts (51 -> 44)
------------------------------
Missing (7): fi-ilk-m540 fi-hsw-4200u fi-byt-squawks fi-bsw-cyan fi-kbl-7560u fi-byt-clapper fi-bdw-samus
Build changes
-------------
* Linux: CI_DRM_8579 -> Patchwork_17854
CI-20190529: 20190529
CI_DRM_8579: 289eb12c88c49a4ac8d325dc457d8878c7f5bdc0 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_5694: a9b6c4c74bfddf7d3d2da3be08804fe315945cea @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_17854: de0fb243bf50a40b9f92e8689e7b39848d53cc95 @ git://anongit.freedesktop.org/gfx-ci/linux
== Linux commits ==
de0fb243bf50 drm/i915: Kill context before taking ctx->mutex1f073601ee7f drm/i915: Ensure we hold the pin mutexf60b4639d689 drm/i915: Add ww locking to pin_to_display_plane2f3fd8b5e141 drm/i915: Add ww locking to vm_fault_gtt9bb49e2f74c1 drm/i915: Move i915_vma_lock in the selftests to avoid lock inversion, v2. 78eb94b06623 drm/i915: Use ww pinning for intel_context_create_request() 51a11c92d700 drm/i915/selftests: Fix locking inversion in lrc selftest. 4b168d7eb625 drm/i915: Dirty hack to fix selftests locking inversion 756385fc367b drm/i915: Convert i915_perf to ww locking as wellde5ef8ca658c drm/i915: Kill last user of intel_context_create_request outside of selftests 18ebd9d92415 drm/i915: Convert i915_gem_object/client_blt.c to use ww locking as well, v2. fc5ed58aad70 drm/i915: Make sure execbuffer always passes ww state to i915_vma_pin. 2da536f6aca7 drm/i915: Rework intel_context pinning to do everything outside of pin_mutex 5e983148f18d drm/i915: Pin engine before pinning all objects, v4. 36d3bd7c0420 drm/i915: Nuke arguments to eb_pin_engineb25ba367c26d drm/i915: Add ww context handling to context_barrier_task 2d2857b3d5ae drm/i915: Use ww locking in intel_renderstate.45f9dff46487 drm/i915: Use per object locking in execbuf, v11.7d8b20457516 drm/i915/gem: Make eb_add_lut interruptible wait on object lock. 550bd4348656 Revert "drm/i915/gem: Split eb_vma into its own allocation" ef8df645976c drm/i915: Parse command buffer earlier in eb_relocate(slow) c412b07e522c drm/i915: Remove locking from i915_gem_object_prepare_read/write 1534f179b1ab drm/i915: Add an implementation for i915_gem_ww_ctx locking, v2. a8a26d902de0 Revert "drm/i915/gem: Drop relocation slowpath".
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17854/index.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI[Intel-gfx] ✗ Fi.CI.IGT: failure for series starting with [01/24] Revert "drm/i915/gem: Drop relocation slowpath".
In reply to Maarten Lankhorst== Series Details ==
== Series Details ==
Series: series starting with [01/24] Revert "drm/i915/gem: Drop relocation slowpath".
URL : https://patchwork.freedesktop.org/series/77960/
State : failure
== Summary ==
CI Bug Log - changes from CI_DRM_8579_full -> Patchwork_17854_full
====================================================
Summary
-------
**FAILURE**
Serious unknown changes coming with Patchwork_17854_full absolutely need to be verified manually.
If you think the reported changes have nothing to do with the changes introduced in Patchwork_17854_full, please notify your bug team to allow them to document this new failure mode, which will reduce false positives in CI.
Possible new issues
-------------------
Here are the unknown changes that may have been introduced in Patchwork_17854_full:
### IGT changes ###
#### Possible regressions ####
* igt@gem_close@many-handles-one-vma:
- shard-glk: [PASS][1] -> [FAIL][2]
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8579/shard-glk7/igt@[email protected]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17854/shard-glk7/igt@[email protected]
- shard-apl: [PASS][3] -> [FAIL][4]
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8579/shard-apl8/igt@[email protected]
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17854/shard-apl2/igt@[email protected]
- shard-skl: [PASS][5] -> [FAIL][6]
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8579/shard-skl10/igt@[email protected]
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17854/shard-skl10/igt@[email protected]
- shard-tglb: [PASS][7] -> [FAIL][8]
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8579/shard-tglb2/igt@[email protected]
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17854/shard-tglb1/igt@[email protected]
- shard-kbl: [PASS][9] -> [FAIL][10]
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8579/shard-kbl2/igt@[email protected]
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17854/shard-kbl4/igt@[email protected]
- shard-iclb: [PASS][11] -> [FAIL][12]
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8579/shard-iclb4/igt@[email protected]
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17854/shard-iclb4/igt@[email protected]
* igt@i915_module_load@reload-no-display:
- shard-iclb: [PASS][13] -> [INCOMPLETE][14]
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8579/shard-iclb8/igt@[email protected]
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17854/shard-iclb6/igt@[email protected]
- shard-apl: [PASS][15] -> [INCOMPLETE][16]
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8579/shard-apl2/igt@[email protected]
[16]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17854/shard-apl7/igt@[email protected]
- shard-tglb: [PASS][17] -> [INCOMPLETE][18]
[17]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8579/shard-tglb6/igt@[email protected]
[18]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17854/shard-tglb3/igt@[email protected]
- shard-skl: [PASS][19] -> [INCOMPLETE][20]
[19]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8579/shard-skl6/igt@[email protected]
[20]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17854/shard-skl10/igt@[email protected]
- shard-kbl: [PASS][21] -> [INCOMPLETE][22]
[21]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8579/shard-kbl7/igt@[email protected]
[22]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17854/shard-kbl2/igt@[email protected]
* igt@i915_selftest@live@gem_contexts:
- shard-kbl: [PASS][23] -> [DMESG-WARN][24]
[23]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8579/shard-kbl2/igt@i915_selftest@live@gem_contexts.html
[24]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17854/shard-kbl4/igt@i915_selftest@live@gem_contexts.html
* igt@i915_selftest@mock:
- shard-glk: NOTRUN -> [FAIL][25]
[25]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17854/shard-glk8/igt@[email protected]
- shard-iclb: NOTRUN -> [FAIL][26]
[26]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17854/shard-iclb7/igt@[email protected]
- shard-kbl: NOTRUN -> [FAIL][27]
[27]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17854/shard-kbl7/igt@[email protected]
- shard-tglb: NOTRUN -> [FAIL][28]
[28]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17854/shard-tglb2/igt@[email protected]
- shard-skl: NOTRUN -> [FAIL][29]
[29]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17854/shard-skl4/igt@[email protected]
- shard-apl: NOTRUN -> [FAIL][30]
[30]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17854/shard-apl1/igt@[email protected]
* igt@runner@aborted:
- shard-iclb: NOTRUN -> ([FAIL][31], [FAIL][32], [FAIL][33]) ([i915#1580])
[31]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17854/shard-iclb4/igt@[email protected]
[32]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17854/shard-iclb6/igt@[email protected]
[33]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17854/shard-iclb7/igt@[email protected]
- shard-apl: NOTRUN -> ([FAIL][34], [FAIL][35], [FAIL][36]) ([i915#1423] / [i915#529])
[34]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17854/shard-apl1/igt@[email protected]
[35]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17854/shard-apl2/igt@[email protected]
[36]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17854/shard-apl7/igt@[email protected]
- shard-tglb: NOTRUN -> ([FAIL][37], [FAIL][38], [FAIL][39]) ([i915#1233] / [i915#1764] / [i915#529])
[37]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17854/shard-tglb2/igt@[email protected]
[38]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17854/shard-tglb1/igt@[email protected]
[39]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17854/shard-tglb3/igt@[email protected]
- shard-snb: NOTRUN -> ([FAIL][40], [FAIL][41], [FAIL][42], [FAIL][43], [FAIL][44]) ([i915#1821])
[40]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17854/shard-snb4/igt@[email protected]
[41]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17854/shard-snb6/igt@[email protected]
[42]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17854/shard-snb5/igt@[email protected]
[43]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17854/shard-snb4/igt@[email protected]
[44]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17854/shard-snb4/igt@[email protected]
#### Suppressed ####
The following results come from untrusted machines, tests, or statuses. They do not affect the overall result.
* {igt@gem_exec_reloc@basic-parallel}:
- shard-snb: [PASS][45] -> [DMESG-WARN][46] +3 similar issues
[45]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8579/shard-snb6/igt@[email protected]
[46]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17854/shard-snb4/igt@[email protected]
* {igt@i915_selftest@live@gem_execbuf}:
- shard-kbl: [PASS][47] -> [INCOMPLETE][48]
[47]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8579/shard-kbl2/igt@i915_selftest@live@gem_execbuf.html
[48]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17854/shard-kbl4/igt@i915_selftest@live@gem_execbuf.html
- shard-skl: [PASS][49] -> [INCOMPLETE][50]
[49]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8579/shard-skl10/igt@i915_selftest@live@gem_execbuf.html
[50]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17854/shard-skl10/igt@i915_selftest@live@gem_execbuf.html
- shard-apl: [PASS][51] -> [INCOMPLETE][52]
[51]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8579/shard-apl8/igt@i915_selftest@live@gem_execbuf.html
[52]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17854/shard-apl2/igt@i915_selftest@live@gem_execbuf.html
- shard-iclb: [PASS][53] -> [INCOMPLETE][54]
[53]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8579/shard-iclb4/igt@i915_selftest@live@gem_execbuf.html
[54]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17854/shard-iclb4/igt@i915_selftest@live@gem_execbuf.html
- shard-tglb: [PASS][55] -> [INCOMPLETE][56]
[55]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8579/shard-tglb2/igt@i915_selftest@live@gem_execbuf.html
[56]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17854/shard-tglb1/igt@i915_selftest@live@gem_execbuf.html
Known issues
------------
Here are the changes found in Patchwork_17854_full that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@i915_module_load@reload-no-display:
- shard-snb: [PASS][57] -> [INCOMPLETE][58] ([i915#82])
[57]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8579/shard-snb1/igt@[email protected]
[58]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17854/shard-snb5/igt@[email protected]
- shard-glk: [PASS][59] -> [INCOMPLETE][60] ([i915#58] / [k.org#198133])
[59]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8579/shard-glk4/igt@[email protected]
[60]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17854/shard-glk1/igt@[email protected]
* igt@i915_suspend@forcewake:
- shard-kbl: [PASS][61] -> [DMESG-WARN][62] ([i915#180]) +2 similar issues
[61]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8579/shard-kbl4/igt@[email protected]
[62]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17854/shard-kbl3/igt@[email protected]
* igt@kms_available_modes_crc@available_mode_test_crc:
- shard-kbl: [PASS][63] -> [DMESG-WARN][64] ([i915#93] / [i915#95])
[63]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8579/shard-kbl7/igt@kms_available_modes_crc@available_mode_test_crc.html
[64]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17854/shard-kbl2/igt@kms_available_modes_crc@available_mode_test_crc.html
* igt@kms_big_fb@x-tiled-64bpp-rotate-0:
- shard-glk: [PASS][65] -> [DMESG-FAIL][66] ([i915#118] / [i915#95])
[65]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8579/shard-glk1/igt@[email protected]
[66]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17854/shard-glk8/igt@[email protected]
* igt@kms_color@pipe-c-ctm-0-25:
- shard-skl: [PASS][67] -> [DMESG-WARN][68] ([i915#1982]) +10 similar issues
[67]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8579/shard-skl4/igt@[email protected]
[68]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17854/shard-skl3/igt@[email protected]
* igt@kms_cursor_crc@pipe-c-cursor-size-change:
- shard-skl: [PASS][69] -> [FAIL][70] ([i915#54])
[69]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8579/shard-skl2/igt@[email protected]
[70]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17854/shard-skl4/igt@[email protected]
* igt@kms_cursor_crc@pipe-c-cursor-suspend:
- shard-skl: [PASS][71] -> [INCOMPLETE][72] ([i915#300])
[71]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8579/shard-skl9/igt@[email protected]
[72]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17854/shard-skl4/igt@[email protected]
* igt@kms_cursor_legacy@cursora-vs-flipb-atomic-transitions:
- shard-glk: [PASS][73] -> [DMESG-WARN][74] ([i915#118] / [i915#95]) +1 similar issue
[73]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8579/shard-glk1/igt@[email protected]
[74]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17854/shard-glk8/igt@[email protected]
* igt@kms_cursor_legacy@cursorb-vs-flipa-toggle:
- shard-glk: [PASS][75] -> [DMESG-FAIL][76] ([i915#1925] / [i915#1926])
[75]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8579/shard-glk9/igt@[email protected]
[76]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17854/shard-glk9/igt@[email protected]
* igt@kms_draw_crc@draw-method-xrgb8888-pwrite-xtiled:
- shard-apl: [PASS][77] -> [DMESG-WARN][78] ([i915#95]) +11 similar issues
[77]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8579/shard-apl3/igt@[email protected]
[78]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17854/shard-apl3/igt@[email protected]
* igt@kms_hdr@bpc-switch-suspend:
- shard-skl: [PASS][79] -> [FAIL][80] ([i915#1188])
[79]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8579/shard-skl1/igt@[email protected]
[80]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17854/shard-skl9/igt@[email protected]
* igt@kms_pipe_crc_basic@read-crc-pipe-c-frame-sequence:
- shard-skl: [PASS][81] -> [FAIL][82] ([i915#53])
[81]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8579/shard-skl2/igt@[email protected]
[82]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17854/shard-skl4/igt@[email protected]
* igt@kms_pipe_crc_basic@suspend-read-crc-pipe-c:
- shard-glk: [PASS][83] -> [DMESG-WARN][84] ([i915#1982])
[83]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8579/shard-glk5/igt@[email protected]
[84]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17854/shard-glk8/igt@[email protected]
* igt@kms_plane@plane-panning-bottom-right-suspend-pipe-a-planes:
- shard-apl: [PASS][85] -> [DMESG-WARN][86] ([i915#180]) +2 similar issues
[85]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8579/shard-apl3/igt@[email protected]
[86]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17854/shard-apl4/igt@[email protected]
* igt@kms_plane_alpha_blend@pipe-a-coverage-7efc:
- shard-skl: [PASS][87] -> [FAIL][88] ([fdo#108145] / [i915#265])
[87]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8579/shard-skl4/igt@[email protected]
[88]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17854/shard-skl3/igt@[email protected]
* igt@kms_plane_cursor@pipe-a-primary-size-256:
- shard-snb: [PASS][89] -> [SKIP][90] ([fdo#109271])
[89]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8579/shard-snb1/igt@[email protected]
[90]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17854/shard-snb2/igt@[email protected]
* igt@kms_psr@psr2_primary_page_flip:
- shard-iclb: [PASS][91] -> [SKIP][92] ([fdo#109441]) +2 similar issues
[91]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8579/shard-iclb2/igt@kms_psr@psr2_primary_page_flip.html
[92]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17854/shard-iclb1/igt@kms_psr@psr2_primary_page_flip.html
* igt@kms_setmode@basic:
- shard-apl: [PASS][93] -> [FAIL][94] ([i915#31])
[93]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8579/shard-apl6/igt@[email protected]
[94]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17854/shard-apl7/igt@[email protected]
#### Possible fixes ####
* {igt@gem_ctx_isolation@preservation-s3@vcs0}:
- shard-kbl: [INCOMPLETE][95] ([i915#1780]) -> [PASS][96]
[95]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8579/shard-kbl6/igt@gem_ctx_isolation@[email protected]
[96]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17854/shard-kbl7/igt@gem_ctx_isolation@[email protected]
* {igt@gem_exec_reloc@basic-concurrent0}:
- shard-glk: [FAIL][97] ([i915#1930]) -> [PASS][98]
[97]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8579/shard-glk4/igt@[email protected]
[98]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17854/shard-glk1/igt@[email protected]
- shard-apl: [FAIL][99] ([i915#1930]) -> [PASS][100]
[99]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8579/shard-apl2/igt@[email protected]
[100]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17854/shard-apl7/igt@[email protected]
* {igt@gem_exec_reloc@basic-concurrent16}:
- shard-snb: [FAIL][101] ([i915#1930]) -> [PASS][102] +1 similar issue
[101]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8579/shard-snb2/igt@[email protected]
[102]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17854/shard-snb2/igt@[email protected]
- shard-iclb: [FAIL][103] ([i915#1930]) -> [PASS][104] +1 similar issue
[103]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8579/shard-iclb5/igt@[email protected]
[104]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17854/shard-iclb3/igt@[email protected]
- shard-skl: [FAIL][105] ([i915#1930]) -> [PASS][106] +1 similar issue
[105]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8579/shard-skl5/igt@[email protected]
[106]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17854/shard-skl6/igt@[email protected]
- shard-kbl: [FAIL][107] ([i915#1930]) -> [PASS][108]
[107]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8579/shard-kbl3/igt@[email protected]
[108]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17854/shard-kbl3/igt@[email protected]
- shard-tglb: [FAIL][109] ([i915#1930]) -> [PASS][110]
[109]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8579/shard-tglb5/igt@[email protected]
[110]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17854/shard-tglb3/igt@[email protected]
* {igt@gem_exec_schedule@implicit-write-read@rcs0}:
- shard-snb: [INCOMPLETE][111] ([i915#82]) -> [PASS][112]
[111]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8579/shard-snb5/igt@gem_exec_schedule@[email protected]
[112]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17854/shard-snb5/igt@gem_exec_schedule@[email protected]
* igt@gem_exec_whisper@basic-contexts-forked-all:
- shard-glk: [DMESG-WARN][113] ([i915#118] / [i915#95]) -> [PASS][114]
[113]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8579/shard-glk7/igt@[email protected]
[114]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17854/shard-glk7/igt@[email protected]
* igt@gem_workarounds@suspend-resume-context:
- shard-apl: [DMESG-WARN][115] ([i915#180]) -> [PASS][116] +2 similar issues
[115]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8579/shard-apl6/igt@[email protected]
[116]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17854/shard-apl2/igt@[email protected]
* igt@i915_suspend@sysfs-reader:
- shard-apl: [TIMEOUT][117] ([i915#1635]) -> [PASS][118] +3 similar issues
[117]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8579/shard-apl4/igt@[email protected]
[118]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17854/shard-apl7/igt@[email protected]
* igt@kms_big_fb@y-tiled-8bpp-rotate-0:
- shard-apl: [DMESG-WARN][119] ([i915#1982]) -> [PASS][120] +1 similar issue
[119]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8579/shard-apl2/igt@[email protected]
[120]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17854/shard-apl7/igt@[email protected]
* igt@kms_big_fb@yf-tiled-32bpp-rotate-0:
- shard-skl: [DMESG-WARN][121] ([i915#1982]) -> [PASS][122] +9 similar issues
[121]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8579/shard-skl5/igt@[email protected]
[122]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17854/shard-skl6/igt@[email protected]
* {igt@kms_flip@flip-vs-expired-vblank-interruptible@b-edp1}:
- shard-skl: [FAIL][123] ([i915#46]) -> [PASS][124]
[123]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8579/shard-skl5/igt@kms_flip@[email protected]
[124]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17854/shard-skl6/igt@kms_flip@[email protected]
* igt@kms_frontbuffer_tracking@fbc-suspend:
- shard-kbl: [DMESG-WARN][125] ([i915#93] / [i915#95]) -> [PASS][126]
[125]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8579/shard-kbl2/igt@[email protected]
[126]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17854/shard-kbl6/igt@[email protected]
* igt@kms_plane@plane-panning-bottom-right-suspend-pipe-c-planes:
- shard-skl: [INCOMPLETE][127] ([i915#69]) -> [PASS][128]
[127]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8579/shard-skl8/igt@[email protected]
[128]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17854/shard-skl2/igt@[email protected]
* igt@kms_plane_alpha_blend@pipe-c-constant-alpha-mid:
- shard-apl: [DMESG-WARN][129] ([i915#95]) -> [PASS][130] +10 similar issues
[129]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8579/shard-apl7/igt@[email protected]
[130]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17854/shard-apl3/igt@[email protected]
* igt@kms_plane_alpha_blend@pipe-c-constant-alpha-min:
- shard-skl: [FAIL][131] ([fdo#108145] / [i915#265]) -> [PASS][132]
[131]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8579/shard-skl5/igt@[email protected]
[132]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17854/shard-skl6/igt@[email protected]
* igt@kms_psr@psr2_cursor_render:
- shard-iclb: [SKIP][133] ([fdo#109441]) -> [PASS][134] +1 similar issue
[133]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8579/shard-iclb7/igt@kms_psr@psr2_cursor_render.html
[134]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17854/shard-iclb2/igt@kms_psr@psr2_cursor_render.html
* igt@kms_vblank@pipe-a-ts-continuation-suspend:
- shard-kbl: [DMESG-WARN][135] ([i915#180]) -> [PASS][136] +3 similar issues
[135]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8579/shard-kbl3/igt@[email protected]
[136]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17854/shard-kbl4/igt@[email protected]
* {igt@perf@blocking-parameterized}:
- shard-tglb: [FAIL][137] ([i915#1542]) -> [PASS][138]
[137]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8579/shard-tglb7/igt@[email protected]
[138]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17854/shard-tglb6/igt@[email protected]
* {igt@perf_pmu@module-unload}:
- shard-iclb: [DMESG-WARN][139] ([i915#1982]) -> [PASS][140]
[139]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8579/shard-iclb6/igt@[email protected]
[140]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17854/shard-iclb1/igt@[email protected]
* igt@perf_pmu@rc6-runtime-pm:
- shard-glk: [TIMEOUT][141] ([i915#1958]) -> [PASS][142] +4 similar issues
[141]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8579/shard-glk5/igt@[email protected]
[142]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17854/shard-glk2/igt@[email protected]
#### Warnings ####
* igt@gem_ctx_bad_destroy@invalid-pad:
- shard-apl: [TIMEOUT][143] ([i915#1635]) -> [DMESG-WARN][144] ([i915#95])
[143]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8579/shard-apl4/igt@[email protected]
[144]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17854/shard-apl7/igt@[email protected]
* igt@kms_content_protection@atomic:
- shard-apl: [TIMEOUT][145] ([i915#1319] / [i915#1635]) -> [DMESG-FAIL][146] ([fdo#110321] / [i915#95])
[145]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8579/shard-apl6/igt@[email protected]
[146]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17854/shard-apl4/igt@[email protected]
* igt@kms_content_protection@atomic-dpms:
- shard-apl: [TIMEOUT][147] ([i915#1319]) -> [TIMEOUT][148] ([i915#1319] / [i915#1635])
[147]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8579/shard-apl1/igt@[email protected]
[148]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17854/shard-apl6/igt@[email protected]
* igt@kms_content_protection@lic:
- shard-apl: [TIMEOUT][149] ([i915#1319] / [i915#1635]) -> [FAIL][150] ([fdo#110321])
[149]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8579/shard-apl6/igt@[email protected]
[150]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17854/shard-apl1/igt@[email protected]
* igt@kms_content_protection@srm:
- shard-apl: [FAIL][151] ([fdo#110321]) -> [TIMEOUT][152] ([i915#1319] / [i915#1635])
[151]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8579/shard-apl2/igt@[email protected]
[152]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17854/shard-apl7/igt@[email protected]
* igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-draw-mmap-cpu:
- shard-apl: [DMESG-FAIL][153] ([i915#49] / [i915#95]) -> [FAIL][154] ([i915#49])
[153]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8579/shard-apl2/igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-draw-mmap-cpu.html
[154]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17854/shard-apl7/igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-draw-mmap-cpu.html
* igt@kms_vblank@pipe-d-query-idle-hang:
- shard-apl: [TIMEOUT][155] ([i915#1635] / [i915#1640]) -> [SKIP][156] ([fdo#109271])
[155]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8579/shard-apl4/igt@[email protected]
[156]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17854/shard-apl7/igt@[email protected]
- shard-glk: [TIMEOUT][157] ([i915#1640] / [i915#1958]) -> [SKIP][158] ([fdo#109271])
[157]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8579/shard-glk5/igt@[email protected]
[158]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17854/shard-glk2/igt@[email protected]
* igt@runner@aborted:
- shard-kbl: [FAIL][159] ([i915#1436]) -> ([FAIL][160], [FAIL][161], [FAIL][162]) ([i915#1423] / [i915#1436] / [i915#1784] / [i915#656])
[159]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8579/shard-kbl6/igt@[email protected]
[160]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17854/shard-kbl7/igt@[email protected]
[161]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17854/shard-kbl4/igt@[email protected]
[162]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17854/shard-kbl2/igt@[email protected]
- shard-glk: [FAIL][163] ([k.org#202321]) -> ([FAIL][164], [FAIL][165], [FAIL][166]) ([i915#1423] / [k.org#202321])
[163]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8579/shard-glk9/igt@[email protected]
[164]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17854/shard-glk7/igt@[email protected]
[165]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17854/shard-glk8/igt@[email protected]
[166]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17854/shard-glk1/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#103375]: https://bugs.freedesktop.org/show_bug.cgi?id=103375
[fdo#108145]: https://bugs.freedesktop.org/show_bug.cgi?id=108145
[fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
[fdo#109441]: https://bugs.freedesktop.org/show_bug.cgi?id=109441
[fdo#110321]: https://bugs.freedesktop.org/show_bug.cgi?id=110321
[i915#118]: https://gitlab.freedesktop.org/drm/intel/issues/118
[i915#1188]: https://gitlab.freedesktop.org/drm/intel/issues/1188
[i915#1233]: https://gitlab.freedesktop.org/drm/intel/issues/1233
[i915#1319]: https://gitlab.freedesktop.org/drm/intel/issues/1319
[i915#1423]: https://gitlab.freedesktop.org/drm/intel/issues/1423
[i915#1436]: https://gitlab.freedesktop.org/drm/intel/issues/1436
[i915#1542]: https://gitlab.fre
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17854/index.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx