Alternatively, you could also just return 0 in 
amdgpu_atomfirmware_get_vram_width() if emu == 1.  Either way:

Reviewed-by: Alex Deucher <[email protected]>

________________________________
From: amd-gfx <[email protected]> on behalf of Shaoyun Liu 
<[email protected]>
Sent: Tuesday, February 6, 2018 5:31 PM
To: [email protected]
Cc: Liu, Shaoyun
Subject: [PATCH] drm/amdgpu: Avoid get vram info from atom bios on emulation 
mode

Change-Id: I10030e83d63b2c27bfd16b64178e4f07c13addfa
Signed-off-by: Shaoyun Liu <[email protected]>
---
 drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c 
b/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c
index 0a1868b..785fb78 100644
--- a/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c
@@ -707,7 +707,8 @@ static int gmc_v9_0_mc_init(struct amdgpu_device *adev)
         int chansize, numchan;
         int r;

-       adev->gmc.vram_width = amdgpu_atomfirmware_get_vram_width(adev);
+       if (amdgpu_emu_mode != 1)
+               adev->gmc.vram_width = amdgpu_atomfirmware_get_vram_width(adev);
         if (!adev->gmc.vram_width) {
                 /* hbm memory channel size */
                 chansize = 128;
--
1.9.1

_______________________________________________
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

Reply via email to