summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/amd
diff options
context:
space:
mode:
authorRex Zhu <Rex.Zhu@amd.com>2017-04-12 12:52:07 +0300
committerAlex Deucher <alexander.deucher@amd.com>2017-04-29 00:32:50 +0300
commitd475ce6296d702c16c96790a390ad7b4616f18b4 (patch)
treef01827813b9af3b96f54d2dd288f20fbd6264648 /drivers/gpu/drm/amd
parent67131aa525d22fe21904bfd463520e98b5d67566 (diff)
downloadlinux-d475ce6296d702c16c96790a390ad7b4616f18b4.tar.xz
drm/amd/powerplay: allocate fb for avfs fuse table on vega10.
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd')
-rw-r--r--drivers/gpu/drm/amd/powerplay/smumgr/vega10_smumgr.c36
-rw-r--r--drivers/gpu/drm/amd/powerplay/smumgr/vega10_smumgr.h1
2 files changed, 37 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/powerplay/smumgr/vega10_smumgr.c b/drivers/gpu/drm/amd/powerplay/smumgr/vega10_smumgr.c
index 9987d5b80d82..5980f02f2ce9 100644
--- a/drivers/gpu/drm/amd/powerplay/smumgr/vega10_smumgr.c
+++ b/drivers/gpu/drm/amd/powerplay/smumgr/vega10_smumgr.c
@@ -515,6 +515,40 @@ static int vega10_smu_init(struct pp_smumgr *smumgr)
}
}
+ /* allocate space for AVFS Fuse table */
+ smu_allocate_memory(smumgr->device,
+ sizeof(AvfsFuseOverride_t),
+ CGS_GPU_MEM_TYPE__VISIBLE_CONTIG_FB,
+ PAGE_SIZE,
+ &mc_addr,
+ &kaddr,
+ &handle);
+
+ PP_ASSERT_WITH_CODE(kaddr,
+ "[vega10_smu_init] Out of memory for avfs fuse table.",
+ kfree(smumgr->backend);
+ cgs_free_gpu_mem(smumgr->device,
+ (cgs_handle_t)priv->smu_tables.entry[PPTABLE].handle);
+ cgs_free_gpu_mem(smumgr->device,
+ (cgs_handle_t)priv->smu_tables.entry[WMTABLE].handle);
+ cgs_free_gpu_mem(smumgr->device,
+ (cgs_handle_t)priv->smu_tables.entry[AVFSTABLE].handle);
+ cgs_free_gpu_mem(smumgr->device,
+ (cgs_handle_t)priv->smu_tables.entry[TOOLSTABLE].handle);
+ cgs_free_gpu_mem(smumgr->device,
+ (cgs_handle_t)handle);
+ return -1);
+
+ priv->smu_tables.entry[AVFSFUSETABLE].version = 0x01;
+ priv->smu_tables.entry[AVFSFUSETABLE].size = sizeof(AvfsFuseOverride_t);
+ priv->smu_tables.entry[AVFSFUSETABLE].table_id = TABLE_AVFS_FUSE_OVERRIDE;
+ priv->smu_tables.entry[AVFSFUSETABLE].table_addr_high =
+ smu_upper_32_bits(mc_addr);
+ priv->smu_tables.entry[AVFSFUSETABLE].table_addr_low =
+ smu_lower_32_bits(mc_addr);
+ priv->smu_tables.entry[AVFSFUSETABLE].table = kaddr;
+ priv->smu_tables.entry[AVFSFUSETABLE].handle = handle;
+
return 0;
}
@@ -533,6 +567,8 @@ static int vega10_smu_fini(struct pp_smumgr *smumgr)
if (priv->smu_tables.entry[TOOLSTABLE].table)
cgs_free_gpu_mem(smumgr->device,
(cgs_handle_t)priv->smu_tables.entry[TOOLSTABLE].handle);
+ cgs_free_gpu_mem(smumgr->device,
+ (cgs_handle_t)priv->smu_tables.entry[AVFSFUSETABLE].handle);
kfree(smumgr->backend);
smumgr->backend = NULL;
}
diff --git a/drivers/gpu/drm/amd/powerplay/smumgr/vega10_smumgr.h b/drivers/gpu/drm/amd/powerplay/smumgr/vega10_smumgr.h
index 71e9b6492647..821425c1e4e0 100644
--- a/drivers/gpu/drm/amd/powerplay/smumgr/vega10_smumgr.h
+++ b/drivers/gpu/drm/amd/powerplay/smumgr/vega10_smumgr.h
@@ -30,6 +30,7 @@ enum smu_table_id {
WMTABLE,
AVFSTABLE,
TOOLSTABLE,
+ AVFSFUSETABLE,
MAX_SMU_TABLE,
};