Re: [Nouveau] [PATCH 0/3] drm/ttm: constify static vm_operations_structs

2021-02-25 Thread Christian König
Am 23.02.21 um 18:31 schrieb Alex Deucher: On Wed, Feb 10, 2021 at 8:14 AM Daniel Vetter wrote: On Wed, Feb 10, 2021 at 08:45:56AM +0100, Christian König wrote: Reviewed-by: Christian König for the series. Smash it into -misc? @Christian Koenig did these ever land? I don't see them in drm-

[Nouveau] [PATCH v3 8/8] nouveau/svm: Implement atomic SVM access

2021-02-25 Thread Alistair Popple
Some NVIDIA GPUs do not support direct atomic access to system memory via PCIe. Instead this must be emulated by granting the GPU exclusive access to the memory. This is achieved by replacing CPU page table entries with special swap entries that fault on userspace access. The driver then grants th

[Nouveau] [PATCH v3 7/8] nouveau/svm: Refactor nouveau_range_fault

2021-02-25 Thread Alistair Popple
Call mmu_interval_notifier_insert() as part of nouveau_range_fault(). This doesn't introduce any functional change but makes it easier for a subsequent patch to alter the behaviour of nouveau_range_fault() to support GPU atomic operations. Signed-off-by: Alistair Popple --- drivers/gpu/drm/nouve

[Nouveau] [PATCH v3 6/8] mm: Selftests for exclusive device memory

2021-02-25 Thread Alistair Popple
Adds some selftests for exclusive device memory. Signed-off-by: Alistair Popple --- lib/test_hmm.c | 124 ++ lib/test_hmm_uapi.h| 2 + tools/testing/selftests/vm/hmm-tests.c | 219 + 3 files changed, 345 insertions

[Nouveau] [PATCH v3 5/8] mm: Device exclusive memory access

2021-02-25 Thread Alistair Popple
Some devices require exclusive write access to shared virtual memory (SVM) ranges to perform atomic operations on that memory. This requires CPU page tables to be updated to deny access whilst atomic operations are occurring. In order to do this introduce a new swap entry type (SWP_DEVICE_EXCLUSIV

[Nouveau] [PATCH v3 4/8] mm/rmap: Split migration into its own function

2021-02-25 Thread Alistair Popple
Migration is currently implemented as a mode of operation for try_to_unmap_one() generally specified by passing the TTU_MIGRATION flag or in the case of splitting a huge anonymous page TTU_SPLIT_FREEZE. However it does not have much in common with the rest of the unmap functionality of try_to_unma

[Nouveau] [PATCH v3 3/8] mm/rmap: Split try_to_munlock from try_to_unmap

2021-02-25 Thread Alistair Popple
The behaviour of try_to_unmap_one() is difficult to follow because it performs different operations based on a fairly large set of flags used in different combinations. TTU_MUNLOCK is one such flag. However it is exclusively used by try_to_munlock() which specifies no other flags. Therefore rather

[Nouveau] [PATCH v3 2/8] mm/swapops: Rework swap entry manipulation code

2021-02-25 Thread Alistair Popple
Both migration and device private pages use special swap entries which are manipluated by a range of inline functions. The arguments to these are somewhat inconsitent so rework them to remove flag type arguments and to make the arguments similar for both a read and write entry creation. Signed-off

[Nouveau] [PATCH v3 1/8] mm: Remove special swap entry functions

2021-02-25 Thread Alistair Popple
Remove the migration and device private entry_to_page() and entry_to_pfn() inline functions and instead open code them directly. This results in shorter code which is easier to understand. Signed-off-by: Alistair Popple --- arch/s390/mm/pgtable.c | 2 +- fs/proc/task_mmu.c | 23 +++---

[Nouveau] [PATCH v3 0/8] Add support for SVM atomics in Nouveau

2021-02-25 Thread Alistair Popple
This is the third version of a series to add support to Nouveau for atomic memory operations on OpenCL shared virtual memory (SVM) regions. This is achieved using the atomic PTE bits on the GPU to only permit atomic operations to system memory when a page is not mapped in userspace on the CPU. The

Re: [Nouveau] [Linuxarm] [PATCH v1] drm/nouveau/device: append a NUL-terminated character for the string which filled by strncpy()

2021-02-25 Thread Song Bao Hua (Barry Song)
> -Original Message- > From: Luo Jiaxing [mailto:luojiax...@huawei.com] > Sent: Friday, February 26, 2021 12:39 AM > To: nouveau@lists.freedesktop.org; dri-de...@lists.freedesktop.org; > bske...@redhat.com > Cc: linux-ker...@vger.kernel.org; linux...@openeuler.org; luojiaxing > > Subject

Re: [Nouveau] i2c-dev driver corrupts display?

2021-02-25 Thread Ilia Mirkin
That's very surprising. As I recall, i2c-dev just adds /dev nodes for various i2c devices (some of which would be exposed by nouveau, most likely just the connector one to read EDID in your case, as temp/etc sensors came later). It shouldn't cause nouveau to do anything differently -- just allows u

[Nouveau] i2c-dev driver corrupts display?

2021-02-25 Thread Roger
HARDWARE: Dell Inspiron 8100 laptop nVIDIA Geforce2 Go (NV11) with Intel AGP PROBLEM: Display corruption whenever nouveau module was loaded, seemingly at random. CULPRIT: Whenever the i2c-dev.ko driver/module was loaded, the display would become corrupted, or as if the timing became out of sync

Re: [Nouveau] [PATCH] drm/nouveau/pci: rework AGP dependency

2021-02-25 Thread Daniel Vetter
On Thu, Feb 25, 2021 at 1:59 PM Christian König wrote: > > Am 25.02.21 um 13:52 schrieb Arnd Bergmann: > > From: Arnd Bergmann > > > > I noticed a warning from 'nm' when CONFIG_TRIM_UNUSED_KSYMS is set > > and IS_REACHABLE(CONFIG_AGP) is false: > > > > drivers/gpu/drm/nouveau/nvkm/subdev/pci/agp.

[Nouveau] [PATCH v1] drm/nouveau/kms: delete an useless function call in nouveau_framebuffer_new()

2021-02-25 Thread Luo Jiaxing
nouveau_framebuffer_new() call drm_format_info_plane_width() to get a width of plane, but width is not used then, so it's a useless function call here. Signed-off-by: Luo Jiaxing --- drivers/gpu/drm/nouveau/nouveau_display.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a

[Nouveau] [PATCH] drm/nouveau/pci: rework AGP dependency

2021-02-25 Thread Arnd Bergmann
From: Arnd Bergmann I noticed a warning from 'nm' when CONFIG_TRIM_UNUSED_KSYMS is set and IS_REACHABLE(CONFIG_AGP) is false: drivers/gpu/drm/nouveau/nvkm/subdev/pci/agp.o: no symbols I later found this is completely harmless and we should find a way to suppress the warning, but at that point I

[Nouveau] [PATCH v1 1/2] drm/nouveau/kms/nv50-: Remove several set but not used variables "ret" in disp.c

2021-02-25 Thread Luo Jiaxing
Fixes the following warning when using W=1 to build kernel: drivers/gpu/drm/nouveau/dispnv50/disp.c: In function ‘nv50_mstm_cleanup’: drivers/gpu/drm/nouveau/dispnv50/disp.c:1389:6: warning: variable ‘ret’ set but not used [-Wunused-but-set-variable] 1389 | int ret; | ^~~ drivers/gpu

[Nouveau] [PATCH v1] drm/nouveau/device: append a NUL-terminated character for the string which filled by strncpy()

2021-02-25 Thread Luo Jiaxing
Following warning is found when using W=1 to build kernel: In function ‘nvkm_udevice_info’, inlined from ‘nvkm_udevice_mthd’ at drivers/gpu/drm/nouveau/nvkm/engine/device/user.c:195:10: drivers/gpu/drm/nouveau/nvkm/engine/device/user.c:164:2: warning: ‘strncpy’ specified bound 16 equals dest

[Nouveau] [PATCH v1] drm/nouveau: delete unused variables "dev" in nouveau_ttm_tt_populate()

2021-02-25 Thread Luo Jiaxing
After switch to new allocator, dev is no longer used here and should be deleted. Fixes: 461619f5c324 ("drm/nouveau: switch to new allocator") Signed-off-by: Luo Jiaxing --- drivers/gpu/drm/nouveau/nouveau_bo.c | 4 1 file changed, 4 deletions(-) diff --git a/drivers/gpu/drm/nouveau/nouvea

Re: [Nouveau] [PATCH] drm/nouveau/pci: rework AGP dependency

2021-02-25 Thread Christian König
Am 25.02.21 um 13:52 schrieb Arnd Bergmann: From: Arnd Bergmann I noticed a warning from 'nm' when CONFIG_TRIM_UNUSED_KSYMS is set and IS_REACHABLE(CONFIG_AGP) is false: drivers/gpu/drm/nouveau/nvkm/subdev/pci/agp.o: no symbols I later found this is completely harmless and we should find a wa