[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

[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

[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 ---

[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

[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 ---

[RFC PATCH 153/162] drm/i915: Implement eviction locking v2

2020-11-27 Thread Matthew Auld
From: Maarten Lankhorst Use a separate acquire context list and a separate locking function for objects that are locked for eviction. These objects are then properly referenced while on the list and can be unlocked early in the ww transaction. Co-developed-by: Thomas Hellström Signed-off-by:

[RFC PATCH 154/162] drm/i915: Support ww eviction

2020-11-27 Thread Matthew Auld
From: Thomas Hellström Use sleeping ww locks if we're in a ww transaction. Trylock otherwise. We unlock the evicted objects either when eviction failed or when we've reached the target. The ww ticket locks will then ensure we will eventually succeed reaching the target if there is evictable

[RFC PATCH 157/162] drm/i915: Improve accuracy of eviction stats

2020-11-27 Thread Matthew Auld
From: Tvrtko Ursulin Current code uses jiffie time to do the accounting and then does: diff = jiffies - start; msec = diff * 1000 / HZ; ... atomic_long_add(msec, >time_swap_out_ms); If we assume jiffie can be as non-granular as 10ms and that the current accounting records all evictions

[RFC PATCH 156/162] drm/i915: Use a ww transaction in i915_gem_object_pin_map_unlocked()

2020-11-27 Thread Matthew Auld
From: Thomas Hellström By using a ww transaction, anybody using this function and ending up evicting objects can use sleeping waits when locking objects to evict. Signed-off-by: Thomas Hellström Cc: Matthew Auld --- drivers/gpu/drm/i915/gem/i915_gem_pages.c | 17 ++--- 1 file

[RFC PATCH 155/162] drm/i915: Use a ww transaction in the fault handler

2020-11-27 Thread Matthew Auld
From: Thomas Hellström Prefer a ww transaction rather than a single object lock to enable sleeping lock eviction if reached by the fault handler. Signed-off-by: Thomas Hellström Cc: Matthew Auld --- drivers/gpu/drm/i915/gem/i915_gem_mman.c | 45 +--- 1 file changed, 24

[RFC PATCH 158/162] drm/i915: Support ww locks in suspend/resume

2020-11-27 Thread Matthew Auld
From: Venkata Ramana Nayana Add ww locks during suspend/resume. Signed-off-by: Venkata Ramana Nayana --- drivers/gpu/drm/i915/i915_drv.c | 33 ++--- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_drv.c

[RFC PATCH 159/162] drm/i915/dg1: Fix mapping type for default state object

2020-11-27 Thread Matthew Auld
From: Venkata Ramana Nayana Use I915_MAP_WC when default state object is allocated on LMEM. Signed-off-by: Venkata Ramana Nayana --- drivers/gpu/drm/i915/gt/shmem_utils.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/gt/shmem_utils.c

[RFC PATCH 160/162] drm/i915/dg1: Fix GPU hang due to shmemfs page drop

2020-11-27 Thread Matthew Auld
From: Venkata Ramana Nayana This is to fix a bug in upstream commit a6326a4f8ffb ("drm/i915/gt: Keep a no-frills swappable copy of the default context state") We allocate context state obj ce->state from lmem, so in __engines_record_defaults(), we call shmem_create_from_object(). Because it

[RFC PATCH 161/162] drm/i915/dg1: allow pci to auto probe

2020-11-27 Thread Matthew Auld
From: Lucas De Marchi Signed-off-by: Lucas De Marchi --- 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 c3d9b36ef651..603976b9a973 100644 --- a/drivers/gpu/drm/i915/i915_pci.c +++

[RFC PATCH 162/162] drm/i915: drop fake lmem

2020-11-27 Thread Matthew Auld
Signed-off-by: Matthew Auld --- drivers/gpu/drm/i915/i915_drv.c| 15 drivers/gpu/drm/i915/i915_params.c | 5 -- drivers/gpu/drm/i915/i915_params.h | 1 - drivers/gpu/drm/i915/intel_memory_region.c | 11 +-- drivers/gpu/drm/i915/intel_region_lmem.c | 96

[RFC PATCH 150/162] drm/i915: need consider system BO snoop for dgfx

2020-11-27 Thread Matthew Auld
From: CQ Tang When cache_level is NONE, we check HAS_LLC(i915). But additionally for DGFX, we also need to check HAS_SNOOP(i915) on system memory object to use I915_BO_CACHE_COHERENT_FOR_READ. on dg1, has_llc=0, and has_snoop=1. Otherwise, we set obj->cache_choerent=0 and have performance

[RFC PATCH 148/162] drm/i915: suspend/resume enable blitter eviction

2020-11-27 Thread Matthew Auld
From: Venkata Ramana Nayana In suspend mode use blitter eviction before disable the runtime interrupts and in resume use blitter after the gem resume happens. Signed-off-by: Venkata Ramana Nayana Cc: Prathap Kumar Valsan --- drivers/gpu/drm/i915/i915_drv.c | 36

[RFC PATCH 152/162] drm/i915: Perform execbuffer object locking as a separate step

2020-11-27 Thread Matthew Auld
From: Thomas Hellström This is important to help avoid evicting already resident buffers from the batch we're processing. Signed-off-by: Thomas Hellström Cc: Matthew Auld --- .../gpu/drm/i915/gem/i915_gem_execbuffer.c| 25 --- 1 file changed, 21 insertions(+), 4

[RFC PATCH 149/162] drm/i915: suspend/resume handling of perma-pinned objects

2020-11-27 Thread Matthew Auld
From: Venkata Ramana Nayana The objects which are perma-pinned (like guc), use memcpy to evict these objects. Since the objects are always have pinned pages, so can't use present existing swapout/swapin functions. Signed-off-by: Venkata Ramana Nayana Cc: Prathap Kumar Valsan ---

[RFC PATCH 151/162] drm/i915: move eviction to prepare hook

2020-11-27 Thread Matthew Auld
From: Lucas De Marchi Signed-off-by: Lucas De Marchi --- drivers/gpu/drm/i915/i915_drv.c | 40 ++--- 1 file changed, 27 insertions(+), 13 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c index c8af68227020..b7d40a9c00bf

[PATCH] drm/omap: sdi: fix bridge enable/disable

2020-11-27 Thread Tomi Valkeinen
When the SDI output was converted to DRM bridge, the atomic versions of enable and disable funcs were used. This was not intended, as that would require implementing other atomic funcs too. This leads to: WARNING: CPU: 0 PID: 18 at drivers/gpu/drm/drm_bridge.c:708

[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:

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

[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 +++-

[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

[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.

[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

[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.

[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

[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.

[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

[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.

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

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

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

[RFC PATCH 064/162] drm/i915/selftests: Prepare ring submission for obj->mm.lock removal

2020-11-27 Thread Matthew Auld
From: Maarten Lankhorst Use unlocked versions when the ww lock is not held. Signed-off-by: Maarten Lankhorst Cc: Thomas Hellström --- drivers/gpu/drm/i915/gt/selftest_ring_submission.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git

[RFC PATCH 070/162] drm/i915: Finally remove obj->mm.lock.

2020-11-27 Thread Matthew Auld
From: Maarten Lankhorst With all callers and selftests fixed to use ww locking, we can now finally remove this lock. Signed-off-by: Maarten Lankhorst Cc: Thomas Hellström --- drivers/gpu/drm/i915/gem/i915_gem_object.c| 2 - drivers/gpu/drm/i915/gem/i915_gem_object.h| 7 ++--

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

2020-11-27 Thread Matthew Auld
From: Maarten Lankhorst Same as other tests, use pin_map_unlocked. Signed-off-by: Maarten Lankhorst Cc: 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

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

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

[RFC PATCH 073/162] drm/i915: Reference contending lock objects

2020-11-27 Thread Matthew Auld
From: Thomas Hellström When we lock objects in leaf functions, for example during eviction, they may disappear as soon as we unreference them, and the locking context contended pointer then points to a free object. Fix this by taking a reference on that object, and also unlock the contending

[RFC PATCH 074/162] drm/i915: Break out dma_resv ww locking utilities to separate files

2020-11-27 Thread Matthew Auld
From: Thomas Hellström As we're about to add more ww-related functionality, break out the dma_resv ww locking utilities to their own files Signed-off-by: Thomas Hellström Cc: Matthew Auld --- drivers/gpu/drm/i915/Makefile | 1 + drivers/gpu/drm/i915/gem/i915_gem_object.h | 1

[RFC PATCH 086/162] drm/i915: Add blit functions that can be called from within a WW transaction

2020-11-27 Thread Matthew Auld
From: Thomas Hellström We want to be able to blit from within a ww transaction, so add blit functions that are able to do that. Also take care to unlock the blit batch-buffer after use so it isn't recycled locked. Signed-off-by: Thomas Hellström Cc: Matthew Auld ---

[RFC PATCH 085/162] drm/i915/region: support basic eviction

2020-11-27 Thread Matthew Auld
Support basic eviction for regions. Signed-off-by: Matthew Auld Cc: Joonas Lahtinen Cc: Abdiel Janulgue --- .../gpu/drm/i915/gem/i915_gem_object_types.h | 1 + drivers/gpu/drm/i915/gem/i915_gem_shrinker.c | 59 ++ drivers/gpu/drm/i915/gem/i915_gem_shrinker.h | 4 +

[RFC PATCH 081/162] HAX drm/i915/lmem: support CPU relocations

2020-11-27 Thread Matthew Auld
** DO NOT MERGE. RELOCATION SUPPORT WILL BE DROPPED FROM DG1+ ** Add LMEM support for the CPU reloc path. When doing relocations we have both a GPU and CPU reloc path, as well as some debugging options to force a particular path. The GPU reloc path is preferred when the object is not currently

[RFC PATCH 084/162] drm/i915: introduce kernel blitter_context

2020-11-27 Thread Matthew Auld
We may be without a context to perform various internal blitter operations, for example when performing object migration. Piggybacking off the kernel_context is probably a bad idea, since it has other uses. Signed-off-by: Matthew Auld Cc: Joonas Lahtinen Cc: Abdiel Janulgue ---

[RFC PATCH 083/162] drm/i915: Update the helper to set correct mapping

2020-11-27 Thread Matthew Auld
From: Venkata Sandeep Dhanalakota Determine the possible coherent map type based on object location, and if target has llc or if user requires an always coherent mapping. Cc: Matthew Auld Cc: CQ Tang Suggested-by: Michal Wajdeczko Signed-off-by: Venkata Sandeep Dhanalakota Cc: Matthew Auld

[RFC PATCH 079/162] drm/i915/dmabuf: Disallow LMEM objects from dma-buf

2020-11-27 Thread Matthew Auld
From: "Michael J. Ruhl" The dma-buf interface for i915 does not currently support LMEM backed objects. Check imported objects to see if they are from i915 and if they are LMEM. If they are, reject the import. This check is needed in two places, once on import, and then a recheck in the

[RFC PATCH 082/162] HAX drm/i915/lmem: support pread and pwrite

2020-11-27 Thread Matthew Auld
** DO NOT MERGE. PREAD/WRITE SUPPORT WILL BE DROPPED FROM DG1+ ** We need to add support for pread'ing and pwriting an LMEM object. Cc: Joonas Lahtinen Cc: Abdiel Janulgue Signed-off-by: Matthew Auld Signed-off-by: Steve Hampson Signed-off-by: Thomas Hellström ---

[RFC PATCH 072/162] drm/i915: Avoid some false positives in assert_object_held()

2020-11-27 Thread Matthew Auld
From: Thomas Hellström In a ww transaction where we've already locked a reservation object, assert_object_held() might not throw a splat even if the object is unlocked. Improve on that situation by asserting that the reservation object's ww mutex is indeed locked. Signed-off-by: Thomas

[RFC PATCH 076/162] drm/i915: Untangle the vma pages_mutex

2020-11-27 Thread Matthew Auld
From: Thomas Hellström Move the vma pages_mutex out of the way from the object ww locks. Signed-off-by: Thomas Hellström Cc: Matthew Auld --- drivers/gpu/drm/i915/i915_vma.c | 30 -- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git

[RFC PATCH 080/162] drm/i915/lmem: Fail driver init if LMEM training failed

2020-11-27 Thread Matthew Auld
From: Matt Roper Boot firmware performs memory training and health assessment during startup. If the memory training fails, the firmware will consider the GPU unusable and will instruct the punit to keep the GT powered down. If this happens, our driver will be unable to communicate with the GT

[RFC PATCH 077/162] drm/i915/fbdev: Use lmem physical addresses for fb_mmap() on discrete

2020-11-27 Thread Matthew Auld
From: Mohammed Khajapasha use local memory io BAR address for fbdev's fb_mmap() operation on discrete, fbdev uses the physical address of our framebuffer for its fb_mmap() fn. Signed-off-by: Mohammed Khajapasha Cc: Ramalingam C --- drivers/gpu/drm/i915/display/intel_fbdev.c | 27

[RFC PATCH 071/162] drm/i915: Keep userpointer bindings if seqcount is unchanged, v2.

2020-11-27 Thread Matthew Auld
From: Maarten Lankhorst Instead of force unbinding and rebinding every time, we try to check if our notifier seqcount is still correct when pages are bound. This way we only rebind userptr when we need to, and prevent stalls. Reported-by: kernel test robot Reported-by: Dan Carpenter

[RFC PATCH 075/162] drm/i915: Introduce a for_i915_gem_ww(){}

2020-11-27 Thread Matthew Auld
From: Thomas Hellström Introduce a for_i915_gem_ww(){} utility to help make the code around a ww transaction more readable. Signed-off-by: Thomas Hellström Cc: Matthew Auld --- drivers/gpu/drm/i915/i915_gem_ww.h | 31 +- 1 file changed, 30 insertions(+), 1

[RFC PATCH 078/162] drm/i915: Return error value when bo not in LMEM for discrete

2020-11-27 Thread Matthew Auld
From: Mohammed Khajapasha Return EREMOTE value when frame buffer object is not backed by LMEM for discrete. If Local memory is supported by hardware the framebuffer backing gem objects should be from local memory. Signed-off-by: Mohammed Khajapasha Cc: Michael J. Ruhl Cc: Animesh Manna ---

Re: [PATCH v2] soc / drm: mediatek: cmdq: Remove timeout handler in helper function

2020-11-27 Thread Matthias Brugger
Hi Chun-Kuang, On 20/11/2020 00:46, Chun-Kuang Hu wrote: Hi, Matthias: I've provided the example for why of this patch. How do you think about this patch? Patch looks good to me. If you want to take it through your tree you can add my Acked-by: Matthias Brugger Beware that you might need

[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 ---

[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

[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

[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

[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 ---

[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

[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:

[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 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

[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 ---

[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

[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

[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

[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

[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

[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:

[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

[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

[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.

[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 ---

[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()

Re: [REGRESSION] omapdrm/N900 display broken

2020-11-27 Thread Tomi Valkeinen
On 25/11/2020 11:07, Daniel Vetter wrote: >> Laurent, does this ring any bells? The WARN comes in >> drm_atomic_bridge_chain_enable() when >> drm_atomic_get_old_bridge_state() returns null for (presumably) sdi bridge. >> >> I'm not sure why the bridge state would not be there. > > Lack of state

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. > >

[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

[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

[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 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

[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

[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

[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

[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

[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

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

2020-11-27 Thread Matthew Auld
From: Maarten Lankhorst Use the unlocked variants for pin_map and pin_pages, and add lock around unpinning/putting pages. Signed-off-by: Maarten Lankhorst Cc: Thomas Hellström --- .../drm/i915/selftests/intel_memory_region.c | 18 +++--- 1 file changed, 11 insertions(+), 7

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

2020-11-27 Thread Matthew Auld
From: Maarten Lankhorst Use pin_map_unlocked when we're not holding locks. Signed-off-by: Maarten Lankhorst Cc: 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

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

2020-11-27 Thread Matthew Auld
From: 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 Cc: Thomas Hellström --- drivers/gpu/drm/i915/gt/selftest_timeline.c | 28 ++--- 1 file changed, 24

[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 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

[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

[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 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

[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

  1   2   3   4   >