@@ -622,6 +622,13 @@ void amdgpu_gmc_get_vbios_allocations(struct amdgpu_device *adev)
622622{
623623 unsigned size ;
624624
625+ /*
626+ * Some ASICs need to reserve a region of video memory to avoid access
627+ * from driver
628+ */
629+ adev -> mman .stolen_reserved_offset = 0 ;
630+ adev -> mman .stolen_reserved_size = 0 ;
631+
625632 /*
626633 * TODO:
627634 * Currently there is a bug where some memory client outside
@@ -632,10 +639,25 @@ void amdgpu_gmc_get_vbios_allocations(struct amdgpu_device *adev)
632639 */
633640 switch (adev -> asic_type ) {
634641 case CHIP_VEGA10 :
642+ adev -> mman .keep_stolen_vga_memory = true;
643+ /*
644+ * VEGA10 SRIOV VF needs some firmware reserved area.
645+ */
646+ if (amdgpu_sriov_vf (adev )) {
647+ adev -> mman .stolen_reserved_offset = 0x100000 ;
648+ adev -> mman .stolen_reserved_size = 0x600000 ;
649+ }
650+ break ;
635651 case CHIP_RAVEN :
636652 case CHIP_RENOIR :
637653 adev -> mman .keep_stolen_vga_memory = true;
638654 break ;
655+ case CHIP_YELLOW_CARP :
656+ if (amdgpu_discovery == 0 ) {
657+ adev -> mman .stolen_reserved_offset = 0x1ffb0000 ;
658+ adev -> mman .stolen_reserved_size = 64 * PAGE_SIZE ;
659+ }
660+ break ;
639661 default :
640662 adev -> mman .keep_stolen_vga_memory = false;
641663 break ;
@@ -756,25 +778,6 @@ uint64_t amdgpu_gmc_vram_cpu_pa(struct amdgpu_device *adev, struct amdgpu_bo *bo
756778 return amdgpu_bo_gpu_offset (bo ) - adev -> gmc .vram_start + adev -> gmc .aper_base ;
757779}
758780
759- void amdgpu_gmc_get_reserved_allocation (struct amdgpu_device * adev )
760- {
761- /* Some ASICs need to reserve a region of video memory to avoid access
762- * from driver */
763- adev -> mman .stolen_reserved_offset = 0 ;
764- adev -> mman .stolen_reserved_size = 0 ;
765-
766- switch (adev -> asic_type ) {
767- case CHIP_YELLOW_CARP :
768- if (amdgpu_discovery == 0 ) {
769- adev -> mman .stolen_reserved_offset = 0x1ffb0000 ;
770- adev -> mman .stolen_reserved_size = 64 * PAGE_SIZE ;
771- }
772- break ;
773- default :
774- break ;
775- }
776- }
777-
778781int amdgpu_gmc_vram_checking (struct amdgpu_device * adev )
779782{
780783 struct amdgpu_bo * vram_bo = NULL ;
0 commit comments