[Nouveau] [PATCH 33/44] drm/nouveau/disp: move link training out of supervisor

2023-09-14 Thread Ben Skeggs
From: Ben Skeggs - preparation for GSP-RM Signed-off-by: Ben Skeggs --- drivers/gpu/drm/nouveau/nouveau_dp.c | 50 ++- drivers/gpu/drm/nouveau/nvkm/engine/disp/dp.c | 137 +++--- .../gpu/drm/nouveau/nvkm/engine/disp/nv50.c | 13 --

[Nouveau] [PATCH 32/44] drm/nouveau/disp: add dp train method

2023-09-14 Thread Ben Skeggs
From: Ben Skeggs - passes DPCD information from DRM to NVKM - removes NVKM's own sink caps handling - link still trained from supervisor, more patches to come Signed-off-by: Ben Skeggs --- drivers/gpu/drm/nouveau/dispnv50/disp.c | 6 +- drivers/gpu/drm/nouveau/include/nvif/if0012.h |

[Nouveau] [PATCH 34/44] drm/nouveau/disp: add support for post-LT adjust

2023-09-14 Thread Ben Skeggs
From: Ben Skeggs - fixes regression from previous commit Signed-off-by: Ben Skeggs --- drivers/gpu/drm/nouveau/include/nvif/if0012.h | 11 +++ drivers/gpu/drm/nouveau/include/nvif/outp.h | 1 + drivers/gpu/drm/nouveau/nouveau_dp.c | 72 ++-

[Nouveau] [PATCH 35/44] drm/nouveau/disp: add dp sst config method

2023-09-14 Thread Ben Skeggs
From: Ben Skeggs This is presently unused on HW, we read a bunch of regs and calculate the watermark during the second supervisor interrupt. I don't want to change this yet as I need to re-remember how older HW works exactly, but RM wants this info via RPC. Signed-off-by: Ben Skeggs ---

[Nouveau] [PATCH 37/44] drm/nouveau/disp: move outp/conn construction to chipset code

2023-09-14 Thread Ben Skeggs
From: Ben Skeggs - pre-nv5x doesn't use any of this, has its own version DRM-side - preparation for GSP-RM Signed-off-by: Ben Skeggs --- .../gpu/drm/nouveau/nvkm/engine/disp/base.c | 117 + .../gpu/drm/nouveau/nvkm/engine/disp/nv50.c | 122 +- 2 files

[Nouveau] [PATCH 38/44] drm/nouveau/disp: move outp init/fini paths to chipset code

2023-09-14 Thread Ben Skeggs
From: Ben Skeggs - pre-nv5x doesn't use any of this - preparation for GSP-RM Signed-off-by: Ben Skeggs --- .../gpu/drm/nouveau/nvkm/engine/disp/base.c | 31 +++ .../gpu/drm/nouveau/nvkm/engine/disp/conn.c | 10 -- .../gpu/drm/nouveau/nvkm/engine/disp/conn.h | 2 --

[Nouveau] [PATCH 36/44] drm/nouveau/disp: add dp mst id get/put methods

2023-09-14 Thread Ben Skeggs
From: Ben Skeggs - preparation for GSP-RM Signed-off-by: Ben Skeggs --- drivers/gpu/drm/nouveau/dispnv50/disp.c | 32 --- drivers/gpu/drm/nouveau/dispnv50/head.h | 1 + drivers/gpu/drm/nouveau/dispnv50/headc57d.c | 14

[Nouveau] [PATCH 39/44] drm/nouveau/kms/nv50-: create heads based on nvkm head mask

2023-09-14 Thread Ben Skeggs
From: Ben Skeggs No need to go poking HW directly, and probably shouldn't on GSP-RM. Signed-off-by: Ben Skeggs --- drivers/gpu/drm/nouveau/dispnv50/disp.c | 18 +++--- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/drivers/gpu/drm/nouveau/dispnv50/disp.c

[Nouveau] [PATCH 17/44] drm/nouveau/kms/nv50-: keep output state around until modeset complete

2023-09-14 Thread Ben Skeggs
From: Ben Skeggs - we'll want this info post-UPDATE for later patches Signed-off-by: Ben Skeggs --- drivers/gpu/drm/nouveau/dispnv50/disp.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/nouveau/dispnv50/disp.c

[Nouveau] [PATCH 18/44] drm/nouveau/kms/nv50-: move audio enable post-modeset

2023-09-14 Thread Ben Skeggs
From: Ben Skeggs - adds tracking for post-UPDATE modeset operations, similar to mst[mo]'s - audio won't work on RM without this - we should probably have been doing this anyway Signed-off-by: Ben Skeggs --- drivers/gpu/drm/nouveau/dispnv50/disp.c | 35 ++---

[Nouveau] [PATCH 19/44] drm/nouveau/disp: add output hdmi config method

2023-09-14 Thread Ben Skeggs
From: Ben Skeggs - was previously part of acquire() - preparation for GSP-RM Signed-off-by: Ben Skeggs --- drivers/gpu/drm/nouveau/dispnv50/disp.c | 10 ++--- drivers/gpu/drm/nouveau/include/nvif/if0012.h | 28 -- drivers/gpu/drm/nouveau/include/nvif/outp.h | 5 ++-

[Nouveau] [PATCH 23/44] drm/nouveau/disp: add output backlight control methods

2023-09-14 Thread Ben Skeggs
From: Ben Skeggs - preparation for GSP-RM Signed-off-by: Ben Skeggs --- drivers/gpu/drm/nouveau/include/nvif/if0012.h | 17 drivers/gpu/drm/nouveau/include/nvif/outp.h | 3 + drivers/gpu/drm/nouveau/nouveau_backlight.c | 90 ++- drivers/gpu/drm/nouveau/nvif/outp.c

[Nouveau] [PATCH 24/44] drm/nouveau/disp: add output lvds config method

2023-09-14 Thread Ben Skeggs
From: Ben Skeggs - was previously part of acquire() Signed-off-by: Ben Skeggs --- drivers/gpu/drm/nouveau/dispnv50/disp.c | 2 +- drivers/gpu/drm/nouveau/include/nvif/if0012.h| 16 ++-- drivers/gpu/drm/nouveau/include/nvif/outp.h | 3 ++-

[Nouveau] [PATCH 25/44] drm/nouveau/disp: add hdmi audio hal function

2023-09-14 Thread Ben Skeggs
From: Ben Skeggs This just adds a hook for RM to use, HW paths remain untouched, but should probably be cleaned up to use this too at some point. Signed-off-by: Ben Skeggs --- drivers/gpu/drm/nouveau/nvkm/engine/disp/ior.h | 1 + drivers/gpu/drm/nouveau/nvkm/engine/disp/uoutp.c | 10

[Nouveau] [PATCH 26/44] drm/nouveau/disp: move dp aux pwr method to HAL

2023-09-14 Thread Ben Skeggs
From: Ben Skeggs - preparation for GSP-RM Signed-off-by: Ben Skeggs --- drivers/gpu/drm/nouveau/nvkm/engine/disp/dp.c| 9 + drivers/gpu/drm/nouveau/nvkm/engine/disp/outp.h | 4 drivers/gpu/drm/nouveau/nvkm/engine/disp/uoutp.c | 6 +++--- 3 files changed, 16 insertions(+), 3

[Nouveau] [PATCH 27/44] drm/nouveau/disp: add dp aux xfer method

2023-09-14 Thread Ben Skeggs
From: Ben Skeggs - preparation for GSP-RM Signed-off-by: Ben Skeggs --- drivers/gpu/drm/nouveau/dispnv50/disp.c | 32 +-- drivers/gpu/drm/nouveau/include/nvif/if0012.h | 12 +++ drivers/gpu/drm/nouveau/include/nvif/outp.h | 2 ++

[Nouveau] [PATCH 28/44] drm/nouveau/disp: add dp rates method

2023-09-14 Thread Ben Skeggs
From: Ben Skeggs - moves building of link rates table from NVKM to DRM - preparing to move link training out of supervisor Signed-off-by: Ben Skeggs --- drivers/gpu/drm/nouveau/include/nvif/if0012.h | 13 ++ drivers/gpu/drm/nouveau/include/nvif/outp.h | 8 +

[Nouveau] [PATCH 20/44] drm/nouveau/disp: move hdmi disable out of release()

2023-09-14 Thread Ben Skeggs
From: Ben Skeggs - release() is being moved post-modeset, preserve hdmi behaviour for now Signed-off-by: Ben Skeggs --- drivers/gpu/drm/nouveau/dispnv50/disp.c | 8 drivers/gpu/drm/nouveau/nouveau_encoder.h| 6 +-

[Nouveau] [PATCH 21/44] drm/nouveau/disp: release outputs post-modeset

2023-09-14 Thread Ben Skeggs
From: Ben Skeggs Prior to this commit, KMS would call release() prior to modeset, and the second supervisor interrupt would update SOR routing if needed. Now, KMS will call release() post-modeset and update routing immediately. - preparation for GSP-RM Signed-off-by: Ben Skeggs ---

[Nouveau] [PATCH 22/44] drm/nouveau/disp: remove SOR routing updates from supervisor

2023-09-14 Thread Ben Skeggs
From: Ben Skeggs - these shouldn't be necessary now, and are done in acquire()/release() - preparation for GSP-RM, where we don't control the supervisor Signed-off-by: Ben Skeggs --- drivers/gpu/drm/nouveau/nvkm/engine/disp/gf119.c | 1 - drivers/gpu/drm/nouveau/nvkm/engine/disp/gv100.c | 1 -

[Nouveau] [PATCH 29/44] drm/nouveau/kms/nv50-: split DP disable+enable into two modesets

2023-09-14 Thread Ben Skeggs
From: Ben Skeggs Link training can finally be moved out of the supervisor sequence, but first we need to split DP modesets into separate disable and enable sequences to be able to perform link training between them instead. - preparation for GSP-RM Signed-off-by: Ben Skeggs ---

[Nouveau] [PATCH 30/44] drm/nouveau/kms/nv50-: flush mst disables together

2023-09-14 Thread Ben Skeggs
From: Ben Skeggs - fixes some issues tearing down modes on tiled displays Signed-off-by: Ben Skeggs --- drivers/gpu/drm/nouveau/dispnv50/disp.c | 11 +-- drivers/gpu/drm/nouveau/dispnv50/disp.h | 1 - 2 files changed, 1 insertion(+), 11 deletions(-) diff --git

[Nouveau] [PATCH 31/44] drm/nouveau/kms/nv50-: fixup sink D3 before tearing down link

2023-09-14 Thread Ben Skeggs
From: Ben Skeggs - fixes bug preventing this on SST - implement for MST Signed-off-by: Ben Skeggs --- drivers/gpu/drm/nouveau/dispnv50/disp.c | 13 +++-- drivers/gpu/drm/nouveau/nouveau_dp.c | 15 +++ drivers/gpu/drm/nouveau/nouveau_encoder.h | 1 + 3 files

[Nouveau] [PATCH 40/44] drm/nouveau/kms/nv50-: create heads after outps/conns

2023-09-14 Thread Ben Skeggs
From: Ben Skeggs - output info will be used later to determine MST support Signed-off-by: Ben Skeggs --- drivers/gpu/drm/nouveau/dispnv50/disp.c | 64 - 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/drivers/gpu/drm/nouveau/dispnv50/disp.c

[Nouveau] [PATCH 05/44] drm/nouveau/kms/nv50-: fix mst payload alloc fail crashing evo

2023-09-14 Thread Ben Skeggs
From: Ben Skeggs Programming -1 (vc_start_slot, if alloc fails) into HW probably isn't the best idea. Signed-off-by: Ben Skeggs --- drivers/gpu/drm/nouveau/dispnv50/disp.c | 11 +++ 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/nouveau/dispnv50/disp.c

[Nouveau] [PATCH 09/44] drm/nouveau/disp: rename internal output acquire/release functions

2023-09-14 Thread Ben Skeggs
From: Ben Skeggs These will be made static later in the patch series, after the code that uses them has been cleaned up in preparation for GSP-RM support. Signed-off-by: Ben Skeggs --- drivers/gpu/drm/nouveau/nvkm/engine/disp/outp.c | 10 --

[Nouveau] [PATCH 06/44] drm/nouveau/disp: rearrange output methods

2023-09-14 Thread Ben Skeggs
From: Ben Skeggs - preparation for a bunch of API changes, to make diffs prettier Signed-off-by: Ben Skeggs --- drivers/gpu/drm/nouveau/include/nvif/if0012.h | 19 +++ .../gpu/drm/nouveau/nvkm/engine/disp/uoutp.c | 12 ++-- 2 files changed, 17 insertions(+), 14

[Nouveau] [PATCH 10/44] drm/nouveau/kms: Add INHERIT ioctl to nvkm/nvif for reading IOR state

2023-09-14 Thread Ben Skeggs
From: Lyude Paul Now that we're supporting things like Ada and the GSP, there's situations where we really need to actually know the display state that we're starting with when loading the driver in order to prevent breaking GSP expectations. The first step in doing this is making it so that we

[Nouveau] [PATCH 14/44] drm/nouveau/disp: update SOR routing immediately on acquire()

2023-09-14 Thread Ben Skeggs
From: Ben Skeggs - was previously delayed until second supervisor interrupt Signed-off-by: Ben Skeggs --- drivers/gpu/drm/nouveau/nvkm/engine/disp/outp.c | 2 +- drivers/gpu/drm/nouveau/nvkm/engine/disp/uoutp.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git

[Nouveau] [PATCH 15/44] drm/nouveau/kms/nv50-: pull some common init out of OR-specific code

2023-09-14 Thread Ben Skeggs
From: Ben Skeggs - cleanup before additional changes Signed-off-by: Ben Skeggs --- drivers/gpu/drm/nouveau/dispnv50/disp.c | 69 --- drivers/gpu/drm/nouveau/nouveau_encoder.h | 2 + 2 files changed, 38 insertions(+), 33 deletions(-) diff --git

[Nouveau] [PATCH 13/44] drm/nouveau/disp: add acquire_sor/pior()

2023-09-14 Thread Ben Skeggs
From: Ben Skeggs - preparing to move protocol-specific args out of acquire() again - avoid re-acquiring acquired output, will matter when enforced later - sor/pior done at same time due to shared tmds/dp handling Signed-off-by: Ben Skeggs --- drivers/gpu/drm/nouveau/dispnv50/disp.c | 15

[Nouveau] [PATCH 16/44] drm/nouveau/kms/nv50-: remove nv_encoder.audio.connector

2023-09-14 Thread Ben Skeggs
From: Ben Skeggs - use nv_encoder.conn instead, outp->conn never changes Signed-off-by: Ben Skeggs --- drivers/gpu/drm/nouveau/dispnv50/disp.c | 4 +--- drivers/gpu/drm/nouveau/nouveau_encoder.h | 1 - 2 files changed, 1 insertion(+), 4 deletions(-) diff --git

[Nouveau] [PATCH 07/44] drm/nouveau/disp: add output detect method

2023-09-14 Thread Ben Skeggs
From: Ben Skeggs This will check the relevant hotplug pin and skip the DDC probe we currently do if a display is present. - preparation for GSP-RM. Signed-off-by: Ben Skeggs --- drivers/gpu/drm/nouveau/include/nvif/conn.h | 5 -- drivers/gpu/drm/nouveau/include/nvif/if0011.h | 11

[Nouveau] [PATCH 08/44] drm/nouveau/disp: add output method to fetch edid

2023-09-14 Thread Ben Skeggs
From: Ben Skeggs - needed to support TMDS EDID on RM Signed-off-by: Ben Skeggs --- drivers/gpu/drm/nouveau/include/nvif/if0012.h | 10 +++ drivers/gpu/drm/nouveau/include/nvif/outp.h | 1 + drivers/gpu/drm/nouveau/nouveau_connector.c | 22 --

[Nouveau] [PATCH 01/44] drm/nouveau/devinit/tu102-: remove attempt at loading PreOS

2023-09-14 Thread Ben Skeggs
From: Ben Skeggs >From Turing, HW will already have handled this and locked-down the falcon before we get control. So this *should* be a no-op. Signed-off-by: Ben Skeggs --- drivers/gpu/drm/nouveau/nvkm/subdev/devinit/tu102.c | 12 ++-- 1 file changed, 2 insertions(+), 10

[Nouveau] [PATCH 02/44] drm/nouveau/imem: support allocations not preserved across suspend

2023-09-14 Thread Ben Skeggs
From: Ben Skeggs Will initially be used to tag some large grctx allocations which don't need to be saved, to speedup suspend/resume. Signed-off-by: Ben Skeggs --- .../drm/nouveau/include/nvkm/core/memory.h| 1 + .../drm/nouveau/include/nvkm/subdev/instmem.h | 2 +-

[Nouveau] [PATCH 00/44] drm/nouveau: display rework to support GSP-RM

2023-09-14 Thread Ben Skeggs
From: Ben Skeggs The primary issue being tackled here is that, for historical reasons (we didn't know any better / couldn't make it work reliably otherwise), some operations (SOR routing, DP link training) were performed during the 2nd HW supervisor interrupt. We don't have control of the

[Nouveau] [PATCH 03/44] drm/nouveau/gr/gf100-: lose contents of global ctxbufs across suspend

2023-09-14 Thread Ben Skeggs
From: Ben Skeggs Some of these buffers are quite large, and there's no need to preserve them across suspend. Mark the contents as lost to speedup suspend/resume. Signed-off-by: Ben Skeggs --- drivers/gpu/drm/nouveau/nvkm/engine/gr/gf100.c | 10 +- 1 file changed, 5 insertions(+), 5

[Nouveau] [PATCH 04/44] drm/nouveau/mmu/gp100-: always invalidate TLBs at CACHE_LEVEL_ALL

2023-09-14 Thread Ben Skeggs
From: Ben Skeggs Fixes some issues when running on top of RM. Signed-off-by: Ben Skeggs --- drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmmgp100.c | 2 +- drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmmtu102.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git

[Nouveau] [PATCH 11/44] drm/nouveau/disp: shuffle to make upcoming diffs prettier

2023-09-14 Thread Ben Skeggs
From: Ben Skeggs - preparing to move protocol-specific args out of acquire() again - no code changes Signed-off-by: Ben Skeggs --- drivers/gpu/drm/nouveau/nvif/outp.c | 106 +- .../gpu/drm/nouveau/nvkm/engine/disp/uoutp.c | 74 ++-- 2 files changed, 91

[Nouveau] [PATCH 12/44] drm/nouveau/disp: add acquire_dac()

2023-09-14 Thread Ben Skeggs
From: Ben Skeggs - preparing to move protocol-specific args out of acquire() again - avoid re-acquiring acquired output, will matter when enforced later - this one is basically just a rename Signed-off-by: Ben Skeggs --- drivers/gpu/drm/nouveau/dispnv50/disp.c | 3 ++-

[Nouveau] [PATCH 41/44] drm/nouveau/kms/nv50-: name aux channels after their connector

2023-09-14 Thread Ben Skeggs
From: Ben Skeggs - removes use of VBIOS data for naming - preparation for GSP-RM Signed-off-by: Ben Skeggs --- drivers/gpu/drm/nouveau/nouveau_connector.c | 25 - 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/drivers/gpu/drm/nouveau/nouveau_connector.c

[Nouveau] [PATCH 43/44] drm/nouveau/kms/nv50-: create outputs based on nvkm info

2023-09-14 Thread Ben Skeggs
From: Ben Skeggs - preparation for GSP-RM Signed-off-by: Ben Skeggs --- drivers/gpu/drm/nouveau/dispnv50/disp.c | 97 ++- drivers/gpu/drm/nouveau/dispnv50/disp.h | 2 - drivers/gpu/drm/nouveau/include/nvif/if0012.h | 31 +-

[Nouveau] [PATCH 44/44] drm/nouveau/kms/nv50-: disable dcb parsing

2023-09-14 Thread Ben Skeggs
From: Ben Skeggs - nvkm should provide all this info now - preparation for GSP-RM Signed-off-by: Ben Skeggs --- drivers/gpu/drm/nouveau/nouveau_bios.c| 8 +--- drivers/gpu/drm/nouveau/nouveau_display.c | 8 drivers/gpu/drm/nouveau/nvif/disp.c | 2 +- 3 files changed, 10

Re: [Nouveau] [PATCH drm-misc-next v3 6/7] drm/gpuvm: generalize dma_resv/extobj handling and GEM validation

2023-09-14 Thread Thomas Hellström
On Thu, 2023-09-14 at 19:25 +0200, Danilo Krummrich wrote: > On 9/14/23 19:21, Thomas Hellström wrote: > > On Thu, 2023-09-14 at 18:36 +0200, Danilo Krummrich wrote: > > > On 9/14/23 15:48, Thomas Hellström wrote: > > > > Hi, Danilo > > > > > > > > Some additional minor comments as xe conversion

Re: [Nouveau] [PATCH drm-misc-next v3 6/7] drm/gpuvm: generalize dma_resv/extobj handling and GEM validation

2023-09-14 Thread Thomas Hellström
On 9/14/23 10:20, Boris Brezillon wrote: On Wed, 13 Sep 2023 15:22:56 +0200 Thomas Hellström wrote: On 9/13/23 13:33, Boris Brezillon wrote: On Wed, 13 Sep 2023 12:39:01 +0200 Thomas Hellström wrote: Hi, On 9/13/23 09:19, Boris Brezillon wrote: On Wed, 13 Sep 2023 17:05:42 +1000

Re: [Nouveau] [PATCH drm-misc-next v3 6/7] drm/gpuvm: generalize dma_resv/extobj handling and GEM validation

2023-09-14 Thread Thomas Hellström
Hi, On 9/14/23 13:54, Boris Brezillon wrote: On Thu, 14 Sep 2023 12:45:44 +0200 Thomas Hellström wrote: On 9/14/23 10:20, Boris Brezillon wrote: On Wed, 13 Sep 2023 15:22:56 +0200 Thomas Hellström wrote: On 9/13/23 13:33, Boris Brezillon wrote: On Wed, 13 Sep 2023 12:39:01 +0200

Re: [Nouveau] [PATCH drm-misc-next v3 6/7] drm/gpuvm: generalize dma_resv/extobj handling and GEM validation

2023-09-14 Thread Danilo Krummrich
On 9/13/23 14:16, Danilo Krummrich wrote: And validate() can remove it while still holding all dma-resv locks, neat! However, what if two tasks are trying to lock the VA space concurrently? What do we do when the drm_gpuvm_bo's refcount drops to zero in drm_gpuva_unlink()? Are we guaranteed

Re: [Nouveau] [PATCH drm-misc-next v3 6/7] drm/gpuvm: generalize dma_resv/extobj handling and GEM validation

2023-09-14 Thread Thomas Hellström
On 9/14/23 12:57, Danilo Krummrich wrote: On 9/13/23 14:16, Danilo Krummrich wrote: And validate() can remove it while still holding all dma-resv locks, neat! However, what if two tasks are trying to lock the VA space concurrently? What do we do when the drm_gpuvm_bo's refcount drops to

Re: [Nouveau] [PATCH drm-misc-next v3 6/7] drm/gpuvm: generalize dma_resv/extobj handling and GEM validation

2023-09-14 Thread Thomas Hellström
Hi, Danilo Some additional minor comments as xe conversion progresses. On 9/9/23 17:31, Danilo Krummrich wrote: So far the DRM GPUVA manager offers common infrastructure to track GPU VA allocations and mappings, generically connect GPU VA mappings to their backing buffers and perform more

[PATCH] drm/nouveau/nvif: refactor deprecated strncpy

2023-09-14 Thread Justin Stitt
- base-commit: 3669558bdf354cd352be955ef2764cde6a9bf5ec change-id: 20230914-strncpy-drivers-gpu-drm-nouveau-nvif-client-c-82b023c36953 Best regards, -- Justin Stitt

[PATCH] drm/nouveau/pm: refactor deprecated strncpy

2023-09-14 Thread Justin Stitt
} if (++si < source_nr) { --- base-commit: 3669558bdf354cd352be955ef2764cde6a9bf5ec change-id: 20230914-strncpy-drivers-gpu-drm-nouveau-nvkm-engine-pm-base-c-38bf9c78bc0f Best regards, -- Justin Stitt

[PATCH] drm/nouveau/core: refactor deprecated strncpy

2023-09-14 Thread Justin Stitt
name, sizeof(cname)); i = strlen(cname); while (i) { --i; --- base-commit: 3669558bdf354cd352be955ef2764cde6a9bf5ec change-id: 20230914-strncpy-drivers-gpu-drm-nouveau-nvkm-core-firmware-c-791223838b72 Best regards, -- Justin Stitt

Re: [Nouveau] [PATCH drm-misc-next v3 6/7] drm/gpuvm: generalize dma_resv/extobj handling and GEM validation

2023-09-14 Thread Thomas Hellström
On Thu, 2023-09-14 at 18:36 +0200, Danilo Krummrich wrote: > On 9/14/23 15:48, Thomas Hellström wrote: > > Hi, Danilo > > > > Some additional minor comments as xe conversion progresses. > > > > On 9/9/23 17:31, Danilo Krummrich wrote: > > > So far the DRM GPUVA manager offers common

Re: [Nouveau] [PATCH drm-misc-next v3 6/7] drm/gpuvm: generalize dma_resv/extobj handling and GEM validation

2023-09-14 Thread Danilo Krummrich
On 9/14/23 15:48, Thomas Hellström wrote: Hi, Danilo Some additional minor comments as xe conversion progresses. On 9/9/23 17:31, Danilo Krummrich wrote: So far the DRM GPUVA manager offers common infrastructure to track GPU VA allocations and mappings, generically connect GPU VA mappings to

Re: [Nouveau] [PATCH drm-misc-next v3 6/7] drm/gpuvm: generalize dma_resv/extobj handling and GEM validation

2023-09-14 Thread Danilo Krummrich
On 9/14/23 13:32, Thomas Hellström wrote: On 9/14/23 12:57, Danilo Krummrich wrote: On 9/13/23 14:16, Danilo Krummrich wrote: And validate() can remove it while still holding all dma-resv locks, neat! However, what if two tasks are trying to lock the VA space concurrently? What do we do

Re: [Nouveau] [PATCH drm-misc-next v3 6/7] drm/gpuvm: generalize dma_resv/extobj handling and GEM validation

2023-09-14 Thread Danilo Krummrich
On 9/14/23 19:13, Thomas Hellström wrote: On Thu, 2023-09-14 at 17:27 +0200, Danilo Krummrich wrote: On 9/14/23 13:32, Thomas Hellström wrote: On 9/14/23 12:57, Danilo Krummrich wrote: On 9/13/23 14:16, Danilo Krummrich wrote: And validate() can remove it while still holding all dma-

Re: [Nouveau] [PATCH drm-misc-next v3 6/7] drm/gpuvm: generalize dma_resv/extobj handling and GEM validation

2023-09-14 Thread Danilo Krummrich
On 9/14/23 19:21, Thomas Hellström wrote: On Thu, 2023-09-14 at 18:36 +0200, Danilo Krummrich wrote: On 9/14/23 15:48, Thomas Hellström wrote: Hi, Danilo Some additional minor comments as xe conversion progresses. On 9/9/23 17:31, Danilo Krummrich wrote: So far the DRM GPUVA manager offers

Re: [Nouveau] [PATCH drm-misc-next v3 6/7] drm/gpuvm: generalize dma_resv/extobj handling and GEM validation

2023-09-14 Thread Thomas Hellström
On Thu, 2023-09-14 at 17:27 +0200, Danilo Krummrich wrote: > On 9/14/23 13:32, Thomas Hellström wrote: > > > > On 9/14/23 12:57, Danilo Krummrich wrote: > > > On 9/13/23 14:16, Danilo Krummrich wrote: > > > > > > > > > > > > > > > And validate() can remove it while still holding all dma- > > >

Re: [Nouveau] [PATCH] drm/nouveau/pm: refactor deprecated strncpy

2023-09-14 Thread Kees Cook
On Thu, Sep 14, 2023 at 10:17:08PM +, Justin Stitt wrote: > `strncpy` is deprecated for use on NUL-terminated destination strings [1]. > > We should prefer more robust and less ambiguous string interfaces. > > A suitable replacement is `strscpy` [2] due to the fact that it guarantees >

Re: [PATCH] drm/nouveau/nvif: refactor deprecated strncpy

2023-09-14 Thread Kees Cook
t_ctor(>master.base, cli->name, device, >base); So we'll always be %NUL terminated. Therefore, yes, conversion looks good: Reviewed-by: Kees Cook Thanks! -Kees > > --- > base-commit: 3669558bdf354cd352be955ef2764cde6a9bf5ec > change-id: 20230914-strncpy-drivers-gpu-drm-nouveau-nvif-client-c-82b023c36953 > > Best regards, > -- > Justin Stitt > -- Kees Cook

Re: [PATCH] drm/nouveau/core: refactor deprecated strncpy

2023-09-14 Thread Kees Cook
ile (i) { > --i; Yup, consumed by strlen() and snprintf(). Looks like a standard conversion. :) Reviewed-by: Kees Cook -Kees > > --- > base-commit: 3669558bdf354cd352be955ef2764cde6a9bf5ec > change-id: > 20230914-strncpy-drivers-gpu-drm-nouveau-nvkm-core-firmware-c-791223838b72 > > Best regards, > -- > Justin Stitt > -- Kees Cook