Re: [PATCH] drm/i915: fix missing linux/debugfs.h includes

2024-04-30 Thread Danilo Krummrich
On 4/30/24 16:53, Jani Nikula wrote: On Tue, 30 Apr 2024, Danilo Krummrich wrote: After dropping linux/debugfs.h include from drm/drm_print.h the following files in i915 miss the linux/debugfs.h include: i915_debugfs.c, i915_debugfs_params.c and i915_gpu_error.c. Add the include to fix

Re: [PATCH] nouveau: Add missing break statement

2024-04-30 Thread Danilo Krummrich
On 4/30/24 15:18, Chaitanya Kumar Borah wrote: Add the missing break statement that causes the following build error CC [M] drivers/gpu/drm/i915/display/intel_display_device.o ../drivers/gpu/drm/nouveau/nvkm/subdev/gsp/r535.c: In function ‘build_registry’:

[PATCH] drm/i915: fix missing linux/debugfs.h includes

2024-04-30 Thread Danilo Krummrich
t;drm/print: drop include debugfs.h and include where needed") Closes: https://lore.kernel.org/oe-kbuild-all/202404260726.nyguvl59-...@intel.com/ Signed-off-by: Danilo Krummrich --- drivers/gpu/drm/i915/i915_debugfs.c| 1 + drivers/gpu/drm/i915/i915_debugfs_params.c | 1 + drivers/gp

Re: [PATCH] [v7] nouveau: add command-line GSP-RM registry support

2024-04-30 Thread Danilo Krummrich
On 4/30/24 15:06, Lucas De Marchi wrote: On Fri, Apr 26, 2024 at 06:08:19PM GMT, Danilo Krummrich wrote: On 4/25/24 18:38, Timur Tabi wrote: On Thu, 2024-04-25 at 15:22 +0200, Danilo Krummrich wrote: +    size_t length; + +    /* Remove any whitespace from the parameter string

[PATCH] drm/nouveau: use vmemdup_array_user() in u_memcpya()

2024-04-15 Thread Danilo Krummrich
Now that we have vmemdup_array_user(), make use of it. Signed-off-by: Danilo Krummrich --- drivers/gpu/drm/nouveau/nouveau_drv.h | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/gpu/drm/nouveau/nouveau_drv.h b/drivers/gpu/drm/nouveau/nouveau_drv.h index

[PATCH] drm/nouveau: fix duplicate pointer to struct drm_device

2024-04-15 Thread Danilo Krummrich
nouveau_uvmm_ioctl_vm_init() already has a pointer to struct drm_device, no need to derive another one from struct drm_file. Fixes: 266f7618e761 ("drm/nouveau: separately allocate struct nouveau_uvmm") Signed-off-by: Danilo Krummrich --- drivers/gpu/drm/nouveau/nouveau_uvmm.c | 3 +

Re: [PATCH] nouveau: fix instmem race condition around ptr stores

2024-04-15 Thread Danilo Krummrich
On 4/11/24 03:15, Dave Airlie wrote: From: Dave Airlie Running a lot of VK CTS in parallel against nouveau, once every few hours you might see something like this crash. BUG: kernel NULL pointer dereference, address: 0008 PGD 800114e6e067 P4D 800114e6e067 PUD 109046067 PMD

Re: [PATCH v2] drm: nv04: Fix out of bounds access

2024-04-15 Thread Danilo Krummrich
On 4/11/24 13:08, Mikhail Kobuk wrote: When Output Resource (dcb->or) value is assigned in fabricate_dcb_output(), there may be out of bounds access to dac_users array in case dcb->or is zero because ffs(dcb->or) is used as index there. The 'or' argument of fabricate_dcb_output() must be

Re: [PATCH] drm: nv04: Add check to avoid out of bounds access

2024-04-10 Thread Danilo Krummrich
On 4/10/24 17:39, Mikhail Kobuk wrote: On 08/04/2024 16:23, Danilo Krummrich wrote: On 4/5/24 22:05, Lyude Paul wrote: On Fri, 2024-04-05 at 17:53 +0200, Danilo Krummrich wrote: On 3/31/24 08:45, Mikhail Kobuk wrote: Output Resource (dcb->or) value is not guaranteed to be non-zero (

Re: [PATCH] nouveau: fix instmem race condition around ptr stores

2024-04-09 Thread Danilo Krummrich
On 4/9/24 10:27, Lucas Stach wrote: Am Dienstag, dem 09.04.2024 um 10:34 +1000 schrieb Dave Airlie: From: Dave Airlie Running a lot of VK CTS in parallel against nouveau, once every few hours you might see something like this crash. BUG: kernel NULL pointer dereference, address:

Re: [PATCH] drm: nv04: Add check to avoid out of bounds access

2024-04-08 Thread Danilo Krummrich
On 4/5/24 22:05, Lyude Paul wrote: On Fri, 2024-04-05 at 17:53 +0200, Danilo Krummrich wrote: On 3/31/24 08:45, Mikhail Kobuk wrote: Output Resource (dcb->or) value is not guaranteed to be non-zero (i.e. in drivers/gpu/drm/nouveau/nouveau_bios.c, in 'fabricate_dcb_encoder_table()' '

Re: [PATCH] nouveau: fix devinit paths to only handle display on GSP.

2024-04-08 Thread Danilo Krummrich
uveau/gsp: don't check devinit disable on GSP.") Signed-off-by: Dave Airlie Reviewed-by: Danilo Krummrich --- drivers/gpu/drm/nouveau/nvkm/subdev/devinit/gm107.c | 12 drivers/gpu/drm/nouveau/nvkm/subdev/devinit/r535.c | 1 + 2 files changed, 9 insertions(+), 4 deletion

Re: [PATCH] [v2] nouveau: fix function cast warning

2024-04-05 Thread Danilo Krummrich
On 4/4/24 18:02, Arnd Bergmann wrote: From: Arnd Bergmann Calling a function through an incompatible pointer type causes breaks kcfi, so clang warns about the assignment: drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowof.c:73:10: error: cast from 'void (*)(const void *)' to 'void (*)(void

Re: [PATCH] nouveau/gsp: Avoid addressing beyond end of rpc->entries

2024-04-05 Thread Danilo Krummrich
ode: strings = (char *)>entries[NV_GSP_REG_NUM_ENTRIES]; ... memcpy(strings, r535_registry_entries[i].name, name_len); Signed-off-by: Kees Cook Applied to drm-misc-fixes, thanks! --- Cc: Karol Herbst Cc: Lyude Paul Cc: Danilo Krummrich Cc: David Airl

Re: [PATCH v0 13/14] drm/nouveau: Make I2C terminology more inclusive

2024-04-05 Thread Danilo Krummrich
Hi Easwar, On 3/29/24 18:00, Easwar Hariharan wrote: I2C v7, SMBus 3.2, and I3C specifications have replaced "master/slave" with more appropriate terms. Inspired by and following on to Wolfram's series to fix drivers/i2c/[1], fix the terminology for users of I2C_ALGOBIT bitbanging interface,

Re: [PATCH] drm: nv04: Add check to avoid out of bounds access

2024-04-05 Thread Danilo Krummrich
On 3/31/24 08:45, Mikhail Kobuk wrote: Output Resource (dcb->or) value is not guaranteed to be non-zero (i.e. in drivers/gpu/drm/nouveau/nouveau_bios.c, in 'fabricate_dcb_encoder_table()' 'dcb->or' is assigned value '0' in call to 'fabricate_dcb_output()'). I don't really know much about the

Re: [PATCH] nouveau/uvmm: fix addr/range calcs for remap operations

2024-03-28 Thread Danilo Krummrich
the prev + unmap range calcs to use start/end and map back to addr/range. I like how using start/end instead fixes the issue and keeps it simple. Signed-off-by: Dave Airlie Fixes: b88baab82871 ("drm/nouveau: implement new VM_BIND uAPI") Cc: Danilo Krummrich Applied the patch to drm-

Re: [PATCH][next] drm/nouveau/gr/gf100: Remove second semicolon

2024-03-28 Thread Danilo Krummrich
On 3/15/24 10:09, Colin Ian King wrote: There is a statement with two semicolons. Remove the second one, it is redundant. Signed-off-by: Colin Ian King Applied, thanks! --- drivers/gpu/drm/nouveau/nvkm/engine/gr/gf100.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

Nova and staging Rust abstractions

2024-03-20 Thread Danilo Krummrich
Hi all, In this mail I briefly want to announce the Nova project and subsequently talk about the first efforts taken in order to upstream required Rust abstractions: We just started to work on Nova, a Rust-based GSP-only driver for Nvidia GPUs. Nova, in the long term, is intended to serve as

Re: [PATCH] nouveau/gsp: don't check devinit disable on GSP.

2024-03-19 Thread Danilo Krummrich
On 3/19/24 18:38, Timothy Maden wrote: Hello Can this be merged please ? Applied this to drm-misc-next-fixes a couple of hours ago. - Danilo On 3/14/24 03:45, Dave Airlie wrote: From: Dave Airlie GSP should be handling this and I can see no evidence in opengpu driver that this register

Re: [RESEND v3 1/6] drm/mst: read sideband messaging cap

2024-03-19 Thread Danilo Krummrich
c and nouveau maintainers, ack for merging this via drm-intel, please? Sure, please go ahead. Thanks, Danilo BR, Jani. v2: - Rename enumerators (Ville) Cc: Arun R Murthy Cc: Ville Syrjälä Cc: Karol Herbst Cc: Lyude Paul Cc: Danilo Krummrich Reviewed-by: Ville Syrjälä Signed-off-by: Jani

Re: [RESEND v3 1/6] drm/mst: read sideband messaging cap

2024-03-19 Thread Danilo Krummrich
Cc: Ville Syrjälä Cc: Karol Herbst Cc: Lyude Paul Cc: Danilo Krummrich Reviewed-by: Ville Syrjälä Signed-off-by: Jani Nikula Acked-by: Danilo Krummrich --- drivers/gpu/drm/display/drm_dp_mst_topology.c | 20 ++-- drivers/gpu/drm/i915/display/intel_dp.c | 4 ++-- driver

Re: [PATCH v3] nouveau/dmem: handle kcalloc() allocation failure

2024-03-08 Thread Danilo Krummrich
evict device private memory during release") Suggested-by: Danilo Krummrich Signed-off-by: Duoming Zhou Applied to drm-misc-fixes, thanks! --- Changes in v3: - Switch kcalloc() to kvcalloc(). drivers/gpu/drm/nouveau/nouveau_dmem.c | 12 ++-- 1 file changed, 6 insert

Re: [PATCH v2] nouveau/dmem: handle kcalloc() allocation failure

2024-03-05 Thread Danilo Krummrich
Hi Duoming, thanks for sending a V2. On 3/5/24 15:39, Duoming Zhou wrote: The kcalloc() in nouveau_dmem_evict_chunk() will return null if the physical memory has run out. As a result, if we dereference src_pfns, dst_pfns or dma_addrs, the null pointer dereference bugs will happen. Moreover,

Re: [PATCH] nouveau/dmem: handle kcalloc() allocation failure

2024-03-05 Thread Danilo Krummrich
Hi Duoming, On 3/3/24 08:53, Duoming Zhou wrote: The kcalloc() in nouveau_dmem_evict_chunk() will return null if the physical memory has run out. As a result, if we dereference src_pfns, dst_pfns or dma_addrs, the null pointer dereference bugs will happen. This patch uses stack variables to

Re: [PATCH 2/2] drm/nouveau: move more missing UAPI bits

2024-03-05 Thread Danilo Krummrich
On 3/4/24 19:31, Karol Herbst wrote: Those are already de-facto UAPI, so let's just move it into the uapi header. Signed-off-by: Karol Herbst Reviewed-by: Danilo Krummrich --- drivers/gpu/drm/nouveau/nouveau_abi16.c | 20 +++- drivers/gpu/drm/nouveau/nouveau_abi16.h

Re: [PATCH 1/2] drm/nouveau: fix stale locked mutex in nouveau_gem_ioctl_pushbuf

2024-03-05 Thread Danilo Krummrich
other nouveau ioctl call. Fixes: b88baab82871 ("drm/nouveau: implement new VM_BIND uAPI") Cc: Danilo Krummrich Signed-off-by: Karol Herbst Should add a stable tag for that one, otherwise: Reviewed-by: Danilo Krummrich --- drivers/gpu/drm/nouveau/nouveau_gem.c | 2 +- 1 file

Re: [PATCH stable v6.7] drm/nouveau: don't fini scheduler before entity flush

2024-03-04 Thread Danilo Krummrich
On 3/4/24 18:55, Greg KH wrote: On Mon, Mar 04, 2024 at 06:01:46PM +0100, Danilo Krummrich wrote: Cc: # v6.7 only You say 6.7 only, but this commit is in 6.6, so why not 6.6 also? Good catch, I was sure I originally merged this for 6.7. This fix should indeed be applied to 6.6 as well

[PATCH stable v6.7] drm/nouveau: don't fini scheduler before entity flush

2024-03-04 Thread Danilo Krummrich
rolherbst/a20eb0f937a06ed6aabe2ac2ca3d11b5/raw/9cd8b1dc5894872d0eeebbee3dd0fdd28bb576bc/gistfile1.txt Fixes: b88baab82871 ("drm/nouveau: implement new VM_BIND uAPI") Signed-off-by: Danilo Krummrich --- drivers/gpu/drm/nouveau/nouveau_drm.c | 5 +++-- 1 file changed, 3 insertions(+), 2 delet

Re: [PATCH 1/2] nouveau: lock the client object tree.

2024-03-04 Thread Danilo Krummrich
On 3/1/24 04:42, Dave Airlie wrote: From: Dave Airlie It appears the client object tree has no locking unless I've missed something else. Fix races around adding/removing client objects, mostly vram bar mappings. 4562.099306] general protection fault, probably for non-canonical address

Re: [PATCH] drm/nouveau: use dedicated wq for fence uevents work

2024-02-23 Thread Danilo Krummrich
On Fri, Feb 23, 2024 at 10:14:53AM +1000, Dave Airlie wrote: > On Fri, 23 Feb 2024 at 00:45, Danilo Krummrich wrote: > > > > Using the kernel global workqueue to signal fences can lead to > > unexpected deadlocks. Some other work (e.g. from a different driver) > > c

[PATCH] drm/nouveau: use dedicated wq for fence uevents work

2024-02-22 Thread Danilo Krummrich
the fence from running. While this seems fairly unlikely, it's potentially exploitable. Fixes: 39126abc5e20 ("nouveau: offload fence uevents work to workqueue") Signed-off-by: Danilo Krummrich --- drivers/gpu/drm/nouveau/nouveau_drm.c | 13 +++-- drivers/gpu/drm/nouveau/nouveau_dr

Re: [PATCH 1/2] drm/nouveau: don't fini scheduler if not initialized

2024-02-20 Thread Danilo Krummrich
On 2/20/24 20:45, Timur Tabi wrote: On Mon, 2024-02-19 at 10:32 +0100, Danilo Krummrich wrote: Looks like I spoke too soon, I just hit the problem with the drm-next tree. Did you apply the patch to drm-next? Ugh, you're right.  I don't how I got confused, but I could have sworn that I saw

Re: [PATCH] nouveau: offload fence uevents work to workqueue

2024-02-19 Thread Danilo Krummrich
On 2/16/24 17:41, Daniel Vetter wrote: On Tue, Feb 13, 2024 at 06:39:20PM +0100, Danilo Krummrich wrote: On 2/9/24 19:52, Daniel Vetter wrote: On Fri, Feb 09, 2024 at 06:41:32PM +0100, Danilo Krummrich wrote: On 2/6/24 15:03, Daniel Vetter wrote: On Mon, Feb 05, 2024 at 11:00:04PM +0100

Re: [PATCH 1/2] drm/nouveau: don't fini scheduler if not initialized

2024-02-19 Thread Danilo Krummrich
On 2/15/24 00:48, Timur Tabi wrote: On Fri, 2024-02-02 at 17:14 +, Timur Tabi wrote: On Fri, 2024-02-02 at 01:05 +0100, Danilo Krummrich wrote: nouveau_abi16_ioctl_channel_alloc() and nouveau_cli_init() simply call their corresponding *_fini() counterpart. This can lead

Re: [PATCH] drm/nouveau/mmu/r535: uninitialized variable in r535_bar_new_()

2024-02-16 Thread Danilo Krummrich
On 2/13/24 19:09, Dan Carpenter wrote: If gf100_bar_new_() fails then "bar" is not initialized. Fixes: 5bf0257136a2 ("drm/nouveau/mmu/r535: initial support") Signed-off-by: Dan Carpenter Applied to drm-misc-fixes, thanks! --- It looks like this was intended to handle a failure from the

Re: [PATCH] nouveau: fix function cast warnings

2024-02-16 Thread Danilo Krummrich
On 2/13/24 10:57, Arnd Bergmann wrote: From: Arnd Bergmann clang-16 warns about casting between incompatible function types: drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c:161:10: error: cast from 'void (*)(const struct firmware *)' to 'void (*)(void *)' converts to incompatible function

Re: [PATCH 2/2] [v3] drm/nouveau: expose GSP-RM logging buffers via debugfs

2024-02-13 Thread Danilo Krummrich
On 2/13/24 18:10, Timur Tabi wrote: On Tue, 2024-02-13 at 17:57 +0100, Danilo Krummrich wrote: + struct debugfs_blob_wrapper blob_init; + struct debugfs_blob_wrapper blob_intr; + struct debugfs_blob_wrapper blob_rm; + struct debugfs_blob_wrapper blob_pmu; + struct

Re: [PATCH] nouveau: offload fence uevents work to workqueue

2024-02-13 Thread Danilo Krummrich
On 2/9/24 19:52, Daniel Vetter wrote: On Fri, Feb 09, 2024 at 06:41:32PM +0100, Danilo Krummrich wrote: On 2/6/24 15:03, Daniel Vetter wrote: On Mon, Feb 05, 2024 at 11:00:04PM +0100, Danilo Krummrich wrote: On 2/5/24 22:08, Dave Airlie wrote: On Tue, 6 Feb 2024 at 02:22, Danilo Krummrich

Re: [PATCH 1/2] drm/scheduler: improve GPU scheduler documentation v2

2024-02-13 Thread Danilo Krummrich
Hi Christian, What's the status of this effort? Was there ever a follow-up? - Danilo On 11/16/23 23:23, Danilo Krummrich wrote: Hi Christian, Thanks for sending an update of this patch! On Thu, Nov 16, 2023 at 03:15:46PM +0100, Christian König wrote: Start to improve the scheduler document

Re: [PATCH 2/2] [v3] drm/nouveau: expose GSP-RM logging buffers via debugfs

2024-02-13 Thread Danilo Krummrich
On 2/12/24 22:15, Timur Tabi wrote: The LOGINIT, LOGINTR, LOGRM, and LOGPMU buffers are circular buffers that have printf-like logs from GSP-RM and PMU encoded in them. LOGINIT, LOGINTR, and LOGRM are allocated by Nouveau and their DMA addresses are passed to GSP-RM during initialization. The

Re: [PATCH 1/2] [v3] nouveau: add command-line GSP-RM registry support

2024-02-13 Thread Danilo Krummrich
On 2/12/24 22:15, Timur Tabi wrote: Add the NVreg_RegistryDwords command line parameter, which allows specifying additional registry keys to be sent to GSP-RM. This allows additional configuration, debugging, and experimentation with GSP-RM, which uses these keys to alter its behavior. Note

Re: [PATCH] nouveau/svm: fix kvcalloc() argument order

2024-02-12 Thread Danilo Krummrich
On 2/12/24 12:22, Arnd Bergmann wrote: From: Arnd Bergmann The conversion to kvcalloc() mixed up the object size and count arguments, causing a warning: drivers/gpu/drm/nouveau/nouveau_svm.c: In function 'nouveau_svm_fault_buffer_ctor': drivers/gpu/drm/nouveau/nouveau_svm.c:1010:40: error:

Re: [PATCH] nouveau: offload fence uevents work to workqueue

2024-02-09 Thread Danilo Krummrich
On 2/6/24 15:03, Daniel Vetter wrote: On Mon, Feb 05, 2024 at 11:00:04PM +0100, Danilo Krummrich wrote: On 2/5/24 22:08, Dave Airlie wrote: On Tue, 6 Feb 2024 at 02:22, Danilo Krummrich wrote: On 1/29/24 02:50, Dave Airlie wrote: From: Dave Airlie This should break the deadlock between

Re: [PATCH] nouveau: offload fence uevents work to workqueue

2024-02-05 Thread Danilo Krummrich
On 2/5/24 22:08, Dave Airlie wrote: On Tue, 6 Feb 2024 at 02:22, Danilo Krummrich wrote: On 1/29/24 02:50, Dave Airlie wrote: From: Dave Airlie This should break the deadlock between the fctx lock and the irq lock. This offloads the processing off the work from the irq into a workqueue

Re: [PATCH] nouveau/gsp: use correct size for registry rpc.

2024-02-05 Thread Danilo Krummrich
On 1/30/24 04:26, Dave Airlie wrote: From: Dave Airlie Timur pointed this out before, and it just slipped my mind, but this might help some things work better, around pcie power management. Fixes: 8d55b0a940bb ("nouveau/gsp: add some basic registry entries.") Signed-off-by: Dave Airlie

Re: [PATCH] nouveau: offload fence uevents work to workqueue

2024-02-05 Thread Danilo Krummrich
On 1/29/24 02:50, Dave Airlie wrote: From: Dave Airlie This should break the deadlock between the fctx lock and the irq lock. This offloads the processing off the work from the irq into a workqueue. Signed-off-by: Dave Airlie Nouveau's scheduler uses a dedicated wq, hence from this

Re: [PATCH v4 00/14] drm: Add a driver for CSF-based Mali GPUs

2024-02-05 Thread Danilo Krummrich
On 2/5/24 10:03, Boris Brezillon wrote: +Danilo for the panthor gpuvm-needs update. On Sun, 4 Feb 2024 09:14:44 +0800 (CST) "Andy Yan" wrote: Hi Boris: I saw this warning sometimes(Run on a armbain based bookworm),not sure is a know issue or something else。 [15368.293031]

Re: [PATCH 1/2] drm/nouveau: don't fini scheduler if not initialized

2024-02-02 Thread Danilo Krummrich
On 2/2/24 18:14, Timur Tabi wrote: On Fri, 2024-02-02 at 01:05 +0100, Danilo Krummrich wrote: nouveau_abi16_ioctl_channel_alloc() and nouveau_cli_init() simply call their corresponding *_fini() counterpart. This can lead to nouveau_sched_fini() being called without struct nouveau_sched ever

[PATCH 2/2] drm/nouveau: omit to create schedulers using the legacy uAPI

2024-02-01 Thread Danilo Krummrich
Omit to create scheduler instances when using the legacy uAPI. When using the legacy NOUVEAU_GEM_PUSHBUF ioctl no scheduler instance is required, hence omit creating scheduler instances in nouveau_abi16_ioctl_channel_alloc(). Signed-off-by: Danilo Krummrich --- drivers/gpu/drm/nouveau

[PATCH 1/2] drm/nouveau: don't fini scheduler if not initialized

2024-02-01 Thread Danilo Krummrich
rg/nouveau/20240131213917.1545604-1-tt...@nvidia.com/ Signed-off-by: Danilo Krummrich --- drivers/gpu/drm/nouveau/nouveau_abi16.c | 10 --- drivers/gpu/drm/nouveau/nouveau_abi16.h | 2 +- drivers/gpu/drm/nouveau/nouveau_drm.c | 7 +++-- drivers/gpu/drm/nouveau/nouveau_drv.h | 2 +- d

Re: [PATCH v3 1/2] drm: enable (most) W=1 warnings by default across the subsystem

2024-02-01 Thread Danilo Krummrich
-Wstringop-overflow (already enabled by default) Cc: David Airlie Cc: Daniel Vetter Cc: Maarten Lankhorst Cc: Maxime Ripard Cc: Thomas Zimmermann Cc: Alex Deucher Cc: Christian König Cc: Pan, Xinhui Cc: Karol Herbst Cc: Lyude Paul Cc: Danilo Krummrich Cc: Rob Clark Cc: Abhinav Kumar Cc

Re: [PATCH 2/6] drm/nouveau/svm: remove unused but set variables

2024-01-31 Thread Danilo Krummrich
On 1/10/24 18:39, Jani Nikula wrote: Fix the W=1 warning -Wunused-but-set-variable. Cc: Karol Herbst Cc: Lyude Paul Cc: Danilo Krummrich Cc: nouv...@lists.freedesktop.org Signed-off-by: Jani Nikula Reviewed-by: Danilo Krummrich --- drivers/gpu/drm/nouveau/nouveau_svm.c | 10

Re: [PATCH 1/6] drm/nouveau/acr/ga102: remove unused but set variable

2024-01-31 Thread Danilo Krummrich
On 1/10/24 18:39, Jani Nikula wrote: Fix the W=1 warning -Wunused-but-set-variable. Cc: Karol Herbst Cc: Lyude Paul Cc: Danilo Krummrich Cc: nouv...@lists.freedesktop.org Signed-off-by: Jani Nikula Reviewed-by: Danilo Krummrich --- drivers/gpu/drm/nouveau/nvkm/subdev/acr/lsfw.c | 3

Re: Making drm_gpuvm work across gpu devices

2024-01-25 Thread Danilo Krummrich
will give up this approach, unless Matt or Brian can see a way. A few replies inline @Welty, Brian I had more thoughts inline to one of your original question -Original Message- From: Danilo Krummrich Sent: Tuesday, January 23, 2024 6:57 PM To: Zeng, Oak ; Christian König ; Dave

Re: Making drm_gpuvm work across gpu devices

2024-01-23 Thread Danilo Krummrich
the same thoughts after reading your initial mail. Please find some more comments below. -Original Message- From: Christian König Sent: Tuesday, January 23, 2024 6:13 AM To: Zeng, Oak ; Danilo Krummrich ; Dave Airlie ; Daniel Vetter Cc: Welty, Brian ; dri-devel@lists.freedesktop.org; intel

Re: [PATCH][next] drm/nouveau/fifo/gk104: remove redundant variable ret

2024-01-22 Thread Danilo Krummrich
On 1/16/24 13:31, Dan Carpenter wrote: On Tue, Jan 16, 2024 at 11:16:09AM +, Colin Ian King wrote: The variable ret is being assigned a value but it isn't being read afterwards. The assignment is redundant and so ret can be removed. Cleans up clang scan build warning: warning: Although the

Re: [PATCH] drm/exec, drm/gpuvm: Prefer u32 over uint32_t

2024-01-19 Thread Danilo Krummrich
On 1/19/24 10:05, Thomas Hellström wrote: The relatively recently introduced drm/exec utility was using uint32_t in its interface, which was then also carried over to drm/gpuvm. Prefer u32 in new code and update drm/exec and drm/gpuvm accordingly. Cc: Christian König Cc: Danilo Krummrich

Re: [PATCH linux-next v2] drm/nouveau/disp: switch to use kmemdup() helper

2024-01-10 Thread Danilo Krummrich
On 1/9/24 07:24, yang.gua...@zte.com.cn wrote: From: Chen Haonan Use kmemdup() helper instead of open-coding to simplify the code. Signed-off-by: Chen Haonan Reviewed-by: Yang Guang Applied to drm-misc-next, thanks! --- drivers/gpu/drm/nouveau/nvif/outp.c | 3 +-- 1 file changed, 1

Re: [PATCH 1/3] drm/nouveau: include drm/drm_edid.h only where needed

2024-01-09 Thread Danilo Krummrich
On 1/9/24 10:59, Jani Nikula wrote: On Mon, 08 Jan 2024, Danilo Krummrich wrote: On 1/4/24 21:16, Jani Nikula wrote: Including drm_edid.h from nouveau_connector.h causes the rebuild of 15 files when drm_edid.h is modified, while there are only a few files that actually need to include

Re: [PATCH -next] drm/nouveau: uapi: fix kerneldoc warnings

2024-01-08 Thread Danilo Krummrich
On 12/25/23 07:51, Vegard Nossum wrote: As of commit b77fdd6a48e6 ("scripts/kernel-doc: restore warning for Excess struct/union"), we see the following warnings when running 'make htmldocs': ./include/uapi/drm/nouveau_drm.h:292: warning: Excess struct member 'DRM_NOUVEAU_VM_BIND_OP_MAP'

Re: [PATCH 1/3] drm/nouveau: include drm/drm_edid.h only where needed

2024-01-08 Thread Danilo Krummrich
On 1/4/24 21:16, Jani Nikula wrote: Including drm_edid.h from nouveau_connector.h causes the rebuild of 15 files when drm_edid.h is modified, while there are only a few files that actually need to include drm_edid.h. Cc: Karol Herbst Cc: Lyude Paul Cc: Danilo Krummrich Cc: nouv

Re: [PATCH 1/4] drm/nouveau/disp: don't misuse kernel-doc comments

2024-01-08 Thread Danilo Krummrich
* Sets up registers for the given mode/adjusted_mode pair. crtc.c:629: warning: missing initial short description on line: * Sets up registers for the given mode/adjusted_mode pair. Signed-off-by: Randy Dunlap Cc: Karol Herbst Cc: Lyude Paul Cc: Danilo Krummrich Cc: nouv...@lists.freedes

Re: [PATCH] drm/nouveau/bios/init: drop kernel-doc notation

2024-01-08 Thread Danilo Krummrich
totype for INIT_DONE(). Prototype was for init_done() instead Signed-off-by: Randy Dunlap Cc: Karol Herbst Cc: Lyude Paul Cc: Danilo Krummrich Cc: dri-devel@lists.freedesktop.org Cc: nouv...@lists.freedesktop.org Cc: Maarten Lankhorst Cc: Maxime Ripard Cc: Thomas Zimmermann Cc: David Airli

Re: [PATCH] drm/nouveau/fifo: remove duplicated including

2024-01-08 Thread Danilo Krummrich
Hi Wang, there is another patch [1] to fix this, which already made it upstream. - Danilo [1] https://patchwork.freedesktop.org/patch/msgid/20231122004926.84933-1-yang@linux.alibaba.com On 12/15/23 11:02, Wang Jinchao wrote: rm second including of chid.h Signed-off-by: Wang Jinchao

Re: [PATCH linux-next] drm/nouveau/disp: switch to use kmemdup() helper

2024-01-08 Thread Danilo Krummrich
Hi Yang, On 12/14/23 13:03, yang.gua...@zte.com.cn wrote: From: Yang Guang Use kmemdup() helper instead of open-coding to simplify the code. Signed-off-by: Chen Haonan Please add your "Signed-off-by" tag to this patch. If the above is intended to indicate that Chan was involved in

Re: [PATCH drm-misc-next v2 0/2] PowerVR VM fixes

2023-12-05 Thread Danilo Krummrich
On Tue, Dec 05, 2023 at 04:35:00PM +0100, Maxime Ripard wrote: > Hi, > > On Wed, Nov 29, 2023 at 11:07:59PM +0100, Danilo Krummrich wrote: > > Some major GPUVM changes landed just before v8 of the PowerVR series. Since > > v8 > > went in rather quickly (review proces

Re: [PATCH] drm/gpuvm: Let drm_gpuvm_bo_put() report when the vm_bo object is destroyed

2023-12-04 Thread Danilo Krummrich
drm_gpuvm_bo_put() to report when the object is destroyed. Signed-off-by: Boris Brezillon Reviewed-by: Danilo Krummrich --- drivers/gpu/drm/drm_gpuvm.c | 8 ++-- include/drm/drm_gpuvm.h | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/drm_gpuvm.c b/drivers

Re: [PATCH] drm/nouveau: Removes unnecessary args check in nouveau_uvmm_sm_prepare

2023-11-29 Thread Danilo Krummrich
to remind users of this function to ensure that args != NULL when calling this function for a map operation as it was suggested by Danilo [1] [1] https://lore.kernel.org/lkml/6a1ebcef-bade-45a0-9bd9-c05f0226e...@redhat.com Suggested-by: Danilo Krummrich Signed-off-by: Yuran Pereira Applied to drm

Re: [PATCH] driver: gpu: Fix warning directly dereferencing a rcu pointer

2023-11-29 Thread Danilo Krummrich
Hi Abhinav, Thanks for sending this follow-up patch. On 11/26/23 15:57, Abhinav Singh wrote: Fix a sparse warning with this message "warning:dereference of noderef expression". In this context it means we are dereferencing a __rcu tagged pointer directly. We should not be directly

[PATCH drm-misc-next v2 2/2] drm/imagination: vm: make use of GPUVM's drm_exec helper

2023-11-29 Thread Danilo Krummrich
d GEM and VM related code") Signed-off-by: Danilo Krummrich --- drivers/gpu/drm/imagination/pvr_vm.c | 91 +++- 1 file changed, 36 insertions(+), 55 deletions(-) diff --git a/drivers/gpu/drm/imagination/pvr_vm.c b/drivers/gpu/drm/imagination/pvr_vm.c index e0

[PATCH drm-misc-next v2 1/2] drm/gpuvm: fall back to drm_exec_lock_obj()

2023-11-29 Thread Danilo Krummrich
Fall back to drm_exec_lock_obj() if num_fences is zero for the drm_gpuvm_prepare_* function family. Otherwise dma_resv_reserve_fences() would actually allocate slots even though num_fences is zero. Cc: Christian König Signed-off-by: Danilo Krummrich --- drivers/gpu/drm/drm_gpuvm.c | 43

[PATCH drm-misc-next v2 0/2] PowerVR VM fixes

2023-11-29 Thread Danilo Krummrich
drm_gpuvm_exec wrappers - drop 3 patches which were applied already Danilo Krummrich (2): drm/gpuvm: fall back to drm_exec_lock_obj() drm/imagination: vm: make use of GPUVM's drm_exec helper drivers/gpu/drm/drm_gpuvm.c | 43 +++-- drivers/gpu/drm/imagination/pvr_vm.c | 91

Re: [Nouveau] [PATCH][next] nouveau/gsp: replace zero-length array with flex-array member and use __counted_by

2023-11-28 Thread Danilo Krummrich
On 11/29/23 02:06, Gustavo A. R. Silva wrote: On 11/28/23 19:01, Danilo Krummrich wrote: On 11/16/23 20:55, Timur Tabi wrote: On Thu, 2023-11-16 at 20:45 +0100, Danilo Krummrich wrote: As I already mentioned for Timur's patch [2], I'd prefer to get a fix upstream (meaning [1] in this case

Re: [PATCH] nouveau/gsp/r535: remove a stray unlock in r535_gsp_rpc_send()

2023-11-28 Thread Danilo Krummrich
On 11/27/23 13:56, Dan Carpenter wrote: This unlock doesn't belong here and it leads to a double unlock in the caller, r535_gsp_rpc_push(). Fixes: 176fdcbddfd2 ("drm/nouveau/gsp/r535: add support for booting GSP-RM") Signed-off-by: Dan Carpenter Good catch - applied to drm-misc-fixes. -

Re: [Nouveau] [PATCH][next] nouveau/gsp: replace zero-length array with flex-array member and use __counted_by

2023-11-28 Thread Danilo Krummrich
On 11/16/23 20:55, Timur Tabi wrote: On Thu, 2023-11-16 at 20:45 +0100, Danilo Krummrich wrote: As I already mentioned for Timur's patch [2], I'd prefer to get a fix upstream (meaning [1] in this case). Of course, that's probably more up to Timur to tell if this will work out. Don't count

Re: [EXTERNAL] [PATCH drm-misc-next 5/5] drm/imagination: vm: make use of GPUVM's drm_exec helper

2023-11-28 Thread Danilo Krummrich
On 11/28/23 11:47, Donald Robson wrote: Hi Danilo, Apologies - I guess I should have submitted a patch to handle zero fences in your locking functions with the final patch series. On Sat, 2023-11-25 at 00:36 +0100, Danilo Krummrich wrote: *** CAUTION: This email originates from a source

Re: [PATCH v5] Documentation/gpu: VM_BIND locking document

2023-11-27 Thread Danilo Krummrich
Use local references to other documentation where possible    (Bagas Sanjaya) - General documentation fixes and typos (Danilo Krummrich and    Boris Brezillon) - Improve the documentation around locks that need to be grabbed from the    dm-fence critical section (Boris Brezillon) - Add more referen

Re: [PATCH drm-misc-next 4/5] drm/gpuvm: fall back to drm_exec_lock_obj()

2023-11-27 Thread Danilo Krummrich
Hi, On 11/27/23 14:52, Christian König wrote: Am 25.11.23 um 00:40 schrieb Danilo Krummrich: Hi Christian, do you think it makes sense to handle this in drm_exec_prepare_obj() or even dma_resv_reserve_fences() even? IIRC for drm_exec the discussion has gone a bit back and forth between

Re: [PATCH drm-misc-next 4/5] drm/gpuvm: fall back to drm_exec_lock_obj()

2023-11-24 Thread Danilo Krummrich
Hi Christian, do you think it makes sense to handle this in drm_exec_prepare_obj() or even dma_resv_reserve_fences() even? - Danilo On 11/25/23 00:36, Danilo Krummrich wrote: Fall back to drm_exec_lock_obj() if num_fences is zero for the drm_gpuvm_prepare_* function family. Otherwise

[PATCH drm-misc-next 5/5] drm/imagination: vm: make use of GPUVM's drm_exec helper

2023-11-24 Thread Danilo Krummrich
d GEM and VM related code") Signed-off-by: Danilo Krummrich --- drivers/gpu/drm/imagination/pvr_vm.c | 16 +--- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/drivers/gpu/drm/imagination/pvr_vm.c b/drivers/gpu/drm/imagination/pvr_vm.c index e0d74d9a6190..3f7888f5c

[PATCH drm-misc-next 4/5] drm/gpuvm: fall back to drm_exec_lock_obj()

2023-11-24 Thread Danilo Krummrich
Fall back to drm_exec_lock_obj() if num_fences is zero for the drm_gpuvm_prepare_* function family. Otherwise dma_resv_reserve_fences() would actually allocate slots even though num_fences is zero. Cc: Christian König Signed-off-by: Danilo Krummrich --- drivers/gpu/drm/drm_gpuvm.c | 36

[PATCH drm-misc-next 3/5] drm/imagination: vm: fix drm_gpuvm reference count

2023-11-24 Thread Danilo Krummrich
, this prevents lifetime issues such as the VM being freed as long as drm_gpuvm_bo structures still hold references to the VM. Fixes: ff5f643de0bf ("drm/imagination: Add GEM and VM related code") Signed-off-by: Danilo Krummrich --- drivers/gpu/drm/imagination/pvr_vm.c | 11 --- 1 fi

[PATCH drm-misc-next 0/5] PowerVR VM fixes

2023-11-24 Thread Danilo Krummrich
the drm_gpuvm_prepare_* helpers useful for PowerVR. - Danilo Danilo Krummrich (5): drm/imagination: vm: prevent duplicate drm_gpuvm_bo instances drm/imagination: vm: check for drm_gpuvm_range_valid() drm/imagination: vm: fix drm_gpuvm reference count drm/gpuvm: fall back

[PATCH drm-misc-next 2/5] drm/imagination: vm: check for drm_gpuvm_range_valid()

2023-11-24 Thread Danilo Krummrich
Extend pvr_device_addr_and_size_are_valid() by the corresponding GPUVM sanity checks. This includes a, previously missing, overflow check for the base address and size of the requested mapping. Fixes: ff5f643de0bf ("drm/imagination: Add GEM and VM related code") Signed-off-by: Danilo

[PATCH drm-misc-next 1/5] drm/imagination: vm: prevent duplicate drm_gpuvm_bo instances

2023-11-24 Thread Danilo Krummrich
of struct drm_gpuvm_bo and hence leave us with duplicates. Fixes: ff5f643de0bf ("drm/imagination: Add GEM and VM related code") Signed-off-by: Danilo Krummrich --- drivers/gpu/drm/imagination/pvr_vm.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drive

Re: [PATCH v3] driver: gpu: Fixing warning directly dereferencing a rcu pointer

2023-11-20 Thread Danilo Krummrich
On 11/13/23 20:13, Abhinav Singh wrote: This patch fixes a sparse warning with this message "warning:dereference of noderef expression". In this context it means we are dereferencing a __rcu tagged pointer directly. We should not be directly dereferencing a rcu pointer. To get a normal (non

Re: [PATCH 1/2] drm/scheduler: improve GPU scheduler documentation v2

2023-11-16 Thread Danilo Krummrich
Hi Christian, Thanks for sending an update of this patch! On Thu, Nov 16, 2023 at 03:15:46PM +0100, Christian König wrote: > Start to improve the scheduler document. Especially document the > lifetime of each of the objects as well as the restrictions around > DMA-fence handling and userspace

Re: [PATCH][next] nouveau/gsp: replace zero-length array with flex-array member and use __counted_by

2023-11-16 Thread Danilo Krummrich
Hi Gustavo, On Thu, Nov 16, 2023 at 12:11:43PM -0600, Gustavo A. R. Silva wrote: > Fake flexible arrays (zero-length and one-element arrays) are deprecated, > and should be replaced by flexible-array members. So, replace > zero-length array with a flexible-array member in `struct >

Re: [PATCH v4] Documentation/gpu: VM_BIND locking document

2023-11-16 Thread Danilo Krummrich
On 11/16/23 12:48, Thomas Hellström wrote: +Locks used and locking orders += + +One of the benefits of VM_BIND is that local GEM objects share the gpu_vm's +dma_resv object and hence the dma_resv lock. So even with a huge +number of local GEM objects, only one lock

Re: [PATCH v4] Documentation/gpu: VM_BIND locking document

2023-11-15 Thread Danilo Krummrich
On 11/15/23 17:04, Thomas Hellström wrote: Hi, Danilo, On Wed, 2023-11-15 at 16:11 +0100, Danilo Krummrich wrote: On Wed, Nov 15, 2023 at 01:49:37PM +0100, Thomas Hellström wrote: Add the first version of the VM_BIND locking document which is intended to be part of the xe driver upstreaming

Re: [PATCH v4] Documentation/gpu: VM_BIND locking document

2023-11-15 Thread Danilo Krummrich
On Wed, Nov 15, 2023 at 01:49:37PM +0100, Thomas Hellström wrote: > Add the first version of the VM_BIND locking document which is > intended to be part of the xe driver upstreaming agreement. > > The document describes and discuss the locking used during exec- > functions, evicton and for

Re: [PATCH] nouveau/gsp/r535: Fix a NULL vs error pointer bug

2023-11-14 Thread Danilo Krummrich
("drm/nouveau/gsp/r535: add support for booting GSP-RM") Signed-off-by: Dan Carpenter Reviewed-by: Danilo Krummrich --- drivers/gpu/drm/nouveau/nvkm/subdev/gsp/r535.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp

Re: [Nouveau] [PATCH] nouveau: don't fail driver load if no display hw present.

2023-11-14 Thread Danilo Krummrich
On 11/5/23 21:37, Dave Airlie wrote: From: Dave Airlie If we get back ENODEV don't fail load. Maybe worth to note why this is OK in this case, might not be obvious to future readers of the code. Fixes: 15740541e8f0 ("drm/nouveau/devinit/tu102-: prepare for GSP-RM") Maybe I'm missing

Re: [PATCH v8 02/20] drm/gpuvm: Helper to get range of unmap from a remap op.

2023-11-14 Thread Danilo Krummrich
() - Improved documentation Changes since v6: - Remove use of __always_inline Signed-off-by: Donald Robson Signed-off-by: Sarah Walker Reviewed-by: Danilo Krummrich Want me to apply the patch? --- include/drm/drm_gpuvm.h | 28 1 file changed, 28 insertions

Re: [PATCH] drm/nouveau: Prevents NULL pointer dereference in nouveau_uvmm_sm_prepare

2023-11-14 Thread Danilo Krummrich
Hi Yuran, On 10/26/23 19:03, Yuran Pereira wrote: There are instances where the "args" argument passed to nouveau_uvmm_sm_prepare() is NULL. I.e. when nouveau_uvmm_sm_prepare() is called from nouveau_uvmm_sm_unmap_prepare() ``` static int nouveau_uvmm_sm_unmap_prepare(struct nouveau_uvmm

[PATCH drm-misc-next 2/2] drm/nouveau: enable dynamic job-flow control

2023-11-13 Thread Danilo Krummrich
Make use of the scheduler's credit limit and scheduler job's credit count to account for the actual size of a job, such that we fill up the ring efficiently. Signed-off-by: Danilo Krummrich --- drivers/gpu/drm/nouveau/nouveau_abi16.c | 3 ++- drivers/gpu/drm/nouveau/nouveau_drm.c | 2

[PATCH drm-misc-next 1/2] drm/nouveau: implement 1:1 scheduler - entity relationship

2023-11-13 Thread Danilo Krummrich
/20231031032439.1558703-1-matthew.br...@intel.com/T/ Signed-off-by: Danilo Krummrich --- drivers/gpu/drm/nouveau/nouveau_abi16.c | 18 +- drivers/gpu/drm/nouveau/nouveau_abi16.h | 2 +- drivers/gpu/drm/nouveau/nouveau_drm.c | 31 ++-- drivers/gpu/drm/nouveau/nouveau_drv.h | 9 +- drivers/gpu

[PATCH drm-misc-next] drm/nouveau: use GPUVM common infrastructure

2023-11-13 Thread Danilo Krummrich
the GPUVM's GEM objects. Hence, make us of it. Signed-off-by: Danilo Krummrich --- Originally, this patch was part of [1]. However, while applying the series, I noticed that this patch needs another iteration, hence I held it back to rework it and send it separately. Changes since detached from [1

Re: [PATCH v2] driver: gpu: Fixing warning directly dereferencing a rcu pointer

2023-11-13 Thread Danilo Krummrich
On 11/13/23 19:55, Abhinav Singh wrote: On 11/14/23 00:19, Danilo Krummrich wrote: Hi, thanks for sending a v2. On 11/13/23 19:42, Abhinav Singh wrote: This patch fixes a sparse warning with this message "warning:dereference of noderef expression". In this context i

  1   2   3   4   5   6   7   8   >