1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
|
From b379ae77aca9b23994c1a9fe973b84bd041025e0 Mon Sep 17 00:00:00 2001
From: Jonathan Kim <jonathan.kim@amd.com>
Date: Thu, 20 Jun 2019 01:15:29 -0400
Subject: [PATCH 2577/2940] drm/amdgpu: early merge post fix to df_v3_6 for
xgmi
fixed df permon to 4
removed unrequired ret in soc15
changed df init to df sw_init
Change-Id: I0098b86daa33f2dc20b6652104296d0d4e8bd030
Signed-off-by: Jonathan Kim <jonathan.kim@amd.com>
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
---
drivers/gpu/drm/amd/amdgpu/amdgpu.h | 3 ++-
drivers/gpu/drm/amd/amdgpu/df_v3_6.c | 4 ++--
drivers/gpu/drm/amd/amdgpu/soc15.c | 5 ++---
3 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
index 56ff37805142..6972f808b388 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
@@ -703,6 +703,7 @@ struct amdgpu_nbio_funcs {
struct amdgpu_df_funcs {
void (*init)(struct amdgpu_device *adev);
+ void (*sw_init)(struct amdgpu_device *adev);
void (*enable_broadcast_mode)(struct amdgpu_device *adev,
bool enable);
u32 (*get_fb_channel_number)(struct amdgpu_device *adev);
@@ -772,7 +773,7 @@ struct amd_powerplay {
};
#define AMDGPU_RESET_MAGIC_NUM 64
-#define AMDGPU_MAX_DF_PERFMONS 16
+#define AMDGPU_MAX_DF_PERFMONS 4
struct amdgpu_device {
struct device *dev;
struct drm_device *ddev;
diff --git a/drivers/gpu/drm/amd/amdgpu/df_v3_6.c b/drivers/gpu/drm/amd/amdgpu/df_v3_6.c
index 08780fa10f32..7e0e8cda31b7 100644
--- a/drivers/gpu/drm/amd/amdgpu/df_v3_6.c
+++ b/drivers/gpu/drm/amd/amdgpu/df_v3_6.c
@@ -118,7 +118,7 @@ static ssize_t df_v3_6_get_df_cntr_avail(struct device *dev,
static DEVICE_ATTR(df_cntr_avail, S_IRUGO, df_v3_6_get_df_cntr_avail, NULL);
/* init perfmons */
-static void df_v3_6_init(struct amdgpu_device *adev)
+static void df_v3_6_sw_init(struct amdgpu_device *adev)
{
int i, ret;
@@ -491,7 +491,7 @@ static void df_v3_6_pmc_get_count(struct amdgpu_device *adev,
}
const struct amdgpu_df_funcs df_v3_6_funcs = {
- .init = df_v3_6_init,
+ .sw_init = df_v3_6_sw_init,
.enable_broadcast_mode = df_v3_6_enable_broadcast_mode,
.get_fb_channel_number = df_v3_6_get_fb_channel_number,
.get_hbm_channel_number = df_v3_6_get_hbm_channel_number,
diff --git a/drivers/gpu/drm/amd/amdgpu/soc15.c b/drivers/gpu/drm/amd/amdgpu/soc15.c
index be4d88ce4e74..52a7f30334e5 100644
--- a/drivers/gpu/drm/amd/amdgpu/soc15.c
+++ b/drivers/gpu/drm/amd/amdgpu/soc15.c
@@ -1024,6 +1024,8 @@ static int soc15_common_sw_init(void *handle)
if (amdgpu_sriov_vf(adev))
xgpu_ai_mailbox_add_irq_id(adev);
+ adev->df_funcs->sw_init(adev);
+
return 0;
}
@@ -1057,7 +1059,6 @@ static void soc15_doorbell_range_init(struct amdgpu_device *adev)
static int soc15_common_hw_init(void *handle)
{
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
- int ret;
/* enable pcie gen2/3 link */
soc15_pcie_gen3_enable(adev);
@@ -1072,8 +1073,6 @@ static int soc15_common_hw_init(void *handle)
if (adev->nbio_funcs->remap_hdp_registers)
adev->nbio_funcs->remap_hdp_registers(adev);
- adev->df_funcs->init(adev);
-
/* enable the doorbell aperture */
soc15_enable_doorbell_aperture(adev, true);
/* HW doorbell routing policy: doorbell writing not
--
2.17.1
|