[PATCH] drm/amdgpu: optimize ACA log print

2024-10-25 Thread Yang Wang
- skip to print CE ACA log. - optimize ACA log print for MCA. Signed-off-by: Yang Wang --- drivers/gpu/drm/amd/amdgpu/amdgpu_mca.c | 21 - 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_mca.c b/drivers/gpu/drm/amd/amdgpu/amdgp

[PATCH 2/4] drm/amdgpu: stop tracking visible memory stats

2024-10-25 Thread Tvrtko Ursulin
From: Yunxiang Li Since on modern systems all of vram can be made visible anyways, to simplify the new implementation, drops tracking how much memory is visible for now. If this is really needed we can add it back on top of the new implementation, or just report all the BOs as visible. Signed-of

[PATCH v3 2/2] drm/amdgpu: clean up the suspend_complete

2024-10-25 Thread Prike Liang
To check the status of S3 suspend completion, use the PM core pm_suspend_global_flags bit(1) to detect S3 abort events. Therefore, clean up the AMDGPU driver's private flag suspend_complete. Signed-off-by: Prike Liang --- drivers/gpu/drm/amd/amdgpu/amdgpu.h | 2 -- drivers/gpu/drm/amd/amdgp

[PATCH 1/2] drm/amdgpu: add userq specific kernel config for fence ioctls

2024-10-25 Thread Arunpravin Paneer Selvam
Keep the user queue fence signal and wait IOCTLs in the kernel config CONFIG_DRM_AMDGPU_NAVI3X_USERQ. Signed-off-by: Arunpravin Paneer Selvam --- drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 4 drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c | 16 2 files changed, 20

[PATCH 21/29] drm/amdgpu: sw_init for each vcn instance

2024-10-25 Thread boyuan.zhang
From: Boyuan Zhang Pass instance parameter to amdgpu_vcn_sw_init(), and perform sw init ONLY for the given vcn instance, instead of for all vcn instances. Modify each vcn generation accordingly. Signed-off-by: Boyuan Zhang --- drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c | 83 --

Re: [PATCH 0/2] drm: Treewide plane/crtc legacy state sweeping

2024-10-25 Thread Ville Syrjälä
On Wed, Oct 02, 2024 at 09:21:58PM +0300, Ville Syrjala wrote: > From: Ville Syrjälä > > An attempt to hide the drm_plane/crtc legacy state better. > > This also highlights the fact that a lot of supposedly > atomic drivers are poking around in the legacy crtc state, > which is rather questionab

Re: [PATCH] drm/amdgpu: add get_gfx_shadow_info callback for gfx12

2024-10-25 Thread Alex Deucher
On Thu, Oct 24, 2024 at 12:59 PM Shashank Sharma wrote: > > This callback gets the size and alignment requirements > for the gfx shadow buffer for preemption. > > Cc: Alex Deucher > Cc: Christian Koenig > Signed-off-by: Shashank Sharma Reviewed-by: Alex Deucher > --- > drivers/gpu/drm/amd/a

Re: [PATCH 2/2] drm: remove driver date from struct drm_driver and all drivers

2024-10-25 Thread Simon Ser
Acked-by: Simon Ser

[PATCH 04/29] drm/amd/pm: add inst to set_powergating_by_smu

2024-10-25 Thread boyuan.zhang
From: Boyuan Zhang Add an instance parameter to set_powergating_by_smu() function, and re-write all amd_pm functions accordingly. Then use the instance to call smu_dpm_set_vcn_enable(). v2: remove duplicated functions. remove for-loop in smu_dpm_set_power_gate(), and temporarily move it to to a

Re: [PATCH] drm/amdgpu: optimize ACA log print

2024-10-25 Thread Lazar, Lijo
On 10/25/2024 12:49 PM, Yang Wang wrote: > - skip to print CE ACA log. > - optimize ACA log print for MCA. > > Signed-off-by: Yang Wang > --- > drivers/gpu/drm/amd/amdgpu/amdgpu_mca.c | 21 - > 1 file changed, 20 insertions(+), 1 deletion(-) > > diff --git a/drivers/gpu/d

[PATCH 1/4] drm/amdgpu: make drm-memory-* report resident memory

2024-10-25 Thread Tvrtko Ursulin
From: Yunxiang Li The old behavior reports the resident memory usage for this key and the documentation say so as well. However this was accidentally changed to include buffers that was evicted. Fixes: a2529f67e2ed ("drm/amdgpu: Use drm_print_memory_stats helper from fdinfo") Signed-off-by: Yun

RE: [PATCH] drm/amdgpu: optimize ACA log print

2024-10-25 Thread Wang, Yang(Kevin)
[AMD Official Use Only - AMD Internal Distribution Only] -Original Message- From: Lazar, Lijo Sent: Friday, October 25, 2024 3:25 PM To: Wang, Yang(Kevin) ; amd-gfx@lists.freedesktop.org Cc: Zhang, Hawking ; Zhou1, Tao Subject: Re: [PATCH] drm/amdgpu: optimize ACA log print On 10/25/2

Re: [PATCH 0/2] drm: Treewide plane/crtc legacy state sweeping

2024-10-25 Thread Dmitry Baryshkov
On Fri, 25 Oct 2024 at 10:46, Ville Syrjälä wrote: > > On Wed, Oct 02, 2024 at 09:21:58PM +0300, Ville Syrjala wrote: > > From: Ville Syrjälä > > > > An attempt to hide the drm_plane/crtc legacy state better. > > > > This also highlights the fact that a lot of supposedly > > atomic drivers are po

Re: [PATCH v3 2/2] drm/amdgpu: clean up the suspend_complete

2024-10-25 Thread Lazar, Lijo
On 10/24/2024 1:51 PM, Prike Liang wrote: > To check the status of S3 suspend completion, > use the PM core pm_suspend_global_flags bit(1) > to detect S3 abort events. Therefore, clean up > the AMDGPU driver's private flag suspend_complete. > > Signed-off-by: Prike Liang > --- > drivers/gpu/d

[PATCH] drm/amd/pm: Vangogh: Fix kernel memory out of bounds write

2024-10-25 Thread Tvrtko Ursulin
From: Tvrtko Ursulin KASAN reports that the GPU metrics table allocated in vangogh_tables_init() is not large enough for the memset done in smu_cmn_init_soft_gpu_metrics(). Condensed report follows: [ 33.861314] BUG: KASAN: slab-out-of-bounds in smu_cmn_init_soft_gpu_metrics+0x73/0x200 [amdgp

[PATCH 6.6 12/28] maple_tree: clean up inlines for some functions

2024-10-25 Thread Yu Kuai
From: "Liam R. Howlett" commit 271f61a8b41dcd86e1ecc2e0455bcc071bc7dde4 upstream. There are a few functions which were inlined but are somewhat too large to inline, so remove the inline key word. There are also several very small functions which are used in critical code sections which gcc was

[PATCH 6.6 13/28] maple_tree: add test for mtree_dup()

2024-10-25 Thread Yu Kuai
From: Peng Zhang commit a2587a7e8d37885dc063255f5400a66299b42e48 upstream. Add test for mtree_dup(). Test by duplicating different maple trees and then comparing the two trees. Includes tests for duplicating full trees and memory allocation failures on different nodes. Link: https://lkml.ker

[PATCH 2/2] drm: remove driver date from struct drm_driver and all drivers

2024-10-25 Thread Jani Nikula
We stopped using the driver initialized date in commit 7fb8af6798e8 ("drm: deprecate driver date") and (eventually) started returning "0" for drm_version ioctl instead. Finish the job, and remove the unused date member from struct drm_driver, its initialization from drivers, along with the common

[PATCH 6.6 24/28] libfs: Add simple_offset_empty()

2024-10-25 Thread Yu Kuai
From: Chuck Lever commit ecba88a3b32d733d41e27973e25b2bc580f64281 upstream. For simple filesystems that use directory offset mapping, rely strictly on the directory offset map to tell when a directory has no children. After this patch is applied, the emptiness test holds only the RCU read lock

[PATCH 6.6 10/28] maple_tree: use cached node end in mas_next()

2024-10-25 Thread Yu Kuai
From: "Liam R. Howlett" commit e9c52d8940cbfd94b36035bbebce7f55954e7728 upstream. When looking for the next entry, don't recalculate the node end as it is now tracked in the maple state. Link: https://lkml.kernel.org/r/20231101171629.3612299-6-liam.howl...@oracle.com Signed-off-by: Liam R. Howl

[PATCH v8 1/4] drm: Introduce device wedged event

2024-10-25 Thread Raag Jadav
Introduce device wedged event, which will notify userspace of wedged (hanged/unusable) state of the DRM device through a uevent. This is useful especially in cases where the device is no longer operating as expected even after a reset and has become unrecoverable from driver context. Purpose of thi

[PATCH v8 3/4] drm/xe: Use device wedged event

2024-10-25 Thread Raag Jadav
This was previously attempted as xe specific reset uevent but dropped in commit 77a0d4d1cea2 ("drm/xe/uapi: Remove reset uevent for now") as part of refactoring. Now that we have device wedged event provided by DRM core, make use of it and support both driver rebind and bus-reset based recovery. W

Re: [PATCH 2/2] drm: remove driver date from struct drm_driver and all drivers

2024-10-25 Thread Jani Nikula
url: > https://github.com/intel-lab-lkp/linux/commits/Jani-Nikula/drm-remove-driver-date-from-struct-drm_driver-and-all-drivers/20241025-002344 > base: git://anongit.freedesktop.org/drm/drm-misc drm-misc-next > patch link: > https://lore.kernel.org/r/20241024162240.2398664-2-jan

[PATCH 6.6 18/28] maple_tree: don't find node end in mtree_lookup_walk()

2024-10-25 Thread Yu Kuai
From: "Liam R. Howlett" commit 24662decdd44645e8f027d7912be962dd461d1aa upstream. Since the pivot being set is now reliable, the optimized loop no longer needs to find the node end. The redundant check for a dead node can also be avoided as there is no danger of using the wrong pivot since the

[PATCH 6.6 28/28] maple_tree: correct tree corruption on spanning store

2024-10-25 Thread Yu Kuai
From: Lorenzo Stoakes commit bea07fd63192b61209d48cbb81ef474cc3ee4c62 upstream. Patch series "maple_tree: correct tree corruption on spanning store", v3. There has been a nasty yet subtle maple tree corruption bug that appears to have been in existence since the inception of the algorithm. Thi

[PATCH 6.6 19/28] maple_tree: mtree_range_walk() clean up

2024-10-25 Thread Yu Kuai
From: "Liam R. Howlett" commit a3c63c8c5df6406e79490456a1fc41a287676070 upstream. mtree_range_walk() needed to be updated to avoid checking if there was a pivot value. On closer examination, the code could avoid setting min or max in certain scenarios. The commit removes the extra check for pi

[PATCH 6.6 02/28] maple_tree: introduce {mtree,mas}_lock_nested()

2024-10-25 Thread Yu Kuai
From: Peng Zhang commit b2472efe4316b2687c153919c1513a098bd82c17 upstream. In some cases, nested locks may be needed, so {mtree,mas}_lock_nested is introduced. For example, when duplicating maple tree, we need to hold the locks of two trees, in which case nested locks are needed. At the same t

[PATCH 6.6 09/28] maple_tree: add end of node tracking to the maple state

2024-10-25 Thread Yu Kuai
From: "Liam R. Howlett" commit 31c532a8af57513228c2b12d281104198ff412b8 upstream. Analysis of the mas_for_each() iteration showed that there is a significant time spent finding the end of a node. This time can be greatly reduced if the end of the node is cached in the maple state. Care must be

[PATCH 6.6 15/28] maple_tree: remove mas_searchable()

2024-10-25 Thread Yu Kuai
From: "Liam R. Howlett" commit 9a40d45c1f2c49273c04938ec3d7849f685eb3c1 upstream. Now that the status of the maple state is outside of the node, the mas_searchable() function can be dropped for easier open-coding of what is going on. Link: https://lkml.kernel.org/r/20231101171629.3612299-10-li

[PATCH v8 4/4] drm/i915: Use device wedged event

2024-10-25 Thread Raag Jadav
Now that we have device wedged event provided by DRM core, make use of it and support both driver rebind and bus-reset based recovery. With this in place, userspace will be notified of wedged device on gt reset failure. Signed-off-by: Raag Jadav --- drivers/gpu/drm/i915/gt/intel_reset.c | 3 +++

[PATCH 6.6 04/28] maple_tree: skip other tests when BENCH is enabled

2024-10-25 Thread Yu Kuai
From: Peng Zhang commit f670fa1caadb4ea532a89012c5451e4c6789bfcc upstream. Skip other tests when BENCH is enabled so that performance can be measured in user space. Link: https://lkml.kernel.org/r/20231027033845.90608-8-zhangpeng...@bytedance.com Signed-off-by: Peng Zhang Reviewed-by: Liam R.

[PATCH 6.6 20/28] lib/maple_tree.c: fix build error due to hotfix alteration

2024-10-25 Thread Yu Kuai
From: Andrew Morton commit 5143eecd2af2b5424f7b96d53f17bb4718e46bd3 upstream. Commit 0de56e38b307 ("maple_tree: use maple state end for write operations") was broken by a later patch "maple_tree: do not preallocate nodes for slot stores". But the later patch was scheduled ahead of 0de56e38b307,

[PATCH next] drm/amdgpu: Fix amdgpu_ip_block_hw_fini()

2024-10-25 Thread Dan Carpenter
This NULL check is reversed so the function doesn't work. Fixes: dad01f93f432 ("drm/amdgpu: validate hw_fini before function call") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/

[PATCH 6.6 08/28] maple_tree: move debug check to __mas_set_range()

2024-10-25 Thread Yu Kuai
From: "Liam R. Howlett" commit bf857ddd21d0bffc1edafc317e8e2ce0d6d5950c upstream. __mas_set_range() was created to shortcut resetting the maple state and a debug check was added to the caller (the vma iterator) to ensure the internal maple state remains safe to use. Move the debug check from th

[PATCH 6.6 26/28] libfs: Convert simple directory offsets to use a Maple Tree

2024-10-25 Thread Yu Kuai
From: Chuck Lever commit 0e4a862174f2a8d1653a8a9cf0815020e1d3af24 upstream. Test robot reports: > kernel test robot noticed a -19.0% regression of aim9.disk_src.ops_per_sec on: > > commit: a2e459555c5f9da3e619b7e47a63f98574dc75f1 ("shmem: stable directory > offsets") > https://git.kernel.org/cg

[PATCH 6.6 07/28] maple_tree: make mas_erase() more robust

2024-10-25 Thread Yu Kuai
From: "Liam R. Howlett" commit f7a59018953910032231c0a019208c4b0a4a8bc3 upstream. mas_erase() may not deal correctly with all maple states. Make the function more robust by ensuring the state is in one of the two acceptable states. Link: https://lkml.kernel.org/r/20231101171629.3612299-3-liam.

[PATCH v8 0/4] Introduce DRM device wedged event

2024-10-25 Thread Raag Jadav
This series introduces device wedged event in DRM subsystem and uses it in xe and i915 drivers. Detailed description in commit message. This was earlier attempted as xe specific uevent in v1 and v2. https://patchwork.freedesktop.org/series/136909/ Similar work by André Almeida. https://lore.kerne

[PATCH 6.6 11/28] maple_tree: use cached node end in mas_destroy()

2024-10-25 Thread Yu Kuai
From: "Liam R. Howlett" commit 1f41ef12abf8538b3d82cdae14c06aa171cb71ce upstream. The node end is set during the walk, so use the resulting end instead of re-fetching it. Link: https://lkml.kernel.org/r/20231101171629.3612299-7-liam.howl...@oracle.com Signed-off-by: Liam R. Howlett Cc: Peng Zh

[PATCH 6.6 16/28] Revert "maple_tree: correct tree corruption on spanning store"

2024-10-25 Thread Yu Kuai
From: Yu Kuai This reverts commit 677f1df179cb68c12ddf7707ec325eb50e99c7d9. Above commit contain manual changes and will cause conflicts for following patches. The commit be backported from mainline later, without conflicts. Signed-off-by: Yu Kuai --- lib/maple_tree.c | 12 ++-- 1 fil

[PATCH 6.6 23/28] libfs: Define a minimum directory offset

2024-10-25 Thread Yu Kuai
From: Chuck Lever commit 7beea725a8ca412c6190090ce7c3a13b169592a1 upstream. This value is used in several places, so make it a symbolic constant. Reviewed-by: Jan Kara Signed-off-by: Chuck Lever Link: https://lore.kernel.org/r/170820142741.6328.12428356024575347885.st...@91.116.238.104.host.

[PATCH 6.6 25/28] maple_tree: Add mtree_alloc_cyclic()

2024-10-25 Thread Yu Kuai
From: Chuck Lever commit 9b6713cc75229f25552c643083cbdbfb771e5bca upstream. I need a cyclic allocator for the simple_offset implementation in fs/libfs.c. Signed-off-by: Chuck Lever Link: https://lore.kernel.org/r/170820144179.6328.12838600511394432325.st...@91.116.238.104.host.secureserver.ne

[PATCH 6.6 05/28] maple_tree: preserve the tree attributes when destroying maple tree

2024-10-25 Thread Yu Kuai
From: Peng Zhang commit 8e50d32c7a89bde896945e4e572ef28ccd87bbf8 upstream. When destroying maple tree, preserve its attributes and then turn it into an empty tree. This allows it to be reused without needing to be reinitialized. Link: https://lkml.kernel.org/r/20231027033845.90608-10-zhangpen

[PATCH 6.6 03/28] maple_tree: introduce interfaces __mt_dup() and mtree_dup()

2024-10-25 Thread Yu Kuai
From: Peng Zhang commit fd32e4e9b7646510ee9010e0d5f8b8857d48a6f7 upstream. Introduce interfaces __mt_dup() and mtree_dup(), which are used to duplicate a maple tree. They duplicate a maple tree in Depth-First Search (DFS) pre-order traversal. It uses memcopy() to copy nodes in the source tree

[PATCH 6.6 22/28] libfs: Re-arrange locking in offset_iterate_dir()

2024-10-25 Thread Yu Kuai
From: Chuck Lever commit 3f6d810665dfde0d33785420618ceb03fba0619d upstream. Liam and Matthew say that once the RCU read lock is released, xa_state is not safe to re-use for the next xas_find() call. But the RCU read lock must be released on each loop iteration so that dput(), which might_sleep()

[pull] amdgpu, amdkfd, radeon, documentation drm-next-6.13

2024-10-25 Thread Alex Deucher
Hi Dave, Simona, New stuff for 6.13. The following changes since commit d7d2688bf4ea58734d73e18edcbf4684b1496d30: drm/amd/pm: update workload mask after the setting (2024-09-26 17:05:10 -0400) are available in the Git repository at: https://gitlab.freedesktop.org/agd5f/linux.git tags/amd-

[PATCH 6.6 01/28] maple_tree: add mt_free_one() and mt_attr() helpers

2024-10-25 Thread Yu Kuai
From: Peng Zhang commit 4f2267b58a22d972be98edef8e6b3c7a67c9fb91 upstream. Patch series "Introduce __mt_dup() to improve the performance of fork()", v7. This series introduces __mt_dup() to improve the performance of fork(). During the duplication process of mmap, all VMAs are traversed and ins

Re: [PATCH v5 4/4] drm/amdgpu: track bo memory stats at runtime

2024-10-25 Thread Tvrtko Ursulin
On 23/10/2024 13:56, Christian König wrote: Am 23.10.24 um 14:24 schrieb Tvrtko Ursulin: [SNIP] To fold or not the special placements (GWS, GDS & co) is also tangential. In my patch I just preserved the legacy behaviour so it can easily be tweaked on top. Yeah, but again the original behav

[PATCH 6.6 27/28] libfs: fix infinite directory reads for offset dir

2024-10-25 Thread Yu Kuai
From: yangerkun commit 64a7ce76fb901bf9f9c36cf5d681328fc0fd4b5a upstream. After we switch tmpfs dir operations from simple_dir_operations to simple_offset_dir_operations, every rename happened will fill new dentry to dest dir's maple tree(&SHMEM_I(inode)->dir_offsets->mt) with a free key startin

Re: [PATCH] drm/amd/pm: Vangogh: Fix kernel memory out of bounds write

2024-10-25 Thread Mario Limonciello
On 10/25/2024 09:15, Tvrtko Ursulin wrote: From: Tvrtko Ursulin KASAN reports that the GPU metrics table allocated in vangogh_tables_init() is not large enough for the memset done in smu_cmn_init_soft_gpu_metrics(). Condensed report follows: [ 33.861314] BUG: KASAN: slab-out-of-bounds in sm

[PATCH 6.6 17/28] maple_tree: use maple state end for write operations

2024-10-25 Thread Yu Kuai
From: "Liam R. Howlett" commit 0de56e38b307b0cb2ac825e8e7cb371a28daf844 upstream. ma_wr_state was previously tracking the end of the node for writing. Since the implementation of the ma_state end tracking, this is duplicated work. This patch removes the maple write state tracking of the end of

Re: [RFC 1/1] SWDEV476969 - dm: Fail dm_atomic_check if cursor overlay is required at MAX_SURFACES

2024-10-25 Thread Melissa Wen
On 25/10/2024 16:37, Zaeem Mohamed wrote: [why] Prevent index-out-of-bounds due to requiring cursor overlay when plane_count is MAX_SURFACES. Hi Zaeem, Thanks for working on this fix. [how] Bounds check on plane_count when requiring overlay cursor. I agree. Atomic check makes sense. 1)

Re: [PATCH v8 1/4] drm: Introduce device wedged event

2024-10-25 Thread kernel test robot
Hi Raag, kernel test robot noticed the following build errors: [auto build test ERROR on drm-xe/drm-xe-next] [also build test ERROR on drm-intel/for-linux-next drm-intel/for-linux-next-fixes drm-tip/drm-tip linus/master v6.12-rc4 next-20241025] [If your patch is applied to the wrong git tree

[PATCH V3 2/5] drm/amdgpu: Add sysfs interface for sdma reset mask

2024-10-25 Thread jesse.zh...@amd.com
From: "jesse.zh...@amd.com" Add the sysfs interface for sdma: sdma_reset_mask The interface is read-only and show the resets supported by the IP. For example, full adapter reset (mode1/mode2/BACO/etc), soft reset, queue reset, and pipe reset. V2: the sysfs node returns a text string instead of

Re: [PATCH 1/2] drm: Move plane->{fb,old_fb,crtc} to legacy sub-structure

2024-10-25 Thread Jani Nikula
On Thu, 03 Oct 2024, Ville Syrjälä wrote: > On Wed, Oct 02, 2024 at 09:21:59PM +0300, Ville Syrjala wrote: >> From: Ville Syrjälä >> >> Hide the plane->fb/etc. footguns better by stashing them inside >> a "legacy" sub struct. >> >> Eventually maybe we could turn 'legacy' into a pointer >> that

Re: [PATCH 0/2] drm: Treewide plane/crtc legacy state sweeping

2024-10-25 Thread Jani Nikula
On Fri, 25 Oct 2024, Ville Syrjälä wrote: > On Wed, Oct 02, 2024 at 09:21:58PM +0300, Ville Syrjala wrote: >> From: Ville Syrjälä >> >> An attempt to hide the drm_plane/crtc legacy state better. >> >> This also highlights the fact that a lot of supposedly >> atomic drivers are poking around in

Re: [PATCH 1/2] drm: Move plane->{fb,old_fb,crtc} to legacy sub-structure

2024-10-25 Thread Ville Syrjälä
On Fri, Oct 25, 2024 at 12:57:50PM +0300, Jani Nikula wrote: > On Thu, 03 Oct 2024, Ville Syrjälä wrote: > > On Wed, Oct 02, 2024 at 09:21:59PM +0300, Ville Syrjala wrote: > >> From: Ville Syrjälä > >> > >> Hide the plane->fb/etc. footguns better by stashing them inside > >> a "legacy" sub struc

Re: [PATCH] drm/fourcc: add AMD_FMT_MOD_TILE_GFX9_4K_D_X

2024-10-25 Thread Marek Olšák
Reviewed-by: Marek Olšák BTW, we don't have to define everything here. We can use most of the 32 values freely. Marek On Fri, Oct 25, 2024 at 2:03 AM Qiang Yu wrote: > > From: Qiang Yu > > This is used when radeonsi export small texture's modifier > to user with eglExportDMABUFImageQueryMESA(

Re: [PATCH 21/29] drm/amdgpu: sw_init for each vcn instance

2024-10-25 Thread Khatri, Sunil
On 10/25/2024 8:05 AM, boyuan.zh...@amd.com wrote: From: Boyuan Zhang Pass instance parameter to amdgpu_vcn_sw_init(), and perform sw init ONLY for the given vcn instance, instead of for all vcn instances. Modify each vcn generation accordingly. Signed-off-by: Boyuan Zhang --- drivers/gpu/

RE: [PATCH] drm/amdgpu: optimize ACA log print

2024-10-25 Thread Zhang, Hawking
[AMD Official Use Only - AMD Internal Distribution Only] Reviewed-by: Hawking Zhang Regards, Hawking -Original Message- From: Wang, Yang(Kevin) Sent: Friday, October 25, 2024 15:19 To: amd-gfx@lists.freedesktop.org Cc: Zhang, Hawking ; Zhou1, Tao Subject: [PATCH] drm/amdgpu: optimize A

[PATCH v8 2/4] drm/doc: Document device wedged event

2024-10-25 Thread Raag Jadav
Add documentation for device wedged event in a new 'Device wedging' chapter. The describes basic definitions and consumer expectations along with an example. v8: Improve documentation (Christian, Rodrigo) Signed-off-by: Raag Jadav --- Documentation/gpu/drm-uapi.rst | 75

[PATCH 6.6 06/28] maple_tree: remove unnecessary default labels from switch statements

2024-10-25 Thread Yu Kuai
From: "Liam R. Howlett" commit 37a8ab24d3d4c465b070bd704e2ad2fa277df9d7 upstream. Patch series "maple_tree: iterator state changes". These patches have some general cleanup and a change to separate the maple state status tracking from the maple state node. The maple state status change allows

Re: [PATCH 22/29] drm/amdgpu: sw_fini for each vcn instance

2024-10-25 Thread Khatri, Sunil
Looks fine to me as the changes are done to accomodate per instance ip block only Acked-by: Sunil Khatri > On 10/25/2024 8:05 AM, boyuan.zh...@amd.com wrote: From: Boyuan Zhang Pass instance parameter to amdgpu_vcn_sw_fini(), and perform sw fini ONLY for the g

[PATCH] amdgpu/fence: replace call_rcu by kfree_rcu for simple kmem_cache_free callback

2024-10-25 Thread Hongling Zeng
Since SLOB was removed and since commit 6c6c47b063b5 ("mm, slab: call kvfree_rcu_barrier() from kmem_cache_destroy()"), it is not necessary to use call_rcu when the callback only performs kmem_cache_free. Use kfree_rcu() directly. Signed-off-by: Hongling Zeng --- drivers/gpu/drm/amd/amdgpu/amdg

[PATCH 6.6 21/28] maple_tree: avoid checking other gaps after getting the largest gap

2024-10-25 Thread Yu Kuai
From: Peng Zhang commit 7e552dcd803f4ff60165271c573ab2e38d15769f upstream. The last range stored in maple tree is typically quite large. By checking if it exceeds the sum of the remaining ranges in that node, it is possible to avoid checking all other gaps. Running the maple tree test suite in

RE: [PATCH 00/16] DC Patches Oct 28 2024

2024-10-25 Thread Wheeler, Daniel
[Public] Hi all, This week this patchset was tested on 4 systems, two dGPU and two APU based, and tested across multiple display and connection types. APU * Single Display eDP -> 1080p 60hz, 2560x1600 120hz, 1920x1200 165hz * Single Display DP -> 4k144hz, 4k240hz * Multi

[PATCH 6.6 00/28] fix CVE-2024-46701

2024-10-25 Thread Yu Kuai
From: Yu Kuai Fix patch is patch 27, relied patches are from: - patches from set [1] to add helpers to maple_tree, the last patch to improve fork() performance is not backported; - patches from set [2] to change maple_tree, and follow up fixes; - patches from set [3] to convert offset_ctx fro

Re: [PATCH 20/29] drm/amdgpu: early_init for each vcn instance

2024-10-25 Thread Khatri, Sunil
Acked-by: Sunil Khatri > On 10/25/2024 8:05 AM, boyuan.zh...@amd.com wrote: From: Boyuan Zhang Pass instance parameter to amdgpu_vcn_early_init(), and perform early init ONLY for the given vcn instance, instead of for all vcn instances. Modify each vcn generati

[PATCH] drm/amdgpu: Fix dummy_read_page overlapping mappings

2024-10-25 Thread Prike Liang
Use the dma_map_page_attrs() with DMA_ATTR_SKIP_CPU_SYNC attribute setting to handle the dummy page overlapping mappings. Signed-off-by: Prike Liang Suggested-by: Christian König --- drivers/gpu/drm/amd/amdgpu/amdgpu_gart.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff

[PATCH v2] drm/amd/pm: Vangogh: Fix kernel memory out of bounds write

2024-10-25 Thread Tvrtko Ursulin
From: Tvrtko Ursulin KASAN reports that the GPU metrics table allocated in vangogh_tables_init() is not large enough for the memset done in smu_cmn_init_soft_gpu_metrics(). Condensed report follows: [ 33.861314] BUG: KASAN: slab-out-of-bounds in smu_cmn_init_soft_gpu_metrics+0x73/0x200 [amdgp

[PATCH 6.6 14/28] maple_tree: separate ma_state node from status

2024-10-25 Thread Yu Kuai
From: "Liam R. Howlett" commit 067311d33e650adfe7ae23765959ddcc1ba18510 upstream. The maple tree node is overloaded to keep status as well as the active node. This, unfortunately, results in a re-walk on underflow or overflow. Since the maple state has room, the status can be placed in its own

Re: [PATCH] drm/amd/pm: Vangogh: Fix kernel memory out of bounds write

2024-10-25 Thread Mario Limonciello
On 10/25/2024 09:40, Tvrtko Ursulin wrote: On 25/10/2024 15:23, Mario Limonciello wrote: On 10/25/2024 09:15, Tvrtko Ursulin wrote: From: Tvrtko Ursulin KASAN reports that the GPU metrics table allocated in vangogh_tables_init() is not large enough for the memset done in smu_cmn_init_soft_gp

[PATCH v6 4/5] drm: add drm_memory_stats_is_zero

2024-10-25 Thread Yunxiang Li
Add a helper to check if the memory stats is zero, this will be used to check for memory accounting errors. Signed-off-by: Yunxiang Li --- drivers/gpu/drm/drm_file.c | 9 + include/drm/drm_file.h | 1 + 2 files changed, 10 insertions(+) diff --git a/drivers/gpu/drm/drm_file.c b/driv

[PATCH v6 0/5] rework bo mem stats tracking

2024-10-25 Thread Yunxiang Li
Right now every time the fdinfo is read, we go through the vm lists and lock all the BOs to calcuate the statistics. This causes a lot of lock contention when the VM is actively used. It gets worse if there is a lot of shared BOs or if there's a lot of submissions. We have seen submissions lock-up

[RFC 0/1] Fail dm_atomic_check if cursor overlay is required at MAX_SURFACES

2024-10-25 Thread Zaeem Mohamed
Current patch to prevent index-out-of-bounds when cursor plane is required and plane_count is MAX_SURFACES. This check needs to occur in dm_atomic_check where failing is safe. Need help with finding a better location for the bounds check within dm_atomic_commit Zaeem Mohamed (1): SWDEV476969 - d

RE: [PATCH] drm/amdgpu: optimize ACA log print

2024-10-25 Thread Wang, Yang(Kevin)
[AMD Official Use Only - AMD Internal Distribution Only] Fix typo, DE -> UE. Best Regards, Kevin -Original Message- From: Wang, Yang(Kevin) Sent: Friday, October 25, 2024 5:20 PM To: Lazar, Lijo ; amd-gfx@lists.freedesktop.org Cc: Zhang, Hawking ; Zhou1, Tao Subject: RE: [PATCH] drm/amd

Re: [PATCH v8 1/4] drm: Introduce device wedged event

2024-10-25 Thread Jani Nikula
On Fri, 25 Oct 2024, Raag Jadav wrote: > Introduce device wedged event, which will notify userspace of wedged > (hanged/unusable) state of the DRM device through a uevent. This is > useful especially in cases where the device is no longer operating as > expected even after a reset and has become u

Re: [PATCH v5 4/4] drm/amdgpu: track bo memory stats at runtime

2024-10-25 Thread Tvrtko Ursulin
On 23/10/2024 14:31, Li, Yunxiang (Teddy) wrote: [AMD Official Use Only - AMD Internal Distribution Only] From: Tvrtko Ursulin Sent: Wednesday, October 23, 2024 8:25 On 23/10/2024 13:12, Christian König wrote: Am 23.10.24 um 13:37 schrieb Tvrtko Ursulin: On 23/10/2024 10:14, Christian Kön

[PATCH v4 1/2] drm/amdgpu: correct the S3 abort check condition

2024-10-25 Thread Prike Liang
In the normal S3 entry, the TOS cycle counter is not reset during BIOS execution the _S3 method, so it doesn't determine whether the _S3 method is executed exactly. Howerver, the PM core performs the S3 suspend will set the PM_SUSPEND_FLAG_FW_RESUME bit if all the devices suspend successfully. Ther

[PATCH v4 2/2] drm/amdgpu: clean up the suspend_complete

2024-10-25 Thread Prike Liang
To check the status of S3 suspend completion, use the PM core pm_suspend_global_flags bit(1) to detect S3 abort events. Therefore, clean up the AMDGPU driver's private flag suspend_complete. Signed-off-by: Prike Liang --- drivers/gpu/drm/amd/amdgpu/amdgpu.h | 2 -- drivers/gpu/drm/amd/amdgpu

Re: [PATCH v4 1/2] drm/amdgpu: correct the S3 abort check condition

2024-10-25 Thread Lazar, Lijo
On 10/25/2024 3:15 PM, Prike Liang wrote: > In the normal S3 entry, the TOS cycle counter is not > reset during BIOS execution the _S3 method, so it doesn't > determine whether the _S3 method is executed exactly. > Howerver, the PM core performs the S3 suspend will set the > PM_SUSPEND_FLAG_FW_R

Re: [PATCH v2] drm/amd/pm: Vangogh: Fix kernel memory out of bounds write

2024-10-25 Thread Mario Limonciello
On 10/25/2024 09:56, Tvrtko Ursulin wrote: From: Tvrtko Ursulin KASAN reports that the GPU metrics table allocated in vangogh_tables_init() is not large enough for the memset done in smu_cmn_init_soft_gpu_metrics(). Condensed report follows: [ 33.861314] BUG: KASAN: slab-out-of-bounds in sm

[PATCH v6 3/5] drm/amdgpu: stop tracking visible memory stats

2024-10-25 Thread Yunxiang Li
Since on modern systems all of vram can be made visible anyways, to simplify the new implementation, drops tracking how much memory is visible for now. If this is really needed we can add it back on top of the new implementation. Signed-off-by: Yunxiang Li Reviewed-by: Christian König --- drive

[PATCH v6 5/5] drm/amdgpu: track bo memory stats at runtime

2024-10-25 Thread Yunxiang Li
Before, every time fdinfo is queried we try to lock all the BOs in the VM and calculate memory usage from scratch. This works okay if the fdinfo is rarely read and the VMs don't have a ton of BOs. If either of these conditions is not true, we get a massive performance hit. In this new revision, we

[PATCH v6 1/5] drm/amdgpu: remove unused function parameter

2024-10-25 Thread Yunxiang Li
amdgpu_vm_bo_invalidate doesn't use the adev parameter and not all callers have a reference to adev handy, so remove it for cleanliness. Signed-off-by: Yunxiang Li Reviewed-by: Christian König --- drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 4 ++-- drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c

[PATCH v6 2/5] drm/amdgpu: make drm-memory-* report resident memory

2024-10-25 Thread Yunxiang Li
The old behavior reports the resident memory usage for this key and the documentation say so as well. However this was accidentally changed to include buffers that was evicted. Fixes: a2529f67e2ed ("drm/amdgpu: Use drm_print_memory_stats helper from fdinfo") Signed-off-by: Yunxiang Li Reviewed-b

[RFC 1/1] SWDEV476969 - dm: Fail dm_atomic_check if cursor overlay is required at MAX_SURFACES

2024-10-25 Thread Zaeem Mohamed
[why] Prevent index-out-of-bounds due to requiring cursor overlay when plane_count is MAX_SURFACES. [how] Bounds check on plane_count when requiring overlay cursor. Co-developed-by: Melissa Wen Signed-off-by: Zaeem Mohamed --- amdgpu_dm/amdgpu_dm.c | 16 +++- 1 file changed, 15 ins