[Intel-gfx] [PULL] drm-misc-next

2020-12-17 Thread Maarten Lankhorst
duler: "node" --> "list" gpu/drm: ring_mirror_list --> pending_list drm/scheduler: Essentialize the job done callback drm/sched: Add missing structure comment Maarten Lankhorst (1): Merge drm/drm-next into drm-misc-next Maxime Ripard (20): dr

[Intel-gfx] [PATCH v6 40/64] drm/i915: Use a single page table lock for each gtt.

2021-01-05 Thread Maarten Lankhorst
: Maarten Lankhorst Reviewed-by: Thomas Hellström --- drivers/gpu/drm/i915/gt/intel_ggtt.c | 8 +- drivers/gpu/drm/i915/gt/intel_gtt.c | 38 ++- drivers/gpu/drm/i915/gt/intel_gtt.h | 5 drivers/gpu/drm/i915/gt/intel_ppgtt.c | 3 ++- drivers/gpu/drm/i915

[Intel-gfx] [PATCH v6 00/64] drm/i915: Remove obj->mm.lock!

2021-01-05 Thread Maarten Lankhorst
lock held and it makes it easier that way. Finally we convert all selftests, and then remove obj->mm.lock! Compared to last version, I moved gt_revoke slightly to fix a lockdep splat with reset mutex vs mmu notifier. Maarten Lankhorst (62): drm/i915: Do not share hwsp across contexts any more,

[Intel-gfx] [PATCH v6 46/64] drm/i915/selftests: Prepare execbuf tests for obj->mm.lock removal.

2021-01-05 Thread Maarten Lankhorst
Also quite simple, a single call needs to use the unlocked version. Signed-off-by: Maarten Lankhorst Reviewed-by: Thomas Hellström --- drivers/gpu/drm/i915/gem/selftests/i915_gem_execbuffer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/gem/selftests

[Intel-gfx] [PATCH v6 23/64] drm/i915: Add object locking to vm_fault_cpu

2021-01-05 Thread Maarten Lankhorst
Take a simple lock so we hold ww around (un)pin_pages as needed. Signed-off-by: Maarten Lankhorst Reviewed-by: Thomas Hellström --- drivers/gpu/drm/i915/gem/i915_gem_mman.c | 4 1 file changed, 4 insertions(+) diff --git a/drivers/gpu/drm/i915/gem/i915_gem_mman.c b/drivers/gpu/drm/i915

[Intel-gfx] [PATCH v6 01/64] drm/i915: Do not share hwsp across contexts any more, v6

2021-01-05 Thread Maarten Lankhorst
hwsp_offset to i915_request to fix potential wraparound hang. - Ensure timeline wrap test works with the changes. - Assign hwsp in intel_timeline_read_hwsp() within the rcu lock to fix a hang. Signed-off-by: Maarten Lankhorst Reviewed-by: Thomas Hellström #v1 Reported-by: kernel test robot

[Intel-gfx] [PATCH v6 45/64] drm/i915/selftests: Prepare dma-buf tests for obj->mm.lock removal.

2021-01-05 Thread Maarten Lankhorst
Use pin_pages_unlocked() where we don't have a lock. Signed-off-by: Maarten Lankhorst Reviewed-by: Thomas Hellström --- drivers/gpu/drm/i915/gem/selftests/i915_gem_dmabuf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/gem/selftests/i915_gem_dma

[Intel-gfx] [PATCH v6 50/64] drm/i915/selftests: Prepare igt_gem_utils for obj->mm.lock removal

2021-01-05 Thread Maarten Lankhorst
igt_emit_store_dw needs to use the unlocked version, as it's not holding a lock. This fixes igt_gpu_fill_dw() which is used by some other selftests. Signed-off-by: Maarten Lankhorst Reviewed-by: Thomas Hellström --- drivers/gpu/drm/i915/gem/selftests/igt_gem_utils.c | 2 +- 1 file chang

[Intel-gfx] [PATCH v6 21/64] drm/i915: Rework clflush to work correctly without obj->mm.lock.

2021-01-05 Thread Maarten Lankhorst
Pin in the caller, not in the work itself. This should also work better for dma-fence annotations. Signed-off-by: Maarten Lankhorst Reviewed-by: Thomas Hellström --- drivers/gpu/drm/i915/gem/i915_gem_clflush.c | 15 +++ 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a

[Intel-gfx] [PATCH v6 47/64] drm/i915/selftests: Prepare mman testcases for obj->mm.lock removal.

2021-01-05 Thread Maarten Lankhorst
Ensure we hold the lock around put_pages, and use the unlocked wrappers for pinning pages and mappings. Signed-off-by: Maarten Lankhorst Reviewed-by: Thomas Hellström --- drivers/gpu/drm/i915/gem/selftests/i915_gem_mman.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff

[Intel-gfx] [PATCH v6 30/64] drm/i915: Fix pread/pwrite to work with new locking rules.

2021-01-05 Thread Maarten Lankhorst
ons done when pagefaulting inside copy_*_user. Signed-off-by: Maarten Lankhorst Reviewed-by: Thomas Hellström --- drivers/gpu/drm/i915/Makefile | 1 - drivers/gpu/drm/i915/gem/i915_gem_fence.c | 95 - drivers/gpu/drm/i915/gem/i915_gem_object.h | 5 - drivers/gpu/drm/i

[Intel-gfx] [PATCH v6 41/64] drm/i915/selftests: Prepare huge_pages testcases for obj->mm.lock removal.

2021-01-05 Thread Maarten Lankhorst
Straightforward conversion, just convert a bunch of calls to unlocked versions. Signed-off-by: Maarten Lankhorst Reviewed-by: Thomas Hellström --- .../gpu/drm/i915/gem/selftests/huge_pages.c | 28 ++- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/drivers/gpu

[Intel-gfx] [PATCH v6 53/64] drm/i915/selftests: Prepare execlists and lrc selftests for obj->mm.lock removal

2021-01-05 Thread Maarten Lankhorst
Convert normal functions to unlocked versions where needed. Signed-off-by: Maarten Lankhorst Reviewed-by: Thomas Hellström --- drivers/gpu/drm/i915/gt/selftest_execlists.c | 18 +- drivers/gpu/drm/i915/gt/selftest_lrc.c | 16 2 files changed, 17

[Intel-gfx] [PATCH v6 34/64] drm/i915: Add ww locking around vm_access()

2021-01-05 Thread Maarten Lankhorst
i915_gem_object_pin_map potentially needs a ww context, so ensure we have one we can revoke. Signed-off-by: Maarten Lankhorst Reviewed-by: Thomas Hellström --- drivers/gpu/drm/i915/gem/i915_gem_mman.c | 24 ++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a

[Intel-gfx] [PATCH v6 36/64] drm/i915: Lock ww in ucode objects correctly

2021-01-05 Thread Maarten Lankhorst
removes possible lockdep splats about missing resv lock for ucode. Signed-off-by: Maarten Lankhorst Reviewed-by: Thomas Hellström --- drivers/gpu/drm/i915/gem/i915_gem_object.h | 2 ++ drivers/gpu/drm/i915/gem/i915_gem_pages.c | 20 drivers/gpu/drm/i915/gt/uc/intel_guc.c

[Intel-gfx] [PATCH v6 39/64] drm/i915: Fix ww locking in shmem_create_from_object

2021-01-05 Thread Maarten Lankhorst
Quick fix, just use the unlocked version. Signed-off-by: Maarten Lankhorst Reviewed-by: Thomas Hellström --- drivers/gpu/drm/i915/gt/shmem_utils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/gt/shmem_utils.c b/drivers/gpu/drm/i915/gt/shmem_utils.c

[Intel-gfx] [PATCH v6 56/64] drm/i915/selftests: Prepare timeline tests for obj->mm.lock removal

2021-01-05 Thread Maarten Lankhorst
We can no longer call intel_timeline_pin with a null argument, so add a ww loop that locks the backing object. Signed-off-by: Maarten Lankhorst Reviewed-by: Thomas Hellström --- drivers/gpu/drm/i915/gt/selftest_timeline.c | 30 + 1 file changed, 25 insertions(+), 5

[Intel-gfx] [PATCH v6 51/64] drm/i915/selftests: Prepare context selftest for obj->mm.lock removal

2021-01-05 Thread Maarten Lankhorst
Only needs to convert a single call to the unlocked version. Signed-off-by: Maarten Lankhorst Reviewed-by: Thomas Hellström --- drivers/gpu/drm/i915/gt/selftest_context.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/i915/gt/selftest_context.c b

[Intel-gfx] [PATCH v6 15/64] drm/i915: Make compilation of userptr code depend on MMU_NOTIFIER.

2021-01-05 Thread Maarten Lankhorst
Now that unsynchronized mappings are removed, the only time userptr works is when the MMU notifier is enabled. Put all of the userptr code behind a mmu notifier ifdef. Signed-off-by: Maarten Lankhorst --- .../gpu/drm/i915/gem/i915_gem_execbuffer.c| 2 + drivers/gpu/drm/i915/gem

[Intel-gfx] [PATCH v6 48/64] drm/i915/selftests: Prepare object tests for obj->mm.lock removal.

2021-01-05 Thread Maarten Lankhorst
Convert a single pin_pages call to use the unlocked version. Signed-off-by: Maarten Lankhorst Reviewed-by: Thomas Hellström --- drivers/gpu/drm/i915/gem/selftests/i915_gem_object.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/gem/selftests

[Intel-gfx] [PATCH v6 32/64] drm/i915: Prepare for obj->mm.lock removal

2021-01-05 Thread Maarten Lankhorst
From: Thomas Hellström Stolen objects need to lock, and we may call put_pages when refcount drops to 0, ensure all calls are handled correctly. Idea-from: Thomas Hellström Signed-off-by: Maarten Lankhorst Signed-off-by: Thomas Hellström --- drivers/gpu/drm/i915/gem/i915_gem_object.h | 14

[Intel-gfx] [PATCH v6 55/64] drm/i915/selftests: Prepare ring submission for obj->mm.lock removal

2021-01-05 Thread Maarten Lankhorst
Use unlocked versions when the ww lock is not held. Signed-off-by: Maarten Lankhorst Reviewed-by: Thomas Hellström --- drivers/gpu/drm/i915/gt/selftest_ring_submission.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/i915/gt/selftest_ring_submission.c

[Intel-gfx] [PATCH v6 31/64] drm/i915: Fix workarounds selftest, part 1

2021-01-05 Thread Maarten Lankhorst
pin_map needs the ww lock, so ensure we pin both before submission. Signed-off-by: Maarten Lankhorst Reviewed-by: Thomas Hellström --- drivers/gpu/drm/i915/gem/i915_gem_object.h| 3 + drivers/gpu/drm/i915/gem/i915_gem_pages.c | 12 +++ .../gpu/drm/i915/gt/selftest_workarounds.c

[Intel-gfx] [PATCH v6 02/64] drm/i915: Pin timeline map after first timeline pin, v3.

2021-01-05 Thread Maarten Lankhorst
since v2: - Clear entire cacheline when pinning. Signed-off-by: Maarten Lankhorst Reported-by: kernel test robot --- drivers/gpu/drm/i915/gt/intel_timeline.c| 40 + drivers/gpu/drm/i915/gt/intel_timeline.h| 2 + drivers/gpu/drm/i915/gt/mock_engine.c | 22 ++- driver

[Intel-gfx] [PATCH v6 42/64] drm/i915/selftests: Prepare client blit for obj->mm.lock removal.

2021-01-05 Thread Maarten Lankhorst
Straightforward conversion, just convert a bunch of calls to unlocked versions. Signed-off-by: Maarten Lankhorst Reviewed-by: Thomas Hellström --- drivers/gpu/drm/i915/gem/selftests/i915_gem_client_blt.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpu

[Intel-gfx] [PATCH v6 14/64] drm/i915: Reject UNSYNCHRONIZED for userptr, v2.

2021-01-05 Thread Maarten Lankhorst
s you will need CONFIG_I915_USERPTR. Signed-off-by: Maarten Lankhorst --- drivers/gpu/drm/i915/gem/i915_gem_userptr.c | 10 ++ 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/i915/gem/i915_gem_userptr.c b/drivers/gpu/drm/i915/gem/i915_gem_userptr.c index 64

[Intel-gfx] [PATCH v6 28/64] drm/i915: Take obj lock around set_domain ioctl

2021-01-05 Thread Maarten Lankhorst
We need to lock the object to move it to the correct domain, add the missing lock. Signed-off-by: Maarten Lankhorst Reviewed-by: Thomas Hellström --- drivers/gpu/drm/i915/gem/i915_gem_domain.c | 18 ++ 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/drivers/gpu

[Intel-gfx] [PATCH v6 29/64] drm/i915: Defer pin calls in buffer pool until first use by caller.

2021-01-05 Thread Maarten Lankhorst
We need to take the obj lock to pin pages, so wait until the callers have done so, before making the object unshrinkable. Signed-off-by: Maarten Lankhorst Reviewed-by: Thomas Hellström --- .../gpu/drm/i915/gem/i915_gem_execbuffer.c| 2 + .../gpu/drm/i915/gem/i915_gem_object_blt.c| 6

[Intel-gfx] [PATCH v6 12/64] drm/i915: No longer allow exporting userptr through dma-buf

2021-01-05 Thread Maarten Lankhorst
It doesn't make sense to export a memory address, we will prevent allowing access this way to different address spaces when we rework userptr handling, so best to explicitly disable it. Signed-off-by: Maarten Lankhorst Reviewed-by: Thomas Hellström -- Still needs an ack from relevant user

[Intel-gfx] [PATCH v6 62/64] drm/i915: Keep userpointer bindings if seqcount is unchanged, v2.

2021-01-05 Thread Maarten Lankhorst
Reported-by: Dan Carpenter Signed-off-by: Maarten Lankhorst --- drivers/gpu/drm/i915/gem/i915_gem_userptr.c | 27 ++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/i915/gem/i915_gem_userptr.c b/drivers/gpu/drm/i915/gem/i915_gem_userptr.c index

[Intel-gfx] [PATCH v6 09/64] drm/i915: Convert i915_gem_object_attach_phys() to ww locking, v2.

2021-01-05 Thread Maarten Lankhorst
e callback would go down the phys free path. Signed-off-by: Maarten Lankhorst Reviewed-by: Thomas Hellström --- drivers/gpu/drm/i915/gem/i915_gem_object.h | 3 ++- drivers/gpu/drm/i915/gem/i915_gem_phys.c | 12 ++-- drivers/gpu/drm/i915/gem/i915_gem_shmem.c | 17 ++--- 3 fil

[Intel-gfx] [PATCH v6 07/64] drm/i915: Move HAS_STRUCT_PAGE to obj->flags

2021-01-05 Thread Maarten Lankhorst
We want to remove the changing of ops structure for attaching phys pages, so we need to kill off HAS_STRUCT_PAGE from ops->flags, and put it in the bo. This will remove a potential race of dereferencing the wrong obj->ops without ww mutex held. Signed-off-by: Maarten Lankhorst Revie

[Intel-gfx] [PATCH v6 26/64] drm/i915: Make lrc_init_wa_ctx compatible with ww locking.

2021-01-05 Thread Maarten Lankhorst
Make creation separate from pinning, in order to take the lock only once, and pin the mapping with the lock held. Signed-off-by: Maarten Lankhorst Reviewed-by: Thomas Hellström --- drivers/gpu/drm/i915/gt/intel_lrc.c | 32 ++--- 1 file changed, 25 insertions(+), 7

[Intel-gfx] [PATCH v6 54/64] drm/i915/selftests: Prepare mocs tests for obj->mm.lock removal

2021-01-05 Thread Maarten Lankhorst
Use pin_map_unlocked when we're not holding locks. Signed-off-by: Maarten Lankhorst Reviewed-by: Thomas Hellström --- drivers/gpu/drm/i915/gt/selftest_mocs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/gt/selftest_mocs.c b/drivers/gpu/drm/i9

[Intel-gfx] [PATCH v6 58/64] drm/i915/selftests: Prepare memory region tests for obj->mm.lock removal

2021-01-05 Thread Maarten Lankhorst
Use the unlocked variants for pin_map and pin_pages, and add lock around unpinning/putting pages. Signed-off-by: Maarten Lankhorst Reviewed-by: Thomas Hellström --- .../drm/i915/selftests/intel_memory_region.c | 18 +++--- 1 file changed, 11 insertions(+), 7 deletions(-) diff

[Intel-gfx] [PATCH v6 17/64] drm/i915: Flatten obj->mm.lock

2021-01-05 Thread Maarten Lankhorst
With userptr fixed, there is no need for all separate lockdep classes now, and we can remove all lockdep tricks used. A trylock in the shrinker is all we need now to flatten the locking hierarchy. Signed-off-by: Maarten Lankhorst Reviewed-by: Thomas Hellström --- drivers/gpu/drm/i915/gem

[Intel-gfx] [PATCH v6 59/64] drm/i915/selftests: Prepare cs engine tests for obj->mm.lock removal

2021-01-05 Thread Maarten Lankhorst
Same as other tests, use pin_map_unlocked. Signed-off-by: Maarten Lankhorst Reviewed-by: Thomas Hellström --- drivers/gpu/drm/i915/gt/selftest_engine_cs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/i915/gt/selftest_engine_cs.c b/drivers/gpu/drm

[Intel-gfx] [PATCH v6 19/64] drm/i915: Make ring submission compatible with obj->mm.lock removal, v2.

2021-01-05 Thread Maarten Lankhorst
ce v1: - Handle -EDEADLK backoff in intel_ring_submission_setup() better. - Handle smatch errors reported by Dan and testbot. Signed-off-by: Maarten Lankhorst Reported-by: kernel test robot Reported-by: Dan Carpenter Reviewed-by: Thomas Hellström --- .../gpu/drm/i915/gt/intel_ring_submission.c

[Intel-gfx] [PATCH v6 24/64] drm/i915: Move pinning to inside engine_wa_list_verify()

2021-01-05 Thread Maarten Lankhorst
This should be done as part of the ww loop, in order to remove a i915_vma_pin that needs ww held. Now only i915_ggtt_pin() callers remaining. Signed-off-by: Maarten Lankhorst Reviewed-by: Thomas Hellström --- drivers/gpu/drm/i915/gt/intel_gtt.c| 14 +- drivers/gpu/drm

[Intel-gfx] [PATCH v6 64/64] drm/i915: Avoid some false positives in assert_object_held()

2021-01-05 Thread Maarten Lankhorst
From: Thomas Hellström In a ww transaction where we've already locked a reservation object, assert_object_held() might not throw a splat even if the object is unlocked. Improve on that situation by asserting that the reservation object's ww mutex is indeed locked. Signed-off-by: Thomas Hellström

[Intel-gfx] [PATCH v6 37/64] drm/i915: Add ww locking to dma-buf ops.

2021-01-05 Thread Maarten Lankhorst
vmap is using pin_pages, but needs to use ww locking, add pin_pages_unlocked to correctly lock the mapping. Also add ww locking to begin/end cpu access. Signed-off-by: Maarten Lankhorst Reviewed-by: Thomas Hellström --- drivers/gpu/drm/i915/gem/i915_gem_dmabuf.c | 60 -- 1

[Intel-gfx] [PATCH v6 60/64] drm/i915/selftests: Prepare gtt tests for obj->mm.lock removal

2021-01-05 Thread Maarten Lankhorst
We need to lock the global gtt dma_resv, use i915_vm_lock_objects to handle this correctly. Add ww handling for this where required. Add the object lock around unpin/put pages, and use the unlocked versions of pin_pages and pin_map where required. Signed-off-by: Maarten Lankhorst Reviewed-by

[Intel-gfx] [PATCH v6 05/64] drm/i915: Ensure we hold the object mutex in pin correctly.

2021-01-05 Thread Maarten Lankhorst
Currently we have a lot of places where we hold the gem object lock, but haven't yet been converted to the ww dance. Complain loudly about those places. i915_vma_pin shouldn't have the obj lock held, so we can do a ww dance, while i915_vma_pin_ww should. Signed-off-by: Maarten

[Intel-gfx] [PATCH v6 10/64] drm/i915: make lockdep slightly happier about execbuf.

2021-01-05 Thread Maarten Lankhorst
As soon as we install fences, we should stop allocating memory in order to prevent any potential deadlocks. This is required later on, when we start adding support for dma-fence annotations. Signed-off-by: Maarten Lankhorst Reviewed-by: Thomas Hellström --- .../gpu/drm/i915/gem

[Intel-gfx] [PATCH v6 63/64] drm/i915: Move gt_revoke() slightly

2021-01-05 Thread Maarten Lankhorst
-by: Maarten Lankhorst --- drivers/gpu/drm/i915/gt/intel_reset.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/i915/gt/intel_reset.c b/drivers/gpu/drm/i915/gt/intel_reset.c index 9d177297db79..3c0807d9a86e 100644 --- a/drivers/gpu/drm/i915/gt/intel_rese

[Intel-gfx] [PATCH v6 27/64] drm/i915: Make __engine_unpark() compatible with ww locking.

2021-01-05 Thread Maarten Lankhorst
Take the ww lock around engine_unpark. Because of the many many places where rpm is used, I chose the safest option and used a trylock to opportunistically take this lock for __engine_unpark. Signed-off-by: Maarten Lankhorst Reviewed-by: Thomas Hellström --- drivers/gpu/drm/i915/gt

[Intel-gfx] [PATCH v6 35/64] drm/i915: Increase ww locking for perf.

2021-01-05 Thread Maarten Lankhorst
We need to lock a few more objects, some temporarily, add ww lock where needed. Signed-off-by: Maarten Lankhorst Reviewed-by: Thomas Hellström --- drivers/gpu/drm/i915/i915_perf.c | 56 1 file changed, 43 insertions(+), 13 deletions(-) diff --git a/drivers/gpu

[Intel-gfx] [PATCH v6 22/64] drm/i915: Pass ww ctx to intel_pin_to_display_plane

2021-01-05 Thread Maarten Lankhorst
Instead of multiple lockings, lock the object once, and perform the ww dance around attach_phys and pin_pages. Signed-off-by: Maarten Lankhorst Reviewed-by: Thomas Hellström --- drivers/gpu/drm/i915/display/intel_display.c | 69 --- drivers/gpu/drm/i915/display/intel_display.h

[Intel-gfx] [PATCH v6 49/64] drm/i915/selftests: Prepare object blit tests for obj->mm.lock removal.

2021-01-05 Thread Maarten Lankhorst
Use some unlocked versions where we're not holding the ww lock. Signed-off-by: Maarten Lankhorst Reviewed-by: Thomas Hellström --- drivers/gpu/drm/i915/gem/selftests/i915_gem_object_blt.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/i91

[Intel-gfx] [PATCH v6 18/64] drm/i915: Populate logical context during first pin.

2021-01-05 Thread Maarten Lankhorst
This allows us to remove pin_map from state allocation, which saves us a few retry loops. We won't need this until first pin, anyway. Signed-off-by: Maarten Lankhorst Reviewed-by: Thomas Hellström --- .../drm/i915/gt/intel_execlists_submission.c | 26 --- 1 file change

[Intel-gfx] [PATCH v6 38/64] drm/i915: Add missing ww lock in intel_dsb_prepare.

2021-01-05 Thread Maarten Lankhorst
Because of the long lifetime of the mapping, we cannot wrap this in a simple limited ww lock. Just use the unlocked version of pin_map, because we'll likely release the mapping a lot later, in a different thread. Signed-off-by: Maarten Lankhorst Reviewed-by: Thomas Hellström --- driver

[Intel-gfx] [PATCH v6 06/64] drm/i915: Add gem object locking to madvise.

2021-01-05 Thread Maarten Lankhorst
Doesn't need the full ww lock, only checking if pages are bound. Signed-off-by: Maarten Lankhorst Reviewed-by: Thomas Hellström #irc --- drivers/gpu/drm/i915/i915_gem.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gp

[Intel-gfx] [PATCH v6 57/64] drm/i915/selftests: Prepare i915_request tests for obj->mm.lock removal

2021-01-05 Thread Maarten Lankhorst
Straightforward conversion by using unlocked versions. Signed-off-by: Maarten Lankhorst Reviewed-by: Thomas Hellström --- drivers/gpu/drm/i915/selftests/i915_request.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/i915/selftests/i915_request.c

[Intel-gfx] [PATCH v6 43/64] drm/i915/selftests: Prepare coherency tests for obj->mm.lock removal.

2021-01-05 Thread Maarten Lankhorst
Straightforward conversion, just convert a bunch of calls to unlocked versions. Signed-off-by: Maarten Lankhorst Reviewed-by: Thomas Hellström --- drivers/gpu/drm/i915/gem/selftests/i915_gem_coherency.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm

[Intel-gfx] [PATCH v6 11/64] drm/i915: Disable userptr pread/pwrite support.

2021-01-05 Thread Maarten Lankhorst
Userptr should not need the kernel for a userspace memcpy, userspace needs to call memcpy directly. Specifically, disable i915_gem_pwrite_ioctl() and i915_gem_pread_ioctl(). Signed-off-by: Maarten Lankhorst Reviewed-by: Thomas Hellström -- Still needs an ack from relevant userspace that it

[Intel-gfx] [PATCH v6 33/64] drm/i915: Add igt_spinner_pin() to allow for ww locking around spinner.

2021-01-05 Thread Maarten Lankhorst
By default, we assume that it's called inside igt_create_request to keep existing selftests working, but allow for manual pinning when passing a ww context. Signed-off-by: Maarten Lankhorst Reviewed-by: Thomas Hellström --- drivers/gpu/drm/i915/selftests/igt_spinner.c

[Intel-gfx] [PATCH v6 03/64] drm/i915: Move cmd parser pinning to execbuffer

2021-01-05 Thread Maarten Lankhorst
s has the added benefit of being able to catch all memory allocation errors before the point of no return, and return -ENOMEM safely to the execbuf submitter. Signed-off-by: Maarten Lankhorst Acked-by: Thomas Hellström --- .../gpu/drm/i915/gem/i915_gem_execbuffer.c| 74 - driver

[Intel-gfx] [PATCH v6 25/64] drm/i915: Take reservation lock around i915_vma_pin.

2021-01-05 Thread Maarten Lankhorst
We previously complained when ww == NULL. This function is now only used in selftests to pin an object, and ww locking is now fixed. Signed-off-by: Maarten Lankhorst Reviewed-by: Thomas Hellström --- .../i915/gem/selftests/i915_gem_coherency.c | 14 + drivers/gpu/drm/i915

[Intel-gfx] [PATCH v6 44/64] drm/i915/selftests: Prepare context tests for obj->mm.lock removal.

2021-01-05 Thread Maarten Lankhorst
Straightforward conversion, just convert a bunch of calls to unlocked versions. Signed-off-by: Maarten Lankhorst Reviewed-by: Thomas Hellström --- drivers/gpu/drm/i915/gem/selftests/i915_gem_context.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/gpu

[Intel-gfx] [PATCH v6 08/64] drm/i915: Rework struct phys attachment handling

2021-01-05 Thread Maarten Lankhorst
Instead of creating a separate object type, we make changes to the shmem type, to clear struct page backing. This will allow us to ensure we never run into a race when we exchange obj->ops with other function pointers. Signed-off-by: Maarten Lankhorst Reviewed-by: Thomas Hellström --- driv

[Intel-gfx] [PATCH v6 61/64] drm/i915: Finally remove obj->mm.lock.

2021-01-05 Thread Maarten Lankhorst
With all callers and selftests fixed to use ww locking, we can now finally remove this lock. Signed-off-by: Maarten Lankhorst Reviewed-by: Thomas Hellström --- drivers/gpu/drm/i915/gem/i915_gem_object.c| 2 - drivers/gpu/drm/i915/gem/i915_gem_object.h| 5 +-- .../gpu/drm/i915/gem

[Intel-gfx] [PATCH v6 52/64] drm/i915/selftests: Prepare hangcheck for obj->mm.lock removal

2021-01-05 Thread Maarten Lankhorst
Convert a few calls to use the unlocked versions. Signed-off-by: Maarten Lankhorst Reviewed-by: Thomas Hellström --- drivers/gpu/drm/i915/gt/selftest_hangcheck.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/i915/gt/selftest_hangcheck.c b/drivers

[Intel-gfx] [PATCH v6 16/64] drm/i915: Fix userptr so we do not have to worry about obj->mm.lock, v5.

2021-01-05 Thread Maarten Lankhorst
eb->[i + 1].vma in the code. (Thomas) - Actually check all invalidations in eb_move_to_gpu. (Thomas) - Do not wait when process is exiting to fix gem_ctx_persistence.userptr. Signed-off-by: Maarten Lankhorst --- .../gpu/drm/i915/gem/i915_gem_execbuffer.c| 101 ++- drivers/gp

[Intel-gfx] [PATCH v6 13/64] drm/i915: Reject more ioctls for userptr

2021-01-05 Thread Maarten Lankhorst
will do the same. This plus the previous changes have been tested against beignet by using its own unit tests, and intel-video-compute by using piglit's opencl tests. Signed-off-by: Maarten Lankhorst Reviewed-by: Thomas Hellström -- Still needs an ack from relevant userspace that it won&#x

[Intel-gfx] [PATCH v6 04/64] drm/i915: Add missing -EDEADLK handling to execbuf pinning, v2.

2021-01-05 Thread Maarten Lankhorst
i915_vma_pin may fail with -EDEADLK when we start locking page tables, so ensure we handle this correctly. Changes since v1: - Drop -EDEADLK todo, this commit handles it. - Change eb_pin_vma from sort-of-bool + -EDEADLK to a proper int. (Matt) Cc: Matthew Brost Signed-off-by: Maarten Lankhorst

[Intel-gfx] [PATCH v6 20/64] drm/i915: Handle ww locking in init_status_page

2021-01-05 Thread Maarten Lankhorst
Try to pin to ggtt first, and use a full ww loop to handle eviction correctly. Signed-off-by: Maarten Lankhorst Reviewed-by: Thomas Hellström --- drivers/gpu/drm/i915/gt/intel_engine_cs.c | 37 +++ 1 file changed, 24 insertions(+), 13 deletions(-) diff --git a/drivers/gpu

[Intel-gfx] [PULL] drm-misc-next

2021-01-06 Thread Maarten Lankhorst
de" --> "list" gpu/drm: ring_mirror_list --> pending_list drm/scheduler: Essentialize the job done callback drm/sched: Add missing structure comment Maarten Lankhorst (1): Merge drm/drm-next into drm-misc-next Maxime Ripard (20): drm/vc4: hdmi: Don&#x

[Intel-gfx] [PATCH] drm/i915: Only set bind_async_flags when concurrent access wa is not active, v2.

2021-05-31 Thread Maarten Lankhorst
eld. Changes since v1: - Fix null pointer dereference when we forget to pass the work stash, it's still required to prealloc all on affected platforms. Signed-off-by: Maarten Lankhorst --- drivers/gpu/drm/i915/gt/gen6_ppgtt.c | 4 +++- drivers/gpu/drm/i915/gt/gen8_ppgtt.c | 4 +++- drivers

[Intel-gfx] [PATCH] drm/i915: Only set bind_async_flags when concurrent access wa is not active, v3.

2021-06-01 Thread Maarten Lankhorst
eld. Changes since v1: - Fix null pointer dereference when we forget to pass the work stash, it's still required to prealloc all on affected platforms. Changes since v2: - Clear bind_async_flags correctly on ggtt w/a. Signed-off-by: Maarten Lankhorst --- drivers/gpu/drm/i915/gt/gen6_ppg

Re: [Intel-gfx] [PATCH V3] x86/gpu: add JasperLake to gen11 early quirks

2021-06-08 Thread Maarten Lankhorst
Op 08-06-2021 om 07:34 schreef Tejas Upadhyay: > Let's reserve JSL stolen memory for graphics. > > JasperLake is a gen11 platform which is compatible with > ICL/EHL changes. > > Required due to below reference patch: > > commit 24ea098b7c0d80b56d62a200608e0b029056baf6 > drm/i915/jsl: Split EHL/JSL

[Intel-gfx] [PULL] topic/i915-ttm

2021-06-11 Thread Maarten Lankhorst
drm-intel pull request for topic/i915-ttm: - Convert i915 lmem handling to ttm. - Add a patch to temporarily add a driver_private member to vma_node. - Use this to allow mixed object mmap handling for i915. -------- Maarten Lankhorst (2):

Re: [Intel-gfx] [PATCH] drm/i915: allow DG1 autoprobe for CONFIG_BROKEN

2021-06-14 Thread Maarten Lankhorst
LS_IDS(&adl_s_info), > INTEL_ADLP_IDS(&adl_p_info), > +#if IS_ENABLED(CONFIG_DRM_I915_UNSTABLE_FAKE_LMEM) > + INTEL_DG1_IDS(&dg1_info), > +#endif > {0, 0, 0} > }; > MODULE_DEVICE_TABLE(pci, pciidlist); Reviewed-by: Maarten Lankhorst ___

Re: [Intel-gfx] [PATCH] drm/i915/ttm: Fix memory leaks

2021-06-15 Thread Maarten Lankhorst
> kfree(i915_tt); > } > > @@ -217,6 +218,7 @@ static void i915_ttm_delete_mem_notify(struct > ttm_buffer_object *bo) > > if (likely(obj)) { > /* This releases all gem object bindings to the backend. */ > + i915_ttm_free_cached_io_st(obj

Re: [Intel-gfx] [PATCH v4 03/12] drm/i915: Introduce a ww transaction helper

2021-06-16 Thread Maarten Lankhorst
Op 15-06-2021 om 15:14 schreef Thomas Hellström: > Introduce a for_i915_gem_ww(){} utility to help make the code > around a ww transaction more readable. > > Signed-off-by: Thomas Hellström > Reviewed-by: Matthew Auld > --- > drivers/gpu/drm/i915/i915_gem_ww.h | 31 +-

Re: [Intel-gfx] [PATCH] drm/i915: Perform execbuffer object locking as a separate step

2021-06-17 Thread Maarten Lankhorst
> + struct drm_i915_gem_exec_object2 *entry = &eb->exec[i]; > + struct eb_vma *ev = &eb->vma[i]; > + struct i915_vma *vma = ev->vma; > > err = eb_pin_vma(eb, entry, ev); > if (err == -EDEADLK) Reviewed-by: Maarten Lankhorst ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx

[Intel-gfx] [PATCH 2/3] drm/i915: Use intel_context->pin_mutex only for context allocation

2021-06-21 Thread Maarten Lankhorst
Rename pin_mutex to alloc_mutex, and only use it for context allocation. This will allow us to simplify __intel_context_do_pin_ww, which no longer needs to run the pre_pin callback separately. Signed-off-by: Maarten Lankhorst --- drivers/gpu/drm/i915/gt/intel_context.c | 40

[Intel-gfx] [PATCH 3/3] drm/i915: Remove intel_context->ops->(pre_pin/post_unpin)

2021-06-21 Thread Maarten Lankhorst
Now that intel_context->pin_mutex is gone, the reason for splitting pre_pin/post_unpin ops is also gone. Remove those ops, and handle this detail inside guc/execlists submission only. Signed-off-by: Maarten Lankhorst --- drivers/gpu/drm/i915/gt/intel_context.c | 19 ++- drivers/

[Intel-gfx] [PATCH 1/3] drm/i915/gt: Do not allow setting ring size for legacy ring submission

2021-06-21 Thread Maarten Lankhorst
It doesn't work for legacy ring submission, and is in the best case ignored. In the worst case we end up freeing engine->legacy.ring for all other active engines, resulting in a use-after-free. Signed-off-by: Maarten Lankhorst Fixes: 88be76cdafc7 ("drm/i915: Allow userspace to spe

[Intel-gfx] [PATCH] drm/i915: Use dma_resv_iter for waiting in i915_gem_object_wait_reservation.

2021-10-13 Thread Maarten Lankhorst
_gem_do_execbuffer+0x9a6/0x20a0 [i915] <4> [83.540485] ? lockdep_hardirqs_on+0xbf/0x130 <4> [83.540490] ? __lock_acquire+0x5c0/0xb70 <4> [83.540495] i915_gem_execbuffer2_ioctl+0x11f/0x2c0 [i915] <4> [83.540559] ? i915_gem_do_execbuffer+0x20a0/0x20a0 [i915] <4> [8

[Intel-gfx] [PATCH] drm/i915: Use dma_resv_iter for waiting in i915_gem_object_wait_reservation.

2021-10-13 Thread Maarten Lankhorst
_gem_do_execbuffer+0x9a6/0x20a0 [i915] <4> [83.540485] ? lockdep_hardirqs_on+0xbf/0x130 <4> [83.540490] ? __lock_acquire+0x5c0/0xb70 <4> [83.540495] i915_gem_execbuffer2_ioctl+0x11f/0x2c0 [i915] <4> [83.540559] ? i915_gem_do_execbuffer+0x20a0/0x20a0 [i915] <4> [83.540

[Intel-gfx] [PATCH] drm/i915: Use dma_resv_iter for waiting in i915_gem_object_wait_reservation.

2021-10-13 Thread Maarten Lankhorst
_gem_do_execbuffer+0x9a6/0x20a0 [i915] <4> [83.540485] ? lockdep_hardirqs_on+0xbf/0x130 <4> [83.540490] ? __lock_acquire+0x5c0/0xb70 <4> [83.540495] i915_gem_execbuffer2_ioctl+0x11f/0x2c0 [i915] <4> [83.540559] ? i915_gem_do_execbuffer+0x20a0/0x20a0 [i915] <4> [

Re: [Intel-gfx] [PATCH] drm/i915: Use dma_resv_iter for waiting in i915_gem_object_wait_reservation.

2021-10-13 Thread Maarten Lankhorst
Op 13-10-2021 om 17:37 schreef Tvrtko Ursulin: > > On 13/10/2021 15:00, Daniel Vetter wrote: >> On Wed, Oct 13, 2021 at 02:32:03PM +0200, Maarten Lankhorst wrote: >>> No memory should be allocated when calling i915_gem_object_wait, >>> because it may be called to

Re: [Intel-gfx] [PATCH 20/28] drm/i915: use new iterator in i915_gem_object_wait_reservation

2021-10-14 Thread Maarten Lankhorst
Op 05-10-2021 om 13:37 schreef Christian König: > Simplifying the code a bit. > > Signed-off-by: Christian König > --- > drivers/gpu/drm/i915/gem/i915_gem_wait.c | 51 +--- > 1 file changed, 9 insertions(+), 42 deletions(-) > > diff --git a/drivers/gpu/drm/i915/gem/i915_gem_wa

Re: [Intel-gfx] [PATCH] drm/i915: Use dma_resv_iter for waiting in i915_gem_object_wait_reservation.

2021-10-14 Thread Maarten Lankhorst
Op 14-10-2021 om 10:37 schreef Tvrtko Ursulin: > > On 13/10/2021 11:41, Maarten Lankhorst wrote: >> No memory should be allocated when calling i915_gem_object_wait, >> because it may be called to idle a BO when evicting memory. >> >> Fix this by using

[Intel-gfx] [PULL] drm-misc-fixes

2021-10-14 Thread Maarten Lankhorst
drm-misc-fixes-2021-10-14: drm-misc-fixes for v5.15-rc6: - Respun clock fixes for vc4/hdmi. - Cap connector_bad_edid()'s num_of_ext by num_blocks read. - Clamp fbdev size to max available height. - Hide hyper-v's hw pointer, to prevent double pointers. - Use the correct engine bit in nouveau's g84_

Re: [Intel-gfx] [PATCH] drm/i915: Use dma_resv_iter for waiting in i915_gem_object_wait_reservation.

2021-10-14 Thread Maarten Lankhorst
Op 14-10-2021 om 15:25 schreef Tvrtko Ursulin: > > On 14/10/2021 13:05, Maarten Lankhorst wrote: >> Op 14-10-2021 om 10:37 schreef Tvrtko Ursulin: >>> >>> On 13/10/2021 11:41, Maarten Lankhorst wrote: >>>> No memory should be allocated when calling i9

[Intel-gfx] [PATCH 1/2] dma-buf: Fix dma_resv_wait_timeout handling of timeout = 0.

2021-10-15 Thread Maarten Lankhorst
11a3 ("dma-buf: use new iterator in dma_resv_wait_timeout") Cc: Christian König Cc: Daniel Vetter Signed-off-by: Maarten Lankhorst --- drivers/dma-buf/dma-resv.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/dma-buf/dma-resv.c b/drivers/dma-

[Intel-gfx] [PATCH 0/2] dma-buf: Fix breakages from dma_resv_iter conversion.

2021-10-15 Thread Maarten Lankhorst
Urgent fixes! dma_resv_test_signaled is completely broken, dma_resv_wait_timeout kind of broken. Maarten Lankhorst (2): dma-buf: Fix dma_resv_wait_timeout handling of timeout = 0. dma-buf: Fix dma_resv_test_signaled. drivers/dma-buf/dma-resv.c | 20 +++- 1 file changed, 11

[Intel-gfx] [PATCH 2/2] dma-buf: Fix dma_resv_test_signaled.

2021-10-15 Thread Maarten Lankhorst
Christian König Cc: Daniel Vetter Signed-off-by: Maarten Lankhorst --- drivers/dma-buf/dma-resv.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/dma-buf/dma-resv.c b/drivers/dma-buf/dma-resv.c index 70a8082660c5..37ab2875e469 100644 --- a/drivers/dma-buf/dma-

Re: [Intel-gfx] [PATCH 2/2] dma-buf: Fix dma_resv_test_signaled.

2021-10-15 Thread Maarten Lankhorst
Op 15-10-2021 om 14:07 schreef Christian König: > Am 15.10.21 um 13:57 schrieb Maarten Lankhorst: >> Commit 7fa828cb9265 ("dma-buf: use new iterator in dma_resv_test_signaled") >> accidentally forgot to test whether the dma-buf is actually signaled, >> breaking >

Re: [Intel-gfx] [PATCH] drm/i915: Use dma_resv_iter for waiting in i915_gem_object_wait_reservation.

2021-10-18 Thread Maarten Lankhorst
Op 14-10-2021 om 15:56 schreef Tvrtko Ursulin: > > On 14/10/2021 14:45, Maarten Lankhorst wrote: >> Op 14-10-2021 om 15:25 schreef Tvrtko Ursulin: >>> >>> On 14/10/2021 13:05, Maarten Lankhorst wrote: >>>> Op 14-10-2021 om 10:37 schreef Tvrtko Ursulin

[Intel-gfx] [PULL] drm-misc-fixes

2021-10-21 Thread Maarten Lankhorst
Hi Dave, New drm-misc-fixes without the vc4 changes. I feel that needs some more discussion first. drm-misc-fixes-2021-10-21-1: drm-misc-fixes for v5.15-rc7: - Rebased, to remove vc4 patches. - Fix mxsfb crash on unload. - Use correct sync parameters for Feixin K101-IM2BYL02. - Assorted kmb mode

[Intel-gfx] [PATCH 04/28] drm/i915: Remove unused bits of i915_vma/active api

2021-10-21 Thread Maarten Lankhorst
When reworking the code to move the eviction fence to the object, the best code is removed code. Remove some functions that are unused, and change the function definition if it's only used in 1 place. Signed-off-by: Maarten Lankhorst Reviewed-by: Niranjana Vishwanathapura --- drivers/gp

[Intel-gfx] [PATCH 02/28] drm/i915: use new iterator in i915_gem_object_wait_reservation

2021-10-21 Thread Maarten Lankhorst
From: Christian König Simplifying the code a bit. Signed-off-by: Christian König [mlankhorst: Handle timeout = 0 correctly, use new i915_request_wait_timeout.] Signed-off-by: Maarten Lankhorst --- drivers/gpu/drm/i915/gem/i915_gem_wait.c | 65 1 file changed, 20

[Intel-gfx] [PATCH 06/28] drm/i915: Remove gen6_ppgtt_unpin_all

2021-10-21 Thread Maarten Lankhorst
gen6_ppgtt_unpin_all is unused, kill it. Signed-off-by: Maarten Lankhorst Reviewed-by: Matthew Auld --- drivers/gpu/drm/i915/gt/gen6_ppgtt.c | 11 --- drivers/gpu/drm/i915/gt/gen6_ppgtt.h | 1 - 2 files changed, 12 deletions(-) diff --git a/drivers/gpu/drm/i915/gt/gen6_ppgtt.c b

[Intel-gfx] [PATCH 01/28] drm/i915: Fix i915_request fence wait semantics

2021-10-21 Thread Maarten Lankhorst
The i915_request fence wait behaves differently for timeout = 0 compared to expected dma-fence behavior. i915 behavior: - Unsignaled: -ETIME - Signaled: 0 (= timeout) Expected: - Unsignaled: 0 - Signaled: 1 Signed-off-by: Maarten Lankhorst --- drivers/gpu/drm/i915/i915_request.c | 57

[Intel-gfx] [PATCH 08/28] drm/i915: Create a full object for mock_ring, v2.

2021-10-21 Thread Maarten Lankhorst
This allows us to finally get rid of all the assumptions that vma->obj is NULL. Changes since v1: - Ensure the mock_ring vma is pinned to prevent a fault. - Pin it high to avoid failure in evict_for_vma selftest. Signed-off-by: Maarten Lankhorst --- drivers/gpu/drm/i915/gt/mock_engine.c |

[Intel-gfx] [PATCH 03/28] drm/i915: Remove dma_resv_prune

2021-10-21 Thread Maarten Lankhorst
The signaled bit is already used for quick testing if a fence is signaled. Signed-off-by: Maarten Lankhorst --- drivers/gpu/drm/i915/Makefile| 1 - drivers/gpu/drm/i915/dma_resv_utils.c| 17 - drivers/gpu/drm/i915/dma_resv_utils.h| 13

[Intel-gfx] [PATCH 07/28] drm/i915: Create a dummy object for gen6 ppgtt

2021-10-21 Thread Maarten Lankhorst
ook real enough. Also kill pin_mutex, it's not compatible with ww locking, and we can use the vm lock instead. Signed-off-by: Maarten Lankhorst --- drivers/gpu/drm/i915/gem/i915_gem_internal.c | 44 --- drivers/gpu/drm/i915/gt/gen6_ppgtt.c | 122 +++ drivers/gpu/drm

[Intel-gfx] [PATCH 05/28] drm/i915: Slightly rework EXEC_OBJECT_CAPTURE handling, v2.

2021-10-21 Thread Maarten Lankhorst
enforce it yet through annotations. Changes since v1: - Rebase on top of multi-batchbuffer changes. Signed-off-by: Maarten Lankhorst Reviewed-by: Niranjana Vishwanathapura #v1 --- .../gpu/drm/i915/gem/i915_gem_execbuffer.c| 29 --- drivers/gpu/drm/i915/i915_gpu_error.c

  1   2   3   4   5   6   7   8   9   10   >