[PULL] drm-misc-next

2020-11-27 Thread Thomas Zimmermann
Hi Dave and Daniel, here's this week's PR for drm-misc-next. Many fixes and updates. The most important change is probably the amdgpu fix that unbreaks TTM multihop. Best regards Thomas drm-misc-next-2020-11-27-1: drm-misc-next for 5.11: UAPI Changes: Cross-subsystem Changes: * char/agp: Dis

Re: [PATCH] drm/radeon: fix check order in radeon_bo_move

2020-11-27 Thread Dave Airlie
Oops sorry for delay LGTM Reviewed-by: Dave Airlie On Fri, 27 Nov 2020 at 02:34, Daniel Vetter wrote: > > On Wed, Nov 25, 2020 at 3:34 PM Christian König > wrote: > > > > Reorder the code to fix checking if blitting is available. > > Might be good to explain why blitting might not be available

Re: [PATCH 1/2] ALSA: ppc: drop if block with always false condition

2020-11-27 Thread Geert Uytterhoeven
Hi Uwe, On Thu, Nov 26, 2020 at 6:03 PM Uwe Kleine-König wrote: > The remove callback is only called for devices that were probed > successfully before. As the matching probe function cannot complete > without error if dev->match_id != PS3_MATCH_ID_SOUND, we don't have to > check this here. > > S

[git pull] drm fixes for 5.10-rc6

2020-11-27 Thread Dave Airlie
Hi Linus, Bit of a delay as fd.o anongit was acting up a bit today, hopefully it stays up this time. Unfortunately this has a bit of thanksgiving stuffing in it, as it a bit larger (at least the vc4 patches) than I like at this point in time. The main thing is it has a bunch of regressions fixes

Re: [PATCH 2/2] powerpc/ps3: make system bus's remove and shutdown callbacks return void

2020-11-27 Thread Geert Uytterhoeven
Hi Uwe, On Thu, Nov 26, 2020 at 6:03 PM Uwe Kleine-König wrote: > The driver core ignores the return value of struct device_driver::remove > because there is only little that can be done. For the shutdown callback > it's ps3_system_bus_shutdown() which ignores the return value. > > To simplify th

Re: [PATCH v2] fbdev: aty: SPARC64 requires FB_ATY_CT

2020-11-27 Thread Geert Uytterhoeven
On Fri, Nov 27, 2020 at 4:18 AM Randy Dunlap wrote: > It looks like SPARC64 requires FB_ATY_CT to build without errors, > so have FB_ATY select FB_ATY_CT if both SPARC64 and PCI are enabled > instead of using "default y if SPARC64 && PCI", which is not strong > enough to prevent build errors. > >

Re: [PATCH 1/2] ALSA: ppc: drop if block with always false condition

2020-11-27 Thread Uwe Kleine-König
On Fri, Nov 27, 2020 at 09:35:39AM +0100, Geert Uytterhoeven wrote: > Hi Uwe, > > On Thu, Nov 26, 2020 at 6:03 PM Uwe Kleine-König > wrote: > > The remove callback is only called for devices that were probed > > successfully before. As the matching probe function cannot complete > > without error

Re: [PATCH] drm/panfrost: fix reference leak in panfrost_job_hw_submit

2020-11-27 Thread Steven Price
On 27/11/2020 09:44, Qinglang Miao wrote: pm_runtime_get_sync will increment pm usage counter even it failed. Forgetting to putting operation will result in a reference leak here. A new function pm_runtime_resume_and_get is introduced in [0] to keep usage counter balanced. So We fix the referenc

[PATCH] drm: rcar-du: fix reference leak in rcar_cmm_enable

2020-11-27 Thread Qinglang Miao
pm_runtime_get_sync will increment pm usage counter even it failed. Forgetting to putting operation will result in a reference leak here. A new function pm_runtime_resume_and_get is introduced in [0] to keep usage counter balanced. So We fix the reference leak by replacing it with new funtion. [0

[PATCH drm/hisilicon 0/3] Add the new api to install irq

2020-11-27 Thread Tian Tao
patch #1 is code refactorings to use devm_drm_dev_alloc and devm_drm_irq_install. patch #2 add the new api to install irq, patch #3 is hibmc driver uses the newly added api to register interrupts. Tian Tao (3): drm/hisilicon: Code refactoring for hibmc_drm_drv drm/irq: Add the new api to insta

Re: [PATCH 000/141] Fix fall-through warnings for Clang

2020-11-27 Thread Miguel Ojeda
On Wed, Nov 25, 2020 at 11:44 PM Edward Cree wrote: > > To make the intent clear, you have to first be certain that you > understand the intent; otherwise by adding either a break or a > fallthrough to suppress the warning you are just destroying the > information that "the intent of this code

Re: [PATCH 000/141] Fix fall-through warnings for Clang

2020-11-27 Thread Miguel Ojeda
On Thu, Nov 26, 2020 at 4:28 PM Geert Uytterhoeven wrote: > > The maintainer is not necessarily the owner/author of the code, and > thus may not know the intent of the code. Agreed, I was not blaming maintainers -- just trying to point out that the problem is there :-) In those cases, it is stil

[PATCH] drm: bridge: cdns-mhdp8546: fix reference leak in cdns_mhdp_probe

2020-11-27 Thread Qinglang Miao
pm_runtime_get_sync will increment pm usage counter even it failed. Forgetting to putting operation will result in a reference leak here. A new function pm_runtime_resume_and_get is introduced in [0] to keep usage counter balanced. So We fix the reference leak by replacing it with new funtion. [0

[PATCH drm/hisilicon 2/3] drm/irq: Add the new api to install irq

2020-11-27 Thread Tian Tao
Add new api devm_drm_irq_install() to register interrupts, no need to call drm_irq_uninstall() when the drm module is removed. Signed-off-by: Tian Tao --- drivers/gpu/drm/drm_irq.c | 34 ++ include/drm/drm_irq.h | 2 +- 2 files changed, 35 insertions(+), 1 de

Re: [REGRESSION] omapdrm/N900 display broken

2020-11-27 Thread Ivaylo Dimitrov
Hi Tomi, On 26.11.20 г. 16:11 ч., Tomi Valkeinen wrote: Hi Aaro, Ivaylo, On 24/11/2020 23:03, Ivaylo Dimitrov wrote: Is there any progress on the issue? I tried 5.9.1 and still nothing displayed. Can you test the attached patch? With this patch I don't see oops that Aaro reported, so: T

[PATCH 2/2] drm/bridge/lontium-lt9611uxc: move HPD notification out of IRQ handler

2020-11-27 Thread Dmitry Baryshkov
drm hotplug handling code (drm_client_dev_hotplug()) can wait on mutex, thus delaying further lt9611uxc IRQ events processing. It was observed occasionally during bootups, when drm_client_modeset_probe() was waiting for EDID ready event, which was delayed because IRQ handler was stuck trying to de

[PATCH] drm/dev: Fix NULL pointer dereference in drm_minor_alloc

2020-11-27 Thread Qinglang Miao
KASAN: null-ptr-deref in range [0x0030-0x0037] CPU: 0 PID: 18491 Comm: syz-executor.0 Tainted: G C 5.10.0-rc4+ #1 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.13.0-1ubuntu1 04/01/2014 RIP: 0010:kobject_put+0x2f/0x140 Call Trace: put_device+0x20/0x40 drm_min

[PATCH v2] fbdev: aty: SPARC64 requires FB_ATY_CT

2020-11-27 Thread Randy Dunlap
It looks like SPARC64 requires FB_ATY_CT to build without errors, so have FB_ATY select FB_ATY_CT if both SPARC64 and PCI are enabled instead of using "default y if SPARC64 && PCI", which is not strong enough to prevent build errors. As it currently is, FB_ATY_CT can be disabled, resulting in buil

[PATCH] drm/vboxvideo: Used the vram helper

2020-11-27 Thread Tian Tao
if the driver uses drmm_vram_helper_init, there is no need to call drm_vram_helper_release_mm when the drm module get unloaded, as this will done automagically. Signed-off-by: Tian Tao --- drivers/gpu/drm/vboxvideo/vbox_ttm.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git

[PATCH] drm/bridge: cdns: fix reference leak in cdns_dsi_transfer

2020-11-27 Thread Qinglang Miao
pm_runtime_get_sync will increment pm usage counter even it failed. Forgetting to putting operation will result in a reference leak here. A new function pm_runtime_resume_and_get is introduced in [0] to keep usage counter balanced. So We fix the reference leak by replacing it with new funtion. [0

[PATCH] drm: bridge: dw-hdmi: Remove redundant null check before clk_disable_unprepare

2020-11-27 Thread Xu Wang
Because clk_disable_unprepare() already checked NULL clock parameter, so the additional check is unnecessary, just remove them. Signed-off-by: Xu Wang --- drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/bridge/sy

[PATCH v2] drm/msm: Fix use-after-free in msm_gem with carveout

2020-11-27 Thread Iskren Chernev
When using gem with vram carveout the page allocation is managed via drm_mm. The necessary drm_mm_node is allocated in add_vma, but it is referenced in msm_gem_object as well. It is freed before the drm_mm_node has been deallocated leading to use-after-free on every single vram allocation. Current

Re: [PATCH] ARM: locomo: make locomo bus's remove callback return void

2020-11-27 Thread Dmitry Torokhov
On Thu, Nov 26, 2020 at 12:01:40PM +0100, Uwe Kleine-König wrote: > The driver core ignores the return value of struct bus_type::remove > because there is only little that can be done. To simplify the quest to > make this function return void, let struct locomo_driver::remove return > void, too. Al

[PATCH drm/hisilicon 1/3] drm/hisilicon: Code refactoring for hibmc_drm_drv

2020-11-27 Thread Tian Tao
Use the devm_drm_dev_alloc provided by the drm framework to alloc a struct hibmc_drm_private. Signed-off-by: Tian Tao --- drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_de.c | 2 +- drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c | 51 +++- drivers/gpu/drm/hisilicon/hibmc/hibm

[PULL] drm-misc-fixes

2020-11-27 Thread Maxime Ripard
Hi Dave, Daniel, Here's this week round of fixes for drm-misc Maxime drm-misc-fixes-2020-11-26: A bunch of fixes for vc4 fixing some coexistence issue between wifi and HDMI, unsupported modes, and vblank timeouts, a fix for ast to reload the gamma LUT after changing the plane format and a double

[PATCH] drm: rcar-du: fix reference leak in amdgpu_debugfs_gfxoff_read

2020-11-27 Thread Qinglang Miao
pm_runtime_get_sync will increment pm usage counter even it failed. Forgetting to putting operation will result in a reference leak here. A new function pm_runtime_resume_and_get is introduced in [0] to keep usage counter balanced. So We fix the reference leak by replacing it with new funtion. [0

[PATCH] drm/armada: Remove redundant null check before clk_disable_unprepare

2020-11-27 Thread Xu Wang
Because clk_disable_unprepare() already checked NULL clock parameter, so the additional check is unnecessary, just remove it. Signed-off-by: Xu Wang --- drivers/gpu/drm/armada/armada_510.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/armada/armada_510

[PATCH 1/2] drm/bridge/lontium-lt9611uxc: fix waiting for EDID to become available

2020-11-27 Thread Dmitry Baryshkov
- Call wake_up() when EDID ready event is received to wake wait_event_interruptible_timeout() - Increase waiting timeout, reading EDID can take longer than 100ms, so let's be on a safe side. - Return NULL pointer from get_edid() callback rather than ERR_PTR() pointer, as DRM code does NULL

[PATCH] drm/lima: fix reference leak in lima_pm_busy

2020-11-27 Thread Qinglang Miao
pm_runtime_get_sync will increment pm usage counter even it failed. Forgetting to putting operation will result in a reference leak here. A new function pm_runtime_resume_and_get is introduced in [0] to keep usage counter balanced. So We fix the reference leak by replacing it with new funtion. [0

[PATCH drm/hisilicon 3/3] drm/hisilicon: Use the new api devm_drm_irq_install

2020-11-27 Thread Tian Tao
Use devm_drm_irq_install to register interrupts so that drm_irq_uninstall is not called when hibmc is removed. Signed-off-by: Tian Tao --- drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/gpu/drm/hisilicon/hibmc/hibmc

[PATCH] drm/mediatek: fix reference leak in mtk_crtc_ddp_hw_init

2020-11-27 Thread Qinglang Miao
pm_runtime_get_sync will increment pm usage counter even it failed. Forgetting to putting operation will result in a reference leak here. A new function pm_runtime_resume_and_get is introduced in [0] to keep usage counter balanced. So We fix the reference leak by replacing it with new funtion. [0

[PATCH] drm/msm: Fix use-after-free in msm_gem with carveout

2020-11-27 Thread Iskren Chernev
When using gem with vram carveout the page allocation is managed via drm_mm. The necessary drm_mm_node is allocated in add_vma, but it freed before the drm_mm_node has been deallocated leading to use-after-free on every single vram allocation. Currently put_iova is called before free_object.

[PATCH] drm: bridge: adv7511: Remove redundant null check before clk_disable_unprepare

2020-11-27 Thread Xu Wang
Because clk_disable_unprepare() already checked NULL clock parameter, so the additional check is unnecessary, just remove them. Signed-off-by: Xu Wang --- drivers/gpu/drm/bridge/adv7511/adv7511_drv.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/bridge

[PATCH] drm/panfrost: fix reference leak in panfrost_job_hw_submit

2020-11-27 Thread Qinglang Miao
pm_runtime_get_sync will increment pm usage counter even it failed. Forgetting to putting operation will result in a reference leak here. A new function pm_runtime_resume_and_get is introduced in [0] to keep usage counter balanced. So We fix the reference leak by replacing it with new funtion. [0

Re: [PATCH] fbdev: aty: SPARC64 requires FB_ATY_CT

2020-11-27 Thread Randy Dunlap
On 11/26/20 12:29 AM, Geert Uytterhoeven wrote: > Hi Randy, > > On Thu, Nov 26, 2020 at 1:40 AM Randy Dunlap wrote: >> It looks like SPARC64 requires FB_ATY_CT to build without errors, >> so adjust the Kconfig entry of FB_ATY_CT so that it is always 'y' >> for SPARC64 && PCI by disabling the prom

[PATCH] drm/komeda: Remove useless variable assignment

2020-11-27 Thread carsten . haitzler
From: Carsten Haitzler ret is not actually read after this (only written in one case then returned), so this assign line is useless. This removes that assignment. Signed-off-by: Carsten Haitzler --- drivers/gpu/drm/arm/display/komeda/komeda_dev.c | 1 - 1 file changed, 1 deletion(-) diff --gi

[PATCH] drm/komeda: Handle NULL pointer access code path in error case

2020-11-27 Thread carsten . haitzler
From: Carsten Haitzler komeda_component_get_old_state() technically can return a NULL pointer. komeda_compiz_set_input() even warns when this happens, but then proceeeds to use that NULL pointer tocompare memory content there agains the new sate to see if it changed. In this case, it's better to

[RFC PATCH 001/162] drm/i915/selftest: also consider non-contiguous objects

2020-11-27 Thread Matthew Auld
In igt_ppgtt_sanity_check we should also exercise the non-contiguous option for LMEM, since this will give us slightly different sg layouts and alignment. Signed-off-by: Matthew Auld --- drivers/gpu/drm/i915/gem/selftests/huge_pages.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/g

[RFC PATCH 000/162] DG1 + LMEM enabling

2020-11-27 Thread Matthew Auld
This series includes a version of Maarten' series[1], which converts more of the driver locking over to dma-resv. On top of this we now implement things like LMEM eviction, which has a dependency on this new locking design. In terms of new uAPI we have gem_create_ext, which offers extensions suppo

[RFC PATCH 002/162] drm/i915/selftest: assert we get 2M GTT pages

2020-11-27 Thread Matthew Auld
For the LMEM case if we have suitable alignment and 2M physical pages we should always get 2M GTT pages within the constraints of the hugepages selftest. If we don't then something might be wrong in our construction of the backing pages. Signed-off-by: Matthew Auld --- .../gpu/drm/i915/gem/selft

[RFC PATCH 003/162] drm/i915/selftest: handle local-memory in perf_memcpy

2020-11-27 Thread Matthew Auld
We currently only support WC when mapping device local-memory, which is returned as a generic -ENOMEM when mapping the object with an unsupported type. Try to handle that case also, although it's starting to get pretty ugly in there. Signed-off-by: Matthew Auld --- drivers/gpu/drm/i915/selftests

[RFC PATCH 005/162] drm/i915/gt: Rename lrc.c to execlists_submission.c

2020-11-27 Thread Matthew Auld
From: Chris Wilson We want to separate the utility functions for controlling the logical ring context from the execlists submission mechanism (which is an overgrown scheduler). This is similar to Daniele's work to split up the files, but being selfish I wanted to base it after my own changes to

[RFC PATCH 004/162] drm/i915/gt: Move move context layout registers and offsets to lrc_reg.h

2020-11-27 Thread Matthew Auld
From: Chris Wilson Cleanup intel_lrc.h by moving some of the residual common register definitions into intel_lrc_reg.h, prior to rebranding and splitting off the submission backends. v2: keep the SCHEDULE enum in the old file, since it is specific to the gvt usage of the execlists submission bac

[RFC PATCH 009/162] drm/i915: Introduce drm_i915_lock_isolated

2020-11-27 Thread Matthew Auld
From: Thomas Hellström When an object is just created and not yet put on any lists, there's a single owner and thus trylock will always succeed. Introduce drm_i915_lock_isolated to annotate trylock in this situation. This is similar to TTM's create_locked() functionality. Signed-off-by: Thomas H

[RFC PATCH 011/162] drm/i915: Pin timeline map after first timeline pin, v5.

2020-11-27 Thread Matthew Auld
From: 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(). Signed-off-by: Maarten Lankhorst Reported-by: kernel te

[RFC PATCH 007/162] drm/i915: split wa_bb code to its own file

2020-11-27 Thread Matthew Auld
From: Daniele Ceraolo Spurio Continuing the split of back-end independent code from the execlist submission specific file. Based on a patch by Chris Wilson. Signed-off-by: Daniele Ceraolo Spurio Cc: Chris P Wilson Cc: Tvrtko Ursulin Reviewed-by: John Harrison --- drivers/gpu/drm/i915/Makef

[RFC PATCH 017/162] drm/i915: Rework struct phys attachment handling

2020-11-27 Thread Matthew Auld
From: 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 Cc: Thomas Hellströ

[RFC PATCH 015/162] drm/i915: Add gem object locking to madvise.

2020-11-27 Thread Matthew Auld
From: Maarten Lankhorst Doesn't need the full ww lock, only checking if pages are bound. Signed-off-by: Maarten Lankhorst Cc: Thomas Hellström --- 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/drive

[RFC PATCH 010/162] drm/i915: Lock hwsp objects isolated for pinning at create time

2020-11-27 Thread Matthew Auld
From: Thomas Hellström We may need to create hwsp objects at request treate time in the middle of a ww transaction. Since we typically don't have easy access to the ww_acquire_context, lock the hwsp objects isolated for pinning/mapping only at create time. For later binding to the ggtt, make sure

[RFC PATCH 008/162] HAX drm/i915: Work around the selftest timeline lock splat workaround

2020-11-27 Thread Matthew Auld
From: Thomas Hellström There is a dirty hack to work around a lockdep splat because incorrect ordering of selftest timeline lock against other locks. However, some selftests recently started to use the same nesting level as the workaround and thus introduced more splats. Add a workaround to the w

[RFC PATCH 016/162] drm/i915: Move HAS_STRUCT_PAGE to obj->flags

2020-11-27 Thread Matthew Auld
From: 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 Lan

[RFC PATCH 013/162] drm/i915: Add missing -EDEADLK handling to execbuf pinning, v2.

2020-11-27 Thread Matthew Auld
From: Maarten Lankhorst i915_vma_pin may fail with -EDEADLK when we start locking page tables, so ensure we handle this correctly. Cc: Matthew Brost Signed-off-by: Maarten Lankhorst Cc: Thomas Hellström --- .../gpu/drm/i915/gem/i915_gem_execbuffer.c| 35 +-- 1 file change

[RFC PATCH 012/162] drm/i915: Move cmd parser pinning to execbuffer

2020-11-27 Thread Matthew Auld
From: 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()

[RFC PATCH 014/162] drm/i915: Ensure we hold the object mutex in pin correctly v2

2020-11-27 Thread Matthew Auld
From: 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: M

[RFC PATCH 006/162] drm/i915: split gen8+ flush and bb_start emission functions to their own file

2020-11-27 Thread Matthew Auld
From: Daniele Ceraolo Spurio These functions are independent from the backend used and can therefore be split out of the exelists submission file, so they can be re-used by the upcoming GuC submission backend. Based on a patch by Chris Wilson. Signed-off-by: Daniele Ceraolo Spurio Cc: Chris P

[RFC PATCH 018/162] drm/i915: Convert i915_gem_object_attach_phys() to ww locking, v2.

2020-11-27 Thread Matthew Auld
From: 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. Signed-off-by: Maarten Lankhorst Cc: Thoma

[RFC PATCH 020/162] drm/i915: Disable userptr pread/pwrite support.

2020-11-27 Thread Matthew Auld
From: 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(). Still needs an ack from relevant userspace that it won't break, but should be good. Signed-off-b

[RFC PATCH 019/162] drm/i915: make lockdep slightly happier about execbuf.

2020-11-27 Thread Matthew Auld
From: 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 Cc: Thomas Hellström --- .../gpu/drm/i915/ge

[RFC PATCH 022/162] drm/i915: Reject more ioctls for userptr

2020-11-27 Thread Matthew Auld
From: 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()

[RFC PATCH 025/162] drm/i915: Fix userptr so we do not have to worry about obj->mm.lock, v5.

2020-11-27 Thread Matthew Auld
From: 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_p

[RFC PATCH 028/162] drm/i915: Make ring submission compatible with obj->mm.lock removal, v2.

2020-11-27 Thread Matthew Auld
From: 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

[RFC PATCH 029/162] drm/i915: Handle ww locking in init_status_page

2020-11-27 Thread Matthew Auld
From: Maarten Lankhorst Try to pin to ggtt first, and use a full ww loop to handle eviction correctly. Signed-off-by: Maarten Lankhorst Cc: Thomas Hellström --- drivers/gpu/drm/i915/gt/intel_engine_cs.c | 37 +++ 1 file changed, 24 insertions(+), 13 deletions(-) diff --gi

[RFC PATCH 021/162] drm/i915: No longer allow exporting userptr through dma-buf

2020-11-27 Thread Matthew Auld
From: 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 Cc: Thomas Hellström --- drivers/gpu/drm/i915/gem/

[RFC PATCH 031/162] drm/i915: Pass ww ctx to intel_pin_to_display_plane

2020-11-27 Thread Matthew Auld
From: 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 Cc: Thomas Hellström --- drivers/gpu/drm/i915/display/intel_display.c | 69 --- drivers/gpu/drm/i915/display

[RFC PATCH 026/162] drm/i915: Flatten obj->mm.lock

2020-11-27 Thread Matthew Auld
From: 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 Cc: Thomas Hellström --- drivers/gpu/dr

[RFC PATCH 032/162] drm/i915: Add object locking to vm_fault_cpu

2020-11-27 Thread Matthew Auld
From: Maarten Lankhorst Take a simple lock so we hold ww around (un)pin_pages as needed. Signed-off-by: Maarten Lankhorst Cc: 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/drive

[RFC PATCH 023/162] drm/i915: Reject UNSYNCHRONIZED for userptr, v2.

2020-11-27 Thread Matthew Auld
From: 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. Signed-off-by: Maarten Lankhorst Cc: Thomas Hellström --- drivers/gpu/drm/i915/gem/i915_gem_userptr.c | 10 ++-

[RFC PATCH 036/162] drm/i915: Make __engine_unpark() compatible with ww locking v2

2020-11-27 Thread Matthew Auld
From: 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 Cc: Thomas Hellström --- drivers/gpu/drm/i91

[RFC PATCH 038/162] drm/i915: Defer pin calls in buffer pool until first use by caller.

2020-11-27 Thread Matthew Auld
From: 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 Cc: Thomas Hellström --- .../gpu/drm/i915/gem/i915_gem_execbuffer.c| 2 + .../gpu/drm/i915/gem/i915_gem_objec

[RFC PATCH 034/162] drm/i915: Take reservation lock around i915_vma_pin.

2020-11-27 Thread Matthew Auld
From: 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 Cc: Thomas Hellström --- .../i915/gem/selftests/i915_gem_coherency.c | 14 + drivers/gpu

[RFC PATCH 035/162] drm/i915: Make intel_init_workaround_bb more compatible with ww locking.

2020-11-27 Thread Matthew Auld
From: Daniele Ceraolo Spurio Make creation separate from pinning, in order to take the lock only once, and pin the mapping with the lock held. Signed-off-by: Maarten Lankhorst Cc: Thomas Hellström Signed-off-by: Daniele Ceraolo Spurio --- .../drm/i915/gt/intel_engine_workaround_bb.c | 45 ++

[RFC PATCH 024/162] drm/i915: Make compilation of userptr code depend on MMU_NOTIFIER.

2020-11-27 Thread Matthew Auld
From: 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 Cc: Thomas Hellström --- .../gpu/drm/i915/gem/i915_gem_execbuffer.c

[RFC PATCH 033/162] drm/i915: Move pinning to inside engine_wa_list_verify()

2020-11-27 Thread Matthew Auld
From: 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 Cc: Thomas Hellström --- drivers/gpu/drm/i915/gt/intel_workarounds.c | 24 -

[RFC PATCH 027/162] drm/i915: Populate logical context during first pin.

2020-11-27 Thread Matthew Auld
From: 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 Cc: Thomas Hellström --- drivers/gpu/drm/i915/gt/intel_context_types.h | 13 ++- .../drm/i915/gt/inte

[RFC PATCH 043/162] drm/i915: Add ww locking around vm_access()

2020-11-27 Thread Matthew Auld
From: 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 Cc: Thomas Hellström --- drivers/gpu/drm/i915/gem/i915_gem_mman.c | 24 ++-- 1 file changed, 22 insertions(+), 2 deletions(

[RFC PATCH 039/162] drm/i915: Fix pread/pwrite to work with new locking rules.

2020-11-27 Thread Matthew Auld
From: 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

[RFC PATCH 047/162] drm/i915: Add missing ww lock in intel_dsb_prepare.

2020-11-27 Thread Matthew Auld
From: 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 Cc: Thomas Hellström ---

[RFC PATCH 048/162] drm/i915: Fix ww locking in shmem_create_from_object

2020-11-27 Thread Matthew Auld
From: Maarten Lankhorst Quick fix, just use the unlocked version. Signed-off-by: Maarten Lankhorst Cc: 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/g

[RFC PATCH 037/162] drm/i915: Take obj lock around set_domain ioctl

2020-11-27 Thread Matthew Auld
From: Maarten Lankhorst We need to lock the object to move it to the correct domain, add the missing lock. Signed-off-by: Maarten Lankhorst Cc: Thomas Hellström --- drivers/gpu/drm/i915/gem/i915_gem_domain.c | 18 ++ 1 file changed, 10 insertions(+), 8 deletions(-) diff --git

[RFC PATCH 030/162] drm/i915: Rework clflush to work correctly without obj->mm.lock.

2020-11-27 Thread Matthew Auld
From: 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 Cc: Thomas Hellström --- drivers/gpu/drm/i915/gem/i915_gem_clflush.c | 15 +++ 1 file changed, 7 insertions(+), 8 deletions(-

[RFC PATCH 041/162] drm/i915: Prepare for obj->mm.lock removal

2020-11-27 Thread Matthew Auld
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. Idea-from: Thomas Hellström Signed-off-by: Maarten Lankhorst Signed-off-by: Thomas Hellström --- drivers/gpu/drm/i915/gem/i915_gem_object.h | 13 +++

[RFC PATCH 040/162] drm/i915: Fix workarounds selftest, part 1

2020-11-27 Thread Matthew Auld
From: Maarten Lankhorst pin_map needs the ww lock, so ensure we pin both before submission. Signed-off-by: Maarten Lankhorst Cc: 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_work

[RFC PATCH 049/162] drm/i915: Use a single page table lock for each gtt.

2020-11-27 Thread Matthew Auld
From: 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 requir

[RFC PATCH 045/162] drm/i915: Lock ww in ucode objects correctly

2020-11-27 Thread Matthew Auld
From: 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 convenien

[RFC PATCH 046/162] drm/i915: Add ww locking to dma-buf ops.

2020-11-27 Thread Matthew Auld
From: 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 Cc: Thomas Hellström --- drivers/gpu/drm/i915/gem/i915_gem_dmabuf.c | 60 +

[RFC PATCH 044/162] drm/i915: Increase ww locking for perf.

2020-11-27 Thread Matthew Auld
From: Maarten Lankhorst We need to lock a few more objects, some temporarily, add ww lock where needed. Signed-off-by: Maarten Lankhorst Cc: Thomas Hellström --- drivers/gpu/drm/i915/i915_perf.c | 56 1 file changed, 43 insertions(+), 13 deletions(-) diff --g

[RFC PATCH 042/162] drm/i915: Add igt_spinner_pin() to allow for ww locking around spinner.

2020-11-27 Thread Matthew Auld
From: 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 Cc: Thomas Hellström --- drivers/gpu/drm/i915/selftests/igt_spinner.c | 136 +++

[RFC PATCH 052/162] drm/i915/selftests: Prepare coherency tests for obj->mm.lock removal.

2020-11-27 Thread Matthew Auld
From: Maarten Lankhorst Straightforward conversion, just convert a bunch of calls to unlocked versions. Signed-off-by: Maarten Lankhorst Cc: Thomas Hellström --- drivers/gpu/drm/i915/gem/selftests/i915_gem_coherency.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dri

[RFC PATCH 050/162] drm/i915/selftests: Prepare huge_pages testcases for obj->mm.lock removal.

2020-11-27 Thread Matthew Auld
From: Maarten Lankhorst Straightforward conversion, just convert a bunch of calls to unlocked versions. Signed-off-by: Maarten Lankhorst Cc: Thomas Hellström --- .../gpu/drm/i915/gem/selftests/huge_pages.c | 28 ++- 1 file changed, 21 insertions(+), 7 deletions(-) diff --gi

[RFC PATCH 051/162] drm/i915/selftests: Prepare client blit for obj->mm.lock removal.

2020-11-27 Thread Matthew Auld
From: Maarten Lankhorst Straightforward conversion, just convert a bunch of calls to unlocked versions. Signed-off-by: Maarten Lankhorst Cc: Thomas Hellström --- drivers/gpu/drm/i915/gem/selftests/i915_gem_client_blt.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git

[RFC PATCH 053/162] drm/i915/selftests: Prepare context tests for obj->mm.lock removal.

2020-11-27 Thread Matthew Auld
From: Maarten Lankhorst Straightforward conversion, just convert a bunch of calls to unlocked versions. Signed-off-by: Maarten Lankhorst Cc: Thomas Hellström --- drivers/gpu/drm/i915/gem/selftests/i915_gem_context.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git

[RFC PATCH 055/162] drm/i915/selftests: Prepare execbuf tests for obj->mm.lock removal.

2020-11-27 Thread Matthew Auld
From: Maarten Lankhorst Also quite simple, a single call needs to use the unlocked version. Signed-off-by: Maarten Lankhorst Cc: 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/i9

[RFC PATCH 054/162] drm/i915/selftests: Prepare dma-buf tests for obj->mm.lock removal.

2020-11-27 Thread Matthew Auld
From: Maarten Lankhorst Use pin_pages_unlocked() where we don't have a lock. Signed-off-by: Maarten Lankhorst Cc: 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/i9

[RFC PATCH 056/162] drm/i915/selftests: Prepare mman testcases for obj->mm.lock removal.

2020-11-27 Thread Matthew Auld
From: 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 Cc: Thomas Hellström --- drivers/gpu/drm/i915/gem/selftests/i915_gem_mman.c | 10 ++ 1 file changed, 6 insertions(+), 4 dele

[RFC PATCH 057/162] drm/i915/selftests: Prepare object tests for obj->mm.lock removal.

2020-11-27 Thread Matthew Auld
From: Maarten Lankhorst Convert a single pin_pages call to use the unlocked version. Signed-off-by: Maarten Lankhorst Cc: 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/self

[RFC PATCH 059/162] drm/i915/selftests: Prepare igt_gem_utils for obj->mm.lock removal

2020-11-27 Thread Matthew Auld
From: 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 Cc: Thomas Hellström --- drivers/gpu/drm/i915/gem/selftests/igt_gem_utils.c | 2 +- 1 f

[RFC PATCH 060/162] drm/i915/selftests: Prepare context selftest for obj->mm.lock removal

2020-11-27 Thread Matthew Auld
From: Maarten Lankhorst Only needs to convert a single call to the unlocked version. Signed-off-by: Maarten Lankhorst Cc: 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_co

[RFC PATCH 061/162] drm/i915/selftests: Prepare hangcheck for obj->mm.lock removal

2020-11-27 Thread Matthew Auld
From: Maarten Lankhorst Convert a few calls to use the unlocked versions. Signed-off-by: Maarten Lankhorst Cc: 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_hangche

[RFC PATCH 058/162] drm/i915/selftests: Prepare object blit tests for obj->mm.lock removal.

2020-11-27 Thread Matthew Auld
From: Maarten Lankhorst Use some unlocked versions where we're not holding the ww lock. Signed-off-by: Maarten Lankhorst Cc: 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/

[RFC PATCH 062/162] drm/i915/selftests: Prepare execlists for obj->mm.lock removal

2020-11-27 Thread Matthew Auld
From: Maarten Lankhorst Convert normal functions to unlocked versions where needed. Signed-off-by: Maarten Lankhorst Cc: Thomas Hellström --- drivers/gpu/drm/i915/gt/selftest_execlists.c | 34 ++-- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/drivers/gpu/drm

  1   2   3   4   >