All of lore.kernel.org
 help / color / mirror / Atom feed
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
Cc: David.Mao-5C7GfCeVMHo@public.gmane.org
Subject: Re: [PATCH] amdgpu: add interface for reserve/unserve vmid v2
Date: Wed, 3 May 2017 13:56:46 +0800	[thread overview]
Message-ID: <5909711E.2090709@amd.com> (raw)
In-Reply-To: <1493790281-30264-1-git-send-email-David1.Zhou-5C7GfCeVMHo@public.gmane.org>

On 05/03/2017 01:44 PM, Chunming Zhou wrote:
> v2: delete unused comments.
>
> Change-Id: If533576eb8a65bd019a3480d6fe2a64f23e3c944
> Signed-off-by: Chunming Zhou <David1.Zhou@amd.com>
> Reviewed-by: Monk Liu <monk.liu@amd.com>
Reviewed-by: Junwei Zhang <Jerry.Zhang@amd.com>

> ---
>   amdgpu/amdgpu.h    | 13 +++++++++++++
>   amdgpu/amdgpu_cs.c | 28 ++++++++++++++++++++++++++++
>   2 files changed, 41 insertions(+)
>
> diff --git a/amdgpu/amdgpu.h b/amdgpu/amdgpu.h
> index 4772006..7afade0 100644
> --- a/amdgpu/amdgpu.h
> +++ b/amdgpu/amdgpu.h
> @@ -1626,6 +1626,19 @@ int amdgpu_cs_signal_sem(amdgpu_device_handle dev,
>   			 uint32_t ip_instance,
>   			 uint32_t ring,
>   			 amdgpu_sem_handle sem);
> +/**
> + *  reserve vmid for this process
> + *
> + * \param   dev    - [in] Device handle. See #amdgpu_device_initialize()
> + */
> +int amdgpu_cs_reserved_vmid(amdgpu_device_handle dev);
> +
> +/**
> + *  unreserve vmid for this process
> + *
> + * \param   dev    - [in] Device handle. See #amdgpu_device_initialize()
> + */
> +int amdgpu_cs_unreserved_vmid(amdgpu_device_handle dev);
>
>   /**
>    *  wait sem
> diff --git a/amdgpu/amdgpu_cs.c b/amdgpu/amdgpu_cs.c
> index 62b595a..7717f4e 100644
> --- a/amdgpu/amdgpu_cs.c
> +++ b/amdgpu/amdgpu_cs.c
> @@ -754,3 +754,31 @@ int amdgpu_cs_destroy_sem(amdgpu_device_handle dev,
>
>   	return 0;
>   }
> +
> +int amdgpu_cs_unreserved_vmid(amdgpu_device_handle dev)
> +{
> +	union drm_amdgpu_vm args;
> +	int r;
> +
> +	if (NULL == dev)
> +		return -EINVAL;
> +
> +	memset(&args, 0, sizeof(args));
> +	args.in.op = AMDGPU_VM_OP_UNRESERVE_VMID;
> +	r = drmCommandWriteRead(dev->fd, DRM_AMDGPU_VM, &args, sizeof(args));
> +	return r;
> +}
> +
> +int amdgpu_cs_reserved_vmid(amdgpu_device_handle dev)
> +{
> +	union drm_amdgpu_vm args;
> +	int r;
> +
> +	if (NULL == dev)
> +		return -EINVAL;
> +
> +	memset(&args, 0, sizeof(args));
> +	args.in.op = AMDGPU_VM_OP_RESERVE_VMID;
> +	r = drmCommandWriteRead(dev->fd, DRM_AMDGPU_VM, &args, sizeof(args));
> +	return r;
> +}
>
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

      parent reply	other threads:[~2017-05-03  5:56 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-03  5:44 [PATCH] amdgpu: add interface for reserve/unserve vmid v2 Chunming Zhou
     [not found] ` <1493790281-30264-1-git-send-email-David1.Zhou-5C7GfCeVMHo@public.gmane.org>
2017-05-03  5:56   ` Zhang, Jerry (Junwei) [this message]

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=5909711E.2090709@amd.com \
    --to=jerry.zhang-5c7gfcevmho@public.gmane.org \
    --cc=David.Mao-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.