Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit83a0b86

Browse files
Likun GAOalexdeucher
Likun GAO
authored andcommitted
drm/amdgpu: add judgement when add ip blocks (v2)
Judgement whether to add an sw ip according to the harvest info.v2: fix indentation (Alex)Signed-off-by: Likun Gao <Likun.Gao@amd.com>Reviewed-by: Guchun Chen <guchun.chen@amd.com>Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
1 parentfe1c97d commit83a0b86

File tree

6 files changed

+57
-2
lines changed

6 files changed

+57
-2
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1006,6 +1006,7 @@ struct amdgpu_device {
10061006
structamdgpu_dfdf;
10071007

10081008
structamdgpu_ip_blockip_blocks[AMDGPU_MAX_IP_NUM];
1009+
uint32_tharvest_ip_mask;
10091010
intnum_ip_blocks;
10101011
structmutexmn_lock;
10111012
DECLARE_HASHTABLE(mn_hash,7);

‎drivers/gpu/drm/amd/amdgpu/amdgpu_device.c‎

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1683,6 +1683,19 @@ int amdgpu_device_ip_block_add(struct amdgpu_device *adev,
16831683
if (!ip_block_version)
16841684
return-EINVAL;
16851685

1686+
switch (ip_block_version->type) {
1687+
caseAMD_IP_BLOCK_TYPE_VCN:
1688+
if (adev->harvest_ip_mask&AMD_HARVEST_IP_VCN_MASK)
1689+
return0;
1690+
break;
1691+
caseAMD_IP_BLOCK_TYPE_JPEG:
1692+
if (adev->harvest_ip_mask&AMD_HARVEST_IP_JPEG_MASK)
1693+
return0;
1694+
break;
1695+
default:
1696+
break;
1697+
}
1698+
16861699
DRM_INFO("add ip block number %d <%s>\n",adev->num_ip_blocks,
16871700
ip_block_version->funcs->name);
16881701

@@ -3111,7 +3124,6 @@ bool amdgpu_device_has_dc_support(struct amdgpu_device *adev)
31113124
returnamdgpu_device_asic_has_dc_support(adev->asic_type);
31123125
}
31133126

3114-
31153127
staticvoidamdgpu_device_xgmi_reset_func(structwork_struct*__work)
31163128
{
31173129
structamdgpu_device*adev=
@@ -3276,6 +3288,7 @@ int amdgpu_device_init(struct amdgpu_device *adev,
32763288
adev->vm_manager.vm_pte_funcs=NULL;
32773289
adev->vm_manager.vm_pte_num_scheds=0;
32783290
adev->gmc.gmc_funcs=NULL;
3291+
adev->harvest_ip_mask=0x0;
32793292
adev->fence_context=dma_fence_context_alloc(AMDGPU_MAX_RINGS);
32803293
bitmap_zero(adev->gfx.pipe_reserve_bitmap,AMDGPU_MAX_COMPUTE_QUEUES);
32813294

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

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -373,6 +373,34 @@ int amdgpu_discovery_get_ip_version(struct amdgpu_device *adev, int hw_id,
373373
return-EINVAL;
374374
}
375375

376+
voidamdgpu_discovery_harvest_ip(structamdgpu_device*adev)
377+
{
378+
structbinary_header*bhdr;
379+
structharvest_table*harvest_info;
380+
inti;
381+
382+
bhdr= (structbinary_header*)adev->mman.discovery_bin;
383+
harvest_info= (structharvest_table*)(adev->mman.discovery_bin+
384+
le16_to_cpu(bhdr->table_list[HARVEST_INFO].offset));
385+
386+
for (i=0;i<32;i++) {
387+
if (le32_to_cpu(harvest_info->list[i].hw_id)==0)
388+
break;
389+
390+
switch (le32_to_cpu(harvest_info->list[i].hw_id)) {
391+
caseVCN_HWID:
392+
adev->harvest_ip_mask |=AMD_HARVEST_IP_VCN_MASK;
393+
adev->harvest_ip_mask |=AMD_HARVEST_IP_JPEG_MASK;
394+
break;
395+
caseDMU_HWID:
396+
adev->harvest_ip_mask |=AMD_HARVEST_IP_DMU_MASK;
397+
break;
398+
default:
399+
break;
400+
}
401+
}
402+
}
403+
376404
intamdgpu_discovery_get_gfx_info(structamdgpu_device*adev)
377405
{
378406
structbinary_header*bhdr;

‎drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929

3030
voidamdgpu_discovery_fini(structamdgpu_device*adev);
3131
intamdgpu_discovery_reg_base_init(structamdgpu_device*adev);
32+
voidamdgpu_discovery_harvest_ip(structamdgpu_device*adev);
3233
intamdgpu_discovery_get_ip_version(structamdgpu_device*adev,inthw_id,
3334
int*major,int*minor,int*revision);
3435
intamdgpu_discovery_get_gfx_info(structamdgpu_device*adev);

‎drivers/gpu/drm/amd/amdgpu/nv.c‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -635,6 +635,8 @@ static int nv_reg_base_init(struct amdgpu_device *adev)
635635
gotolegacy_init;
636636
}
637637

638+
amdgpu_discovery_harvest_ip(adev);
639+
638640
return0;
639641
}
640642

@@ -777,7 +779,6 @@ int nv_set_ip_blocks(struct amdgpu_device *adev)
777779
amdgpu_device_ip_block_add(adev,&vcn_v3_0_ip_block);
778780
if (!amdgpu_sriov_vf(adev))
779781
amdgpu_device_ip_block_add(adev,&jpeg_v3_0_ip_block);
780-
781782
if (adev->enable_mes)
782783
amdgpu_device_ip_block_add(adev,&mes_v10_1_ip_block);
783784
break;
@@ -1149,6 +1150,11 @@ static int nv_common_early_init(void *handle)
11491150
return-EINVAL;
11501151
}
11511152

1153+
if (adev->harvest_ip_mask&AMD_HARVEST_IP_VCN_MASK)
1154+
adev->pg_flags &= ~(AMD_PG_SUPPORT_VCN |
1155+
AMD_PG_SUPPORT_VCN_DPG |
1156+
AMD_PG_SUPPORT_JPEG);
1157+
11521158
if (amdgpu_sriov_vf(adev)) {
11531159
amdgpu_virt_init_setting(adev);
11541160
xgpu_nv_mailbox_set_irq_funcs(adev);

‎drivers/gpu/drm/amd/include/amd_shared.h‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,12 @@ enum PP_FEATURE_MASK {
216216
PP_GFX_DCS_MASK=0x80000,
217217
};
218218

219+
enumamd_harvest_ip_mask {
220+
AMD_HARVEST_IP_VCN_MASK=0x1,
221+
AMD_HARVEST_IP_JPEG_MASK=0x2,
222+
AMD_HARVEST_IP_DMU_MASK=0x4,
223+
};
224+
219225
enumDC_FEATURE_MASK {
220226
DC_FBC_MASK=0x1,
221227
DC_MULTI_MON_PP_MCLK_SWITCH_MASK=0x2,

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp