public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Thomas Hellström" <thomas.hellstrom@linux.intel.com>
To: Danilo Krummrich <dakr@redhat.com>,
	airlied@gmail.com, daniel@ffwll.ch, matthew.brost@intel.com,
	sarah.walker@imgtec.com, donald.robson@imgtec.com,
	boris.brezillon@collabora.com, christian.koenig@amd.com,
	faith@gfxstrand.net
Cc: dri-devel@lists.freedesktop.org, nouveau@lists.freedesktop.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH drm-misc-next v6 2/6] drm/gpuvm: add drm_gpuvm_flags to drm_gpuvm
Date: Fri, 13 Oct 2023 13:43:09 +0200	[thread overview]
Message-ID: <6876d2cddd0a32bb77f2bc5ef206f06107cef8e3.camel@linux.intel.com> (raw)
In-Reply-To: <20231008233212.13815-3-dakr@redhat.com>

On Mon, 2023-10-09 at 01:32 +0200, Danilo Krummrich wrote:
> Introduce flags for struct drm_gpuvm, this required by subsequent
> commits.
> 
> Signed-off-by: Danilo Krummrich <dakr@redhat.com>
> ---
>  drivers/gpu/drm/drm_gpuvm.c            |  4 +++-
>  drivers/gpu/drm/nouveau/nouveau_uvmm.c |  2 +-
>  include/drm/drm_gpuvm.h                | 17 ++++++++++++++++-
>  3 files changed, 20 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/drm_gpuvm.c
> b/drivers/gpu/drm/drm_gpuvm.c
> index ebda9d594165..6368dfdbe9dd 100644
> --- a/drivers/gpu/drm/drm_gpuvm.c
> +++ b/drivers/gpu/drm/drm_gpuvm.c
> @@ -703,6 +703,7 @@ EXPORT_SYMBOL_GPL(drm_gpuvm_root_object_alloc);
>   * @gpuvm: pointer to the &drm_gpuvm to initialize
>   * @r_obj: the root &drm_gem_object providing the GPUVM's common
> &dma_resv
>   * @name: the name of the GPU VA space
> + * @flags: the &drm_gpuvm_flags for this GPUVM

NIT: It looks like kerneldoc guidelines recommends using &enum
drm_gpuvm_flags in new  code

>   * @start_offset: the start offset of the GPU VA space
>   * @range: the size of the GPU VA space
>   * @reserve_offset: the start of the kernel reserved GPU VA area
> @@ -716,7 +717,7 @@ EXPORT_SYMBOL_GPL(drm_gpuvm_root_object_alloc);
>   */
>  void
>  drm_gpuvm_init(struct drm_gpuvm *gpuvm, struct drm_gem_object
> *r_obj,
> -              const char *name,
> +              const char *name, enum drm_gpuvm_flags flags,
>                u64 start_offset, u64 range,
>                u64 reserve_offset, u64 reserve_range,
>                const struct drm_gpuvm_ops *ops)
> @@ -729,6 +730,7 @@ drm_gpuvm_init(struct drm_gpuvm *gpuvm, struct
> drm_gem_object *r_obj,
>         gpuvm->mm_range = range;
>  
>         gpuvm->name = name ? name : "unknown";
> +       gpuvm->flags = flags;
>         gpuvm->ops = ops;
>         gpuvm->r_obj = r_obj;
>  
> diff --git a/drivers/gpu/drm/nouveau/nouveau_uvmm.c
> b/drivers/gpu/drm/nouveau/nouveau_uvmm.c
> index 4dea847ef989..93ad2ba7ec8b 100644
> --- a/drivers/gpu/drm/nouveau/nouveau_uvmm.c
> +++ b/drivers/gpu/drm/nouveau/nouveau_uvmm.c
> @@ -1843,7 +1843,7 @@ nouveau_uvmm_init(struct nouveau_uvmm *uvmm,
> struct nouveau_cli *cli,
>         uvmm->kernel_managed_addr = kernel_managed_addr;
>         uvmm->kernel_managed_size = kernel_managed_size;
>  
> -       drm_gpuvm_init(&uvmm->base, r_obj, cli->name,
> +       drm_gpuvm_init(&uvmm->base, r_obj, cli->name, 0,
>                        NOUVEAU_VA_SPACE_START,
>                        NOUVEAU_VA_SPACE_END,
>                        kernel_managed_addr, kernel_managed_size,
> diff --git a/include/drm/drm_gpuvm.h b/include/drm/drm_gpuvm.h
> index 0aec14d8b259..13539f32c2e2 100644
> --- a/include/drm/drm_gpuvm.h
> +++ b/include/drm/drm_gpuvm.h
> @@ -183,6 +183,16 @@ static inline bool drm_gpuva_invalidated(struct
> drm_gpuva *va)
>         return va->flags & DRM_GPUVA_INVALIDATED;
>  }
>  
> +/**
> + * enum drm_gpuvm_flags - flags for struct drm_gpuvm
> + */
> +enum drm_gpuvm_flags {
> +       /**
> +        * @DRM_GPUVM_USERBITS: user defined bits
> +        */
> +       DRM_GPUVM_USERBITS = (1 << 0),

BIT(0)

> +};
> +
>  /**
>   * struct drm_gpuvm - DRM GPU VA Manager
>   *
> @@ -201,6 +211,11 @@ struct drm_gpuvm {
>          */
>         const char *name;
>  
> +       /**
> +        * @flags: the &drm_gpuvm_flags of this GPUVM
enum?
> +        */
> +       enum drm_gpuvm_flags flags;
> +
>         /**
>          * @mm_start: start of the VA space
>          */
> @@ -246,7 +261,7 @@ struct drm_gpuvm {
>  };
>  
>  void drm_gpuvm_init(struct drm_gpuvm *gpuvm, struct drm_gem_object
> *r_obj,
> -                   const char *name,
> +                   const char *name, enum drm_gpuvm_flags flags,
>                     u64 start_offset, u64 range,
>                     u64 reserve_offset, u64 reserve_range,
>                     const struct drm_gpuvm_ops *ops);

Reviewed-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>


  reply	other threads:[~2023-10-13 11:43 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-08 23:32 [PATCH drm-misc-next v6 0/6] [RFC] DRM GPUVM features Danilo Krummrich
2023-10-08 23:32 ` [PATCH drm-misc-next v6 1/6] drm/gpuvm: add common dma-resv per struct drm_gpuvm Danilo Krummrich
2023-10-13 11:38   ` Thomas Hellström
2023-10-13 11:51     ` Danilo Krummrich
2023-10-13 13:00       ` Thomas Hellström
2023-10-17 13:18         ` Danilo Krummrich
2023-10-08 23:32 ` [PATCH drm-misc-next v6 2/6] drm/gpuvm: add drm_gpuvm_flags to drm_gpuvm Danilo Krummrich
2023-10-13 11:43   ` Thomas Hellström [this message]
2023-10-08 23:32 ` [PATCH drm-misc-next v6 3/6] drm/gpuvm: add an abstraction for a VM / BO combination Danilo Krummrich
2023-10-13 12:30   ` Thomas Hellström
2023-10-17  9:58     ` Danilo Krummrich
2023-10-17 10:54       ` Thomas Hellström
2023-10-13 12:33   ` Thomas Hellström
2023-10-08 23:32 ` [PATCH drm-misc-next v6 4/6] drm/gpuvm: track/lock/validate external/evicted objects Danilo Krummrich
2023-10-09 13:36   ` Thomas Hellström
2023-10-09 14:45     ` Danilo Krummrich
2023-10-09 20:54       ` Danilo Krummrich
2023-10-10  6:26       ` Thomas Hellström
2023-10-13 12:04         ` Danilo Krummrich
2023-10-13 13:02           ` Thomas Hellström
2023-10-10  6:40   ` Thomas Hellström
2023-10-13 12:05     ` Danilo Krummrich
2023-10-13 13:37   ` Thomas Hellström
2023-10-16 10:55     ` Thomas Hellström
2023-10-08 23:32 ` [PATCH drm-misc-next v6 5/6] drm/nouveau: make use of the GPUVM's shared dma-resv Danilo Krummrich
2023-10-08 23:32 ` [PATCH drm-misc-next v6 6/6] drm/nouveau: use GPUVM common infrastructure Danilo Krummrich

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=6876d2cddd0a32bb77f2bc5ef206f06107cef8e3.camel@linux.intel.com \
    --to=thomas.hellstrom@linux.intel.com \
    --cc=airlied@gmail.com \
    --cc=boris.brezillon@collabora.com \
    --cc=christian.koenig@amd.com \
    --cc=dakr@redhat.com \
    --cc=daniel@ffwll.ch \
    --cc=donald.robson@imgtec.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=faith@gfxstrand.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=matthew.brost@intel.com \
    --cc=nouveau@lists.freedesktop.org \
    --cc=sarah.walker@imgtec.com \
    /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