[PATCH 1/3] drm/amdgpu:new field members for SRIOV
Liu, Monk
Monk.Liu at amd.com
Wed Jan 11 14:49:03 UTC 2017
>Similar to the GDS address inside the VMs I think the code actually using it should calculate it from the BO address.
[ML] do you mean If some where want to use vmid0_gds_address I should just use vmid0_csa_addr + 4096 ?
>The validate buffer is only temporarily used during mapping the CSA into the VM.
So please put that one the stack in that function.
[ML] okay
Can I get your RB after above two place modified in patch ?
BR Monk
-----Original Message-----
From: amd-gfx [mailto:amd-gfx-bounces at lists.freedesktop.org] On Behalf Of Christian K?nig
Sent: Wednesday, January 11, 2017 8:46 PM
To: Liu, Monk <Monk.Liu at amd.com>; amd-gfx at lists.freedesktop.org
Subject: Re: [PATCH 1/3] drm/amdgpu:new field members for SRIOV
Am 11.01.2017 um 11:43 schrieb Monk Liu:
> and implement CSA functions in this file
>
> Change-Id: Ife0eff7b13b8b5946f005a39f6ecb8db1cb72c38
> Signed-off-by: Monk Liu <Monk.Liu at amd.com>
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_virt.h | 8 ++++++++
> drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h | 3 +++
> 2 files changed, 11 insertions(+)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.h
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.h
> index 0d821d9..b65bedc 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.h
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.h
> @@ -28,11 +28,19 @@
> #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 */
> +
> /* 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;
Similar to the GDS address inside the VMs I think the code actually using it should calculate it from the BO address.
> };
>
> +#define AMDGPU_CSA_SIZE (8 * 1024)
> +#define AMDGPU_CSA_VADDR (AMDGPU_VA_RESERVED_SIZE - AMDGPU_CSA_SIZE)
> +
> #define amdgpu_sriov_enabled(adev) \
> ((adev)->virt.caps & AMDGPU_SRIOV_CAPS_ENABLE_IOV)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h
> index 42a629b..42f1ec1 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h
> @@ -111,6 +111,9 @@ struct amdgpu_vm {
>
> /* client id */
> u64 client_id;
> + /* each VM will map on CSA */
> + struct ttm_validate_buffer csa_tv;
The validate buffer is only temporarily used during mapping the CSA into the VM.
So please put that one the stack in that function.
Apart from that the patch looks good to me, Christian.
> + struct amdgpu_bo_va *csa_bo_va;
> };
>
> struct amdgpu_vm_id {
_______________________________________________
amd-gfx mailing list
amd-gfx at lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
More information about the amd-gfx
mailing list