Skip to contentSkip to conversation

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

PATCH Superseded Emily Deng 3 participants 6 messages Oct 12, 2018 3 messages not in the archive

Subsystems (2)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Emily Deng

author
#0 lore raw

PATCH 1/1 drm/amdgpu/sriov: 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.

---
 drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +14 -0
index ae86238..d9df3dd 100644
@@ -4872,6 +4872,17 @@ static void gfx_v9_0_set_rlc_funcs(struct amdgpu_device *adev)
 	}
 }
 
+static void gfx_v9_0_set_gds_default(struct amdgpu_device *adev)
+{
+	switch (adev->asic_type) {
+	case CHIP_VEGA10:
+		adev->gds.mem.total_size = 0x10000;
+		break;
+	default:
+		break;
+	}
+}
+
 static void gfx_v9_0_set_gds_init(struct amdgpu_device *adev)
 {
 	/* init asci gds info */
@@ -4879,6 +4890,9 @@ static void gfx_v9_0_set_gds_init(struct amdgpu_device *adev)
 	adev->gds.gws.total_size = 64;
 	adev->gds.oa.total_size = 16;
 
+	if (adev->gds.mem.total_size == 0 && amdgpu_sriov_vf(adev))
+		gfx_v9_0_set_gds_default(adev);
+
 	if (adev->gds.mem.total_size == 64 * 1024) {
 		adev->gds.mem.gfx_partition_size = 4096;
 		adev->gds.mem.cs_partition_size = 4096;
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): 1539314460-30042-1-git-send-email-Emily.Deng-5C7GfCeVMHo@public.gmane.org

#2 lore raw
Quoted 14 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.

---
  drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 14 ++++++++++++++
  1 file changed, 14 insertions(+)
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +0 -0
index ae86238..d9df3dd 100644

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

Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +5 -0
@@ -4872,6 +4872,17 @@ static void gfx_v9_0_set_rlc_funcs(struct amdgpu_device *adev)
  	}
  }
 
+static void gfx_v9_0_set_gds_default(struct amdgpu_device *adev)
+{
+	switch (adev->asic_type) {
+	case CHIP_VEGA10:
+		adev->gds.mem.total_size = 0x10000;

Do you mean this value is same as the original value from mmGDS_VMID0_SIZE before reset? if so, we may provide a default value for recovery, e.g. in the gds.mem structure.

Regards,
Jerry

Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +6 -0
+		break;
+	default:
+		break;
+	}
+}
+
  static void gfx_v9_0_set_gds_init(struct amdgpu_device *adev)
  {
  	/* init asci gds info */

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

Quoted 9 lines
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +3 -0
@@ -4879,6 +4890,9 @@ static void gfx_v9_0_set_gds_init(struct amdgpu_device *adev)
  	adev->gds.gws.total_size = 64;
  	adev->gds.oa.total_size = 16;
 
+	if (adev->gds.mem.total_size == 0 && amdgpu_sriov_vf(adev))
+		gfx_v9_0_set_gds_default(adev);
+
  	if (adev->gds.mem.total_size == 64 * 1024) {
  		adev->gds.mem.gfx_partition_size = 4096;
  		adev->gds.mem.cs_partition_size = 4096;

_______________________________________________
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): 29e3bf85-2f54-6b30-02f4-b93fe7e26362-5C7GfCeVMHo@public.gmane.org

#4 lore raw
Quoted 27 lines

-----Original Message-----
From: Zhang, Jerry
Sent: Friday, October 12, 2018 1:18 PM
To: Deng, Emily <[email protected]>; [email protected]
Subject: Re: [PATCH] drm/amdgpu/sriov: Set the default value about gds vmid0 size

drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c static void gfx_v9_0_set_rlc_funcs(struct

Quoted 15 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.

---
  drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 14 ++++++++++++++
  1 file changed, 14 insertions(+)
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +0 -0
index ae86238..d9df3dd 100644
@@ -4872,6 +4872,17 @@ static void gfx_v9_0_set_rlc_funcs(struct

amdgpu_device *adev)

Quoted 3 lines
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +0 -0
  	}
  }
 
Quoted 8 lines

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

Quoted 4 lines
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +4 -0
+static void gfx_v9_0_set_gds_default(struct amdgpu_device *adev) {
+	switch (adev->asic_type) {
+	case CHIP_VEGA10:
+		adev->gds.mem.total_size = 0x10000;

Do you mean this value is same as the original value from mmGDS_VMID0_SIZE before reset?
if so, we may provide a default value for recovery, e.g. in the gds.mem structure.

Yes.

Quoted 16 lines

Regards,
Jerry

drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c static void gfx_v9_0_set_gds_init(struct

Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +6 -0
+		break;
+	default:
+		break;
+	}
+}
+
  static void gfx_v9_0_set_gds_init(struct amdgpu_device *adev)
  {
  	/* init asci gds info */
@@ -4879,6 +4890,9 @@ static void gfx_v9_0_set_gds_init(struct

amdgpu_device *adev)

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

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

Quoted 6 lines
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +3 -0
+	if (adev->gds.mem.total_size == 0 && amdgpu_sriov_vf(adev))
+		gfx_v9_0_set_gds_default(adev);
+
  	if (adev->gds.mem.total_size == 64 * 1024) {
  		adev->gds.mem.gfx_partition_size = 4096;
  		adev->gds.mem.cs_partition_size = 4096;

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

#5 lore raw
In reply to a message not in the archive

Am 12.10.2018 um 05:21 schrieb Emily Deng:

Quoted 3 lines

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.

Can we just always use the fixed value instead of reading mmGDS_VMID0_SIZE?

We really don't want to introduce so much complexity here and another extra code path for SRIOV.

Christian.

Quoted 29 lines
---
  drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 14 ++++++++++++++
  1 file changed, 14 insertions(+)
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +11 -0
index ae86238..d9df3dd 100644
@@ -4872,6 +4872,17 @@ static void gfx_v9_0_set_rlc_funcs(struct amdgpu_device *adev)
  	}
  }
 
+static void gfx_v9_0_set_gds_default(struct amdgpu_device *adev)
+{
+	switch (adev->asic_type) {
+	case CHIP_VEGA10:
+		adev->gds.mem.total_size = 0x10000;
+		break;
+	default:
+		break;
+	}
+}
+
  static void gfx_v9_0_set_gds_init(struct amdgpu_device *adev)
  {
  	/* init asci gds info */

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

Quoted 9 lines
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +3 -0
@@ -4879,6 +4890,9 @@ static void gfx_v9_0_set_gds_init(struct amdgpu_device *adev)
  	adev->gds.gws.total_size = 64;
  	adev->gds.oa.total_size = 16;
 
+	if (adev->gds.mem.total_size == 0 && amdgpu_sriov_vf(adev))
+		gfx_v9_0_set_gds_default(adev);
+
  	if (adev->gds.mem.total_size == 64 * 1024) {
  		adev->gds.mem.gfx_partition_size = 4096;
  		adev->gds.mem.cs_partition_size = 4096;

_______________________________________________
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): dca6ddec-1a15-b059-688a-913e48877523-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org

#7 lore raw
Quoted 8 lines · Christian König

Am 12.10.2018 um 05:21 schrieb Emily Deng:

Quoted 3 lines

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.

Can we just always use the fixed value instead of reading mmGDS_VMID0_SIZE?

We really don't want to introduce so much complexity here and another extra code path for SRIOV.

Suppose VBIOS may set the size for different SKU so read from the register. We may confirm a fixed or default value for all gfx v9.

Jerry

Quoted 38 lines

Christian.

Quoted 35 lines

---
  drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 14 ++++++++++++++

  1 file changed, 14 insertions(+)
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +10 -0
index ae86238..d9df3dd 100644
@@ -4872,6 +4872,17 @@ static void gfx_v9_0_set_rlc_funcs(struct 
 amdgpu_device *adev)
       }
   }
   +static void gfx_v9_0_set_gds_default(struct amdgpu_device *adev)
+{
+    switch (adev->asic_type) {
+    case CHIP_VEGA10:
+        adev->gds.mem.total_size = 0x10000;
+        break;
+    default:
+        break;
+    }
+}
+
   static void gfx_v9_0_set_gds_init(struct amdgpu_device *adev)
   {

      /* init asci gds info */

drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +2 -0
@@ -4879,6 +4890,9 @@ static void gfx_v9_0_set_gds_init(struct 
 amdgpu_device *adev)
       adev->gds.gws.total_size = 64;
       adev->gds.oa.total_size = 16;
   +    if (adev->gds.mem.total_size == 0 && amdgpu_sriov_vf(adev))
+        gfx_v9_0_set_gds_default(adev);
+
Quoted 8 lines
Quoted 3 lines
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +0 -0
       if (adev->gds.mem.total_size == 64 * 1024) {
           adev->gds.mem.gfx_partition_size = 4096;

          adev->gds.mem.cs_partition_size = 4096;

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

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

#8 lore raw
In reply to a message not in the archive
Quoted 12 lines

-----Original Message-----
From: Christian König <[email protected]>
Sent: Friday, October 12, 2018 3:40 PM
To: Deng, Emily <[email protected]>; [email protected]
Subject: Re: [PATCH] drm/amdgpu/sriov: Set the default value about gds vmid0 size

Am 12.10.2018 um 05:21 schrieb Emily Deng:

Quoted 3 lines

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.

Quoted 5 lines

Can we just always use the fixed value instead of reading mmGDS_VMID0_SIZE?

We really don't want to introduce so much complexity here and another extra code path for SRIOV.

Thanks, will send a patch to fix the value.

Best wishes
Emily Deng

Quoted 37 lines

Christian.

drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c static void gfx_v9_0_set_rlc_funcs(struct

Quoted 12 lines
---
  drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 14 ++++++++++++++
  1 file changed, 14 insertions(+)
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +0 -0
index ae86238..d9df3dd 100644
@@ -4872,6 +4872,17 @@ static void gfx_v9_0_set_rlc_funcs(struct

amdgpu_device *adev)

drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c static void gfx_v9_0_set_gds_init(struct

Quoted 17 lines
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +10 -0
  	}
  }
 
+static void gfx_v9_0_set_gds_default(struct amdgpu_device *adev) {
+	switch (adev->asic_type) {
+	case CHIP_VEGA10:
+		adev->gds.mem.total_size = 0x10000;
+		break;
+	default:
+		break;
+	}
+}
+
  static void gfx_v9_0_set_gds_init(struct amdgpu_device *adev)
  {
  	/* init asci gds info */
@@ -4879,6 +4890,9 @@ static void gfx_v9_0_set_gds_init(struct

amdgpu_device *adev)

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

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

Quoted 6 lines
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +3 -0
+	if (adev->gds.mem.total_size == 0 && amdgpu_sriov_vf(adev))
+		gfx_v9_0_set_gds_default(adev);
+
  	if (adev->gds.mem.total_size == 64 * 1024) {
  		adev->gds.mem.gfx_partition_size = 4096;
  		adev->gds.mem.cs_partition_size = 4096;

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