Skip to content

Commit e5ad717

Browse files
Lijo Lazaralexdeucher
authored andcommitted
drm/amdgpu: Add compatible NPS mode info
Populate the compatible NPS modes also for providing partition configuration details through sysfs. Signed-off-by: Lijo Lazar <[email protected]> Reviewed-by: Asad Kamal <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent 81db4ea commit e5ad717

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

drivers/gpu/drm/amd/amdgpu/amdgpu_xcp.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ struct amdgpu_xcp_cfg {
7777
u8 num_res;
7878
struct amdgpu_xcp_mgr *xcp_mgr;
7979
struct kobject kobj;
80+
u16 compatible_nps_modes;
8081
};
8182

8283
struct amdgpu_xcp_ip_funcs {

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -455,6 +455,7 @@ static int aqua_vanjaram_get_xcp_res_info(struct amdgpu_xcp_mgr *xcp_mgr,
455455
int max_res[AMDGPU_XCP_RES_MAX] = {};
456456
bool res_lt_xcp;
457457
int num_xcp, i;
458+
u16 nps_modes;
458459

459460
if (!(xcp_mgr->supp_xcp_modes & BIT(mode)))
460461
return -EINVAL;
@@ -467,23 +468,33 @@ static int aqua_vanjaram_get_xcp_res_info(struct amdgpu_xcp_mgr *xcp_mgr,
467468
switch (mode) {
468469
case AMDGPU_SPX_PARTITION_MODE:
469470
num_xcp = 1;
471+
nps_modes = BIT(AMDGPU_NPS1_PARTITION_MODE);
470472
break;
471473
case AMDGPU_DPX_PARTITION_MODE:
472474
num_xcp = 2;
475+
nps_modes = BIT(AMDGPU_NPS1_PARTITION_MODE);
473476
break;
474477
case AMDGPU_TPX_PARTITION_MODE:
475478
num_xcp = 3;
479+
nps_modes = BIT(AMDGPU_NPS1_PARTITION_MODE) |
480+
BIT(AMDGPU_NPS4_PARTITION_MODE);
476481
break;
477482
case AMDGPU_QPX_PARTITION_MODE:
478483
num_xcp = 4;
484+
nps_modes = BIT(AMDGPU_NPS1_PARTITION_MODE) |
485+
BIT(AMDGPU_NPS4_PARTITION_MODE);
479486
break;
480487
case AMDGPU_CPX_PARTITION_MODE:
481488
num_xcp = NUM_XCC(adev->gfx.xcc_mask);
489+
nps_modes = BIT(AMDGPU_NPS1_PARTITION_MODE) |
490+
BIT(AMDGPU_NPS4_PARTITION_MODE);
482491
break;
483492
default:
484493
return -EINVAL;
485494
}
486495

496+
xcp_cfg->compatible_nps_modes =
497+
(adev->gmc.supported_nps_modes & nps_modes);
487498
xcp_cfg->num_res = ARRAY_SIZE(max_res);
488499

489500
for (i = 0; i < xcp_cfg->num_res; i++) {

0 commit comments

Comments
 (0)