[RFC 02/29] drm/xe: Make xe_svm_alloc_vram public
Ghimiray, Himal Prasad
himal.prasad.ghimiray at intel.com
Fri Mar 28 07:51:32 UTC 2025
On 28-03-2025 04:15, Matthew Brost wrote:
> On Fri, Mar 14, 2025 at 01:31:59PM +0530, Himal Prasad Ghimiray wrote:
>> This function will be used in prefetch too, hence make it public.
>>
>> Signed-off-by: Himal Prasad Ghimiray <himal.prasad.ghimiray at intel.com>
>> ---
>> drivers/gpu/drm/xe/xe_svm.c | 6 +++---
>> drivers/gpu/drm/xe/xe_svm.h | 13 +++++++++++++
>> 2 files changed, 16 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/xe/xe_svm.c b/drivers/gpu/drm/xe/xe_svm.c
>> index 516898e99b26..2d2b385b691e 100644
>> --- a/drivers/gpu/drm/xe/xe_svm.c
>> +++ b/drivers/gpu/drm/xe/xe_svm.c
>> @@ -655,9 +655,9 @@ static struct xe_vram_region *tile_to_vr(struct xe_tile *tile)
>> return &tile->mem.vram;
>> }
>>
>> -static int xe_svm_alloc_vram(struct xe_vm *vm, struct xe_tile *tile,
>> - struct xe_svm_range *range,
>> - const struct drm_gpusvm_ctx *ctx)
>
> All public functions need kernel doc. Patch LGTM though.
>
> Matt
Sure will add. Thanks
>
>> +int xe_svm_alloc_vram(struct xe_vm *vm, struct xe_tile *tile,
>> + struct xe_svm_range *range,
>> + const struct drm_gpusvm_ctx *ctx)
>> {
>> struct mm_struct *mm = vm->svm.gpusvm.mm;
>> struct xe_vram_region *vr = tile_to_vr(tile);
>> diff --git a/drivers/gpu/drm/xe/xe_svm.h b/drivers/gpu/drm/xe/xe_svm.h
>> index e059590e5076..976059545173 100644
>> --- a/drivers/gpu/drm/xe/xe_svm.h
>> +++ b/drivers/gpu/drm/xe/xe_svm.h
>> @@ -72,6 +72,10 @@ bool xe_svm_has_mapping(struct xe_vm *vm, u64 start, u64 end);
>> int xe_svm_bo_evict(struct xe_bo *bo);
>>
>> void xe_svm_range_debug(struct xe_svm_range *range, const char *operation);
>> +
>> +int xe_svm_alloc_vram(struct xe_vm *vm, struct xe_tile *tile,
>> + struct xe_svm_range *range,
>> + const struct drm_gpusvm_ctx *ctx);
>> #else
>> static inline bool xe_svm_range_pages_valid(struct xe_svm_range *range)
>> {
>> @@ -124,6 +128,15 @@ static inline
>> void xe_svm_range_debug(struct xe_svm_range *range, const char *operation)
>> {
>> }
>> +
>> +static inline
>> +int xe_svm_alloc_vram(struct xe_vm *vm, struct xe_tile *tile,
>> + struct xe_svm_range *range,
>> + const struct drm_gpusvm_ctx *ctx)
>> +{
>> + return 0;
>> +}
>> +
>> #endif
>>
>> /**
>> --
>> 2.34.1
>>
More information about the Intel-xe
mailing list