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

2021-01-28 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 v7 63/63] drm/i915: Move gt_revoke() slightly

2021-01-28 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 v7 27/63] drm/i915: Make __engine_unpark() compatible with ww locking.

2021-01-28 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 v7 26/63] drm/i915: Make lrc_init_wa_ctx compatible with ww locking, v2.

2021-01-28 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. Signed-off-by: Maarten Lankhorst Reviewed-by: Thomas Hellström --- drivers/gpu/drm/i915/gt/intel_lrc.c | 44 +

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

2021-01-28 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| 76

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

2021-01-28 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 v7 54/63] drm/i915/selftests: Prepare mocs tests for obj->mm.lock removal

2021-01-28 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 v7 03/63] drm/i915: Move cmd parser pinning to execbuffer

2021-01-28 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 v7 01/63] drm/i915: Do not share hwsp across contexts any more, v7.

2021-01-28 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 v7 53/63] drm/i915/selftests: Prepare execlists and lrc selftests for obj->mm.lock removal

2021-01-28 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 v7 58/63] drm/i915/selftests: Prepare memory region tests for obj->mm.lock removal

2021-01-28 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 v7 16/63] drm/i915: Fix userptr so we do not have to worry about obj->mm.lock, v6.

2021-01-28 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 v7 34/63] drm/i915: Add ww locking around vm_access()

2021-01-28 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 v7 00/63] drm/i915: Remove obj->mm.lock!

2021-01-28 Thread Maarten Lankhorst
Rebased on top of latest drm-tip. The userptr changes have been tested against beignet's selftests, and intel-compute-runtime with piglit. I added a few ERRs to check if the changed paths were hit, but didn't get any returned, and no new test failures, so no regressions. The userptr abi changes h

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

2021-01-28 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 v7 09/63] drm/i915: Convert i915_gem_object_attach_phys() to ww locking, v2.

2021-01-28 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 v7 06/63] drm/i915: Add gem object locking to madvise.

2021-01-28 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 v7 07/63] drm/i915: Move HAS_STRUCT_PAGE to obj->flags

2021-01-28 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 v7 10/63] drm/i915: make lockdep slightly happier about execbuf.

2021-01-28 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 v7 14/63] drm/i915: Reject UNSYNCHRONIZED for userptr, v2.

2021-01-28 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

Re: [Intel-gfx] [PATCH 20/41] drm/i915: Replace priolist rbtree with a skiplist

2021-01-28 Thread Chris Wilson
Quoting Tvrtko Ursulin (2021-01-28 15:56:19) > On 25/01/2021 14:01, Chris Wilson wrote: > > diff --git a/drivers/gpu/drm/i915/i915_priolist_types.h > > b/drivers/gpu/drm/i915/i915_priolist_types.h > > index bc2fa84f98a8..1200c3df6a4a 100644 > > --- a/drivers/gpu/drm/i915/i915_priolist_types.h > >

[Intel-gfx] [PATCH 5/5] drm/i915: Don't check tc_mode unless dealing with a TC PHY

2021-01-28 Thread Ville Syrjala
From: Ville Syrjälä We shouldn't really trust tc_mode on non-TC PHYs since we never initialize it explicitly. So let's check for the PHY type first. Fortunately TC_PORT_TBT_ALT happens to be zero so I don't think there's an actual bug here, just a possibility for a future one if someone rearrange

[Intel-gfx] [PATCH 4/5] drm/i915: Move HDMI vswing programming to the right place

2021-01-28 Thread Ville Syrjala
From: Ville Syrjälä The documented programming sequence indicates the correct point for the vswing programming is just before we enable the DDI. Make it so. Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/display/intel_ddi.c | 30 1 file changed, 15 insertions(+)

[Intel-gfx] [PATCH 3/5] drm/i915: Power up combo PHY lanes for for HDMI as well

2021-01-28 Thread Ville Syrjala
From: Ville Syrjälä Currently we only explicitly power up the combo PHY lanes for DP. The spec says we should do it for HDMI as well. Cc: sta...@vger.kernel.org Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/display/intel_ddi.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drive

[Intel-gfx] [PATCH 2/5] drm/i915: Extract intel_ddi_power_up_lanes()

2021-01-28 Thread Ville Syrjala
From: Ville Syrjälä Reduce the copypasta by pulling the combo PHY lane power up stuff into a helper. We'll have a third user soon. Cc: sta...@vger.kernel.org Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/display/intel_ddi.c | 35 +--- 1 file changed, 19 insertions(+

[Intel-gfx] [PATCH 1/5] drm/i915: Skip vswing programming for TBT

2021-01-28 Thread Ville Syrjala
From: Ville Syrjälä In thunderbolt mode the PHY is owned by the thunderbolt controller. We are not supposed to touch it. So skip the vswing programming as well (we already skipped the other steps not applicable to TBT). Touching this stuff could supposedly interfere with the PHY programming done

Re: [Intel-gfx] [PATCH 20/41] drm/i915: Replace priolist rbtree with a skiplist

2021-01-28 Thread Tvrtko Ursulin
On 25/01/2021 14:01, Chris Wilson wrote: Replace the priolist rbtree with a skiplist. The crucial difference is that walking and removing the first element of a skiplist is O(1), but O(lgN) for an rbtree, as we need to rebalance on remove. This is a hindrance for submission latency as it occurs

[Intel-gfx] ✓ Fi.CI.BAT: success for drm: Move struct drm_device.pdev to legacy (rev6)

2021-01-28 Thread Patchwork
== Series Details == Series: drm: Move struct drm_device.pdev to legacy (rev6) URL : https://patchwork.freedesktop.org/series/84205/ State : success == Summary == CI Bug Log - changes from CI_DRM_9693 -> Patchwork_19528 Summary --- *

[Intel-gfx] ✓ Fi.CI.BAT: success for series starting with [v5,1/8] drm/i915: make local-memory probing a GT operation (rev2)

2021-01-28 Thread Patchwork
== Series Details == Series: series starting with [v5,1/8] drm/i915: make local-memory probing a GT operation (rev2) URL : https://patchwork.freedesktop.org/series/86355/ State : success == Summary == CI Bug Log - changes from CI_DRM_9693 -> Patchwork_19527 ===

[Intel-gfx] ✗ Fi.CI.SPARSE: warning for series starting with [v5,1/8] drm/i915: make local-memory probing a GT operation (rev2)

2021-01-28 Thread Patchwork
== Series Details == Series: series starting with [v5,1/8] drm/i915: make local-memory probing a GT operation (rev2) URL : https://patchwork.freedesktop.org/series/86355/ State : warning == Summary == $ dim sparse --fast origin/drm-tip Sparse version: v0.6.2 Fast mode used, each commit won't

Re: [Intel-gfx] [PATCH 2/2] drm/i915: Fix the MST PBN divider calculation

2021-01-28 Thread Ville Syrjälä
On Mon, Jan 25, 2021 at 07:36:36PM +0200, Imre Deak wrote: > Atm the driver will calculate a wrong MST timeslots/MTP (aka time unit) > value for MST streams if the link parameters (link rate or lane count) > are limited in a way independent of the sink capabilities (reported by > DPCD). > > One ex

[Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for series starting with [v5,1/8] drm/i915: make local-memory probing a GT operation (rev2)

2021-01-28 Thread Patchwork
== Series Details == Series: series starting with [v5,1/8] drm/i915: make local-memory probing a GT operation (rev2) URL : https://patchwork.freedesktop.org/series/86355/ State : warning == Summary == $ dim checkpatch origin/drm-tip 9bdaab539cc2 drm/i915: make local-memory probing a GT operat

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

2021-01-28 Thread Jani Nikula
Hi Dave & Daniel - Apparently there's a regression in -rc5 that affects a large portion of the platforms in CI. See [1]. The issue showed up in -rc5 i.e. *before* the changes in this pull, however the issue prevents getting full coverage [2]. It does not look like this pull makes matters worse,

[Intel-gfx] [PATCH v6 4/5] drm/i915: Don't assign to struct drm_device.pdev

2021-01-28 Thread Thomas Zimmermann
Using struct drm_device.pdev is deprecated. Don't assign it. Users should upcast from struct drm_device.dev. v6: * also fix the assignment in selftests in this patch (Chris) Signed-off-by: Thomas Zimmermann Reviewed-by: Chris Wilson Cc: Jani Nikula Cc: Joonas Lahtinen Cc: Rodrigo Vivi

[Intel-gfx] [PATCH v6 5/5] drm: Move struct drm_device.pdev to legacy section

2021-01-28 Thread Thomas Zimmermann
Struct drm_device.pdev is being moved to legacy status as only legacy DRM drivers use it. A possible follow-up patchset could remove pdev entirely. v4: * rebased Signed-off-by: Thomas Zimmermann Reviewed-by: Chris Wilson Acked-by: Sam Ravnborg --- include/drm/drm_device.h | 6 +++---

[Intel-gfx] [PATCH v6 3/5] drm/i915/gvt: Remove references to struct drm_device.pdev

2021-01-28 Thread Thomas Zimmermann
Using struct drm_device.pdev is deprecated. Convert i915 to struct drm_device.dev. No functional changes. Signed-off-by: Thomas Zimmermann Reviewed-by: Chris Wilson Cc: Jani Nikula Cc: Joonas Lahtinen Cc: Rodrigo Vivi --- drivers/gpu/drm/i915/gvt/cfg_space.c | 5 +++-- drivers/gpu/drm/i915/

[Intel-gfx] [PATCH v6 2/5] drm/i915/gt: Remove references to struct drm_device.pdev

2021-01-28 Thread Thomas Zimmermann
Using struct drm_device.pdev is deprecated. Convert i915 to struct drm_device.dev. No functional changes. Signed-off-by: Thomas Zimmermann Reviewed-by: Chris Wilson Cc: Jani Nikula Cc: Joonas Lahtinen Cc: Rodrigo Vivi --- drivers/gpu/drm/i915/gt/intel_engine_cs.c | 2 +- drivers/gpu/drm/i91

[Intel-gfx] [PATCH v6 0/5] drm: Move struct drm_device.pdev to legacy

2021-01-28 Thread Thomas Zimmermann
V6 of the patchset fixes i915/selftests to do the assigment of pdev in a later patch. This was forgotten in v5. The pdev field in struct drm_device points to a PCI device structure and goes back to UMS-only days when all DRM drivers were for PCI devices. Meanwhile we also support USB, SPI and plat

[Intel-gfx] [PATCH v6 1/5] drm/i915: Remove references to struct drm_device.pdev

2021-01-28 Thread Thomas Zimmermann
Using struct drm_device.pdev is deprecated. Convert i915 to struct drm_device.dev. No functional changes. v6: * also remove assignment in selftests/ in a later patch (Chris) v5: * remove assignment in later patch (Chris) v3: * rebased v2: * move gt/ and gvt/ changes

[Intel-gfx] v5.11-rc5 BUG kmalloc-1k (Not tainted): Redzone overwritten

2021-01-28 Thread Jani Nikula
A number of our CI systems are hitting redzone overwritten errors after s2idle, with the errors introduced between v5.11-rc4 and v5.11-rc5. See snippet below, full logs for one affected machine at [1]. Known issue? BR, Jani. [1] https://intel-gfx-ci.01.org/tree/drm-intel-fixes/CI_DIF_549/fi-

Re: [Intel-gfx] [PATCH 22/41] drm/i915: Fair low-latency scheduling

2021-01-28 Thread Chris Wilson
Quoting Tvrtko Ursulin (2021-01-28 11:35:59) > > On 25/01/2021 14:01, Chris Wilson wrote: > > The first "scheduler" was a topographical sorting of requests into > > priority order. The execution order was deterministic, the earliest > > submitted, highest priority request would be executed first.

Re: [Intel-gfx] [PATCH 22/41] drm/i915: Fair low-latency scheduling

2021-01-28 Thread Tvrtko Ursulin
On 25/01/2021 14:01, Chris Wilson wrote: The first "scheduler" was a topographical sorting of requests into priority order. The execution order was deterministic, the earliest submitted, highest priority request would be executed first. Priority inheritance ensured that inversions were kept at

Re: [Intel-gfx] [PATCH 20/41] drm/i915: Replace priolist rbtree with a skiplist

2021-01-28 Thread Chris Wilson
Quoting Tvrtko Ursulin (2021-01-27 15:58:12) > Okay makes sense. The change in key drives the requirement so just > please mention in the commit message and I'll tackle the skip list > mechanics in the meantime. In the following patches, we introduce a new sort key to the scheduler, a virtual de

Re: [Intel-gfx] [PATCH v2 02/11] drm/i915: Limit plane stride to below TILEOFF.x limit

2021-01-28 Thread Karthik B S
On 1/11/2021 10:07 PM, Ville Syrjala wrote: From: Ville Syrjälä Limit pre-skl plane stride to below 4k or 8k pixels (depending on the platform). We do this in order guarantee that TILEOFF/OFFSET.x does not get too big. Currently this is not a problem as we align SURF to 4k, and so TILEOFF/OFFS

Re: [Intel-gfx] [PATCH] drm/i915/gt: Prefer local execution_mask for determing viable engines

2021-01-28 Thread Tvrtko Ursulin
On 27/01/2021 09:06, Chris Wilson wrote: In gen8_emit_flush_xcs, we have to look at all the engines the request may execute on, and emit an aux-invalidate for each. Currently, we handle the virtual engine by looking at its engine mask, but that is copied and refined as the request->execution_ma

[Intel-gfx] ✗ Fi.CI.BUILD: failure for disable the QSES check for HDCP2.2 over MST

2021-01-28 Thread Patchwork
== Series Details == Series: disable the QSES check for HDCP2.2 over MST URL : https://patchwork.freedesktop.org/series/86375/ State : failure == Summary == Applying: drm/i915/hdcp: disable the QSES check for HDCP2.2 over MST Using index info to reconstruct a base tree... M drivers/gpu/d

[Intel-gfx] ✓ Fi.CI.IGT: success for Final set of patches for ADLS enabling (rev2)

2021-01-28 Thread Patchwork
== Series Details == Series: Final set of patches for ADLS enabling (rev2) URL : https://patchwork.freedesktop.org/series/86322/ State : success == Summary == CI Bug Log - changes from CI_DRM_9690_full -> Patchwork_19525_full Summary --

<    1   2