[PATCH 2/3] drm/amdgpu: add gtt print like vram when dump mm table

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

 



Am 19.04.2017 um 05:50 schrieb Chunming Zhou:
> Change-Id: If0474e24e14d237d2d55731871c5ceb11e5a3601
> Signed-off-by: Chunming Zhou <David1.Zhou at amd.com>

One nit pick below.

> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c | 7 +++++++
>   drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c     | 4 ++++
>   2 files changed, 11 insertions(+)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c
> index 8a950a5..85de145 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c
> @@ -138,6 +138,13 @@ int amdgpu_gtt_mgr_alloc(struct ttm_mem_type_manager *man,
>   	return r;
>   }
>   
> +void amdgpu_gtt_mgr_print(struct seq_file *m, struct ttm_mem_type_manager *man)
> +{
> +	struct amdgpu_gtt_mgr *mgr = man->priv;
> +
> +	seq_printf(m, "man size:%llu pages, gtt available:%llu pages\n",
> +		   man->size,	mgr->available);
> +}
>   /**
>    * amdgpu_gtt_mgr_new - allocate a new node
>    *
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> index c3112b6..688056e 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> @@ -1540,6 +1540,8 @@ int amdgpu_fill_buffer(struct amdgpu_bo *bo,
>   
>   #if defined(CONFIG_DEBUG_FS)
>   
> +extern void amdgpu_gtt_mgr_print(struct seq_file *m, struct ttm_mem_type_manager
> +				 *man);
>   static int amdgpu_mm_dump_table(struct seq_file *m, void *data)
>   {
>   	struct drm_info_node *node = (struct drm_info_node *)m->private;
> @@ -1558,6 +1560,8 @@ static int amdgpu_mm_dump_table(struct seq_file *m, void *data)
>   			   adev->mman.bdev.man[ttm_pl].size,
>   			   (u64)atomic64_read(&adev->vram_usage) >> 20,
>   			   (u64)atomic64_read(&adev->vram_vis_usage) >> 20);
> +	if (ttm_pl == TTM_PL_TT)
> +		amdgpu_gtt_mgr_print(m, &adev->mman.bdev.man[ttm_pl]);

We should probably use a switch/case statement here instead of open 
coding it with an if.

With that fixed the patch is Reviewed-by: Christian König 
<christian.koenig at amd.com>.

Regards,
Christian.

>   	return ret;
>   }
>   




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

  Powered by Linux