@@ -2552,7 +2552,7 @@ static int amdgpu_device_ip_init(struct amdgpu_device *adev)
25522552 adev -> ip_blocks [i ].status .hw = true;
25532553
25542554 /* right after GMC hw init, we create CSA */
2555- if (amdgpu_mcbp ) {
2555+ if (adev -> gfx . mcbp ) {
25562556 r = amdgpu_allocate_static_csa (adev , & adev -> virt .csa_obj ,
25572557 AMDGPU_GEM_DOMAIN_VRAM |
25582558 AMDGPU_GEM_DOMAIN_GTT ,
@@ -3673,6 +3673,23 @@ static const struct attribute *amdgpu_dev_attributes[] = {
36733673 NULL
36743674};
36753675
3676+ static void amdgpu_device_set_mcbp (struct amdgpu_device * adev )
3677+ {
3678+ if (amdgpu_mcbp == 1 )
3679+ adev -> gfx .mcbp = true;
3680+
3681+ if ((adev -> ip_versions [GC_HWIP ][0 ] >= IP_VERSION (9 , 0 , 0 )) &&
3682+ (adev -> ip_versions [GC_HWIP ][0 ] < IP_VERSION (10 , 0 , 0 )) &&
3683+ adev -> gfx .num_gfx_rings )
3684+ adev -> gfx .mcbp = true;
3685+
3686+ if (amdgpu_sriov_vf (adev ))
3687+ adev -> gfx .mcbp = true;
3688+
3689+ if (adev -> gfx .mcbp )
3690+ DRM_INFO ("MCBP is enabled\n" );
3691+ }
3692+
36763693/**
36773694 * amdgpu_device_init - initialize the driver
36783695 *
@@ -3824,9 +3841,6 @@ int amdgpu_device_init(struct amdgpu_device *adev,
38243841 DRM_INFO ("register mmio base: 0x%08X\n" , (uint32_t )adev -> rmmio_base );
38253842 DRM_INFO ("register mmio size: %u\n" , (unsigned )adev -> rmmio_size );
38263843
3827- if (amdgpu_mcbp )
3828- DRM_INFO ("MCBP is enabled\n" );
3829-
38303844 /*
38313845 * Reset domain needs to be present early, before XGMI hive discovered
38323846 * (if any) and intitialized to use reset sem and in_gpu reset flag
@@ -3852,6 +3866,8 @@ int amdgpu_device_init(struct amdgpu_device *adev,
38523866 if (r )
38533867 return r ;
38543868
3869+ amdgpu_device_set_mcbp (adev );
3870+
38553871 /* Get rid of things like offb */
38563872 r = drm_aperture_remove_conflicting_pci_framebuffers (adev -> pdev , & amdgpu_kms_driver );
38573873 if (r )
@@ -4018,6 +4034,11 @@ int amdgpu_device_init(struct amdgpu_device *adev,
40184034 /* Get a log2 for easy divisions. */
40194035 adev -> mm_stats .log2_max_MBps = ilog2 (max (1u , max_MBps ));
40204036
4037+ r = amdgpu_atombios_sysfs_init (adev );
4038+ if (r )
4039+ drm_err (& adev -> ddev ,
4040+ "registering atombios sysfs failed (%d).\n" , r );
4041+
40214042 r = amdgpu_pm_sysfs_init (adev );
40224043 if (r )
40234044 DRM_ERROR ("registering pm sysfs failed (%d).\n" , r );
0 commit comments