mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-23 09:57:08 +03:00
gpu: nvgpu: add ioctl for querying memory state
Add NVGPU_GPU_IOCTL_GET_MEMORY_STATE to read the amount of free device-local video memory, if applicable. Some reserved fields are added to support different types of queries in the future (e.g. context-local free amount). Bug 1787771 Bug 200233138 Change-Id: Id5ffd02ad4d6ed3a6dc196541938573c27b340ac Signed-off-by: Konsta Holtta <kholtta@nvidia.com> Reviewed-on: http://git-master/r/1223762 (cherry picked from commit 96221d96c7972c6387944603e974f7639d6dbe70) Reviewed-on: http://git-master/r/1235980 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
committed by
mobile promotions
parent
4d07572c82
commit
fa6ab1943e
@@ -510,6 +510,18 @@ struct nvgpu_gpu_alloc_vidmem_args {
|
||||
};
|
||||
};
|
||||
|
||||
struct nvgpu_gpu_get_memory_state_args {
|
||||
/*
|
||||
* Current free space for this device; may change even when any
|
||||
* kernel-managed metadata (e.g., page tables or channels) is allocated
|
||||
* or freed. For an idle gpu, an allocation of this size would succeed.
|
||||
*/
|
||||
__u64 total_free_bytes;
|
||||
|
||||
/* For future use; must be set to 0. */
|
||||
__u64 reserved[4];
|
||||
};
|
||||
|
||||
#define NVGPU_GPU_IOCTL_ZCULL_GET_CTX_SIZE \
|
||||
_IOR(NVGPU_GPU_IOCTL_MAGIC, 1, struct nvgpu_gpu_zcull_get_ctx_size_args)
|
||||
#define NVGPU_GPU_IOCTL_ZCULL_GET_INFO \
|
||||
@@ -568,8 +580,11 @@ struct nvgpu_gpu_alloc_vidmem_args {
|
||||
#define NVGPU_GPU_IOCTL_ALLOC_VIDMEM \
|
||||
_IOWR(NVGPU_GPU_IOCTL_MAGIC, 27, \
|
||||
struct nvgpu_gpu_alloc_vidmem_args)
|
||||
#define NVGPU_GPU_IOCTL_GET_MEMORY_STATE \
|
||||
_IOWR(NVGPU_GPU_IOCTL_MAGIC, 33, \
|
||||
struct nvgpu_gpu_get_memory_state_args)
|
||||
#define NVGPU_GPU_IOCTL_LAST \
|
||||
_IOC_NR(NVGPU_GPU_IOCTL_ALLOC_VIDMEM)
|
||||
_IOC_NR(NVGPU_GPU_IOCTL_GET_MEMORY_STATE)
|
||||
#define NVGPU_GPU_IOCTL_MAX_ARG_SIZE \
|
||||
sizeof(struct nvgpu_gpu_get_cpu_time_correlation_info_args)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user