summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c
diff options
context:
space:
mode:
authorHuang Rui2018-12-05 04:41:33 +0100
committerAlex Deucher2019-03-19 21:03:54 +0100
commite65d45f2c73df8b7596d67c09bc3528a8968a99d (patch)
tree5aca9f0c90f8943664aa5ea43adb1e57279c01f5 /drivers/gpu/drm/amd/powerplay/amdgpu_smu.c
parentdrm/amd/powerplay: add interface to set tool table location (v2) (diff)
downloadkernel-qcow2-linux-e65d45f2c73df8b7596d67c09bc3528a8968a99d.tar.gz
kernel-qcow2-linux-e65d45f2c73df8b7596d67c09bc3528a8968a99d.tar.xz
kernel-qcow2-linux-e65d45f2c73df8b7596d67c09bc3528a8968a99d.zip
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> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/powerplay/amdgpu_smu.c')
-rw-r--r--drivers/gpu/drm/amd/powerplay/amdgpu_smu.c19
1 files changed, 19 insertions, 0 deletions
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");