[Intel-gfx] [PATCH v3 10/17] drm/i915: Require object lock when freeing pages during destruction

2021-12-16 Thread Maarten Lankhorst
TTM already requires this, and we require it for delayed destroy. Signed-off-by: Maarten Lankhorst Reviewed-by: Matthew Auld --- drivers/gpu/drm/i915/gem/i915_gem_object.c | 5 + 1 file changed, 5 insertions(+) diff --git a/drivers/gpu/drm/i915/gem/i915_gem_object.c b/drivers/gpu/drm

[PATCH v3 04/17] drm/i915: Take object lock in i915_ggtt_pin if ww is not set

2021-12-16 Thread Maarten Lankhorst
i915_vma_wait_for_bind needs the vma lock held, fix the caller. Signed-off-by: Maarten Lankhorst --- drivers/gpu/drm/i915/i915_vma.c | 40 +++-- 1 file changed, 28 insertions(+), 12 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_vma.c b/drivers/gpu/drm/i915

[Intel-gfx] [PATCH v3 04/17] drm/i915: Take object lock in i915_ggtt_pin if ww is not set

2021-12-16 Thread Maarten Lankhorst
i915_vma_wait_for_bind needs the vma lock held, fix the caller. Signed-off-by: Maarten Lankhorst --- drivers/gpu/drm/i915/i915_vma.c | 40 +++-- 1 file changed, 28 insertions(+), 12 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_vma.c b/drivers/gpu/drm/i915

[PATCH v3 03/17] drm/i915: Remove pages_mutex and intel_gtt->vma_ops.set/clear_pages members, v3.

2021-12-16 Thread Maarten Lankhorst
att) Remove race of clearing vma->pages accidentally from put, free it but leave it set, as only get has the lock. Signed-off-by: Maarten Lankhorst --- drivers/gpu/drm/i915/display/intel_dpt.c | 2 - drivers/gpu/drm/i915/gt/gen6_ppgtt.c | 15 - drivers/gpu/drm/i

[PATCH v3 06/17] drm/i915: Ensure gem_contexts selftests work with unbind changes, v2.

2021-12-16 Thread Maarten Lankhorst
as required. Changes since v1: - Fix cleaning up obj_b on failure. (Matt) Signed-off-by: Maarten Lankhorst Reviewed-by: Matthew Auld --- .../drm/i915/gem/selftests/i915_gem_context.c | 59 +++ 1 file changed, 35 insertions(+), 24 deletions(-) diff --git a/drivers/gpu/drm/i915/gem

[PATCH v3 09/17] drm/i915: Trylock the object when shrinking

2021-12-16 Thread Maarten Lankhorst
We're working on requiring the obj->resv lock during unbind, fix the shrinker to take the objectl ock. Signed-off-by: Maarten Lankhorst --- drivers/gpu/drm/i915/gem/i915_gem_shrinker.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/drivers/gpu/drm/i915/gem/i915_gem_shrinker.c

[Intel-gfx] [PATCH v3 03/17] drm/i915: Remove pages_mutex and intel_gtt->vma_ops.set/clear_pages members, v3.

2021-12-16 Thread Maarten Lankhorst
att) Remove race of clearing vma->pages accidentally from put, free it but leave it set, as only get has the lock. Signed-off-by: Maarten Lankhorst --- drivers/gpu/drm/i915/display/intel_dpt.c | 2 - drivers/gpu/drm/i915/gt/gen6_ppgtt.c | 15 - drivers/gpu/drm/i

[Intel-gfx] [PATCH v3 01/17] drm/i915: Remove unused bits of i915_vma/active api

2021-12-16 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 [mlankhorst: Remove

[Intel-gfx] [PATCH v3 05/17] drm/i915: Force ww lock for i915_gem_object_ggtt_pin_ww, v2.

2021-12-16 Thread Maarten Lankhorst
We will need the lock to unbind the vma, and wait for bind to complete. Remove the special casing for the !ww path, and force ww locking for all. Changes since v1: - Pass err to for_i915_gem_ww handling for -EDEADLK handling. Signed-off-by: Maarten Lankhorst --- drivers/gpu/drm/i915/i915_drv.h

[PATCH v3 05/17] drm/i915: Force ww lock for i915_gem_object_ggtt_pin_ww, v2.

2021-12-16 Thread Maarten Lankhorst
We will need the lock to unbind the vma, and wait for bind to complete. Remove the special casing for the !ww path, and force ww locking for all. Changes since v1: - Pass err to for_i915_gem_ww handling for -EDEADLK handling. Signed-off-by: Maarten Lankhorst --- drivers/gpu/drm/i915/i915_drv.h

[PATCH v3 00/17] drm/i915: Remove short term pins from execbuf by requiring lock to unbind.

2021-12-16 Thread Maarten Lankhorst
d, and replaced with unpinning the entire VM. Maarten Lankhorst (17): drm/i915: Remove unused bits of i915_vma/active api drm/i915: Change shrink ordering to use locking around unbinding. drm/i915: Remove pages_mutex and intel_gtt->vma_ops.set/clear_pages members, v3. drm/i915

[PATCH v3 01/17] drm/i915: Remove unused bits of i915_vma/active api

2021-12-16 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 [mlankhorst: Remove

[PATCH v3 08/17] drm/i915: Call i915_gem_evict_vm in vm_fault_gtt to prevent new ENOSPC errors

2021-12-16 Thread Maarten Lankhorst
Now that we cannot unbind kill the currently locked object directly because we're removing short term pinning, we may have to unbind the object from gtt manually, using a i915_gem_evict_vm() call. Signed-off-by: Maarten Lankhorst --- drivers/gpu/drm/i915/gem/i915_gem_mman.c | 18

[PATCH v3 02/17] drm/i915: Change shrink ordering to use locking around unbinding.

2021-12-16 Thread Maarten Lankhorst
Call drop_pages with the gem object lock held, instead of the other way around. This will allow us to drop the vma bindings with the gem object lock held. We plan to require the object lock for unpinning in the future, and this is an easy target. Signed-off-by: Maarten Lankhorst Reviewed

[Intel-gfx] [PATCH v3 00/17] drm/i915: Remove short term pins from execbuf by requiring lock to unbind.

2021-12-16 Thread Maarten Lankhorst
d, and replaced with unpinning the entire VM. Maarten Lankhorst (17): drm/i915: Remove unused bits of i915_vma/active api drm/i915: Change shrink ordering to use locking around unbinding. drm/i915: Remove pages_mutex and intel_gtt->vma_ops.set/clear_pages members, v3. drm/i915

[Intel-gfx] [PATCH v3 02/17] drm/i915: Change shrink ordering to use locking around unbinding.

2021-12-16 Thread Maarten Lankhorst
Call drop_pages with the gem object lock held, instead of the other way around. This will allow us to drop the vma bindings with the gem object lock held. We plan to require the object lock for unpinning in the future, and this is an easy target. Signed-off-by: Maarten Lankhorst Reviewed

Re: [PATCH v8 6/6] drm/sprd: add Unisoc's drm mipi dsi driver

2021-12-10 Thread Maarten Lankhorst
On 07-12-2021 15:27, Kevin Tang wrote: > Adds dsi host controller support for the Unisoc's display subsystem. > Adds dsi phy support for the Unisoc's display subsystem. > Only MIPI DSI Displays supported, DP/TV/HMDI will be support > in the feature. > > v1: > - Remove dphy and dsi graph binding,

Re: [PATCH v2 12/16] drm/i915: Add i915_vma_unbind_unlocked, and take obj lock for i915_vma_unbind

2021-12-09 Thread Maarten Lankhorst
On 09-12-2021 14:40, Matthew Auld wrote: > On Thu, 9 Dec 2021 at 13:25, Maarten Lankhorst > wrote: >> On 09-12-2021 14:05, Matthew Auld wrote: >>> On Mon, 29 Nov 2021 at 13:58, Maarten Lankhorst >>> wrote: >>>> We want to remove more membe

Re: [PATCH v2 12/16] drm/i915: Add i915_vma_unbind_unlocked, and take obj lock for i915_vma_unbind

2021-12-09 Thread Maarten Lankhorst
On 09-12-2021 14:05, Matthew Auld wrote: > On Mon, 29 Nov 2021 at 13:58, Maarten Lankhorst > wrote: >> We want to remove more members of i915_vma, which requires the locking to be >> held more often. >> >> Start requiring gem object lock for i915_vma_unbind, as it's

Re: [Intel-gfx] [PATCH v2 12/16] drm/i915: Add i915_vma_unbind_unlocked, and take obj lock for i915_vma_unbind

2021-12-09 Thread Maarten Lankhorst
On 09-12-2021 14:40, Matthew Auld wrote: > On Thu, 9 Dec 2021 at 13:25, Maarten Lankhorst > wrote: >> On 09-12-2021 14:05, Matthew Auld wrote: >>> On Mon, 29 Nov 2021 at 13:58, Maarten Lankhorst >>> wrote: >>>> We want to remove more membe

Re: [Intel-gfx] [PATCH v2 11/16] drm/i915: Call i915_gem_evict_vm in vm_fault_gtt to prevent new ENOSPC errors

2021-12-09 Thread Maarten Lankhorst
On 09-12-2021 13:17, Matthew Auld wrote: > On Mon, 29 Nov 2021 at 13:58, Maarten Lankhorst > wrote: >> Now that we cannot unbind kill the currently locked object directly > Can this be reworded slightly? Not sure what is meant by "unbind kill" here. Oops, the word '

Re: [Intel-gfx] [PATCH v2 11/16] drm/i915: Call i915_gem_evict_vm in vm_fault_gtt to prevent new ENOSPC errors

2021-12-09 Thread Maarten Lankhorst
On 09-12-2021 13:17, Matthew Auld wrote: > On Mon, 29 Nov 2021 at 13:58, Maarten Lankhorst > wrote: >> Now that we cannot unbind kill the currently locked object directly > Can this be reworded slightly? Not sure what is meant by "unbind kill" here. Oops, the word '

Re: [Intel-gfx] [PATCH v2 12/16] drm/i915: Add i915_vma_unbind_unlocked, and take obj lock for i915_vma_unbind

2021-12-09 Thread Maarten Lankhorst
On 09-12-2021 14:05, Matthew Auld wrote: > On Mon, 29 Nov 2021 at 13:58, Maarten Lankhorst > wrote: >> We want to remove more members of i915_vma, which requires the locking to be >> held more often. >> >> Start requiring gem object lock for i915_vma_unbind, as it's

Re: [Intel-gfx] [PATCH v2 10/16] drm/i915: Make i915_gem_evict_vm work correctly for already locked objects

2021-12-08 Thread Maarten Lankhorst
On 08-12-2021 13:07, Matthew Auld wrote: > On Mon, 29 Nov 2021 at 13:58, Maarten Lankhorst > wrote: >> i915_gem_execbuf will call i915_gem_evict_vm() after failing to pin >> all objects in the first round. We are about to remove those short-term >> pins, but even w

Re: [Intel-gfx] [PATCH v2 10/16] drm/i915: Make i915_gem_evict_vm work correctly for already locked objects

2021-12-08 Thread Maarten Lankhorst
On 08-12-2021 13:07, Matthew Auld wrote: > On Mon, 29 Nov 2021 at 13:58, Maarten Lankhorst > wrote: >> i915_gem_execbuf will call i915_gem_evict_vm() after failing to pin >> all objects in the first round. We are about to remove those short-term >> pins, but even w

Re: [Intel-gfx] [PATCH v2 07/16] drm/i915: Take trylock during eviction, v2.

2021-12-08 Thread Maarten Lankhorst
On 07-12-2021 12:01, Matthew Auld wrote: > On Mon, 29 Nov 2021 at 13:57, Maarten Lankhorst > wrote: >> Now that freeing objects takes the object lock when destroying the >> backing pages, we can confidently take the object lock even for dead >> objects. > That looks to

Re: [Intel-gfx] [PATCH v2 07/16] drm/i915: Take trylock during eviction, v2.

2021-12-08 Thread Maarten Lankhorst
On 07-12-2021 12:01, Matthew Auld wrote: > On Mon, 29 Nov 2021 at 13:57, Maarten Lankhorst > wrote: >> Now that freeing objects takes the object lock when destroying the >> backing pages, we can confidently take the object lock even for dead >> objects. > That looks to

Re: [PATCH v2 06/16] drm/i915: Ensure gem_contexts selftests work with unbind changes.

2021-12-08 Thread Maarten Lankhorst
On 07-12-2021 11:44, Matthew Auld wrote: > On Mon, 29 Nov 2021 at 13:57, Maarten Lankhorst > wrote: >> In the next commit, we don't evict when refcount = 0. >> >> igt_vm_isolation() continuously tries to pin/unpin at same address, >> but also calls put() on the obje

Re: [Intel-gfx] [PATCH v2 06/16] drm/i915: Ensure gem_contexts selftests work with unbind changes.

2021-12-08 Thread Maarten Lankhorst
On 07-12-2021 11:44, Matthew Auld wrote: > On Mon, 29 Nov 2021 at 13:57, Maarten Lankhorst > wrote: >> In the next commit, we don't evict when refcount = 0. >> >> igt_vm_isolation() continuously tries to pin/unpin at same address, >> but also calls put() on the obje

Re: [Intel-gfx] [PATCH v2 03/16] drm/i915: Remove pages_mutex and intel_gtt->vma_ops.set/clear_pages members, v2.

2021-12-07 Thread Maarten Lankhorst
On 06-12-2021 18:10, Matthew Auld wrote: > On Mon, 29 Nov 2021 at 13:57, Maarten Lankhorst > wrote: >> Big delta, but boils down to moving set_pages to i915_vma.c, and removing >> the special handling, all callers use the defaults anyway. We only remap >> in ggtt, s

Re: [Intel-gfx] [PATCH v2 03/16] drm/i915: Remove pages_mutex and intel_gtt->vma_ops.set/clear_pages members, v2.

2021-12-07 Thread Maarten Lankhorst
On 06-12-2021 18:10, Matthew Auld wrote: > On Mon, 29 Nov 2021 at 13:57, Maarten Lankhorst > wrote: >> Big delta, but boils down to moving set_pages to i915_vma.c, and removing >> the special handling, all callers use the defaults anyway. We only remap >> in ggtt, s

Re: [Intel-gfx] [PATCH v2 03/16] drm/i915: Remove pages_mutex and intel_gtt->vma_ops.set/clear_pages members, v2.

2021-12-06 Thread Maarten Lankhorst
On 06-12-2021 14:13, Matthew Auld wrote: > On Mon, 29 Nov 2021 at 13:57, Maarten Lankhorst > wrote: >> Big delta, but boils down to moving set_pages to i915_vma.c, and removing >> the special handling, all callers use the defaults anyway. We only remap >> in ggtt, s

Re: [Intel-gfx] [PATCH v2 03/16] drm/i915: Remove pages_mutex and intel_gtt->vma_ops.set/clear_pages members, v2.

2021-12-06 Thread Maarten Lankhorst
On 06-12-2021 14:13, Matthew Auld wrote: > On Mon, 29 Nov 2021 at 13:57, Maarten Lankhorst > wrote: >> Big delta, but boils down to moving set_pages to i915_vma.c, and removing >> the special handling, all callers use the defaults anyway. We only remap >> in ggtt, s

Re: [Intel-gfx] [PATCH v2 00/16] drm/i915: Remove short term pins from execbuf.

2021-12-01 Thread Maarten Lankhorst
On 30-11-2021 19:38, Tvrtko Ursulin wrote: > > On 30/11/2021 11:17, Maarten Lankhorst wrote: >> On 30-11-2021 09:54, Tvrtko Ursulin wrote: >>> >>> Hi, >>> >>> On 29/11/2021 13:47, Maarten Lankhorst wrote: >>>> New ver

Re: [Intel-gfx] [PATCH v2 00/16] drm/i915: Remove short term pins from execbuf.

2021-12-01 Thread Maarten Lankhorst
On 30-11-2021 19:38, Tvrtko Ursulin wrote: > > On 30/11/2021 11:17, Maarten Lankhorst wrote: >> On 30-11-2021 09:54, Tvrtko Ursulin wrote: >>> >>> Hi, >>> >>> On 29/11/2021 13:47, Maarten Lankhorst wrote: >>>> New ver

Re: [RESEND PATCH v7 6/6] drm/sprd: add Unisoc's drm mipi dsi driver

2021-11-30 Thread Maarten Lankhorst
On 22-11-2021 10:34, Kevin Tang wrote: > Adds dsi host controller support for the Unisoc's display subsystem. > Adds dsi phy support for the Unisoc's display subsystem. > Only MIPI DSI Displays supported, DP/TV/HMDI will be support > in the feature. > > v1: > - Remove dphy and dsi graph binding,

Re: [RFC PATCH 1/2] dma-fence: Avoid establishing a locking order between fence classes

2021-11-30 Thread Maarten Lankhorst
On 30-11-2021 13:19, Thomas Hellström wrote: > The locking order for taking two fence locks is implicitly defined in > at least two ways in the code: > > 1) Fence containers first and other fences next, which is defined by > the enable_signaling() callbacks of dma_fence_chain and >

Re: [Intel-gfx] [RFC PATCH 1/2] dma-fence: Avoid establishing a locking order between fence classes

2021-11-30 Thread Maarten Lankhorst
On 30-11-2021 13:19, Thomas Hellström wrote: > The locking order for taking two fence locks is implicitly defined in > at least two ways in the code: > > 1) Fence containers first and other fences next, which is defined by > the enable_signaling() callbacks of dma_fence_chain and >

Re: [Intel-gfx] [PATCH v2 00/16] drm/i915: Remove short term pins from execbuf.

2021-11-30 Thread Maarten Lankhorst
On 30-11-2021 09:54, Tvrtko Ursulin wrote: > > Hi, > > On 29/11/2021 13:47, Maarten Lankhorst wrote: >> New version of the series, with feedback from previous series added. > > If there was a cover letter sent for this work in the past could you please > keep attac

Re: [Intel-gfx] [PATCH v2 00/16] drm/i915: Remove short term pins from execbuf.

2021-11-30 Thread Maarten Lankhorst
On 30-11-2021 09:54, Tvrtko Ursulin wrote: > > Hi, > > On 29/11/2021 13:47, Maarten Lankhorst wrote: >> New version of the series, with feedback from previous series added. > > If there was a cover letter sent for this work in the past could you please > keep attac

[PATCH] drm/i915: Force ww lock for i915_gem_object_ggtt_pin_ww, v2.

2021-11-30 Thread Maarten Lankhorst
We will need the lock to unbind the vma, and wait for bind to complete. Remove the special casing for the !ww path, and force ww locking for all. Changes since v1: - Pass err to for_i915_gem_ww handling for -EDEADLK handling. Signed-off-by: Maarten Lankhorst --- drivers/gpu/drm/i915/i915_drv.h

[Intel-gfx] [PATCH] drm/i915: Force ww lock for i915_gem_object_ggtt_pin_ww, v2.

2021-11-30 Thread Maarten Lankhorst
We will need the lock to unbind the vma, and wait for bind to complete. Remove the special casing for the !ww path, and force ww locking for all. Changes since v1: - Pass err to for_i915_gem_ww handling for -EDEADLK handling. Signed-off-by: Maarten Lankhorst --- drivers/gpu/drm/i915/i915_drv.h

[PATCH v2 09/16] drm/i915: Ensure i915_vma tests do not get -ENOSPC with the locking changes.

2021-11-29 Thread Maarten Lankhorst
manually to prevent spurious -ENOSPC in those mock tests. Signed-off-by: Maarten Lankhorst --- drivers/gpu/drm/i915/selftests/i915_vma.c | 17 - 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/selftests/i915_vma.c b/drivers/gpu/drm/i915

[Intel-gfx] [PATCH v2 08/16] drm/i915: Pass trylock context to callers

2021-11-29 Thread Maarten Lankhorst
the locked objects are marked as locked by the correct ww. Signed-off-by: Maarten Lankhorst --- .../gpu/drm/i915/gem/i915_gem_execbuffer.c| 2 +- drivers/gpu/drm/i915/gem/i915_gem_object.h| 8 -- drivers/gpu/drm/i915/gem/i915_gem_shrinker.c | 4 +-- drivers/gpu/drm/i915/gem

[Intel-gfx] [PATCH v2 16/16] drm/i915: Remove short-term pins from execbuf, v5.

2021-11-29 Thread Maarten Lankhorst
during relocations. Changes since v3: - Preserve current behavior for batch buffer, instead be cautious when calling i915_gem_object_ggtt_pin_ww, and re-use the current batch vma if it's inside ggtt and map-and-fenceable. - Remove impossible condition check from eb_reserve. (Matt) Signed-off-by: M

[Intel-gfx] [PATCH v2 04/16] drm/i915: Take object lock in i915_ggtt_pin if ww is not set

2021-11-29 Thread Maarten Lankhorst
i915_vma_wait_for_bind needs the vma lock held, fix the caller. Signed-off-by: Maarten Lankhorst --- drivers/gpu/drm/i915/i915_vma.c | 40 +++-- 1 file changed, 28 insertions(+), 12 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_vma.c b/drivers/gpu/drm/i915

[Intel-gfx] [PATCH v2 12/16] drm/i915: Add i915_vma_unbind_unlocked, and take obj lock for i915_vma_unbind

2021-11-29 Thread Maarten Lankhorst
by the VMA, so after __i915_vma_unbind, vma may be garbage, and we need to cache vma->obj before unlocking. Signed-off-by: Maarten Lankhorst --- drivers/gpu/drm/i915/display/intel_fb_pin.c | 2 +- .../gpu/drm/i915/gem/selftests/huge_pages.c | 2 +- .../i915/gem/selftests/i915_gem_client_bl

[Intel-gfx] [PATCH v2 09/16] drm/i915: Ensure i915_vma tests do not get -ENOSPC with the locking changes.

2021-11-29 Thread Maarten Lankhorst
manually to prevent spurious -ENOSPC in those mock tests. Signed-off-by: Maarten Lankhorst --- drivers/gpu/drm/i915/selftests/i915_vma.c | 17 - 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/selftests/i915_vma.c b/drivers/gpu/drm/i915

[Intel-gfx] [PATCH v2 02/16] drm/i915: Change shrink ordering to use locking around unbinding.

2021-11-29 Thread Maarten Lankhorst
Call drop_pages with the gem object lock held, instead of the other way around. This will allow us to drop the vma bindings with the gem object lock held. We plan to require the object lock for unpinning in the future, and this is an easy target. Signed-off-by: Maarten Lankhorst Reviewed

[Intel-gfx] [PATCH v2 15/16] drm/i915: Remove support for unlocked i915_vma unbind

2021-11-29 Thread Maarten Lankhorst
Now that we require the object lock for all ops, some code handling race conditions can be removed. This is required to not take short-term pins inside execbuf. Signed-off-by: Maarten Lankhorst Acked-by: Niranjana Vishwanathapura --- drivers/gpu/drm/i915/i915_vma.c | 40

[PATCH v2 15/16] drm/i915: Remove support for unlocked i915_vma unbind

2021-11-29 Thread Maarten Lankhorst
Now that we require the object lock for all ops, some code handling race conditions can be removed. This is required to not take short-term pins inside execbuf. Signed-off-by: Maarten Lankhorst Acked-by: Niranjana Vishwanathapura --- drivers/gpu/drm/i915/i915_vma.c | 40

[PATCH v2 10/16] drm/i915: Make i915_gem_evict_vm work correctly for already locked objects

2021-11-29 Thread Maarten Lankhorst
allow multiple objects sharing the same resv to be evicted. Signed-off-by: Maarten Lankhorst --- drivers/gpu/drm/i915/i915_gem_evict.c | 23 ++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/i915_gem_evict.c b/drivers/gpu/drm/i915

[PATCH v2 12/16] drm/i915: Add i915_vma_unbind_unlocked, and take obj lock for i915_vma_unbind

2021-11-29 Thread Maarten Lankhorst
by the VMA, so after __i915_vma_unbind, vma may be garbage, and we need to cache vma->obj before unlocking. Signed-off-by: Maarten Lankhorst --- drivers/gpu/drm/i915/display/intel_fb_pin.c | 2 +- .../gpu/drm/i915/gem/selftests/huge_pages.c | 2 +- .../i915/gem/selftests/i915_gem_client_bl

[PATCH v2 16/16] drm/i915: Remove short-term pins from execbuf, v5.

2021-11-29 Thread Maarten Lankhorst
during relocations. Changes since v3: - Preserve current behavior for batch buffer, instead be cautious when calling i915_gem_object_ggtt_pin_ww, and re-use the current batch vma if it's inside ggtt and map-and-fenceable. - Remove impossible condition check from eb_reserve. (Matt) Signed-off-by: M

[PATCH v2 04/16] drm/i915: Take object lock in i915_ggtt_pin if ww is not set

2021-11-29 Thread Maarten Lankhorst
i915_vma_wait_for_bind needs the vma lock held, fix the caller. Signed-off-by: Maarten Lankhorst --- drivers/gpu/drm/i915/i915_vma.c | 40 +++-- 1 file changed, 28 insertions(+), 12 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_vma.c b/drivers/gpu/drm/i915

[PATCH v2 13/16] drm/i915: Require object lock when freeing pages during destruction

2021-11-29 Thread Maarten Lankhorst
TTM already requires this, and we require it for delayed destroy. Signed-off-by: Maarten Lankhorst Reviewed-by: Matthew Auld --- drivers/gpu/drm/i915/gem/i915_gem_object.c | 5 + 1 file changed, 5 insertions(+) diff --git a/drivers/gpu/drm/i915/gem/i915_gem_object.c b/drivers/gpu/drm

[PATCH v2 05/16] drm/i915: Force ww lock for i915_gem_object_ggtt_pin_ww

2021-11-29 Thread Maarten Lankhorst
We will need the lock to unbind the vma, and wait for bind to complete. Remove the special casing for the !ww path, and force ww locking for all. Signed-off-by: Maarten Lankhorst --- drivers/gpu/drm/i915/i915_drv.h | 7 ++- drivers/gpu/drm/i915/i915_gem.c | 26 ++ 2

[PATCH v2 08/16] drm/i915: Pass trylock context to callers

2021-11-29 Thread Maarten Lankhorst
the locked objects are marked as locked by the correct ww. Signed-off-by: Maarten Lankhorst --- .../gpu/drm/i915/gem/i915_gem_execbuffer.c| 2 +- drivers/gpu/drm/i915/gem/i915_gem_object.h| 8 -- drivers/gpu/drm/i915/gem/i915_gem_shrinker.c | 4 +-- drivers/gpu/drm/i915/gem

[PATCH v2 02/16] drm/i915: Change shrink ordering to use locking around unbinding.

2021-11-29 Thread Maarten Lankhorst
Call drop_pages with the gem object lock held, instead of the other way around. This will allow us to drop the vma bindings with the gem object lock held. We plan to require the object lock for unpinning in the future, and this is an easy target. Signed-off-by: Maarten Lankhorst Reviewed

[PATCH v2 11/16] drm/i915: Call i915_gem_evict_vm in vm_fault_gtt to prevent new ENOSPC errors

2021-11-29 Thread Maarten Lankhorst
Now that we cannot unbind kill the currently locked object directly because we're removing short term pinning, we may have to unbind the object from gtt manually, using a i915_gem_evict_vm() call. Signed-off-by: Maarten Lankhorst --- drivers/gpu/drm/i915/gem/i915_gem_mman.c | 18

[PATCH v2 03/16] drm/i915: Remove pages_mutex and intel_gtt->vma_ops.set/clear_pages members, v2.

2021-11-29 Thread Maarten Lankhorst
(), as it's locked with obj->mutex, and cmpxchg in unpin, which only fails if we race a against a new pin. Changes since v1: - aliasing gtt sets ZERO_SIZE_PTR, not -ENODEV, remove special case from __i915_vma_get_pages(). (Matt) Signed-off-by: Maarten Lankhorst --- drivers/gpu/drm/i915/disp

[Intel-gfx] [PATCH v2 10/16] drm/i915: Make i915_gem_evict_vm work correctly for already locked objects

2021-11-29 Thread Maarten Lankhorst
allow multiple objects sharing the same resv to be evicted. Signed-off-by: Maarten Lankhorst --- drivers/gpu/drm/i915/i915_gem_evict.c | 23 ++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/i915_gem_evict.c b/drivers/gpu/drm/i915

[Intel-gfx] [PATCH v2 14/16] drm/i915: Remove assert_object_held_shared

2021-11-29 Thread Maarten Lankhorst
This duck tape workaround is no longer required, unbind and destroy are fixed to take the obj->resv mutex before destroying and obj->mm.lock has been removed, always requiring obj->resv as well. Signed-off-by: Maarten Lankhorst --- drivers/gpu/drm/i915/gem/i915_gem_object.c | 4 ++--

[Intel-gfx] [PATCH v2 11/16] drm/i915: Call i915_gem_evict_vm in vm_fault_gtt to prevent new ENOSPC errors

2021-11-29 Thread Maarten Lankhorst
Now that we cannot unbind kill the currently locked object directly because we're removing short term pinning, we may have to unbind the object from gtt manually, using a i915_gem_evict_vm() call. Signed-off-by: Maarten Lankhorst --- drivers/gpu/drm/i915/gem/i915_gem_mman.c | 18

[PATCH v2 01/16] drm/i915: Remove unused bits of i915_vma/active api

2021-11-29 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 [mlankhorst: Remove

[Intel-gfx] [PATCH v2 03/16] drm/i915: Remove pages_mutex and intel_gtt->vma_ops.set/clear_pages members, v2.

2021-11-29 Thread Maarten Lankhorst
(), as it's locked with obj->mutex, and cmpxchg in unpin, which only fails if we race a against a new pin. Changes since v1: - aliasing gtt sets ZERO_SIZE_PTR, not -ENODEV, remove special case from __i915_vma_get_pages(). (Matt) Signed-off-by: Maarten Lankhorst --- drivers/gpu/drm/i915/disp

[Intel-gfx] [PATCH v2 07/16] drm/i915: Take trylock during eviction, v2.

2021-11-29 Thread Maarten Lankhorst
. This is the last step to requiring the object lock for vma_unbind. Changes since v1: - No longer require the refcount, as every freed object now holds the lock when unbinding VMA's. Signed-off-by: Maarten Lankhorst --- drivers/gpu/drm/i915/gem/i915_gem_shrinker.c | 6 drivers/gpu/drm/i915

[PATCH v2 07/16] drm/i915: Take trylock during eviction, v2.

2021-11-29 Thread Maarten Lankhorst
. This is the last step to requiring the object lock for vma_unbind. Changes since v1: - No longer require the refcount, as every freed object now holds the lock when unbinding VMA's. Signed-off-by: Maarten Lankhorst --- drivers/gpu/drm/i915/gem/i915_gem_shrinker.c | 6 drivers/gpu/drm/i915

[Intel-gfx] [PATCH v2 06/16] drm/i915: Ensure gem_contexts selftests work with unbind changes.

2021-11-29 Thread Maarten Lankhorst
as required. Signed-off-by: Maarten Lankhorst --- .../drm/i915/gem/selftests/i915_gem_context.c | 54 +++ 1 file changed, 32 insertions(+), 22 deletions(-) diff --git a/drivers/gpu/drm/i915/gem/selftests/i915_gem_context.c b/drivers/gpu/drm/i915/gem/selftests/i915_gem_context.c index

[PATCH v2 14/16] drm/i915: Remove assert_object_held_shared

2021-11-29 Thread Maarten Lankhorst
This duck tape workaround is no longer required, unbind and destroy are fixed to take the obj->resv mutex before destroying and obj->mm.lock has been removed, always requiring obj->resv as well. Signed-off-by: Maarten Lankhorst --- drivers/gpu/drm/i915/gem/i915_gem_object.c | 4 ++--

[PATCH v2 00/16] drm/i915: Remove short term pins from execbuf.

2021-11-29 Thread Maarten Lankhorst
New version of the series, with feedback from previous series added. First 11 patches are clean, some small fixes might required still for all to pass. Maarten Lankhorst (16): drm/i915: Remove unused bits of i915_vma/active api drm/i915: Change shrink ordering to use locking around

[Intel-gfx] [PATCH v2 00/16] drm/i915: Remove short term pins from execbuf.

2021-11-29 Thread Maarten Lankhorst
New version of the series, with feedback from previous series added. First 11 patches are clean, some small fixes might required still for all to pass. Maarten Lankhorst (16): drm/i915: Remove unused bits of i915_vma/active api drm/i915: Change shrink ordering to use locking around

[Intel-gfx] [PATCH v2 13/16] drm/i915: Require object lock when freeing pages during destruction

2021-11-29 Thread Maarten Lankhorst
TTM already requires this, and we require it for delayed destroy. Signed-off-by: Maarten Lankhorst Reviewed-by: Matthew Auld --- drivers/gpu/drm/i915/gem/i915_gem_object.c | 5 + 1 file changed, 5 insertions(+) diff --git a/drivers/gpu/drm/i915/gem/i915_gem_object.c b/drivers/gpu/drm

[Intel-gfx] [PATCH v2 05/16] drm/i915: Force ww lock for i915_gem_object_ggtt_pin_ww

2021-11-29 Thread Maarten Lankhorst
We will need the lock to unbind the vma, and wait for bind to complete. Remove the special casing for the !ww path, and force ww locking for all. Signed-off-by: Maarten Lankhorst --- drivers/gpu/drm/i915/i915_drv.h | 7 ++- drivers/gpu/drm/i915/i915_gem.c | 26 ++ 2

[PATCH v2 06/16] drm/i915: Ensure gem_contexts selftests work with unbind changes.

2021-11-29 Thread Maarten Lankhorst
as required. Signed-off-by: Maarten Lankhorst --- .../drm/i915/gem/selftests/i915_gem_context.c | 54 +++ 1 file changed, 32 insertions(+), 22 deletions(-) diff --git a/drivers/gpu/drm/i915/gem/selftests/i915_gem_context.c b/drivers/gpu/drm/i915/gem/selftests/i915_gem_context.c index

[Intel-gfx] [PATCH v2 01/16] drm/i915: Remove unused bits of i915_vma/active api

2021-11-29 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 [mlankhorst: Remove

Re: [PATCH 28/28] drm/i915: Remove short-term pins from execbuf, v4.

2021-11-29 Thread Maarten Lankhorst
On 25-10-2021 17:02, Matthew Auld wrote: > On Thu, 21 Oct 2021 at 11:37, Maarten Lankhorst > wrote: >> Add a flag PIN_VALIDATE, to indicate we don't need to pin and only >> protected by the object lock. >> >> This removes the need to unpin, which is done

Re: [Intel-gfx] [PATCH 28/28] drm/i915: Remove short-term pins from execbuf, v4.

2021-11-29 Thread Maarten Lankhorst
On 25-10-2021 17:02, Matthew Auld wrote: > On Thu, 21 Oct 2021 at 11:37, Maarten Lankhorst > wrote: >> Add a flag PIN_VALIDATE, to indicate we don't need to pin and only >> protected by the object lock. >> >> This removes the need to unpin, which is done

Re: [Intel-gfx] [PATCH 15/28] drm/i915: Add lock for unbinding to i915_gem_object_ggtt_pin_ww

2021-11-29 Thread Maarten Lankhorst
On 21-10-2021 19:48, Matthew Auld wrote: > On Thu, 21 Oct 2021 at 11:37, Maarten Lankhorst > wrote: >> Signed-off-by: Maarten Lankhorst > Needs a proper commit message. What about this? >> --- >> drivers/gpu/drm/i915/i915_gem.c | 9 - >> 1 file cha

Re: [Intel-gfx] [PATCH 15/28] drm/i915: Add lock for unbinding to i915_gem_object_ggtt_pin_ww

2021-11-29 Thread Maarten Lankhorst
On 21-10-2021 19:48, Matthew Auld wrote: > On Thu, 21 Oct 2021 at 11:37, Maarten Lankhorst > wrote: >> Signed-off-by: Maarten Lankhorst > Needs a proper commit message. What about this? >> --- >> drivers/gpu/drm/i915/i915_gem.c | 9 - >> 1 file cha

Re: [Intel-gfx] [PATCH 14/28] drm/i915: Take object lock in i915_ggtt_pin if ww is not set

2021-11-29 Thread Maarten Lankhorst
On 21-10-2021 19:39, Matthew Auld wrote: > On Thu, 21 Oct 2021 at 11:37, Maarten Lankhorst > wrote: >> i915_vma_wait_for_bind needs the vma lock held, fix the caller. >> >> Signed-off-by: Maarten Lankhorst >> --- >> drivers/gpu/drm/i915/i915_vma.c | 40 +++

Re: [Intel-gfx] [PATCH 14/28] drm/i915: Take object lock in i915_ggtt_pin if ww is not set

2021-11-29 Thread Maarten Lankhorst
On 21-10-2021 19:39, Matthew Auld wrote: > On Thu, 21 Oct 2021 at 11:37, Maarten Lankhorst > wrote: >> i915_vma_wait_for_bind needs the vma lock held, fix the caller. >> >> Signed-off-by: Maarten Lankhorst >> --- >> drivers/gpu/drm/i915/i915_vma.c | 40 +++

Re: [Intel-gfx] [PATCH 13/28] drm/i915: Remove pages_mutex and intel_gtt->vma_ops.set/clear_pages members

2021-11-29 Thread Maarten Lankhorst
On 22-10-2021 12:59, Matthew Auld wrote: > On Thu, 21 Oct 2021 at 18:30, Matthew Auld > wrote: >> On Thu, 21 Oct 2021 at 11:36, Maarten Lankhorst >> wrote: >>> Big delta, but boils down to moving set_pages to i915_vma.c, and removing >>> the special handling,

Re: [Intel-gfx] [PATCH 13/28] drm/i915: Remove pages_mutex and intel_gtt->vma_ops.set/clear_pages members

2021-11-29 Thread Maarten Lankhorst
On 22-10-2021 12:59, Matthew Auld wrote: > On Thu, 21 Oct 2021 at 18:30, Matthew Auld > wrote: >> On Thu, 21 Oct 2021 at 11:36, Maarten Lankhorst >> wrote: >>> Big delta, but boils down to moving set_pages to i915_vma.c, and removing >>> the special handling,

Re: [PATCH v7 2/6] drm/sprd: add Unisoc's drm kms master

2021-11-26 Thread Maarten Lankhorst
On 25-10-2021 11:34, Kevin Tang wrote: > Adds drm support for the Unisoc's display subsystem. > > This is drm kms driver, this driver provides support for the > application framework in Android, Yocto and more. > > Application framework can access Unisoc's display internal > peripherals through

Re: [PATCH 1/2] dim: Caution more against topic branches

2021-11-25 Thread Maarten Lankhorst
alk about topic branches anywhere else in > the docs hopefully this makes things a bit clearer. > > Cc: Jani Nikula > Cc: Joonas Lahtinen > Cc: Tvrtko Ursulin > Cc: Rodrigo Vivi > Cc: Lyude Paul > Cc: Thomas Zimmermann > Cc: Maarten Lankhorst > Cc: Maxime Ripard >

Re: [PATCH 1/6] dma-buf: move dma_resv_prune_unlocked into dma_resv.c

2021-11-25 Thread Maarten Lankhorst
On 28-10-2021 15:26, Christian König wrote: > The i915 driver implements a prune function which is called when it is very > likely that the fences inside the dma_resv object can be removed because they > are all signaled. > > Move that function into the dma-resv.c code since the behavior of

Re: [PATCH 1/6] dma-buf: move dma_resv_prune_unlocked into dma_resv.c

2021-11-25 Thread Maarten Lankhorst
On 28-10-2021 15:26, Christian König wrote: > The i915 driver implements a prune function which is called when it is very > likely that the fences inside the dma_resv object can be removed because they > are all signaled. > > Move that function into the dma-resv.c code since the behavior of

[PULL] drm-misc-fixes

2021-10-26 Thread Maarten Lankhorst
Hi Dave and Dan, Last pull request for me for v5.15 I hope. Out for vacation until the third week of november, Maxime offered to do the remainder of v5.15. ~Maarten drm-misc-fixes-2021-10-26: drm-misc-fixes for v5.15-rc8: - Fix fence leak in ttm_transfered_destroy. - Add quirk for Aya Neo 2021

[PULL] drm-misc-fixes

2021-10-26 Thread Maarten Lankhorst
Hi Dave and Dan, Last pull request for me for v5.15 I hope. Out for vacation until the third week of november, Maxime offered to do the remainder of v5.15. ~Maarten drm-misc-fixes-2021-10-26: drm-misc-fixes for v5.15-rc8: - Fix fence leak in ttm_transfered_destroy. - Add quirk for Aya Neo 2021

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

2021-10-26 Thread Maarten Lankhorst
Hi Dave and Dan, Last pull request for me for v5.15 I hope. Out for vacation until the third week of november, Maxime offered to do the remainder of v5.15. ~Maarten drm-misc-fixes-2021-10-26: drm-misc-fixes for v5.15-rc8: - Fix fence leak in ttm_transfered_destroy. - Add quirk for Aya Neo 2021

Re: [Intel-gfx] ✗ Fi.CI.IGT: failure for series starting with [01/28] drm/i915: Fix i915_request fence wait semantics

2021-10-22 Thread Maarten Lankhorst
Op 22-10-2021 om 13:24 schreef Matthew Auld: > On Thu, 21 Oct 2021 at 13:57, Patchwork > wrote: > > *Patch Details* > *Series:* series starting with [01/28] drm/i915: Fix i915_request > fence wait semantics > *URL:*

Re: [Intel-gfx] [PATCH 10/28] drm/i915: Change shrink ordering to use locking around unbinding.

2021-10-22 Thread Maarten Lankhorst
Op 21-10-2021 om 18:12 schreef Matthew Auld: > On Thu, 21 Oct 2021 at 11:37, Maarten Lankhorst > wrote: >> Call drop_pages with the gem object lock held, instead of the other >> way around. This will allow us to drop the vma bindings with the >> gem object lock held.

Re: [Intel-gfx] [PATCH 10/28] drm/i915: Change shrink ordering to use locking around unbinding.

2021-10-22 Thread Maarten Lankhorst
Op 21-10-2021 om 18:12 schreef Matthew Auld: > On Thu, 21 Oct 2021 at 11:37, Maarten Lankhorst > wrote: >> Call drop_pages with the gem object lock held, instead of the other >> way around. This will allow us to drop the vma bindings with the >> gem object lock held.

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

2021-10-22 Thread Maarten Lankhorst
Op 21-10-2021 om 17:57 schreef Matthew Auld: > On Thu, 21 Oct 2021 at 11:36, Maarten Lankhorst > wrote: >> 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 pinn

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

2021-10-22 Thread Maarten Lankhorst
Op 21-10-2021 om 17:57 schreef Matthew Auld: > On Thu, 21 Oct 2021 at 11:36, Maarten Lankhorst > wrote: >> 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 pinn

Re: [Intel-gfx] [PATCH 19/28] drm/i915: Pass trylock context to callers

2021-10-22 Thread Maarten Lankhorst
Op 21-10-2021 om 20:03 schreef Matthew Auld: > On Thu, 21 Oct 2021 at 11:37, Maarten Lankhorst > wrote: >> Signed-off-by: Maarten Lankhorst > Needs a proper commit message. What about this? drm/i915: Pass trylock context to callers We are moving away from short term pinning,

Re: [Intel-gfx] [PATCH 19/28] drm/i915: Pass trylock context to callers

2021-10-22 Thread Maarten Lankhorst
Op 21-10-2021 om 20:03 schreef Matthew Auld: > On Thu, 21 Oct 2021 at 11:37, Maarten Lankhorst > wrote: >> Signed-off-by: Maarten Lankhorst > Needs a proper commit message. What about this? drm/i915: Pass trylock context to callers We are moving away from short term pinning,

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

2021-10-22 Thread Maarten Lankhorst
Op 21-10-2021 om 16:43 schreef Matthew Auld: > On Thu, 21 Oct 2021 at 11:36, Maarten Lankhorst > wrote: >> The signaled bit is already used for quick testing if a fence is signaled. > Why do we need this change? Can you add some more details to the commit > please? It's a ter

Re: [PATCH 03/28] drm/i915: Remove dma_resv_prune

2021-10-22 Thread Maarten Lankhorst
Op 21-10-2021 om 16:43 schreef Matthew Auld: > On Thu, 21 Oct 2021 at 11:36, Maarten Lankhorst > wrote: >> The signaled bit is already used for quick testing if a fence is signaled. > Why do we need this change? Can you add some more details to the commit > please? It's a ter

<    1   2   3   4   5   6   7   8   9   10   >