aboutsummaryrefslogtreecommitdiffstats
path: root/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/1347-drm-amd-powerplay-add-interface-to-allocate-memory-p.patch
blob: 19e9dcecf79ad29679b7c3d8e477fb5614303751 (plain)
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
From 686c04c99775e8b0b2af7b04ddfe461e6ade5c6f Mon Sep 17 00:00:00 2001
From: Huang Rui <ray.huang@amd.com>
Date: Wed, 5 Dec 2018 11:41:33 +0800
Subject: [PATCH 1347/2940] drm/amd/powerplay: add interface to allocate memory
 pool (v2)

This patch adds interface to allocate memory pool for smu.
This memory pool will be used for SMC use and msg SetSystemVirtualDramAddr and
DramLogSetDramAddr can notify it changed.

v2: add detailed info to describe this function

Signed-off-by: Huang Rui <ray.huang@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
---
 drivers/gpu/drm/amd/powerplay/amdgpu_smu.c | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c b/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c
index 87c46cf32293..4f61ee954ea7 100644
--- a/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c
+++ b/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c
@@ -216,6 +216,21 @@ static int smu_smc_table_hw_init(struct smu_context *smu)
 	return ret;
 }
 
+/**
+ * smu_alloc_memory_pool - allocate memory pool in the system memory
+ *
+ * @smu: amdgpu_device pointer
+ *
+ * This memory pool will be used for SMC use and msg SetSystemVirtualDramAddr
+ * and DramLogSetDramAddr can notify it changed.
+ *
+ * Returns 0 on success, error on failure.
+ */
+static int smu_alloc_memory_pool(struct smu_context *smu)
+{
+	return 0;
+}
+
 static int smu_hw_init(void *handle)
 {
 	int ret;
@@ -243,6 +258,10 @@ static int smu_hw_init(void *handle)
 	if (ret)
 		goto failed;
 
+	ret = smu_alloc_memory_pool(smu);
+	if (ret)
+		goto failed;
+
 	mutex_unlock(&smu->mutex);
 
 	pr_info("SMU is initialized successfully!\n");
-- 
2.17.1