[PATCH] drm/amd/display: Fix memory leak in dm_sw_fini()

2024-02-13 Thread Armin Wolf
After destroying dmub_srv, the memory associated with it is not freed, causing a memory leak: unreferenced object 0x896302b45800 (size 1024): comm "(udev-worker)", pid 222, jiffies 4294894636 hex dump (first 32 bytes): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

Re: [PATCH v2] drm/amd/display: Add NULL test for 'timing generator' in 'dcn21_set_pipe()'

2024-02-13 Thread Kees Cook
On Thu, Feb 01, 2024 at 03:28:45PM +0530, Srinivasan Shanmugam wrote: > In "u32 otg_inst = pipe_ctx->stream_res.tg->inst;" > pipe_ctx->stream_res.tg could be NULL, it is relying on the caller to > ensure the tg is not NULL. > > Fixes: 474ac4a875ca ("drm/amd/display: Implement some asic specific ab

[PATCH 1/2] drm/buddy: Fix alloc_range() error handling code

2024-02-13 Thread Arunpravin Paneer Selvam
Few users have observed display corruption when they boot the machine to KDE Plasma or playing games. We have root caused the problem that whenever alloc_range() couldn't find the required memory blocks the function was returning SUCCESS in some of the corner cases. The right approach would be if

[PATCH 2/2] drm/tests/drm_buddy: add alloc_contiguous test

2024-02-13 Thread Arunpravin Paneer Selvam
Sanity check DRM_BUDDY_CONTIGUOUS_ALLOCATION. References: https://gitlab.freedesktop.org/drm/amd/-/issues/3097 Signed-off-by: Matthew Auld Reviewed-by: Arunpravin Paneer Selvam Cc: Arunpravin Paneer Selvam Cc: Limonciello Cc: Christian König Signed-off-by: Arunpravin Paneer Selvam --- drive

Re: [PATCH 2/2] drm/tests/drm_buddy: add alloc_contiguous test

2024-02-13 Thread Matthew Auld
On 13/02/2024 13:52, Arunpravin Paneer Selvam wrote: Sanity check DRM_BUDDY_CONTIGUOUS_ALLOCATION. References: https://gitlab.freedesktop.org/drm/amd/-/issues/3097 Signed-off-by: Matthew Auld Reviewed-by: Arunpravin Paneer Selvam It looks like you changed the patch authorship here. Cc: Aru

RE: [PATCH v2] drm/amd/pm: Allow setting max UCLK on SMU v13.0.6

2024-02-13 Thread Kamal, Asad
[AMD Official Use Only - General] Reviewed-by: Asad Kamal Tested-by: Asad Kamal Thanks & Regards Asad -Original Message- From: Lazar, Lijo Sent: Friday, February 9, 2024 1:21 PM To: amd-gfx@lists.freedesktop.org Cc: Zhang, Hawking ; Deucher, Alexander ; Kamal, Asad ; Ma, Le Subject

Re: [PATCH 2/2] drm/tests/drm_buddy: add alloc_contiguous test

2024-02-13 Thread Christian König
Am 13.02.24 um 15:28 schrieb Matthew Auld: On 13/02/2024 13:52, Arunpravin Paneer Selvam wrote: Sanity check DRM_BUDDY_CONTIGUOUS_ALLOCATION. References: https://gitlab.freedesktop.org/drm/amd/-/issues/3097 Signed-off-by: Matthew Auld Reviewed-by: Arunpravin Paneer Selvam It looks like you

[PATCH v2 0/6] dma-fence, drm, amdgpu new trace events

2024-02-13 Thread Pierre-Eric Pelloux-Prayer
This series adds new events to make it easier for tools like gpuvis or umr to graph the GPUs, kernel and applications activity. UMR patches using these events can be found here: https://gitlab.freedesktop.org/tomstdenis/umr/-/merge_requests/37 V1: https://patchwork.kernel.org/project/linux-media/

[PATCH v2 1/6] tracing, dma-buf: add a trace_dma_fence_sync_to event

2024-02-13 Thread Pierre-Eric Pelloux-Prayer
This new event can be used to trace where a given dma_fence is added as a dependency of some other work. I plan to use it in amdgpu. Signed-off-by: Pierre-Eric Pelloux-Prayer --- drivers/dma-buf/dma-fence.c | 1 + include/trace/events/dma_fence.h | 34 2 f

[PATCH v2 2/6] dma-buf/fence-chain: use trace_dma_fence_sync_to

2024-02-13 Thread Pierre-Eric Pelloux-Prayer
To inform tools about the relationship between the fences. Signed-off-by: Pierre-Eric Pelloux-Prayer --- drivers/dma-buf/dma-fence-chain.c | 4 1 file changed, 4 insertions(+) diff --git a/drivers/dma-buf/dma-fence-chain.c b/drivers/dma-buf/dma-fence-chain.c index 9663ba1bb6ac..a211b3d415

[PATCH v2 3/6] amdgpu: use trace_dma_fence_sync_to in amdgpu_fence_sync

2024-02-13 Thread Pierre-Eric Pelloux-Prayer
This makes it possible to understand the dependencies between jobs. Possible usage of this trace: * stuttering issues like Mesa !9189 * incorrect synchronization: I don't have a link for this one, but having these events was very useful to debug a virtio-gpu / native-context / radeonsi sync iss

[PATCH v2 4/6] drm/amdgpu: add BO clear event

2024-02-13 Thread Pierre-Eric Pelloux-Prayer
Useful to identify why sdma jobs are submitted. Signed-off-by: Pierre-Eric Pelloux-Prayer --- drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 2 ++ drivers/gpu/drm/amd/amdgpu/amdgpu_trace.h | 16 2 files changed, 18 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ob

[PATCH v2 5/6] drm/amdgpu: add a amdgpu_cs_ioctl2 event

2024-02-13 Thread Pierre-Eric Pelloux-Prayer
amdgpu_cs_ioctl already exists but serves a different purpose. amdgpu_cs_ioctl2 marks the beginning of the kernel processing of the ioctl which is useful for tools to map which events belong to the same submission (without this, the first event would be the amdgpu_bo_set_list ones). Signed-off-by

[PATCH v2 6/6] drm: add drm_mode_atomic_commit event

2024-02-13 Thread Pierre-Eric Pelloux-Prayer
With this and the dma_fence_sync_to event, a tool can draw the relationship between the compositing draw, the atomic commit, and vblank. An example on a 2 monitors system look like this: gnome-shell-1638[018] . 2571.905124: drm_mode_atomic_commit: file=245c3f0c, pid=1165, fl

Re: [PATCH v2 6/6] drm: add drm_mode_atomic_commit event

2024-02-13 Thread Steven Rostedt
On Tue, 13 Feb 2024 16:50:31 +0100 Pierre-Eric Pelloux-Prayer wrote: > @@ -1503,6 +1504,24 @@ int drm_mode_atomic_ioctl(struct drm_device *dev, > drm_mode_object_put(obj); > } > > + if (trace_drm_mode_atomic_commit_enabled()) { > + struct drm_crtc_state *crtc

[PATCH] drm/amdgpu: Allow secure submission on SDMAv4.4.2 rings

2024-02-13 Thread David Francis
This flag was accidentally left off of SDMAv4.4.2 when it was added. SDMAv4.4.2, like all other SDMA engines, does support secure submission. Signed-off-by: David Francis --- drivers/gpu/drm/amd/amdgpu/sdma_v4_4_2.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu

[PATCH] drm/amdgpu: Improve error checking in amdgpu_virt_rlcg_reg_rw (v2)

2024-02-13 Thread Victor Lu
The current error detection only looks for a timeout. This should be changed to also check scratch_reg1 for any errors returned from RLCG. v2: remove new error value Signed-off-by: Victor Lu --- drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c | 5 +++-- drivers/gpu/drm/amd/amdgpu/amdgpu_virt.h | 1 +

Re: [PATCH] drm/amdgpu: Allow secure submission on SDMAv4.4.2 rings

2024-02-13 Thread Alex Deucher
On Tue, Feb 13, 2024 at 1:58 PM David Francis wrote: > > This flag was accidentally left off of SDMAv4.4.2 when it was > added. SDMAv4.4.2, like all other SDMA engines, does support > secure submission. > > Signed-off-by: David Francis Acked-by: Alex Deucher > --- > drivers/gpu/drm/amd/amdgpu

Re: [PATCH 1/2] drm/amdkfd: update SIMD distribution algo for GFXIP 9.4.2 onwards

2024-02-13 Thread Felix Kuehling
On 2024-02-09 20:49, Rajneesh Bhardwaj wrote: In certain cooperative group dispatch scenarios the default SPI resource allocation may cause reduced per-CU workgroup occupancy. Set COMPUTE_RESOURCE_LIMITS.FORCE_SIMD_DIST=1 to mitigate soft hang scenarions. Suggested-by: Joseph Greathouse Signe

Re: [PATCH 2/2] drm/amdgpu: Fix implicit assumtion in gfx11 debug flags

2024-02-13 Thread Felix Kuehling
On 2024-02-09 20:49, Rajneesh Bhardwaj wrote: Gfx11 debug flags mask is currently set with an implicit assumption that no other mqd update flags exist. This needs to be fixed with newly introduced flag UPDATE_FLAG_IS_GWS by the previous patch. Signed-off-by: Rajneesh Bhardwaj Reviewed-by: Fel

Re: [PATCH 1/2] drm/amdkfd: update SIMD distribution algo for GFXIP 9.4.2 onwards

2024-02-13 Thread Bhardwaj, Rajneesh
On 2/13/2024 3:52 PM, Felix Kuehling wrote: On 2024-02-09 20:49, Rajneesh Bhardwaj wrote: In certain cooperative group dispatch scenarios the default SPI resource allocation may cause reduced per-CU workgroup occupancy. Set COMPUTE_RESOURCE_LIMITS.FORCE_SIMD_DIST=1 to mitigate soft hang scena

[Patch v2 1/2] drm/amdkfd: update SIMD distribution algo for GFXIP 9.4.2 onwards

2024-02-13 Thread Rajneesh Bhardwaj
In certain cooperative group dispatch scenarios the default SPI resource allocation may cause reduced per-CU workgroup occupancy. Set COMPUTE_RESOURCE_LIMITS.FORCE_SIMD_DIST=1 to mitigate soft hang scenarions. Suggested-by: Joseph Greathouse Signed-off-by: Rajneesh Bhardwaj --- * Change the enum

[Patch v2 2/2] drm/amdgpu: Fix implicit assumtion in gfx11 debug flags

2024-02-13 Thread Rajneesh Bhardwaj
Gfx11 debug flags mask is currently set with an implicit assumption that no other mqd update flags exist. This needs to be fixed with newly introduced flag UPDATE_FLAG_IS_GWS by the previous patch. Reviewed-by: Felix Kuehling Signed-off-by: Rajneesh Bhardwaj --- drivers/gpu/drm/amd/amdkfd/kfd_m

Re: [Patch v2 1/2] drm/amdkfd: update SIMD distribution algo for GFXIP 9.4.2 onwards

2024-02-13 Thread Felix Kuehling
On 2024-02-13 16:39, Rajneesh Bhardwaj wrote: In certain cooperative group dispatch scenarios the default SPI resource allocation may cause reduced per-CU workgroup occupancy. Set COMPUTE_RESOURCE_LIMITS.FORCE_SIMD_DIST=1 to mitigate soft hang scenarions. Suggested-by: Joseph Greathouse Signe

[PATCH v3] drm/amdkfd: Relocate TBA/TMA to opposite side of VM hole

2024-02-13 Thread Felix Kuehling
The TBA and TMA, along with an unused IB allocation, reside at low addresses in the VM address space. A stray VM fault which hits these pages must be serviced by making their page table entries invalid. The scheduler depends upon these pages being resident and fails, preventing a debugger from insp

[PATCH] drm/amdgpu: Do not program IH_CHICKEN in vega20_ih.c under SRIOV

2024-02-13 Thread Victor Lu
IH_CHICKEN is blocked for VF writes; this access should be skipped. Signed-off-by: Victor Lu --- drivers/gpu/drm/amd/amdgpu/vega20_ih.c | 38 ++ 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/vega20_ih.c b/drivers/gpu/drm/amd/a

[PATCH 0/2] drm/amd/display: clean codestyle errors

2024-02-13 Thread Joao Paulo Pereira da Silva
jppaulo (2): drm/amd/display: clean inconsistent indenting drm/amd/display: clean else not following close brace drivers/gpu/drm/amd/display/dc/core/dc.c | 6 +++--- drivers/gpu/drm/amd/display/dc/core/dc_link_enc_cfg.c | 3 +-- 2 files changed, 4 insertions(+), 5 deletions(-) -

[PATCH 1/2] drm/amd/display: clean inconsistent indenting

2024-02-13 Thread Joao Paulo Pereira da Silva
From: jppaulo Clean some wrong indenting that throw errors in checkpatch. Signed-off-by: Joao Paulo Pereira da Silva --- drivers/gpu/drm/amd/display/dc/core/dc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/amd/display/dc/core/dc.c b/drivers/gpu/dr

[PATCH 2/2] drm/amd/display: clean else not following close brace

2024-02-13 Thread Joao Paulo Pereira da Silva
From: jppaulo Put else statement in the same line and after the close brace. Signed-off-by: Joao Paulo Pereira da Silva --- drivers/gpu/drm/amd/display/dc/core/dc_link_enc_cfg.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_link_en

Coverity: jpeg_v4_0_5_start(): Code maintainability issues

2024-02-13 Thread coverity-bot
Hello! This is an experimental semi-automated report about issues detected by Coverity from a scan of next-20240213 as part of the linux-next scan project: https://scan.coverity.com/projects/linux-next-weekly-scan You're getting this email because you were associated with the identified lin

[PATCH 1/2] drm/buddy: Fix alloc_range() error handling code

2024-02-13 Thread Arunpravin Paneer Selvam
Few users have observed display corruption when they boot the machine to KDE Plasma or playing games. We have root caused the problem that whenever alloc_range() couldn't find the required memory blocks the function was returning SUCCESS in some of the corner cases. The right approach would be if

[PATCH 2/2] drm/tests/drm_buddy: add alloc_contiguous test

2024-02-13 Thread Arunpravin Paneer Selvam
From: Matthew Auld Sanity check DRM_BUDDY_CONTIGUOUS_ALLOCATION. References: https://gitlab.freedesktop.org/drm/amd/-/issues/3097 Signed-off-by: Matthew Auld Cc: Arunpravin Paneer Selvam Cc: Limonciello Cc: Christian König Reviewed-by: Arunpravin Paneer Selvam Signed-off-by: Arunpravin Pane