Skip to contentSkip to conversation

drm/amdgpu: improve the amdgpu device init progress in sriov mode

PATCH Superseded chong li 1 participant 1 message Jun 30

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

chong li

author
#0 lore raw

PATCH 1/1 drm/amdgpu: improve the amdgpu device init progress in sriov mode

Move the initialization of non-GPU resources
out of the full GPU access region during AMDGPU device initialization

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c    |  10 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c | 131 ++++++++++-------
 drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c      | 138 +++++++++++++-----
 drivers/gpu/drm/amd/amdgpu/amdgpu_virt.h      |   2 +
 4 files changed, 181 insertions(+), 100 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +6 -4
index 5442a1fc1c37..247779cbf394 100644
@@ -1953,10 +1953,6 @@ static int amdgpu_device_ip_early_init(struct amdgpu_device *adev)
 	amdgpu_device_enable_virtual_display(adev);
 
 	if (amdgpu_sriov_vf(adev)) {
-		r = amdgpu_virt_request_full_gpu(adev, true);
-		if (r)
-			return r;
-
 		r = amdgpu_virt_init_critical_region(adev);
 		if (r)
 			return r;
@@ -2118,6 +2114,12 @@ static int amdgpu_device_ip_early_init(struct amdgpu_device *adev)
 	if (!total)
 		return -ENODEV;
 
+	if (amdgpu_sriov_vf(adev)) {
+		r = amdgpu_virt_request_full_gpu(adev, true);
+		if (r)
+			return r;
+	}
+
 	if (adev->gmc.xgmi.supported)
 		amdgpu_xgmi_early_init(adev);
 
drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c +75 -56

160 lines not on this page · raw message

drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c +98 -40

195 lines not on this page · raw message

drivers/gpu/drm/amd/amdgpu/amdgpu_virt.h +2 -0
index d8500c3e48a1..1ffd6065c6be 100644
@@ -452,6 +452,8 @@ static inline bool is_virtual_machine(void)
 	((adev)->virt.is_xgmi_node_migrate_enabled && (adev)->gmc.xgmi.node_segment_size != 0)
 
 bool amdgpu_virt_mmio_blocked(struct amdgpu_device *adev);
+int amdgpu_virt_read_vf_fb(struct amdgpu_device *adev, u64 offset,
+			   void *buf, size_t size);
 void amdgpu_virt_init_setting(struct amdgpu_device *adev);
 int amdgpu_virt_request_full_gpu(struct amdgpu_device *adev, bool init);
 int amdgpu_virt_release_full_gpu(struct amdgpu_device *adev, bool init);
Signature · 1 line
2.48.1