mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-27 12:57:53 +00:00
drm/amdgpu: move apu flags initialization to the start of device init
In some asics, we need to adjust the behavior according to the apu flags at very early stage. Signed-off-by: Huang Rui <ray.huang@amd.com> Reviewed-by: Aaron Liu <aaron.liu@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
25f178bbd0
commit
9f6a785720
3 changed files with 37 additions and 10 deletions
|
@ -1369,6 +1369,38 @@ static void amdgpu_device_check_smu_prv_buffer_size(struct amdgpu_device *adev)
|
|||
adev->pm.smu_prv_buffer_size = 0;
|
||||
}
|
||||
|
||||
static int amdgpu_device_init_apu_flags(struct amdgpu_device *adev)
|
||||
{
|
||||
if (!(adev->flags & AMD_IS_APU) ||
|
||||
adev->asic_type < CHIP_RAVEN)
|
||||
return 0;
|
||||
|
||||
switch (adev->asic_type) {
|
||||
case CHIP_RAVEN:
|
||||
if (adev->pdev->device == 0x15dd)
|
||||
adev->apu_flags |= AMD_APU_IS_RAVEN;
|
||||
if (adev->pdev->device == 0x15d8)
|
||||
adev->apu_flags |= AMD_APU_IS_PICASSO;
|
||||
break;
|
||||
case CHIP_RENOIR:
|
||||
if ((adev->pdev->device == 0x1636) ||
|
||||
(adev->pdev->device == 0x164c))
|
||||
adev->apu_flags |= AMD_APU_IS_RENOIR;
|
||||
else
|
||||
adev->apu_flags |= AMD_APU_IS_GREEN_SARDINE;
|
||||
break;
|
||||
case CHIP_VANGOGH:
|
||||
adev->apu_flags |= AMD_APU_IS_VANGOGH;
|
||||
break;
|
||||
case CHIP_YELLOW_CARP:
|
||||
break;
|
||||
default:
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* amdgpu_device_check_arguments - validate module params
|
||||
*
|
||||
|
@ -3386,6 +3418,10 @@ int amdgpu_device_init(struct amdgpu_device *adev,
|
|||
mutex_init(&adev->psp.mutex);
|
||||
mutex_init(&adev->notifier_lock);
|
||||
|
||||
r = amdgpu_device_init_apu_flags(adev);
|
||||
if (r)
|
||||
return r;
|
||||
|
||||
r = amdgpu_device_check_arguments(adev);
|
||||
if (r)
|
||||
return r;
|
||||
|
|
|
@ -1305,7 +1305,6 @@ static int nv_common_early_init(void *handle)
|
|||
break;
|
||||
|
||||
case CHIP_VANGOGH:
|
||||
adev->apu_flags |= AMD_APU_IS_VANGOGH;
|
||||
adev->cg_flags = AMD_CG_SUPPORT_GFX_MGCG |
|
||||
AMD_CG_SUPPORT_GFX_MGLS |
|
||||
AMD_CG_SUPPORT_GFX_CP_LS |
|
||||
|
|
|
@ -1360,10 +1360,7 @@ static int soc15_common_early_init(void *handle)
|
|||
break;
|
||||
case CHIP_RAVEN:
|
||||
adev->asic_funcs = &soc15_asic_funcs;
|
||||
if (adev->pdev->device == 0x15dd)
|
||||
adev->apu_flags |= AMD_APU_IS_RAVEN;
|
||||
if (adev->pdev->device == 0x15d8)
|
||||
adev->apu_flags |= AMD_APU_IS_PICASSO;
|
||||
|
||||
if (adev->rev_id >= 0x8)
|
||||
adev->apu_flags |= AMD_APU_IS_RAVEN2;
|
||||
|
||||
|
@ -1455,11 +1452,6 @@ static int soc15_common_early_init(void *handle)
|
|||
break;
|
||||
case CHIP_RENOIR:
|
||||
adev->asic_funcs = &soc15_asic_funcs;
|
||||
if ((adev->pdev->device == 0x1636) ||
|
||||
(adev->pdev->device == 0x164c))
|
||||
adev->apu_flags |= AMD_APU_IS_RENOIR;
|
||||
else
|
||||
adev->apu_flags |= AMD_APU_IS_GREEN_SARDINE;
|
||||
|
||||
if (adev->apu_flags & AMD_APU_IS_RENOIR)
|
||||
adev->external_rev_id = adev->rev_id + 0x91;
|
||||
|
|
Loading…
Reference in a new issue