amd-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Alex Deucher <alexdeucher@gmail.com>
To: "Christian König" <ckoenig.leichtzumerken@gmail.com>
Cc: "Christian König" <christian.koenig@amd.com>,
	"amd-gfx list" <amd-gfx@lists.freedesktop.org>,
	Arunpravin <arunpravin.paneerselvam@amd.com>
Subject: Re: [PATCH 2/2] drm/amdgpu: move internal vram_mgr function into the C file
Date: Tue, 10 May 2022 10:39:31 -0400	[thread overview]
Message-ID: <CADnq5_MQZJ1MjQvYHE1j_jrHd4yyjgzOi3zfXE1Mbe8+TO1D2Q@mail.gmail.com> (raw)
In-Reply-To: <20220510113649.879821-2-christian.koenig@amd.com>

On Tue, May 10, 2022 at 7:36 AM Christian König
<ckoenig.leichtzumerken@gmail.com> wrote:
>
> No need to have those in the header.
>
> Signed-off-by: Christian König <christian.koenig@amd.com>

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>

> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c | 29 ++++++++++++++++++++
>  drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.h | 27 ------------------
>  2 files changed, 29 insertions(+), 27 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c
> index 51d9d3a4456c..7a5e8a7b4a1b 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c
> @@ -50,6 +50,35 @@ to_amdgpu_device(struct amdgpu_vram_mgr *mgr)
>         return container_of(mgr, struct amdgpu_device, mman.vram_mgr);
>  }
>
> +static inline struct drm_buddy_block *
> +amdgpu_vram_mgr_first_block(struct list_head *list)
> +{
> +       return list_first_entry_or_null(list, struct drm_buddy_block, link);
> +}
> +
> +static inline bool amdgpu_is_vram_mgr_blocks_contiguous(struct list_head *head)
> +{
> +       struct drm_buddy_block *block;
> +       u64 start, size;
> +
> +       block = amdgpu_vram_mgr_first_block(head);
> +       if (!block)
> +               return false;
> +
> +       while (head != block->link.next) {
> +               start = amdgpu_vram_mgr_block_start(block);
> +               size = amdgpu_vram_mgr_block_size(block);
> +
> +               block = list_entry(block->link.next, struct drm_buddy_block, link);
> +               if (start + size != amdgpu_vram_mgr_block_start(block))
> +                       return false;
> +       }
> +
> +       return true;
> +}
> +
> +
> +
>  /**
>   * DOC: mem_info_vram_total
>   *
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.h
> index 9a2db87186c7..4b267bf1c5db 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.h
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.h
> @@ -53,33 +53,6 @@ static inline u64 amdgpu_vram_mgr_block_size(struct drm_buddy_block *block)
>         return PAGE_SIZE << drm_buddy_block_order(block);
>  }
>
> -static inline struct drm_buddy_block *
> -amdgpu_vram_mgr_first_block(struct list_head *list)
> -{
> -       return list_first_entry_or_null(list, struct drm_buddy_block, link);
> -}
> -
> -static inline bool amdgpu_is_vram_mgr_blocks_contiguous(struct list_head *head)
> -{
> -       struct drm_buddy_block *block;
> -       u64 start, size;
> -
> -       block = amdgpu_vram_mgr_first_block(head);
> -       if (!block)
> -               return false;
> -
> -       while (head != block->link.next) {
> -               start = amdgpu_vram_mgr_block_start(block);
> -               size = amdgpu_vram_mgr_block_size(block);
> -
> -               block = list_entry(block->link.next, struct drm_buddy_block, link);
> -               if (start + size != amdgpu_vram_mgr_block_start(block))
> -                       return false;
> -       }
> -
> -       return true;
> -}
> -
>  static inline struct amdgpu_vram_mgr_resource *
>  to_amdgpu_vram_mgr_resource(struct ttm_resource *res)
>  {
> --
> 2.25.1
>

  reply	other threads:[~2022-05-10 14:39 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-10 11:36 [PATCH 1/2] drm/amdgpu: fix start calculation in amdgpu_vram_mgr_new Christian König
2022-05-10 11:36 ` [PATCH 2/2] drm/amdgpu: move internal vram_mgr function into the C file Christian König
2022-05-10 14:39   ` Alex Deucher [this message]
2022-05-10 15:35   ` Arunpravin Paneer Selvam
2022-05-10 14:42 ` [PATCH 1/2] drm/amdgpu: fix start calculation in amdgpu_vram_mgr_new Alex Deucher
2022-05-10 15:08   ` Christian König
2022-05-10 15:12     ` Alex Deucher
2022-05-10 15:20 ` Arunpravin Paneer Selvam
2022-05-10 15:26   ` Christian König
2022-05-10 15:40     ` Arunpravin Paneer Selvam

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=CADnq5_MQZJ1MjQvYHE1j_jrHd4yyjgzOi3zfXE1Mbe8+TO1D2Q@mail.gmail.com \
    --to=alexdeucher@gmail.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=arunpravin.paneerselvam@amd.com \
    --cc=christian.koenig@amd.com \
    --cc=ckoenig.leichtzumerken@gmail.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;
as well as URLs for NNTP newsgroup(s).