diff options
author | Xiaojian Du <Xiaojian.Du@amd.com> | 2022-01-17 12:44:51 +0800 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2022-01-19 22:31:51 -0500 |
commit | 479e3b02b73a2de2b19df2950863149c59d57bfe (patch) | |
tree | 1d68ff5235ec85b6c932aca38c6b5a9b6b8fb5e8 /drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c | |
parent | amdgpu/amdgpu_psp: remove unneeded ret variable (diff) | |
download | linux-dev-479e3b02b73a2de2b19df2950863149c59d57bfe.tar.xz linux-dev-479e3b02b73a2de2b19df2950863149c59d57bfe.zip |
drm/amdgpu: add vram check function for GMC
This patch will add vram check function for GMC block.
It will write pattern data to the vram and then read back from the vram,
so that to verify the work status of vram.
This patch will cover gmc v6/7/8/9/10.
Signed-off-by: Xiaojian Du <Xiaojian.Du@amd.com>
Reviewed-by: Huang Rui <ray.huang@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c b/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c index c76ffd1a70cd..6866e0311b49 100644 --- a/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c +++ b/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c @@ -1815,7 +1815,7 @@ static int gmc_v9_0_hw_init(void *handle) { struct amdgpu_device *adev = (struct amdgpu_device *)handle; bool value; - int i; + int i, r; /* The sequence of these two function calls matters.*/ gmc_v9_0_init_golden_registers(adev); @@ -1850,7 +1850,14 @@ static int gmc_v9_0_hw_init(void *handle) if (adev->umc.funcs && adev->umc.funcs->init_registers) adev->umc.funcs->init_registers(adev); - return gmc_v9_0_gart_enable(adev); + r = gmc_v9_0_gart_enable(adev); + if (r) + return r; + + if (amdgpu_emu_mode == 1) + return amdgpu_gmc_vram_checking(adev); + else + return r; } /** |