public inbox for amd-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: "Christian König" <ckoenig.leichtzumerken-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: "Lin, Amber" <Amber.Lin-5C7GfCeVMHo@public.gmane.org>,
	"amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org"
	<amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org>
Subject: Re: [PATCH 1/3] drm/amdgpu: Relocate kgd2kfd function declaration
Date: Wed, 2 Jan 2019 14:36:05 +0100	[thread overview]
Message-ID: <d0e70155-bae3-daeb-b5df-d6a328bb3fcb@gmail.com> (raw)
In-Reply-To: <1544800921-15780-1-git-send-email-Amber.Lin-5C7GfCeVMHo@public.gmane.org>

Am 14.12.18 um 16:22 schrieb Lin, Amber:
> Since amdkfd is merged into amdgpu module and amdgpu can access amdkfd
> directly, move declaration of kgd2kfd functions from kfd_priv.h to
> amdgpu_amdkfd.h
>
> Signed-off-by: Amber Lin <Amber.Lin@amd.com>

Yes, please. If it's not committed yet Acked-by: Christian König 
<christian.koenig@amd.com> for the series.

> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c       | 43 ++++++++++++++++++++++++
>   drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h       | 20 ++++++++++-
>   drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_fence.c |  1 +
>   drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c |  2 ++
>   drivers/gpu/drm/amd/amdkfd/kfd_module.c          |  2 +-
>   drivers/gpu/drm/amd/amdkfd/kfd_priv.h            | 22 ------------
>   drivers/gpu/drm/amd/include/kgd_kfd_interface.h  |  3 --
>   7 files changed, 66 insertions(+), 27 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c
> index 2dfaf15..358f690 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c
> @@ -619,4 +619,47 @@ struct kfd2kgd_calls *amdgpu_amdkfd_gfx_9_0_get_functions(void)
>   {
>   	return NULL;
>   }
> +
> +struct kfd_dev *kgd2kfd_probe(struct kgd_dev *kgd, struct pci_dev *pdev,
> +			      const struct kfd2kgd_calls *f2g)
> +{
> +	return NULL;
> +}
> +
> +bool kgd2kfd_device_init(struct kfd_dev *kfd,
> +			 const struct kgd2kfd_shared_resources *gpu_resources)
> +{
> +	return false;
> +}
> +
> +void kgd2kfd_device_exit(struct kfd_dev *kfd)
> +{
> +}
> +
> +void kgd2kfd_exit(void)
> +{
> +}
> +
> +void kgd2kfd_suspend(struct kfd_dev *kfd)
> +{
> +}
> +
> +int kgd2kfd_resume(struct kfd_dev *kfd)
> +{
> +	return 0;
> +}
> +
> +int kgd2kfd_pre_reset(struct kfd_dev *kfd)
> +{
> +	return 0;
> +}
> +
> +int kgd2kfd_post_reset(struct kfd_dev *kfd)
> +{
> +	return 0;
> +}
> +
> +void kgd2kfd_interrupt(struct kfd_dev *kfd, const void *ih_ring_entry)
> +{
> +}
>   #endif
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h
> index 70429f7..3214d31 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h
> @@ -33,7 +33,6 @@
>   #include "amdgpu_sync.h"
>   #include "amdgpu_vm.h"
>   
> -extern const struct kgd2kfd_calls *kgd2kfd;
>   extern uint64_t amdgpu_amdkfd_total_mem_size;
>   
>   struct amdgpu_device;
> @@ -214,4 +213,23 @@ int amdgpu_amdkfd_gpuvm_import_dmabuf(struct kgd_dev *kgd,
>   void amdgpu_amdkfd_gpuvm_init_mem_limits(void);
>   void amdgpu_amdkfd_unreserve_memory_limit(struct amdgpu_bo *bo);
>   
> +/* KGD2KFD callbacks */
> +int kgd2kfd_init(unsigned interface_version,
> +		 const struct kgd2kfd_calls **g2f);
> +void kgd2kfd_exit(void);
> +struct kfd_dev *kgd2kfd_probe(struct kgd_dev *kgd, struct pci_dev *pdev,
> +			      const struct kfd2kgd_calls *f2g);
> +bool kgd2kfd_device_init(struct kfd_dev *kfd,
> +			 const struct kgd2kfd_shared_resources *gpu_resources);
> +void kgd2kfd_device_exit(struct kfd_dev *kfd);
> +void kgd2kfd_suspend(struct kfd_dev *kfd);
> +int kgd2kfd_resume(struct kfd_dev *kfd);
> +int kgd2kfd_pre_reset(struct kfd_dev *kfd);
> +int kgd2kfd_post_reset(struct kfd_dev *kfd);
> +void kgd2kfd_interrupt(struct kfd_dev *kfd, const void *ih_ring_entry);
> +int kgd2kfd_quiesce_mm(struct mm_struct *mm);
> +int kgd2kfd_resume_mm(struct mm_struct *mm);
> +int kgd2kfd_schedule_evict_and_restore_process(struct mm_struct *mm,
> +					       struct dma_fence *fence);
> +
>   #endif /* AMDGPU_AMDKFD_H_INCLUDED */
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_fence.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_fence.c
> index 574c118..3c7055e 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_fence.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_fence.c
> @@ -31,6 +31,7 @@
>   
>   static const struct dma_fence_ops amdkfd_fence_ops;
>   static atomic_t fence_seq = ATOMIC_INIT(0);
> +extern const struct kgd2kfd_calls *kgd2kfd;
>   
>   /* Eviction Fence
>    * Fence helper functions to deal with KFD memory eviction.
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
> index be1ab43..3fc2618 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
> @@ -44,6 +44,8 @@
>    */
>   #define AMDGPU_USERPTR_RESTORE_DELAY_MS 1
>   
> +extern const struct kgd2kfd_calls *kgd2kfd;
> +
>   /* Impose limit on how much memory KFD can use */
>   static struct {
>   	uint64_t max_system_mem_limit;
> diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_module.c b/drivers/gpu/drm/amd/amdkfd/kfd_module.c
> index 8018163..030b39d 100644
> --- a/drivers/gpu/drm/amd/amdkfd/kfd_module.c
> +++ b/drivers/gpu/drm/amd/amdkfd/kfd_module.c
> @@ -23,6 +23,7 @@
>   #include <linux/sched.h>
>   #include <linux/device.h>
>   #include "kfd_priv.h"
> +#include "amdgpu_amdkfd.h"
>   
>   static const struct kgd2kfd_calls kgd2kfd = {
>   	.exit		= kgd2kfd_exit,
> @@ -104,7 +105,6 @@ int kgd2kfd_init(unsigned int interface_version,
>   
>   	return 0;
>   }
> -EXPORT_SYMBOL(kgd2kfd_init);
>   
>   void kgd2kfd_exit(void)
>   {
> diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_priv.h b/drivers/gpu/drm/amd/amdkfd/kfd_priv.h
> index 0689d4c..12b6633 100644
> --- a/drivers/gpu/drm/amd/amdkfd/kfd_priv.h
> +++ b/drivers/gpu/drm/amd/amdkfd/kfd_priv.h
> @@ -266,14 +266,6 @@ struct kfd_dev {
>   	bool pci_atomic_requested;
>   };
>   
> -/* KGD2KFD callbacks */
> -void kgd2kfd_exit(void);
> -struct kfd_dev *kgd2kfd_probe(struct kgd_dev *kgd,
> -			struct pci_dev *pdev, const struct kfd2kgd_calls *f2g);
> -bool kgd2kfd_device_init(struct kfd_dev *kfd,
> -			const struct kgd2kfd_shared_resources *gpu_resources);
> -void kgd2kfd_device_exit(struct kfd_dev *kfd);
> -
>   enum kfd_mempool {
>   	KFD_MEMPOOL_SYSTEM_CACHEABLE = 1,
>   	KFD_MEMPOOL_SYSTEM_WRITECOMBINE = 2,
> @@ -541,11 +533,6 @@ struct qcm_process_device {
>   /* Approx. time before evicting the process again */
>   #define PROCESS_ACTIVE_TIME_MS 10
>   
> -int kgd2kfd_quiesce_mm(struct mm_struct *mm);
> -int kgd2kfd_resume_mm(struct mm_struct *mm);
> -int kgd2kfd_schedule_evict_and_restore_process(struct mm_struct *mm,
> -					       struct dma_fence *fence);
> -
>   /* 8 byte handle containing GPU ID in the most significant 4 bytes and
>    * idr_handle in the least significant 4 bytes
>    */
> @@ -800,20 +787,11 @@ int kfd_numa_node_to_apic_id(int numa_node_id);
>   /* Interrupts */
>   int kfd_interrupt_init(struct kfd_dev *dev);
>   void kfd_interrupt_exit(struct kfd_dev *dev);
> -void kgd2kfd_interrupt(struct kfd_dev *kfd, const void *ih_ring_entry);
>   bool enqueue_ih_ring_entry(struct kfd_dev *kfd,	const void *ih_ring_entry);
>   bool interrupt_is_wanted(struct kfd_dev *dev,
>   				const uint32_t *ih_ring_entry,
>   				uint32_t *patched_ihre, bool *flag);
>   
> -/* Power Management */
> -void kgd2kfd_suspend(struct kfd_dev *kfd);
> -int kgd2kfd_resume(struct kfd_dev *kfd);
> -
> -/* GPU reset */
> -int kgd2kfd_pre_reset(struct kfd_dev *kfd);
> -int kgd2kfd_post_reset(struct kfd_dev *kfd);
> -
>   /* amdkfd Apertures */
>   int kfd_init_apertures(struct kfd_process *process);
>   
> diff --git a/drivers/gpu/drm/amd/include/kgd_kfd_interface.h b/drivers/gpu/drm/amd/include/kgd_kfd_interface.h
> index 8154d67..3d5c3b0 100644
> --- a/drivers/gpu/drm/amd/include/kgd_kfd_interface.h
> +++ b/drivers/gpu/drm/amd/include/kgd_kfd_interface.h
> @@ -379,7 +379,4 @@ struct kgd2kfd_calls {
>   	int  (*post_reset)(struct kfd_dev *kfd);
>   };
>   
> -int kgd2kfd_init(unsigned interface_version,
> -		const struct kgd2kfd_calls **g2f);
> -
>   #endif	/* KGD_KFD_INTERFACE_H_INCLUDED */

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

      parent reply	other threads:[~2019-01-02 13:36 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-14 15:22 [PATCH 1/3] drm/amdgpu: Relocate kgd2kfd function declaration Lin, Amber
     [not found] ` <1544800921-15780-1-git-send-email-Amber.Lin-5C7GfCeVMHo@public.gmane.org>
2018-12-14 15:22   ` [PATCH 2/3] drm/amdgpu: Simply kgd2kfd interface Lin, Amber
2018-12-14 15:22   ` [PATCH 3/3] drm/amdgpu: Remove kgd2kfd function pointers Lin, Amber
2018-12-14 21:21   ` [PATCH 1/3] drm/amdgpu: Relocate kgd2kfd function declaration Kuehling, Felix
2019-01-02 13:36   ` Christian König [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=d0e70155-bae3-daeb-b5df-d6a328bb3fcb@gmail.com \
    --to=ckoenig.leichtzumerken-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=Amber.Lin-5C7GfCeVMHo@public.gmane.org \
    --cc=amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    --cc=christian.koenig-5C7GfCeVMHo@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox