[Nouveau] [PATCH drm-next 14/14] drm/nouveau: debugfs: implement DRM GPU VA debugfs

2023-01-17 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 | 24 +++ 1 file changed, 24 insertions(+) diff --git a

[Nouveau] [PATCH drm-next 13/14] drm/nouveau: implement new VM_BIND UAPI

2023-01-17 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 usersp

[Nouveau] [PATCH drm-next 12/14] drm/nouveau: implement uvmm for user mode bindings

2023-01-17 Thread Danilo Krummrich
uvmm provides the driver abstraction around the DRM GPU VA manager connecting it to the nouveau infrastructure. It handles the split and merge operations provided by the DRM GPU VA manager for map operations colliding with existent mappings and takes care of the driver specific locking around the

[Nouveau] [PATCH drm-next 11/14] drm/nouveau: nvkm/vmm: implement raw ops to manage uvmm

2023-01-17 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 add

[Nouveau] [PATCH drm-next 10/14] drm/nouveau: chan: provide nouveau_channel_kill()

2023-01-17 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 th

[Nouveau] [PATCH drm-next 09/14] drm/nouveau: fence: fail to emit when fence context is killed

2023-01-17 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 wo

[Nouveau] [PATCH drm-next 07/14] drm/nouveau: bo: initialize GEM GPU VA interface

2023-01-17 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 a/drivers/gpu/drm/nouve

[Nouveau] [PATCH drm-next 08/14] drm/nouveau: move usercopy helpers to nouveau_drv.h

2023-01-17 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-next 05/14] drm/nouveau: new VM_BIND uapi interfaces

2023-01-17 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 ma

[Nouveau] [PATCH drm-next 06/14] drm/nouveau: get vmm via nouveau_cli_vmm()

2023-01-17 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-next 04/14] drm: debugfs: provide infrastructure to dump a DRM GPU VA space

2023-01-17 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 spac

[Nouveau] [PATCH drm-next 03/14] drm: manager to keep track of GPUs VA mappings

2023-01-17 Thread Danilo Krummrich
This adds the infrastructure for a manager implementation to keep track of GPU virtual address (VA) mappings. New UAPIs, motivated by Vulkan sparse memory bindings graphics drivers start implementing, allow userspace applications to request multiple and arbitrary GPU VA mappings of buffer objects.

[Nouveau] [PATCH drm-next 01/14] drm: execution context for GEM buffers

2023-01-17 Thread Danilo Krummrich
From: Christian König This adds the infrastructure for an execution context for GEM buffers which is similar to the existinc TTMs execbuf util and intended to replace it in the long term. The basic functionality is that we abstracts the necessary loop to lock many different GEM buffers with auto

[Nouveau] [PATCH drm-next 02/14] drm/exec: fix memory leak in drm_exec_prepare_obj()

2023-01-17 Thread Danilo Krummrich
Don't call drm_gem_object_get() unconditionally. Signed-off-by: Danilo Krummrich --- drivers/gpu/drm/drm_exec.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/gpu/drm/drm_exec.c b/drivers/gpu/drm/drm_exec.c index ed2106c22786..5713a589a6a3 100644 --- a/drivers/gpu/drm/drm_exec.c +++

[Nouveau] [PATCH drm-next 00/14] [RFC] DRM GPUVA Manager & Nouveau VM_BIND UAPI

2023-01-17 Thread Danilo Krummrich
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 core feature to keep track of GPU virtual address (VA) mappings in a more generic way. The

Re: [Nouveau] [REGRESSION] GM20B probe fails after commit 2541626cfb79

2023-01-17 Thread Ben Skeggs
On Mon, 16 Jan 2023 at 22:27, Diogo Ivo wrote: > > On Mon, Jan 16, 2023 at 07:45:05AM +1000, David Airlie wrote: > > On Thu, Dec 29, 2022 at 12:58 AM Diogo Ivo > > wrote: > > As a quick check can you try changing > > > > drivers/gpu/drm/nouveau/nvkm/core/firmware.c:nvkm_firmware_mem_target > > f

Re: [Nouveau] [REGRESSION] GM20B probe fails after commit 2541626cfb79

2023-01-17 Thread Nicolas Chauvet
Le dim. 15 janv. 2023 à 22:45, David Airlie a écrit : > > On Thu, Dec 29, 2022 at 12:58 AM Diogo Ivo > wrote: > > > > Hello, > > > > Commit 2541626cfb79 breaks GM20B probe with > > the following kernel log: > > > > [2.153892] [ cut here ] > > [2.153897] WARNING: C

Re: [Nouveau] [PATCH 6/8] iommu/intel: Add a gfp parameter to alloc_pgtable_page()

2023-01-17 Thread Jason Gunthorpe
On Tue, Jan 17, 2023 at 03:35:08AM +, Tian, Kevin wrote: > > From: Jason Gunthorpe > > Sent: Saturday, January 7, 2023 12:43 AM > > > > @@ -2676,7 +2676,7 @@ static int copy_context_table(struct intel_iommu > > *iommu, > > if (!old_ce) > > goto

Re: [Nouveau] [PATCH 7/8] iommu/intel: Support the gfp argument to the map_pages op

2023-01-17 Thread Jason Gunthorpe
On Tue, Jan 17, 2023 at 03:38:51AM +, Tian, Kevin wrote: > > From: Jason Gunthorpe > > Sent: Saturday, January 7, 2023 12:43 AM > > > > @@ -2368,7 +2372,7 @@ static int iommu_domain_identity_map(struct > > dmar_domain *domain, > > > > return __domain_mapping(domain, first_vpfn, > >

Re: [Nouveau] [PATCH v2 3/3] drm: Call vga_switcheroo_process_delayed_switch() in drm_lastclose

2023-01-17 Thread Thomas Zimmermann
Hi Am 17.01.23 um 10:44 schrieb Lukas Wunner: On Thu, Jan 12, 2023 at 09:11:56PM +0100, Thomas Zimmermann wrote: Several lastclose helpers call vga_switcheroo_process_delayed_switch(). It's better to call the helper from drm_lastclose() after the kernel client's screen has been restored. This w

Re: [Nouveau] [PATCH v2 3/3] drm: Call vga_switcheroo_process_delayed_switch() in drm_lastclose

2023-01-17 Thread Lukas Wunner
On Thu, Jan 12, 2023 at 09:11:56PM +0100, Thomas Zimmermann wrote: > Several lastclose helpers call vga_switcheroo_process_delayed_switch(). > It's better to call the helper from drm_lastclose() after the kernel > client's screen has been restored. This way, all drivers can benefit > without having

Re: [Nouveau] [PATCH 00/22] drm: Remove includes for drm_crtc_helper.h

2023-01-17 Thread Thomas Zimmermann
Hi Am 16.01.23 um 21:47 schrieb Sam Ravnborg: Hi Thomas. On Mon, Jan 16, 2023 at 02:12:13PM +0100, Thomas Zimmermann wrote: A lot of source files include drm_crtc_helper.h for its contained include statements. This leads to excessive compile-time dependencies. Where possible, remove the inclu

Re: [Nouveau] [PATCH 00/22] drm: Remove includes for drm_crtc_helper.h

2023-01-17 Thread Thomas Zimmermann
Hi Am 16.01.23 um 19:37 schrieb Alex Deucher: On Mon, Jan 16, 2023 at 11:20 AM Jani Nikula wrote: On Mon, 16 Jan 2023, Thomas Zimmermann wrote: A lot of source files include drm_crtc_helper.h for its contained include statements. This leads to excessive compile-time dependencies. Where pos