Skip to contentSkip to conversation

drm/amdgpu: Set the default value about gds vmid0 size

PATCH Superseded Emily Deng 2 participants 2 messages Oct 12, 2018 1 message not in the archive

Subsystems (2)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Emily Deng

author
#0 lore raw

PATCH v2 1/1 drm/amdgpu: Set the default value about gds vmid0 size

For sriov, when first run windows guest, then run linux guest, the gds vmid0 size will be reset to 0 by windows guest. So if the value has been reset to 0, then set the value to the default value in linux guest.

v2:
Fixed value instead of reading mmGDS_VMID0_SIZE.

---
 drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +13 -1
index e61f6a3..38a2ecc 100644
@@ -4904,7 +4904,19 @@ static void gfx_v9_0_set_rlc_funcs(struct amdgpu_device *adev)
 static void gfx_v9_0_set_gds_init(struct amdgpu_device *adev)
 {
 	/* init asci gds info */
-	adev->gds.mem.total_size = RREG32_SOC15(GC, 0, mmGDS_VMID0_SIZE);
+	switch (adev->asic_type) {
+	case CHIP_VEGA10:
+	case CHIP_VEGA12:
+	case CHIP_VEGA20:
+		adev->gds.mem.total_size = 0x10000;
+		break;
+	case CHIP_RAVEN:
+		adev->gds.mem.total_size = 0x1000;
+		break;
+	default:
+		break;
+	}
+
 	adev->gds.gws.total_size = 64;
 	adev->gds.oa.total_size = 16;
 
Signature · 6 lines
2.7.4

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 1539336871-22760-1-git-send-email-Emily.Deng-5C7GfCeVMHo@public.gmane.org

#2 lore raw
Quoted 21 lines · Emily Deng

For sriov, when first run windows guest, then run linux guest, the gds vmid0 size will be reset to 0 by windows guest. So if the value has been reset to 0, then set the value to the default value in linux guest.

v2:
Fixed value instead of reading mmGDS_VMID0_SIZE.

---
  drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 14 +++++++++++++-
  1 file changed, 13 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +0 -1
index e61f6a3..38a2ecc 100644
@@ -4904,7 +4904,19 @@ static void gfx_v9_0_set_rlc_funcs(struct amdgpu_device *adev)
  static void gfx_v9_0_set_gds_init(struct amdgpu_device *adev)
  {
  	/* init asci gds info */
-	adev->gds.mem.total_size = RREG32_SOC15(GC, 0, mmGDS_VMID0_SIZE);

drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c static void gfx_v9_0_set_rlc_funcs(struct amdgpu_device *adev) · line 4916

Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +10 -0
+	switch (adev->asic_type) {
+	case CHIP_VEGA10:
+	case CHIP_VEGA12:
+	case CHIP_VEGA20:
+		adev->gds.mem.total_size = 0x10000;
+		break;
+	case CHIP_RAVEN:
+		adev->gds.mem.total_size = 0x1000;
+		break;
+	default:

Better to show some info here in case that new card goes here with 0 size unexpectedly. or set default value as 0x10000.

Jerry

drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c static void gfx_v9_0_set_rlc_funcs(struct amdgpu_device *adev) · line 4922

Quoted 6 lines
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +3 -0
+		break;
+	}
+
  	adev->gds.gws.total_size = 64;
  	adev->gds.oa.total_size = 16;
 

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx