Skip to content

Commit d4f6425

Browse files
lema1-devalexdeucher
authored andcommitted
drm/amdgpu: update mall info v2 from discovery
Mall info v2 is introduced in ip discovery Signed-off-by: Le Ma <le.ma@amd.com> Reviewed-by: Shiwu Zhang <shiwu.zhang@amd.com> Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com> Reviewed-by: Lijo Lazar <lijo.lazar@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
1 parent 4b721ed commit d4f6425

2 files changed

Lines changed: 12 additions & 1 deletion

File tree

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1478,6 +1478,7 @@ static int amdgpu_discovery_get_gfx_info(struct amdgpu_device *adev)
14781478

14791479
union mall_info {
14801480
struct mall_info_v1_0 v1;
1481+
struct mall_info_v2_0 v2;
14811482
};
14821483

14831484
static int amdgpu_discovery_get_mall_info(struct amdgpu_device *adev)
@@ -1518,6 +1519,10 @@ static int amdgpu_discovery_get_mall_info(struct amdgpu_device *adev)
15181519
adev->gmc.mall_size = mall_size;
15191520
adev->gmc.m_half_use = half_use;
15201521
break;
1522+
case 2:
1523+
mall_size_per_umc = le32_to_cpu(mall_info->v2.mall_size_per_umc);
1524+
adev->gmc.mall_size = mall_size_per_umc * adev->gmc.num_umc;
1525+
break;
15211526
default:
15221527
dev_err(adev->dev,
15231528
"Unhandled MALL info table %d.%d\n",

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
#define GC_TABLE_ID 0x4347
3131
#define HARVEST_TABLE_SIGNATURE 0x56524148
3232
#define VCN_INFO_TABLE_ID 0x004E4356
33-
#define MALL_INFO_TABLE_ID 0x4D414C4C
33+
#define MALL_INFO_TABLE_ID 0x4C4C414D
3434

3535
typedef enum
3636
{
@@ -312,6 +312,12 @@ struct mall_info_v1_0 {
312312
uint32_t reserved[5];
313313
};
314314

315+
struct mall_info_v2_0 {
316+
struct mall_info_header header;
317+
uint32_t mall_size_per_umc;
318+
uint32_t reserved[8];
319+
};
320+
315321
#define VCN_INFO_TABLE_MAX_NUM_INSTANCES 4
316322

317323
struct vcn_info_header {

0 commit comments

Comments
 (0)