[PATCH 2/3] drm/amdgpu: fix amdgpu_debugfs_gem_bo_info

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> -----Original Message-----
> From: amd-gfx [mailto:amd-gfx-bounces at lists.freedesktop.org] On Behalf
> Of Christian König
> Sent: Monday, June 26, 2017 9:40 AM
> To: amd-gfx at lists.freedesktop.org
> Cc: john at fastquake.com; Kuehling, Felix
> Subject: [PATCH 2/3] drm/amdgpu: fix amdgpu_debugfs_gem_bo_info
> 
> From: Christian König <christian.koenig at amd.com>
> 
> Otherwise we trigger a bunch of WARN_ONs when this is called.
> 
> Signed-off-by: Christian König <christian.koenig at amd.com>

Reviewed-by: Alex Deucher <alexander.deucher at amd.com>

> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | 10 +++++++---
>  1 file changed, 7 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
> index 621f739..96c4493 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
> @@ -784,6 +784,7 @@ static int amdgpu_debugfs_gem_bo_info(int id, void
> *ptr, void *data)
>  	unsigned domain;
>  	const char *placement;
>  	unsigned pin_count;
> +	uint64_t offset;
> 
>  	domain = amdgpu_mem_type_to_domain(bo-
> >tbo.mem.mem_type);
>  	switch (domain) {
> @@ -798,9 +799,12 @@ static int amdgpu_debugfs_gem_bo_info(int id, void
> *ptr, void *data)
>  		placement = " CPU";
>  		break;
>  	}
> -	seq_printf(m, "\t0x%08x: %12ld byte %s @ 0x%010Lx",
> -		   id, amdgpu_bo_size(bo), placement,
> -		   amdgpu_bo_gpu_offset(bo));
> +	seq_printf(m, "\t0x%08x: %12ld byte %s",
> +		   id, amdgpu_bo_size(bo), placement);
> +
> +	offset = ACCESS_ONCE(bo->tbo.mem.start);
> +	if (offset != AMDGPU_BO_INVALID_OFFSET)
> +		seq_printf(m, " @ 0x%010Lx", offset);
> 
>  	pin_count = ACCESS_ONCE(bo->pin_count);
>  	if (pin_count)
> --
> 2.7.4
> 
> _______________________________________________
> amd-gfx mailing list
> amd-gfx at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx


[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux