From: "Zhang, Jerry (Junwei)" <Jerry.Zhang-5C7GfCeVMHo@public.gmane.org>
To: Chunming Zhou <David1.Zhou-5C7GfCeVMHo@public.gmane.org>,
amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Subject: Re: [PATCH 1/6] drm/amdgpu: add vm ioctl
Date: Wed, 26 Apr 2017 15:09:25 +0800 [thread overview]
Message-ID: <590047A5.1070807@amd.com> (raw)
In-Reply-To: <1493013460-13344-2-git-send-email-David1.Zhou-5C7GfCeVMHo@public.gmane.org>
On 04/24/2017 01:57 PM, Chunming Zhou wrote:
> It will be used for reserving vmid.
>
> Change-Id: Ib7169ea999690c8e82d0dcbccdd2d97760c0270a
> Signed-off-by: Chunming Zhou <David1.Zhou@amd.com>
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 1 +
> drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 16 ++++++++++++++++
> drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h | 1 +
> include/uapi/drm/amdgpu_drm.h | 20 ++++++++++++++++++++
> 4 files changed, 38 insertions(+)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
> index cad589a..7004e6c 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
> @@ -1051,6 +1051,7 @@ int amdgpu_get_vblank_timestamp_kms(struct drm_device *dev, unsigned int pipe,
> const struct drm_ioctl_desc amdgpu_ioctls_kms[] = {
> DRM_IOCTL_DEF_DRV(AMDGPU_GEM_CREATE, amdgpu_gem_create_ioctl, DRM_AUTH|DRM_RENDER_ALLOW),
> DRM_IOCTL_DEF_DRV(AMDGPU_CTX, amdgpu_ctx_ioctl, DRM_AUTH|DRM_RENDER_ALLOW),
> + DRM_IOCTL_DEF_DRV(AMDGPU_VM, amdgpu_vm_ioctl, DRM_AUTH|DRM_RENDER_ALLOW),
> DRM_IOCTL_DEF_DRV(AMDGPU_BO_LIST, amdgpu_bo_list_ioctl, DRM_AUTH|DRM_RENDER_ALLOW),
> /* KMS */
> DRM_IOCTL_DEF_DRV(AMDGPU_GEM_MMAP, amdgpu_gem_mmap_ioctl, DRM_AUTH|DRM_RENDER_ALLOW),
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> index f804d38..eb429c5 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> @@ -2358,3 +2358,19 @@ void amdgpu_vm_manager_fini(struct amdgpu_device *adev)
> }
> }
> }
> +
> +int amdgpu_vm_ioctl(struct drm_device *dev, void *data, struct drm_file *filp)
> +{
> + union drm_amdgpu_vm *args = data;
> + struct amdgpu_device *adev = dev->dev_private;
> + struct amdgpu_fpriv *fpriv = filp->driver_priv;
> +
> + switch (args->in.op) {
> + case AMDGPU_VM_OP_RESERVE_VMID:
How do you think to add an op to release the reserved vmid as well?
Jerry
> + break;
> + default:
> + return -EINVAL;
> + }
> +
> + return 0;
> +}
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h
> index 0f547c6..62dbace 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h
> @@ -247,5 +247,6 @@ int amdgpu_vm_bo_clear_mappings(struct amdgpu_device *adev,
> void amdgpu_vm_bo_rmv(struct amdgpu_device *adev,
> struct amdgpu_bo_va *bo_va);
> void amdgpu_vm_adjust_size(struct amdgpu_device *adev, uint64_t vm_size);
> +int amdgpu_vm_ioctl(struct drm_device *dev, void *data, struct drm_file *filp);
>
> #endif
> diff --git a/include/uapi/drm/amdgpu_drm.h b/include/uapi/drm/amdgpu_drm.h
> index 56b7a2f3..5ee639b 100644
> --- a/include/uapi/drm/amdgpu_drm.h
> +++ b/include/uapi/drm/amdgpu_drm.h
> @@ -51,6 +51,7 @@
> #define DRM_AMDGPU_GEM_OP 0x10
> #define DRM_AMDGPU_GEM_USERPTR 0x11
> #define DRM_AMDGPU_WAIT_FENCES 0x12
> +#define DRM_AMDGPU_VM 0x13
>
> /* hybrid specific ioctls */
> #define DRM_AMDGPU_SEM 0x5b
> @@ -71,6 +72,7 @@
> #define DRM_IOCTL_AMDGPU_GEM_OP DRM_IOWR(DRM_COMMAND_BASE + DRM_AMDGPU_GEM_OP, struct drm_amdgpu_gem_op)
> #define DRM_IOCTL_AMDGPU_GEM_USERPTR DRM_IOWR(DRM_COMMAND_BASE + DRM_AMDGPU_GEM_USERPTR, struct drm_amdgpu_gem_userptr)
> #define DRM_IOCTL_AMDGPU_WAIT_FENCES DRM_IOWR(DRM_COMMAND_BASE + DRM_AMDGPU_WAIT_FENCES, union drm_amdgpu_wait_fences)
> +#define DRM_IOCTL_AMDGPU_VM DRM_IOWR(DRM_COMMAND_BASE + DRM_AMDGPU_VM, union drm_amdgpu_vm)
>
> /* hybrid specific ioctls */
> #define DRM_IOCTL_AMDGPU_GEM_DGMA DRM_IOWR(DRM_COMMAND_BASE + DRM_AMDGPU_GEM_DGMA, struct drm_amdgpu_gem_dgma)
> @@ -212,6 +214,24 @@ struct drm_amdgpu_ctx_in {
> union drm_amdgpu_ctx_out out;
> };
>
> +/* vm ioctl */
> +#define AMDGPU_VM_OP_RESERVE_VMID 1
> +struct drm_amdgpu_vm_in {
> + /** AMDGPU_VM_OP_* */
> + __u32 op;
> + __u32 flags;
> +};
> +
> +struct drm_amdgpu_vm_out {
> + /** For future use, no flags defined so far */
> + __u64 flags;
> +};
> +
> +union drm_amdgpu_vm {
> + struct drm_amdgpu_vm_in in;
> + struct drm_amdgpu_vm_out out;
> +};
> +
> /* sem related */
> #define AMDGPU_SEM_OP_CREATE_SEM 1
> #define AMDGPU_SEM_OP_WAIT_SEM 2
>
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
next prev parent reply other threads:[~2017-04-26 7:09 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-24 5:57 [PATCH 0/6] *** Dedicated vmid per process v2 *** Chunming Zhou
[not found] ` <1493013460-13344-1-git-send-email-David1.Zhou-5C7GfCeVMHo@public.gmane.org>
2017-04-24 5:57 ` [PATCH 1/6] drm/amdgpu: add vm ioctl Chunming Zhou
[not found] ` <1493013460-13344-2-git-send-email-David1.Zhou-5C7GfCeVMHo@public.gmane.org>
2017-04-26 7:09 ` Zhang, Jerry (Junwei) [this message]
[not found] ` <590047A5.1070807-5C7GfCeVMHo@public.gmane.org>
2017-04-26 8:47 ` Christian König
2017-04-24 5:57 ` [PATCH 2/6] drm/amdgpu: add dedicated vmid field in vm struct Chunming Zhou
[not found] ` <1493013460-13344-3-git-send-email-David1.Zhou-5C7GfCeVMHo@public.gmane.org>
2017-04-26 7:09 ` Zhang, Jerry (Junwei)
[not found] ` <590047B3.7050109-5C7GfCeVMHo@public.gmane.org>
2017-04-26 8:49 ` Christian König
[not found] ` <291734a9-5306-f3e3-219c-c53cbf433358-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
2017-04-26 9:05 ` zhoucm1
[not found] ` <590062C5.6020402-5C7GfCeVMHo@public.gmane.org>
2017-04-26 9:10 ` Christian König
[not found] ` <05c4fcec-9dae-24ac-4a5d-26e0fd5bc148-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
2017-04-26 9:14 ` zhoucm1
[not found] ` <59006508.7080907-5C7GfCeVMHo@public.gmane.org>
2017-04-26 9:45 ` Christian König
[not found] ` <f41de8f1-11d9-a727-c34f-d218b08f9047-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
2017-04-26 9:46 ` zhoucm1
2017-04-24 5:57 ` [PATCH 3/6] drm/amdgpu: reserve vmid by vm ioctl Chunming Zhou
[not found] ` <1493013460-13344-4-git-send-email-David1.Zhou-5C7GfCeVMHo@public.gmane.org>
2017-04-26 7:09 ` Zhang, Jerry (Junwei)
[not found] ` <590047C6.50005-5C7GfCeVMHo@public.gmane.org>
2017-04-26 8:51 ` Christian König
[not found] ` <238b3d86-743a-4ca9-c008-92ae4e1ec79c-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
2017-04-26 9:04 ` Zhang, Jerry (Junwei)
[not found] ` <5900629A.20701-5C7GfCeVMHo@public.gmane.org>
2017-04-26 9:08 ` Christian König
2017-04-24 5:57 ` [PATCH 4/6] drm/amdgpu: add limitation for dedicated vm number v2 Chunming Zhou
[not found] ` <1493013460-13344-5-git-send-email-David1.Zhou-5C7GfCeVMHo@public.gmane.org>
2017-04-26 7:10 ` Zhang, Jerry (Junwei)
[not found] ` <590047D0.7080901-5C7GfCeVMHo@public.gmane.org>
2017-04-26 8:53 ` Christian König
2017-04-24 5:57 ` [PATCH 5/6] drm/amdgpu: implement grab dedicated vmid V2 Chunming Zhou
2017-04-24 5:57 ` [PATCH 6/6] drm/amdgpu: bump module verion for reserved vmid Chunming Zhou
2017-04-25 9:07 ` [PATCH 0/6] *** Dedicated vmid per process v2 *** zhoucm1
[not found] ` <58FF11E7.6040607-5C7GfCeVMHo@public.gmane.org>
2017-04-25 10:02 ` Christian König
-- strict thread matches above, loose matches on Subject: below --
2017-04-26 11:10 [PATCH 0/6 v3] *** Dedicated vmid per process v3 *** Chunming Zhou
[not found] ` <1493205039-3721-1-git-send-email-David1.Zhou-5C7GfCeVMHo@public.gmane.org>
2017-04-26 11:10 ` [PATCH 1/6] drm/amdgpu: add vm ioctl Chunming Zhou
2017-04-27 5:00 [PATCH 0/6 v4] *** Dedicated vmid per process v4 *** Chunming Zhou
[not found] ` <1493269238-26742-1-git-send-email-David1.Zhou-5C7GfCeVMHo@public.gmane.org>
2017-04-27 5:00 ` [PATCH 1/6] drm/amdgpu: add vm ioctl Chunming Zhou
2017-04-27 13:09 [PATCH 0/6 v5] *** Dedicated vmid per process v5 *** Chunming Zhou
[not found] ` <1493298597-28517-1-git-send-email-David1.Zhou-5C7GfCeVMHo@public.gmane.org>
2017-04-27 13:09 ` [PATCH 1/6] drm/amdgpu: add vm ioctl Chunming Zhou
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=590047A5.1070807@amd.com \
--to=jerry.zhang-5c7gfcevmho@public.gmane.org \
--cc=David1.Zhou-5C7GfCeVMHo@public.gmane.org \
--cc=amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@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.