Skip to content

Commit 60a970a

Browse files
huangruialexdeucher
authored andcommitted
drm/amdgpu: fix the clearing wb size
The clearing wb size should be the one that it is assigned. Signed-off-by: Huang Rui <[email protected]> Reviewed-by: Christian König <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent e11ddff commit 60a970a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/gpu/drm/amd/amdgpu/amdgpu_device.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,7 @@ static int amdgpu_wb_init(struct amdgpu_device *adev)
475475
int r;
476476

477477
if (adev->wb.wb_obj == NULL) {
478-
r = amdgpu_bo_create_kernel(adev, AMDGPU_MAX_WB * 4,
478+
r = amdgpu_bo_create_kernel(adev, AMDGPU_MAX_WB * sizeof(uint32_t),
479479
PAGE_SIZE, AMDGPU_GEM_DOMAIN_GTT,
480480
&adev->wb.wb_obj, &adev->wb.gpu_addr,
481481
(void **)&adev->wb.wb);
@@ -488,7 +488,7 @@ static int amdgpu_wb_init(struct amdgpu_device *adev)
488488
memset(&adev->wb.used, 0, sizeof(adev->wb.used));
489489

490490
/* clear wb memory */
491-
memset((char *)adev->wb.wb, 0, AMDGPU_GPU_PAGE_SIZE);
491+
memset((char *)adev->wb.wb, 0, AMDGPU_MAX_WB * sizeof(uint32_t));
492492
}
493493

494494
return 0;

0 commit comments

Comments
 (0)