[PATCH v2] drm/amdgpu: Save VCN shared memory with init reset

2024-10-17 Thread Lijo Lazar
VCN shared memory is in framebuffer and there are some flags initialized during sw_init. Ideally, such programming should be during hw_init. Make sure the flags are saved during reset on initialization since that reset will affect frame buffer region. For clarity, separate it out to another functi

[PATCH v2] drm/amdgpu: Fix the logic for NPS request failure

2024-10-17 Thread Lijo Lazar
On a hive, NPS request is placed by the first one for all devices in the hive. If the request fails, mark the mode as UNKNOWN so that subsequent devices on unload don't request it. Also, fix the mutex double lock issue in error condition, should have been mutex_unlock. Signed-off-by: Lijo Lazar R

Re: [PATCH next] drm/amdgpu: Fix a double lock bug

2024-10-17 Thread Lazar, Lijo
On 10/18/2024 1:10 AM, Dan Carpenter wrote: > This was supposed to be an unlock instead of a lock. The original > code will lead to a deadlock. > > Fixes: ee52489d1210 ("drm/amdgpu: Place NPS mode request on unload") > Signed-off-by: Dan Carpenter Thanks, this is being taken care with a foll

RE: [PATCH] drm/amdkfd: fix the hang caused by the write reorder to fence_addr

2024-10-17 Thread Zhao, Victor
[AMD Official Use Only - AMD Internal Distribution Only] Ping. Please help review. Thanks, Victor -Original Message- From: Victor Zhao Sent: Thursday, October 17, 2024 4:35 PM To: amd-gfx@lists.freedesktop.org Cc: Zhao, Victor Subject: [PATCH] drm/amdkfd: fix the hang caused by the wri

[PATCH 2/2] drm/amdgpu: add amdgpu_sdma_sched_mask debugfs

2024-10-17 Thread jesse.zh...@amd.com
Userspace wants to run jobs on a specific sdma ring for verification purposes. This debugfs entry helps to disable or enable submitting jobs to a specific ring. This entry is populated only if there are at least two or more cores in the sdma ip. Signed-off-by: Jesse Zhang Suggested-by:Alex Deuc

[PATCH 1/2] drm/amdgpu: add amdgpu_gfx_sched_mask and amdgpu_compute_sched_mask debugfs

2024-10-17 Thread jesse.zh...@amd.com
compute/gfx may have multiple rings on some hardware. In some cases, userspace wants to run jobs on a specific ring for validation purposes. This debugfs entry helps to disable or enable submitting jobs to a specific ring. This entry is populated only if there are at least two or more cores in th

[PATCH v3] drm/amdgpu/gfx9: Add cleaner shader for GFX9.4.2

2024-10-17 Thread Srinivasan Shanmugam
This commit adds the cleaner shader microcode for GFX9.4.2 GPUs. The cleaner shader is a piece of GPU code that is used to clear or initialize certain GPU resources, such as Local Data Share (LDS), Vector General Purpose Registers (VGPRs), and Scalar General Purpose Registers (SGPRs). Clearing the

RE: [PATCH 3/3] drm/amd/display: Add hpd_source index check for dcn401 link encoder setup

2024-10-17 Thread Li, Roman
[Public] The series Reviewed-by: Roman Li > -Original Message- > From: SHANMUGAM, SRINIVASAN > Sent: Thursday, October 17, 2024 2:56 AM > To: Siqueira, Rodrigo ; Pillai, Aurabindo > > Cc: amd-gfx@lists.freedesktop.org; SHANMUGAM, SRINIVASAN > ; Chung, ChiaHsuan (Tom) > ; Li, Roman ; Hu

Re: [PATCH v2] drm/amdkfd: Add kfd driver function to support hot plug/unplug amdgpu devices

2024-10-17 Thread Felix Kuehling
On 2024-10-15 17:21, Xiaogang.Chen wrote: From: Xiaogang Chen The purpose of this patch is having kfd driver function as expected during AMD gpu device plug/unplug. When an AMD gpu device got unplug kfd driver stops all queues from this device. If there are user processes still ref the rende

Re: [PATCH] drm/amd/amdkfd: add/remove kfd queues on start/stop KFD scheduling

2024-10-17 Thread Philip Yang
On 2024-10-17 12:12, Shaoyun Liu wrote: From: shaoyunl Add back kfd queues in start scheduling that originally been removed on stop scheduling. Signed-off-by: Shaoyun Liu --- .../drm/amd/amdkfd/kfd_device_queue_manager.c | 40 +-- 1 file change

Re: [PATCH 1/2] Documentation/gpu: Document how to narrow down display issues

2024-10-17 Thread Mario Limonciello
On 10/16/2024 22:34, Rodrigo Siqueira wrote: The amdgpu driver is composed of multiple components, each of which can be a source of some specific problem that the user/developer can see. This commit introduces steps to narrow down and collect display information. Cc: Leo Li Cc: Aurabindo Pillai

RE: [PATCH 00/10] DC Patches October 14, 2024

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

Re: [PATCH] drm/amd/amdkfd: add/remove kfd queues on start/stop KFD scheduling

2024-10-17 Thread Felix Kuehling
On 2024-10-17 12:12, Shaoyun Liu wrote: From: shaoyunl Add back kfd queues in start scheduling that originally been removed on stop scheduling. Signed-off-by: Shaoyun Liu Reviewed-by: Felix Kuehling --- .../drm/amd/amdkfd/kfd_device_queue_manager.c | 40 +-- 1 file ch

RE: [PATCH v2 1/2] drm/amdgpu/gfx9: Add cleaner shader for GFX9.4.2

2024-10-17 Thread SHANMUGAM, SRINIVASAN
[AMD Official Use Only - AMD Internal Distribution Only] Hi Alex, Thank you so much for reviewing Please ignore this v2 changes As this v2 leads to drivers/gpu/drm/amd/amdgpu/gfx_v9_0_cleaner_shader.h:29:18: warning: ‘gfx_9_4_2_cleaner_shader_hex’ defined but not used [-Wunused-const-variable=

[PATCH v2 2/2] drm/amdgpu/gfx9: Enable Cleaner Shader for GFX9.4.2 Hardware

2024-10-17 Thread Srinivasan Shanmugam
This patch adds support for the cleaner shader feature onto GFX9.4.2 hardware, as part of the leftover locals feature. The cleaner shader is important for ensuring process isolation and maintaining KGD/KFD serialization by clearing GPU memory before it is reused. The patch updates the `gfx_v9_0_sw

[PATCH v2 1/2] drm/amdgpu/gfx9: Add cleaner shader for GFX9.4.2

2024-10-17 Thread Srinivasan Shanmugam
This commit adds the cleaner shader microcode for GFX9.4.2 GPUs. The cleaner shader is a piece of GPU code that is used to clear or initialize certain GPU resources, such as Local Data Share (LDS), Vector General Purpose Registers (VGPRs), and Scalar General Purpose Registers (SGPRs). Clearing the

Re: [PATCH v7 1/5] drm: Introduce device wedged event

2024-10-17 Thread Rodrigo Vivi
On Thu, Oct 17, 2024 at 09:59:10AM +0200, Christian König wrote: > Am 17.10.24 um 04:47 schrieb Raag Jadav: > > On Mon, Sep 30, 2024 at 01:08:41PM +0530, Raag Jadav wrote: > > > Introduce device wedged event, which will notify userspace of wedged > > > (hanged/unusable) state of the DRM device thro

[PATCH v5 01/12] drm/amdgpu: validate hw_fini before function call

2024-10-17 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 | 38 +- 1 file changed, 22 insertions(+), 16 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu

[PATCH v5 12/12] drm/amdgpu: clean unused functions of uvd/vcn/vce

2024-10-17 Thread Sunil Khatri
Some of the functions pointers of amdgpu_ip_funcs are not used and are left commented out. Hence this cleans those up which arent used. Cc: Leo Liu Signed-off-by: Sunil Khatri --- drivers/gpu/drm/amd/amdgpu/uvd_v7_0.c | 274 -- drivers/gpu/drm/amd/amdgpu/vce_v4_0.c | 273

[PATCH v5 08/12] drm/amdgpu: clean the dummy suspend functions

2024-10-17 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 v5 00/12] validate/clean the functions of ip funcs

2024-10-17 Thread Sunil Khatri
v5: Fixed review comments. Dropped hw_fini patch and need to look further why such functions exists. hw_init/hw_fini are mandatory functions and we should have a valid definition. v4: hw_init/hw_fini functions are mandatory and raise error message if these functions are not defined. v

[PATCH v5 03/12] drm/amdgpu: validate suspend before function call

2024-10-17 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 | 9 ++--- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 15 +++ drivers/gpu/drm/amd/amdgpu/amdgpu_reset.c

[PATCH v5 07/12] drm/amdgpu: clean the dummy resume functions

2024-10-17 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 v5 09/12] drm/amdgpu: clean the dummy wait_for_idle functions

2024-10-17 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 | 6 -- drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c | 6 -- drivers/gpu/drm/amd/a

[PATCH v5 11/12] drm/amdgpu: Clean the functions pointer set as NULL

2024-10-17 Thread Sunil Khatri
We dont need to set the functions to NULL which arent needed as global structure members are by default set to zero or NULL for pointers. Cc: Leo Liu Signed-off-by: Sunil Khatri --- drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c | 4 drivers/gpu/drm/amd/amdgpu/amdgpu_isp.c |

[PATCH v5 05/12] drm/amdgpu: validate resume before function call

2024-10-17 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 | 11 -- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 24 +++-- drivers/gpu/drm/amd/amdgpu/sienna_cic

[PATCH v5 04/12] drm/amdgpu: add helper function amdgpu_ip_block_resume

2024-10-17 Thread Sunil Khatri
Use the helper function amdgpu_ip_block_resume where same checks and calls are repeated. Signed-off-by: Sunil Khatri --- drivers/gpu/drm/amd/amdgpu/amdgpu.h| 2 ++ drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 17 + 2 files changed, 19 insertions(+) diff --git a/drivers/

[PATCH v5 06/12] drm/amdgpu: validate wait_for_idle before function call

2024-10-17 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 v5 10/12] drm/amdgpu: clean the dummy soft_reset functions

2024-10-17 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 | 6 -- drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c | 6 -- drivers/gpu/drm/amd/amdg

[PATCH v5 02/12] drm/amdgpu: add helper function amdgpu_ip_block_suspend

2024-10-17 Thread Sunil Khatri
Use the helper function amdgpu_ip_block_suspend where same checks and calls are repeated. Signed-off-by: Sunil Khatri --- drivers/gpu/drm/amd/amdgpu/amdgpu.h| 1 + drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 17 + 2 files changed, 18 insertions(+) diff --git a/drivers/

Re: [PATCH 1/2] drm/amdgpu/gfx9: Enable Cleaner Shader for GFX9.4.2 Hardware

2024-10-17 Thread Alex Deucher
On Thu, Oct 17, 2024 at 2:49 AM Srinivasan Shanmugam wrote: > > This patch adds support for the cleaner shader feature onto GFX9.4.2 > hardware, as part of the leftover locals feature. The cleaner shader is > important for ensuring process isolation and maintaining KGD/KFD > serialization by clear

[PATCH] drm/amd/amdkfd: add/remove kfd queues on start/stop KFD scheduling

2024-10-17 Thread Shaoyun Liu
From: shaoyunl Add back kfd queues in start scheduling that originally been removed on stop scheduling. Signed-off-by: Shaoyun Liu --- .../drm/amd/amdkfd/kfd_device_queue_manager.c | 40 +-- 1 file changed, 37 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/amd/amdk

[PATCH] drm/amd/amdkfd: add/remove kfd queues on start/stop KFD scheduling

2024-10-17 Thread Shaoyun Liu
From: shaoyunl Add back kfd queues in start scheduling that originally been removed on stop scheduling. Signed-off-by: Shaoyun Liu --- .../drm/amd/amdkfd/kfd_device_queue_manager.c | 40 +-- 1 file changed, 37 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/amd/amdk

Re: [PATCH] drm/amd/amdkfd: add/remove kfd queues through on stop/start KFD scheduling

2024-10-17 Thread Felix Kuehling
On 2024-10-16 21:44, shaoyunl wrote: Add back kfd queues in start scheduling that originally been removed on stop scheduling. Signed-off-by: shaoyunl --- .../drm/amd/amdkfd/kfd_device_queue_manager.c | 40 +-- 1 file changed, 37 insertions(+), 3 deletions(-) diff --git a/

Re: [PATCH] drm/amdgpu: Dereference the ATCS ACPI buffer

2024-10-17 Thread Alex Deucher
On Thu, Oct 17, 2024 at 3:23 AM Prike Liang wrote: > > Need to dereference the atcs acpi buffer after > the method is executed, otherwise it will result in > a memory leak. > > Signed-off-by: Prike Liang Reviewed-by: Alex Deucher > --- > drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c | 1 + > 1 fil

[PATCH 17/32] drm/amdgpu: power vcn 5_0_0 by instance

2024-10-17 Thread boyuan.zhang
From: Boyuan Zhang For vcn 5_0_0, add ip_block for each vcn instance during discovery stage. And only powering on/off one of the vcn instance using the instance value stored in ip_block, instead of powering on/off all vcn instances. Modify the existing functions to use the instance value in ip_b

[PATCH 32/32] drm/amdgpu: set_powergating for each vcn instance

2024-10-17 Thread boyuan.zhang
From: Boyuan Zhang Perform set_powergating_state only for the instance of the current vcn IP block, instead of perform it for all vcn instances. Signed-off-by: Boyuan Zhang --- drivers/gpu/drm/amd/amdgpu/vcn_v2_5.c | 313 drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c | 20

[PATCH 24/32] drm/amdgpu: suspend for each vcn instance

2024-10-17 Thread boyuan.zhang
From: Boyuan Zhang Pass instance parameter to amdgpu_vcn_suspend(), and perform suspend 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 | 35 --

RE: [PATCH] drm/amdgpu: Save VCN shared memory with init reset

2024-10-17 Thread Liu, Leo
[AMD Official Use Only - AMD Internal Distribution Only] > -Original Message- > From: Lazar, Lijo > Sent: October 17, 2024 9:17 AM > To: Liu, Leo ; Koenig, Christian > ; amd-gfx@lists.freedesktop.org > Cc: Zhang, Hawking ; Deucher, Alexander > ; Sundararaju, Sathishkumar > ; Jiang, Sonny

[PATCH 28/32] drm/amdgpu: print_ip_state for each vcn instance

2024-10-17 Thread boyuan.zhang
From: Boyuan Zhang Perform print_ip_state only for the instance of the current vcn IP block, instead of perform it for all vcn instances. Signed-off-by: Boyuan Zhang --- drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c | 33 - drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c | 33 +++

[PATCH 30/32] drm/amdgpu: wait_for_idle for each vcn instance

2024-10-17 Thread boyuan.zhang
From: Boyuan Zhang Perform wait_for_idle only for the instance of the current vcn IP block, instead of perform it for all vcn instances. Signed-off-by: Boyuan Zhang --- drivers/gpu/drm/amd/amdgpu/vcn_v2_5.c | 18 +- drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c | 17 ---

[PATCH 19/32] drm/amdgpu: set powergating state by vcn instance

2024-10-17 Thread boyuan.zhang
From: Boyuan Zhang Set powergating state by vcn instance in idle_work_handler() and ring_begin_use() functions for vcn with multiple instances. v2: Add instance parameter to amdgpu_device_ip_set_powergating_state(), instead of creating new function. Signed-off-by: Boyuan Zhang --- drivers/gpu

[PATCH 08/32] drm/amdgpu: pass ip_block in set_clockgating_state

2024-10-17 Thread boyuan.zhang
From: Boyuan Zhang Pass ip_block instead of adev in set_clockgating_state() and is_idle() callback functions. Modify set_clockgating_state() and is_idle() ip functions for all correspoding ip blocks. Signed-off-by: Boyuan Zhang --- drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c | 4 ++-- drive

[PATCH 31/32] drm/amdgpu: is_idle for each vcn instance

2024-10-17 Thread boyuan.zhang
From: Boyuan Zhang Perform is_idle only for the instance of the current vcn IP block, instead of perform it for all vcn instances. Signed-off-by: Boyuan Zhang --- drivers/gpu/drm/amd/amdgpu/vcn_v2_5.c | 11 +-- drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c | 11 +-- drivers/gpu/drm

[PATCH 15/32] drm/amdgpu: power vcn 4_0_3 by instance

2024-10-17 Thread boyuan.zhang
From: Boyuan Zhang For vcn 4_0_3, add ip_block for each vcn instance during discovery stage. And only powering on/off one of the vcn instance using the instance value stored in ip_block, instead of powering on/off all vcn instances. Modify the existing functions to use the instance value in ip_b

[PATCH 23/32] drm/amdgpu: hw_init for each vcn instance

2024-10-17 Thread boyuan.zhang
From: Boyuan Zhang Pass instance parameter to amdgpu_vcn_hw_init(), and perform hw 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/vcn_v2_5.c | 39 +++-- drivers

[PATCH 25/32] drm/amdgpu: resume for each vcn instance

2024-10-17 Thread boyuan.zhang
From: Boyuan Zhang Pass instance parameter to amdgpu_vcn_resume(), and perform resume 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 | 60

[PATCH 09/32] drm/amdgpu: track instances of the same IP block

2024-10-17 Thread boyuan.zhang
From: Boyuan Zhang Add a new function to count the number of instance of the same IP block in the current ip_block list, then use the returned count value to set the newly defined instance variable in ip_block, to track the instance number of each ip_block. Signed-off-by: Boyuan Zhang Signed-of

[PATCH 27/32] drm/amdgpu: set funcs for each vcn instance

2024-10-17 Thread boyuan.zhang
From: Boyuan Zhang Pass instance parameter to set_dec_ring_funcs(), set_enc_ring_funcs(), and set_irq_funcs(), and perform function setup 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/a

[PATCH 29/32] drm/amdgpu: dump_ip_state for each vcn instance

2024-10-17 Thread boyuan.zhang
From: Boyuan Zhang Perform dump_ip_state only for the instance of the current vcn IP block, instead of perform it for all vcn instances. Signed-off-by: Boyuan Zhang --- drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c | 27 +-- drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c | 27 +-

[PATCH 26/32] drm/amdgpu: setup_ucode for each vcn instance

2024-10-17 Thread boyuan.zhang
From: Boyuan Zhang Pass instance parameter to amdgpu_vcn_setup_ucode(), and perform setup ucode 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 | 37 --

[PATCH 11/32] drm/amdgpu/vcn: separate gating state by instance

2024-10-17 Thread boyuan.zhang
From: Boyuan Zhang vcn gating state should now be based on instance. For example, instance 0 can be gated while instance 1 is ungated, or vice versa. Therefore, change the cur_state to be an array, so that it can track the gating status for each vcn instance now. v2: remove redundant codes in v

[PATCH 13/32] drm/amdgpu: power vcn 3_0 by instance

2024-10-17 Thread boyuan.zhang
From: Boyuan Zhang For vcn 3_0, add ip_block for each vcn instance during discovery stage. And only powering on/off one of the vcn instance using the instance value stored in ip_block, instead of powering on/off all vcn instances. Modify the existing functions to use the instance value in ip_blo

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

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

[PATCH 16/32] drm/amdgpu: power vcn 4_0_5 by instance

2024-10-17 Thread boyuan.zhang
From: Boyuan Zhang For vcn 4_0_5, add ip_block for each vcn instance during discovery stage. And only powering on/off one of the vcn instance using the instance value stored in ip_block, instead of powering on/off all vcn instances. Modify the existing functions to use the instance value in ip_b

[PATCH 06/32] add inst to amdgpu_dpm_enable_vcn

2024-10-17 Thread boyuan.zhang
From: Boyuan Zhang Add an instance parameter to amdgpu_dpm_enable_vcn() function, and change all calls from vcn ip functions to add instance argument. vcn generations with only one instance (v1.0, v2.0) always use 0 as instance number. vcn generations with multiple instances (v2.5, v3.0, v4.0, v4

[PATCH 14/32] drm/amdgpu: power vcn 4_0 by instance

2024-10-17 Thread boyuan.zhang
From: Boyuan Zhang For vcn 4_0, add ip_block for each vcn instance during discovery stage. And only powering on/off one of the vcn instance using the instance value stored in ip_block, instead of powering on/off all vcn instances. Modify the existing functions to use the instance value in ip_blo

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

2024-10-17 Thread boyuan.zhang
From: Boyuan Zhang Pass instance parameter to amdgpu_vcn_sw_fini(), and perform sw fini 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 | 36 --

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

2024-10-17 Thread boyuan.zhang
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 generation accordingly. Signed-off-by: Boyuan Zhang --- drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c | 23

[PATCH 18/32] drm/amdgpu/vcn: separate idle work by instance

2024-10-17 Thread boyuan.zhang
From: Boyuan Zhang Previously idle working handling is for all VCN instances. As a result, when one of the instance finishes its job, the idle work can't be triggered if the other instance is still busy. Now, move the idle_work from amdgpu_vcn to amdgpu_vcn_inst, in order to track work by vcn in

[PATCH 10/32] drm/amdgpu: move per inst variables to amdgpu_vcn_inst

2024-10-17 Thread boyuan.zhang
From: Boyuan Zhang Move all per instance variables from amdgpu_vcn to amdgpu_vcn_inst. Move adev->vcn.fw[i] from amdgpu_vcn to amdgpu_vcn_inst. Move adev->vcn.vcn_config[i] from amdgpu_vcn to amdgpu_vcn_inst. Move adev->vcn.vcn_codec_disable_mask[i] from amdgpu_vcn to amdgpu_vcn_inst. Signed-of

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

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

[PATCH 07/32] drm/amdgpu: pass ip_block in set_powergating_state

2024-10-17 Thread boyuan.zhang
From: Boyuan Zhang Pass ip_block instead of adev in set_powergating_state callback function. Modify set_powergating_state ip functions for all correspoding ip blocks. v2: fix a ip block index error. Signed-off-by: Boyuan Zhang Suggested-by: Christian König --- drivers/gpu/drm/amd/amdgpu/amdg

[PATCH 12/32] drm/amdgpu: power vcn 2_5 by instance

2024-10-17 Thread boyuan.zhang
From: Boyuan Zhang For vcn 2_5, add ip_block for each vcn instance during discovery stage. And only powering on/off one of the vcn instance using the instance value stored in ip_block, instead of powering on/off all vcn instances. Modify the existing functions to use the instance value in ip_blo

[PATCH 05/32] drm/amd/pm: add inst to dpm_set_powergating_by_smu

2024-10-17 Thread boyuan.zhang
From: Boyuan Zhang Add an instance parameter to amdgpu_dpm_set_powergating_by_smu() function, and use the instance to call set_powergating_by_smu(). v2: remove duplicated functions. remove for-loop in amdgpu_dpm_set_powergating_by_smu(), and temporarily move it to amdgpu_dpm_enable_vcn(), in or

[PATCH 03/32] drm/amd/pm: add inst to smu_dpm_set_vcn_enable

2024-10-17 Thread boyuan.zhang
From: Boyuan Zhang First, add an instance parameter to smu_dpm_set_vcn_enable() function, and calling dpm_set_vcn_enable() with this given instance. Second, modify vcn_gated to be an array, to track the gating status for each vcn instance separately. With these 2 changes, smu_dpm_set_vcn_enable

[PATCH 02/32] drm/amd/pm: power up or down vcn by instance

2024-10-17 Thread boyuan.zhang
From: Boyuan Zhang For smu ip with multiple vcn instances (smu 11/13/14), remove all the for loop in dpm_set_vcn_enable() functions. And use the instance argument to power up/down vcn for the given instance only, instead of powering up/down for all vcn instances. v2: remove all duplicated functi

[PATCH 01/32] drm/amd/pm: add inst to dpm_set_vcn_enable

2024-10-17 Thread boyuan.zhang
From: Boyuan Zhang Add an instance parameter to the existing function dpm_set_vcn_enable() for future implementation. Re-write all pptable functions accordingly. v2: Remove duplicated dpm_set_vcn_enable() functions in v1. Instead, adding instance parameter to existing functions. Signed-off-by:

[PATCH 00/32] Separating vcn power management by instance

2024-10-17 Thread boyuan.zhang
From: Boyuan Zhang Previously, all vcn instance will be powered on/off at the same time even only one of the instance requests power status change. This patch set enables vcn to ONLY power on/off the instance that requires power status change. Other vcn instances will remain the original power st

Re: [PATCH] drm/amdgpu: Save VCN shared memory with init reset

2024-10-17 Thread Lazar, Lijo
On 10/17/2024 6:37 PM, Liu, Leo wrote: > [AMD Official Use Only - AMD Internal Distribution Only] > >> -Original Message- >> From: Lazar, Lijo >> Sent: October 16, 2024 11:18 PM >> To: Liu, Leo ; Koenig, Christian >> ; amd-gfx@lists.freedesktop.org >> Cc: Zhang, Hawking ; Deucher, Alex

Re: [PATCH v4 15/15] drm/amdgpu: validate get_clockgating_state before use

2024-10-17 Thread Christian König
Am 17.10.24 um 14:55 schrieb Khatri, Sunil: On 10/17/2024 5:50 PM, Christian König wrote: Am 17.10.24 um 12:06 schrieb Sunil Khatri: Validate the function pointer for get_clockgating_state before making a function call. Oh, I'm not sure if that is necessary or not. The NBIO, HDP and SMUIO

RE: [PATCH] drm/amdgpu: Save VCN shared memory with init reset

2024-10-17 Thread Liu, Leo
[AMD Official Use Only - AMD Internal Distribution Only] > -Original Message- > From: Lazar, Lijo > Sent: October 16, 2024 11:18 PM > To: Liu, Leo ; Koenig, Christian > ; amd-gfx@lists.freedesktop.org > Cc: Zhang, Hawking ; Deucher, Alexander > ; Sundararaju, Sathishkumar > ; Jiang, Sonny

Re: [PATCH v4 00/15] validate/clean the functions of ip funcs

2024-10-17 Thread Khatri, Sunil
On 10/17/2024 5:53 PM, Christian König wrote: Patches #1-#4, #8-#10,#13 are Reviewed-by: Christian König Since those patches should be independent maybe push them to amd-staging-drm-next before continuing working on the set. Sure if the order isnt needed i will push those out of what you

Re: [PATCH v4 15/15] drm/amdgpu: validate get_clockgating_state before use

2024-10-17 Thread Khatri, Sunil
On 10/17/2024 5:50 PM, Christian König wrote: Am 17.10.24 um 12:06 schrieb Sunil Khatri: Validate the function pointer for get_clockgating_state before making a function call. Oh, I'm not sure if that is necessary or not. The NBIO, HDP and SMUIO functions are not IP specific. For many socs

Re: [PATCH v4 14/15] drm/amdgpu: clean unused functions of amd_ip_funcs

2024-10-17 Thread Khatri, Sunil
On 10/17/2024 5:48 PM, Christian König wrote: Am 17.10.24 um 12:06 schrieb 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. Pleas

Re: [PATCH v4 11/15] drm/amdgpu: clean the dummy hw_fini functions

2024-10-17 Thread Khatri, Sunil
On 10/17/2024 5:28 PM, Christian König wrote: Am 17.10.24 um 12:06 schrieb Sunil Khatri: Remove the dummy hw_fini functions for all ip blocks. As discussed on the call hw_init() and hw_fini() are the only two functions I consider mandatory. So please drop this patch here and as a follow u

Re: [PATCH v4 03/09] drm/amdgpu: Add wait IOCTL timeline syncobj support

2024-10-17 Thread Christian König
Am 15.10.24 um 09:43 schrieb Arunpravin Paneer Selvam: Add user fence wait IOCTL timeline syncobj support. v2:(Christian) - handle dma_fence_wait() return value. - shorten the variable name syncobj_timeline_points a bit. - move num_points up to avoid padding issues. v3:(Christian) -

Re: [PATCH v4 07/15] drm/amdgpu: validate resume before function call

2024-10-17 Thread Khatri, Sunil
On 10/17/2024 5:25 PM, Christian König wrote: Same comment as patch #5, please add an amdgpu_ip_block_resume() function. Sure Regards, Christian. Am 17.10.24 um 12:06 schrieb Sunil Khatri: Before making a function call to resume, validate the function pointer like we do in sw_init. Signed

Re: [PATCH v4 06/15] drm/amdgpu: validate suspend before function call

2024-10-17 Thread Khatri, Sunil
On 10/17/2024 5:24 PM, Christian König wrote: Am 17.10.24 um 12:06 schrieb Sunil Khatri: Before making a function call to suspend, validate the function pointer like we do in sw_init. Same comment as on patch #5, please add an amdgpu_ip_block_suspend() function and just call it multiple tim

Re: [PATCH v4 05/15] drm/amdgpu: validate hw_fini before function call

2024-10-17 Thread Khatri, Sunil
On 10/17/2024 5:22 PM, Christian König wrote: Am 17.10.24 um 12:06 schrieb 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 | 33 ++   1

Re: [PATCH v4 00/15] validate/clean the functions of ip funcs

2024-10-17 Thread Christian König
Patches #1-#4, #8-#10,#13 are Reviewed-by: Christian König Since those patches should be independent maybe push them to amd-staging-drm-next before continuing working on the set. Regards, Christian. Am 17.10.24 um 12:06 schrieb Sunil Khatri: v4: hw_init/hw_fini functions are mandatory and

Re: [PATCH v4 15/15] drm/amdgpu: validate get_clockgating_state before use

2024-10-17 Thread Christian König
Am 17.10.24 um 12:06 schrieb Sunil Khatri: Validate the function pointer for get_clockgating_state before making a function call. Oh, I'm not sure if that is necessary or not. The NBIO, HDP and SMUIO functions are not IP specific. Christian. Signed-off-by: Sunil Khatri --- drivers/gpu/

Re: [PATCH v4 14/15] drm/amdgpu: clean unused functions of amd_ip_funcs

2024-10-17 Thread Christian König
Am 17.10.24 um 12:06 schrieb 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. Please separate that into two patches, one for the vcn

Re: [PATCH v4 11/15] drm/amdgpu: clean the dummy hw_fini functions

2024-10-17 Thread Christian König
Am 17.10.24 um 12:06 schrieb Sunil Khatri: Remove the dummy hw_fini functions for all ip blocks. As discussed on the call hw_init() and hw_fini() are the only two functions I consider mandatory. So please drop this patch here and as a follow up task maybe look into why vkms and mes_v12 don'

Re: [PATCH v4 07/15] drm/amdgpu: validate resume before function call

2024-10-17 Thread Christian König
Same comment as patch #5, please add an amdgpu_ip_block_resume() function. Regards, Christian. Am 17.10.24 um 12:06 schrieb 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/

Re: [PATCH v4 06/15] drm/amdgpu: validate suspend before function call

2024-10-17 Thread Christian König
Am 17.10.24 um 12:06 schrieb Sunil Khatri: Before making a function call to suspend, validate the function pointer like we do in sw_init. Same comment as on patch #5, please add an amdgpu_ip_block_suspend() function and just call it multiple times. Regards, Christian. Signed-off-by: Sunil

Re: [PATCH v4 05/15] drm/amdgpu: validate hw_fini before function call

2024-10-17 Thread Christian König
Am 17.10.24 um 12:06 schrieb 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 | 33 ++ 1 file changed, 22 insertions(+), 11 deletions(-)

Re: [PATCH] drm/amdgpu: Fix the logic for NPS request failure

2024-10-17 Thread Bhardwaj, Rajneesh
[Public] one comment belon, other than that, looks good to me. Feel free to add my RB if you send a v2. Regards, Rajneesh From: Lazar, Lijo Sent: Thursday, October 17, 2024 5:10 AM To: amd-gfx@lists.freedesktop.org Cc: Zhang, Hawking ; Deucher, Alexander ; Bha

[PATCH v4 05/15] drm/amdgpu: validate hw_fini before function call

2024-10-17 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 | 33 ++ 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu

[PATCH v4 07/15] drm/amdgpu: validate resume before function call

2024-10-17 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 v4 00/15] validate/clean the functions of ip funcs

2024-10-17 Thread Sunil Khatri
v4: hw_init/hw_fini functions are mandatory and raise error message if these functions are not defined. v3: Added 2 new patches to clean get_clocking_state and hw_init validation. Sunil Khatri (15): drm/amdgpu: validate sw_init before function call drm/amdgpu: clean the dummy sw_init

[PATCH v4 04/15] drm/amdgpu: clean the dummy sw_fini functions

2024-10-17 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 v4 11/15] drm/amdgpu: clean the dummy hw_fini functions

2024-10-17 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 v4 12/15] drm/amdgpu: clean the dummy wait_for_idle functions

2024-10-17 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 v4 06/15] drm/amdgpu: validate suspend before function call

2024-10-17 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 v4 15/15] drm/amdgpu: validate get_clockgating_state before use

2024-10-17 Thread Sunil Khatri
Validate the function pointer for get_clockgating_state before making a function call. Signed-off-by: Sunil Khatri --- drivers/gpu/drm/amd/amdgpu/nv.c| 9 ++--- drivers/gpu/drm/amd/amdgpu/soc21.c | 6 -- drivers/gpu/drm/amd/amdgpu/soc24.c | 6 -- 3 files changed, 14 insertions(+)

[PATCH v4 02/15] drm/amdgpu: clean the dummy sw_init functions

2024-10-17 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 v4 03/15] drm/amdgpu: validate sw_fini before function call

2024-10-17 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 v4 14/15] drm/amdgpu: clean unused functions of amd_ip_funcs

2024-10-17 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 v4 10/15] drm/amdgpu: clean the dummy suspend functions

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

  1   2   >