Re: [Intel-gfx] [PATCH 3/4] drm/i915/gtt/xehpsdv: move scratch page to system memory

2021-12-08 Thread Thomas Hellström
platforms and call it a day, since that should work for all configurations. Signed-off-by: Matthew Auld Signed-off-by: Ramalingam C LGTM. Reviewed-by: Thomas Hellström --- drivers/gpu/drm/i915/gt/gen6_ppgtt.c | 1 + drivers/gpu/drm/i915/gt/gen8_ppgtt.c

Re: [Intel-gfx] [PATCH v9 2/8] drm/i915/ttm: add tt shmem backend

2021-12-08 Thread Thomas Hellström
On 12/8/21 10:24, Tvrtko Ursulin wrote: On 08/12/2021 08:39, Thomas Hellström wrote: On 12/8/21 09:30, Tvrtko Ursulin wrote: ... Apart from the code organisation questions, on the practical level - do you need writeback from the TTM backend or while I am proposing to remove it from

Re: [Intel-gfx] [PATCH v9 2/8] drm/i915/ttm: add tt shmem backend

2021-12-08 Thread Thomas Hellström
On 12/8/21 09:30, Tvrtko Ursulin wrote: ... Apart from the code organisation questions, on the practical level - do you need writeback from the TTM backend or while I am proposing to remove it from the "legacy" paths, I can propose removing it from the TTM flow as well? Yeah, if that

[PATCH] drm/i915: Fix coredump of perma-pinned vmas

2021-12-08 Thread Thomas Hellström
error capture code to avoid using the current vma state") Cc: Ramalingam C Cc: Matthew Auld Cc: Maarten Lankhorst Cc: John Harrison Cc: Matthew Brost Reported-by: John Harrison Signed-off-by: Thomas Hellström --- drivers/gpu/drm/i915/i915_gpu_error.c | 9 +++-- 1 file changed, 3 insert

Re: [Intel-gfx] [PATCH v7] drm/i915: Update error capture code to avoid using the current vma state

2021-12-07 Thread Thomas Hellström
Hi, John. On 12/7/21 21:46, John Harrison wrote: On 11/29/2021 12:22, Thomas Hellström wrote: With asynchronous migrations, the vma state may be several migrations ahead of the state that matches the request we're capturing. Address that by introducing an i915_vma_snapshot structure that can

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

2021-12-07 Thread Thomas Hellström
On 12/7/21 19:08, Daniel Vetter wrote: Once more an entire week behind on mails, but this looked interesting enough. On Fri, Dec 03, 2021 at 03:18:01PM +0100, Thomas Hellström wrote: On Fri, 2021-12-03 at 14:08 +0100, Christian König wrote: Am 01.12.21 um 13:16 schrieb Thomas Hellström

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

2021-12-03 Thread Thomas Hellström
On 12/3/21 15:26, Christian König wrote: [Adding Daniel here as well] Am 03.12.21 um 15:18 schrieb Thomas Hellström: [SNIP] Well that's ok as well. My question is why does this single dma_fence then shows up in the dma_fence_chain representing the whole migration? What we'd like to happen

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

2021-12-03 Thread Thomas Hellström
On Fri, 2021-12-03 at 14:08 +0100, Christian König wrote: > Am 01.12.21 um 13:16 schrieb Thomas Hellström (Intel): > > > > On 12/1/21 12:25, Christian König wrote: > > > Am 01.12.21 um 12:04 schrieb Thomas Hellström (Intel): > > > > > > > > On 12

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

2021-11-30 Thread Thomas Hellström
On 11/30/21 19:12, Thomas Hellström wrote: On Tue, 2021-11-30 at 16:02 +0100, Christian König wrote: Am 30.11.21 um 15:35 schrieb Thomas Hellström: On Tue, 2021-11-30 at 14:26 +0100, Christian König wrote: Am 30.11.21 um 13:56 schrieb Thomas Hellström: On 11/30/21 13:42, Christian König

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

2021-11-30 Thread Thomas Hellström
On Tue, 2021-11-30 at 16:02 +0100, Christian König wrote: > Am 30.11.21 um 15:35 schrieb Thomas Hellström: > > On Tue, 2021-11-30 at 14:26 +0100, Christian König wrote: > > > Am 30.11.21 um 13:56 schrieb Thomas Hellström: > > > > On 11/30/21 13:42, Christian König w

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

2021-11-30 Thread Thomas Hellström
On Tue, 2021-11-30 at 14:26 +0100, Christian König wrote: > Am 30.11.21 um 13:56 schrieb Thomas Hellström: > > > > On 11/30/21 13:42, Christian König wrote: > > > Am 30.11.21 um 13:31 schrieb Thomas Hellström: > > > > [SNIP] > > > > > Othe

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

2021-11-30 Thread Thomas Hellström
On 11/30/21 13:42, Christian König wrote: Am 30.11.21 um 13:31 schrieb Thomas Hellström: [SNIP] Other than that, I didn't investigate the nesting fails enough to say I can accurately review this. :) Basically the problem is that within enable_signaling() which is called with the dma_fence

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

2021-11-30 Thread Thomas Hellström
On 11/30/21 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 dma_fence_array. 2

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

2021-11-30 Thread Thomas Hellström
On 11/30/21 13:25, Maarten Lankhorst wrote: 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

[RFC PATCH 2/2] dma-fence: Avoid excessive recursive fence locking from enable_signaling() callbacks

2021-11-30 Thread Thomas Hellström
necessary. Cc: Christian König Cc: dri-devel@lists.freedesktop.org Cc: linaro-mm-...@lists.linaro.org Signed-off-by: Thomas Hellström --- drivers/dma-buf/dma-fence-array.c | 12 +++- drivers/dma-buf/dma-fence-chain.c | 9 + include/linux/dma-fence.h | 1 + 3 files changed

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

2021-11-30 Thread Thomas Hellström
. Cc: linaro-mm-...@lists.linaro.org Cc: dri-devel@lists.freedesktop.org Cc: Christian König Signed-off-by: Thomas Hellström --- drivers/dma-buf/dma-fence-array.c | 13 +++-- drivers/dma-buf/dma-fence-chain.c | 3 +- drivers/dma-buf/dma-fence.c | 79 +-- include

[RFC PATCH 0/2] Attempt to avoid dma-fence-[chain|array] lockdep splats

2021-11-30 Thread Thomas Hellström
excessive recursive locking in these containers (patch 2) Thomas Hellström (2): dma-fence: Avoid establishing a locking order between fence classes dma-fence: Avoid excessive recursive fence locking from enable_signaling() callbacks drivers/dma-buf/dma-fence-array.c | 23

[PATCH v7] drm/i915: Update error capture code to avoid using the current vma state

2021-11-29 Thread Thomas Hellström
change of allocation mode to the separate patch. - Commit message rework due to patch reordering. v7: - Adjust for removal of region refcounting. Signed-off-by: Thomas Hellström Reviewed-by: Ramalingam C --- drivers/gpu/drm/i915/Makefile | 1 + .../gpu/drm/i915/gem

[PATCH v2] dma_fence_array: Fix PENDING_ERROR leak in dma_fence_array_signaled()

2021-11-29 Thread Thomas Hellström
agate errors to dma-fence-array container") Cc: Chris Wilson Cc: Sumit Semwal Cc: Gustavo Padovan Cc: Christian König Cc: "Christian König" Cc: linux-me...@vger.kernel.org Cc: dri-devel@lists.freedesktop.org Cc: linaro-mm-...@lists.linaro.org Cc: # v5.4+ Signed-off-by: Thomas

Re: [PATCH] dma_fence_array: Fix PENDING_ERROR leak in dma_fence_array_signaled()

2021-11-29 Thread Thomas Hellström
On Mon, 2021-11-29 at 13:33 +0100, Christian König wrote: > Am 29.11.21 um 13:23 schrieb Thomas Hellström: > > Hi, Christian, > > > > On Mon, 2021-11-29 at 09:21 +0100, Christian König wrote: > > > Am 29.11.21 um 08:35 schrieb Thomas Hellström: > > > >

Re: [PATCH] dma_fence_array: Fix PENDING_ERROR leak in dma_fence_array_signaled()

2021-11-29 Thread Thomas Hellström
Hi, Christian, On Mon, 2021-11-29 at 09:21 +0100, Christian König wrote: > Am 29.11.21 um 08:35 schrieb Thomas Hellström: > > If a dma_fence_array is reported signaled by a call to > > dma_fence_is_signaled(), it may leak the PENDING_ERROR status. > > > > Fix this by

[PATCH] dma_fence_array: Fix PENDING_ERROR leak in dma_fence_array_signaled()

2021-11-28 Thread Thomas Hellström
") Cc: linaro-mm-...@lists.linaro.org Cc: Christian König Cc: Chris Wilson Signed-off-by: Thomas Hellström --- drivers/dma-buf/dma-fence-array.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/dma-buf/dma-fence-array.c b/drivers/dma-buf/dma-fence-arr

Re: drm/ttm: moving the LRU into the resource

2021-11-25 Thread Thomas Hellström
Hi, Christian, On 11/24/21 13:44, Christian König wrote: Hi guys, I've already send out this patch set a couple of times. This fixes the fundamental problem in TTM that during a move a buffer has resources allocated from two different domains at the same time. Additional to that it's a

Re: [PATCH 03/12] drm/ttm: add a weak BO reference to the resource v3

2021-11-25 Thread Thomas Hellström
On 11/24/21 13:44, Christian König wrote: Keep track for which BO a resource was allocated. This is necessary to move the LRU handling into the resources. A bit problematic is i915 since it tries to use the resource interface without a BO which is illegal from the conceptional point of view.

[PATCH v7 6/6] drm/i915/ttm: Update i915_gem_obj_copy_ttm() to be asynchronous

2021-11-22 Thread Thomas Hellström
Update the copy function i915_gem_obj_copy_ttm() to be asynchronous for future users and update the only current user to sync the objects as needed after this function. Signed-off-by: Thomas Hellström Reviewed-by: Matthew Auld --- drivers/gpu/drm/i915/gem/i915_gem_ttm_move.c | 40

[PATCH v7 4/6] drm/i915/ttm: Correctly handle waiting for gpu when shrinking

2021-11-22 Thread Thomas Hellström
in the shrinker_release_pages() op and an argument to that function indicating whether the shrinker expects it to not wait for gpu. In the latter case the shrinker_release_pages() op will return -EBUSY if the object is not idle. Signed-off-by: Thomas Hellström Reviewed-by: Matthew Auld --- drivers/gpu/drm

[PATCH v7 5/6] drm/i915/ttm: Implement asynchronous TTM moves

2021-11-22 Thread Thomas Hellström
a migration blit (Matthew Auld) Signed-off-by: Thomas Hellström Reviewed-by: Matthew Auld --- drivers/gpu/drm/i915/gem/i915_gem_ttm.c | 32 +- drivers/gpu/drm/i915/gem/i915_gem_ttm.h | 2 +- drivers/gpu/drm/i915/gem/i915_gem_ttm_move.c | 342 +-- drivers/gpu/drm/i915/gem

[PATCH v7 3/6] drm/i915/ttm: Drop region reference counting

2021-11-22 Thread Thomas Hellström
ect, drm_i915_gem_object may hold a reference to intel_memory_region. Break this loop by dropping region reference counting. In addition, Have regions with a manager moving fence make sure that all region objects are released before freeing the region. v6: - Fix a code comment. Signed-off-by: Thomas Hellst

[PATCH v7 1/6] drm/i915: Add support for moving fence waiting

2021-11-22 Thread Thomas Hellström
ing i915_vma_verify_bind_complete() (Matthew Auld) - Fix compilation failure if !CONFIG_DRM_I915_DEBUG_GEM - Fix include ordering. (Matthew Auld) v7: - Fix yet another compilation failure with clang if !CONFIG_DRM_I915_DEBUG_GEM Co-developed-by: Thomas Hellström Signed-off-by: Thomas Hellström Signed-

[PATCH v7 0/6] drm/i915/ttm: Async migration

2021-11-22 Thread Thomas Hellström
Thomas Hellström (5): drm/i915/ttm: Move the i915_gem_obj_copy_ttm() function drm/i915/ttm: Drop region reference counting drm/i915/ttm: Correctly handle waiting for gpu when shrinking drm/i915/ttm: Implement asynchronous TTM moves drm/i915/ttm: Update i915_gem_obj_copy_ttm

[PATCH v7 2/6] drm/i915/ttm: Move the i915_gem_obj_copy_ttm() function

2021-11-22 Thread Thomas Hellström
Move the i915_gem_obj_copy_ttm() function to i915_gem_ttm_move.h. This will help keep a number of functions static when introducing async moves. Signed-off-by: Thomas Hellström Reviewed-by: Matthew Auld --- drivers/gpu/drm/i915/gem/i915_gem_ttm.c | 47 --- drivers/gpu/drm/i915

[PATCH v6 6/6] drm/i915/ttm: Update i915_gem_obj_copy_ttm() to be asynchronous

2021-11-22 Thread Thomas Hellström
Update the copy function i915_gem_obj_copy_ttm() to be asynchronous for future users and update the only current user to sync the objects as needed after this function. Signed-off-by: Thomas Hellström Reviewed-by: Matthew Auld --- drivers/gpu/drm/i915/gem/i915_gem_ttm_move.c | 40

[PATCH v6 5/6] drm/i915/ttm: Implement asynchronous TTM moves

2021-11-22 Thread Thomas Hellström
a migration blit (Matthew Auld) Signed-off-by: Thomas Hellström Reviewed-by: Matthew Auld --- drivers/gpu/drm/i915/gem/i915_gem_ttm.c | 32 +- drivers/gpu/drm/i915/gem/i915_gem_ttm.h | 2 +- drivers/gpu/drm/i915/gem/i915_gem_ttm_move.c | 342 +-- drivers/gpu/drm/i915/gem

[PATCH v6 4/6] drm/i915/ttm: Correctly handle waiting for gpu when shrinking

2021-11-22 Thread Thomas Hellström
in the shrinker_release_pages() op and an argument to that function indicating whether the shrinker expects it to not wait for gpu. In the latter case the shrinker_release_pages() op will return -EBUSY if the object is not idle. Signed-off-by: Thomas Hellström Reviewed-by: Matthew Auld --- drivers/gpu/drm

[PATCH v6 3/6] drm/i915/ttm: Drop region reference counting

2021-11-22 Thread Thomas Hellström
ect, drm_i915_gem_object may hold a reference to intel_memory_region. Break this loop by dropping region reference counting. In addition, Have regions with a manager moving fence make sure that all region objects are released before freeing the region. v6: - Fix a code comment. Signed-off-by: Thomas Hellst

[PATCH v6 1/6] drm/i915: Add support for moving fence waiting

2021-11-22 Thread Thomas Hellström
ing i915_vma_verify_bind_complete() (Matthew Auld) - Fix compilation failure if !CONFIG_DRM_I915_DEBUG_GEM - Fix include ordering. (Matthew Auld) Co-developed-by: Thomas Hellström Signed-off-by: Thomas Hellström Signed-off-by: Maarten Lankhorst Reviewed-by: Matthew Auld --- drivers/gpu/drm/i915/

[PATCH v6 2/6] drm/i915/ttm: Move the i915_gem_obj_copy_ttm() function

2021-11-22 Thread Thomas Hellström
Move the i915_gem_obj_copy_ttm() function to i915_gem_ttm_move.h. This will help keep a number of functions static when introducing async moves. Signed-off-by: Thomas Hellström Reviewed-by: Matthew Auld --- drivers/gpu/drm/i915/gem/i915_gem_ttm.c | 47 --- drivers/gpu/drm/i915

[PATCH v6 0/6] drm/i915/ttm: Async migration

2021-11-22 Thread Thomas Hellström
for fence signaled before returning -EBUSY (Matthew Auld) - Use dma_resv_iter_is_exclusive() (Matthew Auld) - Await all dma-resv fences before a migration blit (Matthew Auld) Maarten Lankhorst (1): drm/i915: Add support for moving fence waiting Thomas Hellström (5): drm/i915/ttm: Move

[PATCH v5 6/6] drm/i915/ttm: Update i915_gem_obj_copy_ttm() to be asynchronous

2021-11-19 Thread Thomas Hellström
Update the copy function i915_gem_obj_copy_ttm() to be asynchronous for future users and update the only current user to sync the objects as needed after this function. Signed-off-by: Thomas Hellström --- drivers/gpu/drm/i915/gem/i915_gem_ttm_move.c | 40 ++-- drivers/gpu/drm

[PATCH v5 5/6] drm/i915/ttm: Implement asynchronous TTM moves

2021-11-19 Thread Thomas Hellström
for ghost objects (Matthew Auld) - Add more documentation for the i915_deps utility (Mattew Auld) - Simplify the i915_deps_sync() function Signed-off-by: Thomas Hellström --- drivers/gpu/drm/i915/gem/i915_gem_ttm.c | 32 +- drivers/gpu/drm/i915/gem/i915_gem_ttm.h | 2 +- drivers/gpu

[PATCH v5 3/6] drm/i915/ttm: Drop region reference counting

2021-11-19 Thread Thomas Hellström
ect, drm_i915_gem_object may hold a reference to intel_memory_region. Break this loop by dropping region reference counting. In addition, Have regions with a manager moving fence make sure that all region objects are released before freeing the region. Signed-off-by: Thomas Hellström Reviewed-by: Matthew A

[PATCH v5 4/6] drm/i915/ttm: Correctly handle waiting for gpu when shrinking

2021-11-19 Thread Thomas Hellström
in the shrinker_release_pages() op and an argument to that function indicating whether the shrinker expects it to not wait for gpu. In the latter case the shrinker_release_pages() op will return -EBUSY if the object is not idle. Signed-off-by: Thomas Hellström Reviewed-by: Matthew Auld --- drivers/gpu/drm

[PATCH v5 1/6] drm/i915: Add support for moving fence waiting

2021-11-19 Thread Thomas Hellström
ing i915_vma_verify_bind_complete() (Matthew Auld) - Fix compilation failure if !CONFIG_DRM_I915_DEBUG_GEM - Fix include ordering. (Matthew Auld) Co-developed-by: Thomas Hellström Signed-off-by: Thomas Hellström Signed-off-by: Maarten Lankhorst Reviewed-by: Matthew Auld --- drivers/gpu/drm/i915/

[PATCH v5 2/6] drm/i915/ttm: Move the i915_gem_obj_copy_ttm() function

2021-11-19 Thread Thomas Hellström
Move the i915_gem_obj_copy_ttm() function to i915_gem_ttm_move.h. This will help keep a number of functions static when introducing async moves. Signed-off-by: Thomas Hellström Reviewed-by: Matthew Auld --- drivers/gpu/drm/i915/gem/i915_gem_ttm.c | 47 --- drivers/gpu/drm/i915

[PATCH v5 0/6] drm/i915/ttm: Async migration

2021-11-19 Thread Thomas Hellström
: Add support for moving fence waiting Thomas Hellström (5): drm/i915/ttm: Move the i915_gem_obj_copy_ttm() function drm/i915/ttm: Drop region reference counting drm/i915/ttm: Correctly handle waiting for gpu when shrinking drm/i915/ttm: Implement asynchronous TTM moves drm/i915/ttm: Update

Sparsely populated TTM bos

2021-11-19 Thread Thomas Hellström
Hi, Christian, We have an upcoming use-case in i915 where one solution would be sparsely populated TTM bos. We had that at one point where ttm_tt pages were allocated on demand, but this time we'd rather be looking at multiple struct ttm_resources per bo and those resources could be from

[PATCH v4 4/6] drm/i915/ttm: Correctly handle waiting for gpu when shrinking

2021-11-18 Thread Thomas Hellström
in the shrinker_release_pages() op and an argument to that function indicating whether the shrinker expects it to not wait for gpu. In the latter case the shrinker_release_pages() op will return -EBUSY if the object is not idle. Signed-off-by: Thomas Hellström --- drivers/gpu/drm/i915/gem

[PATCH v4 6/6] drm/i915/ttm: Update i915_gem_obj_copy_ttm() to be asynchronous

2021-11-18 Thread Thomas Hellström
Update the copy function i915_gem_obj_copy_ttm() to be asynchronous for future users and update the only current user to sync the objects as needed after this function. Signed-off-by: Thomas Hellström --- drivers/gpu/drm/i915/gem/i915_gem_ttm_move.c | 40 ++-- drivers/gpu/drm

[PATCH v4 3/6] drm/i915/ttm: Drop region reference counting

2021-11-18 Thread Thomas Hellström
ect, drm_i915_gem_object may hold a reference to intel_memory_region. Break this loop by dropping region reference counting. In addition, Have regions with a manager moving fence make sure that all region objects are released before freeing the region. Signed-off-by: Thomas Hellström --- drivers/gpu/drm/i915/

[PATCH v4 5/6] drm/i915/ttm: Implement asynchronous TTM moves

2021-11-18 Thread Thomas Hellström
for ghost objects (Matthew Auld) - Add more documentation for the i915_deps utility (Mattew Auld) - Simplify the i915_deps_sync() function Signed-off-by: Thomas Hellström --- drivers/gpu/drm/i915/gem/i915_gem_ttm.c | 32 +- drivers/gpu/drm/i915/gem/i915_gem_ttm.h | 2 +- drivers/gpu

[PATCH v4 2/6] drm/i915/ttm: Move the i915_gem_obj_copy_ttm() function

2021-11-18 Thread Thomas Hellström
Move the i915_gem_obj_copy_ttm() function to i915_gem_ttm_move.h. This will help keep a number of functions static when introducing async moves. Signed-off-by: Thomas Hellström Reviewed-by: Matthew Auld --- drivers/gpu/drm/i915/gem/i915_gem_ttm.c | 47 --- drivers/gpu/drm/i915

[PATCH v4 1/6] drm/i915: Add support for moving fence waiting

2021-11-18 Thread Thomas Hellström
ace with a verification that the vma is already bound. (Matthew Auld) - Squash with a previous patch introducing moving fence waiting and accessing interfaces (Matthew Auld) - Rename to indicated that we also add support for sync waiting. Co-developed-by: Thomas Hellström Signed-off-by: Tho

[PATCH v4 0/6] drm/i915/ttm: Async migration

2021-11-18 Thread Thomas Hellström
. - Break what is now patch 4 out of patch 5. Add support for avoiding waiting for gpu when shrinking. - A number of changes in patch 5. See the commit message for details. Maarten Lankhorst (1): drm/i915: Add support for moving fence waiting Thomas Hellström (5): drm/i915/ttm: Move

Re: [PATCH v3 5/6] drm/i915/ttm: Implement asynchronous TTM moves

2021-11-17 Thread Thomas Hellström
Hi, Matthew Finally got some time to look at this more in-depth, please see below. On Mon, 2021-11-15 at 17:16 +, Matthew Auld wrote: > On 14/11/2021 11:12, Thomas Hellström wrote: > > Don't wait sync while migrating, but rather make the GPU blit await > > the > >

Re: [PATCH v2 1/6] drm/i915: move the pre_pin earlier

2021-11-17 Thread Thomas Hellström
On Wed, 2021-11-17 at 19:49 +0100, Thomas Hellström wrote: > > On 11/17/21 15:20, Matthew Auld wrote: > > In intel_context_do_pin_ww, when calling into the pre_pin > > hook(which is > > passed the ww context) it could in theory return -EDEADLK(which is > > very

Re: [PATCH v2 1/6] drm/i915: move the pre_pin earlier

2021-11-17 Thread Thomas Hellström
): - Also re-order the union unwind Signed-off-by: Matthew Auld Cc: Thomas Hellström Cc: Maarten Lankhorst Reviewed-by: Thomas Hellström --- drivers/gpu/drm/i915/gt/intel_context.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/i915/gt

Re: [PATCH 1/6] drm/i915: move the pre_pin earlier

2021-11-17 Thread Thomas Hellström
e default_state ready when initialising the lrc state, > and so there should be no concern with active_release somehow > prematurely setting the CONTEXT_VALID_BIT. > > Signed-off-by: Matthew Auld > Cc: Thomas Hellström > Cc: Maarten Lankhorst > --- >  drivers/gpu/drm/i915/gt/inte

Re: [PATCH v4] drm/ttm: Clarify that the TTM_PL_SYSTEM is under TTMs control

2021-11-16 Thread Thomas Hellström
On 11/16/21 09:54, Christian König wrote: Am 16.11.21 um 09:33 schrieb Thomas Hellström: On 11/16/21 09:20, Christian König wrote: Am 16.11.21 um 08:43 schrieb Thomas Hellström: On 11/16/21 08:19, Christian König wrote: Am 13.11.21 um 12:26 schrieb Thomas Hellström: Hi, Zack, On 11/11/21

Re: [PATCH v4] drm/ttm: Clarify that the TTM_PL_SYSTEM is under TTMs control

2021-11-16 Thread Thomas Hellström
On 11/16/21 09:20, Christian König wrote: Am 16.11.21 um 08:43 schrieb Thomas Hellström: On 11/16/21 08:19, Christian König wrote: Am 13.11.21 um 12:26 schrieb Thomas Hellström: Hi, Zack, On 11/11/21 17:44, Zack Rusin wrote: On Wed, 2021-11-10 at 09:50 -0500, Zack Rusin wrote: TTM takes

Re: [PATCH v4] drm/ttm: Clarify that the TTM_PL_SYSTEM is under TTMs control

2021-11-15 Thread Thomas Hellström
On 11/16/21 08:19, Christian König wrote: Am 13.11.21 um 12:26 schrieb Thomas Hellström: Hi, Zack, On 11/11/21 17:44, Zack Rusin wrote: On Wed, 2021-11-10 at 09:50 -0500, Zack Rusin wrote: TTM takes full control over TTM_PL_SYSTEM placed buffers. This makes driver internal usage

Re: [PATCH v3 5/6] drm/i915/ttm: Implement asynchronous TTM moves

2021-11-15 Thread Thomas Hellström
On 11/15/21 18:16, Matthew Auld wrote: Thanks for reviewing, Matthew, I'll take a look at the comments. /Thomas On 14/11/2021 11:12, Thomas Hellström wrote: Don't wait sync while migrating, but rather make the GPU blit await the dependencies and add a moving fence to the object

Re: [PATCH v3 2/6] drm/i915: Add support for asynchronous moving fence waiting

2021-11-15 Thread Thomas Hellström
On 11/15/21 14:13, Matthew Auld wrote: On 15/11/2021 12:42, Thomas Hellström wrote: On 11/15/21 13:36, Matthew Auld wrote: On 14/11/2021 11:12, Thomas Hellström wrote: From: Maarten Lankhorst For now, we will only allow async migration when TTM is used, so the paths we care about

Re: [PATCH v3 1/6] drm/i915: Add functions to set/get moving fence

2021-11-15 Thread Thomas Hellström
On 11/15/21 13:39, Matthew Auld wrote: On 14/11/2021 11:12, Thomas Hellström wrote: From: Maarten Lankhorst We want to get rid of i915_vma tracking to simplify the code and lifetimes. Add a way to set/put the moving fence, in preparation for removing the tracking. Signed-off-by: Maarten

Re: [PATCH v3 2/6] drm/i915: Add support for asynchronous moving fence waiting

2021-11-15 Thread Thomas Hellström
On 11/15/21 13:36, Matthew Auld wrote: On 14/11/2021 11:12, Thomas Hellström wrote: From: Maarten Lankhorst For now, we will only allow async migration when TTM is used, so the paths we care about are related to TTM. The mmap path is handled by having the fence in ttm_bo->moving, w

Re: [git pull] drm fixes + one missed next for 5.16-rc1

2021-11-14 Thread Thomas Hellström
On 11/14/21 22:19, Linus Torvalds wrote: On Sun, Nov 14, 2021 at 1:00 PM Dave Airlie wrote: i915 will no longer be x86-64 only in theory, since Intel now produces PCIe graphics cards using the same hw designs. Well, at least in my tree, it still has the "depends on X86", along with several

[PATCH v3 6/6] drm/i915/ttm: Update i915_gem_obj_copy_ttm() to be asynchronous

2021-11-14 Thread Thomas Hellström
Update the copy function i915_gem_obj_copy_ttm() to be asynchronous for future users and update the only current user to sync the objects as needed after this function. Signed-off-by: Thomas Hellström --- drivers/gpu/drm/i915/gem/i915_gem_ttm_move.c | 40 ++-- drivers/gpu/drm

[PATCH v3 5/6] drm/i915/ttm: Implement asynchronous TTM moves

2021-11-14 Thread Thomas Hellström
missing for fully asynchronous operation is asynchronous vma unbinding, which is still to be implemented. This commit substantially reduces execution time in the gem_lmem_swapping test. v2: - Make a couple of functions static. Signed-off-by: Thomas Hellström --- drivers/gpu/drm/i915/gem

[PATCH v3 4/6] drm/i915/ttm: Break refcounting loops at device region unref time

2021-11-14 Thread Thomas Hellström
ice takedown while the region is still present. Signed-off-by: Thomas Hellström --- drivers/gpu/drm/i915/gem/i915_gem_ttm.c | 1 + drivers/gpu/drm/i915/gt/intel_region_lmem.c | 1 + drivers/gpu/drm/i915/intel_memory_region.c | 5 +++- drivers/gpu/drm/i915/intel_memory_region.h | 1 + drivers/

[PATCH v3 2/6] drm/i915: Add support for asynchronous moving fence waiting

2021-11-14 Thread Thomas Hellström
ing a cpu map will only work after the moving fence signals. This should close all holes where userspace can read a buffer before it's fully migrated. v2: - Fix a couple of SPARSE warnings v3: - Fix a NULL pointer dereference Co-developed-by: Thomas Hellström Signed-off-by: Thomas Hellström Sig

[PATCH v3 3/6] drm/i915/ttm: Move the i915_gem_obj_copy_ttm() function

2021-11-14 Thread Thomas Hellström
Move the i915_gem_obj_copy_ttm() function to i915_gem_ttm_move.h. This will help keep a number of functions static when introducing async moves. Signed-off-by: Thomas Hellström --- drivers/gpu/drm/i915/gem/i915_gem_ttm.c | 47 --- drivers/gpu/drm/i915/gem/i915_gem_ttm.h

[PATCH v3 1/6] drm/i915: Add functions to set/get moving fence

2021-11-14 Thread Thomas Hellström
From: Maarten Lankhorst We want to get rid of i915_vma tracking to simplify the code and lifetimes. Add a way to set/put the moving fence, in preparation for removing the tracking. Signed-off-by: Maarten Lankhorst --- drivers/gpu/drm/i915/gem/i915_gem_object.c | 37 ++

[PATCH v3 0/6] drm/i915/ttm: Async migration

2021-11-14 Thread Thomas Hellström
warnings. v3: - Fix a NULL pointer dereference. Maarten Lankhorst (2): drm/i915: Add functions to set/get moving fence drm/i915: Add support for asynchronous moving fence waiting Thomas Hellström (4): drm/i915/ttm: Move the i915_gem_obj_copy_ttm() function drm/i915/ttm: Break refcounting loops

Re: [PATCH v4] drm/ttm: Clarify that the TTM_PL_SYSTEM is under TTMs control

2021-11-13 Thread Thomas Hellström
Hi, Zack, On 11/11/21 17:44, Zack Rusin wrote: On Wed, 2021-11-10 at 09:50 -0500, Zack Rusin wrote: TTM takes full control over TTM_PL_SYSTEM placed buffers. This makes driver internal usage of TTM_PL_SYSTEM prone to errors because it requires the drivers to manually handle all interactions

[PATCH v2 6/6] drm/i915/ttm: Update i915_gem_obj_copy_ttm() to be asynchronous

2021-11-11 Thread Thomas Hellström
Update the copy function i915_gem_obj_copy_ttm() to be asynchronous for future users and update the only current user to sync the objects as needed after this function. Signed-off-by: Thomas Hellström --- drivers/gpu/drm/i915/gem/i915_gem_ttm_move.c | 40 ++-- drivers/gpu/drm

[PATCH v2 5/6] drm/i915/ttm: Implement asynchronous TTM moves

2021-11-11 Thread Thomas Hellström
missing for fully asynchronous operation is asynchronous vma unbinding, which is still to be implemented. This commit substantially reduces execution time in the gem_lmem_swapping test. v2: - Make a couple of functions static. Signed-off-by: Thomas Hellström --- drivers/gpu/drm/i915/gem

[PATCH v2 4/6] drm/i915/ttm: Break refcounting loops at device region unref time

2021-11-11 Thread Thomas Hellström
ice takedown while the region is still present. Signed-off-by: Thomas Hellström --- drivers/gpu/drm/i915/gem/i915_gem_ttm.c | 1 + drivers/gpu/drm/i915/gt/intel_region_lmem.c | 1 + drivers/gpu/drm/i915/intel_memory_region.c | 5 +++- drivers/gpu/drm/i915/intel_memory_region.h | 1 + drivers/

[PATCH v2 3/6] drm/i915/ttm: Move the i915_gem_obj_copy_ttm() function

2021-11-11 Thread Thomas Hellström
Move the i915_gem_obj_copy_ttm() function to i915_gem_ttm_move.h. This will help keep a number of functions static when introducing async moves. Signed-off-by: Thomas Hellström --- drivers/gpu/drm/i915/gem/i915_gem_ttm.c | 47 --- drivers/gpu/drm/i915/gem/i915_gem_ttm.h

[PATCH v2 2/6] drm/i915: Add support for asynchronous moving fence waiting

2021-11-11 Thread Thomas Hellström
ing a cpu map will only work after the moving fence signals. This should close all holes where userspace can read a buffer before it's fully migrated. v2: - Fix a couple of SPARSE warnings Co-developed-by: Thomas Hellström Signed-off-by: Thomas Hellström Signed-off-by: Maarten Lankho

[PATCH v2 1/6] drm/i915: Add functions to set/get moving fence

2021-11-11 Thread Thomas Hellström
From: Maarten Lankhorst We want to get rid of i915_vma tracking to simplify the code and lifetimes. Add a way to set/put the moving fence, in preparation for removing the tracking. Signed-off-by: Maarten Lankhorst --- drivers/gpu/drm/i915/gem/i915_gem_object.c | 37 ++

[PATCH v2 0/6] drm/i915/ttm: Async migration

2021-11-11 Thread Thomas Hellström
warnings. Maarten Lankhorst (2): drm/i915: Add functions to set/get moving fence drm/i915: Add support for asynchronous moving fence waiting Thomas Hellström (4): drm/i915/ttm: Move the i915_gem_obj_copy_ttm() function drm/i915/ttm: Break refcounting loops at device region unref time drm/i915

[PATCH 6/6] drm/i915/ttm: Update i915_gem_obj_copy_ttm() to be asynchronous

2021-11-10 Thread Thomas Hellström
Update the copy function i915_gem_obj_copy_ttm() to be asynchronous for future users and update the only current user to sync the objects as needed after this function. Signed-off-by: Thomas Hellström --- drivers/gpu/drm/i915/gem/i915_gem_ttm_move.c | 40 ++-- drivers/gpu/drm

[PATCH 4/6] drm/i915/ttm: Break refcounting loops at device region unref time

2021-11-10 Thread Thomas Hellström
ice takedown while the region is still present. Signed-off-by: Thomas Hellström --- drivers/gpu/drm/i915/gem/i915_gem_ttm.c | 1 + drivers/gpu/drm/i915/gt/intel_region_lmem.c | 1 + drivers/gpu/drm/i915/intel_memory_region.c | 5 +++- drivers/gpu/drm/i915/intel_memory_region.h | 1 + drivers/

[PATCH 5/6] drm/i915/ttm: Implement asynchronous TTM moves

2021-11-10 Thread Thomas Hellström
missing for fully asynchronous operation is asynchronous vma unbinding, which is still to be implemented. This commit substantially reduces execution time in the gem_lmem_swapping test. Signed-off-by: Thomas Hellström --- drivers/gpu/drm/i915/gem/i915_gem_ttm.c | 10 + drivers/gpu/drm/i915

[PATCH 3/6] drm/i915/ttm: Move the i915_gem_obj_copy_ttm() function

2021-11-10 Thread Thomas Hellström
Move the i915_gem_obj_copy_ttm() function to i915_gem_ttm_move.h. This will help keep a number of functions static when introducing async moves. Signed-off-by: Thomas Hellström --- drivers/gpu/drm/i915/gem/i915_gem_ttm.c | 47 --- drivers/gpu/drm/i915/gem/i915_gem_ttm.h

[PATCH 2/6] drm/i915: Add support for asynchronous moving fence waiting

2021-11-10 Thread Thomas Hellström
ing a cpu map will only work after the moving fence signals. This should close all holes where userspace can read a buffer before it's fully migrated. Co-developed-by: Thomas Hellström Signed-off-by: Thomas Hellström Signed-off-by: Maarten Lankhorst --- drivers/gpu/drm/i915/display/intel_fbde

[PATCH 1/6] drm/i915: Add functions to set/get moving fence

2021-11-10 Thread Thomas Hellström
From: Maarten Lankhorst We want to get rid of i915_vma tracking to simplify the code and lifetimes. Add a way to set/put the moving fence, in preparation for removing the tracking. Signed-off-by: Maarten Lankhorst --- drivers/gpu/drm/i915/gem/i915_gem_object.c | 37 ++

[PATCH 0/6] drm/i915/ttm: Async migration

2021-11-10 Thread Thomas Hellström
: Add functions to set/get moving fence drm/i915: Add support for asynchronous moving fence waiting Thomas Hellström (4): drm/i915/ttm: Move the i915_gem_obj_copy_ttm() function drm/i915/ttm: Break refcounting loops at device region unref time drm/i915/ttm: Implement asynchronous TTM moves

Re: [PATCH] drm/i915/ttm: Fix illegal addition to shrinker list

2021-11-10 Thread Thomas Hellström
On 11/10/21 11:29, Matthew Auld wrote: On 10/11/2021 08:55, Thomas Hellström wrote: There's a small window of opportunity during which the adjust_lru() function can be called with a GEM refcount of zero from the TTM eviction code. This results in a kernel BUG(). Ensure that we don't attempt

[PATCH] drm/i915/ttm: Fix illegal addition to shrinker list

2021-11-10 Thread Thomas Hellström
("drm/i915/ttm: move shrinker management into adjust_lru") Signed-off-by: Thomas Hellström --- drivers/gpu/drm/i915/gem/i915_gem_ttm.c | 31 + 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/drivers/gpu/drm/i915/gem/i915_gem_ttm.c b/drivers/gpu/dr

[PATCH v6 4/4] drm/i915: Initial introduction of vma resources

2021-11-08 Thread Thomas Hellström
for rebinding the same vma with different I915_VMA_*_BIND flags v3: - Some style fixups. - Move the sync fence wait to __i915_vma_evict instead of __i915_vma_unbind to catch also the evict case on suspend. v4: - Remove a minor fix that incorrectly landed in this patch. Signed-off-by: Thomas

[PATCH v6 2/4] drm/i915: Use __GFP_KSWAPD_RECLAIM in the capture code

2021-11-08 Thread Thomas Hellström
00014 [ 234.843121] R13: R14: 7ffd14d79b60 R15: 0005 v5: - Use __GFP_KSWAPD_RECLAIM rather than __GFP_NOWAIT for clarity. (Daniel Vetter) v6: - Include an instance in execlists_capture_work(). - Rework the commit message due to patch reordering. Signed-off-by: Thomas Hellstr

[PATCH v6 3/4] drm/i915: Update error capture code to avoid using the current vma state

2021-11-08 Thread Thomas Hellström
change of allocation mode to the separate patch. - Commit message rework due to patch reordering. Signed-off-by: Thomas Hellström --- drivers/gpu/drm/i915/Makefile | 1 + .../gpu/drm/i915/gem/i915_gem_execbuffer.c| 135 +++--- drivers/gpu/drm/i915/gt/intel_engine_cs.c

[PATCH v6 0/4] drm/i915: Prepare error capture for asynchronous migration

2021-11-08 Thread Thomas Hellström
introduction of patch 2/4. - Use #if IS_ENABLED() rather than #ifdef similar to the rest of the driver Thomas Hellström (4): drm/i915: Avoid allocating a page array for the gpu coredump drm/i915: Use __GFP_KSWAPD_RECLAIM in the capture code drm/i915: Update error capture code to avoid

[PATCH v6 1/4] drm/i915: Avoid allocating a page array for the gpu coredump

2021-11-08 Thread Thomas Hellström
of the allocation succeeding. In particular large contigous allocations like the coredump page vector. Remove the page vector in favor of a linked list of single pages. Use the page lru list head as the list link, as the page owner is allowed to do that. Signed-off-by: Thomas Hellström

[PATCH v2] drm/i915/gem: Fix gem_madvise for ttm+shmem objects

2021-11-08 Thread Thomas Hellström
on the correct list. v2: - Revert a change that made swapped-out objects inaccessible for truncating. (Matthew Auld) Signed-off-by: Thomas Hellström --- drivers/gpu/drm/i915/i915_gem.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm

Re: [PATCH] drm/i915/gem: Fix gem_madvise for ttm+shmem objects

2021-11-08 Thread Thomas Hellström
On 11/8/21 09:08, Thomas Hellström wrote: On 11/5/21 16:18, Matthew Auld wrote: On 05/11/2021 13:03, Thomas Hellström wrote: Gem-TTM objects that are backed by shmem might have populated page-vectors without having the Gem pages set. Those objects aren't moved to the correct shrinker

Re: [PATCH] drm/i915/gem: Fix gem_madvise for ttm+shmem objects

2021-11-08 Thread Thomas Hellström
On 11/5/21 16:18, Matthew Auld wrote: On 05/11/2021 13:03, Thomas Hellström wrote: Gem-TTM objects that are backed by shmem might have populated page-vectors without having the Gem pages set. Those objects aren't moved to the correct shrinker / purge list by the gem_madvise. Furthermore

[PATCH] drm/i915/gem: Fix gem_madvise for ttm+shmem objects

2021-11-05 Thread Thomas Hellström
that. For such objects, identified by having the _SELF_MANAGED_SHRINK_LIST set, make sure they end up on the correct list and defer purging to the shrinker. Signed-off-by: Thomas Hellström --- drivers/gpu/drm/i915/i915_gem.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git

[PATCH] drm/i915/selftests: Use clear_and_wake_up_bit() for the per-engine reset bitlocks

2021-11-04 Thread Thomas Hellström
never waking up. Regardless whether that will be the final solution for GuC, use clear_and_wake_up_bit() pending a more thorough investigation on how this should be handled moving forward. Signed-off-by: Thomas Hellström --- drivers/gpu/drm/i915/gt/selftest_hangcheck.c | 8 drivers/gpu

[PATCH v5 2/2] drm/i915/ttm: Failsafe migration blits

2021-11-04 Thread Thomas Hellström
t end up waiting for a memcpy fence that would never signal. Signed-off-by: Thomas Hellström Reviewed-by: Matthew Auld --- drivers/gpu/drm/i915/gem/i915_gem_ttm_move.c | 324 +++--- drivers/gpu/drm/i915/gem/i915_gem_ttm_move.h | 5 + .../drm/i915/gem/selftests/i915_gem_migrate.c |

<    3   4   5   6   7   8   9   10   11   12   >