]> Git Repo - linux.git/blobdiff - drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c
drm/amdgpu: Add Aldebaran virtualization support
[linux.git] / drivers / gpu / drm / amd / amdgpu / amdgpu_virt.c
index 5da04d45b63795a0305178719dcdbe2025a95cef..a57842689d428d411ecf900f9415c9b9e188da02 100644 (file)
@@ -50,9 +50,12 @@ void amdgpu_virt_init_setting(struct amdgpu_device *adev)
        struct drm_device *ddev = adev_to_drm(adev);
 
        /* enable virtual display */
-       if (adev->mode_info.num_crtc == 0)
-               adev->mode_info.num_crtc = 1;
-       adev->enable_virtual_display = true;
+       if (adev->asic_type != CHIP_ALDEBARAN &&
+           adev->asic_type != CHIP_ARCTURUS) {
+               if (adev->mode_info.num_crtc == 0)
+                       adev->mode_info.num_crtc = 1;
+               adev->enable_virtual_display = true;
+       }
        ddev->driver_features &= ~DRIVER_ATOMIC;
        adev->cg_flags = 0;
        adev->pg_flags = 0;
@@ -466,6 +469,8 @@ static int amdgpu_virt_read_pf2vf_data(struct amdgpu_device *adev)
                        ((struct amd_sriov_msg_pf2vf_info *)pf2vf_info)->vf2pf_update_interval_ms;
                adev->virt.gim_feature =
                        ((struct amd_sriov_msg_pf2vf_info *)pf2vf_info)->feature_flags.all;
+               adev->virt.reg_access =
+                       ((struct amd_sriov_msg_pf2vf_info *)pf2vf_info)->reg_access_flags.all;
 
                break;
        default:
@@ -617,6 +622,14 @@ void amdgpu_virt_init_data_exchange(struct amdgpu_device *adev)
                                if (adev->virt.ras_init_done)
                                        amdgpu_virt_add_bad_page(adev, bp_block_offset, bp_block_size);
                        }
+       } else if (adev->bios != NULL) {
+               adev->virt.fw_reserve.p_pf2vf =
+                       (struct amd_sriov_msg_pf2vf_info_header *)
+                       (adev->bios + (AMD_SRIOV_MSG_PF2VF_OFFSET_KB << 10));
+
+               amdgpu_virt_read_pf2vf_data(adev);
+
+               return;
        }
 
        if (adev->virt.vf2pf_update_interval_ms != 0) {
@@ -640,6 +653,7 @@ void amdgpu_detect_virtualization(struct amdgpu_device *adev)
        case CHIP_NAVI12:
        case CHIP_SIENNA_CICHLID:
        case CHIP_ARCTURUS:
+       case CHIP_ALDEBARAN:
                reg = RREG32(mmRCC_IOV_FUNC_IDENTIFIER);
                break;
        default: /* other chip doesn't support SRIOV */
@@ -668,6 +682,7 @@ void amdgpu_detect_virtualization(struct amdgpu_device *adev)
                case CHIP_VEGA10:
                case CHIP_VEGA20:
                case CHIP_ARCTURUS:
+               case CHIP_ALDEBARAN:
                        soc15_set_virt_ops(adev);
                        break;
                case CHIP_NAVI10:
This page took 0.038112 seconds and 4 git commands to generate.