AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Christian König" <christian.koenig@amd.com>
To: Shashank Sharma <shashank.sharma@amd.com>, amd-gfx@lists.freedesktop.org
Cc: alexander.deucher@amd.com
Subject: Re: [PATCH 10/13] drm/amdgpu: doorbell support in get_memory functions
Date: Mon, 6 Feb 2023 17:30:23 +0100	[thread overview]
Message-ID: <423becc1-5bdd-a50c-16b7-cffb66cb833f@amd.com> (raw)
In-Reply-To: <20230203190836.1987-13-shashank.sharma@amd.com>

Am 03.02.23 um 20:08 schrieb Shashank Sharma:
> From: Alex Deucher <alexander.deucher@amd.com>
>
> This patch adds section for doorbell memory in memory status
> reporting functions like vm/bo_get_memory.

Marek reworked this just recently to pass around a structure. You should 
probably rebase the code when that patch lands.

Apart from that looks good to me.

Christian.

>
> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
> Signed-off-by: Shashank Sharma <shashank.sharma@amd.com>
> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_fdinfo.c |  4 ++--
>   drivers/gpu/drm/amd/amdgpu/amdgpu_object.c |  9 ++++++++-
>   drivers/gpu/drm/amd/amdgpu/amdgpu_object.h |  3 ++-
>   drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c     | 15 ++++++++-------
>   drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h     |  3 ++-
>   5 files changed, 22 insertions(+), 12 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_fdinfo.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_fdinfo.c
> index 99a7855ab1bc..202df09ba5de 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_fdinfo.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_fdinfo.c
> @@ -60,7 +60,7 @@ void amdgpu_show_fdinfo(struct seq_file *m, struct file *f)
>   	struct amdgpu_fpriv *fpriv = file->driver_priv;
>   	struct amdgpu_vm *vm = &fpriv->vm;
>   
> -	uint64_t vram_mem = 0, gtt_mem = 0, cpu_mem = 0;
> +	uint64_t vram_mem = 0, gtt_mem = 0, cpu_mem = 0, doorbell_mem = 0;
>   	ktime_t usage[AMDGPU_HW_IP_NUM];
>   	uint32_t bus, dev, fn, domain;
>   	unsigned int hw_ip;
> @@ -75,7 +75,7 @@ void amdgpu_show_fdinfo(struct seq_file *m, struct file *f)
>   	if (ret)
>   		return;
>   
> -	amdgpu_vm_get_memory(vm, &vram_mem, &gtt_mem, &cpu_mem);
> +	amdgpu_vm_get_memory(vm, &vram_mem, &gtt_mem, &cpu_mem, &doorbell_mem);
>   	amdgpu_bo_unreserve(vm->root.bo);
>   
>   	amdgpu_ctx_mgr_usage(&fpriv->ctx_mgr, usage);
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
> index b2cfd46c459b..ef1f3106bc69 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
> @@ -1288,7 +1288,8 @@ void amdgpu_bo_move_notify(struct ttm_buffer_object *bo,
>   }
>   
>   void amdgpu_bo_get_memory(struct amdgpu_bo *bo, uint64_t *vram_mem,
> -				uint64_t *gtt_mem, uint64_t *cpu_mem)
> +			  uint64_t *gtt_mem, uint64_t *cpu_mem,
> +			  uint64_t *doorbell_mem)
>   {
>   	unsigned int domain;
>   
> @@ -1300,6 +1301,9 @@ void amdgpu_bo_get_memory(struct amdgpu_bo *bo, uint64_t *vram_mem,
>   	case AMDGPU_GEM_DOMAIN_GTT:
>   		*gtt_mem += amdgpu_bo_size(bo);
>   		break;
> +	case AMDGPU_GEM_DOMAIN_DOORBELL:
> +		*doorbell_mem += amdgpu_bo_size(bo);
> +		break;
>   	case AMDGPU_GEM_DOMAIN_CPU:
>   	default:
>   		*cpu_mem += amdgpu_bo_size(bo);
> @@ -1578,6 +1582,9 @@ u64 amdgpu_bo_print_info(int id, struct amdgpu_bo *bo, struct seq_file *m)
>   	case AMDGPU_GEM_DOMAIN_GTT:
>   		placement = " GTT";
>   		break;
> +	case AMDGPU_GEM_DOMAIN_DOORBELL:
> +		placement = "DOOR";
> +		break;
>   	case AMDGPU_GEM_DOMAIN_CPU:
>   	default:
>   		placement = " CPU";
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.h
> index 082f451d26f4..bf9759758f0d 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.h
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.h
> @@ -326,7 +326,8 @@ int amdgpu_bo_sync_wait(struct amdgpu_bo *bo, void *owner, bool intr);
>   u64 amdgpu_bo_gpu_offset(struct amdgpu_bo *bo);
>   u64 amdgpu_bo_gpu_offset_no_check(struct amdgpu_bo *bo);
>   void amdgpu_bo_get_memory(struct amdgpu_bo *bo, uint64_t *vram_mem,
> -			  uint64_t *gtt_mem, uint64_t *cpu_mem);
> +			  uint64_t *gtt_mem, uint64_t *cpu_mem,
> +			  uint64_t *doorbell_mem);
>   void amdgpu_bo_add_to_shadow_list(struct amdgpu_bo_vm *vmbo);
>   int amdgpu_bo_restore_shadow(struct amdgpu_bo *shadow,
>   			     struct dma_fence **fence);
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> index dc379dc22c77..1561d138945b 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> @@ -918,7 +918,8 @@ int amdgpu_vm_update_range(struct amdgpu_device *adev, struct amdgpu_vm *vm,
>   }
>   
>   void amdgpu_vm_get_memory(struct amdgpu_vm *vm, uint64_t *vram_mem,
> -				uint64_t *gtt_mem, uint64_t *cpu_mem)
> +			  uint64_t *gtt_mem, uint64_t *cpu_mem,
> +			  uint64_t *doorbell_mem)
>   {
>   	struct amdgpu_bo_va *bo_va, *tmp;
>   
> @@ -927,37 +928,37 @@ void amdgpu_vm_get_memory(struct amdgpu_vm *vm, uint64_t *vram_mem,
>   		if (!bo_va->base.bo)
>   			continue;
>   		amdgpu_bo_get_memory(bo_va->base.bo, vram_mem,
> -				gtt_mem, cpu_mem);
> +				     gtt_mem, cpu_mem, doorbell_mem);
>   	}
>   	list_for_each_entry_safe(bo_va, tmp, &vm->evicted, base.vm_status) {
>   		if (!bo_va->base.bo)
>   			continue;
>   		amdgpu_bo_get_memory(bo_va->base.bo, vram_mem,
> -				gtt_mem, cpu_mem);
> +				     gtt_mem, cpu_mem, doorbell_mem);
>   	}
>   	list_for_each_entry_safe(bo_va, tmp, &vm->relocated, base.vm_status) {
>   		if (!bo_va->base.bo)
>   			continue;
>   		amdgpu_bo_get_memory(bo_va->base.bo, vram_mem,
> -				gtt_mem, cpu_mem);
> +				     gtt_mem, cpu_mem, doorbell_mem);
>   	}
>   	list_for_each_entry_safe(bo_va, tmp, &vm->moved, base.vm_status) {
>   		if (!bo_va->base.bo)
>   			continue;
>   		amdgpu_bo_get_memory(bo_va->base.bo, vram_mem,
> -				gtt_mem, cpu_mem);
> +				     gtt_mem, cpu_mem, doorbell_mem);
>   	}
>   	list_for_each_entry_safe(bo_va, tmp, &vm->invalidated, base.vm_status) {
>   		if (!bo_va->base.bo)
>   			continue;
>   		amdgpu_bo_get_memory(bo_va->base.bo, vram_mem,
> -				gtt_mem, cpu_mem);
> +				     gtt_mem, cpu_mem, doorbell_mem);
>   	}
>   	list_for_each_entry_safe(bo_va, tmp, &vm->done, base.vm_status) {
>   		if (!bo_va->base.bo)
>   			continue;
>   		amdgpu_bo_get_memory(bo_va->base.bo, vram_mem,
> -				gtt_mem, cpu_mem);
> +				     gtt_mem, cpu_mem, doorbell_mem);
>   	}
>   	spin_unlock(&vm->status_lock);
>   }
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h
> index 094bb4807303..b8ac7d311c8b 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h
> @@ -458,7 +458,8 @@ void amdgpu_vm_set_task_info(struct amdgpu_vm *vm);
>   void amdgpu_vm_move_to_lru_tail(struct amdgpu_device *adev,
>   				struct amdgpu_vm *vm);
>   void amdgpu_vm_get_memory(struct amdgpu_vm *vm, uint64_t *vram_mem,
> -				uint64_t *gtt_mem, uint64_t *cpu_mem);
> +			  uint64_t *gtt_mem, uint64_t *cpu_mem,
> +			  uint64_t *doorbell_mem);
>   
>   int amdgpu_vm_pt_clear(struct amdgpu_device *adev, struct amdgpu_vm *vm,
>   		       struct amdgpu_bo_vm *vmbo, bool immediate);


  reply	other threads:[~2023-02-06 16:30 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-03 19:08 [PATCH 00/13] Re-design doorbell framework for usermode queues Shashank Sharma
2023-02-03 19:08 ` [PATCH 01/13] drm/amdgpu: add UAPI for allocating doorbell memory Shashank Sharma
2023-02-06 11:19   ` Christian König
2023-02-06 15:31     ` Shashank Sharma
2023-02-03 19:08 ` [PATCH 02/13] drm/amdgpu: rename vram_mgr functions to bar_mgr Shashank Sharma
2023-02-06 11:20   ` Christian König
2023-02-06 15:34     ` Shashank Sharma
2023-02-06 16:03       ` Christian König
2023-02-06 16:17     ` Alex Deucher
2023-02-03 19:08 ` [PATCH 03/13] drm/amdgpu: rename amdgpu_vram_mgr.c/h to amdgpu_bar_mgr.c/h Shashank Sharma
2023-02-03 19:08 ` [PATCH 04/13] drm/amdgpu: replace aper_base_kaddr with vram_aper_base_kaddr Shashank Sharma
2023-02-06 11:21   ` Christian König
2023-02-03 19:08 ` [PATCH 05/13] drm/amdgpu: add doorbell support to amdgpu_bar_mgr Shashank Sharma
2023-02-03 19:08 ` [PATCH 06/13] drm/amdgpu: rename gmc.aper_base/size Shashank Sharma
2023-02-06 11:22   ` Christian König
2023-02-03 19:08 ` [PATCH 07/13] drm/amdgpu: store doorbell info in gmc structure Shashank Sharma
2023-02-06 11:23   ` Christian König
2023-02-03 19:08 ` [PATCH 08/13] drm/amdgpu: move doorbell ptr into mman structure Shashank Sharma
2023-02-06 11:24   ` Christian König
2023-02-03 19:08 ` [PATCH 09/13] drm/amdgpu: accommodate DOMAIN/PL_DOORBELL Shashank Sharma
2023-02-06 11:30   ` Christian König
2023-02-06 16:30     ` Alex Deucher
2023-02-03 19:08 ` [PATCH 09/14] drm/amdgpu: move doorbell aperture handling into ttm_init Shashank Sharma
2023-02-06 16:20   ` Christian König
2023-02-03 19:08 ` [PATCH 10/14] drm/amdgpu: accommodate DOMAIN/PL_DOORBELL Shashank Sharma
2023-02-03 19:08 ` [PATCH 10/13] drm/amdgpu: doorbell support in get_memory functions Shashank Sharma
2023-02-06 16:30   ` Christian König [this message]
2023-02-03 19:08 ` [PATCH 11/14] " Shashank Sharma
2023-02-03 19:08 ` [PATCH 11/13] drm/amdgpu: initialize doorbell memory pool Shashank Sharma
2023-02-03 19:08 ` [PATCH 12/13] drm/amdgpu: add domain info in bo_create_kernel_at Shashank Sharma
2023-02-06 16:51   ` Christian König
2023-02-06 17:01     ` Alex Deucher
2023-02-06 17:03       ` Christian König
2023-02-03 19:08 ` [PATCH 12/14] drm/amdgpu: initialize doorbell memory pool Shashank Sharma
2023-02-06 16:54   ` Christian König
2023-02-03 19:08 ` [PATCH 13/14] drm/amdgpu: add domain info in bo_create_kernel_at Shashank Sharma
2023-02-03 19:08 ` [PATCH 13/13] drm/amdgpu: introduce doorbell bo in kernel Shashank Sharma
2023-02-03 19:08 ` [PATCH 14/14] " Shashank Sharma
2023-02-06 16:57   ` Christian König
2023-02-06 17:19     ` Shashank Sharma

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=423becc1-5bdd-a50c-16b7-cffb66cb833f@amd.com \
    --to=christian.koenig@amd.com \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=shashank.sharma@amd.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox