summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c
diff options
context:
space:
mode:
authorAlex Deucher <alexander.deucher@amd.com>2019-09-23 23:12:46 +0300
committerAlex Deucher <alexander.deucher@amd.com>2019-10-03 17:11:01 +0300
commit631cdbd27e922a845a728ea2f933c41d220b3cd1 (patch)
tree8d74be5db4122ee0c6e851cbdf5f6422a54387db /drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c
parentbd5520273cea125698f97bc4dd6152cccdbe6b19 (diff)
downloadlinux-631cdbd27e922a845a728ea2f933c41d220b3cd1.tar.xz
drm/amdgpu/atomfirmware: simplify the interface to get vram info
fetch both the vram type and width in one function call. This avoids having to parse the same data table twice to get the two pieces of data. Reviewed-by: Xiaojie Yuan <xiaojie.yuan@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c34
1 files changed, 2 insertions, 32 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c
index 9feccec2ea5d..19913c39588b 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c
@@ -169,9 +169,8 @@ static int convert_atom_mem_type_to_vram_type(struct amdgpu_device *adev,
return vram_type;
}
-static int
-amdgpu_atomfirmware_get_vram_info(struct amdgpu_device *adev,
- int *vram_width, int *vram_type)
+int amdgpu_atomfirmware_get_vram_info(struct amdgpu_device *adev,
+ int *vram_width, int *vram_type)
{
struct amdgpu_mode_info *mode_info = &adev->mode_info;
int index, i = 0;
@@ -185,7 +184,6 @@ amdgpu_atomfirmware_get_vram_info(struct amdgpu_device *adev,
u32 mem_channel_width;
u32 module_id;
-
if (adev->flags & AMD_IS_APU)
index = get_index_into_master_table(atom_master_list_of_data_tables_v2_1,
integratedsysteminfo);
@@ -262,34 +260,6 @@ amdgpu_atomfirmware_get_vram_info(struct amdgpu_device *adev,
}
/*
- * Return vram width from integrated system info table, if available,
- * or 0 if not.
- */
-int amdgpu_atomfirmware_get_vram_width(struct amdgpu_device *adev)
-{
- int vram_width = 0, vram_type = 0;
- int r = amdgpu_atomfirmware_get_vram_info(adev, &vram_width, &vram_type);
- if (r)
- return 0;
-
- return vram_width;
-}
-
-/*
- * Return vram type from either integrated system info table
- * or umc info table, if available, or 0 (TYPE_UNKNOWN) if not
- */
-int amdgpu_atomfirmware_get_vram_type(struct amdgpu_device *adev)
-{
- int vram_width = 0, vram_type = 0;
- int r = amdgpu_atomfirmware_get_vram_info(adev, &vram_width, &vram_type);
- if (r)
- return 0;
-
- return vram_type;
-}
-
-/*
* Return true if vbios enabled ecc by default, if umc info table is available
* or false if ecc is not enabled or umc info table is not available
*/