Skip to content
This repository was archived by the owner on Nov 8, 2023. It is now read-only.

Commit e64e8f7

Browse files
Li Maalexdeucher
authored andcommitted
drm/amdgpu/atomfirmware: add intergrated info v2.3 table
[Why] The vram width value is 0. Because the integratedsysteminfo table in VBIOS has updated to 2.3. [How] Driver needs a new intergrated info v2.3 table too. Then the vram width value will be correct. Signed-off-by: Li Ma <li.ma@amd.com> Reviewed-by: Yifan Zhang <yifan1.zhang@amd.com> Acked-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Cc: stable@vger.kernel.org
1 parent eb85341 commit e64e8f7

File tree

2 files changed

+58
-0
lines changed

2 files changed

+58
-0
lines changed

drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,7 @@ union igp_info {
212212
struct atom_integrated_system_info_v1_11 v11;
213213
struct atom_integrated_system_info_v1_12 v12;
214214
struct atom_integrated_system_info_v2_1 v21;
215+
struct atom_integrated_system_info_v2_3 v23;
215216
};
216217

217218
union umc_info {
@@ -360,6 +361,20 @@ amdgpu_atomfirmware_get_vram_info(struct amdgpu_device *adev,
360361
if (vram_type)
361362
*vram_type = convert_atom_mem_type_to_vram_type(adev, mem_type);
362363
break;
364+
case 3:
365+
mem_channel_number = igp_info->v23.umachannelnumber;
366+
if (!mem_channel_number)
367+
mem_channel_number = 1;
368+
mem_type = igp_info->v23.memorytype;
369+
if (mem_type == LpDdr5MemType)
370+
mem_channel_width = 32;
371+
else
372+
mem_channel_width = 64;
373+
if (vram_width)
374+
*vram_width = mem_channel_number * mem_channel_width;
375+
if (vram_type)
376+
*vram_type = convert_atom_mem_type_to_vram_type(adev, mem_type);
377+
break;
363378
default:
364379
return -EINVAL;
365380
}

drivers/gpu/drm/amd/include/atomfirmware.h

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1657,6 +1657,49 @@ struct atom_integrated_system_info_v2_2
16571657
uint32_t reserved4[189];
16581658
};
16591659

1660+
struct uma_carveout_option {
1661+
char optionName[29]; //max length of string is 28chars + '\0'. Current design is for "minimum", "Medium", "High". This makes entire struct size 64bits
1662+
uint8_t memoryCarvedGb; //memory carved out with setting
1663+
uint8_t memoryRemainingGb; //memory remaining on system
1664+
union {
1665+
struct _flags {
1666+
uint8_t Auto : 1;
1667+
uint8_t Custom : 1;
1668+
uint8_t Reserved : 6;
1669+
} flags;
1670+
uint8_t all8;
1671+
} uma_carveout_option_flags;
1672+
};
1673+
1674+
struct atom_integrated_system_info_v2_3 {
1675+
struct atom_common_table_header table_header;
1676+
uint32_t vbios_misc; // enum of atom_system_vbiosmisc_def
1677+
uint32_t gpucapinfo; // enum of atom_system_gpucapinf_def
1678+
uint32_t system_config;
1679+
uint32_t cpucapinfo;
1680+
uint16_t gpuclk_ss_percentage; // unit of 0.001%, 1000 mean 1%
1681+
uint16_t gpuclk_ss_type;
1682+
uint16_t dpphy_override; // bit vector, enum of atom_sysinfo_dpphy_override_def
1683+
uint8_t memorytype; // enum of atom_dmi_t17_mem_type_def, APU memory type indication.
1684+
uint8_t umachannelnumber; // number of memory channels
1685+
uint8_t htc_hyst_limit;
1686+
uint8_t htc_tmp_limit;
1687+
uint8_t reserved1; // dp_ss_control
1688+
uint8_t gpu_package_id;
1689+
struct edp_info_table edp1_info;
1690+
struct edp_info_table edp2_info;
1691+
uint32_t reserved2[8];
1692+
struct atom_external_display_connection_info extdispconninfo;
1693+
uint8_t UMACarveoutVersion;
1694+
uint8_t UMACarveoutIndexMax;
1695+
uint8_t UMACarveoutTypeDefault;
1696+
uint8_t UMACarveoutIndexDefault;
1697+
uint8_t UMACarveoutType; //Auto or Custom
1698+
uint8_t UMACarveoutIndex;
1699+
struct uma_carveout_option UMASizeControlOption[20];
1700+
uint8_t reserved3[110];
1701+
};
1702+
16601703
// system_config
16611704
enum atom_system_vbiosmisc_def{
16621705
INTEGRATED_SYSTEM_INFO__GET_EDID_CALLBACK_FUNC_SUPPORT = 0x01,

0 commit comments

Comments
 (0)