packages/linux-lava: fix si patch
This commit is contained in:
parent
f1fe14308e
commit
97cae9af27
1 changed files with 32 additions and 40 deletions
|
|
@ -1,37 +1,35 @@
|
|||
From 8676738da851887056cb4461f70848ddeef35263 Mon Sep 17 00:00:00 2001
|
||||
From 0120e137d9c3aebcb9ac7bd319216a92fbed7499 Mon Sep 17 00:00:00 2001
|
||||
From: LavaDesu <me@lava.moe>
|
||||
Date: Tue, 7 Sep 2021 09:32:22 +0700
|
||||
Date: Mon, 3 Oct 2022 22:55:47 +0700
|
||||
Subject: [PATCH] Lava's amdgpu patches
|
||||
|
||||
---
|
||||
drivers/gpu/drm/amd/amdgpu/amdgpu.h | 6 ++
|
||||
drivers/gpu/drm/amd/amdgpu/amdgpu.h | 4 +
|
||||
drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c | 2 +-
|
||||
drivers/gpu/drm/amd/pm/amdgpu_pm.c | 112 +++++++++++++++++++-
|
||||
drivers/gpu/drm/amd/pm/powerplay/si_dpm.c | 17 +++
|
||||
4 files changed, 131 insertions(+), 6 deletions(-)
|
||||
drivers/gpu/drm/amd/pm/amdgpu_pm.c | 106 ++++++++++++++++++++
|
||||
drivers/gpu/drm/amd/pm/legacy-dpm/si_dpm.c | 17 ++++
|
||||
4 files changed, 128 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
|
||||
index 8ac6eb9f1fd..33ccd30800a 100644
|
||||
index d597e2656c4..6eec6b36c52 100644
|
||||
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h
|
||||
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
|
||||
@@ -212,6 +212,12 @@ extern int amdgpu_mes;
|
||||
extern int amdgpu_noretry;
|
||||
@@ -215,6 +215,10 @@ extern int amdgpu_noretry;
|
||||
extern int amdgpu_force_asic_type;
|
||||
extern int amdgpu_smartshift_bias;
|
||||
+
|
||||
+extern __u32 amdgpu_force_mclk;
|
||||
+extern __u32 amdgpu_force_sclk;
|
||||
+extern __u32 amdgpu_force_vddc;
|
||||
+extern __u32 amdgpu_force_vddci;
|
||||
+
|
||||
extern int amdgpu_use_xgmi_p2p;
|
||||
+extern uint amdgpu_force_mclk;
|
||||
+extern uint amdgpu_force_sclk;
|
||||
+extern uint amdgpu_force_vddc;
|
||||
+extern uint amdgpu_force_vddci;
|
||||
#ifdef CONFIG_HSA_AMD
|
||||
extern int sched_policy;
|
||||
extern bool debug_evictions;
|
||||
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c
|
||||
index a9475b20751..5f558684bd1 100644
|
||||
index 782cbca3753..8cb600cb3b4 100644
|
||||
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c
|
||||
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c
|
||||
@@ -100,7 +100,7 @@ static int amdgpu_dma_buf_attach(struct dma_buf *dmabuf,
|
||||
@@ -58,7 +58,7 @@ static int amdgpu_dma_buf_attach(struct dma_buf *dmabuf,
|
||||
struct amdgpu_device *adev = amdgpu_ttm_adev(bo->tbo.bdev);
|
||||
int r;
|
||||
|
||||
|
|
@ -39,14 +37,14 @@ index a9475b20751..5f558684bd1 100644
|
|||
+ if (pci_p2pdma_distance_many(adev->pdev, &attach->dev, 1, amdgpu_dpm == 1) < 0)
|
||||
attach->peer2peer = false;
|
||||
|
||||
if (attach->dev->driver == adev->dev->driver)
|
||||
r = pm_runtime_get_sync(adev_to_drm(adev)->dev);
|
||||
diff --git a/drivers/gpu/drm/amd/pm/amdgpu_pm.c b/drivers/gpu/drm/amd/pm/amdgpu_pm.c
|
||||
index 769f58d5ae1..614a14bde84 100644
|
||||
index 5e318b3f6c0..8da0b91d3ad 100644
|
||||
--- a/drivers/gpu/drm/amd/pm/amdgpu_pm.c
|
||||
+++ b/drivers/gpu/drm/amd/pm/amdgpu_pm.c
|
||||
@@ -36,6 +36,11 @@
|
||||
@@ -35,6 +35,11 @@
|
||||
#include <linux/pm_runtime.h>
|
||||
#include <asm/processor.h>
|
||||
#include "hwmgr.h"
|
||||
|
||||
+__u32 amdgpu_force_mclk = 0;
|
||||
+__u32 amdgpu_force_sclk = 0;
|
||||
|
|
@ -56,7 +54,7 @@ index 769f58d5ae1..614a14bde84 100644
|
|||
static const struct cg_flag_name clocks[] = {
|
||||
{AMD_CG_SUPPORT_GFX_FGCG, "Graphics Fine Grain Clock Gating"},
|
||||
{AMD_CG_SUPPORT_GFX_MGCG, "Graphics Medium Grain Clock Gating"},
|
||||
@@ -2002,6 +2007,94 @@ static int ss_bias_attr_update(struct amdgpu_device *adev, struct amdgpu_device_
|
||||
@@ -1912,6 +1917,94 @@ static int ss_bias_attr_update(struct amdgpu_device *adev, struct amdgpu_device_
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -151,7 +149,7 @@ index 769f58d5ae1..614a14bde84 100644
|
|||
static struct amdgpu_device_attr amdgpu_device_attrs[] = {
|
||||
AMDGPU_DEVICE_ATTR_RW(power_dpm_state, ATTR_FLAG_BASIC|ATTR_FLAG_ONEVF),
|
||||
AMDGPU_DEVICE_ATTR_RW(power_dpm_force_performance_level, ATTR_FLAG_BASIC|ATTR_FLAG_ONEVF),
|
||||
@@ -2034,6 +2127,11 @@ static struct amdgpu_device_attr amdgpu_device_attrs[] = {
|
||||
@@ -1944,6 +2037,11 @@ static struct amdgpu_device_attr amdgpu_device_attrs[] = {
|
||||
.attr_update = ss_power_attr_update),
|
||||
AMDGPU_DEVICE_ATTR_RW(smartshift_bias, ATTR_FLAG_BASIC,
|
||||
.attr_update = ss_bias_attr_update),
|
||||
|
|
@ -163,16 +161,10 @@ index 769f58d5ae1..614a14bde84 100644
|
|||
};
|
||||
|
||||
static int default_attr_update(struct amdgpu_device *adev, struct amdgpu_device_attr *attr,
|
||||
@@ -2063,11 +2161,15 @@ static int default_attr_update(struct amdgpu_device *adev, struct amdgpu_device_
|
||||
if (asic_type < CHIP_VEGA20)
|
||||
*states = ATTR_STATE_UNSUPPORTED;
|
||||
} else if (DEVICE_ATTR_IS(pp_od_clk_voltage)) {
|
||||
- *states = ATTR_STATE_UNSUPPORTED;
|
||||
- if ((is_support_sw_smu(adev) && adev->smu.od_enabled) ||
|
||||
- (is_support_sw_smu(adev) && adev->smu.is_apu) ||
|
||||
- (!is_support_sw_smu(adev) && hwmgr->od_enabled))
|
||||
- *states = ATTR_STATE_SUPPORTED;
|
||||
+ *states = ATTR_STATE_SUPPORTED;
|
||||
@@ -1976,6 +2074,14 @@ static int default_attr_update(struct amdgpu_device *adev, struct amdgpu_device_
|
||||
*states = ATTR_STATE_UNSUPPORTED;
|
||||
if (amdgpu_dpm_is_overdrive_supported(adev))
|
||||
*states = ATTR_STATE_SUPPORTED;
|
||||
+ } else if (DEVICE_ATTR_IS(pp_override_mclk)) {
|
||||
+ *states = ATTR_STATE_SUPPORTED;
|
||||
+ } else if (DEVICE_ATTR_IS(pp_override_sclk)) {
|
||||
|
|
@ -182,13 +174,13 @@ index 769f58d5ae1..614a14bde84 100644
|
|||
+ } else if (DEVICE_ATTR_IS(pp_override_vddci)) {
|
||||
+ *states = ATTR_STATE_SUPPORTED;
|
||||
} else if (DEVICE_ATTR_IS(mem_busy_percent)) {
|
||||
if (adev->flags & AMD_IS_APU || asic_type == CHIP_VEGA10)
|
||||
if (adev->flags & AMD_IS_APU || gc_ver == IP_VERSION(9, 0, 1))
|
||||
*states = ATTR_STATE_UNSUPPORTED;
|
||||
diff --git a/drivers/gpu/drm/amd/pm/powerplay/si_dpm.c b/drivers/gpu/drm/amd/pm/powerplay/si_dpm.c
|
||||
index 15c0b8af376..31e520d5e21 100644
|
||||
--- a/drivers/gpu/drm/amd/pm/powerplay/si_dpm.c
|
||||
+++ b/drivers/gpu/drm/amd/pm/powerplay/si_dpm.c
|
||||
@@ -3492,6 +3492,23 @@ static void si_apply_state_adjust_rules(struct amdgpu_device *adev,
|
||||
diff --git a/drivers/gpu/drm/amd/pm/legacy-dpm/si_dpm.c b/drivers/gpu/drm/amd/pm/legacy-dpm/si_dpm.c
|
||||
index 49c398ec0aa..1f3f8a210e7 100644
|
||||
--- a/drivers/gpu/drm/amd/pm/legacy-dpm/si_dpm.c
|
||||
+++ b/drivers/gpu/drm/amd/pm/legacy-dpm/si_dpm.c
|
||||
@@ -3507,6 +3507,23 @@ static void si_apply_state_adjust_rules(struct amdgpu_device *adev,
|
||||
&max_mclk_vddc);
|
||||
|
||||
for (i = 0; i < ps->performance_level_count; i++) {
|
||||
|
|
@ -213,5 +205,5 @@ index 15c0b8af376..31e520d5e21 100644
|
|||
if (ps->performance_levels[i].sclk > max_sclk_vddc)
|
||||
ps->performance_levels[i].sclk = max_sclk_vddc;
|
||||
--
|
||||
2.32.0
|
||||
2.36.1
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue