[PATCH] drm/amdgpu: Use the slab allocator to reduce job allocation fragmentation

2024-05-10 Thread Prike Liang
Using kzalloc() results in about 50% memory fragmentation, therefore use the slab allocator to reproduce memory fragmentation. Signed-off-by: Prike Liang --- drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 1 + drivers/gpu/drm/amd/amdgpu/amdgpu_job.c | 26 - drivers/gpu/drm

[PATCH 1/3] drm/amdgpu: Add AMDGPU benchmark dump function skeleton

2024-04-16 Thread Prike Liang
This will add the following bechmark dump for the amdgpu driver performance tunning. 1. AMDGPU hardware configuration. 2. AMDGPU engine clock setting 3. AMDGPU link speed 4. AMDGPU momory move performance Signed-off-by: Prike Liang --- drivers/gpu/drm/amd/amdgpu/amdgpu.h | 1

[PATCH 2/3] drm/amdgpu: add firmware info to benchmark metrics

2024-04-16 Thread Prike Liang
Export the firmware info in the benchmark metrics. Signed-off-by: Prike Liang --- drivers/gpu/drm/amd/amdgpu/amdgpu_benchmark.c | 4 drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.h | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 5 + 3 files changed, 10 insertions(+), 1 deletion

[PATCH 3/3] drm/amdgpu: add the amdgpu buffer object move speed metrics

2024-04-16 Thread Prike Liang
Add the amdgpu buffer object move speed metrics. Signed-off-by: Prike Liang --- drivers/gpu/drm/amd/amdgpu/amdgpu.h | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_benchmark.c | 78 ++- drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c | 2 +- 3 files changed, 61 insertions

[PATCH] drm/amdgpu: Fix the ring buffer size for queue VM flush

2024-03-26 Thread Prike Liang
. Signed-off-by: Prike Liang --- drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 3 +-- drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c | 3 +-- drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 5 - 3 files changed, 2 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c b/drivers/gpu/drm

[PATCH] drm/amdgpu: correct the KGQ fallback message

2024-03-13 Thread Prike Liang
Fix the KGQ fallback function name, as this will help differentiate the failure in the KCQ enablement. Signed-off-by: Prike Liang --- drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c b/drivers

[PATCH] drm/amdgpu: Enable gpu reset for S3 abort cases on Raven series

2024-02-22 Thread Prike Liang
Currently, GPU resets can now be performed successfully on the Raven series. While GPU reset is required for the S3 suspend abort case. So now can enable gpu reset for S3 abort cases on the Raven series. Signed-off-by: Prike Liang --- drivers/gpu/drm/amd/amdgpu/soc15.c | 45

[PATCH] drm/amdgpu: Enable gpu reset for S3 abort cases on Raven series

2024-02-22 Thread Prike Liang
Currently, GPU resets can now be performed successfully on the Raven series. While GPU reset is required for the S3 suspend abort case. So now can enable gpu reset for S3 abort cases on the Raven series. Signed-off-by: Prike Liang --- drivers/gpu/drm/amd/amdgpu/soc15.c | 45

[PATCH 1/2] drm/amdgpu: skip to program GFXDEC registers for suspend abort

2024-02-01 Thread Prike Liang
In the suspend abort cases, the gfx power rail doesn't turn off so some GFXDEC registers/CSB can't reset to default value and at this moment reinitialize GFXDEC/CSB will result in an unexpected error. So let skip those program sequence for the suspend abort case. Signed-off-by: Prike Liang

[PATCH 2/2] drm/amdgpu: reset gpu for s3 suspend abort case

2024-02-01 Thread Prike Liang
In the s3 suspend abort case some type of gfx9 power rail not turn off from FCH side and this will put the GPU in an unknown power status, so let's reset the gpu to a known good power state before reinitialize gpu device. Signed-off-by: Prike Liang --- drivers/gpu/drm/amd/amdgpu/soc15.c | 22

[PATCH 2/2] drm/amdgpu: reset gpu for pm abort case

2024-01-24 Thread Prike Liang
In the pm abort case the gfx power rail not turn off from FCH side and this will lead to the gfx reinitialized failed base on the unknown gfx HW status, so let's reset the gpu to a known good power state. Signed-off-by: Prike Liang --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 5

[PATCH 1/2] drm/amdgpu: skip to program GFXDEC registers for PM abort case

2024-01-24 Thread Prike Liang
In the PM abort cases, the gfx power rail doesn't turn off so some GFXDEC registers/CSB can't reset to default vaule. In order to avoid unexpected problem now need skip to program GFXDEC registers and bypass issue CSB packet for PM abort case. Signed-off-by: Prike Liang --- drivers/gpu/drm/amd

[PATCH 1/2] drm/amdgpu: skip to program GFXDEC registers for PM abort case

2024-01-23 Thread Prike Liang
In the PM abort cases, the gfx power rail doesn't turn off so some GFXDEC registers/CSB can't reset to default vaule. In order to avoid unexpected problem now need skip to program GFXDEC registers and bypass issue CSB packet for PM abort case. Signed-off-by: Prike Liang --- drivers/gpu/drm/amd

[PATCH 2/2] drm/amdgpu: reset gpu for pm abort case

2024-01-23 Thread Prike Liang
In the pm abort case the gfx power rail not turn off from FCH side and this will lead to the gfx reinitialized failed base on the unknown gfx HW status, so let's reset the gpu to a known good power state. Signed-off-by: Prike Liang --- drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 5 + drivers

[PATCH v2] drm/amdgpu: correct the amdgpu runtime dereference usage count

2023-11-16 Thread Prike Liang
Fix the amdgpu runpm dereference usage count. Signed-off-by: Prike Liang --- v2: remove goto clause and return directly(Alex) drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 9 +++-- 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c b

[PATCH] drm/amdgpu: correct the amdgpu runtime dereference usage count

2023-11-13 Thread Prike Liang
Fix the amdgpu runpm dereference usage count. Signed-off-by: Prike Liang --- drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c index

[PATCH 2/2] drm/amdgpu: add amdgpu runpm usage trace for separate funcs

2023-11-08 Thread Prike Liang
in the amdgpu runpm usage dereference. Signed-off-by: Prike Liang --- drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c | 4 drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c | 7 ++- drivers/gpu/drm/amd/amdgpu/amdgpu_trace.h | 15 +++ 3 files changed, 25 insertions(+), 1 deletion(-) diff

[PATCH 1/2] drm/amdgpu: correct the amdgpu runtime dereference usage count

2023-11-08 Thread Prike Liang
Fix the amdgpu runpm dereference usage count. Signed-off-by: Prike Liang --- drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c b

[PATCH] drm/amdgpu: needn't set aggregated doorbell for map queue

2023-11-08 Thread Prike Liang
Needn't set aggregated doorbell for map queue and remove the dead code. Signed-off-by: Prike Liang --- drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 6 -- drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c | 4 2 files changed, 10 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c b

[PATCH] drm/amdgpu: only save and restore GPU device config at GPU error

2023-07-27 Thread Prike Liang
There's need a check on the GPU error state before save and restore GPU device config space. Signed-off-by: Prike Liang --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu

[PATCH] drm/amdgpu: enable SDMA MGCG for SDMA 5.2.x

2023-07-27 Thread Prike Liang
Now the SDMA firmware support SDMA MGCG properly, so let's enable it from the driver side. Signed-off-by: Prike Liang --- drivers/gpu/drm/amd/amdgpu/nv.c| 6 -- drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c | 27 +- 2 files changed, 30 insertions(+), 3 deletions

[PATCH] drm/amdgpu: enable SDMA MGCG for SDMA 5.2.x

2023-07-25 Thread Prike Liang
Now the SDMA firmware support SDMA MGCG properly, so let's enable it from the driver side. Signed-off-by: Prike Liang --- drivers/gpu/drm/amd/amdgpu/nv.c| 6 -- drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/gpu

[PATCH v2] drm/amdgpu/sdma_v4_0: turn off SDMA ring buffer in the s2idle suspend

2022-11-30 Thread Prike Liang
Cc: sta...@vger.kernel.org # 6.0 Fixes: f8f4e2a51834 ("drm/amdgpu: skipping SDMA hw_init and hw_fini for S0ix.") Signed-off-by: Prike Liang --- -v2: change the name sdma_v4_0_gfx_stop() to sdma_v4_0_gfx_enable() (Lijo) --- drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c | 24 +++--

[PATCH] drm/amdgpu/sdma_v4_0: turn off SDMA ring buffer in the s2idle suspend

2022-11-30 Thread Prike Liang
Cc: sta...@vger.kernel.org # 6.0 Fixes: f8f4e2a51834 ("drm/amdgpu: skipping SDMA hw_init and hw_fini for S0ix.") Signed-off-by: Prike Liang --- drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c | 18 -- 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/drivers/g

[PATCH v2] drm/amdgpu: disallow gfxoff until GC IP blocks complete s2idle resume

2022-10-21 Thread Prike Liang
In the S2idle suspend/resume phase the gfxoff is keeping functional so some IP blocks will be likely to reinitialize at gfxoff entry and that will result in failing to program GC registers.Therefore, let disallow gfxoff until AMDGPU IPs reinitialized completely. Signed-off-by: Prike Liang

[PATCH] drm/amdgpu: disallow gfxoff until GC IP blocks complete s2idle resume

2022-10-20 Thread Prike Liang
In the S2idle suspend/resume phase the gfxoff is keeping functional so some IP blocks will be likely to reinitialize at gfxoff entry and that will result in failing to program GC registers.Therefore, let disallow gfxoff until AMDGPU IPs reinitialized completely. Signed-off-by: Prike Liang

[PATCH 2/2] drm/amdkfd: update gfx1037 Lx cache setting

2022-10-20 Thread Prike Liang
Update the gfx1037 L1/L2/L3 cache setting. Signed-off-by: Prike Liang --- drivers/gpu/drm/amd/amdkfd/kfd_crat.c | 53 +++ 1 file changed, 53 insertions(+) diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_crat.c b/drivers/gpu/drm/amd/amdkfd/kfd_crat.c index 960046e43b7a

[PATCH 1/2] drm/amdkfd: introduce dummy cache info for property asic

2022-10-20 Thread Prike Liang
This dummy cache info will enable kfd base function support. Signed-off-by: Prike Liang --- drivers/gpu/drm/amd/amdkfd/kfd_crat.c | 55 +-- 1 file changed, 52 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_crat.c b/drivers/gpu/drm/amd/amdkfd

[PATCH] drm/amdkfd: Fix isa version for the GC 10.3.7

2022-08-24 Thread Prike Liang
Correct the isa version for handling KFD test. Fixes: 7c4f4f197e0c ("drm/amdkfd: Add GC 10.3.6 and 10.3.7 KFD definitions") Signed-off-by: Prike Liang --- drivers/gpu/drm/amd/amdkfd/kfd_device.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/

[PATCH] drm/amdkfd: correct the MEC atomic support firmware checking for GC 10.3.7

2022-07-11 Thread Prike Liang
On the GC 10.3.7 platform the initial MEC release version #3 can support atomic operation,so need correct and set its MEC atomic support version to #3. Signed-off-by: Prike Liang --- drivers/gpu/drm/amd/amdkfd/kfd_device.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm

[PATCH] drm/amdgpu: clean up asd on the ta_firmware_header_v2_0

2022-05-20 Thread Prike Liang
On the psp13 series use ta_firmware_header_v2_0 and the asd firmware was buildin ta, so needn't request asd firmware separately. Signed-off-by: Prike Liang --- drivers/gpu/drm/amd/amdgpu/psp_v13_0.c | 6 -- 1 file changed, 6 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/psp_v13_0.c

[PATCH] drm/amdgpu: keep mmhub clock gating being enabled during s2idle suspend

2022-04-25 Thread Prike Liang
Without MMHUB clock gating being enabled then MMHUB will not disconnect from DF and will result in DF C-state entry can't be accessed during S2idle suspend, and eventually s0ix entry will be blocked. Signed-off-by: Prike Liang --- drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c | 10 ++ 1 file

[PATCH] drm/amdgpu: keep mmhub clock gating being enabled during s2idle suspend

2022-04-19 Thread Prike Liang
Without MMHUB clock gating being enabled then MMHUB will not disconnect from DF and will result in DF C-state entry can't be accessed during S2idle suspend, and eventually s0ix entry will be blocked. Signed-off-by: Prike Liang --- drivers/gpu/drm/amd/amdgpu/mmhub_v2_3.c | 9 + 1 file

[PATCH] drm/amdgpu/gfx10: enable gfx1037 clock counter retrieval function

2022-03-24 Thread Prike Liang
Enable gfx1037 clock counter retrieval function for KFDPerfCountersTest.ClockCountersBasicTest. Signed-off-by: Prike Liang --- drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c b/drivers/gpu/drm/amd/amdgpu

[PATCH] drm/amdgpu: set noretry for gfx 10.3.7

2022-03-23 Thread Prike Liang
Disable xnack on the isa gfx10.3.6. Signed-off-by: Prike Liang --- drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c index e1635a3f2553..a66a0881a934 100644 --- a/drivers

[PATCH 3/3] drm/amdgpu: enable gfxoff routine for GC 10.3.7

2022-03-01 Thread Prike Liang
Enable gfxoff routine for GC 10.3.7. Signed-off-by: Prike Liang --- drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 3 +++ drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c | 1 + 2 files changed, 4 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c b/drivers/gpu/drm/amd/amdgpu

[PATCH 2/3] drm/amdgpu: enable gfx power gating for GC 10.3.7

2022-03-01 Thread Prike Liang
Enable gfx power gating for GC 10.3.7. Signed-off-by: Prike Liang --- drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 2 ++ drivers/gpu/drm/amd/amdgpu/nv.c| 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c b/drivers/gpu/drm/amd/amdgpu

[PATCH 1/3] drm/amdgpu/nv: enable clock gating for GC 10.3.7 subblock

2022-03-01 Thread Prike Liang
This will enable the following block clock gating. - MC - SDMA - HDP - ATHUB - IH - VCN/JPEG Signed-off-by: Prike Liang --- drivers/gpu/drm/amd/amdgpu/nv.c | 12 +++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/nv.c b/drivers/gpu/drm

[PATCH] drm/amdgpu: enable gfx clock gating control for GC 10.3.7

2022-02-28 Thread Prike Liang
Enable gfx cg gate/ungate control for GC 10.3.7. Signed-off-by: Prike Liang --- drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c index 90158289cd30..fd7ded7799e2 100644

[PATCH 2/2] drm/amdgpu/nv: set mode2 reset for MP1 13.0.8

2022-02-22 Thread Prike Liang
Set mode2 reset support for MP1 13.0.8. Signed-off-by: Prike Liang --- drivers/gpu/drm/amd/amdgpu/nv.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/amd/amdgpu/nv.c b/drivers/gpu/drm/amd/amdgpu/nv.c index 5f375f3430e1..f414b7ca0ab7 100644 --- a/drivers/gpu/drm/amd/amdgpu

[PATCH 1/2] drm/amdgpu/nv: enable gfx10.3.7 clock gating support

2022-02-22 Thread Prike Liang
This will enable the following gfx clock gating. - Fine clock gating - Medium Grain clock gating - 3D Coarse clock gating - Coarse Grain clock gating - RLC/CP light sleep clock gating Signed-off-by: Prike Liang --- drivers/gpu/drm/amd/amdgpu/nv.c | 10 +- 1 file changed, 9 insertions

[PATCH v2] drm/amd/pm: validate SMU feature enable message for getting feature enabled mask

2022-02-17 Thread Prike Liang
There's always miss the SMU feature enabled checked in the NPI phase, so let validate the SMU feature enable message directly rather than add more and more MP1 version check. Signed-off-by: Prike Liang Signed-off-by: Lijo Lazar --- .../amd/pm/swsmu/smu11/cyan_skillfish_ppt.c | 12

[PATCH] drm/amd/pm: validate SMU feature enable message for getting feature enabled mask

2022-02-17 Thread Prike Liang
There's always miss the SMU feature enabled checked in the NPI phase, so let validate the SMU feature enable message directly rather than add more and more MP1 version check. Signed-off-by: Prike Liang --- drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c | 28 ++ 1 file changed, 6

[PATCH] drm/amdgpu: enable TMZ option for onwards asic

2022-02-17 Thread Prike Liang
The TMZ is disabled by default and enable TMZ option for the IP discovery based asic will help on the TMZ function verification. Signed-off-by: Prike Liang --- drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c b

[PATCH] drm/amdgpu: enable TMZ option for onwards asic

2022-02-17 Thread Prike Liang
The TMZ is disabled by default and enable TMZ option for the IP discovery based asic will help on the TMZ function verification. Signed-off-by: Prike Liang --- drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c b

[PATCH] drm/amdgpu: not return error on the init_apu_flags

2022-01-09 Thread Prike Liang
In some APU project we needn't always assign flags to identify each other, so we may not need return an error. Change-Id: I92c1acb9ffbdba7e9a68469163911801db262412 Signed-off-by: Prike Liang Reviewed-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 6 ++ 1 file changed, 2

[PATCH v2] drm/amd/pm: skip setting gfx cgpg in the s0ix suspend-resume

2021-12-13 Thread Prike Liang
In the s0ix entry need retain gfx in the gfxoff state,so here need't set gfx cgpg in the S0ix suspend-resume process. Moreover move the S0ix check into SMU12 can simplify the code condition check. Signed-off-by: Prike Liang --- v1->v2: - Move s0ix check into SMU12. --- drivers/gpu/drm/amd

[PATCH] drm/amd/pm: skip gfx cgpg in the s0ix suspend-resume

2021-12-09 Thread Prike Liang
In the s0ix entry need retain gfx in the gfxoff state,we don't disable gfx cgpg in the suspend so there is also needn't enable gfx cgpg in the s0ix resume. Signed-off-by: Prike Liang --- drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff

[PATCH v3] drm/amdgpu: reset asic after system-wide suspend aborted (v3)

2021-11-24 Thread Prike Liang
and add GPU hive case check for GPU reset. v3: Some dGPU reset method not support at the early resume time and temprorary skip the dGPU case. Signed-off-by: Prike Liang --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 8 1 file changed, 8 insertions(+) diff --git a/drivers/gpu/drm/amd

[PATCH v2] drm/amdgpu: reset asic after system-wide suspend aborted (v2)

2021-11-24 Thread Prike Liang
and add GPU hive case check for GPU reset. Signed-off-by: Prike Liang --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 8 1 file changed, 8 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c index 7d4115d..3fcd90d 100644

[PATCH] drm/amdgpu: reset asic after system-wide suspend aborted

2021-11-17 Thread Prike Liang
Do ASIC reset at the moment Sx suspend aborted behind of amdgpu suspend to keep AMDGPU in a clean reset state and that can avoid re-initialize device improperly error. Signed-off-by: Prike Liang --- drivers/gpu/drm/amd/amdgpu/amdgpu.h| 1 + drivers/gpu/drm/amd/amdgpu/amdgpu_device.c

[PATCH] drm/amdgpu: force exit gfxoff on sdma resume for rmb s0ix

2021-09-26 Thread Prike Liang
In the s2idle stress test sdma resume fail occasionally,in the failed case GPU is in the gfxoff state.This issue may introduce by FSDL miss handle doorbell S/R and now temporary fix the issue by forcing exit gfxoff for sdma resume. Signed-off-by: Prike Liang --- drivers/gpu/drm/amd/amdgpu

[PATCH] drm/amdgpu: force exit gfxoff on sdma resume for rmb s0ix

2021-09-23 Thread Prike Liang
In the s2idle stress test sdma resume fail occasionally,in the failed case GPU is in the gfxoff state.This issue may introduce by FSDL miss handle doorbell S/R and now temporary fix the issue by forcing exit gfxoff for sdma resume. Signed-off-by: Prike Liang --- drivers/gpu/drm/amd/amdgpu

[PATCH] drm/amdgpu: fix the hibernation suspend with s0ix

2021-03-08 Thread Prike Liang
During system hibernation suspend still need un-gate gfx CG/PG firstly to handle HW status check before HW resource destory. Signed-off-by: Prike Liang --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/amd

[PATCH] drm/amdgpu: fix shutdown and poweroff process failed with s0ix

2021-02-22 Thread Prike Liang
t;drm/amdgpu: update amdgpu device suspend/resume sequence for s0i3 support") Signed-off-by: Alex Deucher Signed-off-by: Prike Liang --- drivers/gpu/drm/amd/amdgpu/amdgpu.h| 6 ++ drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 6 -- drivers/gpu/drm/amd/amdgpu/amdgpu_dr

[PATCH] drm/amdgpu/pm: no need GPU status set since mmnbif_gpu_BIF_DOORBELL_FENCE_CNTL added in FSDL

2021-01-18 Thread Prike Liang
In the renoir there is no need GpuChangeState message set to exit gfxoff in the s0i3 resume since mmnbif_gpu_BIF_DOORBELL_FENCE_CNTL has been added in the s0i3 FSDL. Signed-off-by: Prike Liang --- drivers/gpu/drm/amd/pm/swsmu/smu12/renoir_ppt.c | 2 +- 1 file changed, 1 insertion(+), 1

[PATCH 4/4] drm/amd/pm: add gfx_state_change_set() for rn gfx power switch

2020-11-12 Thread Prike Liang
The gfx_state_change_set() funtion can support set GFX power change status to D0/D3. Signed-off-by: Prike Liang --- drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c | 18 +- drivers/gpu/drm/amd/pm/inc/amdgpu_smu.h | 2 ++ drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c

[PATCH 3/4] drm/amdgpu: update amdgpu device suspend/resume sequence for s0i3 support

2020-11-12 Thread Prike Liang
the SDMA hang. - Need handle the GPU reset path during amdgpu device suspend. Signed-off-by: Prike Liang Reviewed-by: Alex Deucher Acked-by: Huang Rui --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 15 +++ 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/drivers/gpu

[PATCH 1/4] drm/amdgpu: add s0i3 capacity check for s0i3 routine

2020-11-12 Thread Prike Liang
add amdgpu_acpi_is_s0ix_supported() to check the platform whether support s0i3. Signed-off-by: Prike Liang Reviewed-by: Alex Deucher Acked-by: Huang Rui --- drivers/gpu/drm/amd/amdgpu/amdgpu.h | 2 ++ drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c | 14 ++ 2 files changed, 16

[PATCH 2/4] drm/amdgpu: add amdgpu_gfx_state_change_set() set gfx power change entry

2020-11-12 Thread Prike Liang
The new amdgpu_gfx_state_change_set() funtion can support set GFX power change status to D0/D3. Signed-off-by: Prike Liang Acked-by: Huang Rui Reviewed-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c | 20 drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.h

[PATCH 1/5] drm/amdgpu: add s0i3 capacity check for s0i3 routine

2020-11-11 Thread Prike Liang
add amdgpu_acpi_is_s0ix_supported() to check the platform whether support s0i3. Signed-off-by: Prike Liang Reviewed-by: Alex Deucher Acked-by: Huang Rui --- drivers/gpu/drm/amd/amdgpu/amdgpu.h | 2 ++ drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c | 14 ++ 2 files changed, 16

[PATCH 4/5] drm/amdgpu: fix reset support for s0i3 enablement

2020-11-11 Thread Prike Liang
update amdgpu device suspend sequence for gpu reset during s0i3 enable. Signed-off-by: Prike Liang --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu

[PATCH 3/5] drm/amdgpu: update amdgpu device suspend/resume sequence for s0i3 support

2020-11-11 Thread Prike Liang
the SDMA hang. Signed-off-by: Prike Liang Reviewed-by: Alex Deucher Acked-by: Huang Rui --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 15 +++ 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu

[PATCH 5/5] drm/amd/pm: add gfx_state_change_set() for rn gfx power switch

2020-11-11 Thread Prike Liang
The gfx_state_change_set() funtion can support set GFX power change status to D0/D3. Signed-off-by: Prike Liang --- drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c | 3 +++ drivers/gpu/drm/amd/pm/inc/amdgpu_smu.h | 2 ++ drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 10

[PATCH 2/5] drm/amdgpu: add amdgpu_gfx_state_change_set() set gfx power change entry

2020-11-11 Thread Prike Liang
The new amdgpu_gfx_state_change_set() funtion can support set GFX power change status to D0/D3. Signed-off-by: Prike Liang Acked-by: Huang Rui Reviewed-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c | 20 drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.h

[PATCH 3/4] drm/amdgpu: update amdgpu device suspend/resume sequence for s0i3 support

2020-10-16 Thread Prike Liang
the SDMA hang. Signed-off-by: Prike Liang Reviewed-by: Alex Deucher Acked-by: Huang Rui --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 16 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu

[PATCH 4/4] drm/amdgpu: fix reset support for s0i3 enablement

2020-10-16 Thread Prike Liang
update amdgpu device suspend sequence for gpu reset during s0i3 enable. Signed-off-by: Prike Liang --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu

[PATCH 1/4] drm/amdgpu: add s0i3 capacity check for s0i3 routine

2020-10-16 Thread Prike Liang
add amdgpu_acpi_is_s0ix_supported() to check the platform whether support s0i3. Signed-off-by: Prike Liang Reviewed-by: Alex Deucher Acked-by: Huang Rui --- drivers/gpu/drm/amd/amdgpu/amdgpu.h | 2 ++ drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c | 14 ++ 2 files changed, 16

[PATCH 2/4] drm/amdgpu: add amdgpu_gfx_state_change_set() set gfx power change entry

2020-10-16 Thread Prike Liang
The new amdgpu_gfx_state_change_set() funtion can support set GFX power change status to D0/D3. Signed-off-by: Prike Liang Acked-by: Huang Rui Reviewed-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c | 20 drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.h

[PATCH] drm/amd/powerplay: update smu12_driver_if.h to align with pmfw

2020-04-19 Thread Prike Liang
Update the smu12_driver_if.h header to follow the pmfw release. Signed-off-by: Prike Liang Reviewed-by: Alex Deucher --- .../gpu/drm/amd/powerplay/inc/smu12_driver_if.h| 40 ++ 1 file changed, 25 insertions(+), 15 deletions(-) diff --git a/drivers/gpu/drm/amd/powerplay

[PATCH] drm/amd/powerplay: fix resume failed as smu table initialize early exit

2020-04-15 Thread Prike Liang
When the amdgpu in the suspend/resume loop need notify the dpm disabled, otherwise the smu table will be uninitialize and result in resume failed. Signed-off-by: Prike Liang Tested-by: Mengbing Wang --- drivers/gpu/drm/amd/powerplay/renoir_ppt.c | 7 ++- 1 file changed, 6 insertions(+), 1

[PATCH] drm/amdgpu: fix the hw hang during perform system reboot and reset

2020-04-13 Thread Prike Liang
Unify set device CGPG to ungate state before enter poweroff or reset. Signed-off-by: Prike Liang Tested-by: Mengbing Wang --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd

[PATCH v2] drm/amdgpu: fix gfx hang during suspend with video playback (v2)

2020-04-07 Thread Prike Liang
instead of RLC safe mode guard. Signed-off-by: Prike Liang Tested-by: Mengbing Wang --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c index

[PATCH] drm/amd/powerplay: update smu12_driver_if.h to align with pmfw

2020-04-03 Thread Prike Liang
Update the smu12_driver_if.h header to follow the pmfw release. Signed-off-by: Prike Liang --- .../gpu/drm/amd/powerplay/inc/smu12_driver_if.h| 42 ++ 1 file changed, 27 insertions(+), 15 deletions(-) diff --git a/drivers/gpu/drm/amd/powerplay/inc/smu12_driver_if.h b

[PATCH] drm/amd/powerplay: implement the is_dpm_running()

2020-04-03 Thread Prike Liang
As the pmfw hasn't exported the interface of SMU feature mask to APU SKU so just force on all the features to driver inquired interface at early initial stage. Signed-off-by: Prike Liang --- drivers/gpu/drm/amd/powerplay/renoir_ppt.c | 12 1 file changed, 12 insertions(+) diff

[PATCH] drm/amdgpu: fix gfx hang during suspend with video playback

2020-04-02 Thread Prike Liang
The system will be hang up during S3 as SMU is pending at GC not respose the register CP_HQD_ACTIVE access request and this issue can be fixed by adding RLC safe mode guard before each HQD map/unmap retrive opt. Signed-off-by: Prike Liang Tested-by: Mengbing Wang --- drivers/gpu/drm/amd/amdgpu

[PATCH] drm/amd/powerplay: fix the coverity warning about negative check for an unsigned value

2020-03-09 Thread Prike Liang
There will be a coverity warning because min and max are both unsigned. Signed-off-by: Prike Liang --- drivers/gpu/drm/amd/powerplay/amdgpu_smu.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c b/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c index

[PATCH 2/2] drm/amd/powerplay: map mclk to fclk for COMBINATIONAL_BYPASS case

2020-03-03 Thread Prike Liang
When hit COMBINATIONAL_BYPASS the mclk will be bypass and can export fclk frequency to user usage. Signed-off-by: Prike Liang --- drivers/gpu/drm/amd/powerplay/renoir_ppt.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/amd/powerplay/renoir_ppt.c b

[PATCH 1/2] drm/amd/powerplay: fix pre-check condition for setting clock range

2020-03-03 Thread Prike Liang
This fix will handle some MP1 FW issue like as mclk dpm table in renoir has a reverse dpm clock layout and a zero frequency dpm level as following case. cat pp_dpm_mclk 0: 1200Mhz 1: 1200Mhz 2: 800Mhz 3: 0Mhz Signed-off-by: Prike Liang --- drivers/gpu/drm/amd/powerplay/amdgpu_smu.c | 2

[PATCH] drm/amd/powerplay: suppress nonsupport profile mode overrun message

2019-12-18 Thread Prike Liang
SMU12 not support WORKLOAD_DEFAULT_BIT and WORKLOAD_PPLIB_POWER_SAVING_BIT. Signed-off-by: Prike Liang --- drivers/gpu/drm/amd/powerplay/renoir_ppt.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/amd/powerplay/renoir_ppt.c b/drivers/gpu/drm/amd

[PATCH v2] drm/amd/powerplay:clean up the residual mutex for smu_hw_init

2019-06-25 Thread Prike Liang
The mutex for procting SMU during hw_init was removed as system will be deadlock when smu_populate_umd_state_clk try get SMU mutex. Therefore need remove the residual mutex from failed path. Change-Id: Id8019c01b9496c067efda4817a46983e4da3b6e4 Signed-off-by: Prike Liang --- drivers/gpu/drm/amd

[PATCH] drm/amd/powerplay:clean up the residual mutex for smu_hw_init

2019-06-24 Thread Prike Liang
Change-Id: I1f071e465c97f70048df5b24466bc7e225833c7f Signed-off-by: Prike Liang --- drivers/gpu/drm/amd/powerplay/amdgpu_smu.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c b/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c index edd1da6..0be2845 100644

[PATCH] drm/amd/powerplay: detect version of smu backend

2019-06-14 Thread Prike Liang
Change-Id: Ib050c8cf0c2c5af4c1f747cf596860f9be01a2d3 Signed-off-by: Prike Liang --- drivers/gpu/drm/amd/powerplay/hwmgr/hwmgr.c | 1 + drivers/gpu/drm/amd/powerplay/inc/hwmgr.h | 1 + drivers/gpu/drm/amd/powerplay/smumgr/ci_smumgr.c| 1 + drivers/gpu/drm/amd

[PATCH v2 2/2] drm/amd/amdgpu: add RLC firmware to support raven1 refresh

2019-06-03 Thread Prike Liang
Use SMU firmware version to indentify the raven1 refresh device and then load homologous RLC FW. Change-Id: I7aaa67d8b59cfec03355d9199f7fb2c30ce39856 Signed-off-by: Prike Liang Suggested-by: Huang Rui Reviewed-by: Huang Rui --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 12

[PATCH 2/2] drm/amd/amdgpu: add RLC firmware to support raven1 refresh

2019-05-31 Thread Prike Liang
Use SMU firmware version to indentify the raven1 refresh device and then load homologous RLC FW. Change-Id: I7aaa67d8b59cfec03355d9199f7fb2c30ce39856 Signed-off-by: Prike Liang Suggested-by: Ray Huang --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 12 +++- drivers/gpu/drm/amd/amdgpu

[PATCH 1/2] drm/amd/powerplay: add set_power_profile_mode for raven1_refresh

2019-05-31 Thread Prike Liang
From: Chengming Gui add gfxoff_state_changed_by_workload to control gfxoff when set power_profile_mode Signed-off-by: Chengming Gui --- drivers/gpu/drm/amd/powerplay/hwmgr/hwmgr.c | 1 + drivers/gpu/drm/amd/powerplay/hwmgr/smu10_hwmgr.c | 31 ---

[PATCH] drm/amd/powerplay:clean up phm_enable_clock_power_gatings

2018-12-25 Thread Prike Liang
As the PG was setted by each IP block durinng IP early init thus remove the unused phm_enable_clock_power_gatings related funcs. Change-Id: I4d2858f35aaf61ab6457cff3f73409726e52c980 Signed-off-by: Prike Liang --- drivers/gpu/drm/amd/powerplay/hwmgr/hardwaremanager.c | 9 - drivers/gpu