[PULL] drm-misc-next

2021-07-22 Thread Maarten Lankhorst
drm-misc-next-2021-07-22: drm-misc-next for v5.15-rc1: UAPI Changes: - Remove sysfs stats for dma-buf attachments, as it causes a performance regression. Previous merge is not in a rc kernel yet, so no userspace regression possible. Cross-subsystem Changes: - Sanitize user input in kyro's view

Re: [PATCH] drm/i915/userptr: Probe existence of backing struct pages upon creation

2021-07-26 Thread Maarten Lankhorst
n). > - Move the param next to all the other params which just return true. > > Testcase: igt/gem_userptr_blits/probe > Signed-off-by: Chris Wilson > Signed-off-by: Matthew Auld > Cc: Thomas Hellström > Cc: Maarten Lankhorst > Cc: Tvrtko Ursulin > Cc: Jordan Justen > C

[PULL] drm-misc-next

2021-07-29 Thread Maarten Lankhorst
-mipi-dsi: Find the possible DSI devices Jose Maria Casanova Crespo (1): drm/prime: fix comment on PRIME Helpers Linus Walleij (1): drm/panel-sony-acx424akp: Modernize backlight handling Maarten Lankhorst (1): Backmerge remote-tracking branch 'drm/drm-next' into drm-

Re: [PATCH] drm: Fix oops in damage self-tests by mocking damage property

2021-08-02 Thread Maarten Lankhorst
r > Fixes: c7fcbf251397 ("drm/plane: check that fb_damage is set up when used") > Cc: José Roberto de Souza (v1) > Cc: Ville Syrjälä > Cc: Gwan-gyeong Mun > Cc: José Roberto de Souza > Cc: Hans de Goede > Cc: Daniel Vetter > Cc: Maarten Lankhorst > Cc: Maxime

Re: [PATCH v2 1/2] locking/lockdep: Provide lockdep_assert{, _once}() helpers

2021-08-02 Thread Maarten Lankhorst
Op 31-07-2021 om 10:24 schreef Desmond Cheong Zhi Xi: > From: Peter Zijlstra > > Extract lockdep_assert{,_once}() helpers to more easily write composite > assertions like, for example: > > lockdep_assert(lockdep_is_held(&drm_device.master_mutex) || > lockdep_is_held(&drm

Re: [Intel-gfx] [PATCH] drm/i915/userptr: Probe existence of backing struct pages upon creation

2021-08-03 Thread Maarten Lankhorst
07/2021 16:14, Jason Ekstrand wrote: >>>>> On Mon, Jul 26, 2021 at 3:31 AM Maarten Lankhorst >>>>> wrote: >>>>>> Op 23-07-2021 om 13:34 schreef Matthew Auld: >>>>>>> From: Chris Wilson >>>>>>> >>>&g

[PULL] drm-misc-fixes

2021-04-09 Thread Maarten Lankhorst
drm-misc-fixes-2021-04-09: drm-misc-fixes for v5.12-rc7: - Fix use-after-free in xen. - Reduce fifo threshold on hvs4 to fix a fifo full error. - Disable TE support for Droid4 and N950. - Small compiler fixes. The following changes since commit 50891bead80bc79871528c2962d65c781c02330b: drm/etnav

[PATCH 1/2] drm/i915: Remove asynchronous vma binding

2021-04-20 Thread Maarten Lankhorst
ry allocation inside stop_machine is allowed. This patch does not fix that lockdep splat yet, but will allow the next patch to remove it. Signed-off-by: Maarten Lankhorst Acked-by: Daniel Vetter --- drivers/gpu/drm/i915/gem/i915_gem_stolen.c | 3 - drivers/gpu/drm/i915/gt/gen6_ppgtt.c | 1 -

[PATCH 2/2] drm/i915: Use trylock in shrinker for ggtt on bsw vt-d and bxt, v2.

2021-04-20 Thread Maarten Lankhorst
driver_attach+0x83/0x140 <4>[ 462.602091] ? device_driver_attach+0x50/0x50 <4>[ 462.602099] ? device_driver_attach+0x50/0x50 <4>[ 462.602107] bus_for_each_dev+0x75/0xc0 <4>[ 462.602116] bus_add_driver+0x14b/0x1f0 <4>[ 462.602124] driver_register+0

[PATCH] drm/i915: Fix docbook descriptions for i915_cmd_parser

2021-04-21 Thread Maarten Lankhorst
member 'batch_map' not described in 'intel_engine_cmd_parser' drivers/gpu/drm/i915/i915_cmd_parser.c:1420: warning: Excess function parameter 'trampoline' description in 'intel_engine_cmd_parser' Reported-by: Stephen Rothwell Signed-off-by: Maarten Lankhor

[PATCH] drm/i915: Fix docbook descriptions for i915_gem_shrinker

2021-04-21 Thread Maarten Lankhorst
Fixes the following htmldocs warning: drivers/gpu/drm/i915/gem/i915_gem_shrinker.c:102: warning: Function parameter or member 'ww' not described in 'i915_gem_shrink' Fixes: cf41a8f1dc1e ("drm/i915: Finally remove obj->mm.lock.") Reported-by: Stephen Rothwell

Re: [PATCH] drm/i915: Fix docbook descriptions for i915_cmd_parser

2021-04-21 Thread Maarten Lankhorst
Op 21-04-2021 om 16:32 schreef Daniel Vetter: > On Wed, Apr 21, 2021 at 2:03 PM Maarten Lankhorst > wrote: >> Fixes the following htmldocs warnings: >> drivers/gpu/drm/i915/i915_cmd_parser.c:1420: warning: Excess function >> parameter 'trampoline' descr

Re: [Intel-gfx] [PATCH 1/2] drm: Rename DP_PSR_SELECTIVE_UPDATE to better mach eDP spec

2021-04-23 Thread Maarten Lankhorst
Op 22-04-2021 om 13:00 schreef Mun, Gwan-gyeong: > The changed name looks more accurate to the edp 1.4b spec. > Looks good to me. > > Reviewed-by: Gwan-gyeong Mun > > On Wed, 2021-04-21 at 15:02 -0700, José Roberto de Souza wrote: >> DP_PSR_EN_CFG bit 5 aka "Selective Update Region Scan Line Captu

Re: [PATCH] drm/i915: Fix docbook descriptions for i915_cmd_parser

2021-04-23 Thread Maarten Lankhorst
Op 22-04-2021 om 10:18 schreef Daniel Vetter: > On Wed, Apr 21, 2021 at 04:39:10PM +0200, Maarten Lankhorst wrote: >> Op 21-04-2021 om 16:32 schreef Daniel Vetter: >>> On Wed, Apr 21, 2021 at 2:03 PM Maarten Lankhorst >>> wrote: >>>> Fixes the following

Re: [Intel-gfx] [PATCH 3/4] drm/i915: Pass ww ctx to pin_map, v2.

2021-04-29 Thread Maarten Lankhorst
Op 29-04-2021 om 15:28 schreef Matthew Auld: > On Thu, 29 Apr 2021 at 11:10, Maarten Lankhorst > wrote: >> 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 &g

Re: [Intel-gfx] [PATCH] drm/i915/userptr: Probe existence of backing struct pages upon creation

2021-08-05 Thread Maarten Lankhorst
Op 03-08-2021 om 17:57 schreef Maarten Lankhorst: > Op 2021-08-03 om 17:45 schreef Jason Ekstrand: >> On Tue, Aug 3, 2021 at 10:09 AM Daniel Vetter wrote: >>> On Wed, Jul 28, 2021 at 4:22 PM Matthew Auld >>> wrote: >>>> On Mon, 26 Jul 2021 at 17:10, Tvr

[PULL] drm-misc-next

2021-08-05 Thread Maarten Lankhorst
drm-misc-next-2021-08-05: drm-misc-next for v5.15: UAPI Changes: Cross-subsystem Changes: Core Changes: - Assorted docbook updates. - Unbreak damage selftests. - Define DRM_FORMAT_MAX_PLANES, maximum planes for a planar format. - Add gem fb vmap/vunmap helpers, use them in gud and vkms drivers.

Re: [PATCH] drm/doc/rfc: drop lmem uapi section

2021-08-11 Thread Maarten Lankhorst
> Cc: Stephen Rothwell > Fixes: 727ecd99a4c9 ("drm/doc/rfc: drop the i915_gem_lmem.h header") > Cc: Matthew Auld > Signed-off-by: Daniel Vetter > --- > Documentation/gpu/rfc/i915_gem_lmem.rst | 109 > 1 file changed, 109 deletions(-) Acked-by: M

[PATCH 2/3] drm/i915: Add pci ids for DG1

2021-08-12 Thread Maarten Lankhorst
Signed-off-by: Maarten Lankhorst --- drivers/gpu/drm/i915/i915_pci.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/i915/i915_pci.c b/drivers/gpu/drm/i915/i915_pci.c index 1bbd09ad5287..93ccdc6bbd03 100644 --- a/drivers/gpu/drm/i915/i915_pci.c +++ b/drivers/gpu/drm/i915

[PATCH 3/3] drm/i915/topic/for-CI: Disable fake LMEM implementation

2021-08-12 Thread Maarten Lankhorst
see if anything breaks. Signed-off-by: Maarten Lankhorst --- drivers/gpu/drm/i915/Kconfig.debug | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/gpu/drm/i915/Kconfig.debug b/drivers/gpu/drm/i915/Kconfig.debug index e7fd3e76f8a2..f27c0b5873f7 100644 --- a/drivers/gpu/drm/i915

[PATCH 1/3] Revert "drm/i915: allow DG1 autoprobe for CONFIG_BROKEN"

2021-08-12 Thread Maarten Lankhorst
This reverts commit fae352efb12196e7110f98bc1297ce533472764d. Inside core-for-CI, reverting to make next patch apply cleanly. --- drivers/gpu/drm/i915/i915_pci.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_pci.c b/drivers/gpu/drm/i915/i915_pci.c index 2c1cb9b6b

[PATCH 1/2] Revert "drm/i915: allow DG1 autoprobe for CONFIG_BROKEN"

2021-08-12 Thread Maarten Lankhorst
This reverts commit fae352efb12196e7110f98bc1297ce533472764d. Inside core-for-CI, reverting to make next patch apply cleanly. --- drivers/gpu/drm/i915/i915_pci.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_pci.c b/drivers/gpu/drm/i915/i915_pci.c index 2c1cb9b6b

[PATCH 2/2] drm/i915: Add pci ids and uapi for DG1

2021-08-12 Thread Maarten Lankhorst
ld be mostly ready for DG1. VK_EXT_memory_budget is not hooked up yet, but we should definitely just enable the uapi parts by default. Signed-off-by: Maarten Lankhorst References: https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11584 Cc: Jordan Justen jordan.l.jus...@intel.com Cc:

[PULL] drm-misc-next

2021-08-12 Thread Maarten Lankhorst
Last drm-misc-next for next kernel release! drm-misc-next-2021-08-12: drm-misc-next for v5.15: UAPI Changes: Cross-subsystem Changes: - Add lockdep_assert(once) helpers. Core Changes: - Add lockdep assert to drm_is_current_master_locked. - Fix typos in dma-buf documentation. - Mark drm irq midl

Re: [PATCH 2/2] drm/i915: Add pci ids and uapi for DG1

2021-08-13 Thread Maarten Lankhorst
Op 12-08-2021 om 23:10 schreef Jason Ekstrand: > On Thu, Aug 12, 2021 at 9:49 AM Daniel Vetter wrote: >> On Thu, Aug 12, 2021 at 2:44 PM Maarten Lankhorst >> wrote: >>> DG1 has support for local memory, which requires the usage of the >>> lmem placement extension

Re: [PATCH] drm/i915: Ditch the i915_gem_ww_ctx loop member

2021-08-16 Thread Maarten Lankhorst
_err variable in its place. >>> >>> While initially setting the _err variable to -EDEADLK to enter the >>> loop, we clear it before actually entering using fetch_and_zero() to >>> avoid empty loops or code not setting the _err variable running forever.

[PULL] drm-misc-fixes

2021-03-18 Thread Maarten Lankhorst
drm-misc-fixes-2021-03-18: drm-misc-fixes for v5.12-rc4: - Make ttm_bo_unpin() not wraparound on too many unpins. - Fix coccicheck warning in omap. The following changes since commit de066e116306baf3a6a62691ac63cfc0b1dabddb: drm/compat: Clear bounce structures (2021-03-11 11:11:33 +0100) are av

Re: [PULL] drm-misc-fixes

2021-03-18 Thread Maarten Lankhorst
Op 18-03-2021 om 13:31 schreef Daniel Vetter: > On Thu, Mar 18, 2021 at 12:33 PM Maarten Lankhorst > wrote: >> drm-misc-fixes-2021-03-18: >> drm-misc-fixes for v5.12-rc4: >> - Make ttm_bo_unpin() not wraparound on too many unpins. >> - Fix coccicheck warning in omap.

[PATCH v9 52/70] drm/i915/selftests: Prepare hangcheck for obj->mm.lock removal

2021-03-23 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

[PATCH v9 14/70] drm/i915: Reject UNSYNCHRONIZED for userptr, v2.

2021-03-23 Thread Maarten Lankhorst
s you will need CONFIG_I915_USERPTR. Signed-off-by: Maarten Lankhorst Acked-by: Dave Airlie Reviewed-by: Thomas Hellström Acked-by: Jason Ekstrand --- drivers/gpu/drm/i915/gem/i915_gem_userptr.c | 10 ++ 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/dr

[PATCH v9 08/70] drm/i915: Rework struct phys attachment handling

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

[PATCH v9 51/70] drm/i915/selftests: Prepare context selftest for obj->mm.lock removal

2021-03-23 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

[PATCH v9 22/70] drm/i915: Pass ww ctx to intel_pin_to_display_plane

2021-03-23 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

[PATCH v9 17/70] drm/i915: Flatten obj->mm.lock

2021-03-23 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

[PATCH v9 05/70] drm/i915: Ensure we hold the object mutex in pin correctly.

2021-03-23 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

[PATCH v9 19/70] drm/i915: Make ring submission compatible with obj->mm.lock removal, v2.

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

[PATCH v9 39/70] drm/i915: Fix ww locking in shmem_create_from_object

2021-03-23 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

[PATCH v9 12/70] drm/i915: No longer allow exporting userptr through dma-buf

2021-03-23 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/gp

[PATCH v9 69/70] drm/i915: Pass ww ctx to i915_gem_object_pin_pages

2021-03-23 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

[PATCH v9 47/70] drm/i915/selftests: Prepare mman testcases for obj->mm.lock removal.

2021-03-23 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

[PATCH v9 48/70] drm/i915/selftests: Prepare object tests for obj->mm.lock removal.

2021-03-23 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

[PATCH v9 30/70] drm/i915: Fix pread/pwrite to work with new locking rules.

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

[PATCH v9 63/70] drm/i915: Move gt_revoke() slightly

2021-03-23 Thread Maarten Lankhorst
ode still needs fixing, as taking mmap locks during reset is not allowed. Signed-off-by: Maarten Lankhorst Reviewed-by: Thomas Hellström --- drivers/gpu/drm/i915/gt/intel_reset.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/i915/gt/intel_reset.c b/driv

[PATCH v9 40/70] drm/i915: Use a single page table lock for each gtt.

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

[PATCH v9 38/70] drm/i915: Add missing ww lock in intel_dsb_prepare.

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

[PATCH v9 25/70] drm/i915: Take reservation lock around i915_vma_pin.

2021-03-23 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

[PATCH v9 49/70] drm/i915/selftests: Prepare object blit tests for obj->mm.lock removal.

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

[PATCH v9 57/70] drm/i915/selftests: Prepare i915_request tests for obj->mm.lock removal

2021-03-23 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

[PATCH v9 00/70] drm/i915: Remove obj->mm.lock!

2021-03-23 Thread Maarten Lankhorst
Small fix to timeline patch and a fix for BSW. Maarten Lankhorst (69): drm/i915: Do not share hwsp across contexts any more, v8. drm/i915: Pin timeline map after first timeline pin, v4. drm/i915: Move cmd parser pinning to execbuffer drm/i915: Add missing -EDEADLK handling to execbuf

[PATCH v9 32/70] drm/i915: Prepare for obj->mm.lock removal, v2.

2021-03-23 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

[PATCH v9 36/70] drm/i915: Lock ww in ucode objects correctly

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

[PATCH v9 34/70] drm/i915: Add ww locking around vm_access()

2021-03-23 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

[PATCH v9 27/70] drm/i915: Make __engine_unpark() compatible with ww locking.

2021-03-23 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

[PATCH v9 10/70] drm/i915: make lockdep slightly happier about execbuf.

2021-03-23 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

[PATCH v9 20/70] drm/i915: Handle ww locking in init_status_page

2021-03-23 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

[PATCH v9 33/70] drm/i915: Add igt_spinner_pin() to allow for ww locking around spinner.

2021-03-23 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

[PATCH v9 35/70] drm/i915: Increase ww locking for perf.

2021-03-23 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

[PATCH v9 06/70] drm/i915: Add gem object locking to madvise.

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

[PATCH v9 03/70] drm/i915: Move cmd parser pinning to execbuffer

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

[PATCH v9 58/70] drm/i915/selftests: Prepare memory region tests for obj->mm.lock removal

2021-03-23 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

[PATCH v9 60/70] drm/i915/selftests: Prepare gtt tests for obj->mm.lock removal

2021-03-23 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

[PATCH v9 70/70] drm/i915: Remove asynchronous vma binding

2021-03-23 Thread Maarten Lankhorst
a false positive, but go for safe and remove asynchronous vma binding entirely. Signed-off-by: Maarten Lankhorst --- drivers/gpu/drm/i915/gem/i915_gem_stolen.c | 3 - drivers/gpu/drm/i915/gt/gen6_ppgtt.c | 1 - drivers/gpu/drm/i915/gt/gen8_ppgtt.c | 1 - drivers/gpu/drm/i915/gt

[PATCH v9 28/70] drm/i915: Take obj lock around set_domain ioctl

2021-03-23 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

[PATCH v9 54/70] drm/i915/selftests: Prepare mocs tests for obj->mm.lock removal

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

[PATCH v9 09/70] drm/i915: Convert i915_gem_object_attach_phys() to ww locking, v2.

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

[PATCH v9 43/70] drm/i915/selftests: Prepare coherency tests for obj->mm.lock removal.

2021-03-23 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

[PATCH v9 37/70] drm/i915: Add ww locking to dma-buf ops, v2.

2021-03-23 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. Changes since v1: - Fix i915_gem_map_dma_buf by using pin_pages_unlocked(). Signed-off-by: Maarten Lankhorst Reviewed-by: Thomas Hellström

[PATCH v9 31/70] drm/i915: Fix workarounds selftest, part 1

2021-03-23 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

[PATCH v9 46/70] drm/i915/selftests: Prepare execbuf tests for obj->mm.lock removal.

2021-03-23 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

[PATCH v9 01/70] drm/i915: Do not share hwsp across contexts any more, v8.

2021-03-23 Thread Maarten Lankhorst
function. (tvrtko) Changes since v7: - Move hunk to where it belongs. (jekstrand) - Replace CACHELINE_BYTES with TIMELINE_SEQNO_BYTES. (jekstrand) Signed-off-by: Maarten Lankhorst Reviewed-by: Thomas Hellström #v1 Reported-by: kernel test robot --- drivers/gpu/drm/i915/gt/gen2_engine_cs.c | 2

[PATCH v9 04/70] drm/i915: Add missing -EDEADLK handling to execbuf pinning, v2.

2021-03-23 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

[PATCH v9 53/70] drm/i915/selftests: Prepare execlists and lrc selftests for obj->mm.lock removal

2021-03-23 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

[PATCH v9 64/70] drm/i915: Add missing -EDEADLK path in execbuffer ggtt pinning.

2021-03-23 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

[PATCH v9 66/70] drm/i915: Add ww parameter to get_pages() callback

2021-03-23 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

[PATCH v9 55/70] drm/i915/selftests: Prepare ring submission for obj->mm.lock removal

2021-03-23 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

[PATCH v9 41/70] drm/i915/selftests: Prepare huge_pages testcases for obj->mm.lock removal.

2021-03-23 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

[PATCH v9 68/70] drm/i915: Pass ww ctx to pin_map

2021-03-23 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

[PATCH v9 61/70] drm/i915: Finally remove obj->mm.lock.

2021-03-23 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

[PATCH v9 13/70] drm/i915: Reject more ioctls for userptr, v2.

2021-03-23 Thread Maarten Lankhorst
anges have been tested against beignet by using its own unit tests, and intel-video-compute by using piglit's opencl tests. Changes since v1: - set_domain was apparently used in iris for checking userptr validity, keep it working as intended. Signed-off-by: Maarten Lankhorst Reviewed-by: T

[PATCH v9 42/70] drm/i915/selftests: Prepare client blit for obj->mm.lock removal.

2021-03-23 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

[PATCH v9 26/70] drm/i915: Make lrc_init_wa_ctx compatible with ww locking, v3.

2021-03-23 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

[PATCH v9 65/70] drm/i915: Fix pin_map in scheduler selftests

2021-03-23 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

[PATCH v9 23/70] drm/i915: Add object locking to vm_fault_cpu

2021-03-23 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

[PATCH v9 50/70] drm/i915/selftests: Prepare igt_gem_utils for obj->mm.lock removal

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

[PATCH v9 62/70] drm/i915: Keep userpointer bindings if seqcount is unchanged, v2.

2021-03-23 Thread Maarten Lankhorst
Reported-by: Dan Carpenter Reviewed-by: Thomas Hellström Signed-off-by: Maarten Lankhorst --- drivers/gpu/drm/i915/gem/i915_gem_userptr.c | 27 ++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/i915/gem/i915_gem_userptr.c b/drivers/gpu/drm

[PATCH v9 07/70] drm/i915: Move HAS_STRUCT_PAGE to obj->flags

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

[PATCH v9 18/70] drm/i915: Populate logical context during first pin.

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

[PATCH v9 59/70] drm/i915/selftests: Prepare cs engine tests for obj->mm.lock removal

2021-03-23 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

[PATCH v9 67/70] drm/i915: Add ww context to prepare_(read/write)

2021-03-23 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

[PATCH v9 29/70] drm/i915: Defer pin calls in buffer pool until first use by caller.

2021-03-23 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

[PATCH v9 56/70] drm/i915/selftests: Prepare timeline tests for obj->mm.lock removal

2021-03-23 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

[PATCH v9 11/70] drm/i915: Disable userptr pread/pwrite support.

2021-03-23 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

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

2021-03-23 Thread Maarten Lankhorst
is checked in set_domain through a special path. Signed-off-by: Maarten Lankhorst Acked-by: Dave Airlie --- drivers/gpu/drm/i915/gem/i915_gem_domain.c| 18 +- .../gpu/drm/i915/gem/i915_gem_execbuffer.c| 101 ++- drivers/gpu/drm/i915/gem/i915_gem_object.h| 38 +- .../gp

[PATCH v9 21/70] drm/i915: Rework clflush to work correctly without obj->mm.lock.

2021-03-23 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

[PATCH v9 44/70] drm/i915/selftests: Prepare context tests for obj->mm.lock removal.

2021-03-23 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

[PATCH v9 02/70] drm/i915: Pin timeline map after first timeline pin, v4.

2021-03-23 Thread Maarten Lankhorst
since v2: - Clear entire cacheline when pinning. Changes since v3: - CACHELINE_BYTES -> TIMELINE_SEQNO_BYTES. (jekstrand) Signed-off-by: Maarten Lankhorst Reported-by: kernel test robot Reviewed-by: Thomas Hellström --- drivers/gpu/drm/i915/gt/intel_timeline.c| 40 ++ drivers

[PATCH v9 45/70] drm/i915/selftests: Prepare dma-buf tests for obj->mm.lock removal.

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

[PATCH v9 24/70] drm/i915: Move pinning to inside engine_wa_list_verify()

2021-03-23 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

[PATCH v9 15/70] drm/i915: Make compilation of userptr code depend on MMU_NOTIFIER.

2021-03-23 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

Re: [Intel-gfx] [PATCH v9 68/70] drm/i915: Pass ww ctx to pin_map

2021-03-24 Thread Maarten Lankhorst
Op 23-03-2021 om 18:30 schreef Matthew Auld: > On Tue, 23 Mar 2021 at 15:51, Maarten Lankhorst > wrote: >> 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 &g

  1   2   3   4   5   6   7   8   9   10   >