Re: [Intel-gfx] [PATCH] i915: Drop relocation support on all new hardware (v3)

2021-03-11 Thread Lucas De Marchi
On Wed, Mar 10, 2021 at 1:50 PM Jason Ekstrand wrote: > > The Vulkan driver in Mesa for Intel hardware never uses relocations if > it's running on a version of i915 that supports at least softpin which > all versions of i915 supporting Gen12 do. On the OpenGL side, Gen12+ is > only supported by i

Re: [Intel-gfx] [PATCH] i915: Drop relocation support on all new hardware (v3)

2021-03-11 Thread Tvrtko Ursulin
On 10/03/2021 21:50, Jason Ekstrand wrote: The Vulkan driver in Mesa for Intel hardware never uses relocations if it's running on a version of i915 that supports at least softpin which all versions of i915 supporting Gen12 do. On the OpenGL side, Gen12+ is only supported by iris which never us

Re: [Intel-gfx] [PATCH v3] drm/i915: Enable WaProgramMgsrForCorrectSliceSpecificMmioReads for Gen9

2021-03-11 Thread Tvrtko Ursulin
On 11/03/2021 01:27, Chiou, Cooper wrote: From: Tvrtko Ursulin Hi, On 08/03/2021 17:32, Chiou, Cooper wrote: I've tested on GLK, KBL, CFL Intel NUC devices and got the following performance results, there is no performance regression per my testing. Patch: [v5] drm/i915: Enable WaProgramMg

Re: [Intel-gfx] [PATCH] i915: Drop relocation support on all new hardware (v3)

2021-03-11 Thread Matthew Auld
On 11/03/2021 08:14, Lucas De Marchi wrote: On Wed, Mar 10, 2021 at 1:50 PM Jason Ekstrand wrote: The Vulkan driver in Mesa for Intel hardware never uses relocations if it's running on a version of i915 that supports at least softpin which all versions of i915 supporting Gen12 do. On the Open

Re: [Intel-gfx] [Linaro-mm-sig] [PATCH 1/2] dma-buf: Require VM_PFNMAP vma for mmap

2021-03-11 Thread Intel
On 3/1/21 3:09 PM, Daniel Vetter wrote: On Mon, Mar 1, 2021 at 11:17 AM Christian König wrote: Am 01.03.21 um 10:21 schrieb Thomas Hellström (Intel): On 3/1/21 10:05 AM, Daniel Vetter wrote: On Mon, Mar 01, 2021 at 09:39:53AM +0100, Thomas Hellström (Intel) wrote: Hi, On 3/1/21 9:28 AM,

Re: [Intel-gfx] [PATCH v5] drm/i915: Enable WaProgramMgsrForCorrectSliceSpecificMmioReads for Gen9

2021-03-11 Thread Tvrtko Ursulin
On 05/03/2021 12:58, Cooper Chiou wrote: WaProgramMgsrForCorrectSliceSpecificMmioReads applies for Gen9 to resolve VP8 hardware encoding system hang up on GT1 sku for ChromiumOS projects Slice specific MMIO read inaccurate so MGSR needs to be programmed appropriately to get correct reads from t

Re: [Intel-gfx] [PATCH v3] drm/i915: Enable WaProgramMgsrForCorrectSliceSpecificMmioReads for Gen9

2021-03-11 Thread Chiou, Cooper
> I was referring to the original performance regression report which came > from LKP which was on "i7-7567U" so Kabylake. Can yo find such machine to > test on? [Chiou, Cooper] Yes, lkp-tests team has tested this patch on lkp-kbl-nuc1 (KBL i7-7567U) as the following mail thread and there is no pe

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

2021-03-11 Thread Maarten Lankhorst
drm-misc-fixes-2021-03-11: drm-misc-fixes for rc3, rebased on rc2: - Fix oops in drm_fbdev_cleanup() - unpin qxl bos created as pinned when freeing them, and make ttm only warn once on this behavior. - Use LCD management for atyfb on PPC_MAC. - Use gitlab for drm bugzilla now. - Fix ttm page pool

[Intel-gfx] ✗ Fi.CI.BUILD: failure for series starting with [Linaro-mm-sig,1/2] dma-buf: Require VM_PFNMAP vma for mmap (rev4)

2021-03-11 Thread Patchwork
== Series Details == Series: series starting with [Linaro-mm-sig,1/2] dma-buf: Require VM_PFNMAP vma for mmap (rev4) URL : https://patchwork.freedesktop.org/series/87313/ State : failure == Summary == Applying: dma-buf: Require VM_PFNMAP vma for mmap error: git diff header lacks filename info

Re: [Intel-gfx] [PATCH v5] drm/i915: Enable WaProgramMgsrForCorrectSliceSpecificMmioReads for Gen9

2021-03-11 Thread Joonas Lahtinen
Quoting Tvrtko Ursulin (2021-03-11 12:45:54) > > On 05/03/2021 12:58, Cooper Chiou wrote: > > WaProgramMgsrForCorrectSliceSpecificMmioReads applies for Gen9 to > > resolve VP8 hardware encoding system hang up on GT1 sku for > > ChromiumOS projects > > > > Slice specific MMIO read inaccurate so MG

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

2021-03-11 Thread Rodrigo Vivi
Hi Dave and Daniel, Things are very quiet. Only 1 fix this round. Since I will be out next week, if this trend continues I will accumulate 2 weeks and send when in -rc4. Here goes drm-intel-fixes-2021-03-11: - Wedge the GPU if command parser setup fails (Tvrtko) Thanks, Rodrigo. The following

Re: [Intel-gfx] [PATCH] i915: Drop relocation support on all new hardware (v3)

2021-03-11 Thread Zbigniew Kempczyński
On Wed, Mar 10, 2021 at 03:50:07PM -0600, Jason Ekstrand wrote: > The Vulkan driver in Mesa for Intel hardware never uses relocations if > it's running on a version of i915 that supports at least softpin which > all versions of i915 supporting Gen12 do. On the OpenGL side, Gen12+ is > only support

Re: [Intel-gfx] [Linaro-mm-sig] [PATCH 1/2] dma-buf: Require VM_PFNMAP vma for mmap

2021-03-11 Thread Daniel Vetter
On Thu, Mar 11, 2021 at 11:22:06AM +0100, Thomas Hellström (Intel) wrote: > > On 3/1/21 3:09 PM, Daniel Vetter wrote: > > On Mon, Mar 1, 2021 at 11:17 AM Christian König > > wrote: > > > > > > > > > Am 01.03.21 um 10:21 schrieb Thomas Hellström (Intel): > > > > On 3/1/21 10:05 AM, Daniel Vetter

Re: [Intel-gfx] [Linaro-mm-sig] [PATCH 1/2] dma-buf: Require VM_PFNMAP vma for mmap

2021-03-11 Thread Intel
Hi! On 3/11/21 2:00 PM, Daniel Vetter wrote: On Thu, Mar 11, 2021 at 11:22:06AM +0100, Thomas Hellström (Intel) wrote: On 3/1/21 3:09 PM, Daniel Vetter wrote: On Mon, Mar 1, 2021 at 11:17 AM Christian König wrote: Am 01.03.21 um 10:21 schrieb Thomas Hellström (Intel): On 3/1/21 10:05 AM, D

Re: [Intel-gfx] [Linaro-mm-sig] [PATCH 1/2] dma-buf: Require VM_PFNMAP vma for mmap

2021-03-11 Thread Daniel Vetter
On Thu, Mar 11, 2021 at 2:12 PM Thomas Hellström (Intel) wrote: > > Hi! > > On 3/11/21 2:00 PM, Daniel Vetter wrote: > > On Thu, Mar 11, 2021 at 11:22:06AM +0100, Thomas Hellström (Intel) wrote: > >> On 3/1/21 3:09 PM, Daniel Vetter wrote: > >>> On Mon, Mar 1, 2021 at 11:17 AM Christian König > >>

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

2021-03-11 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| 95

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

2021-03-11 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/i915_gem_execbu

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

2021-03-11 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 v8 46/69] drm/i915/selftests: Prepare execbuf tests for obj->mm.lock removal.

2021-03-11 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 v8 41/69] drm/i915/selftests: Prepare huge_pages testcases for obj->mm.lock removal.

2021-03-11 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/d

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

2021-03-11 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 | 12 --- drivers/gpu/drm/i915/i915_gem.

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

2021-03-11 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/g

[Intel-gfx] [PATCH v8 01/69] drm/i915: Do not share hwsp across contexts any more, v7.

2021-03-11 Thread Maarten Lankhorst
Instead of sharing pages with breadcrumbs, give each timeline a single page. This allows unrelated timelines not to share locks any more during command submission. As an additional benefit, seqno wraparound no longer requires i915_vma_pin, which means we no longer need to worry about a potential -

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

2021-03-11 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/drm

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

2021-03-11 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 v8 43/69] drm/i915/selftests: Prepare coherency tests for obj->mm.lock removal.

2021-03-11 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/i915

[Intel-gfx] [PATCH v8 67/69] drm/i915: Add ww context to prepare_(read/write)

2021-03-11 Thread Maarten Lankhorst
This will allow us to explicitly pass the ww to pin_pages, when it starts taking it. Signed-off-by: Maarten Lankhorst --- drivers/gpu/drm/i915/gem/i915_gem_domain.c | 2 ++ drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c | 7 --- drivers/gpu/drm/i915/gem/i915_gem_object

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

2021-03-11 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 v8 06/69] drm/i915: Add gem object locking to madvise.

2021-03-11 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/gpu/drm/i

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

2021-03-11 Thread Maarten Lankhorst
We are removing obj->mm.lock, and need to take the reservation lock before we can pin pages. Move the pinning pages into the helper, and merge gtt pwrite/pread preparation and cleanup paths. The fence lock is also removed; it will conflict with fence annotations, because of memory allocations done

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

2021-03-11 Thread Maarten Lankhorst
Simple adding of i915_gem_object_lock, we may start to pass ww to get_pages() in the future, but that won't be the case here; We override shmem's get_pages() handling by calling i915_gem_object_get_pages_phys(), no ww is needed. Changes since v1: - Call shmem put pages directly, the callback would

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

2021-03-11 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 v8 56/69] drm/i915/selftests: Prepare timeline tests for obj->mm.lock removal

2021-03-11 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 deletions

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

2021-03-11 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 b

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

2021-03-11 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 v8 03/69] drm/i915: Move cmd parser pinning to execbuffer

2021-03-11 Thread Maarten Lankhorst
We need to get rid of allocations in the cmd parser, because it needs to be called from a signaling context, first move all pinning to execbuf, where we already hold all locks. Allocate jump_whitelist in the execbuffer, and add annotations around intel_engine_cmd_parser(), to ensure we only call t

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

2021-03-11 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 --- drivers/gpu/drm

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

2021-03-11 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/driver

[Intel-gfx] [PATCH v8 26/69] drm/i915: Make lrc_init_wa_ctx compatible with ww locking, v3.

2021-03-11 Thread Maarten Lankhorst
Make creation separate from pinning, in order to take the lock only once, and pin the mapping with the lock held. Changes since v1: - Rebase on top of upstream changes. Changes since v2: - Fully clear wa_ctx on error. Signed-off-by: Maarten Lankhorst Reviewed-by: Thomas Hellström --- drivers/g

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

2021-03-11 Thread Maarten Lankhorst
We should not allow this any more, as it will break with the new userptr implementation, it could still be made to work, but there's no point in doing so. Inspection of the beignet opencl driver shows that it's only used when normal userptr is not available, which means for new kernels you will ne

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

2021-03-11 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/i915_g

[Intel-gfx] [PATCH v8 69/69] drm/i915: Pass ww ctx to i915_gem_object_pin_pages

2021-03-11 Thread Maarten Lankhorst
This is the final part of passing ww ctx to the get_pages() callbacks. Now we no longer have to implicitly get ww ctx by using get_ww_ctx. Signed-off-by: Maarten Lankhorst --- drivers/gpu/drm/i915/display/intel_display.c | 2 +- drivers/gpu/drm/i915/gem/i915_gem_clflush.c | 2 +- drivers/gp

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

2021-03-11 Thread Maarten Lankhorst
New rebased version, now includes conversion to take a ww argument in the set_pages() callback, which completes the rework. Maarten Lankhorst (68): drm/i915: Do not share hwsp across contexts any more, v7. drm/i915: Pin timeline map after first timeline pin, v3. drm/i915: Move cmd parser pin

[Intel-gfx] [PATCH v8 66/69] drm/i915: Add ww parameter to get_pages() callback

2021-03-11 Thread Maarten Lankhorst
We will need this to support eviction with lmem, so explicitly pass ww as a parameter. Signed-off-by: Maarten Lankhorst --- drivers/gpu/drm/i915/gem/i915_gem_dmabuf.c | 3 ++- drivers/gpu/drm/i915/gem/i915_gem_internal.c | 3 ++- drivers/gpu/drm/i915/gem/i915_gem_object_types.h

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

2021-03-11 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 changed, 23 ins

[Intel-gfx] [PATCH v8 68/69] drm/i915: Pass ww ctx to pin_map

2021-03-11 Thread Maarten Lankhorst
This will allow us to explicitly pass the ww to pin_pages, when it starts taking it. This allows us to finally kill off the explicit passing of ww by retrieving it from the obj. Signed-off-by: Maarten Lankhorst --- .../gpu/drm/i915/gem/i915_gem_execbuffer.c| 7 --- drivers/gpu/drm/i915

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

2021-03-11 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 v8 32/69] drm/i915: Prepare for obj->mm.lock removal, v2.

2021-03-11 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. Changes since v1: - Rebase on top of upstream changes. Idea-from: Thomas Hellström Signed-off-by: Maarten Lankhorst Signed-off-by: Thomas Hellström

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

2021-03-11 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/i915

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

2021-03-11 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 i

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

2021-03-11 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 | 41 ++ 1 file changed, 19 insertions(+), 22 deletions(-) diff --git a/drivers/g

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

2021-03-11 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_dmabuf.c

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

2021-03-11 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 Lankhorst Reviewed

[Intel-gfx] [PATCH v8 13/69] drm/i915: Reject more ioctls for userptr, v2.

2021-03-11 Thread Maarten Lankhorst
There are a couple of ioctl's related to tiling and cache placement, that make no sense for userptr, reject those: - i915_gem_set_tiling_ioctl() Tiling should always be linear for userptr. Changing placement will fail with -ENXIO. - i915_gem_set_caching_ioctl() Userptr memory should alw

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

2021-03-11 Thread Maarten Lankhorst
We get a lockdep splat when the reset mutex is held, because it can be taken from fence_wait. This conflicts with the mmu notifier we have, because we recurse between reset mutex and mmap lock -> mmu notifier. Remove this recursion by calling revoke_mmaps before taking the lock. The reset code st

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

2021-03-11 Thread Maarten Lankhorst
In the ucode functions, the calls are done before userspace runs, when debugging using debugfs, or when creating semi-permanent mappings; we can safely use the unlocked versions that does the ww dance for us. Because there is no pin_pages_unlocked yet, add it as convenience function. This removes

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

2021-03-11 Thread Maarten Lankhorst
Instead of doing what we do currently, which will never work with PROVE_LOCKING, do the same as AMD does, and something similar to relocation slowpath. When all locks are dropped, we acquire the pages for pinning. When the locks are taken, we transfer those pages in .get_pages() to the bo. As a fin

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

2021-03-11 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 Acked-by: Jason Ekstrand --- drivers/gpu/drm/

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

2021-03-11 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 Reviewed-by: Thomas Hellström --- .../gpu/drm/i915/gem/i915_gem_execbuffer.c| 2 + driver

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

2021-03-11 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/i915/gem/selftest

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

2021-03-11 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/drm

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

2021-03-11 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/i915_gem_ob

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

2021-03-11 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 changed, 1 in

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

2021-03-11 Thread Maarten Lankhorst
Instead of force unbinding and rebinding every time, we try to check if our notifier seqcount is still correct when pages are bound. This way we only rebind userptr when we need to, and prevent stalls. Changes since v1: - Missing mutex_unlock, reported by kbuild. Reported-by: kernel test robot R

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

2021-03-11 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 v8 60/69] drm/i915/selftests: Prepare gtt tests for obj->mm.lock removal

2021-03-11 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: Th

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

2021-03-11 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 Reviewed-by: Thoma

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

2021-03-11 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/d

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

2021-03-11 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/i

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

2021-03-11 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 won

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

2021-03-11 Thread Maarten Lankhorst
We map the initial context during first pin. 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. intel_ring_submission_setup() is also reworked slightly to do all pinning in a single ww loop. Changes since v1: - Han

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

2021-03-11 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 b

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

2021-03-11 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 insertions

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

2021-03-11 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/d

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

2021-03-11 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 --g

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

2021-03-11 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_engine

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

2021-03-11 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 --- drivers/g

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

2021-03-11 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/g

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

2021-03-11 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/i915/gt/se

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

2021-03-11 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/i915

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

2021-03-11 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 | 136 ---

[Intel-gfx] [PATCH v8 64/69] drm/i915: Add missing -EDEADLK path in execbuffer ggtt pinning.

2021-03-11 Thread Maarten Lankhorst
In reloc_iomap we swallow the -EDEADLK error, but this needs to be returned for -EDEADLK handling. Add the missing check to make bsw pass again. Testcase: gem_exec_fence.basic-await Signed-off-by: Maarten Lankhorst --- drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c | 2 ++ 1 file changed, 2 ins

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

2021-03-11 Thread Maarten Lankhorst
We may create page table objects on the fly, but we may need to wait with the ww lock held. Instead of waiting on a freed obj lock, ensure we have the same lock for each object to keep -EDEADLK working. This ensures that i915_vma_pin_ww can lock the page tables when required. Signed-off-by: Maarte

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

2021-03-11 Thread Maarten Lankhorst
We're starting to require the reservation lock for pinning, so wait until we have that. Update the selftests to handle this correctly, and ensure pin is called in live_hwsp_rollover_user() and mock_hwsp_freelist(). Changes since v1: - Fix NULL + XX arithmatic, use casts. (kbuild) Changes since v2

[Intel-gfx] [PATCH v8 65/69] drm/i915: Fix pin_map in scheduler selftests

2021-03-11 Thread Maarten Lankhorst
Signed-off-by: Maarten Lankhorst --- drivers/gpu/drm/i915/selftests/i915_scheduler.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/selftests/i915_scheduler.c b/drivers/gpu/drm/i915/selftests/i915_scheduler.c index f54bdbeaa48b..4c306e40c416 100644 --- a

Re: [Intel-gfx] [PATCH 6/6] drm/i915: s/plane_res_b/blocks/ etc.

2021-03-11 Thread Lisovskiy, Stanislav
On Fri, Mar 05, 2021 at 05:36:10PM +0200, Ville Syrjala wrote: > From: Ville Syrjälä > > Rename a bunch of the skl+ watermark struct members to > have sensible names. Avoids me having to think what > plane_res_b/etc. means. Nice idea, was always wondering why such tricky names :) plane_res_b =>

[Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915: Remove obj->mm.lock! (rev16)

2021-03-11 Thread Patchwork
== Series Details == Series: drm/i915: Remove obj->mm.lock! (rev16) URL : https://patchwork.freedesktop.org/series/82337/ State : warning == Summary == $ dim checkpatch origin/drm-tip 62d87d68daa6 drm/i915: Do not share hwsp across contexts any more, v7. -:562: WARNING:CONSTANT_COMPARISON: Com

[Intel-gfx] ✗ Fi.CI.SPARSE: warning for drm/i915: Remove obj->mm.lock! (rev16)

2021-03-11 Thread Patchwork
== Series Details == Series: drm/i915: Remove obj->mm.lock! (rev16) URL : https://patchwork.freedesktop.org/series/82337/ State : warning == Summary == $ dim sparse --fast origin/drm-tip Sparse version: v0.6.2 Fast mode used, each commit won't be checked separately. +drivers/gpu/drm/i915/gt/in

[Intel-gfx] ✗ Fi.CI.DOCS: warning for drm/i915: Remove obj->mm.lock! (rev16)

2021-03-11 Thread Patchwork
== Series Details == Series: drm/i915: Remove obj->mm.lock! (rev16) URL : https://patchwork.freedesktop.org/series/82337/ State : warning == Summary == $ make htmldocs 2>&1 > /dev/null | grep i915 ./drivers/gpu/drm/i915/gem/i915_gem_shrinker.c:102: warning: Function parameter or member 'ww' n

Re: [Intel-gfx] [PATCH 2/6] drm/i915: Tighten SAGV constraint for pre-tgl

2021-03-11 Thread Lisovskiy, Stanislav
On Fri, Mar 05, 2021 at 05:36:06PM +0200, Ville Syrjala wrote: > From: Ville Syrjälä > > Say we have two planes enabled with watermarks configured > as follows: > plane A: wm0=enabled/can_sagv=false, wm1=enabled/can_sagv=true > plane B: wm0=enabled/can_sagv=true, wm1=disabled Was thinking about

[Intel-gfx] [PATCH] drm/i915: Uninit the DMC FW loader state during shutdown

2021-03-11 Thread Imre Deak
We need to wait for the DMC FW loader work to complete during shutdown, even if it's unlikely to be still pending by that time, fix this. This also fixes the wakeref tracking WARN during shutdown about the leaked reference we hold due to a missing DMC firmware. While at it add a TODO comment abou

[Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915: Uninit the DMC FW loader state during shutdown

2021-03-11 Thread Patchwork
== Series Details == Series: drm/i915: Uninit the DMC FW loader state during shutdown URL : https://patchwork.freedesktop.org/series/87883/ State : warning == Summary == $ dim checkpatch origin/drm-tip df2d63b8f2b7 drm/i915: Uninit the DMC FW loader state during shutdown -:20: WARNING:COMMIT_L

[Intel-gfx] ✗ Fi.CI.BAT: failure for drm/i915: Remove obj->mm.lock! (rev16)

2021-03-11 Thread Patchwork
== Series Details == Series: drm/i915: Remove obj->mm.lock! (rev16) URL : https://patchwork.freedesktop.org/series/82337/ State : failure == Summary == CI Bug Log - changes from CI_DRM_9849 -> Patchwork_19780 Summary --- **FAILURE**

[Intel-gfx] 2021 X.Org Foundation Membership renewal period extended to Mar 18

2021-03-11 Thread Harry Wentland
Due to some hickups with some of the early election emails and the large spike in membership registrations the elections committee decided to extend the membership deadline by one week to Mar 18, 2021. If you have not renewed your membership please do so by Thursday, Mar 18 at https://members.

Re: [Intel-gfx] [PATCH 1/2] drm/i915/dp_link_training: Add newlines to debug messages

2021-03-11 Thread Ville Syrjälä
On Wed, Mar 10, 2021 at 04:47:56PM -0500, Sean Paul wrote: > From: Sean Paul > > This patch adds some newlines which are missing from debug messages. > This will prevent logs from being stacked up in dmesg. > > Signed-off-by: Sean Paul > --- > drivers/gpu/drm/i915/display/intel_dp_link_trainin

Re: [Intel-gfx] [PATCH 2/2] drm/i915/dp_link_training: Convert DRM_DEBUG_KMS to drm_dbg_kms

2021-03-11 Thread Ville Syrjälä
On Wed, Mar 10, 2021 at 04:47:57PM -0500, Sean Paul wrote: > From: Sean Paul > > One instance of DRM_DEBUG_KMS was leftover in dp_link_training, convert > it to the new shiny. > > Signed-off-by: Sean Paul > --- > .../gpu/drm/i915/display/intel_dp_link_training.c | 15 --- > 1 file

Re: [Intel-gfx] [PATCH 2/6] drm/i915: Tighten SAGV constraint for pre-tgl

2021-03-11 Thread Ville Syrjälä
On Thu, Mar 11, 2021 at 04:36:05PM +0200, Lisovskiy, Stanislav wrote: > On Fri, Mar 05, 2021 at 05:36:06PM +0200, Ville Syrjala wrote: > > From: Ville Syrjälä > > > > Say we have two planes enabled with watermarks configured > > as follows: > > plane A: wm0=enabled/can_sagv=false, wm1=enabled/can

[Intel-gfx] ✗ Fi.CI.BAT: failure for drm/i915: Uninit the DMC FW loader state during shutdown

2021-03-11 Thread Patchwork
== Series Details == Series: drm/i915: Uninit the DMC FW loader state during shutdown URL : https://patchwork.freedesktop.org/series/87883/ State : failure == Summary == CI Bug Log - changes from CI_DRM_9849 -> Patchwork_19781 Summary -

[Intel-gfx] [PATCH v2 00/23] Separate display version numbering and add XE_LPD (version 13)

2021-03-11 Thread Matt Roper
Upcoming platforms will be using an updated display architecture called "XE_LPD." Despite the new name, XE_LPD is a pretty natural evolution from the current design we've been using on TGL, RKL, DG1, and ADL-S. This series provides the basic XE_LPD support that isn't tied to a specific platform; a

[Intel-gfx] [PATCH v2 01/23] drm/i915/display: Convert gen5/gen6 tests to IS_IRONLAKE/IS_SANDYBRIDGE

2021-03-11 Thread Matt Roper
ILK is the only platform that we consider "gen5" and SNB is the only platform we consider "gen6." Add an IS_SANDYBRIDGE() macro and then replace numeric platform tests for these two generations with direct platform tests with the following Coccinelle semantic patch: @@ expression dev_priv

  1   2   3   >