@@ -299,6 +299,9 @@ int amdgpu_discovery_reg_base_init(struct amdgpu_device *adev)
299299 ip -> major , ip -> minor ,
300300 ip -> revision );
301301
302+ if (le16_to_cpu (ip -> hw_id ) == VCN_HWID )
303+ adev -> vcn .num_vcn_inst ++ ;
304+
302305 for (k = 0 ; k < num_base_address ; k ++ ) {
303306 /*
304307 * convert the endianness of base addresses in place,
@@ -385,7 +388,7 @@ void amdgpu_discovery_harvest_ip(struct amdgpu_device *adev)
385388{
386389 struct binary_header * bhdr ;
387390 struct harvest_table * harvest_info ;
388- int i ;
391+ int i , vcn_harvest_count = 0 ;
389392
390393 bhdr = (struct binary_header * )adev -> mman .discovery_bin ;
391394 harvest_info = (struct harvest_table * )(adev -> mman .discovery_bin +
@@ -397,8 +400,7 @@ void amdgpu_discovery_harvest_ip(struct amdgpu_device *adev)
397400
398401 switch (le32_to_cpu (harvest_info -> list [i ].hw_id )) {
399402 case VCN_HWID :
400- adev -> harvest_ip_mask |= AMD_HARVEST_IP_VCN_MASK ;
401- adev -> harvest_ip_mask |= AMD_HARVEST_IP_JPEG_MASK ;
403+ vcn_harvest_count ++ ;
402404 break ;
403405 case DMU_HWID :
404406 adev -> harvest_ip_mask |= AMD_HARVEST_IP_DMU_MASK ;
@@ -407,6 +409,10 @@ void amdgpu_discovery_harvest_ip(struct amdgpu_device *adev)
407409 break ;
408410 }
409411 }
412+ if (vcn_harvest_count == adev -> vcn .num_vcn_inst ) {
413+ adev -> harvest_ip_mask |= AMD_HARVEST_IP_VCN_MASK ;
414+ adev -> harvest_ip_mask |= AMD_HARVEST_IP_JPEG_MASK ;
415+ }
410416}
411417
412418int amdgpu_discovery_get_gfx_info (struct amdgpu_device * adev )
0 commit comments