drm/i915/gem: Parallel execbuf WIP.
Subsystems (4)
cover drm/i915/gem: Parallel execbuf WIP.
Posting this as a RFC, to get some feedback hopefully.
Chris Wilson (2):
drm/i915: Drop inspection of execbuf flags during evict drm/i915/gem: Extract transient execbuf flags from i915_vma
Maarten Lankhorst (2):
drm/i915: Add an implementation for i915_gem_ww_ctx locking. drm/i915: Remove locking from i915_gem_object_prepare_read/write drm/i915: Parallel execbuf wip
drivers/gpu/drm/i915/display/intel_display.c | 6 +- drivers/gpu/drm/i915/display/intel_overlay.c | 2 +- .../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 | 26 +- .../gpu/drm/i915/gem/i915_gem_execbuffer.c | 543 ++++++++++-------- drivers/gpu/drm/i915/gem/i915_gem_object.c | 2 +- drivers/gpu/drm/i915/gem/i915_gem_object.h | 39 +- .../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 | 9 +- .../i915/gem/selftests/i915_gem_client_blt.c | 2 +- .../i915/gem/selftests/i915_gem_coherency.c | 24 +- .../drm/i915/gem/selftests/i915_gem_context.c | 16 +- .../drm/i915/gem/selftests/i915_gem_mman.c | 4 +- .../i915/gem/selftests/i915_gem_object_blt.c | 4 +- .../drm/i915/gem/selftests/i915_gem_phys.c | 2 +- drivers/gpu/drm/i915/gt/intel_renderstate.c | 9 +- .../gpu/drm/i915/gt/selftest_workarounds.c | 2 +- drivers/gpu/drm/i915/gvt/cmd_parser.c | 11 +- drivers/gpu/drm/i915/i915_cmd_parser.c | 1 + drivers/gpu/drm/i915/i915_drv.h | 6 - drivers/gpu/drm/i915/i915_gem.c | 54 +- drivers/gpu/drm/i915/i915_gem.h | 11 + drivers/gpu/drm/i915/i915_gem_evict.c | 15 +- drivers/gpu/drm/i915/i915_vma.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 | 4 +- 32 files changed, 516 insertions(+), 353 deletions(-)
Signature · 6 lines
2.24.0 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 1/5 drm/i915: Drop inspection of execbuf flags during evict
From: Chris Wilson <[email protected]>
With the goal of removing the serialisation from around execbuf, we will no longer have the privilege of there being a single execbuf in flight at any time and so will only be able to inspect the user's flags within the carefully controlled execbuf context. i915_gem_evict_for_node() is the only user outside of execbuf that currently peeks at the flag to convert an overlapping softpinned request from ENOSPC to EINVAL. Retract this nicety and only report ENOSPC if the location is in current use, either due to this execbuf or another.
--- drivers/gpu/drm/i915/i915_gem_evict.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-)
drivers/gpu/drm/i915/i915_gem_evict.c +6 -9
@@ -292,7 +292,8 @@ int i915_gem_evict_for_node(struct i915_address_space *vm,GEM_BUG_ON (!drm_mm_node_allocated (node)); vma =container_of (node,typeof (*vma), node); -/* If we are using coloring to insert guard pages between +/* +* If we are using coloring to insert guard pages between * different cache domains within the address space, we have * to check whether the objects on either side of our range * abutt and conflict. If they are in conflict, then we evict
@@ -309,22 +310,18 @@ int i915_gem_evict_for_node(struct i915_address_space *vm, } } -if (flags &PIN_NONBLOCK && - (i915_vma_is_pinned (vma) ||i915_vma_is_active (vma))) { +if (i915_vma_is_pinned (vma)) { ret = -ENOSPC ;break ; } -/* Overlap of objects in the same batch? */ -if (i915_vma_is_pinned (vma)) { +if (flags &PIN_NONBLOCK &&i915_vma_is_active (vma)) { ret = -ENOSPC ; -if (vma->exec_flags && - *vma->exec_flags &EXEC_OBJECT_PINNED ) - ret = -EINVAL ;break ; } -/* Never show fear in the face of dragons! +/* +* Never show fear in the face of dragons! * * We cannot directly remove this node from within this * iterator and as with i915_gem_evict_something() we employ
Signature · 6 lines
2.24.0 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 2/5 drm/i915/gem: Extract transient execbuf flags from i915_vma
In reply to Maarten LankhorstFrom: Chris Wilson <[email protected]>
For our convenience, and to avoid frequent allocations, we placed some lists we use for execbuf inside the common i915_vma struct. As we look to parallelise execbuf, such fields guarded by the struct_mutex BKL must be pulled under local control. Instead of using the i915_vma as our primary means of tracking the user's list of objects and their virtual mappings, we use a local eb_vma with the same lists as before (just now local not global).
This should allow us to only perform the lookup of vma used for execution once during the execbuf ioctl, as currently we need to remove our secrets from inside i915_vma everytime we drop the struct_mutex as another execbuf may use the shared locations.
Once user visible consequence is that we can remove the requirement that the execobj[] be unique, and only require that they do not conflict (i.e. you cannot softpin the same object into two locations... hmm, we could allow that if truly required, but atm we only allow one vma per ppGTT per object.)
--- .../gpu/drm/i915/gem/i915_gem_execbuffer.c | 274 +++++++++--------- drivers/gpu/drm/i915/i915_vma.h | 11 - 2 files changed, 131 insertions(+), 154 deletions(-)
drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c +131 -143
@@ -27,6 +27,19 @@#include "i915_gem_ioctls.h" #include "i915_trace.h" +struct eb_vma { +struct i915_vma *vma; +unsigned int flags; + +/** This vma's place in the execbuf reservation list */ +struct drm_i915_gem_exec_object2 *exec; +struct list_head bind_link; +struct list_head reloc_link; + +struct hlist_node node; +u32 handle; +}; +enum {FORCE_CPU_RELOC =1 ,FORCE_GTT_RELOC ,
@@ -219,15 +232,14 @@ struct i915_execbuffer {struct drm_file *file;/** per-file lookup tables and limits */ struct drm_i915_gem_execbuffer2 *args;/** ioctl parameters */ struct drm_i915_gem_exec_object2 *exec;/** ioctl execobj[] */ -struct i915_vma **vma; -unsigned int *flags; +struct eb_vma *vma;struct intel_engine_cs *engine;/** engine to queue the request to */ struct intel_context *context;/* logical state for the request */ struct i915_gem_context *gem_context;/** caller's context */ struct i915_request *request;/** our request to build */ -struct i915_vma *batch;/** identity of the batch obj/vma */ +struct eb_vma *batch;/** identity of the batch obj/vma */ /** actual size of execobj[] as we may extend it for the cmdparser */ unsigned int buffer_count;
@@ -274,8 +286,6 @@ struct i915_execbuffer {struct hlist_head *buckets;/** ht for relocation handles */ }; -#define exec_entry (EB ,VMA ) (&(EB)->exec[(VMA)->exec_flags - (EB)->flags]) -/* * Used to convert any address to canonical form. * Starting from gen8, some commands (e.g. STATE_BASE_ADDRESS,
@@ -381,9 +391,9 @@ eb_vma_misplaced(const struct drm_i915_gem_exec_object2 *entry,static inline bool eb_pin_vma (struct i915_execbuffer *eb,const struct drm_i915_gem_exec_object2 *entry, -struct i915_vma *vma) +struct eb_vma *ev) { -unsigned int exec_flags = *vma->exec_flags; +struct i915_vma *vma = ev->vma;u64 pin_flags;if (vma->node.size)
@@ -392,24 +402,24 @@ eb_pin_vma(struct i915_execbuffer *eb, pin_flags = entry->offset &PIN_OFFSET_MASK ; pin_flags |=PIN_USER |PIN_NOEVICT |PIN_OFFSET_FIXED ; -if (unlikely (exec_flags &EXEC_OBJECT_NEEDS_GTT )) +if (unlikely (ev->flags &EXEC_OBJECT_NEEDS_GTT )) pin_flags |=PIN_GLOBAL ;if (unlikely (i915_vma_pin (vma,0 ,0 , pin_flags)))return false; -if (unlikely (exec_flags &EXEC_OBJECT_NEEDS_FENCE )) { +if (unlikely (ev->flags &EXEC_OBJECT_NEEDS_FENCE )) {if (unlikely (i915_vma_pin_fence (vma))) {i915_vma_unpin (vma);return false; }if (vma->fence) - exec_flags |= __EXEC_OBJECT_HAS_FENCE; + ev->flags |= __EXEC_OBJECT_HAS_FENCE; } - *vma->exec_flags = exec_flags | __EXEC_OBJECT_HAS_PIN; -return !eb_vma_misplaced (entry, vma, exec_flags); + ev->flags |= __EXEC_OBJECT_HAS_PIN; +return !eb_vma_misplaced (entry, vma, ev->flags); }static inline void __eb_unreserve_vma (struct i915_vma *vma,unsigned int flags)
@@ -423,13 +433,13 @@ static inline void __eb_unreserve_vma(struct i915_vma *vma, unsigned int flags) }static inline void -eb_unreserve_vma (struct i915_vma *vma,unsigned int *flags) +eb_unreserve_vma (struct eb_vma *ev) { -if (!(*flags & __EXEC_OBJECT_HAS_PIN)) +if (!(ev->flags & __EXEC_OBJECT_HAS_PIN))return ; -__eb_unreserve_vma (vma, *flags); - *flags &= ~__EXEC_OBJECT_RESERVED; +__eb_unreserve_vma (ev->vma, ev->flags); + ev->flags &= ~__EXEC_OBJECT_RESERVED; } static int
@@ -459,12 +469,6 @@ eb_validate_vma(struct i915_execbuffer *eb, entry->pad_to_size =0 ; } -if (unlikely (vma->exec_flags)) { -DRM_DEBUG ("Object [handle %d, index %d] appears more than once in object list\n" , - entry->handle, (int )(entry - eb->exec)); -return -EINVAL ; - } -/* * From drm_mm perspective address space is continuous, * so from this point we're always using non-canonical
@@ -493,6 +497,7 @@ eb_add_vma(struct i915_execbuffer *eb, struct i915_vma *vma) {struct drm_i915_gem_exec_object2 *entry = &eb->exec[i]; +struct eb_vma *ev = &eb->vma[i];int err;GEM_BUG_ON (i915_vma_is_closed (vma));
@@ -503,25 +508,19 @@ eb_add_vma(struct i915_execbuffer *eb,return err; } + ev->vma = vma; + ev->exec = entry; + ev->flags = entry->flags; +if (eb->lut_size >0 ) { - vma->exec_handle = entry->handle; -hlist_add_head (&vma->exec_node, + ev->handle = entry->handle; +hlist_add_head (&ev->node, &eb->buckets[hash_32 (entry->handle, eb->lut_size)]); }if (entry->relocation_count) -list_add_tail (&vma->reloc_link, &eb->relocs); - -/* -* Stash a pointer from the vma to execobj, so we can query its flags, -* size, alignment etc as provided by the user. Also we stash a pointer -* to the vma inside the execobj so that we can use a direct lookup -* to find the right target VMA when doing relocations. -*/ - eb->vma[i] = vma; - eb->flags[i] = entry->flags; - vma->exec_flags = &eb->flags[i]; +list_add_tail (&ev->reloc_link, &eb->relocs);/* * SNA is doing fancy tricks with compressing batch buffers, which leads
@@ -534,28 +533,26 @@ eb_add_vma(struct i915_execbuffer *eb,*/ if (i == batch_idx) {if (entry->relocation_count && - !(eb->flags[i] &EXEC_OBJECT_PINNED )) - eb->flags[i] |= __EXEC_OBJECT_NEEDS_BIAS; + !(ev->flags &EXEC_OBJECT_PINNED )) + ev->flags |= __EXEC_OBJECT_NEEDS_BIAS;if (eb->reloc_cache.has_fence) - eb->flags[i] |=EXEC_OBJECT_NEEDS_FENCE ; + ev->flags |=EXEC_OBJECT_NEEDS_FENCE ; - eb->batch = vma; + eb->batch = ev; } err =0 ; -if (eb_pin_vma (eb, entry, vma)) { +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 (vma, vma->exec_flags); +eb_unreserve_vma (ev); -list_add_tail (&vma->exec_link, &eb->unbound); +list_add_tail (&ev->bind_link, &eb->unbound);if (drm_mm_node_allocated (&vma->node)) err =i915_vma_unbind (vma); -if (unlikely (err)) - vma->exec_flags =NULL ; }return err; }
@@ -577,11 +574,11 @@ static inline int use_cpu_reloc(const struct reloc_cache *cache, obj->cache_level != I915_CACHE_NONE); } -static int eb_reserve_vma (const struct i915_execbuffer *eb, -struct i915_vma *vma) +static int eb_reserve_vma (const struct i915_execbuffer *eb,struct eb_vma *ev) { -struct drm_i915_gem_exec_object2 *entry =exec_entry (eb, vma); -unsigned int exec_flags = *vma->exec_flags; +struct drm_i915_gem_exec_object2 *entry = ev->exec; +unsigned int exec_flags = ev->flags; +struct i915_vma *vma = ev->vma;u64 pin_flags;int err;
@@ -628,8 +625,8 @@ static int eb_reserve_vma(const struct i915_execbuffer *eb, exec_flags |= __EXEC_OBJECT_HAS_FENCE; } - *vma->exec_flags = exec_flags | __EXEC_OBJECT_HAS_PIN; -GEM_BUG_ON (eb_vma_misplaced (entry, vma, exec_flags)); + ev->flags = exec_flags | __EXEC_OBJECT_HAS_PIN; +GEM_BUG_ON (eb_vma_misplaced (entry, vma, ev->flags));return 0 ; }
@@ -638,7 +635,7 @@ static int eb_reserve(struct i915_execbuffer *eb) {const unsigned int count = eb->buffer_count;struct list_head last; -struct i915_vma *vma; +struct eb_vma *ev;unsigned int i, pass;int err;
@@ -659,8 +656,8 @@ static int eb_reserve(struct i915_execbuffer *eb) pass =0 ; err =0 ; do { - list_for_each_entry(vma, &eb->unbound, exec_link) { - err = eb_reserve_vma(eb, vma); + list_for_each_entry(ev, &eb->unbound, bind_link) { + err = eb_reserve_vma(eb, ev); if (err) break; }
@@ -671,26 +668,26 @@ static int eb_reserve(struct i915_execbuffer *eb)INIT_LIST_HEAD (&eb->unbound);INIT_LIST_HEAD (&last);for (i =0 ; i < count; i++) { -unsigned int flags = eb->flags[i]; -struct i915_vma *vma = eb->vma[i]; +struct eb_vma *ev = &eb->vma[i]; +unsigned int flags = ev->flags;if (flags &EXEC_OBJECT_PINNED && flags & __EXEC_OBJECT_HAS_PIN)continue ; -eb_unreserve_vma (vma, &eb->flags[i]); +eb_unreserve_vma (ev);if (flags &EXEC_OBJECT_PINNED )/* Pinned must have their slot */ -list_add (&vma->exec_link, &eb->unbound); +list_add (&ev->bind_link, &eb->unbound);else if (flags & __EXEC_OBJECT_NEEDS_MAP)/* Map require the lowest 256MiB (aperture) */ -list_add_tail (&vma->exec_link, &eb->unbound); +list_add_tail (&ev->bind_link, &eb->unbound);else if (!(flags &EXEC_OBJECT_SUPPORTS_48B_ADDRESS ))/* Prioritise 4GiB region for restricted bo */ -list_add (&vma->exec_link, &last); +list_add (&ev->bind_link, &last);else -list_add_tail (&vma->exec_link, &last); +list_add_tail (&ev->bind_link, &last); }list_splice_tail (&last, &eb->unbound);
@@ -809,10 +806,8 @@ static int eb_lookup_vmas(struct i915_execbuffer *eb)if (unlikely (err)) goto err_vma; -GEM_BUG_ON (vma != eb->vma[i]); -GEM_BUG_ON (vma->exec_flags != &eb->flags[i]);GEM_BUG_ON (drm_mm_node_allocated (&vma->node) && -eb_vma_misplaced (&eb->exec[i], vma, eb->flags[i])); +eb_vma_misplaced (&eb->exec[i], vma, eb->vma[i].flags)); }mutex_unlock (&eb->gem_context->mutex);
@@ -823,27 +818,27 @@ static int eb_lookup_vmas(struct i915_execbuffer *eb) err_obj:i915_gem_object_put (obj); err_vma: - eb->vma[i] =NULL ; + eb->vma[i].vma =NULL ; err_ctx:mutex_unlock (&eb->gem_context->mutex);return err; } -static struct i915_vma * +static struct eb_vma *eb_get_vma (const struct i915_execbuffer *eb,unsigned long handle) {if (eb->lut_size <0 ) {if (handle >= -eb->lut_size)return NULL ; -return eb->vma[handle]; +return &eb->vma[handle]; }else {struct hlist_head *head; -struct i915_vma *vma; +struct eb_vma *ev; head = &eb->buckets[hash_32 (handle, eb->lut_size)]; -hlist_for_each_entry (vma, head, exec_node) { -if (vma->exec_handle == handle) -return vma; +hlist_for_each_entry (ev, head, node) { +if (ev->handle == handle) +return ev; }return NULL ; }
@@ -855,20 +850,18 @@ static void eb_release_vmas(const struct i915_execbuffer *eb)unsigned int i;for (i =0 ; i < count; i++) { -struct i915_vma *vma = eb->vma[i]; -unsigned int flags = eb->flags[i]; +struct eb_vma *ev = &eb->vma[i]; +struct i915_vma *vma = ev->vma;if (!vma)break ; -GEM_BUG_ON (vma->exec_flags != &eb->flags[i]); - vma->exec_flags =NULL ; - eb->vma[i] =NULL ; + eb->vma[i].vma =NULL ; -if (flags & __EXEC_OBJECT_HAS_PIN) -__eb_unreserve_vma (vma, flags); +if (ev->flags & __EXEC_OBJECT_HAS_PIN) +__eb_unreserve_vma (vma, ev->flags); -if (flags & __EXEC_OBJECT_HAS_REF) +if (ev->flags & __EXEC_OBJECT_HAS_REF)i915_vma_put (vma); } }
@@ -1351,10 +1344,10 @@ relocate_entry(struct i915_vma *vma,static u64 eb_relocate_entry (struct i915_execbuffer *eb, -struct i915_vma *vma, +struct eb_vma *ev,const struct drm_i915_gem_relocation_entry *reloc) { -struct i915_vma *target; +struct eb_vma *target;int err;/* we've already hold a reference to all valid objects */
@@ -1386,7 +1379,7 @@ eb_relocate_entry(struct i915_execbuffer *eb, }if (reloc->write_domain) { - *target->exec_flags |=EXEC_OBJECT_WRITE ; + target->flags |=EXEC_OBJECT_WRITE ;/* * Sandybridge PPGTT errata: We need a global gtt mapping
@@ -1396,7 +1389,8 @@ eb_relocate_entry(struct i915_execbuffer *eb,*/ if (reloc->write_domain ==I915_GEM_DOMAIN_INSTRUCTION &&IS_GEN (eb->i915,6 )) { - err =i915_vma_bind (target, target->obj->cache_level, + err =i915_vma_bind (target->vma, + target->vma->obj->cache_level,PIN_GLOBAL ,NULL );if (WARN_ONCE (err,"Unexpected failure to bind target VMA!" ))
@@ -1409,17 +1403,17 @@ eb_relocate_entry(struct i915_execbuffer *eb,* more work needs to be done. */ if (!DBG_FORCE_RELOC && -gen8_canonical_addr (target->node.start) == reloc->presumed_offset) +gen8_canonical_addr (target->vma->node.start) == reloc->presumed_offset)return 0 ;/* Check that the relocation address is valid... */ if (unlikely (reloc->offset > - vma->size - (eb->reloc_cache.use_64bit_reloc ?8 :4 ))) { + ev->vma->size - (eb->reloc_cache.use_64bit_reloc ?8 :4 ))) {DRM_DEBUG ("Relocation beyond object bounds: " "target %d offset %d size %d.\n" , reloc->target_handle, (int )reloc->offset, - (int )vma->size); + (int )ev->vma->size);return -EINVAL ; }if (unlikely (reloc->offset &3 )) {
@@ -1438,18 +1432,18 @@ eb_relocate_entry(struct i915_execbuffer *eb,* do relocations we are already stalling, disable the user's opt * out of our synchronisation. */ - *vma->exec_flags &= ~EXEC_OBJECT_ASYNC ; + ev->flags &= ~EXEC_OBJECT_ASYNC ;/* and update the user's relocation entry */ -return relocate_entry (vma, reloc, eb, target); +return relocate_entry (ev->vma, reloc, eb, target->vma); } -static int eb_relocate_vma (struct i915_execbuffer *eb,struct i915_vma *vma) +static int eb_relocate_vma (struct i915_execbuffer *eb,struct eb_vma *ev) {#define N_RELOC (x) ((x) / sizeof(struct drm_i915_gem_relocation_entry))struct drm_i915_gem_relocation_entry stack[N_RELOC (512 )];struct drm_i915_gem_relocation_entry __user *urelocs; -const struct drm_i915_gem_exec_object2 *entry =exec_entry (eb, vma); +const struct drm_i915_gem_exec_object2 *entry = ev->exec;unsigned int remain; urelocs =u64_to_user_ptr (entry->relocs_ptr);
@@ -1489,7 +1483,7 @@ static int eb_relocate_vma(struct i915_execbuffer *eb, struct i915_vma *vma) remain -= count; do { - u64 offset = eb_relocate_entry(eb, vma, r); + u64 offset = eb_relocate_entry(eb, ev, r); if (likely(offset == 0)) { } else if ((s64)offset < 0) {
@@ -1532,16 +1526,16 @@ static int eb_relocate_vma(struct i915_execbuffer *eb, struct i915_vma *vma) }static int -eb_relocate_vma_slow (struct i915_execbuffer *eb,struct i915_vma *vma) +eb_relocate_vma_slow (struct i915_execbuffer *eb,struct eb_vma *ev) { -const struct drm_i915_gem_exec_object2 *entry =exec_entry (eb, vma); +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, vma, &relocs[i]); +u64 offset =eb_relocate_entry (eb, ev, &relocs[i]);if ((s64 )offset <0 ) { err = (int )offset;
@@ -1685,7 +1679,7 @@ static noinline int eb_relocate_slow(struct i915_execbuffer *eb) {struct drm_device *dev = &eb->i915->drm;bool have_copy = false; -struct i915_vma *vma; +struct eb_vma *ev;int err =0 ; repeat:
@@ -1741,15 +1735,15 @@ static noinline int eb_relocate_slow(struct i915_execbuffer *eb)GEM_BUG_ON (!eb->batch); -list_for_each_entry (vma, &eb->relocs, reloc_link) { +list_for_each_entry (ev, &eb->relocs, reloc_link) {if (!have_copy) {pagefault_disable (); - err =eb_relocate_vma (eb, vma); + err =eb_relocate_vma (eb, ev);pagefault_enable ();if (err) goto repeat; }else { - err =eb_relocate_vma_slow (eb, vma); + err =eb_relocate_vma_slow (eb, ev);if (err) goto err; }
@@ -1794,10 +1788,10 @@ static int eb_relocate(struct i915_execbuffer *eb)/* The objects are in their final locations, apply the relocations. */ if (eb->args->flags & __EXEC_HAS_RELOC) { -struct i915_vma *vma; +struct eb_vma *ev; -list_for_each_entry (vma, &eb->relocs, reloc_link) { -if (eb_relocate_vma (eb, vma)) +list_for_each_entry (ev, &eb->relocs, reloc_link) { +if (eb_relocate_vma (eb, ev)) goto slow; } }
@@ -1818,39 +1812,34 @@ static int eb_move_to_gpu(struct i915_execbuffer *eb)ww_acquire_init (&acquire, &reservation_ww_class);for (i =0 ; i < count; i++) { -struct i915_vma *vma = eb->vma[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) -continue ; - -GEM_BUG_ON (err == -EALREADY );/* No duplicate vma */ -if (err == -EDEADLK ) {GEM_BUG_ON (i ==0 );do {int j = i -1 ; -ww_mutex_unlock (&eb->vma[j]->resv->lock); +ww_mutex_unlock (&eb->vma[j].vma->resv->lock); -swap (eb->flags[i], eb->flags[j]);swap (eb->vma[i], eb->vma[j]); - eb->vma[i]->exec_flags = &eb->flags[i]; }while (--i); -GEM_BUG_ON (vma != eb->vma[0 ]); - vma->exec_flags = &eb->flags[0 ]; err =ww_mutex_lock_slow_interruptible (&vma->resv->lock, &acquire); } +if (err == -EALREADY ) + err =0 ;if (err)break ; }ww_acquire_done (&acquire);while (i--) { -unsigned int flags = eb->flags[i]; -struct i915_vma *vma = eb->vma[i]; +struct eb_vma *ev = &eb->vma[i]; +struct i915_vma *vma = ev->vma; +unsigned int flags = ev->flags;struct drm_i915_gem_object *obj = vma->obj;assert_vma_held (vma);
@@ -1894,10 +1883,10 @@ static int eb_move_to_gpu(struct i915_execbuffer *eb)i915_vma_unlock (vma);__eb_unreserve_vma (vma, flags); - vma->exec_flags =NULL ; -if (unlikely (flags & __EXEC_OBJECT_HAS_REF))i915_vma_put (vma); + + ev->vma =NULL ; }ww_acquire_fini (&acquire);
@@ -2017,13 +2006,13 @@ static struct i915_vma *eb_parse(struct i915_execbuffer *eb)if (IS_ERR (vma)) goto err; - batch_start =gen8_canonical_addr (eb->batch->node.start) + + batch_start =gen8_canonical_addr (eb->batch->vma->node.start) + eb->batch_start_offset; shadow_batch_start =gen8_canonical_addr (vma->node.start); err = intel_engine_cmd_parser(eb->engine, - eb->batch->obj, + eb->batch->vma->obj, batch_start, eb->batch_start_offset, eb->batch_len,
@@ -2047,14 +2036,12 @@ static struct i915_vma *eb_parse(struct i915_execbuffer *eb) goto err; } - eb->vma[eb->buffer_count] =i915_vma_get (vma); - eb->flags[eb->buffer_count] = + eb->vma[eb->buffer_count].vma =i915_vma_get (vma); + eb->vma[eb->buffer_count].flags = __EXEC_OBJECT_HAS_PIN | __EXEC_OBJECT_HAS_REF; - vma->exec_flags = &eb->flags[eb->buffer_count]; - eb->buffer_count++; + eb->batch = &eb->vma[eb->buffer_count++]; eb->batch_start_offset =0 ; - eb->batch = vma;if (i915_vma_is_ggtt (vma)) eb->batch_flags |=I915_DISPATCH_SECURE ;
@@ -2081,7 +2068,7 @@ add_to_client(struct i915_request *rq, struct drm_file *file)spin_unlock (&file_priv->mm.lock); } -static int eb_submit (struct i915_execbuffer *eb) +static int eb_submit (struct i915_execbuffer *eb,struct i915_vma *batch) {int err;
@@ -2108,7 +2095,7 @@ static int eb_submit(struct i915_execbuffer *eb) } err = eb->engine->emit_bb_start (eb->request, - eb->batch->node.start + + batch->node.start + eb->batch_start_offset, eb->batch_len, eb->batch_flags);
@@ -2472,6 +2459,7 @@ i915_gem_do_execbuffer(struct drm_device *dev,struct dma_fence *in_fence =NULL ;struct dma_fence *exec_fence =NULL ;struct sync_file *out_fence =NULL ; +struct i915_vma *batch;int out_fence_fd =-1 ;int err;
@@ -2486,9 +2474,8 @@ i915_gem_do_execbuffer(struct drm_device *dev, args->flags |= __EXEC_HAS_RELOC; eb.exec = exec; - eb.vma = (struct i915_vma **)(exec + args->buffer_count +1 ); - eb.vma[0 ] =NULL ; - eb.flags = (unsigned int *)(eb.vma + args->buffer_count +1 ); + 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);
@@ -2572,20 +2559,23 @@ i915_gem_do_execbuffer(struct drm_device *dev, goto err_vma; } -if (unlikely (*eb.batch->exec_flags &EXEC_OBJECT_WRITE )) { +if (unlikely (eb.batch->flags &EXEC_OBJECT_WRITE )) {DRM_DEBUG ("Attempting to use self-modifying batch buffer\n" ); err = -EINVAL ; goto err_vma; } -if (eb.batch_start_offset > eb.batch->size || - eb.batch_len > eb.batch->size - eb.batch_start_offset) { + + batch = eb.batch->vma; +if (range_overflows_t (u64, + eb.batch_start_offset, eb.batch_len, + batch->size)) {DRM_DEBUG ("Attempting to use out-of-bounds batch\n" ); err = -EINVAL ; goto err_vma; }if (eb.batch_len ==0 ) - eb.batch_len = eb.batch->size - eb.batch_start_offset; + eb.batch_len = eb.batch->vma->size - eb.batch_start_offset;if (eb_use_cmdparser (&eb)) {struct i915_vma *vma;
@@ -2614,13 +2604,13 @@ i915_gem_do_execbuffer(struct drm_device *dev,* fitting due to fragmentation. * So this is actually safe. */ - vma =i915_gem_object_ggtt_pin (eb.batch->obj,NULL ,0 ,0 ,0 ); + vma =i915_gem_object_ggtt_pin (batch->obj,NULL ,0 ,0 ,0 );if (IS_ERR (vma)) { err =PTR_ERR (vma); goto err_vma; } - eb.batch = vma; + batch = vma; }/* All GPU relocation batches must be submitted prior to the user rq */
@@ -2667,12 +2657,12 @@ i915_gem_do_execbuffer(struct drm_device *dev,* inactive_list and lose its active reference. Hence we do not need * to explicitly hold another reference here. */ - eb.request->batch = eb.batch; -if (eb.batch->private) -intel_engine_pool_mark_active (eb.batch->private, eb.request); + eb.request->batch = batch; +if (batch->private) +intel_engine_pool_mark_active (batch->private, eb.request);trace_i915_request_queue (eb.request, eb.batch_flags); - err =eb_submit (&eb); + err =eb_submit (&eb, batch); err_request:add_to_client (eb.request, file);i915_request_add (eb.request);
@@ -2693,9 +2683,9 @@ i915_gem_do_execbuffer(struct drm_device *dev, err_batch_unpin:if (eb.batch_flags &I915_DISPATCH_SECURE ) -i915_vma_unpin (eb.batch); -if (eb.batch->private) -intel_engine_pool_put (eb.batch->private); +i915_vma_unpin (batch); +if (batch->private) +intel_engine_pool_put (batch->private); err_vma:if (eb.exec)eb_release_vmas (&eb);
@@ -2718,9 +2708,7 @@ i915_gem_do_execbuffer(struct drm_device *dev,static size_t eb_element_size (void ) { -return (sizeof (struct drm_i915_gem_exec_object2 ) + -sizeof (struct i915_vma *) + -sizeof (unsigned int )); +return sizeof (struct drm_i915_gem_exec_object2 ) +sizeof (struct eb_vma ); }static bool check_buffer_count (size_t count)
drivers/gpu/drm/i915/i915_vma.h +0 -11
@@ -150,21 +150,10 @@ struct i915_vma {struct rb_node obj_node;struct hlist_node obj_hash; -/** This vma's place in the execbuf reservation list */ -struct list_head exec_link; -struct list_head reloc_link; -/** This vma's place in the eviction list */ struct list_head evict_link;struct list_head closed_link; - -/** -* Used for performing relocations during execbuffer insertion. -*/ -unsigned int *exec_flags; -struct hlist_node exec_node; -u32 exec_handle; }; struct i915_vma *
Signature · 6 lines
2.24.0 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 3/5 drm/i915: Add an implementation for i915_gem_ww_ctx locking.
In reply to Maarten Lankhorsti915_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.
--- drivers/gpu/drm/i915/display/intel_display.c | 6 +-- drivers/gpu/drm/i915/display/intel_overlay.c | 2 +- .../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 | 4 +- .../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 +- .../i915/gem/selftests/i915_gem_object_blt.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 | 54 +++++++++++++++++-- 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 | 4 +- 27 files changed, 181 insertions(+), 50 deletions(-)
drivers/gpu/drm/i915/display/intel_display.c +3 -3
@@ -2159,7 +2159,7 @@ intel_pin_and_fence_fb_obj(struct drm_framebuffer *fb,* pin/unpin/fence and not more. */ wakeref =intel_runtime_pm_get (&dev_priv->runtime_pm); -i915_gem_object_lock (obj); +i915_gem_object_lock (NULL , obj);atomic_inc (&dev_priv->gpu_error.pending_fb_pin);
@@ -2221,7 +2221,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 (NULL , vma->obj);if (flags &PLANE_HAS_FENCE )i915_vma_unpin_fence (vma);i915_gem_object_unpin_from_display_plane (vma);
@@ -16348,7 +16348,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 (NULL , obj); tiling =i915_gem_object_get_tiling (obj); stride =i915_gem_object_get_stride (obj);i915_gem_object_unlock (obj);
drivers/gpu/drm/i915/display/intel_overlay.c +1 -1
@@ -758,7 +758,7 @@ static int intel_overlay_do_put_image(struct intel_overlay *overlay,atomic_inc (&dev_priv->gpu_error.pending_fb_pin); -i915_gem_object_lock (new_bo); +i915_gem_object_lock (NULL , new_bo); vma =i915_gem_object_pin_to_display_plane (new_bo,0 ,NULL ,PIN_MAPPABLE );i915_gem_object_unlock (new_bo);
drivers/gpu/drm/i915/gem/i915_gem_client_blt.c +1 -1
@@ -287,7 +287,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 (NULL , obj); err = i915_sw_fence_await_reservation(&work->wait, obj->base.resv, NULL, true, I915_FENCE_TIMEOUT,
drivers/gpu/drm/i915/gem/i915_gem_context.c +1 -1
@@ -114,7 +114,7 @@ static void lut_close(struct i915_gem_context *ctx)continue ;rcu_read_unlock (); -i915_gem_object_lock (obj); +i915_gem_object_lock (NULL , obj);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
@@ -124,7 +124,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 (NULL , obj);if (err) goto out;
@@ -145,7 +145,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 (NULL , obj);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 (NULL , obj);__i915_gem_object_flush_for_display (obj);i915_gem_object_unlock (obj); }
@@ -291,7 +291,7 @@ int i915_gem_set_caching_ioctl(struct drm_device *dev, void *data,if (ret) goto out; - ret =i915_gem_object_lock_interruptible (obj); + ret =i915_gem_object_lock_interruptible (NULL , obj);if (ret ==0 ) { ret =i915_gem_object_set_cache_level (obj, level);i915_gem_object_unlock (obj);
@@ -551,7 +551,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 (NULL , obj);if (err) goto out_unpin;
@@ -591,7 +591,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 (NULL , obj);if (ret)return ret;
@@ -645,7 +645,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 (NULL , obj);if (ret)return ret;
drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c +2 -2
@@ -797,7 +797,7 @@ static int eb_lookup_vmas(struct i915_execbuffer *eb) lut->handle = handle; lut->ctx = eb->gem_context; -i915_gem_object_lock (obj); +i915_gem_object_lock (NULL , obj);list_add (&lut->obj_link, &obj->lut_list);i915_gem_object_unlock (obj);
@@ -1030,7 +1030,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 (NULL , obj); 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
@@ -104,7 +104,7 @@ void i915_gem_close_object(struct drm_gem_object *gem, struct drm_file *file)struct i915_mmap_offset *mmo;LIST_HEAD (close); -i915_gem_object_lock (obj); +i915_gem_object_lock (NULL , obj);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
@@ -103,20 +103,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 i915_gem_ww_ctx *ww, +struct drm_i915_gem_object *obj, +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 i915_gem_ww_ctx *ww, +struct drm_i915_gem_object *obj) { -return dma_resv_trylock (obj->base.resv); +return __i915_gem_object_lock (ww, obj, 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 i915_gem_ww_ctx *ww, +struct drm_i915_gem_object *obj) { -return dma_resv_lock_interruptible (obj->base.resv,NULL ); +WARN_ON (ww && !ww->intr); +return __i915_gem_object_lock (ww, obj, 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
@@ -142,7 +142,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 (NULL , obj);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 (NULL , obj);WARN_ON (i915_gem_object_set_to_gtt_domain (obj, false));i915_gem_object_unlock (obj);i915_gem_object_put (obj);
drivers/gpu/drm/i915/gem/i915_gem_tiling.c +1 -1
@@ -236,7 +236,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 (NULL , obj);if (i915_gem_object_is_framebuffer (obj)) {i915_gem_object_unlock (obj);return -EBUSY ;
drivers/gpu/drm/i915/gem/selftests/huge_pages.c +2 -2
@@ -974,7 +974,7 @@ static int gpu_write(struct intel_context *ce, {int err; -i915_gem_object_lock (vma->obj); +i915_gem_object_lock (NULL , vma->obj); err =i915_gem_object_set_to_gtt_domain (vma->obj, true);i915_gem_object_unlock (vma->obj);if (err)
@@ -1022,7 +1022,7 @@ static int __cpu_check_lmem(struct drm_i915_gem_object *obj, u32 dword, u32 val)unsigned long n;int err; -i915_gem_object_lock (obj); +i915_gem_object_lock (NULL , obj); err =i915_gem_object_set_to_wc_domain (obj, false);i915_gem_object_unlock (obj);if (err)
drivers/gpu/drm/i915/gem/selftests/i915_gem_client_blt.c +1 -1
@@ -72,7 +72,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 (NULL , obj); 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 (NULL , ctx->obj); 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 (NULL , ctx->obj); 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 (NULL , ctx->obj); err =i915_gem_object_set_to_wc_domain (ctx->obj, true);i915_gem_object_unlock (ctx->obj);if (err)
@@ -168,7 +168,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 (NULL , ctx->obj); err =i915_gem_object_set_to_wc_domain (ctx->obj, false);i915_gem_object_unlock (ctx->obj);if (err)
@@ -191,7 +191,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 (NULL , ctx->obj); 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 (NULL , obj); err =i915_gem_object_set_to_gtt_domain (obj, false);i915_gem_object_unlock (obj);if (err)
@@ -1658,7 +1658,7 @@ static int read_from_scratch(struct i915_gem_context *ctx,i915_request_add (rq); -i915_gem_object_lock (obj); +i915_gem_object_lock (NULL , obj); 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
@@ -102,7 +102,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 (NULL , obj); err =i915_gem_object_set_to_gtt_domain (obj, true);i915_gem_object_unlock (obj);if (err) {
@@ -187,7 +187,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 (NULL , obj); 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_object_blt.c +2 -2
@@ -276,7 +276,7 @@ static int igt_fill_blt_thread(void *arg)if (err) goto err_unpin; -i915_gem_object_lock (obj); +i915_gem_object_lock (NULL , obj); err =i915_gem_object_set_to_cpu_domain (obj, false);i915_gem_object_unlock (obj);if (err)
@@ -397,7 +397,7 @@ static int igt_copy_blt_thread(void *arg)if (err) goto err_unpin; -i915_gem_object_lock (dst); +i915_gem_object_lock (NULL , dst); err =i915_gem_object_set_to_cpu_domain (dst, false);i915_gem_object_unlock (dst);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 (NULL , obj); 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 (NULL , results);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
@@ -2954,7 +2954,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 (NULL , obj); ret =i915_gem_object_set_to_cpu_domain (obj, false);i915_gem_object_unlock (obj);if (ret) {
drivers/gpu/drm/i915/i915_gem.c +50 -4
84 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 (NULL , obj); 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 +2 -2
@@ -273,7 +273,7 @@ static int igt_cpu_check(struct drm_i915_gem_object *obj, u32 dword, u32 val)unsigned long n;int err; -i915_gem_object_lock (obj); +i915_gem_object_lock (NULL , obj); err =i915_gem_object_set_to_wc_domain (obj, false);i915_gem_object_unlock (obj);if (err)
@@ -512,7 +512,7 @@ static int igt_lmem_write_cpu(void *arg)if (err) goto out_unpin; -i915_gem_object_lock (obj); +i915_gem_object_lock (NULL , obj); err =i915_gem_object_set_to_wc_domain (obj, true);i915_gem_object_unlock (obj);if (err)
Signature · 6 lines
2.24.0 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 4/5 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 ++++++------------- 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 | 9 +++++++-- drivers/gpu/drm/i915/gvt/cmd_parser.c | 9 ++++++++- drivers/gpu/drm/i915/i915_cmd_parser.c | 16 ++++++++++++++- 8 files changed, 59 insertions(+), 27 deletions(-)
drivers/gpu/drm/i915/gem/i915_gem_domain.c +6 -14
@@ -591,19 +591,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 (NULL , obj); -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 )) {
@@ -631,8 +629,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; }
@@ -645,20 +641,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 (NULL , obj); -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 )) {
@@ -695,7 +689,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_object.h +0 -1
@@ -427,7 +427,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
@@ -991,9 +991,10 @@ __cpu_check_shmem(struct drm_i915_gem_object *obj, u32 dword, u32 val)unsigned long n;int err; +i915_gem_object_lock (NULL , obj); 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));
@@ -1013,6 +1014,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 (NULL , ctx->obj); 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 (NULL , ctx->obj); 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 (NULL , obj); 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 (NULL , obj); 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 +7 -2
@@ -196,6 +196,8 @@ int intel_renderstate_init(struct intel_renderstate *so,if (err) goto err_vma; +i915_gem_object_lock (NULL , so->vma->obj); + err =render_state_setup (so, engine->i915);if (err) goto err_unpin;
@@ -203,6 +205,7 @@ int intel_renderstate_init(struct intel_renderstate *so,return 0 ; err_unpin: +i915_gem_object_unlock (so->vma->obj);i915_vma_unpin (so->vma); err_vma:i915_vma_close (so->vma);
@@ -235,16 +238,18 @@ int intel_renderstate_emit(struct intel_renderstate *so,return err; } -i915_vma_lock (so->vma); err =i915_request_await_object (rq, so->vma->obj, false);if (err ==0 ) err =i915_vma_move_to_active (so->vma, rq,0 ); -i915_vma_unlock (so->vma);return err; }void intel_renderstate_fini (struct intel_renderstate *so) { +if (!so->vma) +return ; + +i915_gem_object_unlock (so->vma->obj);i915_vma_unpin_and_release (&so->vma,0 ); }
drivers/gpu/drm/i915/gvt/cmd_parser.c +8 -1
@@ -1865,10 +1865,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 (NULL , bb->obj);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);
@@ -1893,6 +1897,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);
@@ -1919,6 +1924,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_cmd_parser.c +15 -1
@@ -1136,18 +1136,31 @@ static u32 *copy_batch(struct drm_i915_gem_object *dst_obj,void *dst, *src;int ret; - ret =i915_gem_object_prepare_write (dst_obj, &dst_needs_clflush); + ret =i915_gem_object_lock_interruptible (NULL , dst_obj);if (ret)return ERR_PTR (ret); + ret =i915_gem_object_prepare_write (dst_obj, &dst_needs_clflush); +if (ret) { +i915_gem_object_unlock (dst_obj); +return ERR_PTR (ret); + } + dst =i915_gem_object_pin_map (dst_obj,I915_MAP_FORCE_WB );i915_gem_object_finish_access (dst_obj); +i915_gem_object_unlock (dst_obj); +if (IS_ERR (dst))return dst; + ret =i915_gem_object_lock_interruptible (NULL , src_obj); +if (ret) +return ERR_PTR (ret); + ret =i915_gem_object_prepare_read (src_obj, &src_needs_clflush);if (ret) {i915_gem_object_unpin_map (dst_obj); +i915_gem_object_unlock (src_obj);return ERR_PTR (ret); }
@@ -1196,6 +1209,7 @@ static u32 *copy_batch(struct drm_i915_gem_object *dst_obj, }i915_gem_object_finish_access (src_obj); +i915_gem_object_unlock (src_obj);/* dst_obj is returned with vmap pinned */ *needs_clflush_after = dst_needs_clflush &CLFLUSH_AFTER ;
Signature · 6 lines
2.24.0 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
RFC PATCH 5/5 drm/i915: Parallel execbuf wip
In reply to Maarten LankhorstDoesn't work yet, but shows the direction I'm going.
Instead of relying on struct_mutex, we rely on the object locks to paralellize submission.
Currently we still have some issues because eb_lookup_vmas() pins the vma, and parallel submission doesn't work yet completely. I'm hoping to find out a good way to handle this. Ideally we drop the pinning, and rely only on object lock, but unfortunately the driver doesn't support it yet.
Posting this as a RFC, to get some feedback on the direction we should be going.
--- .../gpu/drm/i915/gem/i915_gem_execbuffer.c | 295 ++++++++++-------- drivers/gpu/drm/i915/i915_cmd_parser.c | 15 +- drivers/gpu/drm/i915/i915_drv.h | 6 - 3 files changed, 171 insertions(+), 145 deletions(-)
drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c +170 -125
@@ -234,6 +234,8 @@ struct i915_execbuffer {struct drm_i915_gem_exec_object2 *exec;/** ioctl execobj[] */ struct eb_vma *vma; +struct i915_gem_ww_ctx ww; +struct intel_engine_cs *engine;/** engine to queue the request to */ struct intel_context *context;/* logical state for the request */ struct i915_gem_context *gem_context;/** caller's context */
@@ -286,6 +288,9 @@ struct i915_execbuffer {struct hlist_head *buckets;/** ht for relocation handles */ }; +static int eb_parse (struct i915_execbuffer *eb, +struct intel_engine_pool_node *pool); +/* * Used to convert any address to canonical form. * Starting from gen8, some commands (e.g. STATE_BASE_ADDRESS,
@@ -504,8 +509,10 @@ eb_add_vma(struct i915_execbuffer *eb,if (!(eb->args->flags & __EXEC_VALIDATED)) { err =eb_validate_vma (eb, entry, vma); -if (unlikely (err)) +if (unlikely (err)) { +DRM_DEBUG_DRIVER ("eb_validate_vma => %i\n" , err);return err; + } } ev->vma = vma;
@@ -551,8 +558,10 @@ eb_add_vma(struct i915_execbuffer *eb,eb_unreserve_vma (ev);list_add_tail (&ev->bind_link, &eb->unbound); -if (drm_mm_node_allocated (&vma->node)) +if (drm_mm_node_allocated (&vma->node)) { err =i915_vma_unbind (vma); +WARN (err,"i915_vma_unbind => %i\n" , err); + } }return err; }
@@ -574,7 +583,7 @@ static inline int use_cpu_reloc(const struct reloc_cache *cache, obj->cache_level != I915_CACHE_NONE); } -static int eb_reserve_vma (const struct i915_execbuffer *eb,struct eb_vma *ev) +static int eb_reserve_vma (struct i915_execbuffer *eb,struct eb_vma *ev) {struct drm_i915_gem_exec_object2 *entry = ev->exec;unsigned int exec_flags = ev->flags;
@@ -582,6 +591,10 @@ static int eb_reserve_vma(const struct i915_execbuffer *eb, struct eb_vma *ev)u64 pin_flags;int err; + err =i915_gem_object_lock (&eb->ww, vma->obj); +if (err) +return err; + pin_flags =PIN_USER |PIN_NONBLOCK ;if (exec_flags &EXEC_OBJECT_NEEDS_GTT ) pin_flags |=PIN_GLOBAL ;
@@ -797,9 +810,7 @@ static int eb_lookup_vmas(struct i915_execbuffer *eb) lut->handle = handle; lut->ctx = eb->gem_context; -i915_gem_object_lock (NULL , obj);list_add (&lut->obj_link, &obj->lut_list); -i915_gem_object_unlock (obj); add_vma: err =eb_add_vma (eb, i, batch, vma);
@@ -812,15 +823,33 @@ static int eb_lookup_vmas(struct i915_execbuffer *eb)mutex_unlock (&eb->gem_context->mutex); +if (unlikely (eb->batch->flags &EXEC_OBJECT_WRITE )) { +DRM_DEBUG ("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_DEBUG ("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; + eb->args->flags |= __EXEC_VALIDATED;return eb_reserve (eb); err_obj:i915_gem_object_put (obj); +DRM_DEBUG_DRIVER ("err_obj() => %i\n" , err); err_vma: eb->vma[i].vma =NULL ; +DRM_DEBUG_DRIVER ("err_vma() => %i\n" , err); err_ctx:mutex_unlock (&eb->gem_context->mutex); +DRM_DEBUG_DRIVER ("err_ctx() => %i\n" , err);return err; }
@@ -866,6 +895,15 @@ static void eb_release_vmas(const struct i915_execbuffer *eb) } } +static void eb_unreserve_vmas (struct i915_execbuffer *eb) +{ +const unsigned int count = eb->buffer_count; +unsigned int i; + +for (i =0 ; i < count; i++) +eb_unreserve_vma (&eb->vma[i]); +} +static void eb_reset_vmas (const struct i915_execbuffer *eb) {eb_release_vmas (eb);
@@ -1121,7 +1159,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 );
@@ -1131,8 +1169,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; }
@@ -1190,11 +1226,10 @@ static int __reloc_gpu_alloc(struct i915_execbuffer *eb,if (err) goto skip_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;
@@ -1445,6 +1480,11 @@ static int eb_relocate_vma(struct i915_execbuffer *eb, struct eb_vma *ev)struct drm_i915_gem_relocation_entry __user *urelocs;const struct drm_i915_gem_exec_object2 *entry = ev->exec;unsigned int remain; +int err; + + err =i915_gem_object_lock (&eb->ww, ev->vma->obj); +if (err) +return err; urelocs =u64_to_user_ptr (entry->relocs_ptr); remain = entry->relocation_count;
@@ -1675,14 +1715,35 @@ static int eb_prefault_relocations(const struct i915_execbuffer *eb)return 0 ; } +static int eb_lock_and_parse_cmdbuffer (struct i915_execbuffer *eb) +{ +struct intel_engine_pool_node *pool; +int err; + +if (!eb_use_cmdparser (eb)) +return 0 ; + + pool =intel_engine_get_pool (eb->engine, eb->batch_len); +if (IS_ERR (pool)) +return PTR_ERR (pool); + + err =i915_gem_object_lock (&eb->ww, pool->obj); +if (!err) + err =eb_parse (eb, pool); + +if (err) +intel_engine_pool_put (pool); + +return err; +} + static noinline int eb_relocate_slow(struct i915_execbuffer *eb) { -struct drm_device *dev = &eb->i915->drm;bool have_copy = false;struct eb_vma *ev;int err =0 ; -repeat: +repeat_pass:if (signal_pending (current)) { err = -ERESTARTSYS ; goto out;
@@ -1690,10 +1751,10 @@ static noinline int eb_relocate_slow(struct i915_execbuffer *eb)/* We may process another execbuffer during the unlock... */ eb_reset_vmas (eb); -mutex_unlock (&dev->struct_mutex); +i915_gem_ww_ctx_fini (&eb->ww);/* -* We take 3 passes through the slowpatch. +* We take 3 passes through the slowpath. * * 1 - we try to just prefault all the user relocation entries and * then attempt to reuse the atomic pagefault disabled fast path again.
@@ -1714,20 +1775,14 @@ static noinline int eb_relocate_slow(struct i915_execbuffer *eb)cond_resched (); err =0 ; } -if (err) { -mutex_lock (&dev->struct_mutex); +i915_gem_ww_ctx_init (&eb->ww, true); +if (err) goto out; - }/* A frequent cause for EAGAIN are currently unavailable client pages */ flush_workqueue (eb->i915->mm.userptr_wq); - err =i915_mutex_lock_interruptible (dev); -if (err) { -mutex_lock (&dev->struct_mutex); - goto out; - } - +repeat_reloc:/* reacquire the objects */ err =eb_lookup_vmas (eb);if (err)
@@ -1740,8 +1795,10 @@ static noinline int eb_relocate_slow(struct i915_execbuffer *eb)pagefault_disable (); err =eb_relocate_vma (eb, ev);pagefault_enable (); -if (err) - goto repeat; +if (err == -EDEADLK ) + goto err; +else if (err) + goto repeat_pass; }else { err =eb_relocate_vma_slow (eb, ev);if (err)
@@ -1749,6 +1806,9 @@ static noinline int eb_relocate_slow(struct i915_execbuffer *eb) } } +if (!err) + err =eb_lock_and_parse_cmdbuffer (eb); +/* * Leave the user relocations as are, this is the painfully slow path, * and we want to avoid the complication of dropping the lock whilst
@@ -1757,8 +1817,15 @@ static noinline int eb_relocate_slow(struct i915_execbuffer *eb)*/ err: +if (err == -EDEADLK ) { +eb_reset_vmas (eb); + + err =i915_gem_ww_ctx_backoff (&eb->ww); +if (!err) + goto repeat_reloc; + }if (err == -EAGAIN ) - goto repeat; + goto repeat_pass; out:if (have_copy) {
@@ -1781,60 +1848,79 @@ static noinline int eb_relocate_slow(struct i915_execbuffer *eb)return err; } -static int eb_relocate (struct i915_execbuffer *eb) +static int eb_relocate_fast (struct i915_execbuffer *eb) { -if (eb_lookup_vmas (eb)) - goto slow; +int err;/* The objects are in their final locations, apply the relocations. */ if (eb->args->flags & __EXEC_HAS_RELOC) {struct eb_vma *ev;list_for_each_entry (ev, &eb->relocs, reloc_link) { -if (eb_relocate_vma (eb, ev)) - goto slow; + err =eb_relocate_vma (eb, ev); +if (err) +return err; } }return 0 ; - -slow: -return eb_relocate_slow (eb); } -static int eb_move_to_gpu (struct i915_execbuffer *eb) +static int eb_relocate_and_parse_cmdbuf_backoff (struct i915_execbuffer *eb) { -const unsigned int count = eb->buffer_count; -struct ww_acquire_ctx acquire; -unsigned int i; -int err =0 ; +int err; -ww_acquire_init (&acquire, &reservation_ww_class); + err =eb_lookup_vmas (eb); +if (err) { +DRM_DEBUG_DRIVER ("eb_lookup_vmas() => %i\n" , err); +return err; + } -for (i =0 ; i < count; i++) { -struct eb_vma *ev = &eb->vma[i]; -struct i915_vma *vma = ev->vma; +DRM_DEBUG_DRIVER ("eb_reserve() => %i\n" , err); - err =ww_mutex_lock_interruptible (&vma->resv->lock, &acquire); -if (err == -EDEADLK ) { -GEM_BUG_ON (i ==0 ); -do { -int j = i -1 ; +retry_fast: +if (!err) + err =eb_relocate_fast (eb); +if (!err) { + err =eb_lock_and_parse_cmdbuffer (eb); +DRM_DEBUG_DRIVER ("Parsing cmdbuf returns %i\n" , err); -ww_mutex_unlock (&eb->vma[j].vma->resv->lock); +/* return on success, or any error except -EDEADLK */ +if (err != -EDEADLK ) +return err; + } -swap (eb->vma[i], eb->vma[j]); - }while (--i); +if (err == -EDEADLK ) { +eb_unreserve_vmas (eb); - err =ww_mutex_lock_slow_interruptible (&vma->resv->lock, - &acquire); - } -if (err == -EALREADY ) - err =0 ; + err =i915_gem_ww_ctx_backoff (&eb->ww);if (err) -break ; +return err; + + goto retry_fast; } -ww_acquire_done (&acquire); + + err =eb_relocate_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; + +DRM_DEBUG_DRIVER ("Slow relocation returns %i\n" , err); +return err; +} + +static int eb_move_to_gpu (struct i915_execbuffer *eb) +{ +unsigned int i; +int err =0 ; + +ww_acquire_done (&eb->ww.ctx);while (i--) {struct eb_vma *ev = &eb->vma[i];
@@ -1880,15 +1966,12 @@ 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); -__eb_unreserve_vma (vma, flags);if (unlikely (flags & __EXEC_OBJECT_HAS_REF))i915_vma_put (vma); ev->vma =NULL ; } -ww_acquire_fini (&acquire);if (unlikely (err)) goto err_skip;
@@ -1990,21 +2073,17 @@ shadow_batch_pin(struct i915_execbuffer *eb, struct drm_i915_gem_object *obj)return vma; } -static struct i915_vma *eb_parse (struct i915_execbuffer *eb) +static int eb_parse (struct i915_execbuffer *eb, +struct intel_engine_pool_node *pool) { -struct intel_engine_pool_node *pool;struct i915_vma *vma;u64 batch_start;u64 shadow_batch_start;int err; - pool =intel_engine_get_pool (eb->engine, eb->batch_len); -if (IS_ERR (pool)) -return ERR_CAST (pool); - vma =shadow_batch_pin (eb, pool->obj);if (IS_ERR (vma)) - goto err; +return PTR_ERR (vma); batch_start =gen8_canonical_addr (eb->batch->vma->node.start) + eb->batch_start_offset;
@@ -2028,12 +2107,13 @@ static struct i915_vma *eb_parse(struct i915_execbuffer *eb)* For PPGTT backing however, we have no choice but to forcibly * reject unsafe buffers */ -if (i915_vma_is_ggtt (vma) && err == -EACCES ) +if (i915_vma_is_ggtt (vma) && err == -EACCES ) {/* Execute original buffer non-secure */ - vma =NULL ; -else - vma =ERR_PTR (err); - goto err; +intel_engine_pool_put (pool); +return 0 ; + } + +return err; } eb->vma[eb->buffer_count].vma =i915_vma_get (vma);
@@ -2049,11 +2129,7 @@ static struct i915_vma *eb_parse(struct i915_execbuffer *eb)/* eb->batch_len unchanged */ vma->private = pool; -return vma; - -err: -intel_engine_pool_put (pool); -return vma; +return 0 ; } static void
@@ -2485,6 +2561,7 @@ i915_gem_do_execbuffer(struct drm_device *dev, eb.batch_len = args->batch_len; eb.batch_flags =0 ; +if (args->flags &I915_EXEC_SECURE ) {if (INTEL_GEN (i915) >=11 )return -ENODEV ;
@@ -2529,68 +2606,36 @@ i915_gem_do_execbuffer(struct drm_device *dev, } err =eb_create (&eb); -if (err) +if (err) { +DRM_DEBUG_DRIVER ("eb_create() => %i\n" , err); goto err_out_fence; + }GEM_BUG_ON (!eb.lut_size); err =eb_select_context (&eb); -if (unlikely (err)) +if (unlikely (err)) { +DRM_DEBUG_DRIVER ("eb_select_context() => %i\n" , err); goto err_destroy; + } err =eb_pin_engine (&eb, file, args); -if (unlikely (err)) +if (unlikely (err)) { +DRM_DEBUG_DRIVER ("eb_pin_engine() => %i\n" , err); goto err_context; - - err =i915_mutex_lock_interruptible (dev); -if (err) - goto err_engine; - - err =eb_relocate (&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. -*/ - args->flags &= ~__EXEC_HAS_RELOC; - goto err_vma; } -if (unlikely (eb.batch->flags &EXEC_OBJECT_WRITE )) { -DRM_DEBUG ("Attempting to use self-modifying batch buffer\n" ); - err = -EINVAL ; - goto err_vma; - } +i915_gem_ww_ctx_init (&eb.ww, true); - batch = eb.batch->vma; -if (range_overflows_t (u64, - eb.batch_start_offset, eb.batch_len, - batch->size)) { -DRM_DEBUG ("Attempting to use out-of-bounds batch\n" ); - err = -EINVAL ; + err =eb_relocate_and_parse_cmdbuf_backoff (&eb); +if (err) goto err_vma; - } - -if (eb.batch_len ==0 ) - eb.batch_len = eb.batch->vma->size - eb.batch_start_offset; - -if (eb_use_cmdparser (&eb)) { -struct i915_vma *vma; - - vma =eb_parse (&eb); -if (IS_ERR (vma)) { - err =PTR_ERR (vma); - 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;
@@ -2607,7 +2652,7 @@ i915_gem_do_execbuffer(struct drm_device *dev, vma =i915_gem_object_ggtt_pin (batch->obj,NULL ,0 ,0 ,0 );if (IS_ERR (vma)) { err =PTR_ERR (vma); - goto err_vma; + goto err_pool; } batch = vma;
@@ -2684,13 +2729,13 @@ i915_gem_do_execbuffer(struct drm_device *dev, err_batch_unpin:if (eb.batch_flags &I915_DISPATCH_SECURE )i915_vma_unpin (batch); +err_pool:if (batch->private)intel_engine_pool_put (batch->private); err_vma:if (eb.exec)eb_release_vmas (&eb); -mutex_unlock (&dev->struct_mutex); -err_engine: +i915_gem_ww_ctx_fini (&eb.ww);eb_unpin_engine (&eb); err_context:i915_gem_context_put (eb.gem_context);
drivers/gpu/drm/i915/i915_cmd_parser.c +1 -14
@@ -1136,31 +1136,19 @@ static u32 *copy_batch(struct drm_i915_gem_object *dst_obj,void *dst, *src;int ret; - ret =i915_gem_object_lock_interruptible (NULL , dst_obj); + ret =i915_gem_object_prepare_write (dst_obj, &dst_needs_clflush);if (ret)return ERR_PTR (ret); - ret =i915_gem_object_prepare_write (dst_obj, &dst_needs_clflush); -if (ret) { -i915_gem_object_unlock (dst_obj); -return ERR_PTR (ret); - } - dst =i915_gem_object_pin_map (dst_obj,I915_MAP_FORCE_WB );i915_gem_object_finish_access (dst_obj); -i915_gem_object_unlock (dst_obj);if (IS_ERR (dst))return dst; - ret =i915_gem_object_lock_interruptible (NULL , src_obj); -if (ret) -return ERR_PTR (ret); - ret =i915_gem_object_prepare_read (src_obj, &src_needs_clflush);if (ret) {i915_gem_object_unpin_map (dst_obj); -i915_gem_object_unlock (src_obj);return ERR_PTR (ret); }
@@ -1209,7 +1197,6 @@ static u32 *copy_batch(struct drm_i915_gem_object *dst_obj, }i915_gem_object_finish_access (src_obj); -i915_gem_object_unlock (src_obj);/* dst_obj is returned with vmap pinned */ *needs_clflush_after = dst_needs_clflush &CLFLUSH_AFTER ;
drivers/gpu/drm/i915/i915_drv.h +0 -6
@@ -1848,12 +1848,6 @@ int i915_gem_object_unbind(struct drm_i915_gem_object *obj,void i915_gem_runtime_suspend (struct drm_i915_private *dev_priv); -static inline int __must_check -i915_mutex_lock_interruptible (struct drm_device *dev) -{ -return mutex_lock_interruptible (&dev->struct_mutex); -} -int i915_gem_dumb_create (struct drm_file *file_priv,struct drm_device *dev,struct drm_mode_create_dumb *args);
Signature · 6 lines
2.24.0 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI[Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915/gem: Parallel execbuf WIP.
In reply to Maarten Lankhorst== Series Details ==
== Series Details ==
Series: drm/i915/gem: Parallel execbuf WIP.
URL : https://patchwork.freedesktop.org/series/70569/
State : warning
== Summary ==
$ dim checkpatch origin/drm-tip
0c62594b8ba6 drm/i915: Drop inspection of execbuf flags during evict
39b1b1474c8a drm/i915/gem: Extract transient execbuf flags from i915_vma
fc4c279ce55f drm/i915: Add an implementation for i915_gem_ww_ctx locking.
-:551: WARNING:LONG_LINE: line over 100 characters
#551: FILE: drivers/gpu/drm/i915/i915_gem.c:1576:
+ while ((obj = list_first_entry_or_null(&ww->obj_list, struct drm_i915_gem_object, obj_link))) {total: 0 errors, 1 warnings, 0 checks, 529 lines checkedbeb9fa2b3aa0 drm/i915: Remove locking from i915_gem_object_prepare_read/write60116c1680a0 drm/i915: Parallel execbuf wip
-:17: WARNING:COMMIT_LOG_LONG_LINE: Possible unwrapped commit description (prefer a maximum 75 chars per line) #17:
Posting this as a RFC, to get some feedback on the direction we should be going.
total: 0 errors, 1 warnings, 0 checks, 603 lines checked
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI[Intel-gfx] ✗ Fi.CI.BAT: failure for drm/i915/gem: Parallel execbuf WIP.
In reply to Maarten Lankhorst== Series Details ==
== Series Details ==
Series: drm/i915/gem: Parallel execbuf WIP.
URL : https://patchwork.freedesktop.org/series/70569/
State : failure
== Summary ==
CI Bug Log - changes from CI_DRM_7500 -> Patchwork_15631
====================================================
Summary
-------
**FAILURE**
Serious unknown changes coming with Patchwork_15631 absolutely need to be verified manually.
If you think the reported changes have nothing to do with the changes introduced in Patchwork_15631, 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_15631/index.html
Possible new issues
-------------------
Here are the unknown changes that may have been introduced in Patchwork_15631:
### IGT changes ###
#### Possible regressions ####
* igt@gem_busy@busy-all:
- fi-bsw-nick: [PASS][1] -> [INCOMPLETE][2]
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7500/fi-bsw-nick/igt@[email protected]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15631/fi-bsw-nick/igt@[email protected]
- fi-kbl-8809g: [PASS][3] -> [FAIL][4]
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7500/fi-kbl-8809g/igt@[email protected]
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15631/fi-kbl-8809g/igt@[email protected]
- fi-icl-guc: [PASS][5] -> [FAIL][6] +4 similar issues
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7500/fi-icl-guc/igt@[email protected]
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15631/fi-icl-guc/igt@[email protected]
- fi-kbl-r: [PASS][7] -> [FAIL][8]
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7500/fi-kbl-r/igt@[email protected]
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15631/fi-kbl-r/igt@[email protected]
- fi-bsw-kefka: [PASS][9] -> [INCOMPLETE][10]
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7500/fi-bsw-kefka/igt@[email protected]
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15631/fi-bsw-kefka/igt@[email protected]
- fi-icl-dsi: [PASS][11] -> [FAIL][12]
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7500/fi-icl-dsi/igt@[email protected]
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15631/fi-icl-dsi/igt@[email protected]
- fi-hsw-peppy: [PASS][13] -> [FAIL][14] +1 similar issue
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7500/fi-hsw-peppy/igt@[email protected]
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15631/fi-hsw-peppy/igt@[email protected]
- fi-snb-2520m: [PASS][15] -> [FAIL][16]
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7500/fi-snb-2520m/igt@[email protected]
[16]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15631/fi-snb-2520m/igt@[email protected]
- fi-ivb-3770: [PASS][17] -> [FAIL][18] +2 similar issues
[17]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7500/fi-ivb-3770/igt@[email protected]
[18]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15631/fi-ivb-3770/igt@[email protected]
- fi-blb-e6850: [PASS][19] -> [INCOMPLETE][20]
[19]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7500/fi-blb-e6850/igt@[email protected]
[20]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15631/fi-blb-e6850/igt@[email protected]
- fi-cml-s: [PASS][21] -> [FAIL][22] +1 similar issue
[21]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7500/fi-cml-s/igt@[email protected]
[22]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15631/fi-cml-s/igt@[email protected]
- fi-bsw-n3050: [PASS][23] -> [INCOMPLETE][24]
[23]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7500/fi-bsw-n3050/igt@[email protected]
[24]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15631/fi-bsw-n3050/igt@[email protected]
- fi-ilk-650: [PASS][25] -> [INCOMPLETE][26]
[25]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7500/fi-ilk-650/igt@[email protected]
[26]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15631/fi-ilk-650/igt@[email protected]
- fi-snb-2600: [PASS][27] -> [FAIL][28]
[27]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7500/fi-snb-2600/igt@[email protected]
[28]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15631/fi-snb-2600/igt@[email protected]
* igt@gem_close_race@basic-process:
- fi-bwr-2160: [PASS][29] -> [TIMEOUT][30]
[29]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7500/fi-bwr-2160/igt@[email protected]
[30]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15631/fi-bwr-2160/igt@[email protected]
* igt@gem_close_race@basic-threads:
- fi-skl-guc: [PASS][31] -> [FAIL][32] +1 similar issue
[31]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7500/fi-skl-guc/igt@[email protected]
[32]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15631/fi-skl-guc/igt@[email protected]
- fi-kbl-guc: [PASS][33] -> [FAIL][34] +1 similar issue
[33]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7500/fi-kbl-guc/igt@[email protected]
[34]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15631/fi-kbl-guc/igt@[email protected]
- fi-kbl-soraka: [PASS][35] -> [FAIL][36] +1 similar issue
[35]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7500/fi-kbl-soraka/igt@[email protected]
[36]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15631/fi-kbl-soraka/igt@[email protected]
- fi-snb-2600: [PASS][37] -> [DMESG-WARN][38]
[37]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7500/fi-snb-2600/igt@[email protected]
[38]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15631/fi-snb-2600/igt@[email protected]
- fi-snb-2520m: [PASS][39] -> [DMESG-WARN][40]
[39]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7500/fi-snb-2520m/igt@[email protected]
[40]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15631/fi-snb-2520m/igt@[email protected]
* igt@gem_ctx_create@basic-files:
- fi-kbl-r: [PASS][41] -> [DMESG-WARN][42]
[41]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7500/fi-kbl-r/igt@[email protected]
[42]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15631/fi-kbl-r/igt@[email protected]
- fi-kbl-8809g: [PASS][43] -> [DMESG-WARN][44]
[43]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7500/fi-kbl-8809g/igt@[email protected]
[44]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15631/fi-kbl-8809g/igt@[email protected]
- fi-hsw-4770: [PASS][45] -> [FAIL][46] +2 similar issues
[45]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7500/fi-hsw-4770/igt@[email protected]
[46]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15631/fi-hsw-4770/igt@[email protected]
- fi-skl-guc: [PASS][47] -> [DMESG-WARN][48]
[47]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7500/fi-skl-guc/igt@[email protected]
[48]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15631/fi-skl-guc/igt@[email protected]
- fi-kbl-soraka: [PASS][49] -> [DMESG-WARN][50]
[49]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7500/fi-kbl-soraka/igt@[email protected]
[50]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15631/fi-kbl-soraka/igt@[email protected]
- fi-kbl-guc: [PASS][51] -> [DMESG-WARN][52]
[51]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7500/fi-kbl-guc/igt@[email protected]
[52]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15631/fi-kbl-guc/igt@[email protected]
* igt@gem_ctx_switch@rcs0:
- fi-hsw-peppy: [PASS][53] -> [TIMEOUT][54]
[53]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7500/fi-hsw-peppy/igt@[email protected]
[54]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15631/fi-hsw-peppy/igt@[email protected]
* igt@gem_exec_create@basic:
- fi-bdw-5557u: [PASS][55] -> [FAIL][56] +3 similar issues
[55]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7500/fi-bdw-5557u/igt@[email protected]
[56]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15631/fi-bdw-5557u/igt@[email protected]
* igt@gem_exec_fence@basic-await-default:
- fi-icl-guc: [PASS][57] -> [DMESG-FAIL][58]
[57]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7500/fi-icl-guc/igt@[email protected]
[58]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15631/fi-icl-guc/igt@[email protected]
- fi-icl-u2: NOTRUN -> [DMESG-FAIL][59]
[59]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15631/fi-icl-u2/igt@[email protected]
- fi-bdw-5557u: [PASS][60] -> [DMESG-FAIL][61]
[60]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7500/fi-bdw-5557u/igt@[email protected]
[61]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15631/fi-bdw-5557u/igt@[email protected]
* igt@gem_exec_fence@basic-busy-default:
- fi-ivb-3770: [PASS][62] -> [DMESG-FAIL][63]
[62]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7500/fi-ivb-3770/igt@[email protected]
[63]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15631/fi-ivb-3770/igt@[email protected]
- fi-icl-u2: NOTRUN -> [FAIL][64] +6 similar issues
[64]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15631/fi-icl-u2/igt@[email protected]
- fi-hsw-4770: [PASS][65] -> [TIMEOUT][66]
[65]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7500/fi-hsw-4770/igt@[email protected]
[66]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15631/fi-hsw-4770/igt@[email protected]
* igt@runner@aborted:
- fi-hsw-peppy: NOTRUN -> [FAIL][67]
[67]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15631/fi-hsw-peppy/igt@[email protected]
- fi-kbl-8809g: NOTRUN -> [FAIL][68]
[68]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15631/fi-kbl-8809g/igt@[email protected]
- fi-snb-2520m: NOTRUN -> [FAIL][69]
[69]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15631/fi-snb-2520m/igt@[email protected]
- fi-kbl-r: NOTRUN -> [FAIL][70]
[70]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15631/fi-kbl-r/igt@[email protected]
- fi-kbl-soraka: NOTRUN -> [FAIL][71]
[71]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15631/fi-kbl-soraka/igt@[email protected]
- fi-hsw-4770: NOTRUN -> [FAIL][72]
[72]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15631/fi-hsw-4770/igt@[email protected]
- fi-kbl-guc: NOTRUN -> [FAIL][73]
[73]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15631/fi-kbl-guc/igt@[email protected]
- fi-snb-2600: NOTRUN -> [FAIL][74]
[74]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15631/fi-snb-2600/igt@[email protected]
#### Suppressed ####
The following results come from untrusted machines, tests, or statuses. They do not affect the overall result.
* igt@gem_busy@busy-all:
- {fi-kbl-7560u}: [PASS][75] -> [FAIL][76] +1 similar issue
[75]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7500/fi-kbl-7560u/igt@[email protected]
[76]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15631/fi-kbl-7560u/igt@[email protected]
- {fi-tgl-u}: [PASS][77] -> [FAIL][78]
[77]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7500/fi-tgl-u/igt@[email protected]
[78]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15631/fi-tgl-u/igt@[email protected]
* igt@gem_ctx_create@basic-files:
- {fi-kbl-7560u}: [PASS][79] -> [DMESG-WARN][80]
[79]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7500/fi-kbl-7560u/igt@[email protected]
[80]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15631/fi-kbl-7560u/igt@[email protected]
* igt@runner@aborted:
- {fi-kbl-7560u}: NOTRUN -> [FAIL][81]
[81]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15631/fi-kbl-7560u/igt@[email protected]
Known issues
------------
Here are the changes found in Patchwork_15631 that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@gem_busy@busy-all:
- fi-bdw-5557u: [PASS][82] -> [FAIL][83] ([fdo#112270])
[82]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7500/fi-bdw-5557u/igt@[email protected]
[83]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15631/fi-bdw-5557u/igt@[email protected]
- fi-byt-n2820: [PASS][84] -> [INCOMPLETE][85] ([i915#45])
[84]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7500/fi-byt-n2820/igt@[email protected]
[85]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15631/fi-byt-n2820/igt@[email protected]
- fi-pnv-d510: [PASS][86] -> [INCOMPLETE][87] ([i915#299])
[86]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7500/fi-pnv-d510/igt@[email protected]
[87]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15631/fi-pnv-d510/igt@[email protected]
- fi-apl-guc: [PASS][88] -> [INCOMPLETE][89] ([fdo#103927])
[88]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7500/fi-apl-guc/igt@[email protected]
[89]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15631/fi-apl-guc/igt@[email protected]
- fi-glk-dsi: [PASS][90] -> [INCOMPLETE][91] ([i915#58] / [k.org#198133])
[90]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7500/fi-glk-dsi/igt@[email protected]
[91]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15631/fi-glk-dsi/igt@[email protected]
- fi-elk-e7500: [PASS][92] -> [INCOMPLETE][93] ([i915#66])
[92]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7500/fi-elk-e7500/igt@[email protected]
[93]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15631/fi-elk-e7500/igt@[email protected]
- fi-byt-j1900: [PASS][94] -> [INCOMPLETE][95] ([i915#45])
[94]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7500/fi-byt-j1900/igt@[email protected]
[95]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15631/fi-byt-j1900/igt@[email protected]
- fi-bxt-dsi: [PASS][96] -> [INCOMPLETE][97] ([fdo#103927])
[96]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7500/fi-bxt-dsi/igt@[email protected]
[97]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15631/fi-bxt-dsi/igt@[email protected]
* igt@gem_close_race@basic-process:
- fi-gdg-551: [PASS][98] -> [INCOMPLETE][99] ([i915#172])
[98]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7500/fi-gdg-551/igt@[email protected]
[99]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15631/fi-gdg-551/igt@[email protected]
- fi-icl-dsi: [PASS][100] -> [INCOMPLETE][101] ([i915#140])
[100]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7500/fi-icl-dsi/igt@[email protected]
[101]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15631/fi-icl-dsi/igt@[email protected]
#### Warnings ####
* igt@runner@aborted:
- fi-icl-u2: [FAIL][102] ([fdo#110676] / [fdo#111093] / [k.org#202973]) -> [FAIL][103] ([fdo#111093])
[102]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7500/fi-icl-u2/igt@[email protected]
[103]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15631/fi-icl-u2/igt@[email protected]
- fi-icl-guc: [FAIL][104] ([fdo#110943] / [fdo#111093]) -> [FAIL][105] ([fdo#111093])
[104]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7500/fi-icl-guc/igt@[email protected]
[105]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15631/fi-icl-guc/igt@[email protected]
- fi-cml-s: [FAIL][106] ([fdo#111764] / [i915#577]) -> [FAIL][107] ([i915#577])
[106]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7500/fi-cml-s/igt@[email protected]
[107]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15631/fi-cml-s/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#103927]: https://bugs.freedesktop.org/show_bug.cgi?id=103927
[fdo#110676]: https://bugs.freedesktop.org/show_bug.cgi?id=110676
[fdo#110943]: https://bugs.freedesktop.org/show_bug.cgi?id=110943
[fdo#111093]: https://bugs.freedesktop.org/show_bug.cgi?id=111093
[fdo#111593]: https://bugs.freedesktop.org/show_bug.cgi?id=111593
[fdo#111764]: https://bugs.freedesktop.org/show_bug.cgi?id=111764
[fdo#112270]: https://bugs.freedesktop.org/show_bug.cgi?id=112270
[i915#140]: https://gitlab.freedesktop.org/drm/intel/issues/140
[i915#172]: https://gitlab.freedesktop.org/drm/intel/issues/172
[i915#299]: https://gitlab.freedesktop.org/drm/intel/issues/299
[i915#45]: https://gitlab.freedesktop.org/drm/intel/issues/45
[i915#577]: https://gitlab.freedesktop.org/drm/intel/issues/577
[i915#58]: https://gitlab.freedesktop.org/drm/intel/issues/58
[i915#66]: https://gitlab.freedesktop.org/drm/intel/issues/66
[k.org#198133]: https://bugzilla.kernel.org/show_bug.cgi?id=198133
[k.org#202973]: https://bugzilla.kernel.org/show_bug.cgi?id=202973
Participating hosts (41 -> 33)
------------------------------
Missing (8): fi-hsw-4770r fi-ilk-m540 fi-hsw-4200u fi-byt-squawks fi-bsw-cyan fi-ctg-p8600 fi-byt-clapper fi-bdw-samus
Build changes
-------------
* CI: CI-20190529 -> None
* Linux: CI_DRM_7500 -> Patchwork_15631
CI-20190529: 20190529
CI_DRM_7500: ccec746805883b1cc52d4d7af0e2f2612b6e6993 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_5334: 343aae776a58a67fa153825385e6fe90e3185c5b @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_15631: 60116c1680a06e0ae794334371102dbe8c7c52d9 @ git://anongit.freedesktop.org/gfx-ci/linux
== Linux commits ==
60116c1680a0 drm/i915: Parallel execbuf wipbeb9fa2b3aa0 drm/i915: Remove locking from i915_gem_object_prepare_read/write fc4c279ce55f drm/i915: Add an implementation for i915_gem_ww_ctx locking. 39b1b1474c8a drm/i915/gem: Extract transient execbuf flags from i915_vma 0c62594b8ba6 drm/i915: Drop inspection of execbuf flags during evict
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15631/index.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx