Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm/amdgpu: add amdgpu_gtt_node_to_byte_offset helper

Having a helper avoids code duplication.

Signed-off-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Pierre-Eric Pelloux-Prayer and committed by
Alex Deucher
866eedef 2e885302

+8
+8
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.h
··· 220 220 return gmc->gart_start + entity->gart_window_offs[index]; 221 221 } 222 222 223 + /** 224 + * amdgpu_gtt_node_to_byte_offset() - Returns a byte offset of a gtt node 225 + */ 226 + static inline u64 amdgpu_gtt_node_to_byte_offset(const struct drm_mm_node *gtt_node) 227 + { 228 + return gtt_node->start * (u64)PAGE_SIZE; 229 + } 230 + 223 231 void amdgpu_ttm_tt_set_user_pages(struct ttm_tt *ttm, struct amdgpu_hmm_range *range); 224 232 int amdgpu_ttm_tt_get_userptr(const struct ttm_buffer_object *tbo, 225 233 uint64_t *user_addr);