Skip to contentSkip to conversation

drm/amdgpu: no read DF register under SRIOV and set correct vram width

PATCH In review Yintian Tao 2 participants 2 messages May 20, 2019 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amdgpu: no read DF register under SRIOV and set correct vram width

PART1:
Under SRIOV, reading DF register has chance to lead to AER error in host side, just skip reading it.
PART2:
For Vega10 SR-IOV, vram_width can't be read from ATOM as RAVEN, and DF related registers is not readable, seems hardcord is the only way to set the correct vram_width.

---
 drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c +8 -1
index c221570..b5bf9ed 100644
@@ -837,7 +837,7 @@ static int gmc_v9_0_mc_init(struct amdgpu_device *adev)
 
 	if (amdgpu_emu_mode != 1)
 		adev->gmc.vram_width = amdgpu_atomfirmware_get_vram_width(adev);
-	if (!adev->gmc.vram_width) {
+	if (!adev->gmc.vram_width && !amdgpu_sriov_vf(adev)) {
 		/* hbm memory channel size */
 		if (adev->flags & AMD_IS_APU)
 			chansize = 64;
@@ -848,6 +848,13 @@ static int gmc_v9_0_mc_init(struct amdgpu_device *adev)
 		adev->gmc.vram_width = numchan * chansize;
 	}
 
+	/* For Vega10 SR-IOV, vram_width can't be read from ATOM as RAVEN,
+	 * and DF related registers is not readable, seems hardcord is the
+	 * only way to set the correct vram_width */
+	if (amdgpu_sriov_vf(adev) && (adev->asic_type == CHIP_VEGA10)) {
+		adev->gmc.vram_width = 2048;
+	}
+
 	/* size in MB on si */
 	adev->gmc.mc_vram_size =
 		adev->nbio_funcs->get_memsize(adev) * 1024ULL * 1024ULL;
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): 1558344031-874-1-git-send-email-yttao-5C7GfCeVMHo@public.gmane.org

#2 lore raw

Please ignore it. I miss the patch which Alex attached.

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Yintian Tao
Sent: Monday, May 20, 2019 5:21 PM
To: [email protected]
Cc: Huang, Trigger <[email protected]>; Liu, Monk <[email protected]>; Tao, Yintian <[email protected]>
Subject: [PATCH] drm/amdgpu: no read DF register under SRIOV and set correct vram width

[CAUTION: External Email]

PART1:
Under SRIOV, reading DF register has chance to lead to AER error in host side, just skip reading it.
PART2:
For Vega10 SR-IOV, vram_width can't be read from ATOM as RAVEN, and DF related registers is not readable, seems hardcord is the only way to set the correct vram_width.

---
 drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c +8 -1
index c221570..b5bf9ed 100644
@@ -837,7 +837,7 @@ static int gmc_v9_0_mc_init(struct amdgpu_device *adev)
 
        if (amdgpu_emu_mode != 1)
                adev->gmc.vram_width = amdgpu_atomfirmware_get_vram_width(adev);
-       if (!adev->gmc.vram_width) {
+       if (!adev->gmc.vram_width && !amdgpu_sriov_vf(adev)) {
                /* hbm memory channel size */
                if (adev->flags & AMD_IS_APU)
                        chansize = 64;
@@ -848,6 +848,13 @@ static int gmc_v9_0_mc_init(struct amdgpu_device *adev)
                adev->gmc.vram_width = numchan * chansize;
        }
 
+       /* For Vega10 SR-IOV, vram_width can't be read from ATOM as RAVEN,
+        * and DF related registers is not readable, seems hardcord is the
+        * only way to set the correct vram_width */
+       if (amdgpu_sriov_vf(adev) && (adev->asic_type == CHIP_VEGA10)) {
+               adev->gmc.vram_width = 2048;
+       }
+
        /* size in MB on si */
        adev->gmc.mc_vram_size =
                adev->nbio_funcs->get_memsize(adev) * 1024ULL * 1024ULL;

--
2.7.4

_______________________________________________
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