[PATCH 1/2] drm/sched: adding a new scheduling policy

2024-10-10 Thread jesse.zhang
From: "jesse.zh...@amd.com" Added ring ID scheduling. In some cases, userspace needs to run a job on a specific ring. Instead of selecting the best ring to run based on the ring score. For example, The user want to run a bad job on a specific ring to check whether the ring can recover from a queu

[PATCH 2/2] drm/amdgpu: add the ring id schedule module parameter for amdgpu

2024-10-10 Thread jesse.zhang
From: "jesse.zh...@amd.com" Added ring id schedule to switch scheduling policy when cs submits. Schedule the ring by setting the ring id. Signed-off-by: Jesse Zhang --- drivers/gpu/drm/amd/amdgpu/amdgpu.h | 1 + drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 9 +++-- drivers/gpu/drm/amd/amd

Re: [PATCH next] drm/amdgpu: Fix off by one in current_memory_partition_show()

2024-10-10 Thread Lazar, Lijo
On 10/11/2024 12:05 AM, Dan Carpenter wrote: > The >= ARRAY_SIZE() should be > ARRAY_SIZE() to prevent an out of > bounds read. > > Fixes: 012be6f22c01 ("drm/amdgpu: Add sysfs interfaces for NPS mode") > Signed-off-by: Dan Carpenter Reviewed-by: Lijo Lazar Thanks, Lijo > --- > drivers/gpu

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

2024-10-10 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

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

2024-10-10 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

RE: [PATCH] drm/amd/pm: update the driver-fw interface file for smu v14.0.2/3

2024-10-10 Thread Wang, Yang(Kevin)
[AMD Official Use Only - AMD Internal Distribution Only] Reviewed-by: Yang Wang Best Regards, Kevin -Original Message- From: Kenneth Feng Sent: Thursday, October 10, 2024 5:37 PM To: amd-gfx@lists.freedesktop.org Cc: Wang, Yang(Kevin) ; Feng, Kenneth Subject: [PATCH] drm/amd/pm: upda

Re: [PATCH][next] drm/amdgpu: Fix potential integer overflow on shift of a int

2024-10-10 Thread Christian König
Am 10.10.24 um 13:22 schrieb Colin Ian King: The left shift of int 32 bit integer constant 1 is evaluated using 32 bit arithmetic and then assigned to and operated upon using a 64 bit unsigned integer. In the case where the shift is 32 or more this can lead to an overflow. Avoid this by shifting

Re: [PATCH v1 06/13] drm/amdgpu: validate suspend before function call

2024-10-10 Thread Khatri, Sunil
On 10/10/2024 2:15 PM, Lazar, Lijo wrote: On 10/10/2024 2:05 PM, Khatri, Sunil wrote: On 10/10/2024 1:42 PM, Lazar, Lijo wrote: On 10/10/2024 1:13 PM, Christian König wrote: Am 09.10.24 um 16:24 schrieb Sunil Khatri: Before making a function call to suspend, validate the function pointer l

[PATCH] drm/amd/pm: update the driver-fw interface file for smu v14.0.2/3

2024-10-10 Thread Kenneth Feng
update the driver-fw interface file for smu v14.0.2/3 Signed-off-by: Kenneth Feng --- .../swsmu/inc/pmfw_if/smu14_driver_if_v14_0.h | 132 +++--- drivers/gpu/drm/amd/pm/swsmu/inc/smu_v14_0.h | 2 +- 2 files changed, 85 insertions(+), 49 deletions(-) diff --git a/drivers/gpu/drm/a

Re: [PATCH v1 06/13] drm/amdgpu: validate suspend before function call

2024-10-10 Thread Lazar, Lijo
On 10/10/2024 2:34 PM, Khatri, Sunil wrote: > > On 10/10/2024 2:15 PM, Lazar, Lijo wrote: >> >> On 10/10/2024 2:05 PM, Khatri, Sunil wrote: >>> On 10/10/2024 1:42 PM, Lazar, Lijo wrote: On 10/10/2024 1:13 PM, Christian König wrote: > Am 09.10.24 um 16:24 schrieb Sunil Khatri: >> Be

[PATCH 1/2] drm/amdkfd: cleanup device pointer dereference chains

2024-10-10 Thread Yunxiang Li
Pull out some duplicated dereference chains into variables, and in some cases grab struct device pointer directly from amdgpu_device instead of via drm_device. Signed-off-by: Yunxiang Li --- drivers/gpu/drm/amd/amdkfd/kfd_process.c | 32 +--- 1 file changed, 18 insertions(+),

[PATCH 2/2] drm/amdkfd: pause autosuspend when creating pdd

2024-10-10 Thread Yunxiang Li
When using MES creating a pdd will require talking to the GPU to setup the relevant context. The code here forgot to wake up the GPU in case it was in suspend, this causes KVM to EFAULT for passthrough GPU for example. Also, change the other place where we pause suspend to use the cleaner pm_runti

[PATCH] drm/amdgpu: enable userqueue support for GFX12

2024-10-10 Thread Shashank Sharma
From: Somalapuram Amaranath This patch enables Usermode queue support across GFX, Compute and SDMA IPs on GFX12/SDMA7. It typically reuses Navi3X userqueue IP functions to create and destroy MQDs. Cc: Alex Deucher Cc: Christian Koenig Cc: Arvind Yadav Signed-off-by: Somalapuram Amaranath Sig

Re: [PATCH v2] drm/amdkfd: Not restore userptr buffer if kfd process has been removed

2024-10-10 Thread Felix Kuehling
On 2024-10-09 18:50, Chen, Xiaogang wrote: On 10/9/2024 4:36 PM, Felix Kuehling wrote: On 2024-10-04 11:54, Xiaogang.Chen wrote: From: Xiaogang Chen When kfd process has been terminated not restore userptr buffer after mmu notifier invalidates a range. Is this fixing a real problem or

Re: [PATCH] drm/amdkfd: change kfd process kref count at creation

2024-10-10 Thread Felix Kuehling
On 2024-10-09 18:16, Chen, Xiaogang wrote: On 10/9/2024 4:45 PM, Felix Kuehling wrote: On 2024-10-09 17:02, Chen, Xiaogang wrote: On 10/9/2024 3:38 PM, Felix Kuehling wrote: On 2024-10-09 14:08, Xiaogang.Chen wrote: From: Xiaogang Chen kfd process kref count(process->ref) is initialize

RE: [PATCH] drm/amdgpu: Wait for reset on init completion

2024-10-10 Thread Errabolu, Ramesh
[AMD Official Use Only - AMD Internal Distribution Only] Reviewed-by: Ramesh Errabolu Regards, Ramesh -Original Message- From: Lazar, Lijo Sent: Monday, October 7, 2024 4:33 AM To: amd-gfx@lists.freedesktop.org Cc: Zhang, Hawking ; Deucher, Alexander ; Bhardwaj, Rajneesh ; Errabolu,

Re: [PATCH v1 06/13] drm/amdgpu: validate suspend before function call

2024-10-10 Thread Khatri, Sunil
On 10/10/2024 1:13 PM, Christian König wrote: Am 09.10.24 um 16:24 schrieb Sunil Khatri: Before making a function call to suspend, validate the function pointer like we do in sw_init. Signed-off-by: Sunil Khatri ---   drivers/gpu/drm/amd/amdgpu/aldebaran.c  | 15 ++--   drivers/gp

Re: [PATCH v1 06/13] drm/amdgpu: validate suspend before function call

2024-10-10 Thread Lazar, Lijo
On 10/10/2024 1:13 PM, Christian König wrote: > Am 09.10.24 um 16:24 schrieb Sunil Khatri: >> Before making a function call to suspend, validate >> the function pointer like we do in sw_init. >> >> Signed-off-by: Sunil Khatri >> --- >>   drivers/gpu/drm/amd/amdgpu/aldebaran.c  | 15 ++--

Re: [PATCH v1 06/13] drm/amdgpu: validate suspend before function call

2024-10-10 Thread Khatri, Sunil
On 10/10/2024 1:37 PM, Khatri, Sunil wrote: On 10/10/2024 1:13 PM, Christian König wrote: Am 09.10.24 um 16:24 schrieb Sunil Khatri: Before making a function call to suspend, validate the function pointer like we do in sw_init. Signed-off-by: Sunil Khatri ---   drivers/gpu/drm/amd/amdgpu/a

Re: [PATCH v1 06/13] drm/amdgpu: validate suspend before function call

2024-10-10 Thread Khatri, Sunil
On 10/10/2024 1:42 PM, Lazar, Lijo wrote: On 10/10/2024 1:13 PM, Christian König wrote: Am 09.10.24 um 16:24 schrieb Sunil Khatri: Before making a function call to suspend, validate the function pointer like we do in sw_init. Signed-off-by: Sunil Khatri ---   drivers/gpu/drm/amd/amdgpu/al

Re: [PATCH v1 06/13] drm/amdgpu: validate suspend before function call

2024-10-10 Thread Lazar, Lijo
On 10/10/2024 2:05 PM, Khatri, Sunil wrote: > > On 10/10/2024 1:42 PM, Lazar, Lijo wrote: >> >> On 10/10/2024 1:13 PM, Christian König wrote: >>> Am 09.10.24 um 16:24 schrieb Sunil Khatri: Before making a function call to suspend, validate the function pointer like we do in sw_init. >

[PATCHES] drm/radeon issues

2024-10-10 Thread Christian Zigotzky
Hi All, There is another issue with the Radeon DRM driver but there is already a patch available for this issue. Link: https://lists.freedesktop.org/archives/dri-devel/2024-October/473314.html I compiled a new RC2 of kernel 6.12 with this patch for the X1000 and X5000 today. Download: https:/

Re: [PATCH 1/2] drm/amdgpu: drop volatile from ring buffer

2024-10-10 Thread Tvrtko Ursulin
On 09/10/2024 13:07, Christian König wrote: Am 09.10.24 um 09:41 schrieb Tvrtko Ursulin: On 08/10/2024 19:11, Christian König wrote: Volatile only prevents the compiler from re-ordering reads and writes. Since we always only modify the ring buffer from one CPU thread and have an explicit bar

[PATCH][next] drm/amdgpu: Fix potential integer overflow on shift of a int

2024-10-10 Thread Colin Ian King
The left shift of int 32 bit integer constant 1 is evaluated using 32 bit arithmetic and then assigned to and operated upon using a 64 bit unsigned integer. In the case where the shift is 32 or more this can lead to an overflow. Avoid this by shifting using the BIT_ULL macro instead. Fixes: f0b19b

Re: [PATCH v6 2/4] drm/amd/display: Add support for minimum backlight quirk

2024-10-10 Thread Thomas Weißschuh
On 2024-09-16 15:43:35-0400, Harry Wentland wrote: > On 2024-08-26 12:57, Mario Limonciello wrote: > > On 8/24/2024 13:33, Thomas Weißschuh wrote: > >> Not all platforms provide the full range of PWM backlight capabilities > >> supported by the hardware through ATIF. > >> Use the generic drm panel

[PATCH v2 11/14] drm/amdgpu: clean the dummy hw_fini functions

2024-10-10 Thread Sunil Khatri
Remove the dummy hw_fini functions for all ip blocks. Signed-off-by: Sunil Khatri --- drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c | 6 -- drivers/gpu/drm/amd/amdgpu/cik.c | 6 -- drivers/gpu/drm/amd/amdgpu/mes_v12_0.c | 11 +-- drivers/gpu/drm/amd/amdgpu/si.c |

[PATCH v2 07/14] drm/amdgpu: validate resume before function call

2024-10-10 Thread Sunil Khatri
Before making a function call to resume, validate the function pointer like we do in sw_init. Signed-off-by: Sunil Khatri --- drivers/gpu/drm/amd/amdgpu/aldebaran.c | 23 ++ drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 47 - drivers/gpu/drm/amd/amdgpu/sienna_cic

[PATCH v2 08/14] drm/amdgpu: validate wait_for_idle before function call

2024-10-10 Thread Sunil Khatri
Before making a function call to wait_for_idle, validate the function pointer like we do in sw_init. Signed-off-by: Sunil Khatri --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c

[PATCH v2 14/14] drm/amdgpu: clean unused functions of amd_ip_funcs

2024-10-10 Thread Sunil Khatri
Remove the unused and commented out code for vcn/uvd IP's. Also remove the functions which are set to NULL as these are global structures and all members are set to 0 or NULL during initialization. Signed-off-by: Sunil Khatri --- drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c | 4 - drivers/gpu

[PATCH v2 12/14] drm/amdgpu: clean the dummy wait_for_idle functions

2024-10-10 Thread Sunil Khatri
Remove the dummy wait_for_idle functions for all ip blocks. Signed-off-by: Sunil Khatri --- drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c | 6 -- drivers/gpu/drm/amd/amdgpu/amdgpu_isp.c | 5 - drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c | 6 -- drivers/gpu/drm/amd/am

[PATCH v2 02/14] drm/amdgpu: clean the dummy sw_init functions

2024-10-10 Thread Sunil Khatri
Remove the dummy sw_init functions for all IP blocks. Signed-off-by: Sunil Khatri --- drivers/gpu/drm/amd/amdgpu/amdgpu_isp.c | 6 -- drivers/gpu/drm/amd/amdgpu/cik.c| 6 -- drivers/gpu/drm/amd/amdgpu/si.c | 6 -- 3 files changed, 18 deletions(-) diff --git a/drivers

[PATCH v2 00/14] Code clean up for function pointers

2024-10-10 Thread Sunil Khatri
v2: added new patch: drm/amdgpu: clean unused functions of amd_ip_funcs Sunil Khatri (14): drm/amdgpu: validate sw_init before function call drm/amdgpu: clean the dummy sw_init functions drm/amdgpu: validate sw_fini before function call drm/amdgpu: clean the dummy sw_fini functions drm/a

[PATCH v2 01/14] drm/amdgpu: validate sw_init before function call

2024-10-10 Thread Sunil Khatri
Before making a function call to sw_init, validate the function pointer like we do in late_init. Signed-off-by: Sunil Khatri --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b

[PATCH v2 06/14] drm/amdgpu: validate suspend before function call

2024-10-10 Thread Sunil Khatri
Before making a function call to suspend, validate the function pointer like we do in sw_init. Signed-off-by: Sunil Khatri --- drivers/gpu/drm/amd/amdgpu/aldebaran.c | 15 ++-- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 26 - drivers/gpu/drm/amd/amdgpu/amdgpu_

[PATCH v2 03/14] drm/amdgpu: validate sw_fini before function call

2024-10-10 Thread Sunil Khatri
Before making a function call to sw_fini, validate the function pointer like we do in sw_init. Signed-off-by: Sunil Khatri --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 13 +++-- 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c

[PATCH v2 04/14] drm/amdgpu: clean the dummy sw_fini functions

2024-10-10 Thread Sunil Khatri
Remove the dummy sw_fini functions for all ip blocks. Signed-off-by: Sunil Khatri --- drivers/gpu/drm/amd/amdgpu/amdgpu_isp.c | 6 -- drivers/gpu/drm/amd/amdgpu/cik.c| 6 -- drivers/gpu/drm/amd/amdgpu/nv.c | 6 -- drivers/gpu/drm/amd/amdgpu/si.c | 7 --- d

[PATCH v2 09/14] drm/amdgpu: clean the dummy resume functions

2024-10-10 Thread Sunil Khatri
Remove the dummy resume functions for all ip blocks. Signed-off-by: Sunil Khatri --- drivers/gpu/drm/amd/amdgpu/amdgpu_isp.c | 6 -- 1 file changed, 6 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_isp.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_isp.c index 9b98b40ac4db..1383fd1644d

[PATCH v2 10/14] drm/amdgpu: clean the dummy suspend functions

2024-10-10 Thread Sunil Khatri
Remove the dummy suspend functions for all ip blocks. Signed-off-by: Sunil Khatri --- drivers/gpu/drm/amd/amdgpu/amdgpu_isp.c | 6 -- drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c | 3 ++- drivers/gpu/drm/amd/amdgpu/cik.c | 6 -- drivers/gpu/drm/amd/amdgpu/si.c | 6 -- 4

[PATCH v2 13/14] drm/amdgpu: clean the dummy soft_reset functions

2024-10-10 Thread Sunil Khatri
Remove the dummy soft_reset functions for all ip blocks. Signed-off-by: Sunil Khatri --- drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c | 6 -- drivers/gpu/drm/amd/amdgpu/amdgpu_isp.c | 5 - drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c | 6 -- drivers/gpu/drm/amd/amdgp

[PATCH v2 05/14] drm/amdgpu: validate hw_fini before function call

2024-10-10 Thread Sunil Khatri
Before making a function call to hw_fini, validate the function pointer like we do in sw_init. Signed-off-by: Sunil Khatri --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 26 +- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu

[PATCH] drm/amdgpu: Increase MES log buffer to dump mes scratch data

2024-10-10 Thread shaoyunl
MES internal scratch data is useful for mes debug, it can only located in VRAM, change the allocation type and increase size for mes 11 Signed-off-by: shaoyunl --- drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_mes.h | 1 + drivers/gpu/drm/amd/amdgpu/mes_v11_

[PATCH v2 2/2] drm/amdkfd: pause autosuspend when creating pdd

2024-10-10 Thread Yunxiang Li
When using MES creating a pdd will require talking to the GPU to setup the relevant context. The code here forgot to wake up the GPU in case it was in suspend, this causes KVM to EFAULT for passthrough GPU for example. Also, change the other place where we pause suspend to use the cleaner pm_runti

[PATCH v2 1/2] drm/amdkfd: cleanup device pointer dereference chains

2024-10-10 Thread Yunxiang Li
Pull out some duplicated dereference chains into variables, and in some cases grab struct device pointer directly from amdgpu_device instead of via drm_device. Signed-off-by: Yunxiang Li --- drivers/gpu/drm/amd/amdkfd/kfd_process.c | 29 1 file changed, 15 insertions(+),

RE: [PATCH 1/2] drm/amdkfd: cleanup device pointer dereference chains

2024-10-10 Thread Joshi, Mukul
[AMD Official Use Only - AMD Internal Distribution Only] > -Original Message- > From: amd-gfx On Behalf Of Yunxiang > Li > Sent: Thursday, October 10, 2024 11:19 AM > To: amd-gfx@lists.freedesktop.org > Cc: Deucher, Alexander ; Koenig, Christian > ; Gui, Jack ; Li, Yunxiang > (Teddy) > S

RE: [PATCH 1/2] drm/amdkfd: cleanup device pointer dereference chains

2024-10-10 Thread Li, Yunxiang (Teddy)
[AMD Official Use Only - AMD Internal Distribution Only] Oops, lemme fix that real quick... > -Original Message- > From: Joshi, Mukul > Sent: Thursday, October 10, 2024 11:46 > To: Li, Yunxiang (Teddy) ; amd-gfx@lists.freedesktop.org > Cc: Deucher, Alexander ; Koenig, Christian > ; Gui,

Re: [PATCH] drm/amdkfd: change kfd process kref count at creation

2024-10-10 Thread Chen, Xiaogang
On 10/10/2024 2:01 PM, Felix Kuehling wrote: On 2024-10-09 18:16, Chen, Xiaogang wrote: On 10/9/2024 4:45 PM, Felix Kuehling wrote: On 2024-10-09 17:02, Chen, Xiaogang wrote: On 10/9/2024 3:38 PM, Felix Kuehling wrote: On 2024-10-09 14:08, Xiaogang.Chen wrote: From: Xiaogang Chen kfd

RE: drm/amd/display: Introduce DML2

2024-10-10 Thread Li, Roman
[Public] Hi Colin, It's not critical since before the check: p1_min_meta_chunk_bytes = min_meta_chunk_bytes; Thanks, Roman > -Original Message- > From: Colin King (gmail) > Sent: Thursday, October 10, 2024 11:59 AM > To: Zhuo, Lillian > Cc: Siqueira, Rodrigo ; Li, Roman > ; Deucher,

Re: [PATCH v1 06/13] drm/amdgpu: validate suspend before function call

2024-10-10 Thread Christian König
Am 09.10.24 um 16:24 schrieb Sunil Khatri: Before making a function call to suspend, validate the function pointer like we do in sw_init. Signed-off-by: Sunil Khatri --- drivers/gpu/drm/amd/amdgpu/aldebaran.c | 15 ++-- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 26 ++

Re: [PATCH] drm/amdkfd: change kfd process kref count at creation

2024-10-10 Thread Felix Kuehling
On 2024-10-10 16:19, Chen, Xiaogang wrote: On 10/10/2024 2:01 PM, Felix Kuehling wrote: On 2024-10-09 18:16, Chen, Xiaogang wrote: On 10/9/2024 4:45 PM, Felix Kuehling wrote: On 2024-10-09 17:02, Chen, Xiaogang wrote: On 10/9/2024 3:38 PM, Felix Kuehling wrote: On 2024-10-09 14:08, Xiao

RE: [PATCH v2 1/2] drm/amdkfd: cleanup device pointer dereference chains

2024-10-10 Thread Joshi, Mukul
[AMD Official Use Only - AMD Internal Distribution Only] This patch is: Reviewed-by: Mukul Joshi > -Original Message- > From: amd-gfx On Behalf Of Yunxiang > Li > Sent: Thursday, October 10, 2024 12:17 PM > To: amd-gfx@lists.freedesktop.org > Cc: Deucher, Alexander ; Koenig, Christian >