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

2021-03-03 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 v4 7/8] nouveau/svm: Refactor nouveau_range_fault

2021-03-03 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 v4 6/8] mm: Selftests for exclusive device memory

2021-03-03 Thread Alistair Popple
Adds some selftests for exclusive device memory. Signed-off-by: Alistair Popple Acked-by: Jason Gunthorpe Tested-by: Ralph Campbell Reviewed-by: Ralph Campbell --- lib/test_hmm.c | 124 ++ lib/test_hmm_uapi.h| 2 + tools/testing/selfte

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

2021-03-03 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 v4 4/8] mm/rmap: Split migration into its own function

2021-03-03 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 v4 3/8] mm/rmap: Split try_to_munlock from try_to_unmap

2021-03-03 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 v4 2/8] mm/swapops: Rework swap entry manipulation code

2021-03-03 Thread Alistair Popple
Both migration and device private pages use special swap entries that 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 read and write entry creation. Signed-off-by

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

2021-03-03 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 --- v4: * Added pfn_swap_entry_to_page() * Reinstated check that migration

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

2021-03-03 Thread Alistair Popple
This is the forth 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] [PATCH v3 5/8] mm: Device exclusive memory access

2021-03-03 Thread Alistair Popple
On Tuesday, 2 March 2021 11:41:52 PM AEDT Jason Gunthorpe wrote: > > However try_to_protect() scans the PTEs again under the PTL so checking the > > mapping of interest actually gets replaced during the rmap walk seems like a > > reasonable solution. Thanks for the comments. > > It does seem c

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

2021-03-03 Thread Alistair Popple
On Tuesday, 2 March 2021 3:10:49 AM AEDT Jason Gunthorpe wrote: > > + while (page_vma_mapped_walk(&pvmw)) { > > + /* > > +* If the page is mlock()d, we cannot swap it out. > > +* If it's recently referenced (perhaps page_referenced > > +

[Nouveau] Request for information and/or assistance

2021-03-03 Thread o1bigtenor
Greetings Running debian testing, 2 nvidia gpus (GP107 and GF110) and 5 monitors (1 - 3840x2160 and 2 1920x1080 on the GP107 and 2 - 1920x1080 on the GF110) using one screen (7680x3000). I would still like to modify some things but can't find any docs on how to do that and my attempts have only m

Re: [Nouveau] [PATCH 2/3] drm/nouveau/kms/nv50-: Report max cursor size to userspace

2021-03-03 Thread Lyude Paul
On Wed, 2021-03-03 at 18:02 +0100, Uwe Sauter wrote: > Am 03.03.21 um 14:33 schrieb Ilia Mirkin: > > On Wed, Mar 3, 2021 at 8:25 AM Uwe Sauter wrote: > > > > > > Am 03.03.21 um 14:12 schrieb Ilia Mirkin: > > > > On Wed, Mar 3, 2021 at 7:41 AM Alex Riesen > > > > wrote: > > > > > > > > > > Ilia

Re: [Nouveau] [PATCH 2/3] drm/nouveau/kms/nv50-: Report max cursor size to userspace

2021-03-03 Thread James Jones
On 3/3/21 8:51 AM, Lyude Paul wrote: On Wed, 2021-03-03 at 08:12 -0500, Ilia Mirkin wrote: On Wed, Mar 3, 2021 at 7:41 AM Alex Riesen wrote: Ilia Mirkin, Sat, Feb 27, 2021 22:26:57 +0100: Can you try Alex's patch to modetest and confirm that you see issues with modetest? If so, can you (and

Re: [Nouveau] [PATCH 2/3] drm/nouveau/kms/nv50-: Report max cursor size to userspace

2021-03-03 Thread Uwe Sauter
Am 03.03.21 um 14:33 schrieb Ilia Mirkin: > On Wed, Mar 3, 2021 at 8:25 AM Uwe Sauter wrote: >> >> Am 03.03.21 um 14:12 schrieb Ilia Mirkin: >>> On Wed, Mar 3, 2021 at 7:41 AM Alex Riesen >>> wrote: Ilia Mirkin, Sat, Feb 27, 2021 22:26:57 +0100: > Can you try Alex's patch to modete

Re: [Nouveau] [PATCH 17/53] drm/nouveau/dispnv50/headc57d: Make local function 'headc57d_olut' static

2021-03-03 Thread Lyude Paul
Reviewed-by: Lyude Paul Thanks! On Wed, 2021-03-03 at 13:42 +, Lee Jones wrote: > Fixes the following W=1 kernel build warning(s): > >  drivers/gpu/drm/nouveau/dispnv50/headc57d.c:173:1: warning: no previous > prototype for ‘headc57d_olut’ [-Wmissing-prototypes] > > Cc: Ben Skeggs > Cc: D

Re: [Nouveau] [PATCH 2/3] drm/nouveau/kms/nv50-: Report max cursor size to userspace

2021-03-03 Thread Lyude Paul
On Wed, 2021-03-03 at 08:12 -0500, Ilia Mirkin wrote: > On Wed, Mar 3, 2021 at 7:41 AM Alex Riesen > wrote: > > > > Ilia Mirkin, Sat, Feb 27, 2021 22:26:57 +0100: > > > Can you try Alex's patch to modetest and confirm that you see issues > > > with modetest? If so, can you (and maybe Alex as well

Re: [Nouveau] How to reverse engineer a PCI-Express driver under Linux ?

2021-03-03 Thread Tomek LECOCQ
On 3 Mar 2021, at 14:09, Ilia Mirkin wrote: > On Wed, Mar 3, 2021 at 5:30 AM Karol Herbst wrote: >> >> >> Usually drivers map PCIe bars into the VM and read/write at certain offsets >> to do.. stuff. In the linux kernel we have the mmiotrace tracer in order to >> capture what a driver does

[Nouveau] [PATCH 18/53] drm/nouveau/nv50_display: Remove superfluous prototype for local static functions

2021-03-03 Thread Lee Jones
Fixes the following build error: drivers/gpu/drm/nouveau/dispnv50/disp.c:2530:1: error: conflicting types for ‘nv50_display_fini’ In file included from drivers/gpu/drm/nouveau/dispnv50/disp.c:71: drivers/gpu/drm/nouveau/nv50_display.h:36:6: note: previous declaration of ‘nv50_display_fini’ wa

[Nouveau] [PATCH 14/53] drm/nouveau/nouveau_display: Remove set but unused variable 'width'

2021-03-03 Thread Lee Jones
Fixes the following W=1 kernel build warning(s): drivers/gpu/drm/nouveau/nouveau_display.c: In function ‘nouveau_framebuffer_new’: drivers/gpu/drm/nouveau/nouveau_display.c:309:15: warning: variable ‘width’ set but not used [-Wunused-but-set-variable] Cc: Ben Skeggs Cc: David Airlie Cc: Dan

[Nouveau] [PATCH 16/53] drm/nouveau/dispnv50/disp: Remove unused variable 'ret' from function returning void

2021-03-03 Thread Lee Jones
Fixes the following W=1 kernel build warning(s): drivers/gpu/drm/nouveau/dispnv50/disp.c: In function ‘nv50_mstm_cleanup’: drivers/gpu/drm/nouveau/dispnv50/disp.c:1357:6: warning: variable ‘ret’ set but not used [-Wunused-but-set-variable] Cc: Ben Skeggs Cc: David Airlie Cc: Daniel Vetter C

[Nouveau] [PATCH 20/53] drm/nouveau/nouveau_ioc32: File headers are not good candidates for kernel-doc

2021-03-03 Thread Lee Jones
Fixes the following W=1 kernel build warning(s): drivers/gpu/drm/nouveau/nouveau_ioc32.c:2: warning: Cannot understand * file mga_ioc32.c Cc: Ben Skeggs Cc: David Airlie Cc: Daniel Vetter Cc: dri-de...@lists.freedesktop.org Cc: nouveau@lists.freedesktop.org Signed-off-by: Lee Jones --- dr

[Nouveau] [PATCH 22/53] drm/nouveau/nouveau_ioc32: Demote kernel-doc abuse to standard comment block

2021-03-03 Thread Lee Jones
Fixes the following W=1 kernel build warning(s): drivers/gpu/drm/nouveau/nouveau_ioc32.c:52: warning: Function parameter or member 'filp' not described in 'nouveau_compat_ioctl' drivers/gpu/drm/nouveau/nouveau_ioc32.c:52: warning: Function parameter or member 'cmd' not described in 'nouveau_co

[Nouveau] [PATCH 13/53] drm/nouveau/nouveau_bo: Remove unused variables 'dev'

2021-03-03 Thread Lee Jones
Fixes the following W=1 kernel build warning(s): drivers/gpu/drm/nouveau/nouveau_bo.c: In function ‘nouveau_ttm_tt_populate’: drivers/gpu/drm/nouveau/nouveau_bo.c:1228:17: warning: variable ‘dev’ set but not used [-Wunused-but-set-variable] drivers/gpu/drm/nouveau/nouveau_bo.c: In function ‘no

[Nouveau] [PATCH 17/53] drm/nouveau/dispnv50/headc57d: Make local function 'headc57d_olut' static

2021-03-03 Thread Lee Jones
Fixes the following W=1 kernel build warning(s): drivers/gpu/drm/nouveau/dispnv50/headc57d.c:173:1: warning: no previous prototype for ‘headc57d_olut’ [-Wmissing-prototypes] Cc: Ben Skeggs Cc: David Airlie Cc: Daniel Vetter Cc: Lyude Paul Cc: dri-de...@lists.freedesktop.org Cc: nouveau@list

[Nouveau] [PATCH 15/53] drm/nouveau/dispnv04/crtc: Demote non-conforming kernel-doc headers

2021-03-03 Thread Lee Jones
Fixes the following W=1 kernel build warning(s): drivers/gpu/drm/nouveau/dispnv04/crtc.c:462: warning: Function parameter or member 'crtc' not described in 'nv_crtc_mode_set_regs' drivers/gpu/drm/nouveau/dispnv04/crtc.c:462: warning: Function parameter or member 'mode' not described in 'nv_crt

[Nouveau] [PATCH 21/53] drm/nouveau/nouveau_svm: Remove unused variable 'ret' from void function

2021-03-03 Thread Lee Jones
Fixes the following W=1 kernel build warning(s): drivers/gpu/drm/nouveau/nouveau_svm.c: In function ‘nouveau_pfns_map’: drivers/gpu/drm/nouveau/nouveau_svm.c:810:6: warning: variable ‘ret’ set but not used [-Wunused-but-set-variable] Cc: Ben Skeggs Cc: David Airlie Cc: Daniel Vetter Cc: dri

[Nouveau] [PATCH 19/53] drm/nouveau/dispnv50/disp: Include header containing our prototypes

2021-03-03 Thread Lee Jones
Fixes the following W=1 kernel build warning(s): drivers/gpu/drm/nouveau/dispnv50/disp.c:2599:1: warning: no previous prototype for ‘nv50_display_create’ [-Wmissing-prototypes] Cc: Ben Skeggs Cc: David Airlie Cc: Daniel Vetter Cc: dri-de...@lists.freedesktop.org Cc: nouveau@lists.freedesktop

[Nouveau] [PATCH 02/53] drm/nouveau/dispnv50/disp: Remove unused variable 'ret'

2021-03-03 Thread Lee Jones
Fixes the following W=1 kernel build warning(s): drivers/gpu/drm/nouveau/dispnv50/disp.c:1381:6: warning: variable ‘ret’ set but not used [-Wunused-but-set-variable] Cc: Ben Skeggs Cc: David Airlie Cc: Daniel Vetter Cc: dri-de...@lists.freedesktop.org Cc: nouveau@lists.freedesktop.org Signed

[Nouveau] [PATCH 12/53] drm/nouveau/nvkm/engine/gr/gf100: Demote non-conformant kernel-doc header

2021-03-03 Thread Lee Jones
Fixes the following W=1 kernel build warning(s): drivers/gpu/drm/nouveau/nvkm/engine/gr/gf100.c:992: warning: Function parameter or member 'gr' not described in 'gf100_gr_wait_idle' Cc: Ben Skeggs Cc: David Airlie Cc: Daniel Vetter Cc: dri-de...@lists.freedesktop.org Cc: nouveau@lists.freede

[Nouveau] [PATCH 06/53] drm/nouveau/nvkm/subdev/volt/gk20a: Demote non-conformant kernel-doc headers

2021-03-03 Thread Lee Jones
Fixes the following W=1 kernel build warning(s): drivers/gpu/drm/nouveau/nvkm/subdev/volt/gk20a.c:53: warning: Function parameter or member 'speedo' not described in 'gk20a_volt_get_cvb_voltage' drivers/gpu/drm/nouveau/nvkm/subdev/volt/gk20a.c:53: warning: Function parameter or member 's_scale

[Nouveau] [RESEND 00/53] Rid GPU from W=1 warnings

2021-03-03 Thread Lee Jones
This is a resend. All of these patches have been sent before. The vmwgfx ones were even applied, but were dropped for some reason. Lee Jones (53): drm/nouveau/nvkm/subdev/bios/init: Demote obvious abuse of kernel-doc drm/nouveau/dispnv50/disp: Remove unused variable 'ret' drm/msm/dp/dp_dis

[Nouveau] [PATCH 01/53] drm/nouveau/nvkm/subdev/bios/init: Demote obvious abuse of kernel-doc

2021-03-03 Thread Lee Jones
Fixes the following W=1 kernel build warning(s): drivers/gpu/drm/nouveau/nvkm/subdev/bios/init.c:584: warning: Function parameter or member 'init' not described in 'init_reserved' drivers/gpu/drm/nouveau/nvkm/subdev/bios/init.c:611: warning: Function parameter or member 'init' not described in

[Nouveau] [PATCH] drm/nouveau/pmu: Use %p4cc printk modifier to print FourCC codes

2021-03-03 Thread Tian Tao
Now that we can print FourCC codes directly using printk, make use of the feature in nouveau. Signed-off-by: Tian Tao --- drivers/gpu/drm/nouveau/nvkm/subdev/pmu/gt215.c | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/pmu/gt215.c b/

Re: [Nouveau] [PATCH 2/3] drm/nouveau/kms/nv50-: Report max cursor size to userspace

2021-03-03 Thread Ilia Mirkin
On Wed, Mar 3, 2021 at 8:25 AM Uwe Sauter wrote: > > Am 03.03.21 um 14:12 schrieb Ilia Mirkin: > > On Wed, Mar 3, 2021 at 7:41 AM Alex Riesen > > wrote: > >> > >> Ilia Mirkin, Sat, Feb 27, 2021 22:26:57 +0100: > >>> Can you try Alex's patch to modetest and confirm that you see issues > >>> with

Re: [Nouveau] [PATCH 2/3] drm/nouveau/kms/nv50-: Report max cursor size to userspace

2021-03-03 Thread Uwe Sauter
Am 03.03.21 um 14:12 schrieb Ilia Mirkin: > On Wed, Mar 3, 2021 at 7:41 AM Alex Riesen > wrote: >> >> Ilia Mirkin, Sat, Feb 27, 2021 22:26:57 +0100: >>> Can you try Alex's patch to modetest and confirm that you see issues >>> with modetest? If so, can you (and maybe Alex as well) try an older >>>

Re: [Nouveau] [PATCH 2/3] drm/nouveau/kms/nv50-: Report max cursor size to userspace

2021-03-03 Thread Ilia Mirkin
On Wed, Mar 3, 2021 at 7:41 AM Alex Riesen wrote: > > Ilia Mirkin, Sat, Feb 27, 2021 22:26:57 +0100: > > Can you try Alex's patch to modetest and confirm that you see issues > > with modetest? If so, can you (and maybe Alex as well) try an older > > kernel (I'm on 5.6) and see if modetest behaves

Re: [Nouveau] How to reverse engineer a PCI-Express driver under Linux ?

2021-03-03 Thread Ilia Mirkin
On Wed, Mar 3, 2021 at 5:30 AM Karol Herbst wrote: > > > > On Wed, Mar 3, 2021 at 11:07 AM Tomek LECOCQ wrote: >> >> Hello, >> >> I’ve already asked this on the Kernel Newbies mail list, but as developing >> nouveau seems to be kind of similar to what I want to achieve, I thought it >> would be

Re: [Nouveau] [PATCH 2/3] drm/nouveau/kms/nv50-: Report max cursor size to userspace

2021-03-03 Thread Alex Riesen
Ilia Mirkin, Sat, Feb 27, 2021 22:26:57 +0100: > Can you try Alex's patch to modetest and confirm that you see issues > with modetest? If so, can you (and maybe Alex as well) try an older > kernel (I'm on 5.6) and see if modetest behaves well there. [The patch > in question was to expose 256x256 as

Re: [Nouveau] How to reverse engineer a PCI-Express driver under Linux ?

2021-03-03 Thread Karol Herbst
On Wed, Mar 3, 2021 at 11:07 AM Tomek LECOCQ wrote: > Hello, > > I’ve already asked this on the Kernel Newbies mail list, but as developing > nouveau seems to be kind of similar to what I want to achieve, I thought it > would be a good idea to ask it here as well. > > I have a PCI-Express video c

[Nouveau] How to reverse engineer a PCI-Express driver under Linux ?

2021-03-03 Thread Tomek LECOCQ
Hello, I’ve already asked this on the Kernel Newbies mail list, but as developing nouveau seems to be kind of similar to what I want to achieve, I thought it would be a good idea to ask it here as well. I have a PCI-Express video capture card that has a proprietary driver for Linux. I have some