[PATCH] drm/amdgpu: enable FW workaround for VCN 4_0_5

2025-03-28 Thread boyuan.zhang
From: Boyuan Zhang Enabling VCN FW workaround for drm key injection through shared memory for vcn 4_0_5 Signed-off-by: Boyuan Zhang --- drivers/gpu/drm/amd/amdgpu/vcn_v4_0_5.c | 4 1 file changed, 4 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/vcn_v4_0_5.c b/drivers/gpu/drm/amd

[PATCH 2/2] drm/amdgpu/vcn: send session ctx along with msg buffer

2025-02-21 Thread boyuan.zhang
From: Boyuan Zhang Session context buffer is required to be sent along with message buffer Signed-off-by: Boyuan Zhang Tested-by: Yinjie Yao --- drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c | 43 ++--- 1 file changed, 31 insertions(+), 12 deletions(-) diff --git a/drivers/gpu/

[PATCH 1/2] drm/amdgpu/vcn: add session ctx buffer and flag

2025-02-21 Thread boyuan.zhang
From: Boyuan Zhang Define session context buffer addresses and corresponding flag Signed-off-by: Boyuan Zhang Tested-by: Yinjie Yao --- drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h b/d

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

2024-10-29 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/29] drm/amdgpu: set funcs for each vcn instance

2024-10-29 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 Reviewed-by: Christian

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

2024-10-29 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 Acked-by: Sunil Khatri Reviewed-by: Alex Deucher --- drivers/gp

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

2024-10-29 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 14/29] drm/amdgpu: power vcn 4_0 by instance

2024-10-29 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 04/29] drm/amd/pm: add inst to set_powergating_by_smu

2024-10-29 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 12/29] drm/amdgpu: power vcn 2_5 by instance

2024-10-29 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 11/29] drm/amdgpu/vcn: separate gating state by instance

2024-10-29 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 08/29] drm/amdgpu: pass ip_block in set_clockgating_state

2024-10-29 Thread boyuan.zhang
From: Boyuan Zhang Pass ip_block instead of adev in set_clockgating_state() callback functions. Modify set_clockgating_state()for all correspoding ip blocks. v2: remove all changes for is_idle(), remove type casting Signed-off-by: Boyuan Zhang Acked-by: Christian König Reviewed-by: Sunil Khat

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

2024-10-29 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 Reviewed-by: Chr

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

2024-10-29 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 Acked-by: Sunil Khatri Acked-by: Leo Liu Reviewed-by: Alex Deucher --

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

2024-10-29 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. v2: add vcn instance to amdgpu_vcn_save_vcpu_bo() Signed-off-by: Boyuan Zhang Acked-by: Leo Liu Re

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

2024-10-29 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 26/29] drm/amdgpu: setup_ucode for each vcn instance

2024-10-29 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 Acked-by: Leo Liu Reviewed-by: Alex Deucher --- drivers/gpu/d

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

2024-10-29 Thread boyuan.zhang
From: Boyuan Zhang v6: revise patch #3, #5 based on Alex's comments. add reviewed-by/acked-by and rebase patches. v5: revise patch #6, #28 based on Christian's comments. revise patch #7, #8 based on Sunil's comments. revise patch #24 due to Lijo's recent commit. remove patch #28, #29, #31 in v

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

2024-10-29 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 25/29] drm/amdgpu: resume for each vcn instance

2024-10-29 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 Acked-by: Leo Liu Reviewed-by: Alex Deucher --- drivers/gpu/drm/amd/amd

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

2024-10-29 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 Acked-by: Christian König Reviewed-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/vcn_v2_5.c | 313 -

[PATCH 28/29] drm/amdgpu: wait_for_idle for each vcn instance

2024-10-29 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. v2: remove unneeded local variable initialization. Signed-off-by: Boyuan Zhang Acked-by: Leo Liu Reviewed-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/

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

2024-10-29 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 Acked-by: Sunil Khatri Reviewed-by: Alex Deucher --- drivers/gpu/drm/

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

2024-10-29 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 18/29] drm/amdgpu/vcn: separate idle work by instance

2024-10-29 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 16/29] drm/amdgpu: power vcn 4_0_5 by instance

2024-10-29 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 17/29] drm/amdgpu: power vcn 5_0_0 by instance

2024-10-29 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 22/29] drm/amdgpu: sw_fini for each vcn instance

2024-10-29 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 Acked-by: Sunil Khatri --- drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c | 3

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

2024-10-29 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 03/29] drm/amd/pm: add inst to smu_dpm_set_vcn_enable

2024-10-29 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 07/29] drm/amdgpu: pass ip_block in set_powergating_state

2024-10-29 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. v3: remove type casting Signed-off-by: Boyuan Zhang Suggested-by: Christian König Acked-by: C

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

2024-10-29 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 06/29] drm/amdgpu: add inst to amdgpu_dpm_enable_vcn

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

[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

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

2024-10-24 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 08/29] drm/amdgpu: pass ip_block in set_clockgating_state

2024-10-24 Thread boyuan.zhang
From: Boyuan Zhang Pass ip_block instead of adev in set_clockgating_state() callback functions. Modify set_clockgating_state()for all correspoding ip blocks. v2: remove all changes for is_idle(), remove type casting Signed-off-by: Boyuan Zhang Acked-by: Christian König --- drivers/gpu/drm/am

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

2024-10-24 Thread boyuan.zhang
From: Boyuan Zhang v5: revise patch #6, #28 based on Christian's comments. revise patch #7, #8 based on Sunil's comments. revise patch #24 due to Lijo's recent commit. remove patch #28, #29, #31 in v4 based on comments. add reviewed-by/acked-by to patch #1-#19, #27, #29 v4: code polishing and

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

2024-10-24 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 10/29] drm/amdgpu: move per inst variables to amdgpu_vcn_inst

2024-10-24 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 14/29] drm/amdgpu: power vcn 4_0 by instance

2024-10-24 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 26/29] drm/amdgpu: setup_ucode for each vcn instance

2024-10-24 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 17/29] drm/amdgpu: power vcn 5_0_0 by instance

2024-10-24 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 19/29] drm/amdgpu: set powergating state by vcn instance

2024-10-24 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 Reviewed-by: Chr

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

2024-10-24 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 23/29] drm/amdgpu: hw_init for each vcn instance

2024-10-24 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 24/29] drm/amdgpu: suspend for each vcn instance

2024-10-24 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. v2: add vcn instance to amdgpu_vcn_save_vcpu_bo() Signed-off-by: Boyuan Zhang --- drivers/gpu/drm/

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

2024-10-24 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 Reviewed-by: Christian

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

2024-10-24 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 Acked-by: Christian König --- drivers/gpu/drm/amd/amdgpu/vcn_v2_5.c | 313 drivers/gpu/drm/am

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

2024-10-24 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 22/29] drm/amdgpu: sw_fini for each vcn instance

2024-10-24 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 28/29] drm/amdgpu: wait_for_idle for each vcn instance

2024-10-24 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. v2: remove unneeded local variable initialization. Signed-off-by: Boyuan Zhang --- drivers/gpu/drm/amd/amdgpu/vcn_v2_5.c | 16 +++- drivers/gp

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

2024-10-24 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 11/29] drm/amdgpu/vcn: separate gating state by instance

2024-10-24 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 20/29] drm/amdgpu: early_init for each vcn instance

2024-10-24 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 15/29] drm/amdgpu: power vcn 4_0_3 by instance

2024-10-24 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 16/29] drm/amdgpu: power vcn 4_0_5 by instance

2024-10-24 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 18/29] drm/amdgpu/vcn: separate idle work by instance

2024-10-24 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 09/29] drm/amdgpu: track instances of the same IP block

2024-10-24 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 06/29] drm/amdgpu: add inst to amdgpu_dpm_enable_vcn

2024-10-24 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 07/29] drm/amdgpu: pass ip_block in set_powergating_state

2024-10-24 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. v3: remove type casting Signed-off-by: Boyuan Zhang Suggested-by: Christian König Acked-by: C

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

2024-10-24 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 02/29] drm/amd/pm: power up or down vcn by instance

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

[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

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

2024-10-08 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 32/32] drm/amdgpu: set_powergating for each vcn instance

2024-10-08 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 19/32] drm/amdgpu: set powergating state by vcn instance

2024-10-08 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 31/32] drm/amdgpu: is_idle for each vcn instance

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

  1   2   3   >