[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <fc8d0548-1352-40b3-85cd-271cb9c9bf47@amd.com>
Date: Fri, 30 Jan 2026 13:49:31 +0100
From: Christian König <christian.koenig@....com>
To: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@....com>,
Alex Deucher <alexander.deucher@....com>, David Airlie <airlied@...il.com>,
Simona Vetter <simona@...ll.ch>
Cc: amd-gfx@...ts.freedesktop.org, dri-devel@...ts.freedesktop.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v7 04/12] drm/amdgpu: add amdgpu_gtt_node_to_byte_offset
helper
On 1/29/26 16:33, Pierre-Eric Pelloux-Prayer wrote:
> Having a helper avoids code duplication.
>
> Signed-off-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@....com>
Reviewed-by: Christian König <christian.koenig@....com>
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.h | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.h
> index 871388b86503..c43f352df953 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.h
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.h
> @@ -220,6 +220,14 @@ static inline u64 amdgpu_compute_gart_address(struct amdgpu_gmc *gmc,
> return gmc->gart_start + entity->gart_window_offs[index];
> }
>
> +/**
> + * amdgpu_gtt_node_to_byte_offset() - Returns a byte offset of a gtt node
> + */
> +static inline u64 amdgpu_gtt_node_to_byte_offset(const struct drm_mm_node *gtt_node)
> +{
> + return gtt_node->start * (u64)PAGE_SIZE;
> +}
> +
> void amdgpu_ttm_tt_set_user_pages(struct ttm_tt *ttm, struct amdgpu_hmm_range *range);
> int amdgpu_ttm_tt_get_userptr(const struct ttm_buffer_object *tbo,
> uint64_t *user_addr);
Powered by blists - more mailing lists