Commit f5fb30b6 authored by Hawking Zhang's avatar Hawking Zhang Committed by Alex Deucher

drm/amdgpu: update gc info from bios table

Handle newer gc info tables.
Signed-off-by: default avatarHawking Zhang <Hawking.Zhang@amd.com>
Reviewed-by: default avatarLikun Gao <Likun.Gao@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 083e5ff6
...@@ -653,6 +653,7 @@ int amdgpu_atomfirmware_get_clock_info(struct amdgpu_device *adev) ...@@ -653,6 +653,7 @@ int amdgpu_atomfirmware_get_clock_info(struct amdgpu_device *adev)
union gfx_info { union gfx_info {
struct atom_gfx_info_v2_4 v24; struct atom_gfx_info_v2_4 v24;
struct atom_gfx_info_v2_7 v27; struct atom_gfx_info_v2_7 v27;
struct atom_gfx_info_v3_0 v30;
}; };
int amdgpu_atomfirmware_get_gfx_info(struct amdgpu_device *adev) int amdgpu_atomfirmware_get_gfx_info(struct amdgpu_device *adev)
...@@ -668,6 +669,7 @@ int amdgpu_atomfirmware_get_gfx_info(struct amdgpu_device *adev) ...@@ -668,6 +669,7 @@ int amdgpu_atomfirmware_get_gfx_info(struct amdgpu_device *adev)
&frev, &crev, &data_offset)) { &frev, &crev, &data_offset)) {
union gfx_info *gfx_info = (union gfx_info *) union gfx_info *gfx_info = (union gfx_info *)
(mode_info->atom_context->bios + data_offset); (mode_info->atom_context->bios + data_offset);
if (frev == 2) {
switch (crev) { switch (crev) {
case 4: case 4:
adev->gfx.config.max_shader_engines = gfx_info->v24.max_shader_engines; adev->gfx.config.max_shader_engines = gfx_info->v24.max_shader_engines;
...@@ -706,6 +708,21 @@ int amdgpu_atomfirmware_get_gfx_info(struct amdgpu_device *adev) ...@@ -706,6 +708,21 @@ int amdgpu_atomfirmware_get_gfx_info(struct amdgpu_device *adev)
default: default:
return -EINVAL; return -EINVAL;
} }
} else if (frev == 3) {
switch (crev) {
case 0:
adev->gfx.config.max_shader_engines = gfx_info->v30.max_shader_engines;
adev->gfx.config.max_cu_per_sh = gfx_info->v30.max_cu_per_sh;
adev->gfx.config.max_sh_per_se = gfx_info->v30.max_sh_per_se;
adev->gfx.config.max_backends_per_se = gfx_info->v30.max_backends_per_se;
adev->gfx.config.max_texture_channel_caches = gfx_info->v30.max_texture_channel_caches;
return 0;
default:
return -EINVAL;
}
} else {
return -EINVAL;
}
} }
return -EINVAL; return -EINVAL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment