[Nouveau] [PATCH drm-misc-next v8 12/12] drm/nouveau: debugfs: implement DRM GPU VA debugfs

2023-07-19 Thread Danilo Krummrich
Provide the driver indirection iterating over all DRM GPU VA spaces to enable the common 'gpuvas' debugfs file for dumping DRM GPU VA spaces. Signed-off-by: Danilo Krummrich --- drivers/gpu/drm/nouveau/nouveau_debugfs.c | 39 +++ 1 file changed, 39 insertions(+) diff --git

[Nouveau] [PATCH drm-misc-next v8 11/12] drm/nouveau: implement new VM_BIND uAPI

2023-07-19 Thread Danilo Krummrich
This commit provides the implementation for the new uapi motivated by the Vulkan API. It allows user mode drivers (UMDs) to: 1) Initialize a GPU virtual address (VA) space via the new DRM_IOCTL_NOUVEAU_VM_INIT ioctl for UMDs to specify the portion of VA space managed by the kernel and

[Nouveau] [PATCH drm-misc-next v8 07/12] drm/nouveau: fence: separate fence alloc and emit

2023-07-19 Thread Danilo Krummrich
The new (VM_BIND) UAPI exports DMA fences through DRM syncobjs. Hence, in order to emit fences within DMA fence signalling critical sections (e.g. as typically done in the DRM GPU schedulers run_job() callback) we need to separate fence allocation and fence emitting. Signed-off-by: Danilo

[Nouveau] [PATCH drm-misc-next v8 10/12] drm/nouveau: nvkm/vmm: implement raw ops to manage uvmm

2023-07-19 Thread Danilo Krummrich
The new VM_BIND UAPI uses the DRM GPU VA manager to manage the VA space. Hence, we a need a way to manipulate the MMUs page tables without going through the internal range allocator implemented by nvkm/vmm. This patch adds a raw interface for nvkm/vmm to pass the resposibility for managing the

[Nouveau] [PATCH drm-misc-next v8 08/12] drm/nouveau: fence: fail to emit when fence context is killed

2023-07-19 Thread Danilo Krummrich
The new VM_BIND UAPI implementation introduced in subsequent commits will allow asynchronous jobs processing push buffers and emitting fences. If a fence context is killed, e.g. due to a channel fault, jobs which are already queued for execution might still emit new fences. In such a case a job

[Nouveau] [PATCH drm-misc-next v8 09/12] drm/nouveau: chan: provide nouveau_channel_kill()

2023-07-19 Thread Danilo Krummrich
The new VM_BIND UAPI implementation introduced in subsequent commits will allow asynchronous jobs processing push buffers and emitting fences. If a job times out, we need a way to recover from this situation. For now, simply kill the channel to unblock all hung up jobs and signal userspace that

[Nouveau] [PATCH drm-misc-next v8 04/12] drm/nouveau: get vmm via nouveau_cli_vmm()

2023-07-19 Thread Danilo Krummrich
Provide a getter function for the client's current vmm context. Since we'll add a new (u)vmm context for UMD bindings in subsequent commits, this will keep the code clean. Signed-off-by: Danilo Krummrich --- drivers/gpu/drm/nouveau/nouveau_bo.c | 2 +- drivers/gpu/drm/nouveau/nouveau_chan.c |

[Nouveau] [PATCH drm-misc-next v8 06/12] drm/nouveau: move usercopy helpers to nouveau_drv.h

2023-07-19 Thread Danilo Krummrich
Move the usercopy helpers to a common driver header file to make it usable for the new API added in subsequent commits. Signed-off-by: Danilo Krummrich --- drivers/gpu/drm/nouveau/nouveau_drv.h | 26 ++ drivers/gpu/drm/nouveau/nouveau_gem.c | 26

[Nouveau] [PATCH drm-misc-next v8 05/12] drm/nouveau: bo: initialize GEM GPU VA interface

2023-07-19 Thread Danilo Krummrich
Initialize the GEM's DRM GPU VA manager interface in preparation for the (u)vmm implementation, provided by subsequent commits, to make use of it. Signed-off-by: Danilo Krummrich --- drivers/gpu/drm/nouveau/nouveau_bo.c | 3 +++ 1 file changed, 3 insertions(+) diff --git

[Nouveau] [PATCH drm-misc-next v8 03/12] drm/nouveau: new VM_BIND uapi interfaces

2023-07-19 Thread Danilo Krummrich
This commit provides the interfaces for the new UAPI motivated by the Vulkan API. It allows user mode drivers (UMDs) to: 1) Initialize a GPU virtual address (VA) space via the new DRM_IOCTL_NOUVEAU_VM_INIT ioctl. UMDs can provide a kernel reserved VA area. 2) Bind and unbind GPU VA space

[Nouveau] [PATCH drm-misc-next v8 02/12] drm: debugfs: provide infrastructure to dump a DRM GPU VA space

2023-07-19 Thread Danilo Krummrich
This commit adds a function to dump a DRM GPU VA space and a macro for drivers to register the struct drm_info_list 'gpuvas' entry. Most likely, most drivers might maintain one DRM GPU VA space per struct drm_file, but there might also be drivers not having a fixed relation between DRM GPU VA

[Nouveau] [PATCH drm-misc-next v8 01/12] drm: manager to keep track of GPUs VA mappings

2023-07-19 Thread Danilo Krummrich
Add infrastructure to keep track of GPU virtual address (VA) mappings with a decicated VA space manager implementation. New UAPIs, motivated by Vulkan sparse memory bindings graphics drivers start implementing, allow userspace applications to request multiple and arbitrary GPU VA mappings of

[Nouveau] [PATCH drm-misc-next v8 00/12] DRM GPUVA Manager & Nouveau VM_BIND UAPI

2023-07-19 Thread Danilo Krummrich
MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This patch series provides a new UAPI for the Nouveau driver in order to support Vulkan features, such as sparse bindings and sparse residency. Furthermore, with the DRM GPUVA manager it provides a new DRM

Re: [Nouveau] [PATCH 3/3] drm/nouveau/kms/nv50-: init hpd_irq_lock for PIOR DP

2023-07-19 Thread Karol Herbst
On Wed, Jul 19, 2023 at 6:41 AM Ben Skeggs wrote: > > From: Ben Skeggs > > Fixes OOPS on boards with ANX9805 DP encoders. > > Signed-off-by: Ben Skeggs > --- > drivers/gpu/drm/nouveau/dispnv50/disp.c | 4 > 1 file changed, 4 insertions(+) > > diff --git

Re: [Nouveau] [PATCH 2/3] drm/nouveau/disp: PIOR DP uses GPIO for HPD, not PMGR AUX interrupts

2023-07-19 Thread Karol Herbst
On Wed, Jul 19, 2023 at 6:41 AM Ben Skeggs wrote: > > From: Ben Skeggs > > Fixes crash on boards with ANX9805 TMDS/DP encoders. > > Signed-off-by: Ben Skeggs > --- > .../gpu/drm/nouveau/nvkm/engine/disp/uconn.c | 27 --- > 1 file changed, 18 insertions(+), 9 deletions(-) > >

Re: [Nouveau] [PATCH 1/3] drm/nouveau/i2c: fix number of aux event slots

2023-07-19 Thread Karol Herbst
On Wed, Jul 19, 2023 at 6:41 AM Ben Skeggs wrote: > > From: Ben Skeggs > > This was completely bogus before, using maximum DCB device index rather > than maximum AUX ID to size the buffer that stores event refcounts. > > *Pretty* unlikely to have been an actual problem on most configurations, >