Skip to contentSkip to conversation

drm/amdgpu: fix the clearing wb size

PATCH In review Huang Rui 2 participants 2 messages Mar 15, 2017 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore

Huang Rui

author
#0 lore raw

PATCH 1/1 drm/amdgpu: fix the clearing wb size

The clearing wb size should be the one that it is assigned.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +2 -2
index b0ac610..b0e0471 100644
@@ -550,7 +550,7 @@ static int amdgpu_wb_init(struct amdgpu_device *adev)
 	int r;
 
 	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,
 					    &adev->wb.wb_obj, &adev->wb.gpu_addr,
 					    (void **)&adev->wb.wb);
@@ -564,7 +564,7 @@ static int amdgpu_wb_init(struct amdgpu_device *adev)
 		memset(&adev->wb.used, 0, sizeof(adev->wb.used));
 
 		/* 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;
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): 1489563033-15984-1-git-send-email-ray.huang-5C7GfCeVMHo@public.gmane.org

Reviewed-by
#2 lore raw

Am 15.03.2017 um 08:30 schrieb Huang Rui:

Quoted 3 lines

The clearing wb size should be the one that it is assigned.

Quoted 18 lines
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +1 -1
index b0ac610..b0e0471 100644
@@ -550,7 +550,7 @@ static int amdgpu_wb_init(struct amdgpu_device *adev)
  	int r;
 
  	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,
  					    &adev->wb.wb_obj, &adev->wb.gpu_addr,
  					    (void **)&adev->wb.wb);

drivers/gpu/drm/amd/amdgpu/amdgpu_device.c static int amdgpu_wb_init(struct amdgpu_device *adev) · line 570

Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +1 -1
@@ -564,7 +564,7 @@ static int amdgpu_wb_init(struct amdgpu_device *adev)
  		memset(&adev->wb.used, 0, sizeof(adev->wb.used));
 
  		/* 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;

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx