mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-24 10:34:43 +03:00
gpu: nvgpu: support free space query in allocators
Add gk20a_alloc_space() to query the amount of free memory in bytes in gk20a_allocator. Bug 1787771 Bug 200233138 Change-Id: Ia381cafd5d2dbf394072d07be96991974f9289ae Signed-off-by: Konsta Holtta <kholtta@nvidia.com> Reviewed-on: http://git-master/r/1223760 (cherry picked from commit 0c7fd96acc3e3d581bd25ccbe40b0821a310760f) Reviewed-on: http://git-master/r/1235978 GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
This commit is contained in:
committed by
mobile promotions
parent
a4e4466a0c
commit
6fb5481a6b
@@ -59,6 +59,14 @@ u64 gk20a_alloc_end(struct gk20a_allocator *a)
|
||||
return 0;
|
||||
}
|
||||
|
||||
u64 gk20a_alloc_space(struct gk20a_allocator *a)
|
||||
{
|
||||
if (a->ops->space)
|
||||
return a->ops->space(a);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
u64 gk20a_alloc(struct gk20a_allocator *a, u64 len)
|
||||
{
|
||||
return a->ops->alloc(a, len);
|
||||
|
||||
@@ -61,6 +61,7 @@ struct gk20a_allocator_ops {
|
||||
u64 (*length)(struct gk20a_allocator *allocator);
|
||||
u64 (*end)(struct gk20a_allocator *allocator);
|
||||
int (*inited)(struct gk20a_allocator *allocator);
|
||||
u64 (*space)(struct gk20a_allocator *allocator);
|
||||
|
||||
/* Destructor. */
|
||||
void (*fini)(struct gk20a_allocator *allocator);
|
||||
@@ -223,6 +224,7 @@ u64 gk20a_alloc_base(struct gk20a_allocator *a);
|
||||
u64 gk20a_alloc_length(struct gk20a_allocator *a);
|
||||
u64 gk20a_alloc_end(struct gk20a_allocator *a);
|
||||
u64 gk20a_alloc_initialized(struct gk20a_allocator *a);
|
||||
u64 gk20a_alloc_space(struct gk20a_allocator *a);
|
||||
|
||||
void gk20a_alloc_destroy(struct gk20a_allocator *allocator);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user