All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Liu, Monk" <Monk.Liu-5C7GfCeVMHo@public.gmane.org>
To: "Christian König"
	<deathsimple-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>,
	"amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org"
	<amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org>
Subject: 答复: [PATCH 2/7] drm/amdgpu:new field members for SRIOV
Date: Tue, 10 Jan 2017 03:05:54 +0000	[thread overview]
Message-ID: <BY2PR1201MB1110963B2DE72B2892D4AC1F84670@BY2PR1201MB1110.namprd12.prod.outlook.com> (raw)
In-Reply-To: <9f6b9ab8-3bb1-7a57-75d9-70d23d5dd74b-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>


[-- Attachment #1.1: Type: text/plain, Size: 3162 bytes --]


> +};
> +
> +struct amdgpu_vm_virt {
> +     /* each VM will map on CSA */
> +     struct ttm_validate_buffer csa_tv;
> +     struct amdgpu_bo_va *csa_bo_va;

Please put that directly into the amdgpu_vm structure.



[ML] they are not a tiny used by bare-metal case so I don't think they should be put into common structure at all.

see we have "struct amdgpu_virt" in "struct amdgpu_device", the same style


BR Monk

________________________________
发件人: Christian König <deathsimple@vodafone.de>
发送时间: 2017年1月9日 18:57:06
收件人: Liu, Monk; amd-gfx@lists.freedesktop.org
主题: Re: [PATCH 2/7] drm/amdgpu:new field members for SRIOV

Am 09.01.2017 um 09:02 schrieb Monk Liu:
> Change-Id: Ife0eff7b13b8b5946f005a39f6ecb8db1cb72c38
> Signed-off-by: Monk Liu <Monk.Liu@amd.com>
> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_virt.h | 19 +++++++++++++++++++
>   drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h   |  2 ++
>   2 files changed, 21 insertions(+)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.h
> index 0d821d9..5aa7f0c 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.h
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.h
> @@ -28,9 +28,28 @@
>   #define AMDGPU_SRIOV_CAPS_ENABLE_IOV   (1 << 1) /* sr-iov is enabled on this GPU */
>   #define AMDGPU_SRIOV_CAPS_IS_VF        (1 << 2) /* this GPU is a virtual function */
>   #define AMDGPU_PASSTHROUGH_MODE        (1 << 3) /* thw whole GPU is pass through for VM */
> +
> +struct amdgpu_vm;
>   /* GPU virtualization */
>   struct amdgpu_virt {
>        uint32_t caps;
> +     uint32_t csa_size;
> +     struct amdgpu_bo *csa_obj;
> +     uint64_t csa_vmid0_addr;
> +     uint64_t gds_vmid0_addr;
> +     int (*allocate_csa)(struct amdgpu_device *adev);
> +     void (*deallocate_csa)(struct amdgpu_device *adev);
> +     int (*map_csa)(struct amdgpu_device *adev, struct amdgpu_vm *vm);
> +     void (*unmap_csa)(struct amdgpu_device *adev, struct amdgpu_vm *vm);

Why callbacks for this?

> +};
> +
> +struct amdgpu_vm_virt {
> +     /* each VM will map on CSA */
> +     struct ttm_validate_buffer csa_tv;
> +     struct amdgpu_bo_va *csa_bo_va;

Please put that directly into the amdgpu_vm structure.

> +     /* virtual MC address of CSA & GDS for each VM */
> +     uint64_t vm_csa_addr;
> +     uint64_t vm_gds_addr;

That should be constant, shouldn't it?

Regards,
Christian.

>   };
>
>   #define amdgpu_sriov_enabled(adev) \
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h
> index 42a629b..27cbcbc 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h
> @@ -29,6 +29,7 @@
>   #include "gpu_scheduler.h"
>   #include "amdgpu_sync.h"
>   #include "amdgpu_ring.h"
> +#include "amdgpu_virt.h"
>
>   struct amdgpu_bo_va;
>   struct amdgpu_job;
> @@ -111,6 +112,7 @@ struct amdgpu_vm {
>
>        /* client id */
>        u64                     client_id;
> +     struct amdgpu_vm_virt   vm_virt;
>   };
>
>   struct amdgpu_vm_id {



[-- Attachment #1.2: Type: text/html, Size: 5960 bytes --]

[-- Attachment #2: Type: text/plain, Size: 154 bytes --]

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

  parent reply	other threads:[~2017-01-10  3:05 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-09  8:02 [PATCH 0/7] static CSA for SRIOV serials Monk Liu
     [not found] ` <1483948982-27056-1-git-send-email-Monk.Liu-5C7GfCeVMHo@public.gmane.org>
2017-01-09  8:02   ` [PATCH 1/7] drm/amdgpu:add new file for SRIOV Monk Liu
     [not found]     ` <1483948982-27056-2-git-send-email-Monk.Liu-5C7GfCeVMHo@public.gmane.org>
2017-01-09 10:57       ` Christian König
2017-01-09  8:02   ` [PATCH 2/7] drm/amdgpu:new field members " Monk Liu
     [not found]     ` <1483948982-27056-3-git-send-email-Monk.Liu-5C7GfCeVMHo@public.gmane.org>
2017-01-09 10:57       ` Christian König
     [not found]         ` <9f6b9ab8-3bb1-7a57-75d9-70d23d5dd74b-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
2017-01-10  3:03           ` 答复: " Liu, Monk
     [not found]             ` <BY2PR1201MB11106E7ABC5FF87AF1F6F67A84670-O28G1zQ8oGliQkyLPkmea2rFom/aUZj6nBOFsp37pqbUKgpGm//BTAC/G2K4zDHf@public.gmane.org>
2017-01-10  9:51               ` Christian König
     [not found]                 ` <aec66a0f-0fd7-1e02-f160-999fc76de4a6-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
2017-01-10  9:57                   ` 答复: " Liu, Monk
     [not found]                     ` <BY2PR1201MB1110F2B6E7FB093F369ACA2884670-O28G1zQ8oGliQkyLPkmea2rFom/aUZj6nBOFsp37pqbUKgpGm//BTAC/G2K4zDHf@public.gmane.org>
2017-01-10 12:25                       ` Christian König
2017-01-10  3:05           ` Liu, Monk [this message]
     [not found]             ` <BY2PR1201MB1110963B2DE72B2892D4AC1F84670-O28G1zQ8oGliQkyLPkmea2rFom/aUZj6nBOFsp37pqbUKgpGm//BTAC/G2K4zDHf@public.gmane.org>
2017-01-10  9:48               ` Christian König
2017-01-09  8:02   ` [PATCH 3/7] drm/amdgpu:impl static CSA alloc/dealloc Monk Liu
     [not found]     ` <1483948982-27056-4-git-send-email-Monk.Liu-5C7GfCeVMHo@public.gmane.org>
2017-01-09 10:59       ` Christian König
2017-01-09  8:02   ` [PATCH 4/7] drm/amdgpu:impl static CSA map/unmap routines Monk Liu
     [not found]     ` <1483948982-27056-5-git-send-email-Monk.Liu-5C7GfCeVMHo@public.gmane.org>
2017-01-09 11:01       ` Christian König
2017-01-09  8:03   ` [PATCH 5/7] drm/amdgpu:set static csa function Monk Liu
     [not found]     ` <1483948982-27056-6-git-send-email-Monk.Liu-5C7GfCeVMHo@public.gmane.org>
2017-01-09 11:02       ` Christian König
2017-01-09  8:03   ` [PATCH 6/7] drm/amdgpu:alloc/dealloc csa accordingly Monk Liu
     [not found]     ` <1483948982-27056-7-git-send-email-Monk.Liu-5C7GfCeVMHo@public.gmane.org>
2017-01-10  7:56       ` Nils Wallménius
     [not found]         ` <CA+nq7DuCviSbC7ty46j7YqYM83c5=oZF19eAfZLT1_ehYNqu+A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-01-10  9:59           ` 答复: " Liu, Monk
2017-01-09  8:03   ` [PATCH 7/7] drm/amdgpu:map/unmap static " Monk Liu
     [not found]     ` <1483948982-27056-8-git-send-email-Monk.Liu-5C7GfCeVMHo@public.gmane.org>
2017-01-09 11:04       ` Christian König
     [not found]         ` <4f78e5dd-f7e8-0976-5abf-305e0b793ba1-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
2017-01-10  2:40           ` 答复: " Liu, Monk
     [not found]             ` <BY2PR1201MB11108A5E8A3EF7F10C0392AE84670-O28G1zQ8oGliQkyLPkmea2rFom/aUZj6nBOFsp37pqbUKgpGm//BTAC/G2K4zDHf@public.gmane.org>
2017-01-10  9:44               ` Christian König
     [not found]                 ` <cd95519f-f45b-6865-0fab-e75a970a48b0-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
2017-01-10  9:53                   ` 答复: " Liu, Monk
     [not found]                     ` <BY2PR1201MB1110632E66A596FA820250E584670-O28G1zQ8oGliQkyLPkmea2rFom/aUZj6nBOFsp37pqbUKgpGm//BTAC/G2K4zDHf@public.gmane.org>
2017-01-10 12:19                       ` Christian König

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=BY2PR1201MB1110963B2DE72B2892D4AC1F84670@BY2PR1201MB1110.namprd12.prod.outlook.com \
    --to=monk.liu-5c7gfcevmho@public.gmane.org \
    --cc=amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    --cc=deathsimple-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.