Commit 60a970a6 authored by Huang Rui's avatar Huang Rui Committed by Alex Deucher

drm/amdgpu: fix the clearing wb size

The clearing wb size should be the one that it is assigned.
Signed-off-by: default avatarHuang Rui <ray.huang@amd.com>
Reviewed-by: default avatarChristian König <christian.koenig@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent e11ddff6
...@@ -475,7 +475,7 @@ static int amdgpu_wb_init(struct amdgpu_device *adev) ...@@ -475,7 +475,7 @@ static int amdgpu_wb_init(struct amdgpu_device *adev)
int r; int r;
if (adev->wb.wb_obj == NULL) { if (adev->wb.wb_obj == NULL) {
r = amdgpu_bo_create_kernel(adev, AMDGPU_MAX_WB * 4, r = amdgpu_bo_create_kernel(adev, AMDGPU_MAX_WB * sizeof(uint32_t),
PAGE_SIZE, AMDGPU_GEM_DOMAIN_GTT, PAGE_SIZE, AMDGPU_GEM_DOMAIN_GTT,
&adev->wb.wb_obj, &adev->wb.gpu_addr, &adev->wb.wb_obj, &adev->wb.gpu_addr,
(void **)&adev->wb.wb); (void **)&adev->wb.wb);
...@@ -488,7 +488,7 @@ static int amdgpu_wb_init(struct amdgpu_device *adev) ...@@ -488,7 +488,7 @@ static int amdgpu_wb_init(struct amdgpu_device *adev)
memset(&adev->wb.used, 0, sizeof(adev->wb.used)); memset(&adev->wb.used, 0, sizeof(adev->wb.used));
/* clear wb memory */ /* clear wb memory */
memset((char *)adev->wb.wb, 0, AMDGPU_GPU_PAGE_SIZE); memset((char *)adev->wb.wb, 0, AMDGPU_MAX_WB * sizeof(uint32_t));
} }
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment