[PATCH] drm/amdgpu: fix the clearing wb size

Christian König deathsimple at vodafone.de
Wed Mar 15 09:53:07 UTC 2017


Am 15.03.2017 um 08:30 schrieb Huang Rui:
> The clearing wb size should be the one that it is assigned.
>
> Signed-off-by: Huang Rui <ray.huang at amd.com>

Reviewed-by: Christian König <christian.koenig at amd.com>

> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> index b0ac610..b0e0471 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> @@ -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;




More information about the amd-gfx mailing list